gemi 0.208.0 → 0.210.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/{chunk-f0sfh1r2.js → chunk-8b2421h0.js} +2 -2
- package/dist/{chunk-f0sfh1r2.js.map → chunk-8b2421h0.js.map} +1 -1
- package/dist/{chunk-rffpqhn8.js → chunk-9zatr0vt.js} +1 -1
- package/dist/chunk-m60st4nt.js +24 -0
- package/dist/{chunk-ykh78bct.js.map → chunk-m60st4nt.js.map} +6 -5
- package/dist/{chunk-ag5nhjcr.js → chunk-p507sdj8.js} +1 -1
- package/dist/{chunk-24z18t5q.js → chunk-w8cbs1kg.js} +26 -26
- package/dist/{chunk-24z18t5q.js.map → chunk-w8cbs1kg.js.map} +6 -5
- package/dist/chunks/{RealtimeClient-DIxu38Vp.js → RealtimeClient-CuTFz0v1.js} +2 -2
- package/dist/chunks/{RealtimeClient-DIxu38Vp.js.map → RealtimeClient-CuTFz0v1.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-DwBG9z7t.js → ThemeProvider-BO3sQkWl.js} +212 -11
- package/dist/chunks/ThemeProvider-BO3sQkWl.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-DbtCribY.js → fetchFileRequest-CrKd0rD5.js} +2 -2
- package/dist/chunks/{fetchFileRequest-DbtCribY.js.map → fetchFileRequest-CrKd0rD5.js.map} +1 -1
- package/dist/chunks/{live-Dw8WcP_Q.js → live-BCCfTb28.js} +3 -3
- package/dist/chunks/{live-Dw8WcP_Q.js.map → live-BCCfTb28.js.map} +1 -1
- package/dist/chunks/{mutationExtras-BHBySXVs.js → mutationExtras-cPXZS6Hf.js} +2 -2
- package/dist/chunks/{mutationExtras-BHBySXVs.js.map → mutationExtras-cPXZS6Hf.js.map} +1 -1
- package/dist/chunks/{subscriptionStream-CdYxY-Q6.js → subscriptionStream-CRrAISl8.js} +2 -2
- package/dist/chunks/{subscriptionStream-CdYxY-Q6.js.map → subscriptionStream-CRrAISl8.js.map} +1 -1
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/Mutation.d.ts +7 -0
- package/dist/client/Mutation.d.ts.map +1 -1
- package/dist/client/QueryManagerContext.d.ts +12 -0
- package/dist/client/QueryManagerContext.d.ts.map +1 -1
- package/dist/client/QueryResource.d.ts +54 -0
- package/dist/client/QueryResource.d.ts.map +1 -1
- package/dist/client/chunkLoadRecovery.d.ts +24 -1
- package/dist/client/chunkLoadRecovery.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +86 -16
- package/dist/client/index.js.map +1 -1
- package/dist/client/queryEffects.d.ts +5 -1
- package/dist/client/queryEffects.d.ts.map +1 -1
- package/dist/client/requestTimeout.d.ts +29 -0
- package/dist/client/requestTimeout.d.ts.map +1 -0
- package/dist/client/useMutation.d.ts +8 -1
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/client/useQuery.d.ts +15 -0
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/index.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/assetFallback.d.ts +46 -0
- package/dist/server/assetFallback.d.ts.map +1 -0
- package/dist/server/httpProd.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/testing/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-ykh78bct.js +0 -24
- package/dist/chunks/ThemeProvider-DwBG9z7t.js.map +0 -1
- /package/dist/{chunk-rffpqhn8.js.map → chunk-9zatr0vt.js.map} +0 -0
- /package/dist/{chunk-ag5nhjcr.js.map → chunk-p507sdj8.js.map} +0 -0
|
@@ -39,7 +39,11 @@ export declare function mergeDefinedConfig<C extends object>(base: C, ...overrid
|
|
|
39
39
|
/**
|
|
40
40
|
* A failed `suspense: false` query: schedule the background retry its retry
|
|
41
41
|
* policy allows. The resource owns the timer, one per variant however many
|
|
42
|
-
* readers render it
|
|
42
|
+
* readers render it, and records the decision as the state's `reconnecting`.
|
|
43
|
+
*
|
|
44
|
+
* Call it once per failure (per stored error): a function `retry` is the
|
|
45
|
+
* app's own code, documented to run once after every failure, and the
|
|
46
|
+
* `reconnecting` write this makes changes the snapshot without a new failure.
|
|
43
47
|
*/
|
|
44
48
|
export declare function retryFailedQuery(resource: QueryResource, variantKey: string, snapshot: Snapshot, cfg: QueryEffectConfig): void;
|
|
45
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryEffects.d.ts","sourceRoot":"","sources":["../../client/queryEffects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AAEH,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,KAAK,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAElD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;CAAE,EAC9E,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;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AED,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACzB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,iBAAiB,GACjC,MAAM,IAAI,CAiCZ;AAiBD;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,OAAO,GACV,SAAS,GAAG,QAAQ,CAmDtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,IAAI,SAAa,QAalB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a query or mutation fails with when its `timeout` passed before the
|
|
3
|
+
* answer (headers and body) arrived. The request is aborted. For a query it
|
|
4
|
+
* is a network failure like any other: `isRetryableQueryError` is `true`, so
|
|
5
|
+
* `retry` retries it.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RequestTimeoutError extends Error {
|
|
8
|
+
url: string;
|
|
9
|
+
timeout: number;
|
|
10
|
+
constructor(url: string, timeout: number);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Abort `controller` once `timeout` ms have passed. No timer for an unset,
|
|
14
|
+
* zero, negative or non-finite timeout. `timedOut()` tells the caller's
|
|
15
|
+
* `catch` that the abort was this timer, not a cancel; `clear()` runs once
|
|
16
|
+
* the request settles.
|
|
17
|
+
*
|
|
18
|
+
* `tighten(timeout)` gives the request already on the wire a timeout from
|
|
19
|
+
* now, when that ends sooner than the one it has (otherwise it changes
|
|
20
|
+
* nothing): a request is never aborted at once, however long it has already
|
|
21
|
+
* waited. `timeout()` is the one in force.
|
|
22
|
+
*/
|
|
23
|
+
export declare function startRequestTimeout(controller: AbortController | null, timeout: number | undefined): {
|
|
24
|
+
timedOut: () => boolean;
|
|
25
|
+
timeout: () => number;
|
|
26
|
+
tighten: (next: number | undefined) => void;
|
|
27
|
+
clear: () => void;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=requestTimeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestTimeout.d.ts","sourceRoot":"","sources":["../../client/requestTimeout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAEnC,GAAG,EAAE,MAAM;IACX,OAAO,EAAE,MAAM;gBADf,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM;CAKzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,eAAe,GAAG,IAAI,EAClC,OAAO,EAAE,MAAM,GAAG,SAAS;;;oBAOJ,MAAM,GAAG,SAAS;;EAuB1C"}
|
|
@@ -46,6 +46,13 @@ type Config<T, E = never> = {
|
|
|
46
46
|
onError(error: WithMutationErrorHelpers<MutationError | E>): void;
|
|
47
47
|
onCanceled?: () => void;
|
|
48
48
|
concurrency?: MutationConcurrency;
|
|
49
|
+
/**
|
|
50
|
+
* How long the request may wait for its answer, in ms. Past it the request
|
|
51
|
+
* is aborted and `onError` gets a `RequestTimeoutError`; it is not sent
|
|
52
|
+
* again. Defaults to `queryConfig.mutationTimeout`; unset, it waits as long
|
|
53
|
+
* as the browser does.
|
|
54
|
+
*/
|
|
55
|
+
timeout?: number;
|
|
49
56
|
/**
|
|
50
57
|
* Queries the answer is written into on success, before `onSuccess`, with
|
|
51
58
|
* no refetch: `{ path, params?, search?, data? }`. Without `data` the
|
|
@@ -160,7 +167,7 @@ export declare function useUpload<K extends keyof Methods["POST"], T = Data<"POS
|
|
|
160
167
|
options?: {
|
|
161
168
|
params?: Partial<ParseParams<K>>;
|
|
162
169
|
},
|
|
163
|
-
config?: Partial<Omit<Config<T, E>, "concurrency">>
|
|
170
|
+
config?: Partial<Omit<Config<T, E>, "concurrency" | "timeout">>
|
|
164
171
|
]): {
|
|
165
172
|
state: "done" | "error" | "idle" | "uploading";
|
|
166
173
|
progress: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../client/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../client/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,KAAK,OAAO,GAAG;IACb,IAAI,EAAE;SACH,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,QAAQ,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,C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,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC;CAChE;;;wBAqCW,QAAQ,GAAG,IAAI,GAAG,IAAI,KAC/B,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;;EAmI1B"}
|
|
@@ -56,6 +56,15 @@ export interface Config<T> {
|
|
|
56
56
|
focusThrottleInterval?: number;
|
|
57
57
|
/** How long cached data stays fresh before a read revalidates it, in ms. */
|
|
58
58
|
staleTime?: number;
|
|
59
|
+
/**
|
|
60
|
+
* How long a request may wait for its answer, in ms. Past it the request is
|
|
61
|
+
* aborted and fails with a `RequestTimeoutError`, a network failure: `retry`
|
|
62
|
+
* retries it, and `isReconnecting` is `true` meanwhile. Unset (the
|
|
63
|
+
* default), a request waits as long as the browser does. When several
|
|
64
|
+
* mounted readers of the same query and `search` set one, the smallest
|
|
65
|
+
* applies; a reader without one never removes another's.
|
|
66
|
+
*/
|
|
67
|
+
timeout?: number;
|
|
59
68
|
debug?: boolean;
|
|
60
69
|
lazy?: boolean;
|
|
61
70
|
/**
|
|
@@ -113,6 +122,12 @@ interface QueryReturn<T extends keyof GetRPC, D> {
|
|
|
113
122
|
data: D;
|
|
114
123
|
loading: boolean;
|
|
115
124
|
error: Error;
|
|
125
|
+
/**
|
|
126
|
+
* `true` while the query sits on an error its `retry` policy retries — a
|
|
127
|
+
* dropped connection, a timeout, a 5xx — until a retry succeeds or the
|
|
128
|
+
* retries run out. Always `false` under suspense.
|
|
129
|
+
*/
|
|
130
|
+
isReconnecting: boolean;
|
|
116
131
|
mutate: {
|
|
117
132
|
(fn?: NestedPrettify<Data<T>>): void;
|
|
118
133
|
(fn?: (data: NestedPrettify<Data<T>>) => NestedPrettify<Data<T>>): void;
|
|
@@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,MAAM,MAAM,EACtD,GAAG,EAAE,CAAC,EACN,GAAG,IAAI,EAAE;IACP,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE;CACvC,GACA,WAAW,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CA4brD"}
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ff as a,Hg as r,If as c,Ig as s,Jf as e,Jg as t,Kf as f,Kg as u,Lf as h,Mf as i,Nf as j,Uf as k,Vf as l,Wf as m,Xf as n,Yf as o,gg as p,sh as v,wg as q}from"../chunk-
|
|
2
|
+
import{Ff as a,Hg as r,If as c,Ig as s,Jf as e,Jg as t,Kf as f,Kg as u,Lf as h,Mf as i,Nf as j,Uf as k,Vf as l,Wf as m,Xf as n,Yf as o,gg as p,sh as v,wg as q}from"../chunk-w8cbs1kg.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import{Aj as g,Xi as b,wj as d}from"../chunk-wy87gc0b.js";import"../chunk-xt90xbes.js";import"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import"../chunk-q634cwbc.js";import"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import"../chunk-y16vp7yf.js";import"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import"../chunk-qc7x8q1q.js";import"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import"../chunk-a76a7869.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=E9B0667A9AEA956864756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as H,Ah as fa,Bh as ga,Ch as ha,Df as J,Dh as ia,Ef as K,Eh as ja,Fh as ka,Gf as L,Gh as la,Hf as M,Hh as ma,Ih as na,Jh as oa,Kh as pa,Lh as qa,Mh as ra,Ne as t,Nh as sa,Oe as u,Oh as ta,Pe as v,Ph as ua,Qe as w,Re as x,Se as E,Sg as $,Xe as F,_e as G,af as I,th as aa,uh as ba,vh as ca,yh as da,zh as ea}from"../chunk-
|
|
2
|
+
import{$e as H,Ah as fa,Bh as ga,Ch as ha,Df as J,Dh as ia,Ef as K,Eh as ja,Fh as ka,Gf as L,Gh as la,Hf as M,Hh as ma,Ih as na,Jh as oa,Kh as pa,Lh as qa,Mh as ra,Ne as t,Nh as sa,Oe as u,Oh as ta,Pe as v,Ph as ua,Qe as w,Re as x,Se as E,Sg as $,Xe as F,_e as G,af as I,th as aa,uh as ba,vh as ca,yh as da,zh as ea}from"../chunk-w8cbs1kg.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import{Ci as n,Hi as o,Ii as p,Ji as q,Ki as r,Pi as s,Ri as y,Si as z,Ti as A,Ui as B,Vi as C,Wi as D,fj as N,gj as O,hj as P,ij as Q,jj as R,kj as S,lj as T,mj as U,ni as a,nj as V,oi as b,oj as W,pi as d,pj as X,rj as Y,sj as Z,tj as _,ui as e,vi as f,wi as g,xi as h,yi as i,zi as j}from"../chunk-wy87gc0b.js";import{Jj as c}from"../chunk-xt90xbes.js";import{Oj as k,Pj as l,Qj as m}from"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import"../chunk-q634cwbc.js";import"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import"../chunk-y16vp7yf.js";import"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import"../chunk-qc7x8q1q.js";import"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import"../chunk-a76a7869.js";export{g as toRangeHeaderValue,v as toMiddlewareList,k as stateKey,_ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,ia as middlewareConfigDefaults,u as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,qa as defineResourcePolicy,ha as defineMiddlewareConfig,n as cspNonce,w as createUnsatisfiableResponse,x as createStreamResponse,L as createFileResponse,I as clientIp,Y as classifyAddress,ca as authorizeChannel,M as ViewRouter,o as ValidationError,V as TooManyRedirectsError,T as TooLargeError,S as TimeoutError,ra as SitemapError,sa as Sitemap,K as SameSiteBounceMiddleware,Z as SafeResponse,N as SafeFetchError,J as SAME_SITE_BOUNCE_PARAM,ta as RobotsTxt,ua as Robots,pa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,H as RateLimitMiddleware,F as RateLimitExceededError,A as RangeNotSatisfiableError,na as PoliciesServiceProvider,oa as Policies,q as PayloadTooLargeError,B as NotFoundError,W as NetworkError,l as MissingRequestStateError,G as Middleware,fa as McpToolDeclaration,ga as McpRouter,ea as McpRouteDeclaration,da as McpModelParam,p as InvalidValidationRuleError,O as InvalidUrlError,z as InsufficientPermissionsError,X as HttpStatusError,t as HttpResponse,s as HttpRequest,C as FileNotFoundError,R as DnsError,la as CorsMiddleware,a as Controller,U as ContentTypeError,ba as ChannelRouter,aa as ChannelDeclaration,ka as CacheMiddleware,ma as CSRFMiddleware,$ as BodyLimitMiddleware,P as BlockedHostError,Q as BlockedAddressError,y as AuthorizationError,ja as AuthenticationMiddleware,D as AuthenticationError,E as ApiRouter};
|
|
3
3
|
|
|
4
4
|
//# debugId=7AB49193A4961B3464756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ra as T}from"../chunk-hmccxtd3.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-pag82mxh.js";import{Ke as b,Le as w}from"../chunk-q7x7ddw0.js";import"../chunk-5399t8zm.js";import{If as j}from"../chunk-
|
|
2
|
+
import{ra as T}from"../chunk-hmccxtd3.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-pag82mxh.js";import{Ke as b,Le as w}from"../chunk-q7x7ddw0.js";import"../chunk-5399t8zm.js";import{If as j}from"../chunk-w8cbs1kg.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import"../chunk-wy87gc0b.js";import"../chunk-xt90xbes.js";import"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import"../chunk-q634cwbc.js";import"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import"../chunk-y16vp7yf.js";import"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import{$l as R,Xl as V,Yl as X,Zl as E,_l as L,am as S}from"../chunk-qc7x8q1q.js";import"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import"../chunk-a76a7869.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=A0096549CAB54C3E64756E2164756E21
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ta as E}from"../chunk-716832vw.js";import{ob as l}from"../chunk-3raywsbj.js";import{pb as H}from"../chunk-pag82mxh.js";import{$b as I,Cb as g,Db as W,Eb as _,Fb as p,Gb as P,Hb as u,Ib as $,Jb as V,Kb as q,Lb as B,Mb as K,Qb as L,Rb as Q,Sb as T,Wb as U,Xb as y,Yb as F,Zb as C,_b as D,cc as b,fc as f,gc as k,hc as m}from"../chunk-
|
|
2
|
+
import{Ta as E}from"../chunk-716832vw.js";import{ob as l}from"../chunk-3raywsbj.js";import{pb as H}from"../chunk-pag82mxh.js";import{$b as I,Cb as g,Db as W,Eb as _,Fb as p,Gb as P,Hb as u,Ib as $,Jb as V,Kb as q,Lb as B,Mb as K,Qb as L,Rb as Q,Sb as T,Wb as U,Xb as y,Yb as F,Zb as C,_b as D,cc as b,fc as f,gc as k,hc as m}from"../chunk-9zatr0vt.js";import"../chunk-zrqzxc50.js";import"../chunk-8gyq2etb.js";import"../chunk-rhyhxgxg.js";import"../chunk-hcysexst.js";import{Ee as h}from"../chunk-zcx8n3mk.js";import"../chunk-q7x7ddw0.js";import"../chunk-5399t8zm.js";import{Bf as n,Cf as v,ff as d,gf as s,ih as w,mh as A,qh as R}from"../chunk-w8cbs1kg.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import"../chunk-wy87gc0b.js";import"../chunk-xt90xbes.js";import"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import"../chunk-q634cwbc.js";import{gk as M}from"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import"../chunk-y16vp7yf.js";import"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import"../chunk-bdzj9znx.js";import"../chunk-qc7x8q1q.js";import{bm as O,dm as J}from"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import"../chunk-a76a7869.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 J;boot(){if(this.models.length>0)l(...this.models);else a();this.app.config.merge(this.config),J.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 z of this.services){let G=typeof z==="function"?new z:z,x=G.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,G),this.serviceInstances.push(G),this.serviceTokens.add(x.token)}this.app.setShutdownHooks(this.serviceInstances.map((z)=>({name:`${z.constructor.name}.onShutdown`,shutdown:(G)=>z.onShutdown(G)})))}async waitForBoot(){await this.app.boot(),await this.bootServices(),p(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(),J.getInstance()===this.app)J.setInstance(void 0);O.disable()}}function a(){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:
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A second place to find a build asset this server does not have (#1269).
|
|
3
|
+
*
|
|
4
|
+
* While two releases serve one app (a weighted rollout across revisions, two
|
|
5
|
+
* origins behind a load balancer with no affinity), a document from one
|
|
6
|
+
* release asks for its hashed files and each request can land on the other.
|
|
7
|
+
* Neither release has the other's files, and a reload only rolls the dice
|
|
8
|
+
* again. With a fallback base set — a bucket or blob container the deploy
|
|
9
|
+
* uploads every release's `dist/client/assets` to before it takes traffic —
|
|
10
|
+
* a miss under `/assets/` is fetched from there and streamed back, so any
|
|
11
|
+
* release answers any recent release's chunks, stylesheets and fonts. Without
|
|
12
|
+
* a file there either, the miss is answered as before (the reload stub for a
|
|
13
|
+
* chunk, a 404 for the rest).
|
|
14
|
+
*
|
|
15
|
+
* Read at boot from `GEMI_ASSET_FALLBACK_URL`. Unset, nothing changes.
|
|
16
|
+
*/
|
|
17
|
+
/** How long the fallback may take to start answering before the miss is answered locally. */
|
|
18
|
+
export declare const ASSET_FALLBACK_TIMEOUT_MS = 3000;
|
|
19
|
+
/** How long a path the fallback did not have is not asked for again. */
|
|
20
|
+
export declare const ASSET_FALLBACK_MISS_TTL_MS = 30000;
|
|
21
|
+
/** Marks a response that came from the fallback, for whoever debugs a deploy. */
|
|
22
|
+
export declare const ASSET_FALLBACK_HEADER = "x-gemi-asset-fallback";
|
|
23
|
+
export interface AssetFallbackOptions {
|
|
24
|
+
/** Absolute http(s) URL the `/assets/...` path is resolved against. */
|
|
25
|
+
base: string;
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
missTtlMs?: number;
|
|
28
|
+
fetch?: typeof fetch;
|
|
29
|
+
now?: () => number;
|
|
30
|
+
}
|
|
31
|
+
export type AssetFallback = (req: Request, pathname: string) => Promise<Response | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* `GEMI_ASSET_FALLBACK_URL`, checked: an absolute http(s) URL, given a
|
|
34
|
+
* trailing `/`. Anything else is reported and ignored, since a typo must not
|
|
35
|
+
* cost the server its boot.
|
|
36
|
+
*/
|
|
37
|
+
export declare function assetFallbackBase(value: string | undefined): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The lookup for one fallback base. Answers `undefined` whenever the fallback
|
|
40
|
+
* has nothing usable — a non-200, a timeout, a network error, a method other
|
|
41
|
+
* than GET/HEAD — and remembers that for `missTtlMs`, so a path that is
|
|
42
|
+
* really gone (an old tab days later, a scanner) costs the fallback one
|
|
43
|
+
* request per window, not one per hit.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createAssetFallback({ base, timeoutMs, missTtlMs, fetch: fetchImpl, now, }: AssetFallbackOptions): AssetFallback;
|
|
46
|
+
//# sourceMappingURL=assetFallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetFallback.d.ts","sourceRoot":"","sources":["../../server/assetFallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,6FAA6F;AAC7F,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAC/C,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAIjD,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;AAE9F;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAe/E;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,SAAqC,EACrC,SAAsC,EACtC,KAAK,EAAE,SAAiB,EACxB,GAAc,GACf,EAAE,oBAAoB,GAAG,aAAa,CA6EtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpProd.d.ts","sourceRoot":"","sources":["../../server/httpProd.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"httpProd.d.ts","sourceRoot":"","sources":["../../server/httpProd.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAuD1C,wBAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,4BA4VxE"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ra as f}from"../chunk-ba1h9pm6.js";import{Sa as A}from"../chunk-n0sbg84n.js";import{nm as Q,pm as q,qm as w,tm as Z,um as P,vm as y,wm as S,xm as U}from"../chunk-ad0dx73f.js";import{Bm as H}from"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import{Jm as F}from"../chunk-a76a7869.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 A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=S(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)U(()=>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{Ra as f}from"../chunk-ba1h9pm6.js";import{Sa as A}from"../chunk-n0sbg84n.js";import{nm as Q,pm as q,qm as w,tm as Z,um as P,vm as y,wm as S,xm as U}from"../chunk-ad0dx73f.js";import{Bm as H}from"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import{Jm as F}from"../chunk-a76a7869.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 A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=S(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)U(()=>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-m60st4nt.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-p507sdj8.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{q as shutdownSignal,W as liveness,Q as isShuttingDown,w as holdShutdown,k as Server};
|
|
3
3
|
|
|
4
4
|
//# debugId=80001A39147D866564756E2164756E21
|
package/dist/services/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rb as v9}from"../chunk-g6tqje74.js";import{$b as k9,Ab as q4,Bb as c1,Cb as mZ,Db as cZ,Eb as Y9,Ib as K9,Jb as G9,Kb as z9,Lb as X9,Mb as F9,Nb as M9,Ob as L9,Pb as N9,Qb as D9,Rb as H9,Sb as U9,Tb as g4,Ub as _6,Vb as w,Wb as x9,Xb as O9,Yb as S9,Zb as R9,_b as _9,ac as f9,bc as C9,cc as V9,dc as T9,ec as P9,fc as b9,gc as w9,hc as q9,sb as IZ,tb as yZ,ub as AZ,vb as hZ,wb as EZ,xb as y4,yb as gZ,zb as w4}from"../chunk-rffpqhn8.js";import{kc as h4}from"../chunk-zrqzxc50.js";import"../chunk-8gyq2etb.js";import{$d as pZ,_d as uZ,ae as dZ,be as lZ,ce as nZ,de as sZ,ee as oZ,fe as aZ,ge as tZ,he as rZ,ie as eZ,je as W9,ke as Z9,le as $9,me as J9,ne as Q9}from"../chunk-rhyhxgxg.js";import{oe as iZ}from"../chunk-hcysexst.js";import{Ae as TZ,Be as PZ,Ce as bZ,De as wZ,Ee as qZ,Je as vZ,pe as HZ,qe as UZ,re as xZ,se as OZ,te as SZ,ue as RZ,ve as _Z,we as kZ,xe as fZ,ye as CZ,ze as VZ}from"../chunk-zcx8n3mk.js";import{Ke as B9,Le as j9}from"../chunk-q7x7ddw0.js";import"../chunk-5399t8zm.js";import{$f as R8,$g as KZ,Ag as u8,Bg as p8,Cg as d8,Ch as jZ,Dg as l8,Dh as FZ,Eg as n8,Fg as i8,Gg as s8,Lg as U,Mg as m,Ng as o8,Of as J8,Og as a8,Pf as Q8,Pg as t8,Qf as Y8,Qg as r8,Rf as K8,Rg as e8,Sf as G8,Te as N6,Tf as z8,Tg as WZ,Ue as P5,Ug as ZZ,Ve as b5,Vg as $Z,We as w5,Wg as JZ,Xg as QZ,Ye as q5,Zf as O8,_f as S8,_g as YZ,af as D6,ag as _8,ah as GZ,bf as x4,bg as k8,cf as Z6,cg as f8,df as O4,dg as C8,dh as zZ,ef as S4,eg as V8,fg as T8,hg as P8,if as f6,ig as R6,ih as XZ,jf as C6,jg as b8,lf as v5,mf as I5,mh as BZ,nf as y5,ng as w8,of as A5,og as q8,pf as h5,pg as I8,qf as E5,qh as m4,rf as g5,rh as e,sf as m5,sg as y8,tf as c5,tg as A8,uf as o0,ug as h8,vf as u5,vg as E8,wf as p5,xf as d5,xg as g8,yf as l5,yg as m8,zf as n5,zg as c8}from"../chunk-24z18t5q.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import{$i as A1,Bj as h1,Pi as b4,Ti as J1,Vi as a,Zi as D4,_i as U1,aj as i5,bj as s5,cj as o5,dj as a5,ej as t5,qj as HW,rj as UW,uj as r5,vi as U4,vj as e5,wi as N4,xi as H1,xj as W8,yj as Z8,zj as $8}from"../chunk-wy87gc0b.js";import"../chunk-xt90xbes.js";import{Mj as V}from"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import{$j as H8,Yj as N8,Zj as D8,_j as v1,ak as d0,bk as U8,ck as x8}from"../chunk-q634cwbc.js";import{ik as F8,jk as M8,kk as L8}from"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import{Tk as v8}from"../chunk-y16vp7yf.js";import{Vk as X8,Wk as B8,Xk as j8}from"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import{Rl as _4,Sl as MZ,Tl as LZ,Ul as NZ,Wl as DZ}from"../chunk-bdzj9znx.js";import"../chunk-qc7x8q1q.js";import{em as _}from"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import{Jm as y1}from"../chunk-a76a7869.js";import{Buffer as a0}from"buffer";class t0 extends U1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-v10kckwp.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 a0?$:$ instanceof Blob||$ instanceof File?a0.from(await $.arrayBuffer()):"",{sdk:G,client:z}=await this.connect();return Z?.throwIfAborted(),await z.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={}){D4(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 z=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.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=A1(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?N4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new J1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let z=H1(G.ContentRange),X=Boolean(z)&&G.$metadata?.httpStatusCode===206,B=z?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,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 a(Z);throw Y}}}import{Buffer as r0}from"buffer";import{Readable as SW}from"stream";function H4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function RW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class e0 extends U1{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 r0?$:r0.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,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let S=await this.size({name:$,bucket:J}),o=U4(Q,S);if(!o)throw new J1(S);K=o.start,G=o.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(S){if(RW(S))throw new J1(await this.size({name:$,bucket:J}));if(H4(S))throw new a($);throw S}let B=H1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await _W(X);if(H instanceof ReadableStream)H=A1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.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(H4(Q))throw new a(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(H4(Q))return;throw Q}}}async function _W(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return SW.toWeb(W.readableStreamBody);return null}function kW(W){return W}class R4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class E1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var W6=1000,fW=60000,CW=`
|
|
2
|
+
import{rb as v9}from"../chunk-g6tqje74.js";import{$b as k9,Ab as q4,Bb as c1,Cb as mZ,Db as cZ,Eb as Y9,Ib as K9,Jb as G9,Kb as z9,Lb as X9,Mb as F9,Nb as M9,Ob as L9,Pb as N9,Qb as D9,Rb as H9,Sb as U9,Tb as g4,Ub as _6,Vb as w,Wb as x9,Xb as O9,Yb as S9,Zb as R9,_b as _9,ac as f9,bc as C9,cc as V9,dc as T9,ec as P9,fc as b9,gc as w9,hc as q9,sb as IZ,tb as yZ,ub as AZ,vb as hZ,wb as EZ,xb as y4,yb as gZ,zb as w4}from"../chunk-9zatr0vt.js";import{kc as h4}from"../chunk-zrqzxc50.js";import"../chunk-8gyq2etb.js";import{$d as pZ,_d as uZ,ae as dZ,be as lZ,ce as nZ,de as sZ,ee as oZ,fe as aZ,ge as tZ,he as rZ,ie as eZ,je as W9,ke as Z9,le as $9,me as J9,ne as Q9}from"../chunk-rhyhxgxg.js";import{oe as iZ}from"../chunk-hcysexst.js";import{Ae as TZ,Be as PZ,Ce as bZ,De as wZ,Ee as qZ,Je as vZ,pe as HZ,qe as UZ,re as xZ,se as OZ,te as SZ,ue as RZ,ve as _Z,we as kZ,xe as fZ,ye as CZ,ze as VZ}from"../chunk-zcx8n3mk.js";import{Ke as B9,Le as j9}from"../chunk-q7x7ddw0.js";import"../chunk-5399t8zm.js";import{$f as R8,$g as KZ,Ag as u8,Bg as p8,Cg as d8,Ch as jZ,Dg as l8,Dh as FZ,Eg as n8,Fg as i8,Gg as s8,Lg as U,Mg as m,Ng as o8,Of as J8,Og as a8,Pf as Q8,Pg as t8,Qf as Y8,Qg as r8,Rf as K8,Rg as e8,Sf as G8,Te as N6,Tf as z8,Tg as WZ,Ue as P5,Ug as ZZ,Ve as b5,Vg as $Z,We as w5,Wg as JZ,Xg as QZ,Ye as q5,Zf as O8,_f as S8,_g as YZ,af as D6,ag as _8,ah as GZ,bf as x4,bg as k8,cf as Z6,cg as f8,df as O4,dg as C8,dh as zZ,ef as S4,eg as V8,fg as T8,hg as P8,if as f6,ig as R6,ih as XZ,jf as C6,jg as b8,lf as v5,mf as I5,mh as BZ,nf as y5,ng as w8,of as A5,og as q8,pf as h5,pg as I8,qf as E5,qh as m4,rf as g5,rh as e,sf as m5,sg as y8,tf as c5,tg as A8,uf as o0,ug as h8,vf as u5,vg as E8,wf as p5,xf as d5,xg as g8,yf as l5,yg as m8,zf as n5,zg as c8}from"../chunk-w8cbs1kg.js";import"../chunk-3wsmgdcr.js";import"../chunk-101rvvje.js";import{$i as A1,Bj as h1,Pi as b4,Ti as J1,Vi as a,Zi as D4,_i as U1,aj as i5,bj as s5,cj as o5,dj as a5,ej as t5,qj as HW,rj as UW,uj as r5,vi as U4,vj as e5,wi as N4,xi as H1,xj as W8,yj as Z8,zj as $8}from"../chunk-wy87gc0b.js";import"../chunk-xt90xbes.js";import{Mj as V}from"../chunk-w92n83g2.js";import"../chunk-1agwddws.js";import{$j as H8,Yj as N8,Zj as D8,_j as v1,ak as d0,bk as U8,ck as x8}from"../chunk-q634cwbc.js";import{ik as F8,jk as M8,kk as L8}from"../chunk-mxedsqbe.js";import"../chunk-r5ggnywk.js";import{Tk as v8}from"../chunk-y16vp7yf.js";import{Vk as X8,Wk as B8,Xk as j8}from"../chunk-n65hk6bq.js";import"../chunk-094hbhc8.js";import"../chunk-9qyedsvw.js";import"../chunk-h1f4f9wx.js";import"../chunk-1vnbw1d8.js";import{Rl as _4,Sl as MZ,Tl as LZ,Ul as NZ,Wl as DZ}from"../chunk-bdzj9znx.js";import"../chunk-qc7x8q1q.js";import{em as _}from"../chunk-p608rrfc.js";import"../chunk-achvynaf.js";import"../chunk-jggtz103.js";import"../chunk-ad0dx73f.js";import"../chunk-mtf5kzza.js";import"../chunk-vrpsgq3x.js";import{Jm as y1}from"../chunk-a76a7869.js";import{Buffer as a0}from"buffer";class t0 extends U1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-v10kckwp.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 a0?$:$ instanceof Blob||$ instanceof File?a0.from(await $.arrayBuffer()):"",{sdk:G,client:z}=await this.connect();return Z?.throwIfAborted(),await z.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={}){D4(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 z=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.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=A1(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?N4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new J1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let z=H1(G.ContentRange),X=Boolean(z)&&G.$metadata?.httpStatusCode===206,B=z?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,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 a(Z);throw Y}}}import{Buffer as r0}from"buffer";import{Readable as SW}from"stream";function H4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function RW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class e0 extends U1{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 r0?$:r0.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,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let S=await this.size({name:$,bucket:J}),o=U4(Q,S);if(!o)throw new J1(S);K=o.start,G=o.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(S){if(RW(S))throw new J1(await this.size({name:$,bucket:J}));if(H4(S))throw new a($);throw S}let B=H1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await _W(X);if(H instanceof ReadableStream)H=A1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.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(H4(Q))throw new a(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(H4(Q))return;throw Q}}}async function _W(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return SW.toWeb(W.readableStreamBody);return null}function kW(W){return W}class R4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class E1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var W6=1000,fW=60000,CW=`
|
|
3
3
|
local currentKey = KEYS[1]
|
|
4
4
|
local previousKey = KEYS[2]
|
|
5
5
|
local limit = tonumber(ARGV[1])
|
package/dist/testing/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as toVariantKey, B as ProgressManager, G as RealtimeContext, J as liveModule, N as I18nProvider, P as ServerDataContext, c as ClientRouterContext, et as applyParams, i as RouteTransitionProvider, nt as QueryManagerContext, r as m, rt as QueryManagerProvider, t as ThemeProvider
|
|
1
|
+
import { $ as toVariantKey, B as ProgressManager, Ct as Subject, G as RealtimeContext, J as liveModule, N as I18nProvider, P as ServerDataContext, c as ClientRouterContext, et as applyParams, i as RouteTransitionProvider, nt as QueryManagerContext, r as m, rt as QueryManagerProvider, t as ThemeProvider } from "../chunks/ThemeProvider-BO3sQkWl.js";
|
|
2
2
|
import { r as RouteStateProvider } from "../chunks/useParams-BN3XXfmG.js";
|
|
3
3
|
import "../chunks/urlpattern-polyfill-Cc7YrzJf.js";
|
|
4
4
|
import { t as channelKey } from "../chunks/channelKey-CIhHpX6x.js";
|
|
5
|
-
import { t as followLive } from "../chunks/live-
|
|
5
|
+
import { t as followLive } from "../chunks/live-BCCfTb28.js";
|
|
6
6
|
import { Suspense, createElement, useContext, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { hydrateRoot } from "react-dom/client";
|
package/package.json
CHANGED
package/dist/chunk-ykh78bct.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$ as AJ,_ as p,aa as DJ,ba as PJ}from"./chunk-f0sfh1r2.js";import{Da as b,Ha as T,Ia as NJ}from"./chunk-v2fd69at.js";import"./chunk-ba1h9pm6.js";import{Qe as jJ,eh as xJ,fh as k,nh as IJ,oh as MJ,ph as FJ}from"./chunk-24z18t5q.js";import"./chunk-3wsmgdcr.js";import"./chunk-101rvvje.js";import{ui as ZJ,vi as XJ,yi as QJ}from"./chunk-wy87gc0b.js";import{Lj as LJ}from"./chunk-xt90xbes.js";import"./chunk-w92n83g2.js";import"./chunk-1agwddws.js";import"./chunk-q634cwbc.js";import"./chunk-mxedsqbe.js";import"./chunk-r5ggnywk.js";import"./chunk-y16vp7yf.js";import"./chunk-n65hk6bq.js";import"./chunk-094hbhc8.js";import"./chunk-9qyedsvw.js";import"./chunk-h1f4f9wx.js";import"./chunk-1vnbw1d8.js";import"./chunk-qc7x8q1q.js";import"./chunk-p608rrfc.js";import"./chunk-achvynaf.js";import{jm as GJ}from"./chunk-jggtz103.js";import"./chunk-ad0dx73f.js";import{Bm as _J}from"./chunk-mtf5kzza.js";import{Dm as y}from"./chunk-vrpsgq3x.js";import"./chunk-a76a7869.js";import{createHash as U2}from"crypto";import{join as d,resolve as TJ,sep as BJ}from"path";import{Duplex as gJ}from"stream";import{constants as E,createBrotliCompress as fJ,createGzip as mJ}from"zlib";var uJ=["br","gzip"],hJ=1024,cJ=5,pJ=19,dJ=6;function lJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function oJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let Z of J.split(",")){let[X,...j]=Z.split(";"),H=X.trim().toLowerCase();if(H==="")continue;let W=1;for(let G of j){let U=G.indexOf("=");if(U===-1)continue;if(G.slice(0,U).trim().toLowerCase()==="q"){W=lJ(G.slice(U+1));break}}$.set(H,W)}return $}function m(J,$=uJ){let Z=oJ(J);if(!Z)return null;let X=Z.get("*"),j=null,H=0;for(let W of $){let G=Z.get(W)??X??0;if(G>H)j=W,H=G}return j}function nJ(J,$){if(!J)return!1;return J.split(",").some((Z)=>Z.trim().toLowerCase().split("=")[0].trim()===$)}function iJ(J,$){if(J==="HEAD")return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let Z=$.headers.get("Content-Type");if(!Z||!/^\s*text\/html\s*(;|$)/i.test(Z))return!1;if(!$.body)return!1;let X=$.headers.get("Content-Encoding");if(X&&X.trim().toLowerCase()!=="identity")return!1;if(nJ($.headers.get("Cache-Control"),"no-transform"))return!1;let j=$.headers.get("Content-Length");if(j!==null&&Number(j)<hJ)return!1;return!0}function aJ(J){let $=J==="br"?fJ({params:{[E.BROTLI_PARAM_QUALITY]:cJ,[E.BROTLI_PARAM_LGWIN]:pJ},flush:E.BROTLI_OPERATION_FLUSH}):mJ({level:dJ,flush:E.Z_SYNC_FLUSH});return gJ.toWeb($)}function rJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let Z=$.split(",").map((X)=>X.trim().toLowerCase());if(Z.includes("*")||Z.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function s(J,$){if(!iJ(J.method,$))return $;let Z=new Headers($.headers);rJ(Z);let X=m(J.headers.get("Accept-Encoding"));if(!X)return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z});let j;try{j=aJ(X)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:Z})}return Z.set("Content-Encoding",X),Z.delete("Content-Length"),new Response($.body.pipeThrough(j),{status:$.status,statusText:$.statusText,headers:Z})}import{readdir as X2,stat as HJ}from"fs/promises";import{join as Q2}from"path";import{mkdir as F2,readFile as tJ,stat as N2,writeFile as A2}from"fs/promises";import{dirname as P2,join as sJ}from"path";import{promisify as e}from"util";import{brotliCompress as eJ,constants as R2,gzip as J2}from"zlib";var $2=".vite/static-assets.json";var JJ={br:".br",gzip:".gz"},Z2=["br","gzip"],S2=e(eJ),b2=e(J2);async function $J(J){let $;try{$=await tJ(sJ(J,$2),"utf8")}catch{return null}let Z;try{Z=JSON.parse($)?.files}catch{return null}if(!Z||typeof Z!=="object")return null;let X={files:{}};for(let[j,H]of Object.entries(Z)){if(!Array.isArray(H))continue;X.files[j]=Z2.filter((W)=>H.includes(W))}return X}function u(J){let $=J.toString(),Z=new Bun.CryptoHasher("sha1");return Z.update($),Z.digest("hex")}async function WJ(J){let $=new Set;async function Z(X,j){let H;try{H=await X2(X,{withFileTypes:!0})}catch{return}for(let W of H){if(W.name.startsWith("."))continue;if(j&&W.name==="assets")continue;let G=Q2(X,W.name),U=W.isDirectory(),O=W.isFile();if(W.isSymbolicLink())try{let _=await HJ(G);U=_.isDirectory(),O=_.isFile()}catch{continue}if(O)$.add(G);else if(U&&!W.isSymbolicLink())await Z(G,!1)}}return await Z(J,!0),$}var j2="public, max-age=31536000, must-revalidate",H2="public, max-age=31536000, immutable";async function W2(J,$,Z){if(Z.length===0||J.headers.has("Range"))return null;let X=m(J.headers.get("Accept-Encoding"),Z);if(!X)return null;let j=$+JJ[X];try{let H=await HJ(j);return H.isFile()?{encoding:X,path:j,size:H.size}:null}catch{return null}}async function YJ(J,$,Z={}){let X=Bun.file($),j=Z.encodings??[],H={"Content-Type":X.type||"application/octet-stream","Cache-Control":Z.immutable?H2:j2,"Accept-Ranges":"bytes"};if(j.length>0)H.Vary="Accept-Encoding";let W=await W2(J,$,j);if(W){let O=Bun.file(W.path);return new Response(O.stream(),{headers:{...H,"Content-Encoding":W.encoding,"Content-Length":String(W.size),ETag:`${u(O.lastModified)}-${W.encoding}`}})}let G=X.size;H.ETag=u(X.lastModified);let U=ZJ(J.headers.get("Range"));if(U){let O=XJ(U,G);if(!O)return jJ(G);return new Response(X.slice(O.start,O.end+1).stream(),{status:206,headers:{...H,"Content-Range":QJ(O.start,O.end,G),"Content-Length":String(O.length)}})}return new Response(X.stream(),{headers:{...H,"Content-Length":String(G)}})}import{stat as z2}from"fs/promises";var v="app/client.tsx";function OJ(J,$=b){let Z=J[v]?.file;if(!Z)return;return{module:T(Z,$),preload:P(J,v,$)}}function P(J,$,Z=b){let X=[],j=new Set,H=(W)=>{if(j.has(W))return;j.add(W);let G=J[W];if(!G?.file)return;X.push(T(G.file,Z));for(let U of G.imports??[])H(U)};return H($),X}function Y2(J,$,Z=b){let X=new Set(P(J,$,Z)),j=[],H=new Set,W=(U)=>{if(H.has(U))return;H.add(U);let O=J[U];if(!O)return;for(let _ of O.dynamicImports??[])if(!/(^|\/)node_modules\//.test(_)&&!j.includes(_))j.push(_);for(let _ of O.imports??[])W(_)};W($);let G=[];for(let U of j)for(let O of P(J,U,Z))if(!X.has(O))X.add(O),G.push(O);return G}function VJ(J,$){let Z=[],X=new Set,j=new Set,H=(W)=>{if(j.has(W))return;j.add(W);let G=J[W];if(!G)return;for(let U of G.imports??[])H(U);for(let U of G.css??[])if(!X.has(U))X.add(U),Z.push(U)};return H($),Z}function UJ(J,$=b){let Z=new Map;return(X)=>{if(!Z.has(X)){let j=`${X}${GJ}`,H=J[j]?.file;Z.set(X,H?{src:T(H,$),preload:P(J,j,$),dynamicPreload:Y2(J,j,$)}:void 0)}return Z.get(X)}}var zJ="x-gemi-build";function G2(J,$,Z,X){let j=Date.now(),H=function(V){return typeof V==="number"&&j-V>=0&&j-V<Z},W=function(V){try{let z=V?JSON.parse(V):null;return z&&typeof z==="object"&&!Array.isArray(z)?z:{}}catch{return{}}},G=function(V){let z={};for(let I in V)if(H(V[I]))z[I]=V[I];return z},U=function(V){let z=2166136261;for(let I=0;I<V.length;I++)z=Math.imul(z^V.charCodeAt(I),16777619);return(z>>>0).toString(36)},O=null,_={};try{O=window.sessionStorage,_=W(O.getItem(J))}catch{O=null}let F=J+":",N="",A="";try{let V=new URL($,window.location.href);N=U(new URL(window.location.href).origin),A=U(V.origin+V.pathname)}catch{}let C=null;try{let V=window.name;if(!A)C=null;else if(V==="")C={};else if(V.indexOf(F)===0){let z=W(V.slice(F.length)),I=z.m;C=z.o===N&&I&&typeof I==="object"&&!Array.isArray(I)?I:{}}}catch{C=null}if(X==="tidy"){try{let V=window.name;if(C===null||V.indexOf(F)!==0)return"ok";for(let z in C)if(H(C[z]))return"cooldown";window.name=""}catch{}return"ok"}if(H(_[$])||C&&H(C[A]))return"cooldown";if(!O&&!C)return"storage";if(!X)return"ok";if(O)try{let V=G(_);V[$]=j;let z=JSON.stringify(V);if(O.setItem(J,z),O.getItem(J)===z)return"ok"}catch{}if(C)try{let V=G(C);V[A]=j;let z=F+JSON.stringify({o:N,m:V});if(window.name=z,window.name===z)return"ok"}catch{}return"storage"}function KJ(J,$=30000){let Z=JSON.stringify("gemi:chunk-reload"),X=JSON.stringify(`Failed to fetch dynamically imported module: ${J}`);return`var g=${G2.toString()};var r=!1;try{r=navigator.onLine!==!1&&g(${Z},window.location.href,${Number($)},!0)==="ok"}catch(e){}if(r)window.location.reload();else throw new Error(${X});export {}`}var O2=new RegExp(`^${xJ}/.+\\.m?js$`);function h(J){return O2.test(J)}function CJ(J){if(h(J))return new Response(KJ(J),{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(k(J))return new Response("Not found",{status:404});return}var V2=`<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Internal Server Error</title>
|
|
8
|
-
<style>
|
|
9
|
-
body { font-family: system-ui, sans-serif; margin: 0; min-height: 100vh; display: grid; place-items: center; }
|
|
10
|
-
main { text-align: center; padding: 16px; }
|
|
11
|
-
h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
|
|
12
|
-
p { margin: 0; opacity: 0.7; }
|
|
13
|
-
</style>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<main>
|
|
17
|
-
<h1>Something went wrong</h1>
|
|
18
|
-
<p>Please try again later.</p>
|
|
19
|
-
</main>
|
|
20
|
-
</body>
|
|
21
|
-
</html>`;function c(J,$,Z){if(!Z)console.error(J);else try{Z(J instanceof Error?J:Error(String(J),{cause:J}))}catch(X){console.error(J),console.error(X)}if(y($))return new Response(JSON.stringify({error:LJ("server_error","Internal Server Error",500)}),{status:500,headers:{"Content-Type":"application/json"}});return new Response(V2,{status:500,headers:{"Content-Type":"text/html; charset=utf-8"}})}var g=_J(),K2=d(g,"app"),M=d(g,"dist"),B=d(M,"client");function x2(J){let $;try{$=decodeURIComponent(J)}catch{return null}let Z=TJ(B,"."+$.replace("/assets/assets","/assets"));return Z.startsWith(B+BJ)?Z:null}async function C2(J){try{return(await z2(J)).isFile()}catch{return!1}}async function x3(J,$){let Z=await import(`${M}/client/.vite/manifest.json`),X=await import(`${M}/server/.vite/manifest.json`),j=await NJ(`${M}/client`);process.env.ROOT_DIR=g,process.env.APP_DIR=K2,process.env.DIST_DIR=M;let H={},W={},G={},U={},O={},_=(Q,Y)=>`"${Q}": () => import("${Y}")`,F=[],N=J.getRequiredViews.call(J);for(let Q of["404",...J.getFlatComponentTree.call(J)]){let Y=X[`app/views/${Q}.tsx`];if(!Y?.file&&N[Q])throw DJ(Q,N[Q]);if(!Y?.file){console.log(`Server file not found for ${Q}`),console.log(Y);let L=Object.keys(X),D=`app/views/${Q}.tsx`;console.log(`${D} not found in server manifest`),console.log(L)}let K=await import(`${process.env.DIST_DIR}/server/${Y?.file}`);H[Q]=K.default,W[Q]=K.OpenGraph,G[Q]=K;let x=Z[`app/views/${Q}.tsx`];if(x?.css&&x?.css.length>0)U[Q]=x?.css;if(x)F.push(_(Q,T(x?.file,j))),O[Q]=P(Z,`app/views/${Q}.tsx`,j)}let A=`{${F.join(",")}}`,C=OJ(Z,j);if(!C)console.error(`Client manifest has no "${v}" entry \u2014 dist/client is incomplete, so documents will render but never hydrate.`);let V=Z["app/client.tsx"]?.css??[],z=(await Promise.all(V.map((Q)=>Bun.file(`${M}/client/${Q}`).text()))).join(`
|
|
22
|
-
`),I=UJ(Z,j),l=U2("sha256").update(await Bun.file(`${M}/client/.vite/manifest.json`).text()).digest("base64url").slice(0,12),o=new Map,RJ=(Q)=>{let Y=o.get(Q);if(!Y)Y=Bun.file(`${M}/client/${Q}`).text(),o.set(Q,Y);return Y},SJ=async(Q,Y)=>{let K=new Set;for(let L of Y?[Y,...Q]:Q)for(let D of VJ(Z,`app/views/${L}.tsx`))K.add(D);let x=await Promise.all([...K].map(async(L)=>({id:L,content:await RJ(L)})));return p(Y?x:[{content:z},...x])},bJ=await WJ(B),n=new Map;for(let[Q,Y]of Object.entries((await $J(B))?.files??{})){let K=TJ(B,Q);if(K.startsWith(B+BJ))n.set(K,{immutable:!0,encodings:Y})}async function qJ(Q){let{pathname:Y}=new URL(Q.url);if(y(Y))return await R(Q,Y);let K=x2(Y),x=k(Y),L=!x&&K!==null&&bJ.has(K),D=x||Y.startsWith("/.well-known")||L;if(L&&!(await i(Q)).publicFiles)return await R(Q,Y);if(D){if(!K||!await C2(K)){if(x&&!h(Y)&&(await i(Q)).assetRoutes)return await R(Q,Y);return CJ(Y)??await R(Q,Y)}try{return await YJ(Q,K,n.get(K))}catch(w){return J.onException?.(w),new Response("Not found",{status:404})}}let q=await R(Q,Y);if(Y.endsWith(".json"))try{q.headers.set(zJ,l)}catch{}return q}async function i(Q){try{return await J.staticFiles?.(Q)??{publicFiles:!0,assetRoutes:!1}}catch{return{publicFiles:!1,assetRoutes:!0}}}async function R(Q,Y){let K=J.fetch.bind(J);try{let x=await K(Q);if(x instanceof Response)return x;else{let L=[];return L.push({content:z}),await x({getStyles:async(q,w)=>{let r=q??["404"];if(w?.static)return SJ(r,w.layout);for(let vJ of r){let kJ=Z[`app/views/${vJ}.tsx`];for(let t of kJ?.css??[]){let yJ=Bun.file(`${process.env.DIST_DIR}/client/${t}`);L.push({id:t,content:await yJ.text()})}}return p(L)},clientEntry:C,modulePreloadManifest:O,loaders:A,viewImportMap:H,viewModules:G,ogMap:W,cssManifest:U,assetBase:j,resolveIsland:I,buildId:l})}}catch(x){return c(x,Y,J.onException)}}let wJ=(process.env.GEMI_COMPRESSION??"auto").toLowerCase()!=="off",a=IJ(process.env.GEMI_TRUST_PROXY),EJ=FJ(process.env),S=J.sockets();if(S&&a.kind==="none"&&!EJ)console.warn("[gemi] Broadcast sockets: GEMI_TRUST_PROXY is not set, so a socket's address is its TCP peer. Behind a proxy or load balancer every client shares the proxy's address, and broadcast.maxConnectionsPerIp caps the whole app per process. Set GEMI_TRUST_PROXY (see forwardedFor) or raise that limit.");let f=Bun.serve({maxRequestBodySize:10737418240,fetch:async(Q,Y)=>{if(MJ(Q.headers,Y.requestIP(Q)?.address??null,a),J.applyTrustedClientIp(Q),S?.matches(Q))return S.upgrade(Q,Y);let K=await $(Q,(x)=>J.withGlobalMiddleware(x,qJ,(L)=>c(L,new URL(x.url).pathname,J.onException)));return wJ?s(Q,K):K},idleTimeout:PJ(),port:process.env.PORT||5173,websocket:S?.websocket});return await S?.start(f),AJ({port:f.port,rootDir:g}),f}export{x3 as httpProd};
|
|
23
|
-
|
|
24
|
-
//# debugId=93E8573AA93C0D0564756E2164756E21
|