@effect/platform 0.53.11 → 0.53.13
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 +989 -142
- package/dist/cjs/Http/Router.js.map +1 -1
- package/dist/dts/Http/App.d.ts +2 -2
- package/dist/dts/Http/Client.d.ts +29 -29
- package/dist/dts/Http/Client.d.ts.map +1 -1
- package/dist/dts/Http/IncomingMessage.d.ts +1 -1
- package/dist/dts/Http/Middleware.d.ts +10 -10
- package/dist/dts/Http/Multipart.d.ts +8 -8
- package/dist/dts/Http/Multiplex.d.ts +19 -19
- package/dist/dts/Http/Router.d.ts +34 -35
- package/dist/dts/Http/Router.d.ts.map +1 -1
- package/dist/dts/Http/Server.d.ts +13 -13
- package/dist/dts/Socket.d.ts +2 -2
- package/dist/dts/WorkerRunner.d.ts +2 -2
- package/dist/dts/internal/http/router.d.ts +1 -1
- package/dist/esm/Http/Router.js.map +1 -1
- package/package.json +3 -3
- package/src/Http/App.ts +3 -3
- package/src/Http/Client.ts +29 -29
- package/src/Http/IncomingMessage.ts +2 -2
- package/src/Http/Middleware.ts +10 -10
- package/src/Http/Multipart.ts +8 -8
- package/src/Http/Multiplex.ts +24 -24
- package/src/Http/Router.ts +34 -39
- package/src/Http/Server.ts +13 -13
- package/src/Socket.ts +4 -4
- package/src/WorkerRunner.ts +2 -2
- package/src/internal/http/client.ts +31 -31
- package/src/internal/http/middleware.ts +7 -7
- package/src/internal/http/multipart.ts +8 -8
- package/src/internal/http/multiplex.ts +28 -28
- package/src/internal/http/router.ts +23 -23
- package/src/internal/http/server.ts +13 -13
- package/src/internal/workerRunner.ts +2 -2
package/src/Http/Client.ts
CHANGED
|
@@ -120,8 +120,8 @@ export const fetchOk: Client.Default = internal.fetchOk
|
|
|
120
120
|
* @category error handling
|
|
121
121
|
*/
|
|
122
122
|
export const catchAll: {
|
|
123
|
-
<E,
|
|
124
|
-
<A, E, R,
|
|
123
|
+
<E, E2, R2, A2>(f: (e: E) => Effect.Effect<A2, E2, R2>): <A, R>(self: Client<A, E, R>) => Client<A2 | A, E2, R2 | R>
|
|
124
|
+
<A, E, R, A2, E2, R2>(self: Client<A, E, R>, f: (e: E) => Effect.Effect<A2, E2, R2>): Client<A | A2, E2, R | R2>
|
|
125
125
|
} = internal.catchAll
|
|
126
126
|
|
|
127
127
|
/**
|
|
@@ -129,11 +129,11 @@ export const catchAll: {
|
|
|
129
129
|
* @category error handling
|
|
130
130
|
*/
|
|
131
131
|
export const catchTag: {
|
|
132
|
-
<E extends { _tag: string }, K extends E["_tag"] & string,
|
|
132
|
+
<E extends { _tag: string }, K extends E["_tag"] & string, A1, E1, R1>(
|
|
133
133
|
tag: K,
|
|
134
134
|
f: (e: Extract<E, { _tag: K }>) => Effect.Effect<A1, E1, R1>
|
|
135
135
|
): <A, R>(self: Client<A, E, R>) => Client<A1 | A, E1 | Exclude<E, { _tag: K }>, R1 | R>
|
|
136
|
-
<R, E extends { _tag: string }, A, K extends E["_tag"] & string, E1, R1
|
|
136
|
+
<R, E extends { _tag: string }, A, K extends E["_tag"] & string, A1, E1, R1>(
|
|
137
137
|
self: Client<A, E, R>,
|
|
138
138
|
tag: K,
|
|
139
139
|
f: (e: Extract<E, { _tag: K }>) => Effect.Effect<A1, E1, R1>
|
|
@@ -195,11 +195,11 @@ export const catchTags: {
|
|
|
195
195
|
* @category filters
|
|
196
196
|
*/
|
|
197
197
|
export const filterOrElse: {
|
|
198
|
-
<A,
|
|
198
|
+
<A, B, E2, R2>(
|
|
199
199
|
f: Predicate.Predicate<A>,
|
|
200
200
|
orElse: (a: A) => Effect.Effect<B, E2, R2>
|
|
201
201
|
): <E, R>(self: Client<A, E, R>) => Client<A | B, E2 | E, R2 | R>
|
|
202
|
-
<A, E, R,
|
|
202
|
+
<A, E, R, B, E2, R2>(
|
|
203
203
|
self: Client<A, E, R>,
|
|
204
204
|
f: Predicate.Predicate<A>,
|
|
205
205
|
orElse: (a: A) => Effect.Effect<B, E2, R2>
|
|
@@ -241,7 +241,7 @@ export const filterStatusOk: <E, R>(
|
|
|
241
241
|
* @since 1.0.0
|
|
242
242
|
* @category constructors
|
|
243
243
|
*/
|
|
244
|
-
export const make: <A, E, R,
|
|
244
|
+
export const make: <A, E, R, E2, R2>(
|
|
245
245
|
execute: (request: Effect.Effect<ClientRequest.ClientRequest, E2, R2>) => Effect.Effect<A, E, R>,
|
|
246
246
|
preprocess: Client.Preprocess<E2, R2>
|
|
247
247
|
) => Client<A, E, R> = internal.make
|
|
@@ -264,10 +264,10 @@ export const makeDefault: (
|
|
|
264
264
|
* @category mapping & sequencing
|
|
265
265
|
*/
|
|
266
266
|
export const transform: {
|
|
267
|
-
<A, E, R,
|
|
267
|
+
<A, E, R, A1, E1, R1>(
|
|
268
268
|
f: (effect: Effect.Effect<A, E, R>, request: ClientRequest.ClientRequest) => Effect.Effect<A1, E1, R1>
|
|
269
269
|
): (self: Client<A, E, R>) => Client<A1, E | E1, R | R1>
|
|
270
|
-
<A, E, R,
|
|
270
|
+
<A, E, R, A1, E1, R1>(
|
|
271
271
|
self: Client<A, E, R>,
|
|
272
272
|
f: (effect: Effect.Effect<A, E, R>, request: ClientRequest.ClientRequest) => Effect.Effect<A1, E1, R1>
|
|
273
273
|
): Client<A1, E | E1, R | R1>
|
|
@@ -278,10 +278,10 @@ export const transform: {
|
|
|
278
278
|
* @category mapping & sequencing
|
|
279
279
|
*/
|
|
280
280
|
export const transformResponse: {
|
|
281
|
-
<A, E, R,
|
|
281
|
+
<A, E, R, A1, E1, R1>(
|
|
282
282
|
f: (effect: Effect.Effect<A, E, R>) => Effect.Effect<A1, E1, R1>
|
|
283
283
|
): (self: Client<A, E, R>) => Client<A1, E1, R1>
|
|
284
|
-
<A, E, R,
|
|
284
|
+
<A, E, R, A1, E1, R1>(
|
|
285
285
|
self: Client<A, E, R>,
|
|
286
286
|
f: (effect: Effect.Effect<A, E, R>) => Effect.Effect<A1, E1, R1>
|
|
287
287
|
): Client<A1, E1, R1>
|
|
@@ -301,8 +301,8 @@ export const map: {
|
|
|
301
301
|
* @category mapping & sequencing
|
|
302
302
|
*/
|
|
303
303
|
export const mapEffect: {
|
|
304
|
-
<A,
|
|
305
|
-
<A, E, R,
|
|
304
|
+
<A, B, E2, R2>(f: (a: A) => Effect.Effect<B, E2, R2>): <E, R>(self: Client<A, E, R>) => Client<B, E2 | E, R2 | R>
|
|
305
|
+
<A, E, R, B, E2, R2>(self: Client<A, E, R>, f: (a: A) => Effect.Effect<B, E2, R2>): Client<B, E | E2, R2 | R>
|
|
306
306
|
} = internal.mapEffect
|
|
307
307
|
|
|
308
308
|
/**
|
|
@@ -310,10 +310,10 @@ export const mapEffect: {
|
|
|
310
310
|
* @category mapping & sequencing
|
|
311
311
|
*/
|
|
312
312
|
export const mapEffectScoped: {
|
|
313
|
-
<A,
|
|
313
|
+
<A, B, E2, R2>(
|
|
314
314
|
f: (a: A) => Effect.Effect<B, E2, R2>
|
|
315
315
|
): <E, R>(self: Client<A, E, R>) => Client<B, E2 | E, Exclude<R2, Scope.Scope> | Exclude<R, Scope.Scope>>
|
|
316
|
-
<A, E, R,
|
|
316
|
+
<A, E, R, B, E2, R2>(
|
|
317
317
|
self: Client<A, E, R>,
|
|
318
318
|
f: (a: A) => Effect.Effect<B, E2, R2>
|
|
319
319
|
): Client<B, E | E2, Exclude<R2, Scope.Scope> | Exclude<R, Scope.Scope>>
|
|
@@ -335,10 +335,10 @@ export const mapRequest: {
|
|
|
335
335
|
* @category mapping & sequencing
|
|
336
336
|
*/
|
|
337
337
|
export const mapRequestEffect: {
|
|
338
|
-
<
|
|
338
|
+
<E2, R2>(
|
|
339
339
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<ClientRequest.ClientRequest, E2, R2>
|
|
340
340
|
): <A, E, R>(self: Client<A, E, R>) => Client<A, E2 | E, R2 | R>
|
|
341
|
-
<A, E, R,
|
|
341
|
+
<A, E, R, E2, R2>(
|
|
342
342
|
self: Client<A, E, R>,
|
|
343
343
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<ClientRequest.ClientRequest, E2, R2>
|
|
344
344
|
): Client<A, E | E2, R | R2>
|
|
@@ -360,10 +360,10 @@ export const mapInputRequest: {
|
|
|
360
360
|
* @category mapping & sequencing
|
|
361
361
|
*/
|
|
362
362
|
export const mapInputRequestEffect: {
|
|
363
|
-
<
|
|
363
|
+
<E2, R2>(
|
|
364
364
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<ClientRequest.ClientRequest, E2, R2>
|
|
365
365
|
): <A, E, R>(self: Client<A, E, R>) => Client<A, E2 | E, R2 | R>
|
|
366
|
-
<A, E, R,
|
|
366
|
+
<A, E, R, E2, R2>(
|
|
367
367
|
self: Client<A, E, R>,
|
|
368
368
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<ClientRequest.ClientRequest, E2, R2>
|
|
369
369
|
): Client<A, E | E2, R2 | R>
|
|
@@ -411,8 +411,8 @@ export const schemaFunction: {
|
|
|
411
411
|
* @category mapping & sequencing
|
|
412
412
|
*/
|
|
413
413
|
export const tap: {
|
|
414
|
-
<A,
|
|
415
|
-
<A, E, R,
|
|
414
|
+
<A, _, E2, R2>(f: (a: A) => Effect.Effect<_, E2, R2>): <E, R>(self: Client<A, E, R>) => Client<A, E2 | E, R2 | R>
|
|
415
|
+
<A, E, R, _, E2, R2>(self: Client<A, E, R>, f: (a: A) => Effect.Effect<_, E2, R2>): Client<A, E | E2, R2 | R>
|
|
416
416
|
} = internal.tap
|
|
417
417
|
|
|
418
418
|
/**
|
|
@@ -420,10 +420,10 @@ export const tap: {
|
|
|
420
420
|
* @category mapping & sequencing
|
|
421
421
|
*/
|
|
422
422
|
export const tapRequest: {
|
|
423
|
-
<
|
|
423
|
+
<_, E2, R2>(
|
|
424
424
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<_, E2, R2>
|
|
425
425
|
): <A, E, R>(self: Client<A, E, R>) => Client<A, E2 | E, R2 | R>
|
|
426
|
-
<A, E, R,
|
|
426
|
+
<A, E, R, _, E2, R2>(
|
|
427
427
|
self: Client<A, E, R>,
|
|
428
428
|
f: (a: ClientRequest.ClientRequest) => Effect.Effect<_, E2, R2>
|
|
429
429
|
): Client<A, E | E2, R | R2>
|
|
@@ -452,8 +452,8 @@ export const currentTracerDisabledWhen: FiberRef.FiberRef<Predicate.Predicate<Cl
|
|
|
452
452
|
export const withTracerDisabledWhen: {
|
|
453
453
|
(
|
|
454
454
|
predicate: Predicate.Predicate<ClientRequest.ClientRequest>
|
|
455
|
-
): <
|
|
456
|
-
<
|
|
455
|
+
): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
456
|
+
<A, E, R>(
|
|
457
457
|
effect: Effect.Effect<A, E, R>,
|
|
458
458
|
predicate: Predicate.Predicate<ClientRequest.ClientRequest>
|
|
459
459
|
): Effect.Effect<A, E, R>
|
|
@@ -470,8 +470,8 @@ export const currentTracerPropagation: FiberRef.FiberRef<boolean> = internal.cur
|
|
|
470
470
|
* @category fiber refs
|
|
471
471
|
*/
|
|
472
472
|
export const withTracerPropagation: {
|
|
473
|
-
(enabled: boolean): <
|
|
474
|
-
<
|
|
473
|
+
(enabled: boolean): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
474
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, enabled: boolean): Effect.Effect<A, E, R>
|
|
475
475
|
} = internal.withTracerPropagation
|
|
476
476
|
|
|
477
477
|
/**
|
|
@@ -485,6 +485,6 @@ export const currentFetchOptions: FiberRef.FiberRef<RequestInit> = internal.curr
|
|
|
485
485
|
* @category fiber refs
|
|
486
486
|
*/
|
|
487
487
|
export const withFetchOptions: {
|
|
488
|
-
(options: RequestInit): <
|
|
489
|
-
<
|
|
488
|
+
(options: RequestInit): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
489
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, options: RequestInit): Effect.Effect<A, E, R>
|
|
490
490
|
} = internal.withFetchOptions
|
|
@@ -134,8 +134,8 @@ export const maxBodySize: FiberRef.FiberRef<Option.Option<FileSystem.Size>> = Gl
|
|
|
134
134
|
* @category fiber refs
|
|
135
135
|
*/
|
|
136
136
|
export const withMaxBodySize = dual<
|
|
137
|
-
(size: Option.Option<FileSystem.SizeInput>) => <
|
|
138
|
-
<
|
|
137
|
+
(size: Option.Option<FileSystem.SizeInput>) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>,
|
|
138
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, size: Option.Option<FileSystem.SizeInput>) => Effect.Effect<A, E, R>
|
|
139
139
|
>(2, (effect, size) => Effect.locally(effect, maxBodySize, Option.map(size, FileSystem.Size)))
|
|
140
140
|
|
|
141
141
|
/**
|
package/src/Http/Middleware.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type * as ServerRequest from "./ServerRequest.js"
|
|
|
14
14
|
* @category models
|
|
15
15
|
*/
|
|
16
16
|
export interface Middleware {
|
|
17
|
-
<
|
|
17
|
+
<E, R>(self: App.Default<E, R>): App.Default<any, any>
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -39,7 +39,7 @@ export const make: <M extends Middleware>(middleware: M) => M = internal.make
|
|
|
39
39
|
* @since 1.0.0
|
|
40
40
|
* @category constructors
|
|
41
41
|
*/
|
|
42
|
-
export const logger: <
|
|
42
|
+
export const logger: <E, R>(httpApp: App.Default<E, R>) => App.Default<E, R> = internal.logger
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* @since 1.0.0
|
|
@@ -51,7 +51,7 @@ export const loggerDisabled: FiberRef.FiberRef<boolean> = internal.loggerDisable
|
|
|
51
51
|
* @since 1.0.0
|
|
52
52
|
* @category fiber refs
|
|
53
53
|
*/
|
|
54
|
-
export const withLoggerDisabled: <
|
|
54
|
+
export const withLoggerDisabled: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R> =
|
|
55
55
|
internal.withLoggerDisabled
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -68,8 +68,8 @@ export const currentTracerDisabledWhen: FiberRef.FiberRef<Predicate.Predicate<Se
|
|
|
68
68
|
export const withTracerDisabledWhen: {
|
|
69
69
|
(
|
|
70
70
|
predicate: Predicate.Predicate<ServerRequest.ServerRequest>
|
|
71
|
-
): <
|
|
72
|
-
<
|
|
71
|
+
): <A, E, R>(layer: Layer.Layer<A, E, R>) => Layer.Layer<A, E, R>
|
|
72
|
+
<A, E, R>(
|
|
73
73
|
layer: Layer.Layer<A, E, R>,
|
|
74
74
|
predicate: Predicate.Predicate<ServerRequest.ServerRequest>
|
|
75
75
|
): Layer.Layer<A, E, R>
|
|
@@ -82,8 +82,8 @@ export const withTracerDisabledWhen: {
|
|
|
82
82
|
export const withTracerDisabledWhenEffect: {
|
|
83
83
|
(
|
|
84
84
|
predicate: Predicate.Predicate<ServerRequest.ServerRequest>
|
|
85
|
-
): <
|
|
86
|
-
<
|
|
85
|
+
): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
86
|
+
<A, E, R>(
|
|
87
87
|
effect: Effect.Effect<A, E, R>,
|
|
88
88
|
predicate: Predicate.Predicate<ServerRequest.ServerRequest>
|
|
89
89
|
): Effect.Effect<A, E, R>
|
|
@@ -94,15 +94,15 @@ export const withTracerDisabledWhenEffect: {
|
|
|
94
94
|
* @category fiber refs
|
|
95
95
|
*/
|
|
96
96
|
export const withTracerDisabledForUrls: {
|
|
97
|
-
(urls: ReadonlyArray<string>): <
|
|
98
|
-
<
|
|
97
|
+
(urls: ReadonlyArray<string>): <A, E, R>(layer: Layer.Layer<A, E, R>) => Layer.Layer<A, E, R>
|
|
98
|
+
<A, E, R>(layer: Layer.Layer<A, E, R>, urls: ReadonlyArray<string>): Layer.Layer<A, E, R>
|
|
99
99
|
} = internal.withTracerDisabledForUrls
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* @since 1.0.0
|
|
103
103
|
* @category constructors
|
|
104
104
|
*/
|
|
105
|
-
export const xForwardedHeaders: <
|
|
105
|
+
export const xForwardedHeaders: <E, R>(httpApp: App.Default<E, R>) => App.Default<E, R> = internal.xForwardedHeaders
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* @since 1.0.0
|
package/src/Http/Multipart.ts
CHANGED
|
@@ -162,8 +162,8 @@ export const maxParts: FiberRef.FiberRef<Option.Option<number>> = internal.maxPa
|
|
|
162
162
|
* @category fiber refs
|
|
163
163
|
*/
|
|
164
164
|
export const withMaxParts: {
|
|
165
|
-
(count: Option.Option<number>): <
|
|
166
|
-
<
|
|
165
|
+
(count: Option.Option<number>): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
166
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, count: Option.Option<number>): Effect.Effect<A, E, R>
|
|
167
167
|
} = internal.withMaxParts
|
|
168
168
|
|
|
169
169
|
/**
|
|
@@ -177,8 +177,8 @@ export const maxFieldSize: FiberRef.FiberRef<FileSystem.Size> = internal.maxFiel
|
|
|
177
177
|
* @category fiber refs
|
|
178
178
|
*/
|
|
179
179
|
export const withMaxFieldSize: {
|
|
180
|
-
(size: FileSystem.SizeInput): <
|
|
181
|
-
<
|
|
180
|
+
(size: FileSystem.SizeInput): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
181
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, size: FileSystem.SizeInput): Effect.Effect<A, E, R>
|
|
182
182
|
} = internal.withMaxFieldSize
|
|
183
183
|
|
|
184
184
|
/**
|
|
@@ -192,8 +192,8 @@ export const maxFileSize: FiberRef.FiberRef<Option.Option<FileSystem.Size>> = in
|
|
|
192
192
|
* @category fiber refs
|
|
193
193
|
*/
|
|
194
194
|
export const withMaxFileSize: {
|
|
195
|
-
(size: Option.Option<FileSystem.SizeInput>): <
|
|
196
|
-
<
|
|
195
|
+
(size: Option.Option<FileSystem.SizeInput>): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
196
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, size: Option.Option<FileSystem.SizeInput>): Effect.Effect<A, E, R>
|
|
197
197
|
} = internal.withMaxFileSize
|
|
198
198
|
|
|
199
199
|
/**
|
|
@@ -207,8 +207,8 @@ export const fieldMimeTypes: FiberRef.FiberRef<Chunk.Chunk<string>> = internal.f
|
|
|
207
207
|
* @category fiber refs
|
|
208
208
|
*/
|
|
209
209
|
export const withFieldMimeTypes: {
|
|
210
|
-
(mimeTypes: ReadonlyArray<string>): <
|
|
211
|
-
<
|
|
210
|
+
(mimeTypes: ReadonlyArray<string>): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>
|
|
211
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, mimeTypes: ReadonlyArray<string>): Effect.Effect<A, E, R>
|
|
212
212
|
} = internal.withFieldMimeTypes
|
|
213
213
|
|
|
214
214
|
/**
|
package/src/Http/Multiplex.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const empty: Multiplex<never> = internal.empty
|
|
|
44
44
|
* @since 1.0.0
|
|
45
45
|
* @category constructors
|
|
46
46
|
*/
|
|
47
|
-
export const make: <
|
|
47
|
+
export const make: <E, R>(
|
|
48
48
|
apps: Iterable<
|
|
49
49
|
readonly [predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E, R>, app: App.Default<E, R>]
|
|
50
50
|
>
|
|
@@ -55,11 +55,11 @@ export const make: <R, E>(
|
|
|
55
55
|
* @category combinators
|
|
56
56
|
*/
|
|
57
57
|
export const add: {
|
|
58
|
-
<R2,
|
|
58
|
+
<E2, R2, E3, R3>(
|
|
59
59
|
predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E2, R2>,
|
|
60
60
|
app: App.Default<E3, R3>
|
|
61
|
-
): <
|
|
62
|
-
<R,
|
|
61
|
+
): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E3 | E, R2 | R3 | R>
|
|
62
|
+
<E, R, E2, R2, E3, R3>(
|
|
63
63
|
self: Multiplex<E, R>,
|
|
64
64
|
predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E2, R2>,
|
|
65
65
|
app: App.Default<E3, R3>
|
|
@@ -71,12 +71,12 @@ export const add: {
|
|
|
71
71
|
* @category combinators
|
|
72
72
|
*/
|
|
73
73
|
export const headerExact: {
|
|
74
|
-
<
|
|
74
|
+
<E2, R2>(
|
|
75
75
|
header: string,
|
|
76
76
|
value: string,
|
|
77
77
|
app: App.Default<E2, R2>
|
|
78
|
-
): <
|
|
79
|
-
<R,
|
|
78
|
+
): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
79
|
+
<E, R, E2, R2>(
|
|
80
80
|
self: Multiplex<E, R>,
|
|
81
81
|
header: string,
|
|
82
82
|
value: string,
|
|
@@ -89,12 +89,12 @@ export const headerExact: {
|
|
|
89
89
|
* @category combinators
|
|
90
90
|
*/
|
|
91
91
|
export const headerRegex: {
|
|
92
|
-
<
|
|
92
|
+
<E2, R2>(
|
|
93
93
|
header: string,
|
|
94
94
|
regex: RegExp,
|
|
95
95
|
app: App.Default<E2, R2>
|
|
96
|
-
): <
|
|
97
|
-
<R,
|
|
96
|
+
): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
97
|
+
<E, R, E2, R2>(
|
|
98
98
|
self: Multiplex<E, R>,
|
|
99
99
|
header: string,
|
|
100
100
|
regex: RegExp,
|
|
@@ -107,12 +107,12 @@ export const headerRegex: {
|
|
|
107
107
|
* @category combinators
|
|
108
108
|
*/
|
|
109
109
|
export const headerStartsWith: {
|
|
110
|
-
<
|
|
110
|
+
<E2, R2>(
|
|
111
111
|
header: string,
|
|
112
112
|
prefix: string,
|
|
113
113
|
app: App.Default<E2, R2>
|
|
114
|
-
): <
|
|
115
|
-
<R,
|
|
114
|
+
): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
115
|
+
<E, R, E2, R2>(
|
|
116
116
|
self: Multiplex<E, R>,
|
|
117
117
|
header: string,
|
|
118
118
|
prefix: string,
|
|
@@ -125,12 +125,12 @@ export const headerStartsWith: {
|
|
|
125
125
|
* @category combinators
|
|
126
126
|
*/
|
|
127
127
|
export const headerEndsWith: {
|
|
128
|
-
<
|
|
128
|
+
<E2, R2>(
|
|
129
129
|
header: string,
|
|
130
130
|
suffix: string,
|
|
131
131
|
app: App.Default<E2, R2>
|
|
132
|
-
): <
|
|
133
|
-
<R,
|
|
132
|
+
): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
133
|
+
<E, R, E2, R2>(
|
|
134
134
|
self: Multiplex<E, R>,
|
|
135
135
|
header: string,
|
|
136
136
|
suffix: string,
|
|
@@ -143,8 +143,8 @@ export const headerEndsWith: {
|
|
|
143
143
|
* @category combinators
|
|
144
144
|
*/
|
|
145
145
|
export const hostExact: {
|
|
146
|
-
<
|
|
147
|
-
<R,
|
|
146
|
+
<E2, R2>(host: string, app: App.Default<E2, R2>): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
147
|
+
<E, R, E2, R2>(self: Multiplex<E, R>, host: string, app: App.Default<E2, R2>): Multiplex<E | E2, R | R2>
|
|
148
148
|
} = internal.hostExact
|
|
149
149
|
|
|
150
150
|
/**
|
|
@@ -152,8 +152,8 @@ export const hostExact: {
|
|
|
152
152
|
* @category combinators
|
|
153
153
|
*/
|
|
154
154
|
export const hostRegex: {
|
|
155
|
-
<
|
|
156
|
-
<R,
|
|
155
|
+
<E2, R2>(regex: RegExp, app: App.Default<E2, R2>): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
156
|
+
<E, R, E2, R2>(self: Multiplex<E, R>, regex: RegExp, app: App.Default<E2, R2>): Multiplex<E | E2, R | R2>
|
|
157
157
|
} = internal.hostRegex
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -161,8 +161,8 @@ export const hostRegex: {
|
|
|
161
161
|
* @category combinators
|
|
162
162
|
*/
|
|
163
163
|
export const hostStartsWith: {
|
|
164
|
-
<
|
|
165
|
-
<R,
|
|
164
|
+
<E2, R2>(prefix: string, app: App.Default<E2, R2>): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
165
|
+
<E, R, E2, R2>(self: Multiplex<E, R>, prefix: string, app: App.Default<E2, R2>): Multiplex<E | E2, R | R2>
|
|
166
166
|
} = internal.hostStartsWith
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -170,6 +170,6 @@ export const hostStartsWith: {
|
|
|
170
170
|
* @category combinators
|
|
171
171
|
*/
|
|
172
172
|
export const hostEndsWith: {
|
|
173
|
-
<
|
|
174
|
-
<R,
|
|
173
|
+
<E2, R2>(suffix: string, app: App.Default<E2, R2>): <E, R>(self: Multiplex<E, R>) => Multiplex<E2 | E, R2 | R>
|
|
174
|
+
<E, R, E2, R2>(self: Multiplex<E, R>, suffix: string, app: App.Default<E2, R2>): Multiplex<E | E2, R | R2>
|
|
175
175
|
} = internal.hostEndsWith
|