gemi 0.209.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-efskg8cp.js → chunk-8b2421h0.js} +2 -2
- package/dist/{chunk-efskg8cp.js.map → chunk-8b2421h0.js.map} +1 -1
- package/dist/{chunk-rffpqhn8.js → chunk-9zatr0vt.js} +1 -1
- package/dist/{chunk-szaq0f6n.js → chunk-m60st4nt.js} +1 -1
- package/dist/{chunk-7fr265wp.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-CmGMu3vA.js → RealtimeClient-CuTFz0v1.js} +2 -2
- package/dist/chunks/{RealtimeClient-CmGMu3vA.js.map → RealtimeClient-CuTFz0v1.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-Cd7Ioorg.js → ThemeProvider-BO3sQkWl.js} +185 -9
- package/dist/chunks/ThemeProvider-BO3sQkWl.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-VDh0ivL-.js → fetchFileRequest-CrKd0rD5.js} +2 -2
- package/dist/chunks/{fetchFileRequest-VDh0ivL-.js.map → fetchFileRequest-CrKd0rD5.js.map} +1 -1
- package/dist/chunks/{live-DAt2MPE2.js → live-BCCfTb28.js} +3 -3
- package/dist/chunks/{live-DAt2MPE2.js.map → live-BCCfTb28.js.map} +1 -1
- package/dist/chunks/{mutationExtras-CodkSO_f.js → mutationExtras-cPXZS6Hf.js} +2 -2
- package/dist/chunks/{mutationExtras-CodkSO_f.js.map → mutationExtras-cPXZS6Hf.js.map} +1 -1
- package/dist/chunks/{subscriptionStream-CotXoVnq.js → subscriptionStream-CRrAISl8.js} +2 -2
- package/dist/chunks/{subscriptionStream-CotXoVnq.js.map → subscriptionStream-CRrAISl8.js.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/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +54 -13
- 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/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/chunks/ThemeProvider-Cd7Ioorg.js.map +0 -1
- /package/dist/{chunk-rffpqhn8.js.map → chunk-9zatr0vt.js.map} +0 -0
- /package/dist/{chunk-szaq0f6n.js.map → chunk-m60st4nt.js.map} +0 -0
- /package/dist/{chunk-7fr265wp.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;;;;;EAWjC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACjD,IAAI,EAAE,CAAC,EACP,GAAG,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,GACjD,CAAC,CAUH;AAED
|
|
1
|
+
{"version":3,"file":"queryEffects.d.ts","sour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vB,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,CAAC;KACpE,CAAC;IACF,GAAG,EAAE;SACF,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,OAAO,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;KACnE,CAAC;IACF,KAAK,EAAE;SACJ,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,SAAS,MAAM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I,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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuery.d.ts","sourceRoot":"","sources":["../../client/useQuery.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,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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:
|
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";
|