gemi 0.168.0 → 0.170.0
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/app/App.d.ts +3 -3
- package/dist/bin/gemi.js.map +1 -1
- package/dist/{chunk-esjt9q54.js → chunk-36515hn6.js} +1 -1
- package/dist/{chunk-wc2sg9ny.js → chunk-6xve1mg1.js} +1 -1
- package/dist/chunk-g548q257.js.map +1 -1
- package/dist/{chunk-a053eza0.js → chunk-mc7pkdav.js} +2 -2
- package/dist/{chunk-a053eza0.js.map → chunk-mc7pkdav.js.map} +1 -1
- package/dist/chunk-t4hphx4x.js +117 -0
- package/dist/{chunk-bb3fdgwt.js.map → chunk-t4hphx4x.js.map} +7 -7
- package/dist/{chunk-q01p8ta3.js → chunk-x1p2vmj7.js} +1 -1
- package/dist/chunk-ys8nk9ga.js.map +2 -2
- package/dist/facades/index.js +1 -1
- package/dist/http/index.js +1 -1
- package/dist/http/requestDomain.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/forwardedFor.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/router/DomainResolver.d.ts +20 -9
- package/dist/services/router/DomainResolver.d.ts.map +1 -1
- package/dist/services/router/DomainRouter.d.ts +2 -1
- package/dist/services/router/DomainRouter.d.ts.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +2 -0
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/config.d.ts +59 -4
- package/dist/services/router/config.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-bb3fdgwt.js +0 -117
- /package/dist/{chunk-esjt9q54.js.map → chunk-36515hn6.js.map} +0 -0
- /package/dist/{chunk-wc2sg9ny.js.map → chunk-6xve1mg1.js.map} +0 -0
- /package/dist/{chunk-q01p8ta3.js.map → chunk-x1p2vmj7.js.map} +0 -0
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as a,Cf as p,Lg as v,Sf as q,bg as r,cf as c,cg as s,df as e,dg as t,ef as f,eg as u,ff as h,gf as i,hf as j,of as k,pf as l,qf as m,rf as n,sf as o}from"../chunk-
|
|
2
|
+
import{$e as a,Cf as p,Lg as v,Sf as q,bg as r,cf as c,cg as s,df as e,dg as t,ef as f,eg as u,ff as h,gf as i,hf as j,of as k,pf as l,qf as m,rf as n,sf as o}from"../chunk-t4hphx4x.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import{Hi as d,Ji as g,ii as b}from"../chunk-ys8nk9ga.js";import"../chunk-5n21z4n8.js";import"../chunk-1h6g1hkg.js";import"../chunk-s71e6k9m.js";import"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import"../chunk-s4fb4njt.js";import"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import"../chunk-vfvjfw5k.js";import"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import"../chunk-9wcv7e1a.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
|
|
3
3
|
|
|
4
4
|
//# debugId=143EE475EE6DEB0C64756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as ma,Mg as $,Ng as aa,Og as ba,Rg as ca,Sg as da,Tg as ea,Ug as fa,Vg as ga,Wg as ha,Xg as ia,Yg as ja,Ze as I,Zg as ka,_e as J,_g as la,af as K,ah as na,bf as L,bh as oa,ch as pa,dh as qa,eh as ra,fh as sa,gh as ta,ie as q,je as r,ke as s,le as t,me as u,mg as _,ne as v,oe as w,pe as D,ue as E,xe as F,ye as G,ze as H}from"../chunk-
|
|
2
|
+
import{$g as ma,Mg as $,Ng as aa,Og as ba,Rg as ca,Sg as da,Tg as ea,Ug as fa,Vg as ga,Wg as ha,Xg as ia,Yg as ja,Ze as I,Zg as ka,_e as J,_g as la,af as K,ah as na,bf as L,bh as oa,ch as pa,dh as qa,eh as ra,fh as sa,gh as ta,ie as q,je as r,ke as s,le as t,me as u,mg as _,ne as v,oe as w,pe as D,ue as E,xe as F,ye as G,ze as H}from"../chunk-t4hphx4x.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import{Ai as V,Bi as W,Ci as X,Di as Y,Ei as Z,Gh as a,Hh as b,Ih as d,Nh as e,Oh as f,Ph as g,Qh as h,Rh as i,Sh as j,Xh as n,Yh as o,bi as p,ci as x,di as y,ei as z,fi as A,gi as B,hi as C,ri as M,si as N,ti as O,ui as P,vi as Q,wi as R,xi as S,yi as T,zi as U}from"../chunk-ys8nk9ga.js";import{Ri as c}from"../chunk-5n21z4n8.js";import{Wi as k,Xi as l,Yi as m}from"../chunk-1h6g1hkg.js";import"../chunk-s71e6k9m.js";import"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import"../chunk-s4fb4njt.js";import"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import"../chunk-vfvjfw5k.js";import"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import"../chunk-9wcv7e1a.js";export{g as toRangeHeaderValue,s as toMiddlewareList,k as stateKey,Z as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,w as parseByteSize,ha as middlewareConfigDefaults,r as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,pa as defineResourcePolicy,ga as defineMiddlewareConfig,t as createUnsatisfiableResponse,u as createStreamResponse,K as createFileResponse,H as clientIp,X as classifyAddress,ba as authorizeChannel,L as ViewRouter,n as ValidationError,U as TooManyRedirectsError,S as TooLargeError,R as TimeoutError,qa as SitemapError,ra as Sitemap,J as SameSiteBounceMiddleware,Y as SafeResponse,M as SafeFetchError,I as SAME_SITE_BOUNCE_PARAM,sa as RobotsTxt,ta as Robots,oa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,G as RateLimitMiddleware,E as RateLimitExceededError,z as RangeNotSatisfiableError,ma as PoliciesServiceProvider,na as Policies,v as PayloadTooLargeError,A as NotFoundError,V as NetworkError,l as MissingRequestStateError,F as Middleware,ea as McpToolDeclaration,fa as McpRouter,da as McpRouteDeclaration,ca as McpModelParam,o as InvalidValidationRuleError,N as InvalidUrlError,y as InsufficientPermissionsError,W as HttpStatusError,q as HttpResponse,p as HttpRequest,B as FileNotFoundError,Q as DnsError,ka as CorsMiddleware,a as Controller,T as ContentTypeError,aa as ChannelRouter,$ as ChannelDeclaration,ja as CacheMiddleware,la as CSRFMiddleware,_ as BodyLimitMiddleware,O as BlockedHostError,P as BlockedAddressError,x as AuthorizationError,ia as AuthenticationMiddleware,C as AuthenticationError,D as ApiRouter};
|
|
3
3
|
|
|
4
4
|
//# debugId=59038848F682F91164756E2164756E21
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestDomain.d.ts","sourceRoot":"","sources":["../../http/requestDomain.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAOxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,QAEpE;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAEjE;
|
|
1
|
+
{"version":3,"file":"requestDomain.d.ts","sourceRoot":"","sources":["../../http/requestDomain.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAOxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,QAEpE;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAEjE;AAOD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAKhE;AAED,2FAA2F;AAC3F,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAEpE"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{da as T}from"../chunk-31np60bx.js";import"../chunk-mvd4mc8p.js";import{bb as D}from"../chunk-f4nanvkm.js";import{fe as b,ge as w}from"../chunk-g1jfc50d.js";import"../chunk-zqptpk90.js";import{cf as j}from"../chunk-
|
|
2
|
+
import{da as T}from"../chunk-31np60bx.js";import"../chunk-mvd4mc8p.js";import{bb as D}from"../chunk-f4nanvkm.js";import{fe as b,ge as w}from"../chunk-g1jfc50d.js";import"../chunk-zqptpk90.js";import{cf as j}from"../chunk-t4hphx4x.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import"../chunk-ys8nk9ga.js";import"../chunk-5n21z4n8.js";import"../chunk-1h6g1hkg.js";import"../chunk-s71e6k9m.js";import"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import"../chunk-s4fb4njt.js";import"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import{$k as R,Xk as V,Yk as X,Zk as E,_k as L,al as S}from"../chunk-vfvjfw5k.js";import"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import"../chunk-9wcv7e1a.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
|
|
3
3
|
|
|
4
4
|
//# debugId=4B68529B8515413E64756E2164756E21
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fa as E}from"../chunk-df2zeevj.js";import{ab as p}from"../chunk-mm45shzv.js";import{bb as H}from"../chunk-f4nanvkm.js";import{Cb as L,Db as Q,Eb as T,Ib as U,Jb as y,Kb as F,Lb as C,Ob as D,Pb as I,Sb as b,Vb as f,Wb as k,Xb as m,ob as g,pb as W,qb as _,rb as l,sb as P,tb as u,ub as $,vb as V,wb as q,xb as B,yb as K}from"../chunk-
|
|
2
|
+
import{Fa as E}from"../chunk-df2zeevj.js";import{ab as p}from"../chunk-mm45shzv.js";import{bb as H}from"../chunk-f4nanvkm.js";import{Cb as L,Db as Q,Eb as T,Ib as U,Jb as y,Kb as F,Lb as C,Ob as D,Pb as I,Sb as b,Vb as f,Wb as k,Xb as m,ob as g,pb as W,qb as _,rb as l,sb as P,tb as u,ub as $,vb as V,wb as q,xb as B,yb as K}from"../chunk-x1p2vmj7.js";import"../chunk-2xtkh8bh.js";import"../chunk-z5g56ds0.js";import"../chunk-9aj6eavs.js";import{$d as h}from"../chunk-gjwf07hy.js";import"../chunk-g1jfc50d.js";import"../chunk-zqptpk90.js";import{Bg as w,Ee as a,Fe as d,Fg as A,Jg as R,Xe as n,Ye as v}from"../chunk-t4hphx4x.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import"../chunk-ys8nk9ga.js";import"../chunk-5n21z4n8.js";import"../chunk-1h6g1hkg.js";import"../chunk-s71e6k9m.js";import{kj as M}from"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import"../chunk-s4fb4njt.js";import"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import"../chunk-17272ccy.js";import"../chunk-vfvjfw5k.js";import{bl as O,dl as z}from"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import"../chunk-9wcv7e1a.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new z;boot(){if(this.models.length>0)p(...this.models);else s();this.app.config.merge(this.config),z.setInstance(this.app),this.app.registerMany([...N,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let G of this.services){let J=typeof G==="function"?new G:G,x=J.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(Z,J),this.serviceInstances.push(J),this.serviceTokens.add(x.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),l(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),z.getInstance()===this.app)z.setInstance(void 0);O.disable()}}function s(){if(Bun.env.NODE_ENV==="production")return;let j=M();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
|
@@ -22,9 +22,9 @@ export declare function applyForwardedTrust(headers: Headers, peer: string | nul
|
|
|
22
22
|
/**
|
|
23
23
|
* A header a proxy in front writes the client's address into, believed only on
|
|
24
24
|
* a request that carries a secret only that proxy sends. Set with
|
|
25
|
-
* `GEMI_CLIENT_IP_HEADER`, `GEMI_PROXY_SECRET_HEADER` and `GEMI_PROXY_SECRET
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* `GEMI_CLIENT_IP_HEADER`, `GEMI_PROXY_SECRET_HEADER` and `GEMI_PROXY_SECRET`.
|
|
26
|
+
* With `route.domains`, its `trustProxy` entries are tried first and this is
|
|
27
|
+
* the fallback for a request none of them claims. Behind Azure Front Door:
|
|
28
28
|
* `X-Azure-ClientIP`, proven by `X-Azure-FDID` carrying the profile's ID.
|
|
29
29
|
*/
|
|
30
30
|
export interface ClientIpHeaderTrust {
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Da as f}from"../chunk-s0z61m9j.js";import{Ea as S}from"../chunk-g548q257.js";import{nl as Q,pl as Z,ql as P,rl as y,sl as U,tl as A}from"../chunk-9akefv1y.js";import{xl as H}from"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import{Fl as F}from"../chunk-9wcv7e1a.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new S({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=U(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)A(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-
|
|
2
|
+
import{Da as f}from"../chunk-s0z61m9j.js";import{Ea as S}from"../chunk-g548q257.js";import{nl as Q,pl as Z,ql as P,rl as y,sl as U,tl as A}from"../chunk-9akefv1y.js";import{xl as H}from"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import{Fl as F}from"../chunk-9wcv7e1a.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new S({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=U(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)A(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-6xve1mg1.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-36515hn6.js"),K=new Y(this.app);this.server=await J(this.app,K.track(I)),N(K)}return this.server}stop(z={}){let B=this.app.sockets();return this.stopping??=P({server:this.server,closeSockets:B?()=>B.shutdown():void 0,shutdownProviders:(I)=>this.app.shutdown(I),settings:{...this.settings??Z(),...z}}),this.stopping}}export{W as liveness,Q as isShuttingDown,k as Server};
|
|
3
3
|
|
|
4
4
|
//# debugId=6D095711CA3C387264756E2164756E21
|
package/dist/services/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{db as E8}from"../chunk-8m9kgynj.js";import{Ab as H8,Bb as U8,Cb as O8,Db as S8,Eb as R8,Fb as T4,Gb as X6,Hb as C,Ib as _8,Jb as f8,Kb as C8,Lb as k8,Mb as b8,Nb as T8,Ob as P8,Pb as V8,Qb as I8,Rb as v8,Sb as q8,Tb as w8,Ub as y8,Vb as A8,Wb as h8,Xb as g8,eb as gZ,fb as EZ,gb as mZ,hb as cZ,ib as uZ,jb as f4,kb as pZ,lb as O4,mb as S4,nb as q1,ob as dZ,pb as lZ,qb as X8,ub as B8,vb as j8,wb as M8,xb as L8,yb as F8,zb as D8}from"../chunk-q01p8ta3.js";import{_b as k4}from"../chunk-2xtkh8bh.js";import{Ad as rZ,Bd as eZ,Cd as W8,Dd as Z8,Ed as $8,Fd as J8,Gd as Q8,Hd as Y8,Id as K8,Jd as G8,Kd as z8,vd as nZ,wd as iZ,xd as sZ,yd as oZ,zd as aZ}from"../chunk-z5g56ds0.js";import{Ld as tZ}from"../chunk-9aj6eavs.js";import{$d as AZ,Md as SZ,Nd as RZ,Od as _Z,Pd as fZ,Qd as CZ,Rd as kZ,Sd as bZ,Td as TZ,Ud as PZ,Vd as VZ,Wd as IZ,Xd as vZ,Yd as qZ,Zd as wZ,_d as yZ,ee as hZ}from"../chunk-gjwf07hy.js";import{fe as N8,ge as x8}from"../chunk-g1jfc50d.js";import"../chunk-zqptpk90.js";import{$f as t5,Ae as B4,Af as I5,Be as c0,Bf as v5,Bg as MZ,Ce as j4,De as M4,Df as q5,Ef as z6,Ff as w5,Fg as LZ,He as mW,Ie as cW,Je as uW,Jf as y5,Ke as pW,Kf as A5,Kg as w1,Le as dW,Lf as g5,Me as lW,Ne as nW,Oe as iW,Of as E5,Pe as sW,Pf as m5,Qe as w0,Qf as c5,Re as oW,Rf as u5,Se as aW,Te as tW,Tf as p5,Ue as rW,Uf as d5,Ve as eW,Vf as l5,Vg as NZ,Wf as n5,Wg as xZ,Xf as i5,Yf as s5,Zf as o5,_f as a5,ag as r5,fg as k,gg as i,hg as e5,if as G5,ig as WZ,jf as z5,jg as ZZ,kf as X5,kg as $Z,lf as B5,lg as JZ,mf as j5,nf as M5,ng as QZ,og as YZ,pg as KZ,qe as Z6,qg as GZ,re as AW,rg as zZ,se as hW,te as gW,tf as f5,uf as C5,ug as XZ,ve as EW,vf as k5,vg as BZ,wf as b5,wg as jZ,xf as T5,yf as P5,ze as $6,zf as V5}from"../chunk-bb3fdgwt.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import{Fi as Q5,Gi as Y5,Ii as K5,Ki as P1,Oh as X4,Ph as K4,Qh as M1,bi as U4,ei as t,gi as d,ki as G4,li as L1,mi as T1,ni as W5,oi as Z5,pi as $5,qi as J5}from"../chunk-ys8nk9ga.js";import"../chunk-5n21z4n8.js";import{Ui as r}from"../chunk-1h6g1hkg.js";import{aj as U5,bj as O5,cj as b1,dj as S5,ej as v0,fj as R5,gj as _5}from"../chunk-s71e6k9m.js";import{mj as F5,nj as D5,oj as H5}from"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import{Xj as h5}from"../chunk-s4fb4njt.js";import{$j as x5,Zj as L5,_j as N5}from"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import{Rk as FZ,Sk as DZ,Tk as HZ,Uk as UZ,Wk as OZ}from"../chunk-17272ccy.js";import"../chunk-vfvjfw5k.js";import{el as w}from"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import{Fl as A0}from"../chunk-9wcv7e1a.js";import{Buffer as y0}from"buffer";class h0 extends L1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-sdn3dmpp.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof y0?$:$ instanceof Blob||$ instanceof File?y0.from(await $.arrayBuffer()):"",{sdk:G,client:X}=await this.connect();return Z?.throwIfAborted(),await X.send(new G.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((G)=>({name:G.Key,size:G.Size??0,lastModified:G.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){G4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let X=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((z)=>({Key:z.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(X.length>0){let z=X[0];throw Error(`S3 could not delete ${X.length} object(s) under "${W}", e.g. "${z.Key}": ${z.Code??"unknown"} ${z.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),G=T1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(G,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),G;try{G=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?K4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new t(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new d(J);throw j}let X=M1(G.ContentRange),z=Boolean(X)&&G.$metadata?.httpStatusCode===206,B=X?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:X?.start??0,end:X?.end??B-1,total:B,partial:z,type:G.ContentType??"application/octet-stream",etag:G.ETag||void 0,lastModified:G.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new d(Z);throw Y}}}import{Buffer as g0}from"buffer";import{Readable as s6}from"stream";function z4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function o6(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class E0 extends L1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof g0?$:g0.from(await $.arrayBuffer()),G=await this.blob(Q,Y);return Z?.throwIfAborted(),await G.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,G,X=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&X){let H=await this.size({name:$,bucket:J}),p=X4(Q,H);if(!p)throw new t(H);K=p.start,G=p.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let z;try{z=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(H){if(o6(H))throw new t(await this.size({name:$,bucket:J}));if(z4(H))throw new d($);throw H}let B=M1(z.contentRange),j=Boolean(B),x=B?.total??z.contentLength??0,O=await a6(z);if(O instanceof ReadableStream)O=T1(O,Z);return Z?.throwIfAborted(),{body:O,start:B?.start??0,end:B?.end??x-1,total:x,partial:j,type:z.contentType??"application/octet-stream",etag:z.etag||void 0,lastModified:z.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(z4(Q))throw new d(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(z4(Q))return;throw Q}}}async function a6(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return s6.toWeb(W.readableStreamBody);return null}function t6(W){return W}class L4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class V1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var m0=1000,r6=60000,e6=`
|
|
2
|
+
import{db as E8}from"../chunk-8m9kgynj.js";import{Ab as H8,Bb as U8,Cb as O8,Db as S8,Eb as R8,Fb as T4,Gb as X6,Hb as C,Ib as _8,Jb as f8,Kb as C8,Lb as k8,Mb as b8,Nb as T8,Ob as P8,Pb as V8,Qb as I8,Rb as v8,Sb as q8,Tb as w8,Ub as y8,Vb as A8,Wb as h8,Xb as g8,eb as gZ,fb as EZ,gb as mZ,hb as cZ,ib as uZ,jb as f4,kb as pZ,lb as O4,mb as S4,nb as q1,ob as dZ,pb as lZ,qb as X8,ub as B8,vb as j8,wb as M8,xb as L8,yb as F8,zb as D8}from"../chunk-x1p2vmj7.js";import{_b as k4}from"../chunk-2xtkh8bh.js";import{Ad as rZ,Bd as eZ,Cd as W8,Dd as Z8,Ed as $8,Fd as J8,Gd as Q8,Hd as Y8,Id as K8,Jd as G8,Kd as z8,vd as nZ,wd as iZ,xd as sZ,yd as oZ,zd as aZ}from"../chunk-z5g56ds0.js";import{Ld as tZ}from"../chunk-9aj6eavs.js";import{$d as AZ,Md as SZ,Nd as RZ,Od as _Z,Pd as fZ,Qd as CZ,Rd as kZ,Sd as bZ,Td as TZ,Ud as PZ,Vd as VZ,Wd as IZ,Xd as vZ,Yd as qZ,Zd as wZ,_d as yZ,ee as hZ}from"../chunk-gjwf07hy.js";import{fe as N8,ge as x8}from"../chunk-g1jfc50d.js";import"../chunk-zqptpk90.js";import{$f as t5,Ae as B4,Af as I5,Be as c0,Bf as v5,Bg as MZ,Ce as j4,De as M4,Df as q5,Ef as z6,Ff as w5,Fg as LZ,He as mW,Ie as cW,Je as uW,Jf as y5,Ke as pW,Kf as A5,Kg as w1,Le as dW,Lf as g5,Me as lW,Ne as nW,Oe as iW,Of as E5,Pe as sW,Pf as m5,Qe as w0,Qf as c5,Re as oW,Rf as u5,Se as aW,Te as tW,Tf as p5,Ue as rW,Uf as d5,Ve as eW,Vf as l5,Vg as NZ,Wf as n5,Wg as xZ,Xf as i5,Yf as s5,Zf as o5,_f as a5,ag as r5,fg as k,gg as i,hg as e5,if as G5,ig as WZ,jf as z5,jg as ZZ,kf as X5,kg as $Z,lf as B5,lg as JZ,mf as j5,nf as M5,ng as QZ,og as YZ,pg as KZ,qe as Z6,qg as GZ,re as AW,rg as zZ,se as hW,te as gW,tf as f5,uf as C5,ug as XZ,ve as EW,vf as k5,vg as BZ,wf as b5,wg as jZ,xf as T5,yf as P5,ze as $6,zf as V5}from"../chunk-t4hphx4x.js";import"../chunk-vnk4vaer.js";import"../chunk-xkas0yp8.js";import{Fi as Q5,Gi as Y5,Ii as K5,Ki as P1,Oh as X4,Ph as K4,Qh as M1,bi as U4,ei as t,gi as d,ki as G4,li as L1,mi as T1,ni as W5,oi as Z5,pi as $5,qi as J5}from"../chunk-ys8nk9ga.js";import"../chunk-5n21z4n8.js";import{Ui as r}from"../chunk-1h6g1hkg.js";import{aj as U5,bj as O5,cj as b1,dj as S5,ej as v0,fj as R5,gj as _5}from"../chunk-s71e6k9m.js";import{mj as F5,nj as D5,oj as H5}from"../chunk-fb77hwk0.js";import"../chunk-jxx9mctk.js";import{Xj as h5}from"../chunk-s4fb4njt.js";import{$j as x5,Zj as L5,_j as N5}from"../chunk-6t1t7h05.js";import"../chunk-a9frf7ym.js";import"../chunk-gwphn604.js";import"../chunk-m950vw4c.js";import"../chunk-978pc27j.js";import{Rk as FZ,Sk as DZ,Tk as HZ,Uk as UZ,Wk as OZ}from"../chunk-17272ccy.js";import"../chunk-vfvjfw5k.js";import{el as w}from"../chunk-8b9ks729.js";import"../chunk-0q65jzhv.js";import"../chunk-sp77zwpn.js";import"../chunk-9akefv1y.js";import"../chunk-rpdekb8t.js";import"../chunk-jd079awh.js";import{Fl as A0}from"../chunk-9wcv7e1a.js";import{Buffer as y0}from"buffer";class h0 extends L1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-sdn3dmpp.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof y0?$:$ instanceof Blob||$ instanceof File?y0.from(await $.arrayBuffer()):"",{sdk:G,client:X}=await this.connect();return Z?.throwIfAborted(),await X.send(new G.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((G)=>({name:G.Key,size:G.Size??0,lastModified:G.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){G4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let X=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((z)=>({Key:z.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(X.length>0){let z=X[0];throw Error(`S3 could not delete ${X.length} object(s) under "${W}", e.g. "${z.Key}": ${z.Code??"unknown"} ${z.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),G=T1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(G,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),G;try{G=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?K4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new t(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new d(J);throw j}let X=M1(G.ContentRange),z=Boolean(X)&&G.$metadata?.httpStatusCode===206,B=X?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:X?.start??0,end:X?.end??B-1,total:B,partial:z,type:G.ContentType??"application/octet-stream",etag:G.ETag||void 0,lastModified:G.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new d(Z);throw Y}}}import{Buffer as g0}from"buffer";import{Readable as s6}from"stream";function z4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function o6(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class E0 extends L1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof g0?$:g0.from(await $.arrayBuffer()),G=await this.blob(Q,Y);return Z?.throwIfAborted(),await G.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,G,X=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&X){let H=await this.size({name:$,bucket:J}),p=X4(Q,H);if(!p)throw new t(H);K=p.start,G=p.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let z;try{z=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(H){if(o6(H))throw new t(await this.size({name:$,bucket:J}));if(z4(H))throw new d($);throw H}let B=M1(z.contentRange),j=Boolean(B),x=B?.total??z.contentLength??0,O=await a6(z);if(O instanceof ReadableStream)O=T1(O,Z);return Z?.throwIfAborted(),{body:O,start:B?.start??0,end:B?.end??x-1,total:x,partial:j,type:z.contentType??"application/octet-stream",etag:z.etag||void 0,lastModified:z.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(z4(Q))throw new d(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(z4(Q))return;throw Q}}}async function a6(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return s6.toWeb(W.readableStreamBody);return null}function t6(W){return W}class L4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class V1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var m0=1000,r6=60000,e6=`
|
|
3
3
|
local currentKey = KEYS[1]
|
|
4
4
|
local previousKey = KEYS[2]
|
|
5
5
|
local limit = tonumber(ARGV[1])
|
|
@@ -36,7 +36,7 @@ export declare function assertValidDomainsConfig(config: DomainsConfig): void;
|
|
|
36
36
|
*/
|
|
37
37
|
export declare class DomainResolver {
|
|
38
38
|
readonly root: string;
|
|
39
|
-
private readonly
|
|
39
|
+
private readonly hostTrusts;
|
|
40
40
|
private readonly fixed;
|
|
41
41
|
private readonly param;
|
|
42
42
|
private readonly custom;
|
|
@@ -46,13 +46,23 @@ export declare class DomainResolver {
|
|
|
46
46
|
private readonly inFlight;
|
|
47
47
|
/** The `ask` secret, or `null` when the endpoint is not served. */
|
|
48
48
|
readonly askSecret: string | null;
|
|
49
|
-
/** The
|
|
50
|
-
readonly
|
|
49
|
+
/** The headers every `trustProxy` secret arrives in, lowercased; `[]` when there is none. */
|
|
50
|
+
readonly proxySecretHeaders: readonly string[];
|
|
51
51
|
constructor(config: DomainsConfig);
|
|
52
|
+
/**
|
|
53
|
+
* The proxy that sent `req`: the first `trustProxy` entry whose secret is
|
|
54
|
+
* present and matches (an entry without a secret — only possible in the
|
|
55
|
+
* single-object form — always does), or `null` when none does.
|
|
56
|
+
*
|
|
57
|
+
* Every entry's secret is compared, in constant time each, even after one
|
|
58
|
+
* matched, so how long this takes does not say which proxy, if any, a
|
|
59
|
+
* request passed for.
|
|
60
|
+
*/
|
|
61
|
+
private trustOf;
|
|
52
62
|
/**
|
|
53
63
|
* The host the trusted proxy says the client addressed — the first entry of
|
|
54
|
-
*
|
|
55
|
-
*
|
|
64
|
+
* its host header, as sent — or `null` when no proxy's secret matches, the
|
|
65
|
+
* one that does has no host header, or it sent no host.
|
|
56
66
|
*
|
|
57
67
|
* A request without the secret is not refused, just routed by its own host:
|
|
58
68
|
* that is a host the client could have sent anyway, so it gains nothing, and
|
|
@@ -60,10 +70,11 @@ export declare class DomainResolver {
|
|
|
60
70
|
*/
|
|
61
71
|
private forwardedHost;
|
|
62
72
|
/**
|
|
63
|
-
* The client address `
|
|
64
|
-
* without a port —
|
|
65
|
-
*
|
|
66
|
-
*
|
|
73
|
+
* The client address the trusted proxy's `clientIpHeader` names — its first
|
|
74
|
+
* entry, without a port — or `null` when no proxy's secret matches, the one
|
|
75
|
+
* that does has no `clientIpHeader`, or the header is absent or not an
|
|
76
|
+
* IPv4/IPv6 address. Only the proxy whose secret matched is read: a later
|
|
77
|
+
* entry is not a fallback for an earlier one.
|
|
67
78
|
*/
|
|
68
79
|
trustedClientIp(req: Request): string | null;
|
|
69
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainResolver.d.ts","sourceRoot":"","sources":["../../../services/router/DomainResolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DomainResolver.d.ts","sourceRoot":"","sources":["../../../services/router/DomainResolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,UAAU,CAAC;AAElB,qDAAqD;AACrD,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,0CAA0C;AAC1C,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;CACjB;AAcD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAO7E;AA+ID,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS5E;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AO,CAAC,WAAW;YAIL,KAAK;YA0BL,aAAa;IAuC3B,wEAAwE;IACxE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;CAUrB"}
|
|
@@ -43,7 +43,8 @@ export declare class DomainRouter {
|
|
|
43
43
|
/**
|
|
44
44
|
* Makes the address a proven proxy names the one the rest of gemi reads: the
|
|
45
45
|
* only entry of `X-Forwarded-For`, with `X-Real-IP` dropped. The proxy is
|
|
46
|
-
* `route.domains.trustProxy`
|
|
46
|
+
* the first `route.domains.trustProxy` entry whose secret matches (and that
|
|
47
|
+
* names the client in its `clientIpHeader`) or, failing that,
|
|
47
48
|
* `GEMI_CLIENT_IP_HEADER` + `GEMI_PROXY_SECRET_HEADER`/`GEMI_PROXY_SECRET`.
|
|
48
49
|
* A request without the secret keeps the address `GEMI_TRUST_PROXY` settled
|
|
49
50
|
* on. Idempotent. Lives here so the secret is withheld from `proxy()` routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainRouter.d.ts","sourceRoot":"","sources":["../../../services/router/DomainRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,cAAc,EAId,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAsB,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEnG,OAAO,EAAE,KAAK,mBAAmB,EAAyB,MAAM,2BAA2B,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,kBAAkB,CAAC;IACxB,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;;;GAKG;AACH,qBAAa,Y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EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,wFAAwF;IACxF,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAG7D,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE;QACN,GAAG,EAAE,cAAc,CAAC;QACpB,IAAI,EAAE,eAAe,CAAC;QACtB,uFAAuF;QACvF,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;KAC5C;IAwBH;;;;;;;;;OASG;IACH,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAejC;;;;;;OAMG;IACG,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAmB5D;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAgBjD,kEAAkE;IAClE,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,iBAAiB;IAI7D,mGAAmG;IACnG,eAAe,IAAI,mBAAmB,EAAE;IAIxC;;;;;OAKG;IACH,UAAU,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,mBAAmB,CAAA;KAAE,CAAC;CAUlE"}
|
|
@@ -74,6 +74,8 @@ export declare class ViewRouteDispatcher {
|
|
|
74
74
|
readonly theme: ThemeConfig | false;
|
|
75
75
|
/** See `ViewRouteConfig.meta`. */
|
|
76
76
|
readonly defaultMeta: ViewRouteConfig["meta"];
|
|
77
|
+
/** See `ViewRouteConfig.notFound`. */
|
|
78
|
+
readonly notFound: ViewRouteConfig["notFound"];
|
|
77
79
|
/**
|
|
78
80
|
* `auth` is the app's `auth` config: gemi's `/auth` view routes are mounted
|
|
79
81
|
* for the features it turns on (#1040).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewRouteDispatcher.d.ts","sourceRoot":"","sources":["../../../services/router/ViewRouteDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAmC,MAAM,2BAA2B,CAAC;AAEjG,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAWlB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiBpD,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AA4G1B;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,QAY9D;AAaD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAQ1D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAM7D;AAED,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,KAAK,SAAiB;IAE7B,cAAc,EAAE,cAAc,CAAM;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAM;IAC7C,0FAA0F;IAC1F,mBAAmB,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,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACpD;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACjD;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,wEAAwE;QACxE,aAAa,CAAC,EAAE,cAAc,CAAC;QAC/B;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CAyiCJ"}
|
|
@@ -6,7 +6,7 @@ import type { ChannelRouterClass } from "../../http/ChannelRouter";
|
|
|
6
6
|
import type { McpRouter } from "../../http/McpRouter";
|
|
7
7
|
import type { McpRemoteFileOptions } from "../mcp/McpRegistry";
|
|
8
8
|
import type { McpRemoteHttpConfig } from "../mcp/http/McpHttpServer";
|
|
9
|
-
import type { ViewRouter } from "../../http/ViewRouter";
|
|
9
|
+
import type { StaticViewOptions, ViewRouter } from "../../http/ViewRouter";
|
|
10
10
|
import type { StreamSummary } from "./ServerQueryStore";
|
|
11
11
|
export interface ApiRouteConfig {
|
|
12
12
|
rootRouter: typeof ApiRouter;
|
|
@@ -81,10 +81,36 @@ export interface ViewRouteConfig {
|
|
|
81
81
|
* and for a client navigation, so this is where the `404` page gets its
|
|
82
82
|
* title and other metadata (`Meta.title(...)`), which otherwise stay
|
|
83
83
|
* gemi's defaults. A `route.domains` group's `view` can set its own.
|
|
84
|
+
*
|
|
85
|
+
* With `notFound` set, what it returns is the props of `notFound.view` on
|
|
86
|
+
* the document (e.g. the tenant's name and logo for a branded page). It is
|
|
87
|
+
* not used otherwise: the app's hydrated `404` view takes no props.
|
|
84
88
|
*/
|
|
85
89
|
onNotFound?: (req: HttpRequest, info: {
|
|
86
90
|
status: number;
|
|
87
|
-
}) => void | Promise<void
|
|
91
|
+
}) => void | Record<string, unknown> | Promise<void | Record<string, unknown>>;
|
|
92
|
+
/**
|
|
93
|
+
* These views' own not-found page, served as a static document (#828),
|
|
94
|
+
* instead of the app's hydrated `404` view. Meant for a `route.domains`
|
|
95
|
+
* group whose pages are `.static()` with their own `layout`: a missing
|
|
96
|
+
* page answers in the same spirit, with no app bundle.
|
|
97
|
+
*
|
|
98
|
+
* It answers every document request that would render the `404` view: a
|
|
99
|
+
* path no route matches, a handler or middleware that throws
|
|
100
|
+
* `NotFoundError`, `FileNotFoundError` or `RecordNotFoundError`, a refusal
|
|
101
|
+
* (403, under its own status) and a feature gate. The view's props are what
|
|
102
|
+
* `onNotFound` returns.
|
|
103
|
+
*
|
|
104
|
+
* `static` takes the options of `.static()`; `layout` is the document
|
|
105
|
+
* layout, and `cacheControl` applies to an unmatched path only (a refusal
|
|
106
|
+
* or a missing record is sent `no-store`, a gated route none). A
|
|
107
|
+
* client-side navigation from a hydrated page still lands on the app's
|
|
108
|
+
* `404` view: the client router has only that one.
|
|
109
|
+
*/
|
|
110
|
+
notFound?: {
|
|
111
|
+
view: string;
|
|
112
|
+
static: StaticViewOptions;
|
|
113
|
+
};
|
|
88
114
|
/**
|
|
89
115
|
* The app-wide default title, description and Open Graph tags (#1042), for
|
|
90
116
|
* a view whose handlers set none: a view with no handler, one whose handler
|
|
@@ -224,6 +250,30 @@ export interface TrustProxyConfig {
|
|
|
224
250
|
value: string;
|
|
225
251
|
};
|
|
226
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* One entry of `route.domains.trustProxy` in its list form: a proxy that
|
|
255
|
+
* proves itself with a secret of its own. Unlike the single-object form,
|
|
256
|
+
* `secret` is required, and `hostHeader` has no default — an entry without
|
|
257
|
+
* one only names the client's address and never moves the host.
|
|
258
|
+
*/
|
|
259
|
+
export interface TrustedProxyConfig {
|
|
260
|
+
/**
|
|
261
|
+
* The header this proxy writes the client's host into. Left out, a request
|
|
262
|
+
* this entry claims is routed by its own `Host`.
|
|
263
|
+
*/
|
|
264
|
+
hostHeader?: string;
|
|
265
|
+
/** The header this proxy writes the client's IP address into. See {@link TrustProxyConfig.clientIpHeader}. */
|
|
266
|
+
clientIpHeader?: string;
|
|
267
|
+
/**
|
|
268
|
+
* What proves this proxy sent the request: a header and the value it must
|
|
269
|
+
* carry, at least 16 characters, compared in constant time and withheld
|
|
270
|
+
* from `proxy()` upstreams. Each entry needs a secret value of its own.
|
|
271
|
+
*/
|
|
272
|
+
secret: {
|
|
273
|
+
header: string;
|
|
274
|
+
value: string;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
227
277
|
export interface DomainsConfig {
|
|
228
278
|
/**
|
|
229
279
|
* The apex the subdomains hang off, e.g. `"example.com"` — `"localhost"` in
|
|
@@ -240,9 +290,14 @@ export interface DomainsConfig {
|
|
|
240
290
|
* trusting it depend on a shared secret the proxy sends, and can name a
|
|
241
291
|
* header that carries the client's IP address — see {@link TrustProxyConfig}.
|
|
242
292
|
*
|
|
293
|
+
* A list trusts several proxies, each proven by its own secret: on each
|
|
294
|
+
* request the first entry whose secret header is present and matches
|
|
295
|
+
* decides both the host and the client's address, and the others are not
|
|
296
|
+
* consulted. See {@link TrustedProxyConfig}.
|
|
297
|
+
*
|
|
243
298
|
* The scheme is read from `X-Forwarded-Proto` whether or not this is set.
|
|
244
299
|
*/
|
|
245
|
-
trustProxy?: boolean | TrustProxyConfig;
|
|
300
|
+
trustProxy?: boolean | TrustProxyConfig | TrustedProxyConfig[];
|
|
246
301
|
groups?: DomainGroupConfig[];
|
|
247
302
|
custom?: CustomDomainConfig;
|
|
248
303
|
/**
|
|
@@ -277,5 +332,5 @@ export interface RouteConfig {
|
|
|
277
332
|
}
|
|
278
333
|
export declare function defineRouteConfig(config: RouteConfig): RouteConfig;
|
|
279
334
|
export declare function apiRouteConfigDefaults(): Omit<Required<ApiRouteConfig>, "rootRouter">;
|
|
280
|
-
export declare function viewRouteConfigDefaults(): Omit<Required<ViewRouteConfig>, "root" | "rootRouter" | "meta">;
|
|
335
|
+
export declare function viewRouteConfigDefaults(): Omit<Required<ViewRouteConfig>, "root" | "rootRouter" | "meta" | "notFound">;
|
|
281
336
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../services/router/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../services/router/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,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