gemi 0.186.0 → 0.186.1
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/bin/gemi.js +2 -2
- package/dist/bin/gemi.js.map +2 -2
- package/dist/{chunk-e38xa29v.js → chunk-2c2n3v4k.js} +1 -1
- package/dist/{chunk-0rkastve.js → chunk-5y6e8kpe.js} +2 -2
- package/dist/{chunk-0rkastve.js.map → chunk-5y6e8kpe.js.map} +3 -3
- package/dist/{chunk-894xp2a6.js → chunk-p4bbsa4x.js} +2 -2
- package/dist/{chunk-894xp2a6.js.map → chunk-p4bbsa4x.js.map} +1 -1
- package/dist/{chunk-sn31ps9c.js → chunk-tckf3g8x.js} +1 -1
- package/dist/{chunk-288ee6av.js → chunk-vvwhk2sb.js} +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/internal/staticNavigationRuntime.d.ts +2 -2
- package/dist/internal/staticNavigationRuntime.d.ts.map +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 +1 -1
- package/dist/testing/index.js.map +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-e38xa29v.js.map → chunk-2c2n3v4k.js.map} +0 -0
- /package/dist/{chunk-sn31ps9c.js.map → chunk-tckf3g8x.js.map} +0 -0
- /package/dist/{chunk-288ee6av.js.map → chunk-vvwhk2sb.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ca as f}from"./chunk-s0z61m9j.js";import{createElement as v}from"react";function q(i,t){let e=Object.keys(t).sort((s,r)=>r.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=new RegExp(e.join("|"),"g");return i.replace(p,(s)=>t[s])}async function X(i,t,e=[],p){let s=[...e.map((n)=>`${i}/views/${n}.tsx`),p?`${i}/views/${p}.tsx`:`${i}/views/RootLayout.tsx`],r=new Set;for(let n of s){let u=t.moduleGraph.getModulesByFile(n);if(u)for(let d of u)r.add(d)}let b=[],l=[],g={};for(let n of r)if(n)for(let u of n.importedModules){if(u.file.includes("module.css"))g[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))l.push(u.file)}for(let n of l){let u=await t.transformRequest(n+"?direct"),d=n.includes("module.css"),j="";if(d)j=q(g[n],u.default);b.push({isDev:!0,id:n,content:d?j:u.code})}return b.map((n,u)=>{return v("style",{key:u,type:"text/css","data-vite-dev-id":n.id,dangerouslySetInnerHTML:{__html:n.content}})})}async function Y(i=[]){return i.map((t,e)=>{return v("style",{key:e,id:t?.id,type:"text/css",dangerouslySetInnerHTML:{__html:t.content}})})}import{existsSync as k}from"fs";import{basename as z}from"path";import{networkInterfaces as $}from"os";var a={name:"gemi",version:"0.186.
|
|
2
|
+
import{Ca as f}from"./chunk-s0z61m9j.js";import{createElement as v}from"react";function q(i,t){let e=Object.keys(t).sort((s,r)=>r.length-s.length).map((s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=new RegExp(e.join("|"),"g");return i.replace(p,(s)=>t[s])}async function X(i,t,e=[],p){let s=[...e.map((n)=>`${i}/views/${n}.tsx`),p?`${i}/views/${p}.tsx`:`${i}/views/RootLayout.tsx`],r=new Set;for(let n of s){let u=t.moduleGraph.getModulesByFile(n);if(u)for(let d of u)r.add(d)}let b=[],l=[],g={};for(let n of r)if(n)for(let u of n.importedModules){if(u.file.includes("module.css"))g[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))l.push(u.file)}for(let n of l){let u=await t.transformRequest(n+"?direct"),d=n.includes("module.css"),j="";if(d)j=q(g[n],u.default);b.push({isDev:!0,id:n,content:d?j:u.code})}return b.map((n,u)=>{return v("style",{key:u,type:"text/css","data-vite-dev-id":n.id,dangerouslySetInnerHTML:{__html:n.content}})})}async function Y(i=[]){return i.map((t,e)=>{return v("style",{key:e,id:t?.id,type:"text/css",dangerouslySetInnerHTML:{__html:t.content}})})}import{existsSync as k}from"fs";import{basename as z}from"path";import{networkInterfaces as $}from"os";var a={name:"gemi",version:"0.186.1",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./ai/voice":"./ai/voice/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./probe":"./probe/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./stats/route-table":"./stats/route-table.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts","./vitest":"./vitest/index.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/ai/voice dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun x vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun x vitest run ai/live","test:packaging":"bun --bun x vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0","happy-dom":"^21.0.4",jsdom:"^30.0.1",oxlint:"^1.39.0",postgres:"^3.4.5",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0",postgres:"^3.4.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0},postgres:{optional:!0}}};var h=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],m=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,t)=>m?`\x1B[${i}m${t}\x1B[0m`:t,E=(i)=>c("1",i),x=(i)=>c("2",i),o=(i)=>c("36",i),G=(i)=>c("32",i),J=(i)=>c("35",i);function N(){return a.version??"?"}function O(i){for(let t of Object.values($()))for(let e of t??[])if((e.family==="IPv4"||e.family===4)&&!e.internal)return`http://${e.address}:${i}`;return null}function Q(i){return f(i).filter((t)=>k(t)).map((t)=>z(t))}function F(i){let{port:t,rootDir:e}=i,p=`http://localhost:${t}`,s=O(t),r=Q(e),b=(g,n)=>` ${G("\u279C")} ${E(g.padEnd(9))}${n}`,l=["",...h.map((g)=>J(g)),"",` ${x("gemi")} ${o(`v${N()}`)}`,"",b("Local:",o(p)),b("Network:",s?o(s):x("unavailable")),b("Env:",r.length?r.join(", "):x("none")),""];console.log(l.join(`
|
|
3
3
|
`))}function V(i,t){return Error(`app/views/${i}.tsx is missing. gemi's auth routes render it because ${t} is on. Add the view, or turn that setting off in app/config/auth.ts.`)}function U(i=process.env.SERVER_IDLE_TIMEOUT){if(i===void 0||i.trim()==="")return 10;let t=Number(i.trim());if(!Number.isInteger(t)||t<0||t>255)throw Error(`SERVER_IDLE_TIMEOUT must be a whole number of seconds from 0 to 255 (0 disables the timeout), got ${JSON.stringify(i)}.`);return t}
|
|
4
4
|
export{X as W,Y as X,F as Y,V as Z,U as _};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=967FB43D0DEC585864756E2164756E21
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
"/**\n * Bun's default, and what both servers use when `SERVER_IDLE_TIMEOUT` is unset.\n */\nexport const DEFAULT_SERVER_IDLE_TIMEOUT = 10;\n\n/**\n * The `idleTimeout` (seconds) both `gemi dev` and `gemi start` pass to\n * `Bun.serve`, from `SERVER_IDLE_TIMEOUT` (#787).\n *\n * One reader for both servers, so a long-poll that works under `gemi start`\n * also works under `gemi dev`. Before this, only `httpProd` read the variable\n * and the dev server always ran at Bun's 10 seconds.\n *\n * It is the time a connection may stay silent, a response that has not started\n * included, before Bun closes it; `0` disables it. It does not apply to an\n * upgraded websocket (the HMR relay included), which has its own\n * `websocket.idleTimeout`.\n *\n * Unset or blank means the default. Anything that is not a whole number from 0\n * to 255 (Bun's own limits) fails the boot with the variable's name, instead\n * of Bun's \"expects idleTimeout to be an integer\", which does not say where the\n * value came from.\n */\nexport function serverIdleTimeout(raw: string | undefined = process.env.SERVER_IDLE_TIMEOUT): number {\n if (raw === undefined || raw.trim() === \"\") return DEFAULT_SERVER_IDLE_TIMEOUT;\n\n const seconds = Number(raw.trim());\n if (!Number.isInteger(seconds) || seconds < 0 || seconds > 255) {\n throw new Error(\n `SERVER_IDLE_TIMEOUT must be a whole number of seconds from 0 to 255 ` +\n `(0 disables the timeout), got ${JSON.stringify(raw)}.`,\n );\n }\n return seconds;\n}\n"
|
|
9
9
|
],
|
|
10
10
|
"mappings": ";yCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAEnD,OAAO,EAAK,QAAQ,EAAO,CAAC,IAAU,EAAO,EAAM,EAGrD,eAAsB,CAAe,CACnC,EACA,EACA,EAAyB,CAAC,EAE1B,EACA,CACA,IAAM,EAAQ,CACZ,GAAG,EAAa,IAAI,CAAC,IAAS,GAAG,WAAgB,OAAU,EAC3D,EAAS,GAAG,WAAgB,QAAe,GAAG,wBAChD,EAEM,EAAU,IAAI,IACpB,QAAW,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAK,YAAY,iBAAiB,CAAI,EAClD,GAAI,EACF,QAAW,KAAK,EAAK,EAAQ,IAAI,CAAC,EAItC,IAAM,EAAS,CAAC,EACV,EAAa,CAAC,EACd,EAA2C,CAAC,EAClD,QAAW,KAAO,EAChB,GAAI,EACF,QAAW,KAAY,EAAI,gBAAiB,CAC1C,GAAI,EAAS,KAAK,SAAS,YAAY,EACrC,EAAiB,EAAS,MAAQ,EAAS,mBAAmB,IAAI,eAAe,KAAK,EAAE,EAE1F,GAAI,EAAS,KAAK,SAAS,MAAM,EAC/B,EAAW,KAAK,EAAS,IAAI,EAMrC,QAAW,KAAiB,EAAY,CACtC,IAAM,EAAY,MAAM,EAAK,iBAAiB,EAAgB,SAAS,EAEjE,EAAc,EAAc,SAAS,YAAY,EAEnD,EAAuB,GAE3B,GAAI,EACF,EAAuB,EACrB,EAAiB,GAGhB,EAA6D,OAChE,EAGF,EAAO,KAAK,CACV,MAAO,GACP,GAAI,EACJ,QAAS,EAAc,EAAuB,EAAU,IAC1D,CAAC,EAGH,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,KAAM,WACN,mBAAoB,EAAM,GAC1B,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EAGH,eAAsB,CAAY,CAAC,EAAS,CAAC,EAAG,CAC9C,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,GAAI,GAAO,GACX,KAAM,WACN,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EC3FH,qBAAS,WACT,mBAAS,aACT,4BAAS,o4HAKT,IAAM,EAAM,CACV,oKACA,mLACA,yKACA,oKACA,mLACA,yJACF,EAEM,EAAW,QAAQ,QAAQ,OAAO,KAAK,GAAK,CAAC,QAAQ,IAAI,SACzD,EAAQ,CAAC,EAAc,IAC3B,EAAW,QAAQ,KAAQ,WAAgB,EACvC,EAAO,CAAC,IAAc,EAAM,IAAK,CAAC,EAClC,EAAM,CAAC,IAAc,EAAM,IAAK,CAAC,EACjC,EAAO,CAAC,IAAc,EAAM,KAAM,CAAC,EACnC,EAAQ,CAAC,IAAc,EAAM,KAAM,CAAC,EACpC,EAAU,CAAC,IAAc,EAAM,KAAM,CAAC,EAE5C,SAAS,CAAW,EAAW,CAC7B,OAAQ,EAA6B,SAAW,IAGlD,SAAS,CAAU,CAAC,EAAsC,CACxD,QAAW,KAAU,OAAO,OAAO,EAAkB,CAAC,EACpD,QAAW,KAAS,GAAU,CAAC,EAG7B,IADa,EAAM,SAAW,QAAW,EAAM,SAAuB,IAC1D,CAAC,EAAM,SAAU,MAAO,UAAU,EAAM,WAAW,IAGnE,OAAO,KAGT,SAAS,CAAc,CAAC,EAA2B,CACjD,OAAO,EAAS,CAAO,EACpB,OAAO,CAAC,IAAS,EAAW,CAAI,CAAC,EACjC,IAAI,CAAC,IAAS,EAAS,CAAI,CAAC,EAG1B,SAAS,CAAkB,CAAC,EAGhC,CACD,IAAQ,OAAM,WAAY,EACpB,EAAQ,oBAAoB,IAC5B,EAAU,EAAW,CAAI,EACzB,EAAM,EAAe,CAAO,EAE5B,EAAM,CAAC,EAAe,IAC1B,KAAK,EAAM,QAAE,MAAM,EAAK,EAAM,OAAO,CAAC,CAAC,IAAI,IAEvC,EAAM,CACV,GACA,GAAG,EAAI,IAAI,CAAC,IAAS,EAAQ,CAAI,CAAC,EAClC,GACA,KAAK,EAAI,MAAM,KAAK,EAAK,IAAI,EAAY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC,ECjErB,SAAS,CAAwB,CAAC,EAAc,EAAoB,CACzE,OAAW,MACT,aAAa,0DAA6D,wEAE5E,ECcK,SAAS,CAAiB,CAAC,EAA0B,QAAQ,IAAI,oBAA6B,CACnG,GAAI,IAAQ,QAAa,EAAI,KAAK,IAAM,GAAI,MArBH,IAuBzC,IAAM,EAAU,OAAO,EAAI,KAAK,CAAC,EACjC,GAAI,CAAC,OAAO,UAAU,CAAO,GAAK,EAAU,GAAK,EAAU,IACzD,MAAU,MACR,qGACmC,KAAK,UAAU,CAAG,IACvD,EAEF,OAAO",
|
|
11
|
-
"debugId": "
|
|
11
|
+
"debugId": "967FB43D0DEC585864756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{X as y,Y as IJ,Z as NJ,_ as FJ}from"./chunk-
|
|
2
|
+
import{X as y,Y as IJ,Z as NJ,_ as FJ}from"./chunk-p4bbsa4x.js";import{pa as T,ta as M,ua as MJ}from"./chunk-bwg7genv.js";import"./chunk-s0z61m9j.js";import{Cg as UJ,Dg as B,Lg as CJ,Mg as LJ,Ng as _J,oe as ZJ}from"./chunk-5y6e8kpe.js";import"./chunk-2qac05gb.js";import"./chunk-3derdn99.js";import{Sh as e,Th as JJ,Wh as $J}from"./chunk-zenfs4e2.js";import{Zi as xJ}from"./chunk-q6rse2fh.js";import"./chunk-spmxhsze.js";import"./chunk-7bz43qbt.js";import"./chunk-a1414jdv.js";import"./chunk-vhyabcw9.js";import"./chunk-zyzhqnbm.js";import"./chunk-vv8vjjez.js";import"./chunk-ecv4mtgh.js";import"./chunk-wtdmwmm7.js";import"./chunk-7gnspwra.js";import"./chunk-yx03gndz.js";import"./chunk-cf5a958j.js";import"./chunk-nadkwh8a.js";import"./chunk-krgwft9w.js";import{pl as WJ}from"./chunk-z2k8m02z.js";import"./chunk-m906xc76.js";import{Dl as KJ}from"./chunk-rdnxkecg.js";import{Fl as S}from"./chunk-0ahecas6.js";import"./chunk-mpreff3t.js";import{createHash as V2}from"crypto";import{join as g,resolve as TJ,sep as AJ}from"path";import{Duplex as gJ}from"stream";import{constants as P,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(";"),W=X.trim().toLowerCase();if(W==="")continue;let G=1;for(let Y of j){let O=Y.indexOf("=");if(O===-1)continue;if(Y.slice(0,O).trim().toLowerCase()==="q"){G=lJ(Y.slice(O+1));break}}$.set(W,G)}return $}function w(J,$=uJ){let Z=oJ(J);if(!Z)return null;let X=Z.get("*"),j=null,W=0;for(let G of $){let Y=Z.get(G)??X??0;if(Y>W)j=G,W=Y}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:{[P.BROTLI_PARAM_QUALITY]:cJ,[P.BROTLI_PARAM_LGWIN]:pJ},flush:P.BROTLI_OPERATION_FLUSH}):mJ({level:dJ,flush:P.Z_SYNC_FLUSH});return gJ.toWeb($)}function tJ(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 a(J,$){if(!iJ(J.method,$))return $;let Z=new Headers($.headers);tJ(Z);let X=w(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 XJ}from"fs/promises";import{join as Q2}from"path";import{mkdir as I2,readFile as rJ,stat as N2,writeFile as F2}from"fs/promises";import{dirname as A2,join as sJ}from"path";import{promisify as t}from"util";import{brotliCompress as eJ,constants as R2,gzip as J2}from"zlib";var $2=".vite/static-assets.json";var r={br:".br",gzip:".gz"},Z2=["br","gzip"],B2=t(eJ),S2=t(J2);async function s(J){let $;try{$=await rJ(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,W]of Object.entries(Z)){if(!Array.isArray(W))continue;X.files[j]=Z2.filter((G)=>W.includes(G))}return X}function k(J){let $=J.toString(),Z=new Bun.CryptoHasher("sha1");return Z.update($),Z.digest("hex")}async function QJ(J){let $=new Set;async function Z(X,j){let W;try{W=await X2(X,{withFileTypes:!0})}catch{return}for(let G of W){if(G.name.startsWith("."))continue;if(j&&G.name==="assets")continue;let Y=Q2(X,G.name),O=G.isDirectory(),V=G.isFile();if(G.isSymbolicLink())try{let K=await XJ(Y);O=K.isDirectory(),V=K.isFile()}catch{continue}if(V)$.add(Y);else if(O&&!G.isSymbolicLink())await Z(Y,!1)}}return await Z(J,!0),$}var j2="public, max-age=31536000, must-revalidate",W2="public, max-age=31536000, immutable";async function G2(J,$,Z){if(Z.length===0||J.headers.has("Range"))return null;let X=w(J.headers.get("Accept-Encoding"),Z);if(!X)return null;let j=$+r[X];try{let W=await XJ(j);return W.isFile()?{encoding:X,path:j,size:W.size}:null}catch{return null}}async function jJ(J,$,Z={}){let X=Bun.file($),j=Z.encodings??[],W={"Content-Type":X.type||"application/octet-stream","Cache-Control":Z.immutable?W2:j2,"Accept-Ranges":"bytes"};if(j.length>0)W.Vary="Accept-Encoding";let G=await G2(J,$,j);if(G){let V=Bun.file(G.path);return new Response(V.stream(),{headers:{...W,"Content-Encoding":G.encoding,"Content-Length":String(G.size),ETag:`${k(V.lastModified)}-${G.encoding}`}})}let Y=X.size;W.ETag=k(X.lastModified);let O=e(J.headers.get("Range"));if(O){let V=JJ(O,Y);if(!V)return ZJ(Y);return new Response(X.slice(V.start,V.end+1).stream(),{status:206,headers:{...W,"Content-Range":$J(V.start,V.end,Y),"Content-Length":String(V.length)}})}return new Response(X.stream(),{headers:{...W,"Content-Length":String(Y)}})}import{stat as U2}from"fs/promises";var R="app/client.tsx";function GJ(J,$=T){let Z=J[R]?.file;if(!Z)return;return{module:M(Z,$),preload:_(J,R,$)}}function _(J,$,Z=T){let X=[],j=new Set,W=(G)=>{if(j.has(G))return;j.add(G);let Y=J[G];if(!Y?.file)return;X.push(M(Y.file,Z));for(let O of Y.imports??[])W(O)};return W($),X}function H2(J,$,Z=T){let X=new Set(_(J,$,Z)),j=[],W=new Set,G=(O)=>{if(W.has(O))return;W.add(O);let V=J[O];if(!V)return;for(let K of V.dynamicImports??[])if(!/(^|\/)node_modules\//.test(K)&&!j.includes(K))j.push(K);for(let K of V.imports??[])G(K)};G($);let Y=[];for(let O of j)for(let V of _(J,O,Z))if(!X.has(V))X.add(V),Y.push(V);return Y}function HJ(J,$){let Z=[],X=new Set,j=new Set,W=(G)=>{if(j.has(G))return;j.add(G);let Y=J[G];if(!Y)return;for(let O of Y.imports??[])W(O);for(let O of Y.css??[])if(!X.has(O))X.add(O),Z.push(O)};return W($),Z}function YJ(J,$=T){let Z=new Map;return(X)=>{if(!Z.has(X)){let j=`${X}${WJ}`,W=J[j]?.file;Z.set(X,W?{src:M(W,$),preload:_(J,j,$),dynamicPreload:H2(J,j,$)}:void 0)}return Z.get(X)}}var OJ="x-gemi-build";function VJ(J,$=30000){let Z=JSON.stringify("gemi:chunk-reload"),X=JSON.stringify(`Failed to fetch dynamically imported module: ${J}`);return`var r=!1;try{var s=window.sessionStorage,u=window.location.href,m=JSON.parse(s.getItem(${Z})||"{}");if(!m||typeof m!=="object")m={};var d=Date.now()-m[u];if(navigator.onLine!==!1&&!(d>=0&&d<${$})){m[u]=Date.now();s.setItem(${Z},JSON.stringify(m));r=!0}}catch(e){}if(r)window.location.reload();else throw new Error(${X});export {}`}var Y2=new RegExp(`^${UJ}/.+\\.m?js$`);function v(J){return Y2.test(J)}function zJ(J){if(v(J))return new Response(VJ(J),{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(B(J))return new Response("Not found",{status:404});return}var O2=`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{W as P,Y as c,Z as f,_ as l}from"./chunk-
|
|
2
|
+
import{W as P,Y as c,Z as f,_ as l}from"./chunk-p4bbsa4x.js";import{na as u,oa as m}from"./chunk-3jpj6hjh.js";import"./chunk-bwg7genv.js";import"./chunk-mvd4mc8p.js";import"./chunk-7txst143.js";import"./chunk-7tm669mw.js";import"./chunk-s0z61m9j.js";import"./chunk-6daabbfj.js";import{Zi as S}from"./chunk-q6rse2fh.js";import{pl as T}from"./chunk-z2k8m02z.js";import{Fl as y}from"./chunk-0ahecas6.js";import"./chunk-mpreff3t.js";import{join as YJ}from"path";import{createServer as AJ}from"vite";import{join as R,sep as o}from"path";import{existsSync as a,statSync as s}from"fs";import{IncomingMessage as t,ServerResponse as r}from"http";import{Socket as e}from"net";function i(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((W)=>W.trim()).filter((W)=>W.length>0).join(`
|
|
5
5
|
`).trim()}function N(J){return`
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ff as p,Qg as v,Vf as q,cf as a,eg as r,ff as c,fg as s,gf as e,gg as t,hf as f,hg as u,if as h,jf as i,kf as j,rf as k,sf as l,tf as m,uf as n,vf as o}from"../chunk-
|
|
2
|
+
import{Ff as p,Qg as v,Vf as q,cf as a,eg as r,ff as c,fg as s,gf as e,gg as t,hf as f,hg as u,if as h,jf as i,kf as j,rf as k,sf as l,tf as m,uf as n,vf as o}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import{Ni as d,Pi as g,ni as b}from"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import"../chunk-spmxhsze.js";import"../chunk-7bz43qbt.js";import"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import"../chunk-zyzhqnbm.js";import"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import"../chunk-cf5a958j.js";import"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import"../chunk-mpreff3t.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=307A15D5D73AADFA64756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as ha,Ae as F,Be as G,Ce as H,Rg as $,Sg as aa,Tg as ba,Wg as ca,Xg as da,Yg as ea,Zg as fa,_g as ga,af as I,ah as ia,bf as J,bh as ja,ch as ka,df as K,dh as la,ef as L,eh as ma,fh as na,gh as oa,hh as pa,ih as qa,jh as ra,kh as sa,le as q,lh as ta,me as r,ne as s,oe as t,pe as u,pg as _,qe as v,re as w,se as D,xe as E}from"../chunk-
|
|
2
|
+
import{$g as ha,Ae as F,Be as G,Ce as H,Rg as $,Sg as aa,Tg as ba,Wg as ca,Xg as da,Yg as ea,Zg as fa,_g as ga,af as I,ah as ia,bf as J,bh as ja,ch as ka,df as K,dh as la,ef as L,eh as ma,fh as na,gh as oa,hh as pa,ih as qa,jh as ra,kh as sa,le as q,lh as ta,me as r,ne as s,oe as t,pe as u,pg as _,qe as v,re as w,se as D,xe as E}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import{Ai as Q,Bi as R,Ci as S,Di as T,Ei as U,Fi as V,Gi as W,Ii as X,Ji as Y,Ki as Z,Lh as a,Mh as b,Nh as d,Sh as e,Th as f,Uh as g,Vh as h,Wh as i,Xh as j,ai as n,bi as o,gi as p,hi as x,ii as y,ji as z,ki as A,li as B,mi as C,wi as M,xi as N,yi as O,zi as P}from"../chunk-zenfs4e2.js";import{Xi as c}from"../chunk-q6rse2fh.js";import{aj as k,bj as l,cj as m}from"../chunk-spmxhsze.js";import"../chunk-7bz43qbt.js";import"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import"../chunk-zyzhqnbm.js";import"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import"../chunk-cf5a958j.js";import"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import"../chunk-mpreff3t.js";export{g as toRangeHeaderValue,s as toMiddlewareList,k as stateKey,Z as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,w as parseByteSize,ha as middlewareConfigDefaults,r as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,pa as defineResourcePolicy,ga as defineMiddlewareConfig,t as createUnsatisfiableResponse,u as createStreamResponse,K as createFileResponse,H as clientIp,X as classifyAddress,ba as authorizeChannel,L as ViewRouter,n as ValidationError,U as TooManyRedirectsError,S as TooLargeError,R as TimeoutError,qa as SitemapError,ra as Sitemap,J as SameSiteBounceMiddleware,Y as SafeResponse,M as SafeFetchError,I as SAME_SITE_BOUNCE_PARAM,sa as RobotsTxt,ta as Robots,oa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,G as RateLimitMiddleware,E as RateLimitExceededError,z as RangeNotSatisfiableError,ma as PoliciesServiceProvider,na as Policies,v as PayloadTooLargeError,A as NotFoundError,V as NetworkError,l as MissingRequestStateError,F as Middleware,ea as McpToolDeclaration,fa as McpRouter,da as McpRouteDeclaration,ca as McpModelParam,o as InvalidValidationRuleError,N as InvalidUrlError,y as InsufficientPermissionsError,W as HttpStatusError,q as HttpResponse,p as HttpRequest,B as FileNotFoundError,Q as DnsError,ka as CorsMiddleware,a as Controller,T as ContentTypeError,aa as ChannelRouter,$ as ChannelDeclaration,ja as CacheMiddleware,la as CSRFMiddleware,_ as BodyLimitMiddleware,O as BlockedHostError,P as BlockedAddressError,x as AuthorizationError,ia as AuthenticationMiddleware,C as AuthenticationError,D as ApiRouter};
|
|
3
3
|
|
|
4
4
|
//# debugId=D9832F0858F9B80564756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{da as T}from"../chunk-dezd1fn5.js";import"../chunk-mvd4mc8p.js";import{bb as D}from"../chunk-f25x1sn1.js";import{ie as b,je as w}from"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{ff as j}from"../chunk-
|
|
2
|
+
import{da as T}from"../chunk-dezd1fn5.js";import"../chunk-mvd4mc8p.js";import{bb as D}from"../chunk-f25x1sn1.js";import{ie as b,je as w}from"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{ff as j}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import"../chunk-spmxhsze.js";import"../chunk-7bz43qbt.js";import"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import"../chunk-zyzhqnbm.js";import"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import{bl as V,cl as X,dl as E,el as L,fl as R,gl as S}from"../chunk-cf5a958j.js";import"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import"../chunk-mpreff3t.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=8CF42B5D5E5E844064756E2164756E21
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** The sha-256 of the source this was built from, so a test can tell it is stale. */
|
|
2
|
-
export declare const STATIC_NAVIGATION_SOURCE_HASH = "
|
|
2
|
+
export declare const STATIC_NAVIGATION_SOURCE_HASH = "7150f8f2959c2cd5f5b6f784452c2aa520d7d06cbe52402b2de7bc85317ac3d6";
|
|
3
3
|
/**
|
|
4
4
|
* The navigation runtime (with the island loader) a static view with
|
|
5
5
|
* `.static({ navigation })` inlines. Byte-for-byte constant.
|
|
6
6
|
*/
|
|
7
|
-
export declare const STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var
|
|
7
|
+
export declare const STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var C=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:C.signal,...s}),q=i.__gemi_nav={d:()=>C.abort()},y=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},L=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},D=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")y(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>y(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),y(n,s)});for(let m of n.children)l.observe(m)}}},R='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts])\",T=A+\",link[rel=stylesheet]\",K=`head>${A},body>${A},link[rel=stylesheet]`,I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(R)?.content,O=(t)=>[...t.querySelectorAll(K)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],N=O(r),p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,k=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},M=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},v={},U=()=>Math.random().toString(36).slice(2),E=()=>a.state?.g||a.replaceState({...a.state,g:U()},\"\"),P=c(location),b=0,Y=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},j=(t)=>{let e=r.body,n=t.body,s=L(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(T))o.remove();for(let o of[...n.children])if(o.matches(T))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),D(e,s)},H=async(t,e)=>{let n=++b,s=!e&&v[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await k(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||O(d)!=N)throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:U()},\"\",o.href)}P=c(location),j(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)Y(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=M(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),E(),v[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==P){let t=v[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",E);h(i,\"scroll\",()=>a.state?.g&&(v[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,x=(t)=>{if(r.querySelector(R)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=M(t);if(e&&c(e)!=c(location))k(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>x(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",x);h(r,\"touchstart\",x,{passive:!0});E();D(r,L(r));_(!0);";
|
|
8
8
|
//# sourceMappingURL=staticNavigationRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticNavigationRuntime.d.ts","sourceRoot":"","sources":["../../internal/staticNavigationRuntime.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,qEAAqE,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"staticNavigationRuntime.d.ts","sourceRoot":"","sources":["../../internal/staticNavigationRuntime.ts"],"names":[],"mappings":"AAIA,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,qEAAqE,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,60KACuyK,CAAC"}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fa as E}from"../chunk-7dhvb6nn.js";import{ab as p}from"../chunk-6tferehw.js";import{bb as H}from"../chunk-f25x1sn1.js";import{Cb as L,Db as Q,Eb as T,Ib as U,Jb as y,Kb as F,Lb as C,Ob as D,Pb as I,Sb as b,Vb as f,Wb as k,Xb as m,ob as g,pb as W,qb as _,rb as l,sb as P,tb as u,ub as $,vb as V,wb as q,xb as B,yb as K}from"../chunk-
|
|
2
|
+
import{Fa as E}from"../chunk-7dhvb6nn.js";import{ab as p}from"../chunk-6tferehw.js";import{bb as H}from"../chunk-f25x1sn1.js";import{Cb as L,Db as Q,Eb as T,Ib as U,Jb as y,Kb as F,Lb as C,Ob as D,Pb as I,Sb as b,Vb as f,Wb as k,Xb as m,ob as g,pb as W,qb as _,rb as l,sb as P,tb as u,ub as $,vb as V,wb as q,xb as B,yb as K}from"../chunk-2c2n3v4k.js";import"../chunk-a1r1r1z7.js";import"../chunk-xmjzyzn6.js";import"../chunk-bm3pyh9m.js";import{ce as h}from"../chunk-87nekrjj.js";import"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{$e as v,Gg as w,He as a,Ie as d,Kg as A,Og as R,_e as n}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import"../chunk-spmxhsze.js";import"../chunk-7bz43qbt.js";import{qj as M}from"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import"../chunk-zyzhqnbm.js";import"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import"../chunk-96r16t57.js";import"../chunk-cf5a958j.js";import{hl as O,jl as z}from"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import"../chunk-mpreff3t.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new z;boot(){if(this.models.length>0)p(...this.models);else s();this.app.config.merge(this.config),z.setInstance(this.app),this.app.registerMany([...N,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let G of this.services){let J=typeof G==="function"?new G:G,x=J.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(Z,J),this.serviceInstances.push(J),this.serviceTokens.add(x.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),l(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),z.getInstance()===this.app)z.setInstance(void 0);O.disable()}}function s(){if(Bun.env.NODE_ENV==="production")return;let j=M();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Da as f}from"../chunk-s0z61m9j.js";import{Ea as S}from"../chunk-6daabbfj.js";import{tl as Q,vl as Z,wl as P,xl as y,yl as U,zl as A}from"../chunk-m906xc76.js";import{Dl as H}from"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import{Ll as F}from"../chunk-mpreff3t.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new S({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=U(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)A(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-
|
|
2
|
+
import{Da as f}from"../chunk-s0z61m9j.js";import{Ea as S}from"../chunk-6daabbfj.js";import{tl as Q,vl as Z,wl as P,xl as y,yl as U,zl as A}from"../chunk-m906xc76.js";import{Dl as H}from"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import{Ll as F}from"../chunk-mpreff3t.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new S({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=U(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)A(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-tckf3g8x.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-vvwhk2sb.js"),K=new Y(this.app);this.server=await J(this.app,K.track(I)),N(K)}return this.server}stop(z={}){let B=this.app.sockets();return this.stopping??=P({server:this.server,closeSockets:B?()=>B.shutdown():void 0,shutdownProviders:(I)=>this.app.shutdown(I),settings:{...this.settings??Z(),...z}}),this.stopping}}export{W as liveness,Q as isShuttingDown,k as Server};
|
|
3
3
|
|
|
4
4
|
//# debugId=09C27F7F5D6A52C164756E2164756E21
|
package/dist/services/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{db as _9}from"../chunk-8m9kgynj.js";import{Ab as $9,Bb as J9,Cb as Q9,Db as Y9,Eb as K9,Fb as y4,Gb as O6,Hb as w,Ib as z9,Jb as G9,Kb as X9,Lb as B9,Mb as j9,Nb as F9,Ob as M9,Pb as L9,Qb as N9,Rb as D9,Sb as H9,Tb as U9,Ub as x9,Vb as O9,Wb as S9,Xb as R9,eb as RZ,fb as _Z,gb as kZ,hb as fZ,ib as CZ,jb as w4,kb as VZ,lb as V4,mb as T4,nb as g1,ob as TZ,pb as PZ,qb as iZ,ub as sZ,vb as oZ,wb as aZ,xb as tZ,yb as W9,zb as Z9}from"../chunk-e38xa29v.js";import{_b as v4}from"../chunk-a1r1r1z7.js";import{Ad as qZ,Bd as vZ,Cd as IZ,Dd as AZ,Ed as hZ,Fd as gZ,Gd as EZ,Hd as mZ,Id as cZ,Jd as uZ,Kd as pZ,Ld as dZ,Md as lZ,Nd as nZ,yd as bZ,zd as wZ}from"../chunk-xmjzyzn6.js";import{Od as yZ}from"../chunk-bm3pyh9m.js";import{$d as HZ,Pd as YZ,Qd as KZ,Rd as zZ,Sd as GZ,Td as XZ,Ud as BZ,Vd as jZ,Wd as FZ,Xd as MZ,Yd as LZ,Zd as NZ,_d as DZ,ae as UZ,be as xZ,ce as OZ,he as SZ}from"../chunk-87nekrjj.js";import{ie as rZ,je as eZ}from"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{$f as q8,$g as e8,Af as F8,Bf as M8,Ce as M6,Cf as L8,De as H4,Df as N8,Ee as r0,Ef as D8,Fe as U4,Ge as x4,Gf as H8,Gg as a8,Hf as x6,If as U8,Ke as k5,Kg as t8,Le as f5,Me as C5,Mf as x8,Ne as V5,Nf as O8,Oe as T5,Of as R8,Og as A4,Pe as P5,Pg as E1,Qe as b5,Re as w5,Rf as _8,Se as q5,Sf as k8,Te as l0,Tf as f8,Ue as v5,Uf as C8,Ve as I5,We as y5,Wf as V8,Xe as A5,Xf as T8,Ye as h5,Yf as P8,Zf as b8,_f as w8,_g as r8,ag as v8,bg as I8,cg as y8,dg as A8,ig as U,jg as m,kg as h8,lf as l5,lg as g8,mf as n5,mg as E8,nf as i5,ng as m8,of as s5,og as c8,pf as o5,qf as a5,qg as u8,rg as p8,sg as d8,te as F6,tg as l8,ue as O5,ug as n8,ve as S5,we as R5,wf as G8,xf as X8,xg as i8,ye as _5,yf as B8,yg as s8,zf as j8,zg as o8}from"../chunk-0rkastve.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import{Hi as jW,Ii as FW,Li as u5,Mi as p5,Oi as d5,Qi as I1,Th as D4,Uh as M4,Vh as D1,gi as C4,ji as $1,li as a,pi as L4,qi as H1,ri as v1,si as g5,ti as E5,ui as m5,vi as c5}from"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import{_i as V}from"../chunk-spmxhsze.js";import{gj as J8,hj as Q8,ij as w1,jj as Y8,kj as m0,lj as K8,mj as z8}from"../chunk-7bz43qbt.js";import{sj as W8,tj as Z8,uj as $8}from"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import{bk as S8}from"../chunk-zyzhqnbm.js";import{dk as t5,ek as r5,fk as e5}from"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import{Xk as WZ,Yk as ZZ,Zk as $Z,_k as JZ,al as QZ}from"../chunk-96r16t57.js";import"../chunk-cf5a958j.js";import{kl as C}from"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import{Ll as i0}from"../chunk-mpreff3t.js";import{Buffer as n0}from"buffer";class s0 extends H1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-xjb2kzkj.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 n0?$:$ instanceof Blob||$ instanceof File?n0.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.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((z)=>({name:z.Key,size:z.Size??0,lastModified:z.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={}){L4(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 G=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.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}),z=v1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{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(),z;try{z=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?M4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new $1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let G=D1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.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 o0}from"buffer";import{Readable as NW}from"stream";function N4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function DW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class a0 extends H1{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 o0?$:o0.from(await $.arrayBuffer()),z=await this.blob(Q,Y);return Z?.throwIfAborted(),await z.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,z,G=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&G){let S=await this.size({name:$,bucket:J}),o=D4(Q,S);if(!o)throw new $1(S);K=o.start,z=o.length}else if(Q?.kind==="offset")K=Q.start,z=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,z,Z?{abortSignal:Z}:void 0)}catch(S){if(DW(S))throw new $1(await this.size({name:$,bucket:J}));if(N4(S))throw new a($);throw S}let B=D1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await HW(X);if(H instanceof ReadableStream)H=v1(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(N4(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(N4(Q))return;throw Q}}}async function HW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return NW.toWeb(W.readableStreamBody);return null}function UW(W){return W}class O4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class y1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var t0=1000,xW=60000,OW=`
|
|
2
|
+
import{db as _9}from"../chunk-8m9kgynj.js";import{Ab as $9,Bb as J9,Cb as Q9,Db as Y9,Eb as K9,Fb as y4,Gb as O6,Hb as w,Ib as z9,Jb as G9,Kb as X9,Lb as B9,Mb as j9,Nb as F9,Ob as M9,Pb as L9,Qb as N9,Rb as D9,Sb as H9,Tb as U9,Ub as x9,Vb as O9,Wb as S9,Xb as R9,eb as RZ,fb as _Z,gb as kZ,hb as fZ,ib as CZ,jb as w4,kb as VZ,lb as V4,mb as T4,nb as g1,ob as TZ,pb as PZ,qb as iZ,ub as sZ,vb as oZ,wb as aZ,xb as tZ,yb as W9,zb as Z9}from"../chunk-2c2n3v4k.js";import{_b as v4}from"../chunk-a1r1r1z7.js";import{Ad as qZ,Bd as vZ,Cd as IZ,Dd as AZ,Ed as hZ,Fd as gZ,Gd as EZ,Hd as mZ,Id as cZ,Jd as uZ,Kd as pZ,Ld as dZ,Md as lZ,Nd as nZ,yd as bZ,zd as wZ}from"../chunk-xmjzyzn6.js";import{Od as yZ}from"../chunk-bm3pyh9m.js";import{$d as HZ,Pd as YZ,Qd as KZ,Rd as zZ,Sd as GZ,Td as XZ,Ud as BZ,Vd as jZ,Wd as FZ,Xd as MZ,Yd as LZ,Zd as NZ,_d as DZ,ae as UZ,be as xZ,ce as OZ,he as SZ}from"../chunk-87nekrjj.js";import{ie as rZ,je as eZ}from"../chunk-6d3527qt.js";import"../chunk-q19cs1qf.js";import{$f as q8,$g as e8,Af as F8,Bf as M8,Ce as M6,Cf as L8,De as H4,Df as N8,Ee as r0,Ef as D8,Fe as U4,Ge as x4,Gf as H8,Gg as a8,Hf as x6,If as U8,Ke as k5,Kg as t8,Le as f5,Me as C5,Mf as x8,Ne as V5,Nf as O8,Oe as T5,Of as R8,Og as A4,Pe as P5,Pg as E1,Qe as b5,Re as w5,Rf as _8,Se as q5,Sf as k8,Te as l0,Tf as f8,Ue as v5,Uf as C8,Ve as I5,We as y5,Wf as V8,Xe as A5,Xf as T8,Ye as h5,Yf as P8,Zf as b8,_f as w8,_g as r8,ag as v8,bg as I8,cg as y8,dg as A8,ig as U,jg as m,kg as h8,lf as l5,lg as g8,mf as n5,mg as E8,nf as i5,ng as m8,of as s5,og as c8,pf as o5,qf as a5,qg as u8,rg as p8,sg as d8,te as F6,tg as l8,ue as O5,ug as n8,ve as S5,we as R5,wf as G8,xf as X8,xg as i8,ye as _5,yf as B8,yg as s8,zf as j8,zg as o8}from"../chunk-5y6e8kpe.js";import"../chunk-2qac05gb.js";import"../chunk-3derdn99.js";import{Hi as jW,Ii as FW,Li as u5,Mi as p5,Oi as d5,Qi as I1,Th as D4,Uh as M4,Vh as D1,gi as C4,ji as $1,li as a,pi as L4,qi as H1,ri as v1,si as g5,ti as E5,ui as m5,vi as c5}from"../chunk-zenfs4e2.js";import"../chunk-q6rse2fh.js";import{_i as V}from"../chunk-spmxhsze.js";import{gj as J8,hj as Q8,ij as w1,jj as Y8,kj as m0,lj as K8,mj as z8}from"../chunk-7bz43qbt.js";import{sj as W8,tj as Z8,uj as $8}from"../chunk-a1414jdv.js";import"../chunk-vhyabcw9.js";import{bk as S8}from"../chunk-zyzhqnbm.js";import{dk as t5,ek as r5,fk as e5}from"../chunk-vv8vjjez.js";import"../chunk-ecv4mtgh.js";import"../chunk-wtdmwmm7.js";import"../chunk-7gnspwra.js";import"../chunk-yx03gndz.js";import{Xk as WZ,Yk as ZZ,Zk as $Z,_k as JZ,al as QZ}from"../chunk-96r16t57.js";import"../chunk-cf5a958j.js";import{kl as C}from"../chunk-nadkwh8a.js";import"../chunk-krgwft9w.js";import"../chunk-z2k8m02z.js";import"../chunk-m906xc76.js";import"../chunk-rdnxkecg.js";import"../chunk-0ahecas6.js";import{Ll as i0}from"../chunk-mpreff3t.js";import{Buffer as n0}from"buffer";class s0 extends H1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-xjb2kzkj.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 n0?$:$ instanceof Blob||$ instanceof File?n0.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.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((z)=>({name:z.Key,size:z.Size??0,lastModified:z.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={}){L4(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 G=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.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}),z=v1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{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(),z;try{z=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?M4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new $1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let G=D1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.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 o0}from"buffer";import{Readable as NW}from"stream";function N4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function DW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class a0 extends H1{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 o0?$:o0.from(await $.arrayBuffer()),z=await this.blob(Q,Y);return Z?.throwIfAborted(),await z.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,z,G=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&G){let S=await this.size({name:$,bucket:J}),o=D4(Q,S);if(!o)throw new $1(S);K=o.start,z=o.length}else if(Q?.kind==="offset")K=Q.start,z=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,z,Z?{abortSignal:Z}:void 0)}catch(S){if(DW(S))throw new $1(await this.size({name:$,bucket:J}));if(N4(S))throw new a($);throw S}let B=D1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await HW(X);if(H instanceof ReadableStream)H=v1(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(N4(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(N4(Q))return;throw Q}}}async function HW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return NW.toWeb(W.readableStreamBody);return null}function UW(W){return W}class O4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class y1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var t0=1000,xW=60000,OW=`
|
|
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
|
@@ -597,7 +597,7 @@ var ISLAND_HYDRATE_SOURCE = `function h(marker, Component) {
|
|
|
597
597
|
* The navigation runtime (with the island loader) a static view with
|
|
598
598
|
* `.static({ navigation })` inlines. Byte-for-byte constant.
|
|
599
599
|
*/
|
|
600
|
-
var STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var
|
|
600
|
+
var STATIC_NAVIGATION_SOURCE = "var r=document,i=window,a=history;i.__gemi_nav?.d();var C=new AbortController,h=(t,e,n,s)=>t.addEventListener(e,n,{signal:C.signal,...s}),q=i.__gemi_nav={d:()=>C.abort()},y=(t,e)=>{if(!t.g)t.g=1,import(e.s).then((n)=>{if(t.isConnected)t.r=n.h(t,n.m[e.e])}).catch((n)=>console.error(n))},L=(t)=>{let e=t.getElementById(\"gemi-islands\");return e?JSON.parse(e.textContent):{i:[]}},D=(t,e)=>{for(let n of t.querySelectorAll(\"gemi-island\")){let s=e.i[n.dataset.island];if(!s||n.o)continue;if(s.l==\"eager\")y(n,s);else if(s.l==\"idle\"||!i.IntersectionObserver||!n.children.length)(i.requestIdleCallback||setTimeout)(()=>y(n,s));else{let l=new IntersectionObserver((m)=>{if(m.some((d)=>d.isIntersecting))l.disconnect(),y(n,s)});for(let m of n.children)l.observe(m)}}},R='meta[name=\"gemi-static\"]',A=\"style:not([data-gemi-fonts])\",T=A+\",link[rel=stylesheet]\",K=`head>${A},body>${A},link[rel=stylesheet]`,I='meta[name]:not([name=viewport]),meta[property],link[rel~=canonical],link[rel~=alternate],link[rel~=icon],link[rel=preload][as=font],style[data-gemi-fonts],script[type=\"application/ld+json\"]',w=(t)=>t.querySelector(R)?.content,O=(t)=>[...t.querySelectorAll(K)].map((e)=>e.outerHTML).join(),c=(t)=>t.href.split(\"#\")[0],N=O(r),p=r.createElement(\"div\");p.setAttribute(\"aria-live\",\"polite\");p.style.cssText=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap\";r.body.append(p);var _=(t)=>{q.p={url:location.href,title:r.title,initial:t},r.dispatchEvent(new CustomEvent(\"gemi:page-load\",{detail:q.p}))},f=new Map,k=(t)=>{let e=f.get(t);if(!e||Date.now()-e[0]>30000){let n=fetch(t,{headers:{accept:\"text/html\",\"x-gemi-navigate\":\"1\"},signal:AbortSignal.timeout(1e4)}).then((s)=>{if(!s.ok||!/^text\\/html/.test(s.headers.get(\"content-type\"))||new URL(s.url||t).origin!=location.origin)throw s;return s.text().then((l)=>[s.url||t,l])});e=[Date.now(),n],n.catch(()=>f.get(t)==e&&f.delete(t))}if(f.delete(t),f.set(t,e),f.size>10)f.delete(f.keys().next().value);return e[1]},M=(t)=>{let e=t.target.closest?.(\"a[href]\"),n=e?.getAttribute(\"target\");if(!e||n&&n!=\"_self\"||e.hasAttribute(\"download\")||/(^|\\s)external(\\s|$)/i.test(e.getAttribute(\"rel\"))||e.closest(\"[data-gemi-reload]\"))return;let s=new URL(e.getAttribute(\"href\"),r.baseURI);if(s.origin==location.origin&&!(s.href.includes(\"#\")&&c(s)==c(location)))return s},v={},U=()=>Math.random().toString(36).slice(2),E=()=>a.state?.g||a.replaceState({...a.state,g:U()},\"\"),P=c(location),b=0,Y=(t)=>{if(!t.hasAttribute(\"tabindex\"))t.setAttribute(\"tabindex\",\"-1\"),t.addEventListener(\"blur\",()=>t.removeAttribute(\"tabindex\"),{once:!0});t.focus({preventScroll:!0})},j=(t)=>{let e=r.body,n=t.body,s=L(t),l=r.documentElement;r.title=t.title;for(let o of[\"lang\",\"dir\"]){let u=t.documentElement.getAttribute(o);if(u==null)l.removeAttribute(o);else l.setAttribute(o,u)}for(let o of r.head.querySelectorAll(I))o.remove();let m=new Set([...r.querySelectorAll(\"link[rel=modulepreload]\")].map((o)=>o.getAttribute(\"href\")));r.head.append(...t.head.querySelectorAll(I),...[...t.head.querySelectorAll(\"link[rel=modulepreload]\")].filter((o)=>!m.has(o.getAttribute(\"href\"))));let d=new Map([...e.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o.dataset.gemiPersist,o])),g=[...n.querySelectorAll(\"[data-gemi-persist]\")].map((o)=>[o,d.get(o.dataset.gemiPersist)]).filter((o)=>o[1]);for(let o of[...e.querySelectorAll(\"gemi-island\")].reverse())if(o.o=1,!g.some((u)=>u[1].contains(o)))try{o.r?.unmount()}catch(u){console.error(u)}for(let[o,u]of g)o.replaceWith(u);for(let o of[...e.childNodes])if(!o.matches?.(T))o.remove();for(let o of[...n.children])if(o.matches(T))o.remove();for(let o of[...e.attributes])e.removeAttribute(o.name);for(let o of n.attributes)e.setAttribute(o.name,o.value);e.append(...n.childNodes,p),D(e,s)},H=async(t,e)=>{let n=++b,s=!e&&v[a.state?.g];a.scrollRestoration=\"manual\";try{let[l,m]=await k(c(t));if(n!=b)return;let d=new DOMParser().parseFromString(m,\"text/html\");if(w(d)==null||w(d)!=w(r)||O(d)!=N)throw 0;if(e){let o=new URL(l);o.hash=t.hash,a.pushState({g:U()},\"\",o.href)}P=c(location),j(d);let g=e&&t.hash&&r.getElementById(decodeURIComponent(t.hash.slice(1)));if(g)g.scrollIntoView({behavior:\"instant\"});else i.scrollTo({left:s?.[0]||0,top:s?.[1]||0,behavior:\"instant\"});if(e)Y(g||r.querySelector(\"h1\")||r.querySelector(\"main\")||r.body);p.textContent=r.title,_(!1)}catch{if(n!=b)return;if(e)location.assign(t.href);else location.reload()}};h(r,\"click\",(t)=>{if(t.defaultPrevented||t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let e=M(t);if(e&&r.dispatchEvent(new CustomEvent(\"gemi:before-navigate\",{cancelable:!0,detail:{url:e.href}})))t.preventDefault(),E(),v[a.state.g]=[i.scrollX,i.scrollY],H(e,1)});h(i,\"popstate\",()=>{if(b++,c(location)==P){let t=v[a.state?.g];if(t)i.scrollTo({left:t[0],top:t[1],behavior:\"instant\"})}else if(a.state?.g)H(new URL(location.href),0);else location.reload()});h(i,\"hashchange\",E);h(i,\"scroll\",()=>a.state?.g&&(v[a.state.g]=[i.scrollX,i.scrollY]),{passive:!0});var S,x=(t)=>{if(r.querySelector(R)?.dataset.prefetch==\"none\"||navigator.connection?.saveData)return;let e=M(t);if(e&&c(e)!=c(location))k(c(e))};h(r,\"pointerover\",(t)=>{clearTimeout(S),S=setTimeout(()=>x(t),65)});h(r,\"pointerout\",()=>clearTimeout(S));h(r,\"focusin\",x);h(r,\"touchstart\",x,{passive:!0});E();D(r,L(r));_(!0);";
|
|
601
601
|
//#endregion
|
|
602
602
|
//#region testing/staticDocument.ts
|
|
603
603
|
var hydrate = new Function("createElement", "hydrateRoot", `${ISLAND_HYDRATE_SOURCE};return h;`)(createElement, hydrateRoot);
|