effect 4.0.0-beta.26 → 4.0.0-beta.28
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/Cause.d.ts +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +3 -3
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +2 -2
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +331 -206
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +113 -72
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +1 -1
- package/dist/ErrorReporter.d.ts +2 -4
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +1 -3
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Layer.d.ts +112 -117
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +43 -44
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +4 -4
- package/dist/LayerMap.js +3 -3
- package/dist/ManagedRuntime.d.ts +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/Metric.d.ts +2 -4
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +2 -4
- package/dist/Metric.js.map +1 -1
- package/dist/PlatformError.d.ts +2 -2
- package/dist/References.d.ts +6 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +6 -1
- package/dist/References.js.map +1 -1
- package/dist/RequestResolver.d.ts +19 -19
- package/dist/RequestResolver.js +10 -10
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Schedule.d.ts +144 -82
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +58 -32
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +9 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +11 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +3 -1
- package/dist/Schema.js.map +1 -1
- package/dist/Stdio.d.ts +6 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +8 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +8 -4
- package/dist/Stream.js.map +1 -1
- package/dist/Types.d.ts +1 -22
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +3 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +12 -28
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -18
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +20 -1
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +65 -12
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +159 -45
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +4 -11
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +0 -5
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +4 -4
- package/dist/unstable/cli/CliError.js +4 -4
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.js +31 -0
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +5 -5
- package/dist/unstable/cluster/Reply.d.ts +3 -3
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts +45 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +22 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +16 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +11 -0
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +5 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +21 -17
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +6 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +6 -6
- package/dist/unstable/http/HttpServerRequest.d.ts +11 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +291 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +47 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +227 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/UrlParams.d.ts +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -0
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +1 -0
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +4 -10
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +39 -9
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -8
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +46 -20
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +5 -5
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +2 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.js +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +21 -0
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +15 -0
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +1 -1
- package/package.json +1 -1
- package/src/Cause.ts +1 -1
- package/src/Data.ts +3 -4
- package/src/Effect.ts +331 -206
- package/src/ErrorReporter.ts +2 -4
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +1 -0
- package/src/Layer.ts +112 -117
- package/src/LayerMap.ts +4 -4
- package/src/ManagedRuntime.ts +1 -1
- package/src/Metric.ts +2 -4
- package/src/References.ts +6 -1
- package/src/RequestResolver.ts +20 -20
- package/src/Schedule.ts +144 -82
- package/src/Scheduler.ts +12 -0
- package/src/Schema.ts +3 -1
- package/src/Stdio.ts +8 -4
- package/src/Stream.ts +8 -4
- package/src/Types.ts +1 -23
- package/src/index.ts +5 -3
- package/src/internal/effect.ts +3 -0
- package/src/unstable/ai/LanguageModel.ts +16 -37
- package/src/unstable/ai/McpSchema.ts +14 -0
- package/src/unstable/ai/McpServer.ts +224 -53
- package/src/unstable/ai/Toolkit.ts +5 -14
- package/src/unstable/ai/internal/codec-transformer.ts +0 -7
- package/src/unstable/cli/CliError.ts +4 -4
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +27 -0
- package/src/unstable/http/Cookies.ts +84 -0
- package/src/unstable/http/Headers.ts +34 -0
- package/src/unstable/http/HttpClientRequest.ts +21 -17
- package/src/unstable/http/HttpEffect.ts +8 -0
- package/src/unstable/http/HttpServerRequest.ts +388 -1
- package/src/unstable/http/HttpServerResponse.ts +328 -1
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +3 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +1 -0
- package/src/unstable/reactivity/Atom.ts +20 -26
- package/src/unstable/reactivity/AtomHttpApi.ts +45 -11
- package/src/unstable/reactivity/AtomRpc.ts +48 -17
- package/src/unstable/rpc/Rpc.ts +1 -3
- package/src/unstable/rpc/RpcMiddleware.ts +12 -6
- package/src/unstable/rpc/RpcServer.ts +2 -2
- package/src/unstable/rpc/Utils.ts +1 -1
- package/src/unstable/schema/Model.ts +31 -0
- package/src/unstable/sql/SqlResolver.ts +2 -2
|
@@ -2489,6 +2489,11 @@ const processNumberBackspace = (state: NumberState) => {
|
|
|
2489
2489
|
}))
|
|
2490
2490
|
}
|
|
2491
2491
|
|
|
2492
|
+
const processNumberClear = (state: NumberState) =>
|
|
2493
|
+
Effect.succeed(Action.NextFrame({
|
|
2494
|
+
state: { ...state, cursor: 0, value: "", error: undefined }
|
|
2495
|
+
}))
|
|
2496
|
+
|
|
2492
2497
|
const defaultIntProcessor = (input: string, state: NumberState) => {
|
|
2493
2498
|
if (state.value.length === 0 && input === "-") {
|
|
2494
2499
|
return Effect.succeed(Action.NextFrame({
|
|
@@ -2542,6 +2547,9 @@ const handleRenderInteger = (options: IntegerOptionsReq) => {
|
|
|
2542
2547
|
|
|
2543
2548
|
const handleProcessInteger = (options: IntegerOptionsReq) => {
|
|
2544
2549
|
return (input: Terminal.UserInput, state: NumberState) => {
|
|
2550
|
+
if (input.key.ctrl && input.key.name === "u") {
|
|
2551
|
+
return processNumberClear(state)
|
|
2552
|
+
}
|
|
2545
2553
|
switch (input.key.name) {
|
|
2546
2554
|
case "backspace": {
|
|
2547
2555
|
return processNumberBackspace(state)
|
|
@@ -2612,6 +2620,9 @@ const handleRenderFloat = (options: FloatOptionsReq) => {
|
|
|
2612
2620
|
|
|
2613
2621
|
const handleProcessFloat = (options: FloatOptionsReq) => {
|
|
2614
2622
|
return (input: Terminal.UserInput, state: NumberState) => {
|
|
2623
|
+
if (input.key.ctrl && input.key.name === "u") {
|
|
2624
|
+
return processNumberClear(state)
|
|
2625
|
+
}
|
|
2615
2626
|
switch (input.key.name) {
|
|
2616
2627
|
case "backspace": {
|
|
2617
2628
|
return processNumberBackspace(state)
|
|
@@ -2962,6 +2973,9 @@ const processAutoCompleteBackspace = <A>(state: AutoCompleteState, options: Auto
|
|
|
2962
2973
|
return Effect.succeed(Action.NextFrame({ state: updateAutoCompleteState(state, options, query) }))
|
|
2963
2974
|
}
|
|
2964
2975
|
|
|
2976
|
+
const processAutoCompleteClear = <A>(state: AutoCompleteState, options: AutoCompleteOptionsReq<A>) =>
|
|
2977
|
+
Effect.succeed(Action.NextFrame({ state: updateAutoCompleteState(state, options, "") }))
|
|
2978
|
+
|
|
2965
2979
|
const processAutoCompleteInput = <A>(input: string, state: AutoCompleteState, options: AutoCompleteOptionsReq<A>) => {
|
|
2966
2980
|
if (input.length === 0) {
|
|
2967
2981
|
return Effect.succeed(Action.Beep())
|
|
@@ -3045,6 +3059,9 @@ const handleSelectProcess = <A>(options: SelectOptionsReq<A>) => {
|
|
|
3045
3059
|
|
|
3046
3060
|
const handleAutoCompleteProcess = <A>(options: AutoCompleteOptionsReq<A>) => {
|
|
3047
3061
|
return (input: Terminal.UserInput, state: AutoCompleteState) => {
|
|
3062
|
+
if (input.key.ctrl && input.key.name === "u") {
|
|
3063
|
+
return processAutoCompleteClear(state, options)
|
|
3064
|
+
}
|
|
3048
3065
|
switch (input.key.name) {
|
|
3049
3066
|
case "k":
|
|
3050
3067
|
case "up": {
|
|
@@ -3217,6 +3234,13 @@ const processTextBackspace = (state: TextState) => {
|
|
|
3217
3234
|
)
|
|
3218
3235
|
}
|
|
3219
3236
|
|
|
3237
|
+
const processTextClear = (state: TextState) =>
|
|
3238
|
+
Effect.succeed(
|
|
3239
|
+
Action.NextFrame({
|
|
3240
|
+
state: { ...state, cursor: 0, value: "", error: undefined }
|
|
3241
|
+
})
|
|
3242
|
+
)
|
|
3243
|
+
|
|
3220
3244
|
const processTextCursorLeft = (state: TextState) => {
|
|
3221
3245
|
if (state.cursor <= 0) {
|
|
3222
3246
|
return Effect.succeed(Action.Beep())
|
|
@@ -3278,6 +3302,9 @@ const handleTextRender = (options: TextOptionsReq) => {
|
|
|
3278
3302
|
|
|
3279
3303
|
const handleTextProcess = (options: TextOptionsReq) => {
|
|
3280
3304
|
return (input: Terminal.UserInput, state: TextState) => {
|
|
3305
|
+
if (input.key.ctrl && input.key.name === "u") {
|
|
3306
|
+
return processTextClear(state)
|
|
3307
|
+
}
|
|
3281
3308
|
switch (input.key.name) {
|
|
3282
3309
|
case "backspace": {
|
|
3283
3310
|
return processTextBackspace(state)
|
|
@@ -668,6 +668,90 @@ export const setUnsafe: {
|
|
|
668
668
|
))
|
|
669
669
|
)
|
|
670
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Add an expired cookie to a Cookies object
|
|
673
|
+
*
|
|
674
|
+
* @since 4.0.0
|
|
675
|
+
* @category combinators
|
|
676
|
+
*/
|
|
677
|
+
export const expireCookie: {
|
|
678
|
+
/**
|
|
679
|
+
* Add an expired cookie to a Cookies object
|
|
680
|
+
*
|
|
681
|
+
* @since 4.0.0
|
|
682
|
+
* @category combinators
|
|
683
|
+
*/
|
|
684
|
+
(
|
|
685
|
+
name: string,
|
|
686
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
687
|
+
): (self: Cookies) => Result.Result<Cookies, CookiesError>
|
|
688
|
+
/**
|
|
689
|
+
* Add an expired cookie to a Cookies object
|
|
690
|
+
*
|
|
691
|
+
* @since 4.0.0
|
|
692
|
+
* @category combinators
|
|
693
|
+
*/
|
|
694
|
+
(
|
|
695
|
+
self: Cookies,
|
|
696
|
+
name: string,
|
|
697
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
698
|
+
): Result.Result<Cookies, CookiesError>
|
|
699
|
+
} = dual(
|
|
700
|
+
(args) => isCookies(args[0]),
|
|
701
|
+
(
|
|
702
|
+
self: Cookies,
|
|
703
|
+
name: string,
|
|
704
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
705
|
+
) =>
|
|
706
|
+
set(self, name, "", {
|
|
707
|
+
...options,
|
|
708
|
+
maxAge: 0,
|
|
709
|
+
expires: new Date(0)
|
|
710
|
+
})
|
|
711
|
+
)
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Add an expired cookie to a Cookies object, throwing an error if invalid
|
|
715
|
+
*
|
|
716
|
+
* @since 4.0.0
|
|
717
|
+
* @category combinators
|
|
718
|
+
*/
|
|
719
|
+
export const expireCookieUnsafe: {
|
|
720
|
+
/**
|
|
721
|
+
* Add an expired cookie to a Cookies object, throwing an error if invalid
|
|
722
|
+
*
|
|
723
|
+
* @since 4.0.0
|
|
724
|
+
* @category combinators
|
|
725
|
+
*/
|
|
726
|
+
(
|
|
727
|
+
name: string,
|
|
728
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
729
|
+
): (self: Cookies) => Cookies
|
|
730
|
+
/**
|
|
731
|
+
* Add an expired cookie to a Cookies object, throwing an error if invalid
|
|
732
|
+
*
|
|
733
|
+
* @since 4.0.0
|
|
734
|
+
* @category combinators
|
|
735
|
+
*/
|
|
736
|
+
(
|
|
737
|
+
self: Cookies,
|
|
738
|
+
name: string,
|
|
739
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
740
|
+
): Cookies
|
|
741
|
+
} = dual(
|
|
742
|
+
(args) => isCookies(args[0]),
|
|
743
|
+
(
|
|
744
|
+
self: Cookies,
|
|
745
|
+
name: string,
|
|
746
|
+
options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
|
|
747
|
+
): Cookies =>
|
|
748
|
+
setUnsafe(self, name, "", {
|
|
749
|
+
...options,
|
|
750
|
+
maxAge: 0,
|
|
751
|
+
expires: new Date(0)
|
|
752
|
+
})
|
|
753
|
+
)
|
|
754
|
+
|
|
671
755
|
/**
|
|
672
756
|
* Add multiple cookies to a Cookies object
|
|
673
757
|
*
|
|
@@ -352,6 +352,40 @@ export const remove: {
|
|
|
352
352
|
return out
|
|
353
353
|
})
|
|
354
354
|
|
|
355
|
+
/**
|
|
356
|
+
* @since 4.0.0
|
|
357
|
+
* @category combinators
|
|
358
|
+
*/
|
|
359
|
+
export const removeMany: {
|
|
360
|
+
/**
|
|
361
|
+
* @since 4.0.0
|
|
362
|
+
* @category combinators
|
|
363
|
+
*/
|
|
364
|
+
(keys: Iterable<string>): (self: Headers) => Headers
|
|
365
|
+
/**
|
|
366
|
+
* @since 4.0.0
|
|
367
|
+
* @category combinators
|
|
368
|
+
*/
|
|
369
|
+
(self: Headers, keys: Iterable<string>): Headers
|
|
370
|
+
} = dual<
|
|
371
|
+
/**
|
|
372
|
+
* @since 4.0.0
|
|
373
|
+
* @category combinators
|
|
374
|
+
*/
|
|
375
|
+
(keys: Iterable<string>) => (self: Headers) => Headers,
|
|
376
|
+
/**
|
|
377
|
+
* @since 4.0.0
|
|
378
|
+
* @category combinators
|
|
379
|
+
*/
|
|
380
|
+
(self: Headers, keys: Iterable<string>) => Headers
|
|
381
|
+
>(2, (self, keys) => {
|
|
382
|
+
const out = make(self)
|
|
383
|
+
for (const key of keys) {
|
|
384
|
+
delete out[key.toLowerCase()]
|
|
385
|
+
}
|
|
386
|
+
return out
|
|
387
|
+
})
|
|
388
|
+
|
|
355
389
|
/**
|
|
356
390
|
* @since 4.0.0
|
|
357
391
|
* @category combinators
|
|
@@ -87,7 +87,11 @@ const Proto = {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* @since 4.0.0
|
|
92
|
+
* @category constructors
|
|
93
|
+
*/
|
|
94
|
+
export function makeWith(
|
|
91
95
|
method: HttpMethod,
|
|
92
96
|
url: string,
|
|
93
97
|
urlParams: UrlParams.UrlParams,
|
|
@@ -109,7 +113,7 @@ function makeProto(
|
|
|
109
113
|
* @since 4.0.0
|
|
110
114
|
* @category constructors
|
|
111
115
|
*/
|
|
112
|
-
export const empty: HttpClientRequest =
|
|
116
|
+
export const empty: HttpClientRequest = makeWith(
|
|
113
117
|
"GET",
|
|
114
118
|
"",
|
|
115
119
|
UrlParams.empty,
|
|
@@ -251,7 +255,7 @@ export const setMethod: {
|
|
|
251
255
|
} = dual(
|
|
252
256
|
2,
|
|
253
257
|
(self: HttpClientRequest, method: HttpMethod): HttpClientRequest =>
|
|
254
|
-
|
|
258
|
+
makeWith(method, self.url, self.urlParams, self.hash, self.headers, self.body)
|
|
255
259
|
)
|
|
256
260
|
|
|
257
261
|
/**
|
|
@@ -270,7 +274,7 @@ export const setHeader: {
|
|
|
270
274
|
*/
|
|
271
275
|
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
272
276
|
} = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
|
|
273
|
-
|
|
277
|
+
makeWith(
|
|
274
278
|
self.method,
|
|
275
279
|
self.url,
|
|
276
280
|
self.urlParams,
|
|
@@ -295,7 +299,7 @@ export const setHeaders: {
|
|
|
295
299
|
*/
|
|
296
300
|
(self: HttpClientRequest, input: Headers.Input): HttpClientRequest
|
|
297
301
|
} = dual(2, (self: HttpClientRequest, input: Headers.Input): HttpClientRequest =>
|
|
298
|
-
|
|
302
|
+
makeWith(
|
|
299
303
|
self.method,
|
|
300
304
|
self.url,
|
|
301
305
|
self.urlParams,
|
|
@@ -394,7 +398,7 @@ export const setUrl: {
|
|
|
394
398
|
(self: HttpClientRequest, url: string | URL): HttpClientRequest
|
|
395
399
|
} = dual(2, (self: HttpClientRequest, url: string | URL): HttpClientRequest => {
|
|
396
400
|
if (typeof url === "string") {
|
|
397
|
-
return
|
|
401
|
+
return makeWith(
|
|
398
402
|
self.method,
|
|
399
403
|
url,
|
|
400
404
|
self.urlParams,
|
|
@@ -408,7 +412,7 @@ export const setUrl: {
|
|
|
408
412
|
const hash = clone.hash ? clone.hash.slice(1) : undefined
|
|
409
413
|
clone.search = ""
|
|
410
414
|
clone.hash = ""
|
|
411
|
-
return
|
|
415
|
+
return makeWith(
|
|
412
416
|
self.method,
|
|
413
417
|
clone.toString(),
|
|
414
418
|
urlParams,
|
|
@@ -435,7 +439,7 @@ export const prependUrl: {
|
|
|
435
439
|
(self: HttpClientRequest, path: string): HttpClientRequest
|
|
436
440
|
} = dual(2, (self: HttpClientRequest, path: string): HttpClientRequest => {
|
|
437
441
|
if (path === "") return self
|
|
438
|
-
return
|
|
442
|
+
return makeWith(
|
|
439
443
|
self.method,
|
|
440
444
|
joinSegments(path, self.url),
|
|
441
445
|
self.urlParams,
|
|
@@ -462,7 +466,7 @@ export const appendUrl: {
|
|
|
462
466
|
(self: HttpClientRequest, path: string): HttpClientRequest
|
|
463
467
|
} = dual(2, (self: HttpClientRequest, path: string): HttpClientRequest => {
|
|
464
468
|
if (path === "") return self
|
|
465
|
-
return
|
|
469
|
+
return makeWith(
|
|
466
470
|
self.method,
|
|
467
471
|
joinSegments(self.url, path),
|
|
468
472
|
self.urlParams,
|
|
@@ -500,7 +504,7 @@ export const updateUrl: {
|
|
|
500
504
|
*/
|
|
501
505
|
(self: HttpClientRequest, f: (url: string) => string): HttpClientRequest
|
|
502
506
|
} = dual(2, (self: HttpClientRequest, f: (url: string) => string): HttpClientRequest =>
|
|
503
|
-
|
|
507
|
+
makeWith(
|
|
504
508
|
self.method,
|
|
505
509
|
f(self.url),
|
|
506
510
|
self.urlParams,
|
|
@@ -525,7 +529,7 @@ export const setUrlParam: {
|
|
|
525
529
|
*/
|
|
526
530
|
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
527
531
|
} = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
|
|
528
|
-
|
|
532
|
+
makeWith(
|
|
529
533
|
self.method,
|
|
530
534
|
self.url,
|
|
531
535
|
UrlParams.set(self.urlParams, key, value),
|
|
@@ -550,7 +554,7 @@ export const setUrlParams: {
|
|
|
550
554
|
*/
|
|
551
555
|
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
|
|
552
556
|
} = dual(2, (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest =>
|
|
553
|
-
|
|
557
|
+
makeWith(
|
|
554
558
|
self.method,
|
|
555
559
|
self.url,
|
|
556
560
|
UrlParams.setAll(self.urlParams, input),
|
|
@@ -575,7 +579,7 @@ export const appendUrlParam: {
|
|
|
575
579
|
*/
|
|
576
580
|
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
|
|
577
581
|
} = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
|
|
578
|
-
|
|
582
|
+
makeWith(
|
|
579
583
|
self.method,
|
|
580
584
|
self.url,
|
|
581
585
|
UrlParams.append(self.urlParams, key, value),
|
|
@@ -600,7 +604,7 @@ export const appendUrlParams: {
|
|
|
600
604
|
*/
|
|
601
605
|
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
|
|
602
606
|
} = dual(2, (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest =>
|
|
603
|
-
|
|
607
|
+
makeWith(
|
|
604
608
|
self.method,
|
|
605
609
|
self.url,
|
|
606
610
|
UrlParams.appendAll(self.urlParams, input),
|
|
@@ -625,7 +629,7 @@ export const setHash: {
|
|
|
625
629
|
*/
|
|
626
630
|
(self: HttpClientRequest, hash: string): HttpClientRequest
|
|
627
631
|
} = dual(2, (self: HttpClientRequest, hash: string): HttpClientRequest =>
|
|
628
|
-
|
|
632
|
+
makeWith(
|
|
629
633
|
self.method,
|
|
630
634
|
self.url,
|
|
631
635
|
self.urlParams,
|
|
@@ -639,7 +643,7 @@ export const setHash: {
|
|
|
639
643
|
* @category combinators
|
|
640
644
|
*/
|
|
641
645
|
export const removeHash = (self: HttpClientRequest): HttpClientRequest =>
|
|
642
|
-
|
|
646
|
+
makeWith(
|
|
643
647
|
self.method,
|
|
644
648
|
self.url,
|
|
645
649
|
self.urlParams,
|
|
@@ -675,7 +679,7 @@ export const setBody: {
|
|
|
675
679
|
headers = Headers.set(headers, "content-length", body.contentLength.toString())
|
|
676
680
|
}
|
|
677
681
|
}
|
|
678
|
-
return
|
|
682
|
+
return makeWith(
|
|
679
683
|
self.method,
|
|
680
684
|
self.url,
|
|
681
685
|
self.urlParams,
|
|
@@ -173,6 +173,14 @@ export const appendPreResponseHandler = (handler: PreResponseHandler): Effect.Ef
|
|
|
173
173
|
return Effect.void
|
|
174
174
|
})
|
|
175
175
|
|
|
176
|
+
export {
|
|
177
|
+
/**
|
|
178
|
+
* @since 4.0.0
|
|
179
|
+
* @category fiber refs
|
|
180
|
+
*/
|
|
181
|
+
appendPreResponseHandlerUnsafe
|
|
182
|
+
}
|
|
183
|
+
|
|
176
184
|
/**
|
|
177
185
|
* @since 4.0.0
|
|
178
186
|
* @category fiber refs
|