@cmmd-center/forge 0.13.95 → 0.13.97
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/{BunHttpServer-DTG5XWSi.cjs → BunHttpServer-CtFGbsWr.cjs} +2 -2
- package/dist/{BunHttpServer-BpaVqxli.mjs → BunHttpServer-o7ISooSQ.mjs} +2 -2
- package/dist/{HttpServer-5UTabe01.mjs → HttpServer-BbbI8N6_.mjs} +79 -39
- package/dist/{HttpServer-DZ6iaxyk.cjs → HttpServer-CRBqMWdP.cjs} +47 -1
- package/dist/{NodeHttpServer-DePOzmYy.mjs → NodeHttpServer-BngJqAIT.mjs} +2 -2
- package/dist/{NodeHttpServer-RV5QsVeb.cjs → NodeHttpServer-DyI6OyMg.cjs} +2 -2
- package/dist/bin.cjs +781 -406
- package/dist/bin.mjs +891 -516
- package/dist/client/assets/{DiffPanel-CAkf79MN.js → DiffPanel-CYrraC28.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-B9IU5Q5Q.js → DiffPanel.logic-DyXOs7eK.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BaJzbqHW.js → DiffWorkerPoolProvider-DMt6DknG.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-ItXVNv0A.js → PullRequestCodePanel-CgjWVTVM.js} +2 -2
- package/dist/client/assets/{Virtualizer-D6N688Z0.js → Virtualizer-D0TQdce0.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-Q7KzTxot.js → WorkerPoolContext-DkMo0hso.js} +4 -4
- package/dist/client/assets/{index-CuTM56F9.js → index-CzgrA9VN.js} +6 -6
- package/dist/client/index.html +4 -4
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require("./chunk-BhaIgcZK.cjs");
|
|
4
4
|
const require_Schema = require("./Schema-DxddW8-V.cjs");
|
|
5
5
|
const require_Path = require("./Path-Dp3btyUm.cjs");
|
|
6
|
-
const require_HttpServer = require("./HttpServer-
|
|
6
|
+
const require_HttpServer = require("./HttpServer-CRBqMWdP.cjs");
|
|
7
7
|
const require_Config = require("./Config-pbf0GGHJ.cjs");
|
|
8
8
|
const require_BunServices = require("./BunServices-blx5Lx2N.cjs");
|
|
9
9
|
//#region ../../node_modules/.bun/@effect+platform-bun@4.0.0-beta.51+01a8f9cec8f1c5e8/node_modules/@effect/platform-bun/dist/BunHttpPlatform.js
|
|
@@ -372,4 +372,4 @@ exports.layerServer = layerServer;
|
|
|
372
372
|
exports.layerTest = layerTest;
|
|
373
373
|
exports.make = make;
|
|
374
374
|
|
|
375
|
-
//# sourceMappingURL=BunHttpServer-
|
|
375
|
+
//# sourceMappingURL=BunHttpServer-CtFGbsWr.cjs.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Aa as Scope, Ai as void_$1, An as cached, Ca as mergeAll, Ea as succeed$2, Er as map, Fa as forkUnsafe, Hr as promise, Ir as onExit, Ka as doneUnsafe, Ma as addFinalizerExit, Mn as callback, Ni as withFiber, Qr as runForkWith, Si as try_, Ta as provideMerge, Wa as _await, Yc as getUnsafe, Yn as fail, Zc as makeUnsafe, Zn as fiber, ar as fnUntraced, bi as timeoutOrElse, cu as flow, eo as makeUnsafe$1, ga as effect, ii as scoped, ja as addFinalizer, jl as Class, li as succeed, lo as succeed$1, ni as runSync, pi as sync, qr as raceFirst, rc as seconds, ri as scope, rl as fromNullishOr, ro as fail$1, tr as flatMap, uo as void_, vo as done, vr as isEffect, wa as provide, xi as tryPromise, yc as isReadonlyArrayNonEmpty } from "./Schema-Ay3DUM83.mjs";
|
|
4
4
|
import { C as fromChannel, H as pipeThroughChannel, Ot as makeUnsafe$2, _ as fail$2, at as toReadableStreamWith, st as unwrap, tn as runIn, wt as fromTransform } from "./Path-BIaGSU2M.mjs";
|
|
5
|
-
import { D as Socket, Et as fromInput$1, F as ClientAbort,
|
|
5
|
+
import { D as Socket, Et as fromInput$1, F as ClientAbort, H as RequestInit, I as HttpServerError, Kt as runtime, L as RequestParseError, M as defaultCloseCodeIsError, Mt as parseHeader, Nt as toSetCookieHeaders, O as SocketCloseError, Ot as fromInput, P as isCloseEvent, S as makeChannel, U as layer$3, Ut as join, Wt as make$4, X as layerWeak, Y as layer$2, b as MultipartError, c as scopeTransferToStream, h as TypeId, ht as inspect, j as TypeId$2, jt as isEmpty, k as SocketError, l as toHandled, mt as TypeId$1, n as layerTestClient, nt as raw, o as HttpPlatform, p as HttpServerRequest, r as make$3, s as make$2, t as HttpServer, w as toPersisted } from "./HttpServer-BbbI8N6_.mjs";
|
|
6
6
|
import { h as unwrap$1 } from "./Config-BnFFyBjD.mjs";
|
|
7
7
|
import { layer as layer$5, t as layer$4 } from "./BunServices-ZpOiNNsP.mjs";
|
|
8
8
|
//#region ../../node_modules/.bun/@effect+platform-bun@4.0.0-beta.51+01a8f9cec8f1c5e8/node_modules/@effect/platform-bun/dist/BunHttpPlatform.js
|
|
@@ -366,4 +366,4 @@ const removeHost = (url) => {
|
|
|
366
366
|
//#endregion
|
|
367
367
|
export { layer, layerConfig, layerHttpServices, layerServer, layerTest, make };
|
|
368
368
|
|
|
369
|
-
//# sourceMappingURL=BunHttpServer-
|
|
369
|
+
//# sourceMappingURL=BunHttpServer-o7ISooSQ.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $l as or, A as Tuple, Aa as Scope, Ac as set$3, Ai as void_, Al as BaseProto, An as cached, Ao as makeDieReason, B as annotate, Bc as map$3, Bl as array, C as Record, Cn as andThen, Dc as isEmptyRecord, Di as uninterruptibleMask, Dr as mapEager, E as TaggedErrorClass, Ea as succeed$2, Ei as uninterruptible, Er as map$1, Et as toCodecJson, Fc as fail, Fi as withParentSpan, Fn as catchFilter, Ft as encodeUnknownEffect, Gl as hasProperty, Gn as die, Gr as provideService, H as declare, Ha as TracerEnabled, Hc as Reference, Hl as structure, Hn as contextWith, Hr as promise, Hs as has, I as Union, Il as redact$1, J as decodeUnknownEffect, Jn as exit, Jr as repeat, Ka as doneUnsafe, Kc as get$2, La as makeUnsafe$3, Ll as symbolRedactable, Lr as onExitPrimitive, Ls as ParentSpan, Ml as NodeInspectSymbol, Mr as matchCauseEffectEager, Na as close, Ni as withFiber, Nn as catchCause, Oc as makeEquivalence, Oi as updateContext, Oo as isNoSuchElementError, Or as mapError, Pa as closeUnsafe, Pc as makeEquivalence$2, Pi as withLogSpan, Pl as format, Ps as DisablePropagation, Qc as merge$1, Qr as runForkWith, Ra as provide, Rc as isFailure$1, Rn as catchTag, Rr as onInterrupt, Sc as makeEquivalence$1, Si as try_, So as fromReasons, St as optional, Ta as provideMerge, Tn as annotateLogs, To as hasInterruptsOnly, Tt as tag, Uc as Service, Ul as symbol$2, Us as toPredicate, Vc as succeed, Vn as context, Vs as compose, W as decodeEffect, Wa as _await, Wc as add, Xa as into, Xi as isSchedule, Xn as failCause, Xr as retry, Xs as isFinite, Yc as getUnsafe$1, Yn as fail$1, Zi as passthrough, Zr as runFork, _ as NonEmptyArray, _l as strictEqual, _s as makeSpanUnsafe, _t as isSchemaError, ai as scopedWith, al as getOrElse, ar as fnUntraced, bi as timeoutOrElse, bl as PipeInspectableProto, bo as filterInterruptors, bs as reportCauseUnsafe, c as Defect, ca as Clock, cc as toSeconds, cu as flow, da as Error$1, dl as match, do as Done, du as pipeArguments, eo as makeUnsafe$2, fa as TaggedError, fi as suspend, fl as none, fr as gen, ga as effect, gl as make$14, h as Literals, hc as fromIterable$1, hr as interrupt, in as make$13, io as failCause$1, iu as constUndefined, jc as empty$6, jl as Class, jr as matchCauseEffect, kc as map$2, ki as useSpan, ko as isTimeoutError, li as succeed
|
|
4
|
-
import { $ as suspend$1, B as onExit, C as fromChannel, Et as runFold, J as runForEach, Jt as make$15, Qt as getCurrent, St as fromPull, W as run, Xt as makeUnsafe$4, Yt as set$4, _ as fail$3, a as Size, en as interruptAll, g as ensuring$1, it as toReadableStreamEffect, k as fromReadableStream, r as FileSystem, t as Path, wt as fromTransform } from "./Path-BIaGSU2M.mjs";
|
|
3
|
+
import { $l as or, A as Tuple, Aa as Scope, Ac as set$3, Ai as void_, Al as BaseProto, An as cached, Ao as makeDieReason, B as annotate, Bc as map$3, Bl as array, C as Record, Cn as andThen, Dc as isEmptyRecord, Di as uninterruptibleMask, Dr as mapEager, E as TaggedErrorClass, Ea as succeed$2, Ei as uninterruptible, Er as map$1, Et as toCodecJson, Fc as fail, Fi as withParentSpan, Fn as catchFilter, Ft as encodeUnknownEffect, Gl as hasProperty, Gn as die, Gr as provideService, H as declare, Ha as TracerEnabled, Hc as Reference, Hl as structure, Hn as contextWith, Hr as promise, Hs as has, I as Union, Il as redact$1, J as decodeUnknownEffect, Jn as exit, Jr as repeat, Ka as doneUnsafe, Kc as get$2, La as makeUnsafe$3, Ll as symbolRedactable, Lr as onExitPrimitive, Ls as ParentSpan, Ml as NodeInspectSymbol, Mr as matchCauseEffectEager, Na as close, Ni as withFiber, Nn as catchCause, Oc as makeEquivalence, Oi as updateContext, Oo as isNoSuchElementError, Or as mapError, Pa as closeUnsafe, Pc as makeEquivalence$2, Pi as withLogSpan, Pl as format, Ps as DisablePropagation, Qc as merge$1, Qr as runForkWith, Ra as provide, Rc as isFailure$1, Rn as catchTag, Rr as onInterrupt, Sc as makeEquivalence$1, Si as try_, So as fromReasons, St as optional, Ta as provideMerge, Tn as annotateLogs, To as hasInterruptsOnly, Tt as tag, Uc as Service, Ul as symbol$2, Us as toPredicate, Vc as succeed$1, Vn as context, Vs as compose, W as decodeEffect, Wa as _await, Wc as add, Xa as into, Xi as isSchedule, Xn as failCause, Xr as retry, Xs as isFinite, Yc as getUnsafe$1, Yn as fail$1, Zi as passthrough, Zr as runFork, _ as NonEmptyArray, _l as strictEqual, _s as makeSpanUnsafe, _t as isSchemaError, ai as scopedWith, al as getOrElse, ar as fnUntraced, bi as timeoutOrElse, bl as PipeInspectableProto, bo as filterInterruptors, bs as reportCauseUnsafe, c as Defect, ca as Clock, cc as toSeconds, cu as flow, da as Error$1, dl as match, do as Done, du as pipeArguments, eo as makeUnsafe$2, fa as TaggedError, fi as suspend, fl as none, fr as gen, ga as effect, gl as make$14, h as Literals, hc as fromIterable$1, hr as interrupt, in as make$13, io as failCause$1, iu as constUndefined, jc as empty$6, jl as Class, jr as matchCauseEffect, kc as map$2, ki as useSpan, ko as isTimeoutError, li as succeed, ll as isSome, lu as identity, mo as StackTrace, n as ArraySchema, ni as runSync, nr as flatMapEager, nu as constFalse, on as stringOrRedacted, oo as isFailure, ou as constant, pi as sync, pl as some, q as decodeTo, qn as ensuring, qr as raceFirst, qs as fromInputUnsafe, qt as transform, ra as isDoneCause, rc as seconds, rl as fromNullishOr, ro as fail$2, ru as constTrue, sl as getOrUndefined, su as dual, tr as flatMap, u as ErrorClass, va as effectDiscard, vo as done, vr as isEffect, vt as link, w as String$1, wo as hasInterrupts, x as Number$1, xi as tryPromise, yc as isReadonlyArrayNonEmpty, yn as acquireRelease, yr as log, zl as symbol$1, zs as externalSpan } from "./Schema-Ay3DUM83.mjs";
|
|
4
|
+
import { $ as suspend$1, B as onExit, C as fromChannel, Et as runFold, J as runForEach, Jt as make$15, Qt as getCurrent, St as fromPull, W as run$1, Xt as makeUnsafe$4, Yt as set$4, _ as fail$3, a as Size, en as interruptAll, g as ensuring$1, it as toReadableStreamEffect, k as fromReadableStream, r as FileSystem, t as Path, wt as fromTransform } from "./Path-BIaGSU2M.mjs";
|
|
5
5
|
//#region ../../node_modules/.bun/effect@4.0.0-beta.51/node_modules/effect/dist/UndefinedOr.js
|
|
6
6
|
/**
|
|
7
7
|
* @since 4.0.0
|
|
@@ -152,6 +152,46 @@ const constInterruptedFiber = /* @__PURE__ */ function() {
|
|
|
152
152
|
};
|
|
153
153
|
}();
|
|
154
154
|
/**
|
|
155
|
+
* Fork an Effect and add the forked fiber to the FiberSet.
|
|
156
|
+
* When the fiber completes, it will be removed from the FiberSet.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* import { Effect, Fiber, FiberSet } from "effect"
|
|
161
|
+
*
|
|
162
|
+
* const program = Effect.gen(function*() {
|
|
163
|
+
* const set = yield* FiberSet.make()
|
|
164
|
+
*
|
|
165
|
+
* // Fork and add to set
|
|
166
|
+
* const fiber1 = yield* FiberSet.run(set, Effect.succeed("hello"))
|
|
167
|
+
* const fiber2 = yield* FiberSet.run(set, Effect.succeed("world"))
|
|
168
|
+
*
|
|
169
|
+
* // Get results
|
|
170
|
+
* const result1 = yield* Fiber.await(fiber1)
|
|
171
|
+
* const result2 = yield* Fiber.await(fiber2)
|
|
172
|
+
*
|
|
173
|
+
* console.log(result1, result2) // "hello" "world"
|
|
174
|
+
* })
|
|
175
|
+
* ```
|
|
176
|
+
*
|
|
177
|
+
* @since 2.0.0
|
|
178
|
+
* @category combinators
|
|
179
|
+
*/
|
|
180
|
+
const run = function() {
|
|
181
|
+
const self = arguments[0];
|
|
182
|
+
if (!isEffect(arguments[1])) {
|
|
183
|
+
const options = arguments[1];
|
|
184
|
+
return (effect) => runImpl(self, effect, options);
|
|
185
|
+
}
|
|
186
|
+
return runImpl(self, arguments[1], arguments[2]);
|
|
187
|
+
};
|
|
188
|
+
const runImpl = (self, effect, options) => withFiber((parent) => {
|
|
189
|
+
if (self.state._tag === "Closed") return sync(constInterruptedFiber);
|
|
190
|
+
const fiber = runForkWith(parent.context)(effect);
|
|
191
|
+
addUnsafe(self, fiber, options);
|
|
192
|
+
return succeed(fiber);
|
|
193
|
+
});
|
|
194
|
+
/**
|
|
155
195
|
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
|
|
156
196
|
*
|
|
157
197
|
* @example
|
|
@@ -724,7 +764,7 @@ function makeCookie(name, value, options) {
|
|
|
724
764
|
if (options.path !== void 0 && !fieldContentRegExp.test(options.path)) return fail(CookiesError.fromReason("InvalidCookiePath"));
|
|
725
765
|
if (options.maxAge !== void 0 && !isFinite(fromInputUnsafe(options.maxAge))) return fail(CookiesError.fromReason("CookieInfinityMaxAge"));
|
|
726
766
|
}
|
|
727
|
-
return succeed(Object.assign(Object.create(CookieProto), {
|
|
767
|
+
return succeed$1(Object.assign(Object.create(CookieProto), {
|
|
728
768
|
name,
|
|
729
769
|
value,
|
|
730
770
|
valueEncoded: encodedValue,
|
|
@@ -751,7 +791,7 @@ const setAll$2 = /* @__PURE__ */ dual(2, (self, cookies) => {
|
|
|
751
791
|
if (isFailure$1(result)) return result;
|
|
752
792
|
record[name] = result.success;
|
|
753
793
|
}
|
|
754
|
-
return succeed(fromReadonlyRecord(record));
|
|
794
|
+
return succeed$1(fromReadonlyRecord(record));
|
|
755
795
|
});
|
|
756
796
|
/**
|
|
757
797
|
* Serialize a cookie into a string
|
|
@@ -1093,7 +1133,7 @@ const makeUrl = (url, params, hash) => {
|
|
|
1093
1133
|
if (value !== void 0) urlInstance.searchParams.append(key, value);
|
|
1094
1134
|
}
|
|
1095
1135
|
if (hash !== void 0) urlInstance.hash = hash;
|
|
1096
|
-
return succeed(urlInstance);
|
|
1136
|
+
return succeed$1(urlInstance);
|
|
1097
1137
|
} catch (e) {
|
|
1098
1138
|
return fail(new UrlParamsError({ cause: e }));
|
|
1099
1139
|
}
|
|
@@ -1769,7 +1809,7 @@ const matchStatus = /* @__PURE__ */ dual(2, (self, cases) => {
|
|
|
1769
1809
|
* @since 4.0.0
|
|
1770
1810
|
* @category filters
|
|
1771
1811
|
*/
|
|
1772
|
-
const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed
|
|
1812
|
+
const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed(self) : fail$1(new HttpClientError({ reason: new StatusCodeError({
|
|
1773
1813
|
response: self,
|
|
1774
1814
|
request: self.request,
|
|
1775
1815
|
description: "non 2xx status code"
|
|
@@ -2099,20 +2139,20 @@ const notFound = /* @__PURE__ */ empty({ status: 404 });
|
|
|
2099
2139
|
* @category accessors
|
|
2100
2140
|
*/
|
|
2101
2141
|
const toResponseOrElse = (u, orElse) => {
|
|
2102
|
-
if (isHttpServerResponse(u)) return succeed
|
|
2103
|
-
else if (isRespondable(u)) return catchCause(u[symbol](), () => succeed
|
|
2104
|
-
else if (isSchemaError(u)) return succeed
|
|
2105
|
-
else if (isNoSuchElementError(u)) return succeed
|
|
2106
|
-
return succeed
|
|
2142
|
+
if (isHttpServerResponse(u)) return succeed(u);
|
|
2143
|
+
else if (isRespondable(u)) return catchCause(u[symbol](), () => succeed(orElse));
|
|
2144
|
+
else if (isSchemaError(u)) return succeed(badRequest);
|
|
2145
|
+
else if (isNoSuchElementError(u)) return succeed(notFound);
|
|
2146
|
+
return succeed(orElse);
|
|
2107
2147
|
};
|
|
2108
2148
|
/**
|
|
2109
2149
|
* @since 4.0.0
|
|
2110
2150
|
* @category accessors
|
|
2111
2151
|
*/
|
|
2112
2152
|
const toResponseOrElseDefect = (u, orElse) => {
|
|
2113
|
-
if (isHttpServerResponse(u)) return succeed
|
|
2114
|
-
else if (isRespondable(u)) return catchCause(u[symbol](), () => succeed
|
|
2115
|
-
return succeed
|
|
2153
|
+
if (isHttpServerResponse(u)) return succeed(u);
|
|
2154
|
+
else if (isRespondable(u)) return catchCause(u[symbol](), () => succeed(orElse));
|
|
2155
|
+
return succeed(orElse);
|
|
2116
2156
|
};
|
|
2117
2157
|
//#endregion
|
|
2118
2158
|
//#region ../../node_modules/.bun/effect@4.0.0-beta.51/node_modules/effect/dist/unstable/http/Etag.js
|
|
@@ -2320,7 +2360,7 @@ const make$7 = (f) => makeWith((effect) => flatMap(effect, (request) => withFibe
|
|
|
2320
2360
|
return uninterruptibleMask((restore) => matchCauseEffect(restore(effect), {
|
|
2321
2361
|
onSuccess(response) {
|
|
2322
2362
|
responseRegistry.register(response, controller);
|
|
2323
|
-
return succeed
|
|
2363
|
+
return succeed(new InterruptibleResponse(response, controller));
|
|
2324
2364
|
},
|
|
2325
2365
|
onFailure(cause) {
|
|
2326
2366
|
if (hasInterrupts(cause)) controller.abort();
|
|
@@ -2346,9 +2386,9 @@ const make$7 = (f) => makeWith((effect) => flatMap(effect, (request) => withFibe
|
|
|
2346
2386
|
span.attribute("http.response.status_code", response.status);
|
|
2347
2387
|
const redactedHeaders = redact(response.headers, redactedHeaderNames);
|
|
2348
2388
|
for (const name in redactedHeaders) span.attribute(`http.response.header.${name}`, String(redactedHeaders[name]));
|
|
2349
|
-
if (scopedController) return succeed
|
|
2389
|
+
if (scopedController) return succeed(response);
|
|
2350
2390
|
responseRegistry.register(response, controller);
|
|
2351
|
-
return succeed
|
|
2391
|
+
return succeed(new InterruptibleResponse(response, controller));
|
|
2352
2392
|
},
|
|
2353
2393
|
onFailure(cause) {
|
|
2354
2394
|
if (!scopedController && hasInterrupts(cause)) controller.abort();
|
|
@@ -2356,7 +2396,7 @@ const make$7 = (f) => makeWith((effect) => flatMap(effect, (request) => withFibe
|
|
|
2356
2396
|
}
|
|
2357
2397
|
})));
|
|
2358
2398
|
});
|
|
2359
|
-
})), succeed
|
|
2399
|
+
})), succeed);
|
|
2360
2400
|
/**
|
|
2361
2401
|
* Appends a transformation of the request object before sending it.
|
|
2362
2402
|
*
|
|
@@ -2525,7 +2565,7 @@ var RequestInit = class extends Service()("effect/http/FetchHttpClient/RequestIn
|
|
|
2525
2565
|
* @since 4.0.0
|
|
2526
2566
|
* @category layers
|
|
2527
2567
|
*/
|
|
2528
|
-
const layer$1 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed
|
|
2568
|
+
const layer$1 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed(/* @__PURE__ */ make$7((request, url, signal, fiber) => {
|
|
2529
2569
|
const fetch = fiber.getRef(Fetch);
|
|
2530
2570
|
const options = fiber.context.mapUnsafe.get(RequestInit.key) ?? {};
|
|
2531
2571
|
const headers = options.headers ? merge(fromInput$1(options.headers), request.headers) : request.headers;
|
|
@@ -2596,7 +2636,7 @@ var RequestParseError = class extends TaggedError("RequestParseError") {
|
|
|
2596
2636
|
* @since 4.0.0
|
|
2597
2637
|
*/
|
|
2598
2638
|
[symbol]() {
|
|
2599
|
-
return succeed
|
|
2639
|
+
return succeed(empty({ status: 400 }));
|
|
2600
2640
|
}
|
|
2601
2641
|
get methodAndUrl() {
|
|
2602
2642
|
return `${this.request.method} ${this.request.url}`;
|
|
@@ -2611,7 +2651,7 @@ var RequestParseError = class extends TaggedError("RequestParseError") {
|
|
|
2611
2651
|
*/
|
|
2612
2652
|
var RouteNotFound = class extends TaggedError("RouteNotFound") {
|
|
2613
2653
|
[symbol]() {
|
|
2614
|
-
return succeed
|
|
2654
|
+
return succeed(empty({ status: 404 }));
|
|
2615
2655
|
}
|
|
2616
2656
|
[ignore] = true;
|
|
2617
2657
|
get methodAndUrl() {
|
|
@@ -2628,7 +2668,7 @@ TaggedError("InternalError");
|
|
|
2628
2668
|
*/
|
|
2629
2669
|
var ResponseError = class extends TaggedError("ResponseError") {
|
|
2630
2670
|
[symbol]() {
|
|
2631
|
-
return succeed
|
|
2671
|
+
return succeed(empty({ status: 500 }));
|
|
2632
2672
|
}
|
|
2633
2673
|
get methodAndUrl() {
|
|
2634
2674
|
return `${this.request.method} ${this.request.url}`;
|
|
@@ -2688,7 +2728,7 @@ const causeResponse = (cause) => {
|
|
|
2688
2728
|
break;
|
|
2689
2729
|
}
|
|
2690
2730
|
}
|
|
2691
|
-
if (response) return succeed
|
|
2731
|
+
if (response) return succeed([response, fromReasons(failures)]);
|
|
2692
2732
|
else if (interrupts.length > 0 && failures.length === 0) {
|
|
2693
2733
|
failures.push(...interrupts);
|
|
2694
2734
|
effect = isClientInterrupt ? clientAbortError : serverAbortError;
|
|
@@ -2713,9 +2753,9 @@ const causeResponseStripped = (cause) => {
|
|
|
2713
2753
|
return [response ?? internalServerError, failures.length > 0 ? some(fromReasons(failures)) : none()];
|
|
2714
2754
|
};
|
|
2715
2755
|
const internalServerError = /* @__PURE__ */ empty({ status: 500 });
|
|
2716
|
-
const succeedInternalServerError = /* @__PURE__ */ succeed
|
|
2717
|
-
const clientAbortError = /* @__PURE__ */ succeed
|
|
2718
|
-
const serverAbortError = /* @__PURE__ */ succeed
|
|
2756
|
+
const succeedInternalServerError = /* @__PURE__ */ succeed(internalServerError);
|
|
2757
|
+
const clientAbortError = /* @__PURE__ */ succeed(/* @__PURE__ */ empty({ status: 499 }));
|
|
2758
|
+
const serverAbortError = /* @__PURE__ */ succeed(/* @__PURE__ */ empty({ status: 503 }));
|
|
2719
2759
|
/**
|
|
2720
2760
|
* @since 4.0.0
|
|
2721
2761
|
*/
|
|
@@ -2807,7 +2847,7 @@ var SocketCloseError = class extends ErrorClass("effect/socket/Socket/SocketClos
|
|
|
2807
2847
|
*/
|
|
2808
2848
|
static filterClean(isClean) {
|
|
2809
2849
|
return function(u) {
|
|
2810
|
-
return SocketError.is(u) && u.reason._tag === "SocketCloseError" && isClean(u.reason.code) ? succeed(u.reason) : fail(u);
|
|
2850
|
+
return SocketError.is(u) && u.reason._tag === "SocketCloseError" && isClean(u.reason.code) ? succeed$1(u.reason) : fail(u);
|
|
2811
2851
|
};
|
|
2812
2852
|
}
|
|
2813
2853
|
get message() {
|
|
@@ -2933,8 +2973,8 @@ const fromWebSocket = (acquire, options) => withFiber((fiber) => {
|
|
|
2933
2973
|
if (isCloseEvent(chunk)) ws.close(chunk.code, chunk.reason);
|
|
2934
2974
|
else ws.send(chunk);
|
|
2935
2975
|
}));
|
|
2936
|
-
const writer = succeed
|
|
2937
|
-
return succeed
|
|
2976
|
+
const writer = succeed(write);
|
|
2977
|
+
return succeed(Socket.of({
|
|
2938
2978
|
[TypeId$2]: TypeId$2,
|
|
2939
2979
|
run,
|
|
2940
2980
|
runRaw,
|
|
@@ -3878,7 +3918,7 @@ var MultipartError = class MultipartError extends TaggedError("MultipartError")
|
|
|
3878
3918
|
*/
|
|
3879
3919
|
const makeConfig = (headers) => withFiber((fiber) => {
|
|
3880
3920
|
const mimeTypes = get$2(fiber.context, FieldMimeTypes);
|
|
3881
|
-
return succeed
|
|
3921
|
+
return succeed({
|
|
3882
3922
|
headers,
|
|
3883
3923
|
maxParts: fiber.getRef(MaxParts),
|
|
3884
3924
|
maxFieldSize: Number(fiber.getRef(MaxFieldSize)),
|
|
@@ -3902,11 +3942,11 @@ const makeChannel = (headers) => fromTransform((upstream) => map$1(makeConfig(he
|
|
|
3902
3942
|
onFile(info) {
|
|
3903
3943
|
let chunks = [];
|
|
3904
3944
|
let finished = false;
|
|
3905
|
-
const pullChunks = fromPull(succeed
|
|
3945
|
+
const pullChunks = fromPull(succeed(suspend(function loop() {
|
|
3906
3946
|
if (!isReadonlyArrayNonEmpty(chunks)) return finished ? done() : flatMap(pump, loop);
|
|
3907
3947
|
const chunk = chunks;
|
|
3908
3948
|
chunks = [];
|
|
3909
|
-
return succeed
|
|
3949
|
+
return succeed(chunk);
|
|
3910
3950
|
})));
|
|
3911
3951
|
partsBuffer.push(new FileImpl(info, pullChunks));
|
|
3912
3952
|
return function(chunk) {
|
|
@@ -3936,7 +3976,7 @@ const makeChannel = (headers) => fromTransform((upstream) => map$1(makeConfig(he
|
|
|
3936
3976
|
}
|
|
3937
3977
|
const parts = partsBuffer;
|
|
3938
3978
|
partsBuffer = [];
|
|
3939
|
-
return succeed
|
|
3979
|
+
return succeed(parts);
|
|
3940
3980
|
}));
|
|
3941
3981
|
}));
|
|
3942
3982
|
function convertError(cause) {
|
|
@@ -4003,7 +4043,7 @@ var FileImpl = class extends PartBase {
|
|
|
4003
4043
|
};
|
|
4004
4044
|
}
|
|
4005
4045
|
};
|
|
4006
|
-
const defaultWriteFile = (path, file) => flatMap(FileSystem.asEffect(), (fs) => mapError(run(file.content, fs.sink(path)), (cause) => MultipartError.fromReason("InternalError", cause)));
|
|
4046
|
+
const defaultWriteFile = (path, file) => flatMap(FileSystem.asEffect(), (fs) => mapError(run$1(file.content, fs.sink(path)), (cause) => MultipartError.fromReason("InternalError", cause)));
|
|
4007
4047
|
/**
|
|
4008
4048
|
* @since 4.0.0
|
|
4009
4049
|
*/
|
|
@@ -4319,10 +4359,10 @@ const cors = (options) => {
|
|
|
4319
4359
|
...maxAge
|
|
4320
4360
|
});
|
|
4321
4361
|
};
|
|
4322
|
-
const preResponseHandler = (request, response) => succeed
|
|
4362
|
+
const preResponseHandler = (request, response) => succeed(setHeaders(response, headersFromRequest(request)));
|
|
4323
4363
|
return (httpApp) => withFiber((fiber) => {
|
|
4324
4364
|
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
4325
|
-
if (request.method === "OPTIONS") return succeed
|
|
4365
|
+
if (request.method === "OPTIONS") return succeed(empty({
|
|
4326
4366
|
status: 204,
|
|
4327
4367
|
headers: headersFromRequestOptions(request)
|
|
4328
4368
|
}));
|
|
@@ -4342,7 +4382,7 @@ const toHandled = (self, handleResponse, middleware) => {
|
|
|
4342
4382
|
reportCauseUnsafe(fiber, cause);
|
|
4343
4383
|
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
4344
4384
|
const handler = requestPreResponseHandlers.get(request.source);
|
|
4345
|
-
const cont = cause.reasons.length === 0 ? succeed
|
|
4385
|
+
const cont = cause.reasons.length === 0 ? succeed(response) : failCause(cause);
|
|
4346
4386
|
if (handler === void 0) {
|
|
4347
4387
|
request[handledSymbol] = true;
|
|
4348
4388
|
return flatMapEager(handleResponse(request, response), () => cont);
|
|
@@ -4521,6 +4561,6 @@ const makeTestClient = /* @__PURE__ */ gen(function* () {
|
|
|
4521
4561
|
*/
|
|
4522
4562
|
const layerTestClient = /* @__PURE__ */ effect(HttpClient)(makeTestClient);
|
|
4523
4563
|
//#endregion
|
|
4524
|
-
export { file as $, SocketErrorReason as A, merge as At, ServeError as B, set$2 as Bt, makeConfig as C, HttpClientErrorSchema as Ct, Socket as D, empty$4 as Dt, make$3 as E, fromInput as Et, ClientAbort as F, getAndSet as Ft, TracerPropagationEnabled as G,
|
|
4564
|
+
export { file as $, SocketErrorReason as A, merge as At, ServeError as B, set$2 as Bt, makeConfig as C, HttpClientErrorSchema as Ct, Socket as D, empty$4 as Dt, make$3 as E, fromInput as Et, ClientAbort as F, getAndSet as Ft, TracerPropagationEnabled as G, run as Gt, RequestInit as H, updateAndGet as Ht, HttpServerError as I, getUnsafe as It, transformResponse as J, filterStatusOk as K, runtime as Kt, RequestParseError as L, make$11 as Lt, defaultCloseCodeIsError as M, parseHeader as Mt, fromWebSocket as N, toSetCookieHeaders as Nt, SocketCloseError as O, fromInput$1 as Ot, isCloseEvent as P, get$1 as Pt, empty as Q, ResponseError as R, makeUnsafe as Rt, makeChannel as S, setBody$1 as St, decodeField as T, jsonUnsafe$1 as Tt, layer$1 as U, join as Ut, causeResponse as V, update as Vt, HttpClient as W, make$12 as Wt, layerWeak as X, layer$2 as Y, symbol as Z, schemaBodyUrlParams as _, acceptJson as _t, withLogAddress as a, setCookie as at, MultipartError as b, get as bt, scopeTransferToStream as c, stream as ct, logger as d, filterStatusOk$1 as dt, isHttpServerResponse as et, withLoggerDisabled as f, matchStatus as ft, schemaBodyJson as g, schemaBodyJson$1 as gt, TypeId as h, inspect as ht, serve as i, schemaJson as it, TypeId$2 as j, isEmpty as jt, SocketError as k, fromRecordUnsafe as kt, toHandled as l, text as lt, ParsedSearchParams as m, TypeId$7 as mt, layerTestClient as n, raw as nt, HttpPlatform as o, setCookies as ot, HttpServerRequest as p, MaxBodySize as pt, retryTransient as q, make as r, redirect as rt, make$1 as s, setHeader as st, HttpServer as t, jsonUnsafe as tt, cors as u, uint8Array as ut, schemaHeaders as v, bearerToken as vt, toPersisted as w, isHttpClientError as wt, TypeId$1 as x, post as xt, toURL as y, bodyJson as yt, RouteNotFound as z, modify$1 as zt };
|
|
4525
4565
|
|
|
4526
|
-
//# sourceMappingURL=HttpServer-
|
|
4566
|
+
//# sourceMappingURL=HttpServer-BbbI8N6_.mjs.map
|
|
@@ -153,6 +153,46 @@ const constInterruptedFiber = /* @__PURE__ */ function() {
|
|
|
153
153
|
};
|
|
154
154
|
}();
|
|
155
155
|
/**
|
|
156
|
+
* Fork an Effect and add the forked fiber to the FiberSet.
|
|
157
|
+
* When the fiber completes, it will be removed from the FiberSet.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* import { Effect, Fiber, FiberSet } from "effect"
|
|
162
|
+
*
|
|
163
|
+
* const program = Effect.gen(function*() {
|
|
164
|
+
* const set = yield* FiberSet.make()
|
|
165
|
+
*
|
|
166
|
+
* // Fork and add to set
|
|
167
|
+
* const fiber1 = yield* FiberSet.run(set, Effect.succeed("hello"))
|
|
168
|
+
* const fiber2 = yield* FiberSet.run(set, Effect.succeed("world"))
|
|
169
|
+
*
|
|
170
|
+
* // Get results
|
|
171
|
+
* const result1 = yield* Fiber.await(fiber1)
|
|
172
|
+
* const result2 = yield* Fiber.await(fiber2)
|
|
173
|
+
*
|
|
174
|
+
* console.log(result1, result2) // "hello" "world"
|
|
175
|
+
* })
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @since 2.0.0
|
|
179
|
+
* @category combinators
|
|
180
|
+
*/
|
|
181
|
+
const run = function() {
|
|
182
|
+
const self = arguments[0];
|
|
183
|
+
if (!require_Schema.isEffect(arguments[1])) {
|
|
184
|
+
const options = arguments[1];
|
|
185
|
+
return (effect) => runImpl(self, effect, options);
|
|
186
|
+
}
|
|
187
|
+
return runImpl(self, arguments[1], arguments[2]);
|
|
188
|
+
};
|
|
189
|
+
const runImpl = (self, effect, options) => require_Schema.withFiber((parent) => {
|
|
190
|
+
if (self.state._tag === "Closed") return require_Schema.sync(constInterruptedFiber);
|
|
191
|
+
const fiber = require_Schema.runForkWith(parent.context)(effect);
|
|
192
|
+
addUnsafe(self, fiber, options);
|
|
193
|
+
return require_Schema.succeed(fiber);
|
|
194
|
+
});
|
|
195
|
+
/**
|
|
156
196
|
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
|
|
157
197
|
*
|
|
158
198
|
* @example
|
|
@@ -4972,6 +5012,12 @@ Object.defineProperty(exports, "retryTransient", {
|
|
|
4972
5012
|
return retryTransient;
|
|
4973
5013
|
}
|
|
4974
5014
|
});
|
|
5015
|
+
Object.defineProperty(exports, "run", {
|
|
5016
|
+
enumerable: true,
|
|
5017
|
+
get: function() {
|
|
5018
|
+
return run;
|
|
5019
|
+
}
|
|
5020
|
+
});
|
|
4975
5021
|
Object.defineProperty(exports, "runtime", {
|
|
4976
5022
|
enumerable: true,
|
|
4977
5023
|
get: function() {
|
|
@@ -5129,4 +5175,4 @@ Object.defineProperty(exports, "withLoggerDisabled", {
|
|
|
5129
5175
|
}
|
|
5130
5176
|
});
|
|
5131
5177
|
|
|
5132
|
-
//# sourceMappingURL=HttpServer-
|
|
5178
|
+
//# sourceMappingURL=HttpServer-CRBqMWdP.cjs.map
|
|
@@ -4,7 +4,7 @@ import { Ai as void_, An as cached, Ca as mergeAll, Ea as succeed$1, Er as map,
|
|
|
4
4
|
import { N as map$1, V as orDie, Xt as makeUnsafe$1, Y as runForEachArray, st as unwrap, tn as runIn } from "./Path-BIaGSU2M.mjs";
|
|
5
5
|
import { f as fromReadable, h as toUint8Array, m as toString, p as toArrayBuffer } from "./NodeTerminal-CeaWke6-.mjs";
|
|
6
6
|
import { n as layer$3, r as layer$2 } from "./NodeServices-Bt1GwPBR.mjs";
|
|
7
|
-
import { At as merge, B as ServeError, C as makeConfig, E as make$4, Et as fromInput$1, F as ClientAbort, H as RequestInit, I as HttpServerError, L as RequestParseError, Mt as parseHeader, N as fromWebSocket, Nt as toSetCookieHeaders, Ot as fromInput, R as ResponseError, T as decodeField, U as layer$5, V as causeResponse, X as layerWeak, Y as layer$4, b as MultipartError, h as TypeId$2, ht as inspect, jt as isEmpty, kt as fromRecordUnsafe, l as toHandled, mt as TypeId, n as layerTestClient, nt as raw, o as HttpPlatform, p as HttpServerRequest, pt as MaxBodySize, r as make$5, s as make$3, t as HttpServer, w as toPersisted, x as TypeId$1 } from "./HttpServer-
|
|
7
|
+
import { At as merge, B as ServeError, C as makeConfig, E as make$4, Et as fromInput$1, F as ClientAbort, H as RequestInit, I as HttpServerError, L as RequestParseError, Mt as parseHeader, N as fromWebSocket, Nt as toSetCookieHeaders, Ot as fromInput, R as ResponseError, T as decodeField, U as layer$5, V as causeResponse, X as layerWeak, Y as layer$4, b as MultipartError, h as TypeId$2, ht as inspect, jt as isEmpty, kt as fromRecordUnsafe, l as toHandled, mt as TypeId, n as layerTestClient, nt as raw, o as HttpPlatform, p as HttpServerRequest, pt as MaxBodySize, r as make$5, s as make$3, t as HttpServer, w as toPersisted, x as TypeId$1 } from "./HttpServer-BbbI8N6_.mjs";
|
|
8
8
|
import { h as unwrap$1 } from "./Config-BnFFyBjD.mjs";
|
|
9
9
|
import { n as import_websocket_server, t as Mime_default } from "./Mime-Dq9IoNiV.mjs";
|
|
10
10
|
import { Duplex, Readable } from "node:stream";
|
|
@@ -602,4 +602,4 @@ const handleCause = (nodeResponse, originalResponse) => (originalCause) => flatM
|
|
|
602
602
|
//#endregion
|
|
603
603
|
export { layer, layerConfig, layerHttpServices, layerServer, layerTest, make, makeHandler, makeUpgradeHandler };
|
|
604
604
|
|
|
605
|
-
//# sourceMappingURL=NodeHttpServer-
|
|
605
|
+
//# sourceMappingURL=NodeHttpServer-BngJqAIT.mjs.map
|
|
@@ -5,7 +5,7 @@ const require_Schema = require("./Schema-DxddW8-V.cjs");
|
|
|
5
5
|
const require_Path = require("./Path-Dp3btyUm.cjs");
|
|
6
6
|
const require_NodeTerminal = require("./NodeTerminal-DQESKR0W.cjs");
|
|
7
7
|
const require_NodeServices = require("./NodeServices-BkfWZHfh.cjs");
|
|
8
|
-
const require_HttpServer = require("./HttpServer-
|
|
8
|
+
const require_HttpServer = require("./HttpServer-CRBqMWdP.cjs");
|
|
9
9
|
const require_Config = require("./Config-pbf0GGHJ.cjs");
|
|
10
10
|
const require_Mime = require("./Mime-Bilnh8zE.cjs");
|
|
11
11
|
let node_stream = require("node:stream");
|
|
@@ -613,4 +613,4 @@ exports.make = make;
|
|
|
613
613
|
exports.makeHandler = makeHandler;
|
|
614
614
|
exports.makeUpgradeHandler = makeUpgradeHandler;
|
|
615
615
|
|
|
616
|
-
//# sourceMappingURL=NodeHttpServer-
|
|
616
|
+
//# sourceMappingURL=NodeHttpServer-DyI6OyMg.cjs.map
|