@effect/platform 0.48.17 → 0.48.18
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/README.md +312 -10
- package/dist/dts/Http/Headers.d.ts +1 -1
- package/dist/dts/Http/Headers.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Http/Headers.ts +1 -1
package/README.md
CHANGED
|
@@ -30,13 +30,13 @@ import { Terminal } from "@effect/platform";
|
|
|
30
30
|
import { NodeRuntime, NodeTerminal } from "@effect/platform-node";
|
|
31
31
|
import { Effect } from "effect";
|
|
32
32
|
|
|
33
|
-
// const
|
|
34
|
-
const
|
|
33
|
+
// const displayMessage: Effect.Effect<void, PlatformError, Terminal.Terminal>
|
|
34
|
+
const displayMessage = Effect.gen(function* (_) {
|
|
35
35
|
const terminal = yield* _(Terminal.Terminal);
|
|
36
36
|
yield* _(terminal.display("a message\n"));
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
NodeRuntime.runMain(
|
|
39
|
+
NodeRuntime.runMain(displayMessage.pipe(Effect.provide(NodeTerminal.layer)));
|
|
40
40
|
// Output: "a message"
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -47,14 +47,14 @@ import { Terminal } from "@effect/platform";
|
|
|
47
47
|
import { NodeRuntime, NodeTerminal } from "@effect/platform-node";
|
|
48
48
|
import { Console, Effect } from "effect";
|
|
49
49
|
|
|
50
|
-
// const
|
|
51
|
-
const
|
|
50
|
+
// const readLine: Effect.Effect<void, Terminal.QuitException, Terminal.Terminal>
|
|
51
|
+
const readLine = Effect.gen(function* (_) {
|
|
52
52
|
const terminal = yield* _(Terminal.Terminal);
|
|
53
53
|
const input = yield* _(terminal.readLine);
|
|
54
54
|
yield* _(Console.log(`input: ${input}`));
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
NodeRuntime.runMain(
|
|
57
|
+
NodeRuntime.runMain(readLine.pipe(Effect.provide(NodeTerminal.layer)));
|
|
58
58
|
// Input: "hello"
|
|
59
59
|
// Output: "input: hello"
|
|
60
60
|
```
|
|
@@ -128,7 +128,14 @@ const loop = (
|
|
|
128
128
|
> =>
|
|
129
129
|
Effect.gen(function* (_) {
|
|
130
130
|
const guess = yield* _(answer);
|
|
131
|
-
return yield* _(
|
|
131
|
+
return yield* _(
|
|
132
|
+
check(
|
|
133
|
+
secret,
|
|
134
|
+
guess,
|
|
135
|
+
end,
|
|
136
|
+
Effect.suspend(() => loop(secret))
|
|
137
|
+
)
|
|
138
|
+
);
|
|
132
139
|
});
|
|
133
140
|
|
|
134
141
|
export const game = Effect.gen(function* (_) {
|
|
@@ -240,8 +247,8 @@ import { FileSystem } from "@effect/platform";
|
|
|
240
247
|
import { NodeFileSystem, NodeRuntime } from "@effect/platform-node";
|
|
241
248
|
import { Effect } from "effect";
|
|
242
249
|
|
|
243
|
-
// const
|
|
244
|
-
const
|
|
250
|
+
// const readFileString: Effect.Effect<void, PlatformError, FileSystem.FileSystem>
|
|
251
|
+
const readFileString = Effect.gen(function* (_) {
|
|
245
252
|
const fs = yield* _(FileSystem.FileSystem);
|
|
246
253
|
|
|
247
254
|
// Reading the content of the same file where this code is written
|
|
@@ -249,5 +256,300 @@ const program = Effect.gen(function* (_) {
|
|
|
249
256
|
console.log(content);
|
|
250
257
|
});
|
|
251
258
|
|
|
252
|
-
NodeRuntime.runMain(
|
|
259
|
+
NodeRuntime.runMain(readFileString.pipe(Effect.provide(NodeFileSystem.layer)));
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
# HTTP Client
|
|
263
|
+
|
|
264
|
+
## Retrieving Data (GET)
|
|
265
|
+
|
|
266
|
+
In this section, we'll explore how to retrieve data using the `HttpClient` module from `@effect/platform`.
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
270
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
271
|
+
import { Console, Effect } from "effect";
|
|
272
|
+
|
|
273
|
+
const getPostAsJson = Http.request
|
|
274
|
+
.get("https://jsonplaceholder.typicode.com/posts/1")
|
|
275
|
+
.pipe(Http.client.fetch(), Http.response.json);
|
|
276
|
+
|
|
277
|
+
NodeRuntime.runMain(
|
|
278
|
+
getPostAsJson.pipe(Effect.andThen((post) => Console.log(typeof post, post)))
|
|
279
|
+
);
|
|
280
|
+
/*
|
|
281
|
+
Output:
|
|
282
|
+
object {
|
|
283
|
+
userId: 1,
|
|
284
|
+
id: 1,
|
|
285
|
+
title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
|
|
286
|
+
body: 'quia et suscipit\n' +
|
|
287
|
+
'suscipit recusandae consequuntur expedita et cum\n' +
|
|
288
|
+
'reprehenderit molestiae ut ut quas totam\n' +
|
|
289
|
+
'nostrum rerum est autem sunt rem eveniet architecto'
|
|
290
|
+
}
|
|
291
|
+
*/
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
If you want a response in a different format other than JSON, you can utilize other APIs provided by `Http.response`.
|
|
295
|
+
|
|
296
|
+
In the following example, we fetch the post as text:
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
300
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
301
|
+
import { Console, Effect } from "effect";
|
|
302
|
+
|
|
303
|
+
const getPostAsText = Http.request
|
|
304
|
+
.get("https://jsonplaceholder.typicode.com/posts/1")
|
|
305
|
+
.pipe(Http.client.fetch(), Http.response.text);
|
|
306
|
+
|
|
307
|
+
NodeRuntime.runMain(
|
|
308
|
+
getPostAsText.pipe(Effect.andThen((post) => Console.log(typeof post, post)))
|
|
309
|
+
);
|
|
310
|
+
/*
|
|
311
|
+
Output:
|
|
312
|
+
string {
|
|
313
|
+
userId: 1,
|
|
314
|
+
id: 1,
|
|
315
|
+
title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
|
|
316
|
+
body: 'quia et suscipit\n' +
|
|
317
|
+
'suscipit recusandae consequuntur expedita et cum\n' +
|
|
318
|
+
'reprehenderit molestiae ut ut quas totam\n' +
|
|
319
|
+
'nostrum rerum est autem sunt rem eveniet architecto'
|
|
320
|
+
}
|
|
321
|
+
*/
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Here are some APIs you can use to convert the response:
|
|
325
|
+
|
|
326
|
+
| **API** | **Description** |
|
|
327
|
+
| ----------------------------- | ------------------------------------- |
|
|
328
|
+
| `Http.response.arrayBuffer` | Convert to `ArrayBuffer` |
|
|
329
|
+
| `Http.response.formData` | Convert to `FormData` |
|
|
330
|
+
| `Http.response.json` | Convert to JSON |
|
|
331
|
+
| `Http.response.stream` | Convert to a `Stream` of `Uint8Array` |
|
|
332
|
+
| `Http.response.text` | Convert to text |
|
|
333
|
+
| `Http.response.urlParamsBody` | Convert to `Http.urlParams.UrlParams` |
|
|
334
|
+
|
|
335
|
+
### Setting Headers
|
|
336
|
+
|
|
337
|
+
When making HTTP requests, sometimes you need to include additional information in the request headers. You can set headers using the `setHeader` function for a single header or `setHeaders` for multiple headers simultaneously.
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
341
|
+
|
|
342
|
+
const getPost = Http.request
|
|
343
|
+
.get("https://jsonplaceholder.typicode.com/posts/1")
|
|
344
|
+
.pipe(
|
|
345
|
+
// Setting a single header
|
|
346
|
+
Http.request.setHeader("Content-type", "application/json; charset=UTF-8"),
|
|
347
|
+
// Setting multiple headers
|
|
348
|
+
Http.request.setHeaders({
|
|
349
|
+
"Content-type": "application/json; charset=UTF-8",
|
|
350
|
+
Foo: "Bar",
|
|
351
|
+
}),
|
|
352
|
+
Http.client.fetch()
|
|
353
|
+
);
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Decoding Data with Schemas
|
|
357
|
+
|
|
358
|
+
A common use case when fetching data is to validate the received format. For this purpose, the `HttpClient` module is integrated with `@effect/schema`.
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
362
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
363
|
+
import { Schema } from "@effect/schema";
|
|
364
|
+
import { Console, Effect } from "effect";
|
|
365
|
+
|
|
366
|
+
const Post = Schema.struct({
|
|
367
|
+
id: Schema.number,
|
|
368
|
+
title: Schema.string,
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
/*
|
|
372
|
+
const getPostAndValidate: Effect.Effect<{
|
|
373
|
+
readonly id: number;
|
|
374
|
+
readonly title: string;
|
|
375
|
+
}, Http.error.HttpClientError | ParseError, never>
|
|
376
|
+
*/
|
|
377
|
+
const getPostAndValidate = Http.request
|
|
378
|
+
.get("https://jsonplaceholder.typicode.com/posts/1")
|
|
379
|
+
.pipe(
|
|
380
|
+
Http.client.fetch(),
|
|
381
|
+
Effect.andThen(Http.response.schemaBodyJson(Post)),
|
|
382
|
+
Effect.scoped
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
NodeRuntime.runMain(getPostAndValidate.pipe(Effect.andThen(Console.log)));
|
|
386
|
+
/*
|
|
387
|
+
Output:
|
|
388
|
+
{
|
|
389
|
+
id: 1,
|
|
390
|
+
title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit'
|
|
391
|
+
}
|
|
392
|
+
*/
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
In this example, we define a schema for a post object with properties `id` and `title`. Then, we fetch the data and validate it against this schema using `Http.response.schemaBodyJson`. Finally, we log the validated post object.
|
|
396
|
+
|
|
397
|
+
Note that we use `Effect.scoped` after consuming the response. This ensures that any resources associated with the HTTP request are properly cleaned up once we're done processing the response.
|
|
398
|
+
|
|
399
|
+
### Filtering And Error Handling
|
|
400
|
+
|
|
401
|
+
It's important to note that `Http.client.fetch` doesn't consider non-`200` status codes as errors by default. This design choice allows for flexibility in handling different response scenarios. For instance, you might have a schema union where the status code serves as the discriminator, enabling you to define a schema that encompasses all possible response cases.
|
|
402
|
+
|
|
403
|
+
You can use `Http.client.filterStatusOk`, or `Http.client.fetchOk` to ensure only `2xx` responses are treated as successes.
|
|
404
|
+
|
|
405
|
+
In this example, we attempt to fetch a non-existent page and don't receive any error:
|
|
406
|
+
|
|
407
|
+
```ts
|
|
408
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
409
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
410
|
+
import { Console, Effect } from "effect";
|
|
411
|
+
|
|
412
|
+
const getText = Http.request
|
|
413
|
+
.get("https://jsonplaceholder.typicode.com/non-existing-page")
|
|
414
|
+
.pipe(Http.client.fetch(), Http.response.text);
|
|
415
|
+
|
|
416
|
+
NodeRuntime.runMain(getText.pipe(Effect.andThen(Console.log)));
|
|
417
|
+
/*
|
|
418
|
+
Output:
|
|
419
|
+
{}
|
|
420
|
+
*/
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
However, if we use `Http.client.filterStatusOk`, an error is logged:
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
427
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
428
|
+
import { Console, Effect } from "effect";
|
|
429
|
+
|
|
430
|
+
const getText = Http.request
|
|
431
|
+
.get("https://jsonplaceholder.typicode.com/non-existing-page")
|
|
432
|
+
.pipe(Http.client.filterStatusOk(Http.client.fetch()), Http.response.text);
|
|
433
|
+
|
|
434
|
+
NodeRuntime.runMain(getText.pipe(Effect.andThen(Console.log)));
|
|
435
|
+
/*
|
|
436
|
+
Output:
|
|
437
|
+
timestamp=2024-03-25T10:21:16.972Z level=ERROR fiber=#0 cause="ResponseError: StatusCode error (404 GET https://jsonplaceholder.typicode.com/non-existing-page): non 2xx status code
|
|
438
|
+
*/
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
Note that you can use `Http.client.fetchOk` as a shortcut for `Http.client.filterStatusOk(Http.client.fetch())`:
|
|
442
|
+
|
|
443
|
+
```ts
|
|
444
|
+
const getText = Http.request
|
|
445
|
+
.get("https://jsonplaceholder.typicode.com/non-existing-page")
|
|
446
|
+
.pipe(Http.client.fetchOk(), Http.response.text);
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
You can also create your own status-based filters. In fact, `Http.client.filterStatusOk` is just a shortcut for the following filter:
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
const getText = Http.request
|
|
453
|
+
.get("https://jsonplaceholder.typicode.com/non-existing-page")
|
|
454
|
+
.pipe(
|
|
455
|
+
Http.client.filterStatus(
|
|
456
|
+
Http.client.fetch(),
|
|
457
|
+
(status) => status >= 200 && status < 300
|
|
458
|
+
),
|
|
459
|
+
Http.response.text
|
|
460
|
+
);
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
## POST
|
|
464
|
+
|
|
465
|
+
To make a POST request, you can use the `Http.request.post` function provided by the `HttpClient` module. Here's an example of how to create and send a POST request:
|
|
466
|
+
|
|
467
|
+
```ts
|
|
468
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
469
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
470
|
+
import { Console, Effect } from "effect";
|
|
471
|
+
|
|
472
|
+
const addPost = Http.request
|
|
473
|
+
.post("https://jsonplaceholder.typicode.com/posts")
|
|
474
|
+
.pipe(
|
|
475
|
+
Http.request.jsonBody({
|
|
476
|
+
title: "foo",
|
|
477
|
+
body: "bar",
|
|
478
|
+
userId: 1,
|
|
479
|
+
}),
|
|
480
|
+
Effect.andThen(Http.client.fetch()),
|
|
481
|
+
Http.response.json
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
NodeRuntime.runMain(addPost.pipe(Effect.andThen(Console.log)));
|
|
485
|
+
/*
|
|
486
|
+
Output:
|
|
487
|
+
{ title: 'foo', body: 'bar', userId: 1, id: 101 }
|
|
488
|
+
*/
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
If you need to send data in a format other than JSON, such as plain text, you can use different APIs provided by `Http.request`.
|
|
492
|
+
|
|
493
|
+
In the following example, we send the data as text:
|
|
494
|
+
|
|
495
|
+
```ts
|
|
496
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
497
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
498
|
+
import { Console, Effect } from "effect";
|
|
499
|
+
|
|
500
|
+
const addPost = Http.request
|
|
501
|
+
.post("https://jsonplaceholder.typicode.com/posts")
|
|
502
|
+
.pipe(
|
|
503
|
+
Http.request.textBody(
|
|
504
|
+
JSON.stringify({
|
|
505
|
+
title: "foo",
|
|
506
|
+
body: "bar",
|
|
507
|
+
userId: 1,
|
|
508
|
+
}),
|
|
509
|
+
"application/json; charset=UTF-8"
|
|
510
|
+
),
|
|
511
|
+
Http.client.fetch(),
|
|
512
|
+
Http.response.json
|
|
513
|
+
);
|
|
514
|
+
|
|
515
|
+
NodeRuntime.runMain(Effect.andThen(addPost, Console.log));
|
|
516
|
+
/*
|
|
517
|
+
Output:
|
|
518
|
+
{ title: 'foo', body: 'bar', userId: 1, id: 101 }
|
|
519
|
+
*/
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Decoding Data with Schemas
|
|
523
|
+
|
|
524
|
+
A common use case when fetching data is to validate the received format. For this purpose, the `HttpClient` module is integrated with `@effect/schema`.
|
|
525
|
+
|
|
526
|
+
```ts
|
|
527
|
+
import { NodeRuntime } from "@effect/platform-node";
|
|
528
|
+
import * as Http from "@effect/platform/HttpClient";
|
|
529
|
+
import { Schema } from "@effect/schema";
|
|
530
|
+
import { Console, Effect } from "effect";
|
|
531
|
+
|
|
532
|
+
const Post = Schema.struct({
|
|
533
|
+
id: Schema.number,
|
|
534
|
+
title: Schema.string,
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
const addPost = Http.request
|
|
538
|
+
.post("https://jsonplaceholder.typicode.com/posts")
|
|
539
|
+
.pipe(
|
|
540
|
+
Http.request.jsonBody({
|
|
541
|
+
title: "foo",
|
|
542
|
+
body: "bar",
|
|
543
|
+
userId: 1,
|
|
544
|
+
}),
|
|
545
|
+
Effect.andThen(Http.client.fetch()),
|
|
546
|
+
Effect.andThen(Http.response.schemaBodyJson(Post)),
|
|
547
|
+
Effect.scoped
|
|
548
|
+
);
|
|
549
|
+
|
|
550
|
+
NodeRuntime.runMain(addPost.pipe(Effect.andThen(Console.log)));
|
|
551
|
+
/*
|
|
552
|
+
Output:
|
|
553
|
+
{ id: 101, title: 'foo' }
|
|
554
|
+
*/
|
|
253
555
|
```
|
|
@@ -42,7 +42,7 @@ export declare const schema: Schema.Schema<Headers, ReadonlyRecord.ReadonlyRecor
|
|
|
42
42
|
* @since 1.0.0
|
|
43
43
|
* @category models
|
|
44
44
|
*/
|
|
45
|
-
export type Input = ReadonlyRecord.ReadonlyRecord<string, string | ReadonlyArray<string
|
|
45
|
+
export type Input = ReadonlyRecord.ReadonlyRecord<string, string | ReadonlyArray<string> | undefined> | Iterable<readonly [string, string]>;
|
|
46
46
|
/**
|
|
47
47
|
* @since 1.0.0
|
|
48
48
|
* @category constructors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Headers.d.ts","sourceRoot":"","sources":["../../../src/Http/Headers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAE/C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAG5C,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC;;;GAGG;AACH,eAAO,MAAM,aAAa,eAA8C,CAAA;AAExE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,SAAS,MAAO,OAAO,iBAA0D,CAAA;AAE9F;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,aAAa,CAAA;IACvC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAC/B;AAED;;;GAGG;AACH,e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AC,OAAO,EAAE,KAAK,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAA;IAC5C,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,OAAO,CAAA;CAOvC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE;IAClB,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAA;IAC9C,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;CAOzC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAA;IACzC,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAQrC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IAChG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;CAqB7F,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.18",
|
|
4
4
|
"description": "Unified interfaces for common platform-specific services",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"path-browserify": "^1.0.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@effect/schema": "^0.64.
|
|
20
|
-
"effect": "^2.4.
|
|
19
|
+
"@effect/schema": "^0.64.14",
|
|
20
|
+
"effect": "^2.4.14"
|
|
21
21
|
},
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"module": "./dist/esm/index.js",
|
package/src/Http/Headers.ts
CHANGED
|
@@ -63,7 +63,7 @@ export const schema: Schema.Schema<Headers, ReadonlyRecord.ReadonlyRecord<string
|
|
|
63
63
|
* @category models
|
|
64
64
|
*/
|
|
65
65
|
export type Input =
|
|
66
|
-
| ReadonlyRecord.ReadonlyRecord<string, string | ReadonlyArray<string
|
|
66
|
+
| ReadonlyRecord.ReadonlyRecord<string, string | ReadonlyArray<string> | undefined>
|
|
67
67
|
| Iterable<readonly [string, string]>
|
|
68
68
|
|
|
69
69
|
/**
|