@deslop/stash 0.1.1091 → 0.1.1092
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/cli.js +2 -2
- package/dist/{contracts-C1Rqhg6U.mjs → contracts-nyOWldn4.mjs} +120 -47
- package/dist/server.js +310 -170
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --max-old-space-size=16384 --heapsnapshot-near-heap-limit=3 --report-on-fatalerror
|
|
2
|
-
import { $ as succeed$5, $a as badArgument, $c as split, $d as make$40, $f as isUndefined, $i as mkString, $l as CurrentLogSpans, $n as toJsonSchemaDocument, $o as flatMap, $r as Suspend, $s as serviceOption, $u as groupBy, A as SignInParams, Aa as collect, Ad as isResult, Af as Prototype, Ai as empty$10, Al as buildWithMemoMap, An as decodeUnknownOption, Ao as as$1, Ar as make$45, As as never, At as fromWebSocket, Au as random$1, Ba as takeAll, Bc as Random$2, Bd as minutes, Bf as NodeInspectSymbol, Bi as fromIterable, Bl as succeedContext, Bn as isMinLength, Bo as catchReason, Br as fromReadable, Bs as provideContext, Bt as TransportError, Bu as empty$11, C as AuthError, Ca as map$4, Cc as withFiberSucceed, Cd as headUnsafe, Cf as some$1, Ci as FileSystem, Cn as UndefinedOr, Co as isUnicast, Cr as get$7, Cs as map$1, Ct as makeCollectorUnsafe, D as OAuthTokenError, Da as make$36, Dc as withTracerEnabled, Dd as fromOption$1, Df as combine$1, Di as concat, Dl as prettyErrors, Dn as decodeSync, Do as andThen, Dr as set$3, Ds as matchCauseEffect, Du as externalSpan, E as OAuthFlow, Ea as pipeTo, Ec as withSpan, Ed as failVoid, Ef as String$3, Ei as catch_$1, El as makeDieReason, En as decodeEffect, Eo as all$1, Er as remove$3, Et as SocketError, Eu as Tracer, F as runMain, Fa as offerAll, Fc as passthrough, Fd as days, Ff as assignProperty, Fi as flatMap$3, Fl as merge$3, Fn as fromJsonString, Fo as catchCause, Fr as fromSetCookie, Fs as option$1, Ft as EncodeError, Fu as appendAll, G as Port, Ga as makeUnsafe$6, Gc as isNonEmpty, Gd as Reference, Gf as hash, Gi as limitBytes, Gl as addFinalizerExit, Gn as makeFilter, Go as contextWith, Gr as make$43, Gs as result$1, Gu as findFirst, H as layer$10, Ha as unbounded, Hc as endsWith, Hd as seconds, Hf as format$1, Hi as fromQueue, Hl as unwrap$3, Hn as isSchema, Ho as catchTags, Hr as toArrayBuffer, Hs as provideServiceEffect, Ht as Any, Hu as every, Ia as offerUnsafe, Ic as spaced, Id as format$2, If as getStackTraceLimit, Ii as flattenIterable, Il as mergeAll, In as is$4, Ir as isEmpty$1, Is as orDie, It as HttpClientError, Iu as contains$1, J as String$2, Ja as interrupt$2, Jc as padStart, Jf as isNotNull, Ji as mapArray, Jl as forkUnsafe$1, Jn as optionalKey, Jo as ensuring$1, Jr as Filter, Js as runFork, Jt as DateTimeUtcFromString, Ju as flatMap$2, K as Record, Ka as await_, Kc as length, Kd as Service, Kf as hasProperty, Ki as map$2, Kl as close, Kn as mutable, Kr as ChildProcessSpawner, Ks as retry, Kt as Class$1, Ku as findFirstIndex, La as shutdown, Lc as toStep, Ld as fromInputUnsafe$1, Lf as setStackTraceLimit, Li as fromArray, Ll as provide$1, Ln as isGreaterThanOrEqualTo, Lo as catchDefect, Lr as parseHeader, Ls as orElseSucceed, Lu as dedupe, Ma as failCause$2, Mc as fromStep, Md as match$3, Mf as contA, Mi as fail$2, Ml as effectContext, Mn as encodeSync, Mo as asVoid, Mr as stringOrRedacted, Ms as onExit, Mu as TaggedClass, N as layer$12, Na as make$38, Nc as isSchedule, Nd as succeed, Nf as contE, Ni as failCause$3, Nl as effectDiscard, Nn as encodeTo, No as cached, Nr as empty$9, Ns as onExitPrimitive, Nt as DecodeError, Nu as TaggedError, O as OAuthTokenResponse, Oa as makeUnsafe$7, Oc as zipWith, Od as getSuccess, Of as flip, Oi as decodeText, Ol as squash, On as decodeTo, Oo as annotateCurrentSpan, Or as setAll, Os as matchCauseEffectEager, Ot as SocketOpenError, Ou as make$42, P as make$41, Pa as offer, Pd as try_$1, Pi as filter$6, Pl as launch, Pn as encodeUnknownEffect$1, Po as callback, Pr as expireCookieUnsafe$1, Ps as onInterrupt, Pt as EmptyBodyError, Q as schema, Qa as runIn, Qc as slice$2, Qd as getUnsafe, Qf as isTagged, Qi as mergeAll$1, Ql as CurrentLogAnnotations, Qn as toEncoded$1, Qo as filterOrFail, Qr as PropertySignature, Qs as scoped, Qt as Exit$1, Qu as getUnsafe$1, R as layer$11, Rc as catchDone, Rd as max$1, Rf as BaseProto, Rl as provideMerge, Rn as isInt, Rr as setUnsafe$2, Rs as promise, Rt as InvalidUrlError, Ru as dedupeAdjacentWith, S as RpcAuth, Sa as fromTransform, Sc as withFiber, Sd as empty$12, Sf as orElseSome, Si as Path, Sl as hasInterruptsOnly, Sn as Uint8ArrayFromBase64, So as isPrivate, Sr as fromRecordUnsafe, Ss as makeSpanScoped, St as Collector, Su as reportCauseUnsafe, T as GitHubUser, Tc as withParentSpan, Td as fail, Tf as Number$1, Ti as catchTags$1, Tl as isTimeoutError, Tn as Unknown, To as acquireRelease, Tr as merge$2, Ts as mapError, Tu as ParentSpan, U as Crypto, Ua as make$35, Uc as includes, Ud as toMillis, Uf as redact, Ui as fromReadableStream, Ul as Scope, Un as isSchemaError$1, Uo as catch_, Ur as toUint8Array$1, Us as raceFirst, Ut as ArraySchema, Uu as filter$5, Va as publishUnsafe, Vc as camelToSnake, Vd as parts, Vf as toJson, Vi as fromPubSub, Vl as sync$1, Vn as isPattern, Vo as catchTag, Vr as pipeThroughDuplex, Vs as provideService, Vt as isHttpClientError, Vu as ensure, W as Array$1, Wa as set$2, Wc as isEmpty$2, Wd as zero$1, Wf as equals, Wi as groupedWithin, Wl as addFinalizer, Wn as make$44, Wo as context, Wr as fromWritable, Ws as repeat, Wt as Boolean$2, Wu as filterMap, X as all, Xa as interruptAllAs, Xc as replace$1, Xd as getOrUndefined$1, Xf as isNotUndefined, Xi as mapEffect, Xl as makeUnsafe$3, Xn as toCodecJson, Xo as fail$1, Xr as Literal$2, Xs as runSync, Xt as Duration, Xu as get$8, Y as URL$1, Ya as interruptAll, Yc as repeat$1, Yd as get$6, Yf as isNotNullish, Yi as mapArrayEffect, Yl as make$37, Yn as tag, Yo as exit, Yr as FilterGroup, Ys as runForkWith, Yt as Defect, Yu as fromIterable$1, Z as option, Za as interruptAs, Zc as replaceAll, Zd as getOrUndefinedUnsafe, Zf as isObject, Zi as mapError$1, Zl as provide$2, Zo as failCause, Zr as Objects, Zs as scope, Zt as Error$2, Zu as getSomes, _ as Organization, _a as toReadableStreamEffect, _c as updateService, _d as takeRight, _f as liftThrowable, _i as encode$1, _l as filterInterruptors, _o as ipFromStringUnsafe, _r as fromIterable$3, _s as logDebug, _t as ClientAbort$1, _u as fiberEnterInterruptibleUnsafe, a as FxConversation, aa as run$3, ac as tap$1, ad as join$1, af as filter$4, ai as null_, al as parse$10, an as MutableJson, ao as Dns, ap as constVoid, ar as omit, as as forkChild, at as RpcSerialization, au as isDeferred, b as AUTH_URL, ba as last$2, bc as when$2, bd as map$6, bf as none, bi as toEpochMillis, bl as hasDies, bn as URLFromString, bo as isLinkLocal, br as empty$8, bs as logInfo, bt as spanAttributes, bu as makeSpanUnsafe, c as GitHubIssue, ca as runForEachArray, cc as timeout, cd as map$3, cf as flatten, ci as resolveDescription, cl as currentTimeMillis, cn as Null, co as makeRecordUnsafe, cp as flow, cr as CurrentRedactedNames$1, cs as fromOption, ct as layerSchemaBinary, cu as fail$3, d as ImageType, da as scan, dc as transposeOption, dd as prepend$2, df as getOrElse, di as toEncoded, dl as StackTrace, dn as Record$1, do as NetAddressError, dp as pipeArguments, dr as redactUrl, ds as ignore$1, dt as constEof, du as isExit, ea as mkUint8Array, ec as sleep, ed as head, ef as makeUnsafe$4, ei as Union$1, el as startsWith, en as Finite, eo as fromInput$2, ep as or$1, er as toType, es as flatMapEager, et as unwrap$4, f as Note, fa as succeed$3, fc as tryPromise, fd as reduce, ff as getOrNull, fi as passthrough$1, fl as annotate, fn as Redacted$1, fo as formatInet, fr as setAll$1, fu as isFailure$1, g as OEmbed, ga as toReadableStream, gc as updateContext, gd as take$1, gf as liftPredicate, gi as encode, gl as fail$4, gn as TaggedError$1, go as ipFromString, gr as has$3, gs as log, gt as isWrapper, gu as effectIsExit, h as NotesError, ha as tap$2, hc as uninterruptibleMask, hd as sort, hf as isSome, hi as decode$3, hn as Struct, ho as inetAddressFromIpString, hr as fromIterable$2, hs as isEffect, ht as exitSchema, i as FileType, ia as provideService$1, ic as sync, id as isReadonlyArrayNonEmpty, if as exists, ii as mapOrSame, il as max$2, in as Literals, io as zero, ip as constUndefined, ir as isSchemaError, is as forever$1, iu as into, j as Verification, ja as end$1, jc as forever, jd as isSuccess, jf as PipeInspectableProto, ji as ensuring, jl as effect, jn as encodeEffect, jo as asSome, jr as value$2, js as onError, ju as Error$1, k as Session, kc as addDelay, kd as isFailure, kf as mapInput, ki as die$3, kl as CurrentMemoMap, kn as decodeUnknownEffect, ko as annotateLogs, kr as isRedacted, ks as matchEffect, ku as nativeTracer, l as GitHubReadme, lc as timeoutOption, lf as fromNullishOr, li as resolveIdentifier, ln as NullOr, lo as nameServerFromInput, lp as identity, lr as empty$7, ls as fromResult, lt as RequestId, lu as failCause$1, m as NoteJson, ma as takeUntil, mc as uninterruptible, md as some$2, mf as isNone, mi as transformOptional, ml as die$1, mn as StringFromUriComponent, mo as formatUrlUnsafe, mr as unwrap$1, ms as interruptible, mt as ServerClient, mu as succeed$4, n as Capture, na as orDie$1, nc as succeedNone, nd as isArrayNonEmpty, nf as all$2, ni as isNever, nl as trim, nn as Json, no as gibibytes, np as constFalse, nr as withDecodingDefault, ns as fnUntraced, nu as _await, o as FxStatus, oa as runCollect, oc as tapCause, od as last$1, of as flatMap$1, oi as optionalKey$1, on as Never, oo as DnsError, op as constant, or as getReferenceKey, os as forkIn, ot as json$1, ou as makeUnsafe$5, p as NoteId, pa as suspend$1, pc as try_, pd as reverse, pf as getOrUndefined, pi as transform$1, pl as combine, pn as String$1, po as formatIp, pr as toString$2, ps as interrupt, pt as constPong, pu as isSuccess$1, q as Redacted, qa as getCurrent, qc as match$2, qd as add$1, qf as isIterable, qi as mapAccum, ql as closeUnsafe, qn as optional$1, qo as die$2, qr as Arrays, qt as DateTimeUtc, r as Extraction, ra as pipeThroughChannel, rc as suspend, rd as isReadonlyArrayEmpty, rf as contains$2, ri as isOptional, rl as trimEnd, rn as Literal$1, ro as mebibytes, rp as constTrue, rr as withDecodingDefaultKey, rs as forEach, rt as withRun, ru as doneUnsafe, s as GitHubComment, sa as runForEach, sc as tapError$1, sd as lastNonEmpty, sf as flatMapNullishOr, si as replaceChecks, sl as Clock, sn as NonEmptyArray, so as make$39, sp as dual, sr as encodeUnknownEffect, ss as forkScoped, st as layerJson$1, su as die, t as RpcContracts, ta as onEnd, tc as succeed$1, td as headNonEmpty, tf as merge$1, ti as decodeTo$1, tl as toLowerCase, tn as Int, to as fromInputUnsafe, tp as compose$1, tr as withConstructorDefault, ts as fn$1, tt as withDefault, tu as TracerTimingEnabled, u as GitHubRepo, ua as runLast, uc as timeoutOrElse, ud as of, uf as fromUndefinedOr, ui as string, ul as IllegalArgumentError, un as Number$2, uo as domainNameFromStringUnsafe, up as pipe, ur as fromInput, us as gen, ut as ResponseDefectEncoded, uu as interrupt$1, v as Reader, vc as useSpan, vd as has$4, vf as map$5, vi as formatIso, vn as Tuple, vo as ipv4ToOctets, vr as get$9, vt as getStreamSchemas, vu as fiberEnterUninterruptibleUnsafe, w as CallbackParams, wc as withLogSpan, wd as make$46, wf as toArray$1, wi as catchReason$1, wl as isNoSuchElementError, wn as Union, wo as unixPathAddress, wr as isRedactedName, ws as mapEager, wt as CloseEvent, wu as DisablePropagation, x as CurrentUser, xc as whileLoop, xd as toEntries, xf as orElse$2, xi as defaultFormatter, xl as hasInterrupts, xn as Uint8Array$2, xo as isLoopback, xr as fromInput$1, xs as logWarning, xt as spanName, xu as onExitUnsafe, y as TikTokPage, ya as unwrap$2, yc as void_, yd as keys, yf as match$1, yi as now, yl as fromReasons, yn as URL$2, yo as isInetAddressV6, yr as CurrentRedactedNames, ys as logFatal, yt as isStreamSchema, yu as forkUnsafe, za as take, zd as millis, zf as Class, zi as fromEffect, zl as succeed$2, zn as isMaxLength, zo as catchIf, zr as toSetCookieHeaders, zs as provide$3, zt as StatusCodeError, zu as drop } from "./contracts-C1Rqhg6U.mjs";
|
|
2
|
+
import { $ as succeed$5, $a as interruptAs, $c as replaceAll, $d as get$6, $f as isNotNullish, $i as mapError$1, $l as make$38, $n as toJsonSchemaDocument, $o as failCause, $r as Objects, $s as scope, $u as fromIterable$1, A as SignInParams, Aa as makeUnsafe$8, Ac as zipWith, Ad as failVoid, Af as String$3, Ai as decodeText, Al as squash, An as decodeUnknownOption, Ao as annotateCurrentSpan, Ar as setAll, As as matchCauseEffectEager, At as fromWebSocket, Au as Tracer, Bc as catchDone, Bd as format$2, Bf as getStackTraceLimit, Bl as provide$1, Bn as isMinLength, Br as setUnsafe$2, Bs as promise, Bt as TransportError, Bu as contains$1, C as AuthError, Cc as whileLoop, Cd as keys, Cf as match$1, Ci as defaultFormatter, Cl as hasInterrupts, Cn as UndefinedOr, Co as isLoopback, Cr as fromInput$1, Cs as logWarning, Ct as makeCollectorUnsafe, Cu as forkUnsafe, D as OAuthTokenError, Dc as withParentSpan, Dd as headUnsafe, Df as some$1, Di as catchTags$1, Dl as isTimeoutError, Dn as decodeSync, Do as acquireRelease, Dr as merge$2, Ds as mapError, E as OAuthFlow, Ec as withLogSpan, Ed as empty$12, Ef as orElseSome, Ei as catchReason$1, El as isNoSuchElementError, En as decodeEffect, Eo as unixPathAddress, Er as isRedactedName, Es as mapEager, Et as SocketError, Eu as reportCauseUnsafe, F as runMain, Fa as make$39, Fc as isSchedule, Fd as isSuccess, Ff as PipeInspectableProto, Fi as failCause$3, Fl as effectContext, Fn as fromJsonString, Fo as cached, Fr as empty$9, Fs as onExitPrimitive, Ft as EncodeError, Fu as Error$1, G as Port, Ga as make$36, Gc as includes, Gd as parts, Gf as toJson, Gi as fromReadableStream, Gl as unwrap$3, Gn as makeFilter, Go as catch_, Gr as toUint8Array$1, Gs as raceFirst, Gu as ensure, H as layer$10, Ha as takeAll, Hc as Random$2, Hd as max$1, Hf as BaseProto, Hi as fromIterable, Hl as succeed$2, Hn as isSchema, Ho as catchReason, Hr as fromReadable, Hs as provideContext, Ht as Any, Hu as dedupeAdjacentWith, Ia as offer, Id as match$3, If as contA, Ii as filter$6, Il as effectDiscard, In as is$4, Io as callback, Ir as expireCookieUnsafe$1, Is as onInterrupt, It as HttpClientError, Iu as TaggedClass, J as String$2, Ja as await_, Jc as length, Jd as zero$1, Jf as equals, Ji as map$2, Jl as addFinalizerExit, Jn as optionalKey, Jr as ChildProcessSpawner, Js as retry, Jt as DateTimeUtcFromString, Ju as filterMap, K as Record, Ka as set$2, Kc as isEmpty$2, Kd as seconds, Kf as format$1, Ki as groupedWithin, Kl as Scope, Kn as mutable, Ko as context, Kr as fromWritable, Ks as repeat, Kt as Class$1, Ku as every, La as offerAll, Lc as passthrough, Ld as succeed, Lf as contE, Li as flatMap$3, Ll as launch, Ln as isGreaterThanOrEqualTo, Lo as catchCause, Lr as fromSetCookie, Ls as option$1, Lu as TaggedError, Ma as collect, Md as getSuccess, Mf as flip, Mi as empty$10, Ml as buildWithMemoMap, Mn as encodeSync, Mo as as$1, Mr as make$46, Ms as never, Mu as make$43, N as layer$12, Na as end$1, Nc as forever, Nd as isFailure, Nf as mapInput, Ni as ensuring, Nl as buildWithScope, Nn as encodeTo, No as asSome, Nr as value$2, Ns as onError, Nt as DecodeError, Nu as nativeTracer, O as OAuthTokenResponse, Oa as pipeTo, Oc as withSpan, Od as make$47, Of as toArray$1, Oi as catch_$1, Ol as makeDieReason, On as decodeTo, Oo as all$1, Or as remove$3, Ot as SocketOpenError, Ou as DisablePropagation, P as make$42, Pa as failCause$2, Pc as fromStep, Pd as isResult, Pf as Prototype, Pi as fail$2, Pl as effect, Pn as encodeUnknownEffect$1, Po as asVoid, Pr as stringOrRedacted, Ps as onExit, Pt as EmptyBodyError, Pu as random$1, Q as schema, Qa as interruptAllAs, Qc as replace$1, Qf as isNotNull, Qi as mapEffect, Ql as forkUnsafe$1, Qn as toEncoded$1, Qo as fail$1, Qr as Literal$2, Qs as runSync, Qt as Exit$1, Qu as flatMap$2, R as layer$11, Ra as offerUnsafe, Rc as spaced, Rd as try_$1, Ri as flattenIterable, Rl as merge$3, Rn as isInt, Rr as isEmpty$1, Rs as orDie, Rt as InvalidUrlError, S as RpcAuth, Sa as last$2, Sc as when$2, Sd as has$4, Sf as map$5, Si as toEpochMillis, Sl as hasDies, Sn as Uint8ArrayFromBase64, So as isLinkLocal, Sr as empty$8, Ss as logInfo, St as Collector, Su as fiberEnterUninterruptibleUnsafe, T as GitHubUser, Ta as map$4, Tc as withFiberSucceed, Td as toEntries, Tf as orElse$2, Ti as FileSystem, Tn as Unknown, To as isUnicast, Tr as get$7, Ts as map$1, Tu as onExitUnsafe, U as Crypto, Ua as publishUnsafe, Uc as camelToSnake, Ud as millis, Uf as Class, Ui as fromPubSub, Ul as succeedContext, Un as isSchemaError$1, Uo as catchTag, Ur as pipeThroughDuplex, Us as provideService, Ut as ArraySchema, Uu as drop, Va as take, Vd as fromInputUnsafe$1, Vf as setStackTraceLimit, Vi as fromEffect, Vl as provideMerge, Vn as isPattern, Vo as catchIf, Vr as toSetCookieHeaders, Vs as provide$3, Vt as isHttpClientError, Vu as dedupe, W as Array$1, Wa as unbounded, Wc as endsWith, Wd as minutes, Wf as NodeInspectSymbol, Wi as fromQueue, Wl as sync$1, Wn as make$45, Wo as catchTags, Wr as toArrayBuffer, Ws as provideServiceEffect, Wt as Boolean$2, Wu as empty$11, X as all, Xa as interrupt$2, Xc as padStart, Xd as Service, Xf as hasProperty, Xi as mapArray, Xl as closeUnsafe, Xn as toCodecJson, Xo as ensuring$1, Xr as Filter, Xs as runFork, Xt as Duration, Xu as findFirstIndex, Y as URL$1, Ya as getCurrent, Yc as match$2, Yd as Reference, Yf as hash, Yi as mapAccum, Yl as close, Yn as tag, Yo as die$2, Yr as Arrays, Yt as Defect, Yu as findFirst, Z as option, Za as interruptAll, Zc as repeat$1, Zd as add$1, Zf as isIterable, Zi as mapArrayEffect, Zl as fork, Zo as exit, Zr as FilterGroup, Zs as runForkWith, Zt as Error$2, _ as Organization, _a as tap$2, _c as uninterruptibleMask, _d as reverse, _f as getOrUndefined, _i as decode$3, _o as inetAddressFromIpString, _r as empty$13, _s as isEffect, _t as ClientAbort$1, _u as isSuccess$1, a as FxConversation, aa as pipeThroughChannel, ac as suspend, ad as headNonEmpty, af as merge$1, ai as isOptional, al as trimEnd, an as MutableJson, ao as mebibytes, ap as compose$1, ar as omit, as as forEach, at as RpcSerialization, au as TracerTimingEnabled, b as AUTH_URL, bc as useSpan, bd as take$1, bf as liftPredicate, bi as formatIso, bn as URLFromString, bo as ipv4ToOctets, br as set$4, bt as spanAttributes, bu as effectIsExit, c as GitHubIssue, ca as runCollect, cc as tapCause, cd as isReadonlyArrayNonEmpty, cf as exists, ci as optionalKey$1, cn as Null, co as DnsError, cp as constUndefined, cr as CurrentRedactedNames$1, cs as forkIn, ct as layerSchemaBinary, cu as into, d as ImageType, dc as timeoutOption, dd as lastNonEmpty, df as flatMapNullishOr, di as resolveIdentifier, dn as Record$1, do as nameServerFromInput, dp as dual, dr as redactUrl, ds as fromResult, dt as constEof, du as die, ea as mergeAll$1, ec as scoped, ed as get$8, ef as getOrUndefined$1, ei as PropertySignature, el as slice$2, en as Finite, eo as runIn, ep as isNotUndefined, er as toType, es as filterOrFail, et as unwrap$4, eu as makeUnsafe$4, f as Note, fa as runLast, fc as timeoutOrElse, fd as map$3, ff as flatten, fi as string, fl as IllegalArgumentError, fn as Redacted$1, fo as domainNameFromStringUnsafe, fp as flow, fr as setAll$1, fs as gen, fu as fail$3, g as OEmbed, ga as takeUntil, gc as uninterruptible, gd as reduce, gf as getOrNull, gi as transformOptional, gl as die$1, gn as TaggedError$1, go as formatUrlUnsafe, gr as has$3, gs as interruptible, gt as isWrapper, gu as isFailure$1, h as NotesError, ha as suspend$1, hc as try_, hd as prepend$2, hf as getOrElse, hi as transform$1, hl as combine, hn as Struct, ho as formatIp, hp as pipeArguments, hr as fromIterable$2, hs as interrupt, ht as exitSchema, hu as isExit, i as FileType, ia as orDie$1, ic as succeedNone, id as head, if as makeUnsafe$5, ii as isNever, il as trim, in as Literals, io as gibibytes, ip as or$1, ir as isSchemaError, is as fnUntraced, j as Verification, jc as addDelay, jd as fromOption$1, jf as combine$1, ji as die$3, jl as CurrentMemoMap, jn as encodeEffect, jo as annotateLogs, jr as isRedacted, js as matchEffect, ju as externalSpan, k as Session, ka as make$37, kc as withTracerEnabled, kd as fail, kf as Number$1, ki as concat, kl as prettyErrors, kn as decodeUnknownEffect, ko as andThen, kr as set$3, ks as matchCauseEffect, ku as ParentSpan, l as GitHubReadme, la as runForEach, lc as tapError$1, ld as join$1, lf as filter$4, li as replaceChecks, ll as Clock, ln as NullOr, lo as make$40, lp as constVoid, lr as empty$7, ls as forkScoped, lt as RequestId, lu as isDeferred, m as NoteJson, ma as succeed$3, mc as tryPromise, md as of, mf as fromUndefinedOr, mi as passthrough$1, ml as annotate, mn as StringFromUriComponent, mo as formatInet, mp as pipe, mr as unwrap$1, mt as ServerClient, mu as interrupt$1, n as Capture, na as mkUint8Array, nc as sleep, nd as getUnsafe$2, nf as getUnsafe$1, ni as Union$1, nl as startsWith, nn as Json, no as fromInput$2, np as isTagged, nr as withDecodingDefault, ns as flatMapEager, nu as CurrentLogAnnotations, o as FxStatus, oa as provideService$1, oc as sync, od as isArrayNonEmpty, of as all$2, oi as mapOrSame, ol as max$2, on as Never, oo as zero, op as constFalse, or as getReferenceKey, os as forever$1, ot as json$1, ou as _await, p as NoteId, pa as scan, pc as transposeOption, pf as fromNullishOr, pi as toEncoded, pl as StackTrace, pn as String$1, po as NetAddressError, pp as identity, pr as toString$2, ps as ignore$1, pt as constPong, pu as failCause$1, q as Redacted, qa as makeUnsafe$7, qc as isNonEmpty, qd as toMillis, qf as redact, qi as limitBytes, ql as addFinalizer, qn as optional$1, qo as contextWith, qr as make$44, qs as result$1, qt as DateTimeUtc, qu as filter$5, r as Extraction, ra as onEnd, rc as succeed$1, rd as groupBy, rf as make$41, ri as decodeTo$1, rl as toLowerCase, rn as Literal$1, ro as fromInputUnsafe, rp as isUndefined, rr as withDecodingDefaultKey, rs as fn$1, rt as withRun, ru as CurrentLogSpans, s as GitHubComment, sa as run$3, sc as tap$1, sd as isReadonlyArrayEmpty, sf as contains$2, si as null_, sl as parse$10, sn as NonEmptyArray, so as Dns, sp as constTrue, sr as encodeUnknownEffect, ss as forkChild, st as layerJson$1, su as doneUnsafe, t as RpcContracts, ta as mkString, tc as serviceOption, td as getSomes, tf as getOrUndefinedUnsafe, ti as Suspend, tl as split, tn as Int, to as badArgument, tp as isObject, tr as withConstructorDefault, ts as flatMap, tt as withDefault, tu as provide$2, u as GitHubRepo, ua as runForEachArray, uc as timeout, ud as last$1, uf as flatMap$1, ui as resolveDescription, ul as currentTimeMillis, un as Number$2, uo as makeRecordUnsafe, up as constant, ur as fromInput, us as fromOption, ut as ResponseDefectEncoded, uu as makeUnsafe$6, v as Reader, va as toReadableStream, vc as updateContext, vd as some$2, vf as isNone, vi as encode, vl as fail$4, vn as Tuple, vo as ipFromString, vr as fromIterable$3, vs as log, vt as getStreamSchemas, vu as succeed$4, w as CallbackParams, wa as fromTransform, wc as withFiber, wd as map$6, wf as none, wi as Path, wl as hasInterruptsOnly, wn as Union, wo as isPrivate, wr as fromRecordUnsafe, ws as makeSpanScoped, wt as CloseEvent, wu as makeSpanUnsafe, x as CurrentUser, xa as unwrap$2, xc as void_, xd as takeRight, xf as liftThrowable, xi as now, xl as fromReasons, xn as Uint8Array$2, xo as isInetAddressV6, xr as CurrentRedactedNames, xs as logFatal, xt as spanName, xu as fiberEnterInterruptibleUnsafe, y as TikTokPage, ya as toReadableStreamEffect, yc as updateService, yd as sort, yf as isSome, yi as encode$1, yl as filterInterruptors, yn as URL$2, yo as ipFromStringUnsafe, yr as get$9, ys as logDebug, yt as isStreamSchema, za as shutdown, zc as toStep, zd as days, zf as assignProperty, zi as fromArray, zl as mergeAll, zn as isMaxLength, zo as catchDefect, zr as parseHeader, zs as orElseSucceed, zt as StatusCodeError, zu as appendAll } from "./contracts-nyOWldn4.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { Duplex, Readable, pipeline } from "node:stream";
|
|
5
5
|
import * as Http from "node:http";
|
|
@@ -117,9 +117,9 @@ const compose = /*#__PURE__*/ dual(2, (left, right) => (input) => {
|
|
|
117
117
|
});
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/MutableHashMap.js
|
|
120
|
-
const TypeId$
|
|
120
|
+
const TypeId$20 = "~effect/MutableHashMap";
|
|
121
121
|
const MutableHashMapProto = {
|
|
122
|
-
[TypeId$
|
|
122
|
+
[TypeId$20]: TypeId$20,
|
|
123
123
|
[Symbol.iterator]() {
|
|
124
124
|
return this.backing[Symbol.iterator]();
|
|
125
125
|
},
|
|
@@ -463,9 +463,9 @@ const RefProto = {
|
|
|
463
463
|
* @category constructors
|
|
464
464
|
* @since 4.0.0
|
|
465
465
|
*/
|
|
466
|
-
const makeUnsafe$
|
|
466
|
+
const makeUnsafe$3 = (value) => {
|
|
467
467
|
const self = Object.create(RefProto);
|
|
468
|
-
self.ref = make$
|
|
468
|
+
self.ref = make$36(value);
|
|
469
469
|
return self;
|
|
470
470
|
};
|
|
471
471
|
/**
|
|
@@ -494,7 +494,7 @@ const makeUnsafe$2 = (value) => {
|
|
|
494
494
|
* @category constructors
|
|
495
495
|
* @since 2.0.0
|
|
496
496
|
*/
|
|
497
|
-
const make$
|
|
497
|
+
const make$35 = (value) => sync(() => makeUnsafe$3(value));
|
|
498
498
|
/**
|
|
499
499
|
* Gets the current value of the Ref.
|
|
500
500
|
*
|
|
@@ -560,7 +560,7 @@ const get$4 = (self) => sync(() => self.ref.current);
|
|
|
560
560
|
const set = /*#__PURE__*/ dual(2, (self, value) => sync(() => set$2(self.ref, value)));
|
|
561
561
|
//#endregion
|
|
562
562
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/HttpBody.js
|
|
563
|
-
const TypeId$
|
|
563
|
+
const TypeId$19 = "~effect/http/HttpBody";
|
|
564
564
|
const HttpBodyErrorTypeId = "~effect/http/HttpBody/HttpBodyError";
|
|
565
565
|
/**
|
|
566
566
|
* Error produced while constructing an HTTP body from JSON or schema-encoded input.
|
|
@@ -578,10 +578,10 @@ var HttpBodyError = class extends (/*#__PURE__*/ TaggedError("HttpBodyError")) {
|
|
|
578
578
|
*/
|
|
579
579
|
[HttpBodyErrorTypeId] = HttpBodyErrorTypeId;
|
|
580
580
|
};
|
|
581
|
-
var Proto$
|
|
582
|
-
[TypeId$
|
|
581
|
+
var Proto$11 = class {
|
|
582
|
+
[TypeId$19];
|
|
583
583
|
constructor() {
|
|
584
|
-
this[TypeId$
|
|
584
|
+
this[TypeId$19] = TypeId$19;
|
|
585
585
|
}
|
|
586
586
|
[NodeInspectSymbol]() {
|
|
587
587
|
return this.toJSON();
|
|
@@ -597,7 +597,7 @@ var Proto$10 = class {
|
|
|
597
597
|
* @category models
|
|
598
598
|
* @since 4.0.0
|
|
599
599
|
*/
|
|
600
|
-
var Empty$1 = class extends Proto$
|
|
600
|
+
var Empty$1 = class extends Proto$11 {
|
|
601
601
|
_tag = "Empty";
|
|
602
602
|
toJSON() {
|
|
603
603
|
return {
|
|
@@ -625,7 +625,7 @@ const empty$5 = /*#__PURE__*/ new Empty$1();
|
|
|
625
625
|
* @category models
|
|
626
626
|
* @since 4.0.0
|
|
627
627
|
*/
|
|
628
|
-
var Raw = class extends Proto$
|
|
628
|
+
var Raw = class extends Proto$11 {
|
|
629
629
|
_tag = "Raw";
|
|
630
630
|
body;
|
|
631
631
|
contentType;
|
|
@@ -665,7 +665,7 @@ const raw$1 = (body, options) => new Raw(body, options?.contentType, options?.co
|
|
|
665
665
|
* @category models
|
|
666
666
|
* @since 4.0.0
|
|
667
667
|
*/
|
|
668
|
-
var Uint8Array$1 = class extends Proto$
|
|
668
|
+
var Uint8Array$1 = class extends Proto$11 {
|
|
669
669
|
_tag = "Uint8Array";
|
|
670
670
|
contentType;
|
|
671
671
|
contentLength;
|
|
@@ -794,7 +794,7 @@ const urlParams = (urlParams, contentType) => text$3(toString$2(fromInput(urlPar
|
|
|
794
794
|
* @category models
|
|
795
795
|
* @since 4.0.0
|
|
796
796
|
*/
|
|
797
|
-
var FormData$1 = class extends Proto$
|
|
797
|
+
var FormData$1 = class extends Proto$11 {
|
|
798
798
|
_tag = "FormData";
|
|
799
799
|
contentType = void 0;
|
|
800
800
|
contentLength = void 0;
|
|
@@ -826,7 +826,7 @@ const formData = (body) => new FormData$1(body);
|
|
|
826
826
|
* @category models
|
|
827
827
|
* @since 4.0.0
|
|
828
828
|
*/
|
|
829
|
-
var Stream = class extends Proto$
|
|
829
|
+
var Stream = class extends Proto$11 {
|
|
830
830
|
_tag = "Stream";
|
|
831
831
|
stream;
|
|
832
832
|
contentType;
|
|
@@ -951,7 +951,7 @@ var UrlError = class extends (/*#__PURE__*/ TaggedError("UrlError")) {};
|
|
|
951
951
|
* @category constructors
|
|
952
952
|
* @since 4.0.0
|
|
953
953
|
*/
|
|
954
|
-
const make$
|
|
954
|
+
const make$34 = (url, params, hash) => try_$1({
|
|
955
955
|
try: () => {
|
|
956
956
|
const urlInstance = new URL(url, baseUrl());
|
|
957
957
|
for (let i = 0; i < params.params.length; i++) {
|
|
@@ -1013,7 +1013,7 @@ const fromString = (url, base) => try_$1({
|
|
|
1013
1013
|
});
|
|
1014
1014
|
//#endregion
|
|
1015
1015
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/HttpClientRequest.js
|
|
1016
|
-
const TypeId$
|
|
1016
|
+
const TypeId$18 = "~effect/http/HttpClientRequest";
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Returns `true` when a value is an `HttpClientRequest`.
|
|
1019
1019
|
*
|
|
@@ -1021,9 +1021,9 @@ const TypeId$17 = "~effect/http/HttpClientRequest";
|
|
|
1021
1021
|
* @category guards
|
|
1022
1022
|
* @since 4.0.0
|
|
1023
1023
|
*/
|
|
1024
|
-
const isHttpClientRequest = (u) => hasProperty(u, TypeId$
|
|
1025
|
-
const Proto$
|
|
1026
|
-
[TypeId$
|
|
1024
|
+
const isHttpClientRequest = (u) => hasProperty(u, TypeId$18);
|
|
1025
|
+
const Proto$10 = {
|
|
1026
|
+
[TypeId$18]: TypeId$18,
|
|
1027
1027
|
...BaseProto,
|
|
1028
1028
|
toJSON() {
|
|
1029
1029
|
return {
|
|
@@ -1048,7 +1048,7 @@ const Proto$9 = {
|
|
|
1048
1048
|
* @since 4.0.0
|
|
1049
1049
|
*/
|
|
1050
1050
|
function makeWith$1(method, url, urlParams, hash, headers, body) {
|
|
1051
|
-
const self = Object.create(Proto$
|
|
1051
|
+
const self = Object.create(Proto$10);
|
|
1052
1052
|
self.method = method;
|
|
1053
1053
|
self.url = url;
|
|
1054
1054
|
self.urlParams = urlParams;
|
|
@@ -1072,7 +1072,7 @@ const empty$4 = /*#__PURE__*/ makeWith$1("GET", "", empty$7, /*#__PURE__*/ none(
|
|
|
1072
1072
|
* @category constructors
|
|
1073
1073
|
* @since 4.0.0
|
|
1074
1074
|
*/
|
|
1075
|
-
const make$
|
|
1075
|
+
const make$33 = (method) => (url, options) => modify(empty$4, {
|
|
1076
1076
|
method,
|
|
1077
1077
|
url,
|
|
1078
1078
|
...options ?? void 0
|
|
@@ -1084,7 +1084,7 @@ const make$32 = (method) => (url, options) => modify(empty$4, {
|
|
|
1084
1084
|
* @category constructors
|
|
1085
1085
|
* @since 4.0.0
|
|
1086
1086
|
*/
|
|
1087
|
-
const get$3 = /*#__PURE__*/ make$
|
|
1087
|
+
const get$3 = /*#__PURE__*/ make$33("GET");
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Creates a `POST` request for the specified URL.
|
|
1090
1090
|
*
|
|
@@ -1092,8 +1092,8 @@ const get$3 = /*#__PURE__*/ make$32("GET");
|
|
|
1092
1092
|
* @category constructors
|
|
1093
1093
|
* @since 4.0.0
|
|
1094
1094
|
*/
|
|
1095
|
-
const post = /*#__PURE__*/ make$
|
|
1096
|
-
const del = /*#__PURE__*/ make$
|
|
1095
|
+
const post = /*#__PURE__*/ make$33("POST");
|
|
1096
|
+
const del = /*#__PURE__*/ make$33("DELETE");
|
|
1097
1097
|
/**
|
|
1098
1098
|
* Applies request options to an `HttpClientRequest`, returning a new request.
|
|
1099
1099
|
*
|
|
@@ -1295,7 +1295,7 @@ const bodyFormData = /*#__PURE__*/ dual(2, (self, body) => setBody$1(self, formD
|
|
|
1295
1295
|
* @since 4.0.0
|
|
1296
1296
|
*/
|
|
1297
1297
|
function toUrl(self) {
|
|
1298
|
-
const r = make$
|
|
1298
|
+
const r = make$34(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
1299
1299
|
if (isSuccess(r)) return some$1(r.success);
|
|
1300
1300
|
return none();
|
|
1301
1301
|
}
|
|
@@ -1308,7 +1308,7 @@ function toUrl(self) {
|
|
|
1308
1308
|
* @category type IDs
|
|
1309
1309
|
* @since 4.0.0
|
|
1310
1310
|
*/
|
|
1311
|
-
const TypeId$
|
|
1311
|
+
const TypeId$17 = "~effect/http/HttpIncomingMessage";
|
|
1312
1312
|
/**
|
|
1313
1313
|
* Creates a decoder that reads an incoming message's JSON body and decodes it with the supplied schema.
|
|
1314
1314
|
*
|
|
@@ -1374,7 +1374,7 @@ const inspect = (self, that) => {
|
|
|
1374
1374
|
* @category type IDs
|
|
1375
1375
|
* @since 4.0.0
|
|
1376
1376
|
*/
|
|
1377
|
-
const TypeId$
|
|
1377
|
+
const TypeId$16 = "~effect/http/HttpClientResponse";
|
|
1378
1378
|
/**
|
|
1379
1379
|
* Wraps a Web `Response` and its original `HttpClientRequest` as an `HttpClientResponse`.
|
|
1380
1380
|
*
|
|
@@ -1412,16 +1412,16 @@ const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? suc
|
|
|
1412
1412
|
description: "non 2xx status code"
|
|
1413
1413
|
}) }));
|
|
1414
1414
|
var WebHttpClientResponse = class extends Class {
|
|
1415
|
+
[TypeId$17];
|
|
1415
1416
|
[TypeId$16];
|
|
1416
|
-
[TypeId$15];
|
|
1417
1417
|
request;
|
|
1418
1418
|
source;
|
|
1419
1419
|
constructor(request, source) {
|
|
1420
1420
|
super();
|
|
1421
1421
|
this.request = request;
|
|
1422
1422
|
this.source = source;
|
|
1423
|
+
this[TypeId$17] = TypeId$17;
|
|
1423
1424
|
this[TypeId$16] = TypeId$16;
|
|
1424
|
-
this[TypeId$15] = TypeId$15;
|
|
1425
1425
|
}
|
|
1426
1426
|
toJSON() {
|
|
1427
1427
|
return inspect(this, {
|
|
@@ -1684,7 +1684,7 @@ const addHeaderAttributes = (span, phase, headers, filter, redactedNames) => {
|
|
|
1684
1684
|
};
|
|
1685
1685
|
//#endregion
|
|
1686
1686
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/HttpClient.js
|
|
1687
|
-
const TypeId$
|
|
1687
|
+
const TypeId$15 = "~effect/http/HttpClient";
|
|
1688
1688
|
/**
|
|
1689
1689
|
* Service tag for the default outgoing HTTP client service.
|
|
1690
1690
|
*
|
|
@@ -1735,7 +1735,7 @@ const filterStatusOk = /*#__PURE__*/ transformResponse(/*#__PURE__*/ flatMap(fil
|
|
|
1735
1735
|
* @since 4.0.0
|
|
1736
1736
|
*/
|
|
1737
1737
|
const makeWith = (postprocess, preprocess) => {
|
|
1738
|
-
const self = Object.create(Proto$
|
|
1738
|
+
const self = Object.create(Proto$9);
|
|
1739
1739
|
self.preprocess = preprocess;
|
|
1740
1740
|
self.postprocess = postprocess;
|
|
1741
1741
|
self.execute = function(request) {
|
|
@@ -1743,8 +1743,8 @@ const makeWith = (postprocess, preprocess) => {
|
|
|
1743
1743
|
};
|
|
1744
1744
|
return self;
|
|
1745
1745
|
};
|
|
1746
|
-
const Proto$
|
|
1747
|
-
[TypeId$
|
|
1746
|
+
const Proto$9 = {
|
|
1747
|
+
[TypeId$15]: TypeId$15,
|
|
1748
1748
|
pipe() {
|
|
1749
1749
|
return pipeArguments(this, arguments);
|
|
1750
1750
|
},
|
|
@@ -1753,7 +1753,7 @@ const Proto$8 = {
|
|
|
1753
1753
|
return { _id: "effect/HttpClient" };
|
|
1754
1754
|
},
|
|
1755
1755
|
.../*#__PURE__*/ Object.fromEntries(/*#__PURE__*/ allShort.map(([fullMethod, method]) => [method, function(url, options) {
|
|
1756
|
-
return this.execute(make$
|
|
1756
|
+
return this.execute(make$33(fullMethod)(url, options));
|
|
1757
1757
|
}]))
|
|
1758
1758
|
};
|
|
1759
1759
|
/**
|
|
@@ -1767,10 +1767,10 @@ const Proto$8 = {
|
|
|
1767
1767
|
* @category constructors
|
|
1768
1768
|
* @since 4.0.0
|
|
1769
1769
|
*/
|
|
1770
|
-
const make$
|
|
1770
|
+
const make$32 = (f) => makeWith((effect) => flatMap(effect, (request) => withFiber((fiber) => {
|
|
1771
1771
|
const scopedController = scopedRequests.get(request);
|
|
1772
1772
|
const controller = scopedController ?? new AbortController();
|
|
1773
|
-
const urlResult = make$
|
|
1773
|
+
const urlResult = make$34(request.url, request.urlParams, getOrUndefined(request.hash));
|
|
1774
1774
|
if (isFailure(urlResult)) return fail$1(new HttpClientError({ reason: new InvalidUrlError({
|
|
1775
1775
|
request,
|
|
1776
1776
|
cause: urlResult.failure
|
|
@@ -1997,8 +1997,8 @@ var InterruptibleResponse = class {
|
|
|
1997
1997
|
this.original = original;
|
|
1998
1998
|
this.controller = controller;
|
|
1999
1999
|
}
|
|
2000
|
-
[TypeId$15] = TypeId$15;
|
|
2001
2000
|
[TypeId$16] = TypeId$16;
|
|
2001
|
+
[TypeId$17] = TypeId$17;
|
|
2002
2002
|
applyInterrupt(effect) {
|
|
2003
2003
|
return suspend(() => {
|
|
2004
2004
|
responseRegistry.unregister(this.original);
|
|
@@ -2149,7 +2149,7 @@ const isCleanSingleTrailingParam = (path) => CLEAN_SINGLE_PARAM_REGEXP.test(path
|
|
|
2149
2149
|
/**
|
|
2150
2150
|
* @internal
|
|
2151
2151
|
*/
|
|
2152
|
-
const make$
|
|
2152
|
+
const make$31 = (options = {}) => new RouterImpl(options);
|
|
2153
2153
|
var RouterImpl = class {
|
|
2154
2154
|
constructor(options = {}) {
|
|
2155
2155
|
this.options = {
|
|
@@ -2768,7 +2768,7 @@ const httpMethods = [
|
|
|
2768
2768
|
* @category constructors
|
|
2769
2769
|
* @since 4.0.0
|
|
2770
2770
|
*/
|
|
2771
|
-
const make$
|
|
2771
|
+
const make$30 = make$31;
|
|
2772
2772
|
//#endregion
|
|
2773
2773
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/Etag.js
|
|
2774
2774
|
/**
|
|
@@ -2910,14 +2910,14 @@ const layerWeak = /*#__PURE__*/ succeed$2(Generator)({
|
|
|
2910
2910
|
const ignore = "~effect/ErrorReporter/ignore";
|
|
2911
2911
|
//#endregion
|
|
2912
2912
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/internal/headers.js
|
|
2913
|
-
const Proto$
|
|
2913
|
+
const Proto$8 = /*#__PURE__*/ Object.getPrototypeOf(empty$8);
|
|
2914
2914
|
/**
|
|
2915
2915
|
* @internal
|
|
2916
2916
|
*/
|
|
2917
|
-
const emptyMutableUnsafe = () => Object.create(Proto$
|
|
2917
|
+
const emptyMutableUnsafe = () => Object.create(Proto$8);
|
|
2918
2918
|
//#endregion
|
|
2919
2919
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/HttpServerResponse.js
|
|
2920
|
-
const TypeId$
|
|
2920
|
+
const TypeId$14 = "~effect/http/HttpServerResponse";
|
|
2921
2921
|
/**
|
|
2922
2922
|
* Returns `true` when the supplied value is an `HttpServerResponse`.
|
|
2923
2923
|
*
|
|
@@ -2925,7 +2925,7 @@ const TypeId$13 = "~effect/http/HttpServerResponse";
|
|
|
2925
2925
|
* @category guards
|
|
2926
2926
|
* @since 4.0.0
|
|
2927
2927
|
*/
|
|
2928
|
-
const isHttpServerResponse = (u) => hasProperty(u, TypeId$
|
|
2928
|
+
const isHttpServerResponse = (u) => hasProperty(u, TypeId$14);
|
|
2929
2929
|
/**
|
|
2930
2930
|
* Creates an empty HTTP response.
|
|
2931
2931
|
*
|
|
@@ -3150,9 +3150,9 @@ const setBody = /*#__PURE__*/ dual(2, (self, body) => makeResponse$1({
|
|
|
3150
3150
|
...self,
|
|
3151
3151
|
body
|
|
3152
3152
|
}, updateHeaders(self.headers, body)));
|
|
3153
|
-
const Proto$
|
|
3153
|
+
const Proto$7 = {
|
|
3154
3154
|
...PipeInspectableProto,
|
|
3155
|
-
[TypeId$
|
|
3155
|
+
[TypeId$14]: TypeId$14,
|
|
3156
3156
|
[ignore]: true,
|
|
3157
3157
|
toJSON() {
|
|
3158
3158
|
return {
|
|
@@ -3166,7 +3166,7 @@ const Proto$6 = {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
};
|
|
3168
3168
|
const makeResponse$1 = (options, ownedHeaders) => {
|
|
3169
|
-
const self = Object.create(Proto$
|
|
3169
|
+
const self = Object.create(Proto$7);
|
|
3170
3170
|
self.status = options.status;
|
|
3171
3171
|
self.statusText = options.statusText;
|
|
3172
3172
|
self.cookies = options.cookies ?? empty$9;
|
|
@@ -3784,7 +3784,7 @@ var HttpPlatform = class extends (/*#__PURE__*/ Service()("effect/http/HttpPlatf
|
|
|
3784
3784
|
* @category constructors
|
|
3785
3785
|
* @since 4.0.0
|
|
3786
3786
|
*/
|
|
3787
|
-
const make$
|
|
3787
|
+
const make$29 = /*#__PURE__*/ fnUntraced(function* (impl) {
|
|
3788
3788
|
const fs = yield* FileSystem;
|
|
3789
3789
|
const etagGen = yield* Generator;
|
|
3790
3790
|
return HttpPlatform.of({
|
|
@@ -3936,7 +3936,7 @@ const toResponseOrElseDefect = (u, orElse) => {
|
|
|
3936
3936
|
* @stability unstable
|
|
3937
3937
|
* @since 4.0.0
|
|
3938
3938
|
*/
|
|
3939
|
-
const TypeId$
|
|
3939
|
+
const TypeId$13 = "~effect/http/HttpServerError";
|
|
3940
3940
|
/**
|
|
3941
3941
|
* Tagged error for failures that occur while handling an HTTP server request.
|
|
3942
3942
|
*
|
|
@@ -3958,7 +3958,7 @@ var HttpServerError = class extends (/*#__PURE__*/ TaggedError("HttpServerError"
|
|
|
3958
3958
|
});
|
|
3959
3959
|
else super(props);
|
|
3960
3960
|
}
|
|
3961
|
-
[TypeId$
|
|
3961
|
+
[TypeId$13] = TypeId$13;
|
|
3962
3962
|
stack = `${this.name}: ${this.message}`;
|
|
3963
3963
|
get request() {
|
|
3964
3964
|
return this.reason.request;
|
|
@@ -4272,7 +4272,7 @@ const constValueChars = /*#__PURE__*/ new Uint8Array(256);
|
|
|
4272
4272
|
constValueChars[9] = 1;
|
|
4273
4273
|
for (let i = 32; i <= 126; i++) constValueChars[i] = 1;
|
|
4274
4274
|
for (let i = 128; i <= 255; i++) constValueChars[i] = 1;
|
|
4275
|
-
function make$
|
|
4275
|
+
function make$28() {
|
|
4276
4276
|
const decoder = new TextDecoder();
|
|
4277
4277
|
const state = {
|
|
4278
4278
|
state: State$4.key,
|
|
@@ -4449,7 +4449,7 @@ function makeState(needle_) {
|
|
|
4449
4449
|
matchIndex: 0
|
|
4450
4450
|
};
|
|
4451
4451
|
}
|
|
4452
|
-
function make$
|
|
4452
|
+
function make$27(needle, callback, seed, minimumChunkLength) {
|
|
4453
4453
|
const state = makeState(needle);
|
|
4454
4454
|
const minChunkLength = minimumChunkLength ?? state.needleLength;
|
|
4455
4455
|
if (seed !== void 0) {
|
|
@@ -4561,7 +4561,7 @@ function parseBoundary(headers) {
|
|
|
4561
4561
|
}
|
|
4562
4562
|
function noopOnChunk(_chunk) {}
|
|
4563
4563
|
const toLimit = (input) => input === Infinity ? Infinity : Number(fromInputUnsafe(input));
|
|
4564
|
-
function make$
|
|
4564
|
+
function make$26({ headers, onFile: onPart, onField, onError, onDone, isFile = defaultIsFile$1, maxParts = Infinity, maxTotalSize: maxTotalSizeInput = Infinity, maxPartSize: maxPartSizeInput = Infinity, maxFieldSize: maxFieldSizeInput = 1048576 }) {
|
|
4565
4565
|
const maxTotalSize = toLimit(maxTotalSizeInput);
|
|
4566
4566
|
const maxPartSize = toLimit(maxPartSizeInput);
|
|
4567
4567
|
const maxFieldSize = toLimit(maxFieldSizeInput);
|
|
@@ -4598,8 +4598,8 @@ function make$25({ headers, onFile: onPart, onField, onError, onDone, isFile = d
|
|
|
4598
4598
|
if (state.state === State$3.body && state.isFile) state.onChunk(null);
|
|
4599
4599
|
onError(error);
|
|
4600
4600
|
}
|
|
4601
|
-
const headerParser = make$
|
|
4602
|
-
const split = make$
|
|
4601
|
+
const headerParser = make$28();
|
|
4602
|
+
const split = make$27(`\r\n--${boundary}`, function(index, chunk) {
|
|
4603
4603
|
if (state.stopped) return;
|
|
4604
4604
|
if (index === 0) {
|
|
4605
4605
|
skipBody();
|
|
@@ -4731,7 +4731,7 @@ function decodeField$1(info, value) {
|
|
|
4731
4731
|
* @category constructors
|
|
4732
4732
|
* @since 4.0.0
|
|
4733
4733
|
*/
|
|
4734
|
-
const make$
|
|
4734
|
+
const make$25 = make$26;
|
|
4735
4735
|
/**
|
|
4736
4736
|
* Determines whether a multipart part should be treated as a file.
|
|
4737
4737
|
*
|
|
@@ -4770,7 +4770,7 @@ const decodeField = decodeField$1;
|
|
|
4770
4770
|
* @category type IDs
|
|
4771
4771
|
* @since 4.0.0
|
|
4772
4772
|
*/
|
|
4773
|
-
const TypeId$
|
|
4773
|
+
const TypeId$12 = "~effect/http/Multipart";
|
|
4774
4774
|
const MultipartErrorTypeId = "~effect/http/Multipart/MultipartError";
|
|
4775
4775
|
const toMultipartError = (cause) => isMultipartError(cause) ? cause : MultipartError.fromReason("InternalError", cause);
|
|
4776
4776
|
/**
|
|
@@ -4885,10 +4885,10 @@ const makeConfig = (headers) => withFiber((fiber) => {
|
|
|
4885
4885
|
});
|
|
4886
4886
|
});
|
|
4887
4887
|
var PartBase$1 = class extends Class {
|
|
4888
|
-
[TypeId$
|
|
4888
|
+
[TypeId$12];
|
|
4889
4889
|
constructor() {
|
|
4890
4890
|
super();
|
|
4891
|
-
this[TypeId$
|
|
4891
|
+
this[TypeId$12] = TypeId$12;
|
|
4892
4892
|
}
|
|
4893
4893
|
};
|
|
4894
4894
|
const defaultWriteFile = (path, file) => flatMap(FileSystem, (fs) => mapError(run$3(file.content, fs.sink(path)), toMultipartError));
|
|
@@ -5029,7 +5029,7 @@ const FieldMimeTypes = /*#__PURE__*/ Reference("effect/http/Multipart/FieldMimeT
|
|
|
5029
5029
|
* @category type IDs
|
|
5030
5030
|
* @since 4.0.0
|
|
5031
5031
|
*/
|
|
5032
|
-
const TypeId$
|
|
5032
|
+
const TypeId$11 = "~effect/http/HttpServerRequest";
|
|
5033
5033
|
/**
|
|
5034
5034
|
* Service tag for the active server-side HTTP request.
|
|
5035
5035
|
*
|
|
@@ -5125,7 +5125,7 @@ const requestPreResponseHandlers = /*#__PURE__*/ new WeakMap();
|
|
|
5125
5125
|
* @category constructors
|
|
5126
5126
|
* @since 4.0.0
|
|
5127
5127
|
*/
|
|
5128
|
-
const make$
|
|
5128
|
+
const make$24 = (middleware) => middleware;
|
|
5129
5129
|
const loggerDisabledRequests = /*#__PURE__*/ new WeakSet();
|
|
5130
5130
|
const stripSearchAndHash = (url) => {
|
|
5131
5131
|
const queryIndex = url.indexOf("?");
|
|
@@ -5142,7 +5142,7 @@ const stripSearchAndHash = (url) => {
|
|
|
5142
5142
|
* @since 4.0.0
|
|
5143
5143
|
*/
|
|
5144
5144
|
const withLoggerDisabled = (self) => withFiber((fiber) => {
|
|
5145
|
-
const request = getUnsafe(fiber.context, HttpServerRequest);
|
|
5145
|
+
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
5146
5146
|
loggerDisabledRequests.add(request.source);
|
|
5147
5147
|
return self;
|
|
5148
5148
|
});
|
|
@@ -5186,8 +5186,8 @@ const TracerHeaderFilter = /*#__PURE__*/ Reference("effect/http/HttpMiddleware/T
|
|
|
5186
5186
|
* @category logging
|
|
5187
5187
|
* @since 4.0.0
|
|
5188
5188
|
*/
|
|
5189
|
-
const logger$1 = /*#__PURE__*/ make$
|
|
5190
|
-
const request = getUnsafe(fiber.context, HttpServerRequest);
|
|
5189
|
+
const logger$1 = /*#__PURE__*/ make$24((httpApp) => withFiber((fiber) => {
|
|
5190
|
+
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
5191
5191
|
const path = stripSearchAndHash(request.url);
|
|
5192
5192
|
return withLogSpan(flatMap(exit(httpApp), (exit) => {
|
|
5193
5193
|
if (loggerDisabledRequests.has(request.source)) return exit;
|
|
@@ -5231,8 +5231,8 @@ const responseSpanExit = (request, response) => {
|
|
|
5231
5231
|
* @category tracing
|
|
5232
5232
|
* @since 4.0.0
|
|
5233
5233
|
*/
|
|
5234
|
-
const tracer = /*#__PURE__*/ make$
|
|
5235
|
-
const request = getUnsafe(fiber.context, HttpServerRequest);
|
|
5234
|
+
const tracer = /*#__PURE__*/ make$24((httpApp) => withFiber((fiber) => {
|
|
5235
|
+
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
5236
5236
|
if (isTracerDisabledUnsafe(fiber, request)) return httpApp;
|
|
5237
5237
|
const nameGenerator = fiber.getRef(SpanNameGenerator);
|
|
5238
5238
|
const span = makeSpanUnsafe(fiber, nameGenerator(request), {
|
|
@@ -5373,8 +5373,8 @@ const toHandled = (self, handleResponse, middleware) => {
|
|
|
5373
5373
|
}
|
|
5374
5374
|
return withFiber((fiber) => {
|
|
5375
5375
|
fiberEnterUninterruptibleUnsafe(fiber);
|
|
5376
|
-
const scope = makeUnsafe$
|
|
5377
|
-
const frame = new RequestFrame(scope, fiber.context, getUnsafe(fiber.context, HttpServerRequest));
|
|
5376
|
+
const scope = makeUnsafe$4();
|
|
5377
|
+
const frame = new RequestFrame(scope, fiber.context, getUnsafe$1(fiber.context, HttpServerRequest));
|
|
5378
5378
|
fiber.setContext(add$1(frame.prev, Scope, scope));
|
|
5379
5379
|
const currentTracer = fiber.cache.tracer;
|
|
5380
5380
|
if (middleware === void 0 && (currentTracer === void 0 || currentTracer === nativeTracer || isTracerDisabledUnsafe(fiber, frame.request))) {
|
|
@@ -5421,7 +5421,7 @@ var HttpServer = class extends (/*#__PURE__*/ Service()("effect/http/HttpServer"
|
|
|
5421
5421
|
* @category constructors
|
|
5422
5422
|
* @since 4.0.0
|
|
5423
5423
|
*/
|
|
5424
|
-
const make$
|
|
5424
|
+
const make$23 = (options) => options;
|
|
5425
5425
|
/**
|
|
5426
5426
|
* Creates a layer that starts serving an HTTP response effect with the current
|
|
5427
5427
|
* `HttpServer`.
|
|
@@ -5489,7 +5489,7 @@ const withLogAddress = (layer) => effectDiscard(logAddress).pipe(provideMerge(la
|
|
|
5489
5489
|
* @stability unstable
|
|
5490
5490
|
* @since 4.0.0
|
|
5491
5491
|
*/
|
|
5492
|
-
const TypeId$
|
|
5492
|
+
const TypeId$10 = "~effect/http/HttpRouter";
|
|
5493
5493
|
/**
|
|
5494
5494
|
* Service tag for the HTTP router used while constructing an HTTP application.
|
|
5495
5495
|
* Route and middleware layers require this service to register themselves with
|
|
@@ -5512,10 +5512,10 @@ const HttpRouter = /*#__PURE__*/ Service("effect/http/HttpRouter");
|
|
|
5512
5512
|
* @category constructors
|
|
5513
5513
|
* @since 4.0.0
|
|
5514
5514
|
*/
|
|
5515
|
-
const make$
|
|
5515
|
+
const make$22 = /*#__PURE__*/ gen(function* () {
|
|
5516
5516
|
const config = yield* RouterConfig;
|
|
5517
5517
|
const ignoreDuplicateSlashes = config.ignoreDuplicateSlashes ?? true;
|
|
5518
|
-
const router = make$
|
|
5518
|
+
const router = make$30(config);
|
|
5519
5519
|
const middleware = /* @__PURE__ */ new Set();
|
|
5520
5520
|
const addAll = (routes) => contextWith((context) => {
|
|
5521
5521
|
const middleware = getMiddleware(context);
|
|
@@ -5545,7 +5545,7 @@ const make$21 = /*#__PURE__*/ gen(function* () {
|
|
|
5545
5545
|
return void_;
|
|
5546
5546
|
});
|
|
5547
5547
|
return HttpRouter.of({
|
|
5548
|
-
[TypeId$
|
|
5548
|
+
[TypeId$10]: TypeId$10,
|
|
5549
5549
|
prefixed(prefix) {
|
|
5550
5550
|
prefix = removeTrailingSlash(prefix);
|
|
5551
5551
|
return HttpRouter.of({
|
|
@@ -5569,7 +5569,7 @@ const make$21 = /*#__PURE__*/ gen(function* () {
|
|
|
5569
5569
|
asHttpEffect() {
|
|
5570
5570
|
let handler = withFiber((fiber) => {
|
|
5571
5571
|
let context = fiber.context;
|
|
5572
|
-
const request = getUnsafe(context, HttpServerRequest);
|
|
5572
|
+
const request = getUnsafe$1(context, HttpServerRequest);
|
|
5573
5573
|
let result = router.find(request.method, request.url);
|
|
5574
5574
|
if (result === void 0 && request.method === "HEAD") result = router.find("GET", request.url);
|
|
5575
5575
|
if (result === void 0) return fail$1(new HttpServerError({ reason: new RouteNotFound({ request }) }));
|
|
@@ -5664,7 +5664,7 @@ var RouteContext = class extends (/*#__PURE__*/ Service()("effect/http/HttpRoute
|
|
|
5664
5664
|
* @category getters
|
|
5665
5665
|
* @since 4.0.0
|
|
5666
5666
|
*/
|
|
5667
|
-
const params = /*#__PURE__*/ withFiberSucceed((fiber) => getUnsafe(fiber.context, RouteContext).params);
|
|
5667
|
+
const params = /*#__PURE__*/ withFiberSucceed((fiber) => getUnsafe$1(fiber.context, RouteContext).params);
|
|
5668
5668
|
/**
|
|
5669
5669
|
* Decodes a schema from the path parameters captured for the current matched
|
|
5670
5670
|
* route.
|
|
@@ -5722,7 +5722,7 @@ const use = (f) => effectDiscard(flatMap(HttpRouter, f));
|
|
|
5722
5722
|
* @category layers
|
|
5723
5723
|
* @since 4.0.0
|
|
5724
5724
|
*/
|
|
5725
|
-
const layer$8 = /*#__PURE__*/ effect(HttpRouter)(make$
|
|
5725
|
+
const layer$8 = /*#__PURE__*/ effect(HttpRouter)(make$22);
|
|
5726
5726
|
const RouteTypeId = "~effect/http/HttpRouter/Route";
|
|
5727
5727
|
const makeRoute = (options) => ({
|
|
5728
5728
|
...options,
|
|
@@ -5846,7 +5846,7 @@ const makeMiddleware = (middleware, options) => options?.global ? effectDiscard(
|
|
|
5846
5846
|
const router = yield* HttpRouter;
|
|
5847
5847
|
const fn = isEffect(middleware) ? yield* middleware : middleware;
|
|
5848
5848
|
yield* router.addGlobalMiddleware(fn);
|
|
5849
|
-
})) : new MiddlewareImpl(isEffect(middleware) ? effectContext(map$1(middleware, (fn) => makeUnsafe$
|
|
5849
|
+
})) : new MiddlewareImpl(isEffect(middleware) ? effectContext(map$1(middleware, (fn) => makeUnsafe$5(/* @__PURE__ */ new Map([[fnContextKey, fn]])))) : succeedContext(makeUnsafe$5(/* @__PURE__ */ new Map([[fnContextKey, middleware]]))));
|
|
5850
5850
|
let middlewareId = 0;
|
|
5851
5851
|
const fnContextKey = "effect/http/HttpRouter/MiddlewareFn";
|
|
5852
5852
|
var MiddlewareImpl = class MiddlewareImpl {
|
|
@@ -5866,7 +5866,7 @@ var MiddlewareImpl = class MiddlewareImpl {
|
|
|
5866
5866
|
const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
|
|
5867
5867
|
stack.push(...getMiddleware(depsContext));
|
|
5868
5868
|
}
|
|
5869
|
-
return makeUnsafe$
|
|
5869
|
+
return makeUnsafe$5(/* @__PURE__ */ new Map([[contextKey, stack]]));
|
|
5870
5870
|
})).pipe(provide$1(this.layerFn));
|
|
5871
5871
|
}
|
|
5872
5872
|
layer;
|
|
@@ -5936,7 +5936,7 @@ const serve = (appLayer, options) => {
|
|
|
5936
5936
|
* @stability stable
|
|
5937
5937
|
* @since 2.0.0
|
|
5938
5938
|
*/
|
|
5939
|
-
const TypeId$
|
|
5939
|
+
const TypeId$9 = "~effect/FiberSet";
|
|
5940
5940
|
/**
|
|
5941
5941
|
* Checks whether a value is a FiberSet.
|
|
5942
5942
|
*
|
|
@@ -5959,9 +5959,9 @@ const TypeId$8 = "~effect/FiberSet";
|
|
|
5959
5959
|
* @category guards
|
|
5960
5960
|
* @since 2.0.0
|
|
5961
5961
|
*/
|
|
5962
|
-
const isFiberSet = (u) => hasProperty(u, TypeId$
|
|
5963
|
-
const Proto$
|
|
5964
|
-
[TypeId$
|
|
5962
|
+
const isFiberSet = (u) => hasProperty(u, TypeId$9);
|
|
5963
|
+
const Proto$6 = {
|
|
5964
|
+
[TypeId$9]: TypeId$9,
|
|
5965
5965
|
[Symbol.iterator]() {
|
|
5966
5966
|
if (this.state._tag === "Closed") return empty$12();
|
|
5967
5967
|
return this.state.backing[Symbol.iterator]();
|
|
@@ -5974,8 +5974,8 @@ const Proto$5 = {
|
|
|
5974
5974
|
};
|
|
5975
5975
|
}
|
|
5976
5976
|
};
|
|
5977
|
-
const makeUnsafe$
|
|
5978
|
-
const self = Object.create(Proto$
|
|
5977
|
+
const makeUnsafe$2 = (backing, deferred) => {
|
|
5978
|
+
const self = Object.create(Proto$6);
|
|
5979
5979
|
self.state = {
|
|
5980
5980
|
_tag: "Open",
|
|
5981
5981
|
backing
|
|
@@ -6019,7 +6019,7 @@ const makeUnsafe$1 = (backing, deferred) => {
|
|
|
6019
6019
|
* @category constructors
|
|
6020
6020
|
* @since 2.0.0
|
|
6021
6021
|
*/
|
|
6022
|
-
const make$
|
|
6022
|
+
const make$21 = () => acquireRelease(sync(() => makeUnsafe$2(/* @__PURE__ */ new Set(), makeUnsafe$6())), (set) => suspend(() => {
|
|
6023
6023
|
const state = set.state;
|
|
6024
6024
|
if (state._tag === "Closed") return void_;
|
|
6025
6025
|
set.state = { _tag: "Closed" };
|
|
@@ -6292,10 +6292,10 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
|
|
|
6292
6292
|
const services = yield* context();
|
|
6293
6293
|
const scope = get$6(services, Scope);
|
|
6294
6294
|
const trackFiber = runIn(forkUnsafe$1(scope, "parallel"));
|
|
6295
|
-
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$
|
|
6295
|
+
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$37(concurrency);
|
|
6296
6296
|
const clients = /* @__PURE__ */ new Map();
|
|
6297
6297
|
let isShutdown = false;
|
|
6298
|
-
const shutdownLatch = makeUnsafe$
|
|
6298
|
+
const shutdownLatch = makeUnsafe$7(false);
|
|
6299
6299
|
yield* addFinalizer(scope, withFiber((parent) => {
|
|
6300
6300
|
isShutdown = true;
|
|
6301
6301
|
for (const client of clients.values()) {
|
|
@@ -6397,7 +6397,7 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
|
|
|
6397
6397
|
}) : streamOrEffect;
|
|
6398
6398
|
const withMiddleware = rpc.middlewares.size === 0 ? handler : isStream ? flatMap(exit(applyMiddleware(services, handler, metadata)), (exit) => writeFailure ? failCause(writeFailure) : exit) : applyMiddleware(services, handler, metadata);
|
|
6399
6399
|
let responded = false;
|
|
6400
|
-
const scope = makeUnsafe$
|
|
6400
|
+
const scope = makeUnsafe$4();
|
|
6401
6401
|
let deferred = void 0;
|
|
6402
6402
|
let effect = onExit(withMiddleware, (exit) => {
|
|
6403
6403
|
responded = true;
|
|
@@ -6487,7 +6487,7 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
|
|
|
6487
6487
|
client.latches ??= /* @__PURE__ */ new Map();
|
|
6488
6488
|
latch = client.latches.get(request.id);
|
|
6489
6489
|
if (!latch) {
|
|
6490
|
-
latch = makeUnsafe$
|
|
6490
|
+
latch = makeUnsafe$7(false);
|
|
6491
6491
|
client.latches.set(request.id, latch);
|
|
6492
6492
|
}
|
|
6493
6493
|
}
|
|
@@ -6560,7 +6560,7 @@ const handlerContext = (entry, fiberContext) => {
|
|
|
6560
6560
|
return merged;
|
|
6561
6561
|
};
|
|
6562
6562
|
const applyMiddleware = (context, handler, options) => {
|
|
6563
|
-
for (const service of options.rpc.middlewares) handler = getUnsafe(context, service)(handler, options);
|
|
6563
|
+
for (const service of options.rpc.middlewares) handler = getUnsafe$1(context, service)(handler, options);
|
|
6564
6564
|
return handler;
|
|
6565
6565
|
};
|
|
6566
6566
|
/**
|
|
@@ -6572,11 +6572,11 @@ const applyMiddleware = (context, handler, options) => {
|
|
|
6572
6572
|
* @category running
|
|
6573
6573
|
* @since 4.0.0
|
|
6574
6574
|
*/
|
|
6575
|
-
const make$
|
|
6575
|
+
const make$20 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
6576
6576
|
const { codecFor, disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
|
|
6577
6577
|
const { encodeDefectUnsafe, encodeUnknownRequestExit } = defectCodecs(codecFor);
|
|
6578
6578
|
const services = yield* context();
|
|
6579
|
-
const scope = yield* make$
|
|
6579
|
+
const scope = yield* make$38();
|
|
6580
6580
|
const server = yield* makeNoSerialization(group, {
|
|
6581
6581
|
...options,
|
|
6582
6582
|
disableClientAcks: !supportsAck,
|
|
@@ -6719,7 +6719,7 @@ const make$19 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
|
6719
6719
|
* @category layers
|
|
6720
6720
|
* @since 4.0.0
|
|
6721
6721
|
*/
|
|
6722
|
-
const layer$7 = (group, options) => effectDiscard(forkScoped(make$
|
|
6722
|
+
const layer$7 = (group, options) => effectDiscard(forkScoped(make$20(group, options)));
|
|
6723
6723
|
/**
|
|
6724
6724
|
* Creates a RPC server that registers a HTTP route with a `HttpRouter`.
|
|
6725
6725
|
*
|
|
@@ -6813,7 +6813,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
|
|
|
6813
6813
|
const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
|
|
6814
6814
|
const includesFraming = serialization.includesFraming;
|
|
6815
6815
|
const isBinary = !serialization.contentType.includes("json");
|
|
6816
|
-
const disconnects = yield* make$
|
|
6816
|
+
const disconnects = yield* make$39();
|
|
6817
6817
|
let writeRequest;
|
|
6818
6818
|
let clientId = 0;
|
|
6819
6819
|
const clients = /* @__PURE__ */ new Map();
|
|
@@ -6821,12 +6821,12 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
|
|
|
6821
6821
|
const encoder = new TextEncoder();
|
|
6822
6822
|
const httpEffect = gen(function* () {
|
|
6823
6823
|
const fiber = getCurrent();
|
|
6824
|
-
const request = getUnsafe(fiber.context, HttpServerRequest);
|
|
6825
|
-
const scope = getUnsafe(fiber.context, Scope);
|
|
6824
|
+
const request = getUnsafe$1(fiber.context, HttpServerRequest);
|
|
6825
|
+
const scope = getUnsafe$1(fiber.context, Scope);
|
|
6826
6826
|
const requestHeaders = Object.entries(request.headers);
|
|
6827
6827
|
const data = yield* orDie(isBinary ? map$1(request.arrayBuffer, (buf) => new Uint8Array(buf)) : request.text);
|
|
6828
6828
|
const id = clientId++;
|
|
6829
|
-
const queue = yield* make$
|
|
6829
|
+
const queue = yield* make$39({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
|
|
6830
6830
|
const parser = serialization.makeUnsafe();
|
|
6831
6831
|
const requestIds = [];
|
|
6832
6832
|
const offer$1 = (data) => typeof data === "string" ? offer(queue, encoder.encode(data)) : offer(queue, data);
|
|
@@ -6943,7 +6943,7 @@ const layerProtocolHttp = (options) => {
|
|
|
6943
6943
|
const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
|
|
6944
6944
|
const serialization = yield* RpcSerialization;
|
|
6945
6945
|
const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
|
|
6946
|
-
const disconnects = yield* make$
|
|
6946
|
+
const disconnects = yield* make$39();
|
|
6947
6947
|
let clientId = 0;
|
|
6948
6948
|
const clients = /* @__PURE__ */ new Map();
|
|
6949
6949
|
const clientIds = /* @__PURE__ */ new Set();
|
|
@@ -7035,7 +7035,7 @@ const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
|
|
|
7035
7035
|
* @stability stable
|
|
7036
7036
|
* @since 2.0.0
|
|
7037
7037
|
*/
|
|
7038
|
-
const TypeId$
|
|
7038
|
+
const TypeId$8 = "~effect/FiberMap";
|
|
7039
7039
|
/**
|
|
7040
7040
|
* Returns `true` if a value is a `FiberMap`.
|
|
7041
7041
|
*
|
|
@@ -7062,9 +7062,9 @@ const TypeId$7 = "~effect/FiberMap";
|
|
|
7062
7062
|
* @category guards
|
|
7063
7063
|
* @since 2.0.0
|
|
7064
7064
|
*/
|
|
7065
|
-
const isFiberMap = (u) => hasProperty(u, TypeId$
|
|
7066
|
-
const Proto$
|
|
7067
|
-
[TypeId$
|
|
7065
|
+
const isFiberMap = (u) => hasProperty(u, TypeId$8);
|
|
7066
|
+
const Proto$5 = {
|
|
7067
|
+
[TypeId$8]: TypeId$8,
|
|
7068
7068
|
[Symbol.iterator]() {
|
|
7069
7069
|
if (this.state._tag === "Closed") return empty$12();
|
|
7070
7070
|
return this.state.backing[Symbol.iterator]();
|
|
@@ -7077,8 +7077,8 @@ const Proto$4 = {
|
|
|
7077
7077
|
};
|
|
7078
7078
|
}
|
|
7079
7079
|
};
|
|
7080
|
-
const makeUnsafe = (backing, deferred) => {
|
|
7081
|
-
const self = Object.create(Proto$
|
|
7080
|
+
const makeUnsafe$1 = (backing, deferred) => {
|
|
7081
|
+
const self = Object.create(Proto$5);
|
|
7082
7082
|
self.state = {
|
|
7083
7083
|
_tag: "Open",
|
|
7084
7084
|
backing
|
|
@@ -7122,7 +7122,7 @@ const makeUnsafe = (backing, deferred) => {
|
|
|
7122
7122
|
* @category constructors
|
|
7123
7123
|
* @since 2.0.0
|
|
7124
7124
|
*/
|
|
7125
|
-
const make$
|
|
7125
|
+
const make$19 = () => acquireRelease(sync(() => makeUnsafe$1(empty$6(), makeUnsafe$6())), (map) => suspend(() => {
|
|
7126
7126
|
const state = map.state;
|
|
7127
7127
|
if (state._tag === "Closed") return void_;
|
|
7128
7128
|
map.state = { _tag: "Closed" };
|
|
@@ -10949,13 +10949,13 @@ var NodeHttpIncomingMessage = class extends Class {
|
|
|
10949
10949
|
*
|
|
10950
10950
|
* @since 4.0.0
|
|
10951
10951
|
*/
|
|
10952
|
-
[TypeId$
|
|
10952
|
+
[TypeId$17];
|
|
10953
10953
|
source;
|
|
10954
10954
|
onError;
|
|
10955
10955
|
remoteAddressOverride;
|
|
10956
10956
|
constructor(source, onError, remoteAddressOverride) {
|
|
10957
10957
|
super();
|
|
10958
|
-
this[TypeId$
|
|
10958
|
+
this[TypeId$17] = TypeId$17;
|
|
10959
10959
|
this.source = source;
|
|
10960
10960
|
this.onError = onError;
|
|
10961
10961
|
this.remoteAddressOverride = remoteAddressOverride;
|
|
@@ -11082,7 +11082,7 @@ var RequestInit = class extends (/*#__PURE__*/ Service()("effect/http/FetchHttpC
|
|
|
11082
11082
|
* @category layers
|
|
11083
11083
|
* @since 4.0.0
|
|
11084
11084
|
*/
|
|
11085
|
-
const layer$6 = /*#__PURE__*/ layerMergedContext(/*#__PURE__*/ succeed$1(/* @__PURE__ */ make$
|
|
11085
|
+
const layer$6 = /*#__PURE__*/ layerMergedContext(/*#__PURE__*/ succeed$1(/* @__PURE__ */ make$32((request, url, signal, fiber) => {
|
|
11086
11086
|
const fetch = fiber.getRef(Fetch);
|
|
11087
11087
|
const options = getOrUndefined$1(fiber.context, RequestInit) ?? {};
|
|
11088
11088
|
let headers = options.headers ? merge$2(fromInput$1(options.headers), request.headers) : request.headers;
|
|
@@ -11150,7 +11150,7 @@ const layerAgentOptions = /*#__PURE__*/ flow(makeAgent, /*#__PURE__*/ effect(Htt
|
|
|
11150
11150
|
*/
|
|
11151
11151
|
const makeNodeHttp = /*#__PURE__*/ gen(function* () {
|
|
11152
11152
|
const agent = yield* HttpAgent;
|
|
11153
|
-
return make$
|
|
11153
|
+
return make$32((request, url, signal) => {
|
|
11154
11154
|
const nodeRequest = url.protocol === "https:" ? Https.request(url, {
|
|
11155
11155
|
agent: agent.https,
|
|
11156
11156
|
method: request.method,
|
|
@@ -11238,7 +11238,7 @@ const waitForFinish = (nodeRequest, request) => callback((resume) => {
|
|
|
11238
11238
|
});
|
|
11239
11239
|
});
|
|
11240
11240
|
var NodeHttpResponse = class extends NodeHttpIncomingMessage {
|
|
11241
|
-
[TypeId$
|
|
11241
|
+
[TypeId$16];
|
|
11242
11242
|
request;
|
|
11243
11243
|
url;
|
|
11244
11244
|
constructor(request, source, url) {
|
|
@@ -11247,7 +11247,7 @@ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
|
|
|
11247
11247
|
response: this,
|
|
11248
11248
|
cause
|
|
11249
11249
|
}) }));
|
|
11250
|
-
this[TypeId$
|
|
11250
|
+
this[TypeId$16] = TypeId$16;
|
|
11251
11251
|
this.request = request;
|
|
11252
11252
|
this.url = url;
|
|
11253
11253
|
}
|
|
@@ -11358,7 +11358,7 @@ const compress = (data, algorithm, options) => callback((resume) => {
|
|
|
11358
11358
|
* @category constructors
|
|
11359
11359
|
* @since 4.0.0
|
|
11360
11360
|
*/
|
|
11361
|
-
const make$
|
|
11361
|
+
const make$18 = (fallback) => ({
|
|
11362
11362
|
algorithms: fallback.algorithms,
|
|
11363
11363
|
compressResponse(response, algorithm, options) {
|
|
11364
11364
|
const body = response.body;
|
|
@@ -11445,9 +11445,9 @@ const compressedBody = (response, body) => removeHeader(setBody(response, body),
|
|
|
11445
11445
|
* @category constructors
|
|
11446
11446
|
* @since 4.0.0
|
|
11447
11447
|
*/
|
|
11448
|
-
const make$
|
|
11448
|
+
const make$17 = /*#__PURE__*/ make$29({
|
|
11449
11449
|
platform: "node",
|
|
11450
|
-
compression: /* @__PURE__ */ make$
|
|
11450
|
+
compression: /* @__PURE__ */ make$18({
|
|
11451
11451
|
algorithms,
|
|
11452
11452
|
compressResponse(response, algorithm, options) {
|
|
11453
11453
|
const body = response.body;
|
|
@@ -11502,7 +11502,7 @@ const make$16 = /*#__PURE__*/ make$28({
|
|
|
11502
11502
|
* @category layers
|
|
11503
11503
|
* @since 4.0.0
|
|
11504
11504
|
*/
|
|
11505
|
-
const layer$5 = /*#__PURE__*/ pipe(/*#__PURE__*/ effect(HttpPlatform)(make$
|
|
11505
|
+
const layer$5 = /*#__PURE__*/ pipe(/*#__PURE__*/ effect(HttpPlatform)(make$17), /*#__PURE__*/ provide$1(layer$10), /*#__PURE__*/ provide$1(layer$9));
|
|
11506
11506
|
//#endregion
|
|
11507
11507
|
//#region ../../node_modules/.pnpm/@effect+platform-node@4.0.5_effect@4.0.5_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeMultipartParser.js
|
|
11508
11508
|
/**
|
|
@@ -11520,7 +11520,7 @@ var MultipartStream = class extends Duplex {
|
|
|
11520
11520
|
super({ readableObjectMode: true });
|
|
11521
11521
|
let currentError;
|
|
11522
11522
|
let currentFile;
|
|
11523
|
-
this._parser = make$
|
|
11523
|
+
this._parser = make$25({
|
|
11524
11524
|
...config,
|
|
11525
11525
|
onField: (info, value) => {
|
|
11526
11526
|
if (currentError !== void 0) return;
|
|
@@ -11583,7 +11583,7 @@ var MultipartStream = class extends Duplex {
|
|
|
11583
11583
|
* @category constructors
|
|
11584
11584
|
* @since 4.0.0
|
|
11585
11585
|
*/
|
|
11586
|
-
const make$
|
|
11586
|
+
const make$16 = (config) => new MultipartStream(config);
|
|
11587
11587
|
/**
|
|
11588
11588
|
* A readable stream containing a parsed multipart file.
|
|
11589
11589
|
*
|
|
@@ -11632,7 +11632,7 @@ var FileStream = class extends Readable {
|
|
|
11632
11632
|
*/
|
|
11633
11633
|
const stream = (source, headers) => makeConfig(headers).pipe(map$1((config) => fromReadable({
|
|
11634
11634
|
evaluate() {
|
|
11635
|
-
const parser = make$
|
|
11635
|
+
const parser = make$16(config);
|
|
11636
11636
|
source.pipe(parser);
|
|
11637
11637
|
return parser;
|
|
11638
11638
|
},
|
|
@@ -11652,10 +11652,10 @@ const persisted = (source, headers) => toPersisted(stream(source, headers), (pat
|
|
|
11652
11652
|
}));
|
|
11653
11653
|
const convertPart = (part) => part._tag === "Field" ? new FieldImpl(part.info, part.value) : new FileImpl(part);
|
|
11654
11654
|
var PartBase = class extends Class {
|
|
11655
|
-
[TypeId$
|
|
11655
|
+
[TypeId$12];
|
|
11656
11656
|
constructor() {
|
|
11657
11657
|
super();
|
|
11658
|
-
this[TypeId$
|
|
11658
|
+
this[TypeId$12] = TypeId$12;
|
|
11659
11659
|
}
|
|
11660
11660
|
};
|
|
11661
11661
|
var FieldImpl = class extends PartBase {
|
|
@@ -11746,7 +11746,7 @@ function convertError(cause) {
|
|
|
11746
11746
|
* @category constructors
|
|
11747
11747
|
* @since 4.0.0
|
|
11748
11748
|
*/
|
|
11749
|
-
const make$
|
|
11749
|
+
const make$15 = /*#__PURE__*/ fnUntraced(function* (evaluate, options) {
|
|
11750
11750
|
const scope$2 = yield* scope;
|
|
11751
11751
|
const server = evaluate();
|
|
11752
11752
|
const shutdown = yield* callback((resume) => {
|
|
@@ -11779,7 +11779,7 @@ const make$14 = /*#__PURE__*/ fnUntraced(function* (evaluate, options) {
|
|
|
11779
11779
|
})), (wss) => callback((resume) => {
|
|
11780
11780
|
wss.close(() => resume(void_));
|
|
11781
11781
|
})).pipe(provide$2(scope$2), cached);
|
|
11782
|
-
return make$
|
|
11782
|
+
return make$23({
|
|
11783
11783
|
address: boundAddress,
|
|
11784
11784
|
serve: fnUntraced(function* (httpApp, middleware) {
|
|
11785
11785
|
const serveScope = yield* scope;
|
|
@@ -11874,7 +11874,7 @@ const makeUpgradeHandler = (lazyWss, httpEffect, options) => {
|
|
|
11874
11874
|
});
|
|
11875
11875
|
};
|
|
11876
11876
|
var ServerRequestImpl = class ServerRequestImpl extends NodeHttpIncomingMessage {
|
|
11877
|
-
[TypeId$
|
|
11877
|
+
[TypeId$11];
|
|
11878
11878
|
response;
|
|
11879
11879
|
upgradeEffect;
|
|
11880
11880
|
upgraded = false;
|
|
@@ -11885,7 +11885,7 @@ var ServerRequestImpl = class ServerRequestImpl extends NodeHttpIncomingMessage
|
|
|
11885
11885
|
request: this,
|
|
11886
11886
|
cause
|
|
11887
11887
|
}) }), remoteAddressOverride);
|
|
11888
|
-
this[TypeId$
|
|
11888
|
+
this[TypeId$11] = TypeId$11;
|
|
11889
11889
|
this.response = response;
|
|
11890
11890
|
this.upgradeEffect = upgradeEffect;
|
|
11891
11891
|
this.url = url;
|
|
@@ -11957,7 +11957,7 @@ const layerHttpServices = /*#__PURE__*/ mergeAll(layer$5, layerWeak, layer$11);
|
|
|
11957
11957
|
* @category layers
|
|
11958
11958
|
* @since 4.0.0
|
|
11959
11959
|
*/
|
|
11960
|
-
const layerConfig = (evaluate, options) => mergeAll(effect(HttpServer)(flatMap(unwrap$4(options), (options) => make$
|
|
11960
|
+
const layerConfig = (evaluate, options) => mergeAll(effect(HttpServer)(flatMap(unwrap$4(options), (options) => make$15(evaluate, options))), layerHttpServices);
|
|
11961
11961
|
const closeCode = (exit) => isSuccess$1(exit) ? 1e3 : hasInterruptsOnly(exit.cause) ? 1001 : 1011;
|
|
11962
11962
|
const upgradedResponse = /*#__PURE__*/ empty$3({ status: 101 });
|
|
11963
11963
|
const handleResponse = (request, response) => {
|
|
@@ -12038,7 +12038,7 @@ const handleResponse = (request, response) => {
|
|
|
12038
12038
|
});
|
|
12039
12039
|
case "Stream": {
|
|
12040
12040
|
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
12041
|
-
const drainLatch = makeUnsafe$
|
|
12041
|
+
const drainLatch = makeUnsafe$7();
|
|
12042
12042
|
nodeResponse.on("drain", () => drainLatch.openUnsafe());
|
|
12043
12043
|
return body.stream.pipe(orDie$1, runForEachArray((array) => {
|
|
12044
12044
|
const chunk = array.length > 1 ? Buffer.concat(array) : array[0];
|
|
@@ -12387,7 +12387,7 @@ const utf8Strings = (record) => {
|
|
|
12387
12387
|
*/
|
|
12388
12388
|
const layer$4 = /*#__PURE__*/ effect(Dns, /*#__PURE__*/ orDie(/*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (options) {
|
|
12389
12389
|
const resolve = yield* resolver(options);
|
|
12390
|
-
return make$
|
|
12390
|
+
return make$40({
|
|
12391
12391
|
lookup,
|
|
12392
12392
|
resolve: (name, type) => map$1(resolve(name, type), map$3(utf8Strings))
|
|
12393
12393
|
});
|
|
@@ -12785,6 +12785,110 @@ const when = when$1;
|
|
|
12785
12785
|
*/
|
|
12786
12786
|
const orElse = orElse$1;
|
|
12787
12787
|
//#endregion
|
|
12788
|
+
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SynchronizedRef.js
|
|
12789
|
+
/**
|
|
12790
|
+
* Stores mutable state whose updates run one at a time.
|
|
12791
|
+
*
|
|
12792
|
+
* A `SynchronizedRef<A>` behaves like a `Ref<A>` for reading and simple state
|
|
12793
|
+
* storage, but update and modify operations are serialized so each change sees
|
|
12794
|
+
* a consistent current value. This is especially useful when the next value is
|
|
12795
|
+
* computed by an effect, because the effectful transition is still protected
|
|
12796
|
+
* from concurrent updates. This module includes constructors, reads, writes,
|
|
12797
|
+
* updates, partial updates, and effectful update helpers.
|
|
12798
|
+
*
|
|
12799
|
+
* @stability stable
|
|
12800
|
+
* @since 2.0.0
|
|
12801
|
+
*/
|
|
12802
|
+
const TypeId$6 = "~effect/SynchronizedRef";
|
|
12803
|
+
const Proto$4 = {
|
|
12804
|
+
...PipeInspectableProto,
|
|
12805
|
+
[TypeId$6]: TypeId$6,
|
|
12806
|
+
toJSON() {
|
|
12807
|
+
return {
|
|
12808
|
+
_id: "SynchronizedRef",
|
|
12809
|
+
value: this.backing.ref.current
|
|
12810
|
+
};
|
|
12811
|
+
}
|
|
12812
|
+
};
|
|
12813
|
+
/**
|
|
12814
|
+
* Creates a `SynchronizedRef` synchronously from an initial value.
|
|
12815
|
+
*
|
|
12816
|
+
* **When to use**
|
|
12817
|
+
*
|
|
12818
|
+
* Use when you need synchronous `SynchronizedRef` construction outside an
|
|
12819
|
+
* Effect workflow.
|
|
12820
|
+
*
|
|
12821
|
+
* @stability stable
|
|
12822
|
+
* @category constructors
|
|
12823
|
+
* @since 4.0.0
|
|
12824
|
+
*/
|
|
12825
|
+
const makeUnsafe = (value) => {
|
|
12826
|
+
const self = Object.create(Proto$4);
|
|
12827
|
+
self.semaphore = makeUnsafe$8(1);
|
|
12828
|
+
self.backing = makeUnsafe$3(value);
|
|
12829
|
+
return self;
|
|
12830
|
+
};
|
|
12831
|
+
/**
|
|
12832
|
+
* Creates a `SynchronizedRef` from an initial value, wrapped in an `Effect`.
|
|
12833
|
+
*
|
|
12834
|
+
* **When to use**
|
|
12835
|
+
*
|
|
12836
|
+
* Use to create a `SynchronizedRef` inside an Effect program when later updates
|
|
12837
|
+
* may run effects and must be serialized.
|
|
12838
|
+
*
|
|
12839
|
+
* **Details**
|
|
12840
|
+
*
|
|
12841
|
+
* The returned effect constructs a fresh `SynchronizedRef` by delegating to
|
|
12842
|
+
* `makeUnsafe` when the effect is evaluated.
|
|
12843
|
+
*
|
|
12844
|
+
* @see {@link makeUnsafe} for synchronous construction when the caller controls safe initialization
|
|
12845
|
+
* @see {@link Ref.make} for a plain `Ref` when updates do not need effectful synchronization
|
|
12846
|
+
*
|
|
12847
|
+
* @stability stable
|
|
12848
|
+
* @category constructors
|
|
12849
|
+
* @since 2.0.0
|
|
12850
|
+
*/
|
|
12851
|
+
const make$13 = (value) => sync(() => makeUnsafe(value));
|
|
12852
|
+
/**
|
|
12853
|
+
* Reads the current value synchronously, bypassing the `Effect` API and the
|
|
12854
|
+
* ref's semaphore.
|
|
12855
|
+
*
|
|
12856
|
+
* **When to use**
|
|
12857
|
+
*
|
|
12858
|
+
* Use when you need immediate synchronous access to a `SynchronizedRef` value
|
|
12859
|
+
* in low-level code that can safely read outside an `Effect`.
|
|
12860
|
+
*
|
|
12861
|
+
* @see {@link get} for the Effect-wrapped read when composing inside Effect programs
|
|
12862
|
+
*
|
|
12863
|
+
* @stability stable
|
|
12864
|
+
* @category getters
|
|
12865
|
+
* @since 4.0.0
|
|
12866
|
+
*/
|
|
12867
|
+
const getUnsafe = (self) => self.backing.ref.current;
|
|
12868
|
+
/**
|
|
12869
|
+
* Runs an effectful modification atomically while holding the ref's semaphore,
|
|
12870
|
+
* stores the new value if the effect succeeds, and returns the computed result.
|
|
12871
|
+
*
|
|
12872
|
+
* **When to use**
|
|
12873
|
+
*
|
|
12874
|
+
* Use to effectfully compute both a separate return value and the next stored
|
|
12875
|
+
* `SynchronizedRef` value in one serialized update.
|
|
12876
|
+
*
|
|
12877
|
+
* @see {@link modify} for the pure variant
|
|
12878
|
+
* @see {@link updateEffect} for effectfully storing a new value without a separate result
|
|
12879
|
+
*
|
|
12880
|
+
* @stability stable
|
|
12881
|
+
* @category mutations
|
|
12882
|
+
* @since 2.0.0
|
|
12883
|
+
*/
|
|
12884
|
+
const modifyEffect$1 = /*#__PURE__*/ dual(2, (self, f) => self.semaphore.withPermit(suspend(() => {
|
|
12885
|
+
const value = getUnsafe(self);
|
|
12886
|
+
return map$1(f(value), ([b, a]) => {
|
|
12887
|
+
self.backing.ref.current = a;
|
|
12888
|
+
return b;
|
|
12889
|
+
});
|
|
12890
|
+
})));
|
|
12891
|
+
//#endregion
|
|
12788
12892
|
//#region ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SubscriptionRef.js
|
|
12789
12893
|
/**
|
|
12790
12894
|
* Stores mutable state and publishes changes as a stream.
|
|
@@ -12831,7 +12935,7 @@ const Proto$3 = {
|
|
|
12831
12935
|
*/
|
|
12832
12936
|
const make$12 = (value) => map$1(unbounded({ replay: 1 }), (pubsub) => {
|
|
12833
12937
|
const self = Object.create(Proto$3);
|
|
12834
|
-
self.semaphore = makeUnsafe$
|
|
12938
|
+
self.semaphore = makeUnsafe$8(1);
|
|
12835
12939
|
self.value = value;
|
|
12836
12940
|
self.pubsub = pubsub;
|
|
12837
12941
|
publishUnsafe(self.pubsub, value);
|
|
@@ -13643,7 +13747,7 @@ function userFrom(auth, headers) {
|
|
|
13643
13747
|
return pipe(get$7(headers, "authorization"), filter$4(startsWith("Bearer ")), map$5(replace$1("Bearer ", "")), orElse$2(() => pipe(get$7(headers, "cookie"), flatMapNullishOr((cookie) => parseHeader(cookie)[SESSION_COOKIE]))), fromOption, rejected("Sign in first"), flatMap((token) => auth.verify(token)));
|
|
13644
13748
|
}
|
|
13645
13749
|
function provide(auth) {
|
|
13646
|
-
return pipe(make$
|
|
13750
|
+
return pipe(make$41(Auth, auth), add$1(RpcAuth, RpcAuth.of((effect, request) => flatMap(userFrom(auth, request.headers), (user) => provideService(effect, CurrentUser, user)))));
|
|
13647
13751
|
}
|
|
13648
13752
|
function verifyWith(current) {
|
|
13649
13753
|
return fn$1("Auth.verify")(function* (token) {
|
|
@@ -13659,7 +13763,11 @@ function verifyWith(current) {
|
|
|
13659
13763
|
}
|
|
13660
13764
|
const SameOrigin = middleware((httpEffect) => gen(function* () {
|
|
13661
13765
|
const request = yield* HttpServerRequest;
|
|
13662
|
-
|
|
13766
|
+
const scheme = match(exists(get$7(request.headers, "x-forwarded-proto"), (proto) => proto === "https" || proto === "wss"), {
|
|
13767
|
+
onFalse: () => "http",
|
|
13768
|
+
onTrue: () => "https"
|
|
13769
|
+
});
|
|
13770
|
+
if (exists(get$7(request.headers, "origin"), (origin) => origin !== `${scheme}://${request.headers["host"] ?? ""}`)) return text$2("The request comes from another origin", { status: 403 });
|
|
13663
13771
|
return yield* httpEffect;
|
|
13664
13772
|
}), { global: true });
|
|
13665
13773
|
function parentDomain(request) {
|
|
@@ -13735,7 +13843,7 @@ var Auth = class Auth extends Service()("@deslop/auth/service/Auth") {
|
|
|
13735
13843
|
publicKey,
|
|
13736
13844
|
users: fromIterable$2(verification.users)
|
|
13737
13845
|
}))), timeout("10 seconds"));
|
|
13738
|
-
const current = yield* make$
|
|
13846
|
+
const current = yield* make$35(yield* pipe(read, tapError$1((cause) => logWarning(`Cannot read the auth keys from ${url}`, cause)), retry(spaced("5 seconds"))));
|
|
13739
13847
|
yield* pipe(read, flatMap((verification) => set(current, verification)), ignore$1({
|
|
13740
13848
|
log: "Warn",
|
|
13741
13849
|
message: `Cannot refresh the auth keys from ${url}`
|
|
@@ -13886,7 +13994,7 @@ const make$10 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
13886
13994
|
package: "@effect/opentelemetry",
|
|
13887
13995
|
module: options.label
|
|
13888
13996
|
}));
|
|
13889
|
-
const exportFibers = yield* make$
|
|
13997
|
+
const exportFibers = yield* make$21();
|
|
13890
13998
|
const runExportFork = yield* runtime(exportFibers)();
|
|
13891
13999
|
yield* (yield* Flusher).register(runExport);
|
|
13892
14000
|
yield* addFinalizer(scope, suspend(() => {
|
|
@@ -14101,7 +14209,7 @@ const make$8 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
14101
14209
|
excludeLogSpans: options.excludeLogSpans ?? false,
|
|
14102
14210
|
clock: yield* Clock
|
|
14103
14211
|
};
|
|
14104
|
-
return make$
|
|
14212
|
+
return make$42((options) => {
|
|
14105
14213
|
exporter.push(makeLogRecord(options, opts));
|
|
14106
14214
|
});
|
|
14107
14215
|
});
|
|
@@ -14226,7 +14334,7 @@ const layer$1 = /*#__PURE__*/ flow(/* @__PURE__ */ fnUntraced(function* (options
|
|
|
14226
14334
|
if (!span.sampled) return;
|
|
14227
14335
|
exporter.push(makeOtlpSpan(span));
|
|
14228
14336
|
}
|
|
14229
|
-
return make$
|
|
14337
|
+
return make$43({
|
|
14230
14338
|
span(options) {
|
|
14231
14339
|
return new SpanImpl(options, exportFn);
|
|
14232
14340
|
},
|
|
@@ -44079,7 +44187,7 @@ function captionTranscript(input) {
|
|
|
44079
44187
|
const cues = pipe(input.vtt, replaceAll(/\r\n?/gu, "\n"), split("\n\n"), flatMap$2((block) => {
|
|
44080
44188
|
const lines = split(block, "\n");
|
|
44081
44189
|
return pipe(findFirstIndex(lines, includes("-->")), map$5((index) => {
|
|
44082
|
-
const times = map$3(pipe(getUnsafe$
|
|
44190
|
+
const times = map$3(pipe(getUnsafe$2(lines, index), split(" --> ")), (time) => reduce(pipe(time, split(" "), headNonEmpty, split(":"), map$3(parse$10), getSomes), 0, (total, part) => total * 60 + part));
|
|
44083
44191
|
return map$3(drop(lines, index + 1), (line) => ({
|
|
44084
44192
|
end: lastNonEmpty(times),
|
|
44085
44193
|
start: headNonEmpty(times),
|
|
@@ -44136,7 +44244,7 @@ const Transcription = Struct({ chunks: ArraySchema(Struct({
|
|
|
44136
44244
|
const MAX_WHISPER_SECONDS = 7200;
|
|
44137
44245
|
const BLOCKED_ANSWER = /not a bot|requir(?:es|ing) login|login required|CONNECT tunnel failed|ProxyError|HTTP Error (?:403|429|5\d\d)|Requested format is not available|timed out/iu;
|
|
44138
44246
|
const run = fnUntraced(function* (command, args) {
|
|
44139
|
-
const handle = yield* make$
|
|
44247
|
+
const handle = yield* make$44(command, args, {
|
|
44140
44248
|
stderr: "pipe",
|
|
44141
44249
|
stdout: "pipe"
|
|
44142
44250
|
});
|
|
@@ -44152,7 +44260,7 @@ var Media = class Media extends Service()("@deslop/stash/services/media/service/
|
|
|
44152
44260
|
const path = yield* Path;
|
|
44153
44261
|
const spawner = yield* ChildProcessSpawner;
|
|
44154
44262
|
const cache = path.join(yield* pipe(String$2("XDG_CACHE_HOME"), withDefault(path.join(yield* String$2("HOME"), ".cache"))), "deslop", "media");
|
|
44155
|
-
const whisper = yield* make$
|
|
44263
|
+
const whisper = yield* make$37(1);
|
|
44156
44264
|
const ytDlpArgs = [
|
|
44157
44265
|
"--js-runtimes",
|
|
44158
44266
|
"node",
|
|
@@ -97047,7 +97155,7 @@ function toCodec(schema) {
|
|
|
97047
97155
|
const encoded = toEncoded(jsonCodec.ast);
|
|
97048
97156
|
const from = transform(encoded);
|
|
97049
97157
|
if (from === encoded) return jsonCodec.ast === schema.ast ? schema : jsonCodec;
|
|
97050
|
-
return make$
|
|
97158
|
+
return make$45(decodeTo$1(from, jsonCodec.ast, passthrough$1()));
|
|
97051
97159
|
}
|
|
97052
97160
|
function transform(root) {
|
|
97053
97161
|
let cache;
|
|
@@ -98795,7 +98903,7 @@ const TypeId$1 = "~effect/ai/Toolkit";
|
|
|
98795
98903
|
* @since 4.0.0
|
|
98796
98904
|
*/
|
|
98797
98905
|
const FailureOrigin = /*#__PURE__*/ Reference("effect/ai/Toolkit/FailureOrigin", { defaultValue: () => "result" });
|
|
98798
|
-
const failureCause = (error, origin) => annotate(fail$4(error), make$
|
|
98906
|
+
const failureCause = (error, origin) => annotate(fail$4(error), make$41(FailureOrigin, origin));
|
|
98799
98907
|
const Proto = {
|
|
98800
98908
|
.../*#__PURE__*/ Prototype({
|
|
98801
98909
|
label: "Toolkit",
|
|
@@ -98867,7 +98975,7 @@ const Proto = {
|
|
|
98867
98975
|
})));
|
|
98868
98976
|
}
|
|
98869
98977
|
const decodedParams = decodedParamsResult.success;
|
|
98870
|
-
const queue = yield* make$
|
|
98978
|
+
const queue = yield* make$39();
|
|
98871
98979
|
const context = {
|
|
98872
98980
|
toolCallId,
|
|
98873
98981
|
preliminary: (result) => asVoid(offer(queue, {
|
|
@@ -98933,7 +99041,7 @@ const Proto = {
|
|
|
98933
99041
|
context: services
|
|
98934
99042
|
});
|
|
98935
99043
|
}
|
|
98936
|
-
return makeUnsafe$
|
|
99044
|
+
return makeUnsafe$5(context$1);
|
|
98937
99045
|
});
|
|
98938
99046
|
},
|
|
98939
99047
|
toLayer(build) {
|
|
@@ -99544,11 +99652,11 @@ const make$1 = /*#__PURE__*/ fnUntraced(function* (params) {
|
|
|
99544
99652
|
return void_;
|
|
99545
99653
|
}) : identity)));
|
|
99546
99654
|
}
|
|
99547
|
-
const queue = yield* make$
|
|
99655
|
+
const queue = yield* make$39();
|
|
99548
99656
|
const deferredFinishParts = [];
|
|
99549
99657
|
if (preResolvedStreamParts.length > 0) yield* offerAll(queue, preResolvedStreamParts);
|
|
99550
|
-
const toolCallFibers = yield* make$
|
|
99551
|
-
const toolCallSemaphore = concurrency === "unbounded" ? void 0 : yield* make$
|
|
99658
|
+
const toolCallFibers = yield* make$21();
|
|
99659
|
+
const toolCallSemaphore = concurrency === "unbounded" ? void 0 : yield* make$37(concurrency);
|
|
99552
99660
|
const pendingToolCalls = /* @__PURE__ */ new Map();
|
|
99553
99661
|
const bufferedToolCalls = [];
|
|
99554
99662
|
const handleToolCall = fnUntraced(function* (part) {
|
|
@@ -101700,7 +101808,7 @@ var Organizer = class Organizer extends Service()("@deslop/stash/services/notes/
|
|
|
101700
101808
|
tags: normalizeTags(response.value.tags)
|
|
101701
101809
|
};
|
|
101702
101810
|
}, timeout("5 minutes"), mapError((cause) => pipe(liftPredicate(cause, is$4(NotesError)), getOrElse(() => NotesError.make({
|
|
101703
|
-
cause: make$
|
|
101811
|
+
cause: make$46(cause),
|
|
101704
101812
|
message: "AI tagging failed; the note is saved as it is."
|
|
101705
101813
|
}))))) });
|
|
101706
101814
|
}));
|
|
@@ -101769,17 +101877,16 @@ function optional(message, fallback) {
|
|
|
101769
101877
|
return (effect) => pipe(effect, tapError$1((error) => logWarning(message, error)), orElseSucceed(fallback));
|
|
101770
101878
|
}
|
|
101771
101879
|
var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/Notes") {
|
|
101772
|
-
static layer = effect(this, gen(function* () {
|
|
101880
|
+
static layer = (directory) => effect(this, gen(function* () {
|
|
101773
101881
|
const fs = yield* FileSystem;
|
|
101774
101882
|
const path = yield* Path;
|
|
101775
101883
|
const sources = yield* Sources;
|
|
101776
101884
|
const media = yield* Media;
|
|
101777
101885
|
const organizer = yield* Organizer;
|
|
101778
|
-
const directory = yield* pipe(String$2("STASH_DATA_DIR"), withDefault(path.join(yield* String$2("HOME"), ".deslop", "stash")));
|
|
101779
101886
|
const images = path.join(directory, "images");
|
|
101780
101887
|
const files = path.join(directory, "files");
|
|
101781
|
-
const reading = yield* make$
|
|
101782
|
-
const runs = yield* make$
|
|
101888
|
+
const reading = yield* make$37(2);
|
|
101889
|
+
const runs = yield* make$19();
|
|
101783
101890
|
const storageFailed = mapError((cause) => NotesError.make({
|
|
101784
101891
|
cause,
|
|
101785
101892
|
message: "The notes database or files could not be read or written."
|
|
@@ -101802,7 +101909,7 @@ var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/
|
|
|
101802
101909
|
}));
|
|
101803
101910
|
}
|
|
101804
101911
|
function updateNote(id, change) {
|
|
101805
|
-
return transact((current) => make$
|
|
101912
|
+
return transact((current) => make$47(void 0, changeNote(current, id, change)));
|
|
101806
101913
|
}
|
|
101807
101914
|
function findNote(id) {
|
|
101808
101915
|
return map$1(get$1(state), (notes) => findFirst(notes, (note) => note.id === id));
|
|
@@ -101995,8 +102102,8 @@ var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/
|
|
|
101995
102102
|
text: ""
|
|
101996
102103
|
});
|
|
101997
102104
|
const earlier = yield* transact((current) => match$1(findFirst(current, (item) => item.id === input.id), {
|
|
101998
|
-
onNone: () => make$
|
|
101999
|
-
onSome: (item) => make$
|
|
102105
|
+
onNone: () => make$47(none(), prepend$2(current, note)),
|
|
102106
|
+
onSome: (item) => make$47(some$1(item), current)
|
|
102000
102107
|
}));
|
|
102001
102108
|
return yield* match$1(earlier, {
|
|
102002
102109
|
onNone: () => as$1(start(note), note),
|
|
@@ -102029,18 +102136,18 @@ var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/
|
|
|
102029
102136
|
onSome: (link) => ({ url: link })
|
|
102030
102137
|
})
|
|
102031
102138
|
});
|
|
102032
|
-
return make$
|
|
102139
|
+
return make$47({
|
|
102033
102140
|
fresh: true,
|
|
102034
102141
|
note
|
|
102035
102142
|
}, prepend$2(current, note));
|
|
102036
102143
|
},
|
|
102037
102144
|
onSome: (note) => {
|
|
102038
102145
|
const merged = withWords(note, text);
|
|
102039
|
-
if (note.id === input.id || merged === note) return make$
|
|
102146
|
+
if (note.id === input.id || merged === note) return make$47({
|
|
102040
102147
|
fresh: false,
|
|
102041
102148
|
note
|
|
102042
102149
|
}, current);
|
|
102043
|
-
return make$
|
|
102150
|
+
return make$47({
|
|
102044
102151
|
fresh: false,
|
|
102045
102152
|
note: merged
|
|
102046
102153
|
}, changeNote(current, note.id, () => merged));
|
|
@@ -102084,20 +102191,20 @@ var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/
|
|
|
102084
102191
|
regenerate: fn$1("Notes.regenerate")(function* (input) {
|
|
102085
102192
|
yield* remove$1(runs, input.id);
|
|
102086
102193
|
const reset = yield* transact((current) => match$1(findFirst(current, (note) => note.id === input.id), {
|
|
102087
|
-
onNone: () => make$
|
|
102194
|
+
onNone: () => make$47(none(), current),
|
|
102088
102195
|
onSome: (found) => {
|
|
102089
102196
|
const next = {
|
|
102090
102197
|
...omit(found, ["issue", "transcript"]),
|
|
102091
102198
|
status: "organizing"
|
|
102092
102199
|
};
|
|
102093
|
-
return make$
|
|
102200
|
+
return make$47(some$1(next), changeNote(current, input.id, () => next));
|
|
102094
102201
|
}
|
|
102095
102202
|
}));
|
|
102096
102203
|
yield* pipe(fromOption(reset), missing, flatMap(start));
|
|
102097
102204
|
}),
|
|
102098
102205
|
remove: fn$1("Notes.remove")(function* (input) {
|
|
102099
102206
|
yield* remove$1(runs, input.id);
|
|
102100
|
-
yield* transact((current) => make$
|
|
102207
|
+
yield* transact((current) => make$47(void 0, match(some$2(current, (note) => note.id === input.id), {
|
|
102101
102208
|
onFalse: () => current,
|
|
102102
102209
|
onTrue: () => filter$5(current, (note) => note.id !== input.id)
|
|
102103
102210
|
})));
|
|
@@ -102110,38 +102217,71 @@ var Notes = class Notes extends Service()("@deslop/stash/services/notes/service/
|
|
|
102110
102217
|
});
|
|
102111
102218
|
}));
|
|
102112
102219
|
};
|
|
102220
|
+
var UserNotes = class UserNotes extends Service()("@deslop/stash/services/notes/service/UserNotes") {
|
|
102221
|
+
static layer = effect(this, gen(function* () {
|
|
102222
|
+
const fs = yield* FileSystem;
|
|
102223
|
+
const path = yield* Path;
|
|
102224
|
+
const directory = yield* pipe(String$2("STASH_DATA_DIR"), withDefault(path.join(yield* String$2("HOME"), ".deslop", "stash")));
|
|
102225
|
+
const users = yield* pipe(fs.makeDirectory(directory, {
|
|
102226
|
+
mode: 448,
|
|
102227
|
+
recursive: true
|
|
102228
|
+
}), andThen(fs.readDirectory(directory)), mapError((cause) => NotesError.make({
|
|
102229
|
+
cause,
|
|
102230
|
+
message: "The notes folder could not be read."
|
|
102231
|
+
})));
|
|
102232
|
+
const scope = yield* Scope;
|
|
102233
|
+
const services = succeedContext(yield* context());
|
|
102234
|
+
const loaded = yield* make$13(empty$13());
|
|
102235
|
+
const build = fnUntraced(function* (user) {
|
|
102236
|
+
const owned = yield* fork(scope);
|
|
102237
|
+
const context = yield* pipe(buildWithScope(pipe(Notes.layer(path.join(directory, user)), provide$1(services)), owned), onError((cause) => close(owned, failCause$1(cause))));
|
|
102238
|
+
return get$6(context, Notes);
|
|
102239
|
+
});
|
|
102240
|
+
function load(user) {
|
|
102241
|
+
return modifyEffect$1(loaded, (current) => match$1(get$9(current, user), {
|
|
102242
|
+
onNone: () => map$1(build(user), (notes) => make$47(notes, set$4(current, user, notes))),
|
|
102243
|
+
onSome: (notes) => succeed$1(make$47(notes, current))
|
|
102244
|
+
}));
|
|
102245
|
+
}
|
|
102246
|
+
yield* forEach(users, load, {
|
|
102247
|
+
concurrency: 1,
|
|
102248
|
+
discard: true
|
|
102249
|
+
});
|
|
102250
|
+
return UserNotes.of({ current: flatMap(CurrentUser, (user) => load(user.id)) });
|
|
102251
|
+
}));
|
|
102252
|
+
};
|
|
102113
102253
|
//#endregion
|
|
102114
102254
|
//#region src/rpcs/handlers.ts
|
|
102115
102255
|
const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
102116
|
-
const notes = yield*
|
|
102256
|
+
const notes = (yield* UserNotes).current;
|
|
102117
102257
|
return RpcContracts.of({
|
|
102118
|
-
"notes.capture": notes.capture,
|
|
102119
|
-
"notes.get": notes.get,
|
|
102120
|
-
"notes.regenerate": notes.regenerate,
|
|
102121
|
-
"notes.remove": notes.remove,
|
|
102122
|
-
"notes.search": notes.search,
|
|
102123
|
-
"notes.watch": () => notes.events
|
|
102258
|
+
"notes.capture": (input) => flatMap(notes, (service) => service.capture(input)),
|
|
102259
|
+
"notes.get": (input) => flatMap(notes, (service) => service.get(input)),
|
|
102260
|
+
"notes.regenerate": (input) => flatMap(notes, (service) => service.regenerate(input)),
|
|
102261
|
+
"notes.remove": (input) => flatMap(notes, (service) => service.remove(input)),
|
|
102262
|
+
"notes.search": (input) => flatMap(notes, (service) => service.search(input)),
|
|
102263
|
+
"notes.watch": () => unwrap$2(map$1(notes, (service) => service.events))
|
|
102124
102264
|
});
|
|
102125
102265
|
}));
|
|
102126
102266
|
//#endregion
|
|
102127
102267
|
//#region src/main.server.ts
|
|
102128
102268
|
const noteIdParam = schemaPathParams(Struct({ id: NoteId }));
|
|
102129
102269
|
const routes = pipe(use((router) => gen(function* () {
|
|
102130
|
-
const
|
|
102270
|
+
const userNotes = (yield* UserNotes).current;
|
|
102131
102271
|
yield* router.add("POST", "/api/capture", gen(function* () {
|
|
102132
|
-
return yield* schemaJson(Note)(yield*
|
|
102272
|
+
return yield* schemaJson(Note)(yield* (yield* userNotes).capture(yield* schemaBodyJson(Capture)));
|
|
102133
102273
|
}));
|
|
102134
102274
|
yield* router.add("POST", "/api/files/:id", gen(function* () {
|
|
102135
102275
|
const request = yield* HttpServerRequest;
|
|
102136
102276
|
const type = yield* decodeUnknownEffect(FileType)(pipe(request.headers["content-type"] ?? "", split(";"), headNonEmpty, trim));
|
|
102137
|
-
return yield* schemaJson(Note)(yield*
|
|
102277
|
+
return yield* schemaJson(Note)(yield* (yield* userNotes).captureFile({
|
|
102138
102278
|
body: request.stream,
|
|
102139
102279
|
id: (yield* noteIdParam).id,
|
|
102140
102280
|
type
|
|
102141
102281
|
}));
|
|
102142
102282
|
}));
|
|
102143
102283
|
yield* router.add("GET", "/api/images/:id", gen(function* () {
|
|
102144
|
-
const image = yield*
|
|
102284
|
+
const image = yield* (yield* userNotes).image((yield* noteIdParam).id);
|
|
102145
102285
|
return uint8Array(image.bytes, {
|
|
102146
102286
|
contentType: image.type,
|
|
102147
102287
|
headers: { "cache-control": "private, max-age=31536000, immutable" }
|
|
@@ -102153,6 +102293,6 @@ const rpc = pipe(layerHttp({
|
|
|
102153
102293
|
path: "/api/rpc",
|
|
102154
102294
|
protocol: "websocket"
|
|
102155
102295
|
}), provide$1(RpcHandlers), provide$1(layerJson$1));
|
|
102156
|
-
runMain(pipe(serve(pipe(merge$3(rpc, routes), provide$1(Auth.layer)), { disableLogger: true }), provide$1(
|
|
102296
|
+
runMain(pipe(serve(pipe(merge$3(rpc, routes), provide$1(Auth.layer)), { disableLogger: true }), provide$1(UserNotes.layer), provide$1(mergeAll(Sources.layer, Media.layer, Organizer.layer)), provide$1(mergeAll(layer$4, layer$6, layer$11)), provide$1(layer("@deslop/stash")), provide$1(layerNodeHttpServer), launch));
|
|
102157
102297
|
//#endregion
|
|
102158
102298
|
export {};
|