gemi 0.139.0 → 0.140.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/ai/FallbackProvider.d.ts.map +1 -1
- package/dist/ai/index.js +21 -21
- package/dist/ai/index.js.map +5 -5
- package/dist/ai/providers/call.d.ts +21 -1
- package/dist/ai/providers/call.d.ts.map +1 -1
- package/dist/ai/providers/http.d.ts +13 -0
- package/dist/ai/providers/http.d.ts.map +1 -1
- package/dist/ai/runtime.d.ts +10 -1
- package/dist/ai/runtime.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-qvx8473q.js → chunk-0c553zfq.js} +3 -3
- package/dist/{chunk-qvx8473q.js.map → chunk-0c553zfq.js.map} +1 -1
- package/dist/{chunk-78zfqt54.js → chunk-18y8n1r3.js} +2 -2
- package/dist/{chunk-78zfqt54.js.map → chunk-18y8n1r3.js.map} +1 -1
- package/dist/{chunk-a2fhbstt.js → chunk-1cdz01em.js} +3 -3
- package/dist/{chunk-a2fhbstt.js.map → chunk-1cdz01em.js.map} +1 -1
- package/dist/{chunk-fwmmy0jn.js → chunk-1fe07ge4.js} +1 -1
- package/dist/{chunk-y6gr3stt.js → chunk-23mcs80p.js} +3 -3
- package/dist/{chunk-y6gr3stt.js.map → chunk-23mcs80p.js.map} +1 -1
- package/dist/{chunk-bg0e39dk.js → chunk-3v4esxbd.js} +2 -2
- package/dist/{chunk-bg0e39dk.js.map → chunk-3v4esxbd.js.map} +1 -1
- package/dist/{chunk-ted0qjps.js → chunk-3wpxqcw7.js} +1 -1
- package/dist/{chunk-5benn2ys.js → chunk-5013raxj.js} +3 -3
- package/dist/{chunk-5benn2ys.js.map → chunk-5013raxj.js.map} +1 -1
- package/dist/{chunk-f9w78tbd.js → chunk-5aj27bgc.js} +2 -2
- package/dist/{chunk-f9w78tbd.js.map → chunk-5aj27bgc.js.map} +1 -1
- package/dist/chunk-5gkzbhts.js +5 -0
- package/dist/{chunk-fs4ntgdr.js.map → chunk-5gkzbhts.js.map} +1 -1
- package/dist/{chunk-qk6vmvr2.js → chunk-6d9f4vw0.js} +4 -4
- package/dist/{chunk-qk6vmvr2.js.map → chunk-6d9f4vw0.js.map} +1 -1
- package/dist/{chunk-skmdmqv7.js → chunk-6hs102jh.js} +2 -2
- package/dist/{chunk-skmdmqv7.js.map → chunk-6hs102jh.js.map} +1 -1
- package/dist/{chunk-zvzvgrrn.js → chunk-6jd0e1dz.js} +2 -2
- package/dist/{chunk-zvzvgrrn.js.map → chunk-6jd0e1dz.js.map} +1 -1
- package/dist/{chunk-kpb8xvrv.js → chunk-6qydm38w.js} +2 -2
- package/dist/{chunk-kpb8xvrv.js.map → chunk-6qydm38w.js.map} +1 -1
- package/dist/{chunk-85k70cme.js → chunk-6zz3kez5.js} +3 -3
- package/dist/{chunk-85k70cme.js.map → chunk-6zz3kez5.js.map} +1 -1
- package/dist/{chunk-y4mnxgdt.js → chunk-7dwgex81.js} +5 -5
- package/dist/{chunk-y4mnxgdt.js.map → chunk-7dwgex81.js.map} +3 -3
- package/dist/{chunk-yhp70t40.js → chunk-7hdfbp2x.js} +2 -2
- package/dist/{chunk-yhp70t40.js.map → chunk-7hdfbp2x.js.map} +1 -1
- package/dist/{chunk-vz5rrcnh.js → chunk-7p64zc6a.js} +2 -2
- package/dist/{chunk-vz5rrcnh.js.map → chunk-7p64zc6a.js.map} +1 -1
- package/dist/{chunk-nbfksexg.js → chunk-8gfgsmxk.js} +2 -2
- package/dist/{chunk-nbfksexg.js.map → chunk-8gfgsmxk.js.map} +1 -1
- package/dist/{chunk-c6c7p43e.js → chunk-8r9kna46.js} +2 -2
- package/dist/{chunk-c6c7p43e.js.map → chunk-8r9kna46.js.map} +1 -1
- package/dist/{chunk-7d26eqv1.js → chunk-98dxtkbt.js} +2 -2
- package/dist/{chunk-7d26eqv1.js.map → chunk-98dxtkbt.js.map} +1 -1
- package/dist/{chunk-n7576zsr.js → chunk-9b4ypfcw.js} +3 -3
- package/dist/{chunk-n7576zsr.js.map → chunk-9b4ypfcw.js.map} +1 -1
- package/dist/{chunk-aj2sr77y.js → chunk-9yfg4nqq.js} +2 -2
- package/dist/{chunk-aj2sr77y.js.map → chunk-9yfg4nqq.js.map} +1 -1
- package/dist/{chunk-c83e4ghx.js → chunk-apfk702c.js} +2 -2
- package/dist/{chunk-c83e4ghx.js.map → chunk-apfk702c.js.map} +1 -1
- package/dist/{chunk-7t7jh8t2.js → chunk-b3tmkge9.js} +2 -2
- package/dist/{chunk-7t7jh8t2.js.map → chunk-b3tmkge9.js.map} +1 -1
- package/dist/{chunk-6qzyq0g5.js → chunk-b4qh3ywd.js} +2 -2
- package/dist/{chunk-6qzyq0g5.js.map → chunk-b4qh3ywd.js.map} +1 -1
- package/dist/{chunk-d368es1y.js → chunk-b9d021hx.js} +2 -2
- package/dist/{chunk-d368es1y.js.map → chunk-b9d021hx.js.map} +1 -1
- package/dist/{chunk-46bwknb5.js → chunk-c7ecv545.js} +3 -3
- package/dist/{chunk-46bwknb5.js.map → chunk-c7ecv545.js.map} +1 -1
- package/dist/{chunk-wbvb1hcx.js → chunk-ct3sgfpj.js} +2 -2
- package/dist/{chunk-wbvb1hcx.js.map → chunk-ct3sgfpj.js.map} +1 -1
- package/dist/{chunk-965gfa41.js → chunk-d0kw04ym.js} +2 -2
- package/dist/{chunk-965gfa41.js.map → chunk-d0kw04ym.js.map} +1 -1
- package/dist/{chunk-vmr4d6hc.js → chunk-d1whcvyn.js} +1 -1
- package/dist/{chunk-zbdgwgfv.js → chunk-d7a092vd.js} +2 -2
- package/dist/{chunk-zbdgwgfv.js.map → chunk-d7a092vd.js.map} +1 -1
- package/dist/{chunk-p1y58p84.js → chunk-dje31gme.js} +2 -2
- package/dist/{chunk-p1y58p84.js.map → chunk-dje31gme.js.map} +1 -1
- package/dist/{chunk-3jkem5gq.js → chunk-dptp6ceg.js} +2 -2
- package/dist/{chunk-3jkem5gq.js.map → chunk-dptp6ceg.js.map} +1 -1
- package/dist/{chunk-an1nja68.js → chunk-dvwdehnp.js} +2 -2
- package/dist/{chunk-an1nja68.js.map → chunk-dvwdehnp.js.map} +1 -1
- package/dist/{chunk-v4dp93qv.js → chunk-dzvp8ynr.js} +3 -3
- package/dist/{chunk-v4dp93qv.js.map → chunk-dzvp8ynr.js.map} +1 -1
- package/dist/{chunk-d492ae5e.js → chunk-e3y72vzw.js} +2 -2
- package/dist/{chunk-d492ae5e.js.map → chunk-e3y72vzw.js.map} +1 -1
- package/dist/{chunk-9s203ks3.js → chunk-e9eh5k8a.js} +2 -2
- package/dist/{chunk-9s203ks3.js.map → chunk-e9eh5k8a.js.map} +1 -1
- package/dist/{chunk-pv2mtg8n.js → chunk-e9xbdgb2.js} +2 -2
- package/dist/{chunk-pv2mtg8n.js.map → chunk-e9xbdgb2.js.map} +1 -1
- package/dist/{chunk-md6wfc1h.js → chunk-eve0hewa.js} +3 -3
- package/dist/{chunk-md6wfc1h.js.map → chunk-eve0hewa.js.map} +1 -1
- package/dist/{chunk-kzdkpz04.js → chunk-eydahc2f.js} +1 -1
- package/dist/{chunk-z969a4nt.js → chunk-eyqsvzej.js} +2 -2
- package/dist/{chunk-z969a4nt.js.map → chunk-eyqsvzej.js.map} +1 -1
- package/dist/{chunk-cedmppcy.js → chunk-gp4s95kn.js} +2 -2
- package/dist/{chunk-cedmppcy.js.map → chunk-gp4s95kn.js.map} +1 -1
- package/dist/{chunk-63m8s40k.js → chunk-gx202f9t.js} +2 -2
- package/dist/{chunk-63m8s40k.js.map → chunk-gx202f9t.js.map} +1 -1
- package/dist/{chunk-ant9ck0r.js → chunk-gy307m19.js} +2 -2
- package/dist/{chunk-ant9ck0r.js.map → chunk-gy307m19.js.map} +1 -1
- package/dist/{chunk-h0ydk8cc.js → chunk-j9hf1jyd.js} +2 -2
- package/dist/{chunk-h0ydk8cc.js.map → chunk-j9hf1jyd.js.map} +1 -1
- package/dist/{chunk-7vxeqxxr.js → chunk-jrvg80jw.js} +2 -2
- package/dist/{chunk-7vxeqxxr.js.map → chunk-jrvg80jw.js.map} +1 -1
- package/dist/{chunk-8dmhbj4m.js → chunk-k732d7x5.js} +2 -2
- package/dist/{chunk-8dmhbj4m.js.map → chunk-k732d7x5.js.map} +1 -1
- package/dist/{chunk-4jc7wbet.js → chunk-kc2z9z3m.js} +2 -2
- package/dist/{chunk-4jc7wbet.js.map → chunk-kc2z9z3m.js.map} +1 -1
- package/dist/{chunk-xwmy6fby.js → chunk-kddgfct7.js} +3 -3
- package/dist/{chunk-xwmy6fby.js.map → chunk-kddgfct7.js.map} +1 -1
- package/dist/{chunk-qfhcec6q.js → chunk-ks7msv3e.js} +2 -2
- package/dist/{chunk-qfhcec6q.js.map → chunk-ks7msv3e.js.map} +1 -1
- package/dist/{chunk-9wc53ywv.js → chunk-me6mmvbq.js} +2 -2
- package/dist/{chunk-9wc53ywv.js.map → chunk-me6mmvbq.js.map} +1 -1
- package/dist/{chunk-c0m8pcbd.js → chunk-mj55jdwp.js} +1 -1
- package/dist/{chunk-z76te7x6.js → chunk-mxqnrn1k.js} +2 -2
- package/dist/{chunk-z76te7x6.js.map → chunk-mxqnrn1k.js.map} +1 -1
- package/dist/{chunk-n1n7qb34.js → chunk-ny01tp0y.js} +4 -4
- package/dist/{chunk-n1n7qb34.js.map → chunk-ny01tp0y.js.map} +1 -1
- package/dist/{chunk-8ef5c93d.js → chunk-p131vmpy.js} +2 -2
- package/dist/{chunk-8ef5c93d.js.map → chunk-p131vmpy.js.map} +1 -1
- package/dist/{chunk-g22q8j2s.js → chunk-pfgbkhmm.js} +2 -2
- package/dist/{chunk-g22q8j2s.js.map → chunk-pfgbkhmm.js.map} +1 -1
- package/dist/{chunk-n2czjpz9.js → chunk-pxavt1j3.js} +2 -2
- package/dist/{chunk-n2czjpz9.js.map → chunk-pxavt1j3.js.map} +1 -1
- package/dist/{chunk-jys3n8xv.js → chunk-qdz4dqbf.js} +3 -3
- package/dist/{chunk-jys3n8xv.js.map → chunk-qdz4dqbf.js.map} +1 -1
- package/dist/{chunk-gqcmnyc8.js → chunk-qvtmn7mn.js} +2 -2
- package/dist/{chunk-gqcmnyc8.js.map → chunk-qvtmn7mn.js.map} +1 -1
- package/dist/{chunk-gq4fr0zn.js → chunk-r1x5ms0y.js} +3 -3
- package/dist/{chunk-gq4fr0zn.js.map → chunk-r1x5ms0y.js.map} +1 -1
- package/dist/{chunk-w17p2k8g.js → chunk-r6thf4ge.js} +3 -3
- package/dist/{chunk-w17p2k8g.js.map → chunk-r6thf4ge.js.map} +1 -1
- package/dist/{chunk-z0jazehw.js → chunk-rw4z3n9b.js} +2 -2
- package/dist/{chunk-z0jazehw.js.map → chunk-rw4z3n9b.js.map} +1 -1
- package/dist/{chunk-e440f645.js → chunk-rwrcsfzv.js} +2 -2
- package/dist/{chunk-e440f645.js.map → chunk-rwrcsfzv.js.map} +1 -1
- package/dist/{chunk-27xv8kty.js → chunk-s58hbczk.js} +2 -2
- package/dist/{chunk-27xv8kty.js.map → chunk-s58hbczk.js.map} +1 -1
- package/dist/{chunk-8p4t8x9c.js → chunk-t6n490ha.js} +2 -2
- package/dist/{chunk-8p4t8x9c.js.map → chunk-t6n490ha.js.map} +1 -1
- package/dist/{chunk-80fjsb26.js → chunk-t7qp951h.js} +3 -3
- package/dist/{chunk-80fjsb26.js.map → chunk-t7qp951h.js.map} +1 -1
- package/dist/{chunk-038xtqpm.js → chunk-tbhtx2t0.js} +2 -2
- package/dist/{chunk-chyt9th4.js.map → chunk-tbhtx2t0.js.map} +1 -1
- package/dist/{chunk-974p7em0.js → chunk-tghh8r2q.js} +2 -2
- package/dist/{chunk-974p7em0.js.map → chunk-tghh8r2q.js.map} +1 -1
- package/dist/{chunk-p2c7z2nr.js → chunk-v2cv3wcw.js} +2 -2
- package/dist/{chunk-p2c7z2nr.js.map → chunk-v2cv3wcw.js.map} +1 -1
- package/dist/{chunk-rqb52m93.js → chunk-vp4x2c0k.js} +2 -2
- package/dist/{chunk-rqb52m93.js.map → chunk-vp4x2c0k.js.map} +1 -1
- package/dist/{chunk-chyt9th4.js → chunk-vtqvq9ca.js} +2 -2
- package/dist/{chunk-038xtqpm.js.map → chunk-vtqvq9ca.js.map} +1 -1
- package/dist/{chunk-eqzxvfvt.js → chunk-x4g0r9d3.js} +2 -2
- package/dist/{chunk-eqzxvfvt.js.map → chunk-x4g0r9d3.js.map} +1 -1
- package/dist/{chunk-zj8y4ak5.js → chunk-y7v30zd8.js} +1 -1
- package/dist/{chunk-6t38r0hf.js → chunk-ygyjtrzb.js} +2 -2
- package/dist/{chunk-6t38r0hf.js.map → chunk-ygyjtrzb.js.map} +1 -1
- package/dist/{chunk-26yghzet.js → chunk-yxhg3wjf.js} +2 -2
- package/dist/{chunk-26yghzet.js.map → chunk-yxhg3wjf.js.map} +1 -1
- package/dist/{chunk-ghbzre7k.js → chunk-yxjfghq3.js} +3 -3
- package/dist/{chunk-ghbzre7k.js.map → chunk-yxjfghq3.js.map} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-fs4ntgdr.js +0 -5
- /package/dist/{chunk-fwmmy0jn.js.map → chunk-1fe07ge4.js.map} +0 -0
- /package/dist/{chunk-ted0qjps.js.map → chunk-3wpxqcw7.js.map} +0 -0
- /package/dist/{chunk-vmr4d6hc.js.map → chunk-d1whcvyn.js.map} +0 -0
- /package/dist/{chunk-kzdkpz04.js.map → chunk-eydahc2f.js.map} +0 -0
- /package/dist/{chunk-c0m8pcbd.js.map → chunk-mj55jdwp.js.map} +0 -0
- /package/dist/{chunk-zj8y4ak5.js.map → chunk-y7v30zd8.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-038xtqpm.js";import Eu from"os";import Au from"fs";var Wl=new Map,hh=new Map,nh=Symbol("OriginError"),Dl={};class fl extends Promise{constructor(l,n,u,c,w={}){let E,t;super((_,B)=>{E=_,t=B});this.tagged=Array.isArray(l.raw),this.strings=l,this.args=n,this.handler=u,this.canceller=c,this.options=w,this.state=null,this.statement=null,this.resolve=(_)=>(this.active=!1,E(_)),this.reject=(_)=>(this.active=!1,t(_)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[nh]=this.handler.debug?Error():this.tagged&&vn(this.strings)}get origin(){return(this.handler.debug?this[nh].stack:this.tagged&&hh.has(this.strings)?hh.get(this.strings):hh.set(this.strings,this[nh].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(l=1,n){if(this.options.simple=!1,typeof l==="function")n=l,l=1;if(this.cursorRows=l,typeof n==="function")return this.cursorFn=n,this;let u;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};u&&u();let c=new Promise((w,E)=>{this.cursorFn=(t)=>{return w({value:t,done:!1}),new Promise((_)=>u=_)},this.resolve=()=>(this.active=!1,w({done:!0})),this.reject=(t)=>(this.active=!1,E(t))});return this.execute(),c},return(){return u&&u(Dl),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw Error(".stream has been renamed to .forEach")}forEach(l){return this.forEachFn=l,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function vn(l){if(Wl.has(l))return Wl.get(l);let n=Error.stackTraceLimit;return Error.stackTraceLimit=4,Wl.set(l,Error()),Error.stackTraceLimit=n,Wl.get(l)}class Yl extends Error{constructor(l){super(l.message);this.name=this.constructor.name,Object.assign(this,l)}}var K={connection:Th,postgres:Xh,generic:Ch,notSupported:Zh};function Th(l,n,u){let{host:c,port:w}=u||n,E=Object.assign(Error("write "+l+" "+(n.path||c+":"+w)),{code:l,errno:l,address:n.path||c},n.path?{}:{port:w});return Error.captureStackTrace(E,Th),E}function Xh(l){let n=new Yl(l);return Error.captureStackTrace(n,Xh),n}function Ch(l,n){let u=Object.assign(Error(l+": "+n),{code:l});return Error.captureStackTrace(u,Ch),u}function Zh(l){let n=Object.assign(Error(l+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:l});return Error.captureStackTrace(n,Zh),n}var mn={string:{to:25,from:null,serialize:(l)=>""+l},number:{to:0,from:[21,23,26,700,701],serialize:(l)=>""+l,parse:(l)=>+l},json:{to:114,from:[114,3802],serialize:(l)=>JSON.stringify(l),parse:(l)=>JSON.parse(l)},boolean:{to:16,from:16,serialize:(l)=>l===!0?"t":"f",parse:(l)=>l==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(l)=>(l instanceof Date?l:new Date(l)).toISOString(),parse:(l)=>new Date(l)},bytea:{to:17,from:17,serialize:(l)=>"\\x"+Buffer.from(l).toString("hex"),parse:(l)=>Buffer.from(l.slice(2),"hex")}};class ml{then(){uh()}catch(){uh()}finally(){uh()}}class il extends ml{constructor(l){super();this.value=el(l)}}class wl extends ml{constructor(l,n,u){super();this.value=l,this.type=n,this.array=u}}class bl extends ml{constructor(l,n){super();this.first=l,this.rest=n}build(l,n,u,c){let w=bn.map(([E,t])=>({fn:t,i:l.search(E)})).sort((E,t)=>E.i-t.i).pop();return w.i===-1?_h(this.first,c):w.fn(this.first,this.rest,n,u,c)}}function al(l,n,u,c){let w=l instanceof wl?l.value:l;if(w===void 0){if(l instanceof wl?l.value=c.transform.undefined:w=l=c.transform.undefined,w===void 0)throw K.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+u.push(l instanceof wl?(n.push(l.value),l.array?l.array[l.type||vl(l.value)]||l.type||ih(l.value):l.type):(n.push(l),vl(l)))}var Hh=Qh(mn);function th(l,n,u,c,w,E){for(let t=1;t<l.strings.length;t++)n+=wh(n,u,c,w,E)+l.strings[t],u=l.args[t];return n}function wh(l,n,u,c,w){return n instanceof bl?n.build(l,u,c,w):n instanceof fl?ch(n,u,c,w):n instanceof il?n.value:n&&n[0]instanceof fl?n.reduce((E,t)=>E+" "+ch(t,u,c,w),""):al(n,u,c,w)}function ch(l,n,u,c){return l.fragment=!0,th(l,l.strings[0],l.args[0],n,u,c)}function zh(l,n,u,c,w){return l.map((E)=>"("+c.map((t)=>wh("values",E[t],n,u,w)).join(",")+")").join(",")}function Fh(l,n,u,c,w){let E=Array.isArray(l[0]),t=n.length?n.flat():Object.keys(E?l[0]:l);return zh(E?l:[l],u,c,t,w)}function Kl(l,n,u,c,w){if(typeof l==="string"&&(l=[l].concat(n)),Array.isArray(l))return _h(l,w);let E;return(n.length?n.flat():Object.keys(l)).map((_)=>{return E=l[_],(E instanceof fl?ch(E,u,c,w):E instanceof il?E.value:al(E,u,c,w))+" as "+el(w.transform.column.to?w.transform.column.to(_):_)}).join(",")}var bn=Object.entries({values:Fh,in:(...l)=>{let n=Fh(...l);return n==="()"?"(null)":n},select:Kl,as:Kl,returning:Kl,"\\(":Kl,update(l,n,u,c,w){return(n.length?n.flat():Object.keys(l)).map((E)=>el(w.transform.column.to?w.transform.column.to(E):E)+"="+wh("values",l[E],u,c,w))},insert(l,n,u,c,w){let E=n.length?n.flat():Object.keys(Array.isArray(l)?l[0]:l);return"("+_h(E,w)+")values"+zh(Array.isArray(l)?l:[l],u,c,E,w)}}).map(([l,n])=>[new RegExp("((?:^|[\\s(])"+l+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),n]);function uh(){throw K.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:an,parsers:en}=Hh;function ih(l){if(Array.isArray(l))return ih(l[0]);return typeof l==="string"?1009:0}var Jh=function(l){let n=Qh(l||{});return{serializers:Object.assign({},an,n.serializers),parsers:Object.assign({},en,n.parsers)}};function Qh(l){return Object.keys(l).reduce((n,u)=>{if(l[u].from&&[].concat(l[u].from).forEach((c)=>n.parsers[c]=l[u].parse),l[u].serialize)n.serializers[l[u].to]=l[u].serialize,l[u].from&&[].concat(l[u].from).forEach((c)=>n.serializers[c]=l[u].serialize);return n},{parsers:{},serializers:{}})}function _h(l,{transform:{column:n}}){return l.map((u)=>el(n.to?n.to(u):u)).join(",")}var el=function(n){return'"'+n.replace(/"/g,'""').replace(/\./g,'"."')+'"'},vl=function l(n){return n instanceof wl?n.type:n instanceof Date?1184:n instanceof Uint8Array?17:n===!0||n===!1?16:typeof n==="bigint"?20:Array.isArray(n)?l(n[0]):0},kn=/\\/g,on=/"/g;function pn(l){return l.replace(kn,"\\\\").replace(on,"\\\"")}var Vh=function l(n,u,c,w){if(Array.isArray(n)===!1)return n;if(!n.length)return"{}";let E=n[0],t=w===1020?";":",";if(Array.isArray(E)&&!E.type)return"{"+n.map((_)=>l(_,u,c,w)).join(t)+"}";return"{"+n.map((_)=>{if(_===void 0){if(_=c.transform.undefined,_===void 0)throw K.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return _===null?"null":'"'+pn(u?u(_.type?_.value:_):""+_)+'"'}).join(t)+"}"},fh={i:0,char:null,str:"",quoted:!1,last:0},Wh=function(n,u,c){return fh.i=fh.last=0,Kh(fh,n,u,c)};function Kh(l,n,u,c){let w=[],E=c===1020?";":",";for(;l.i<n.length;l.i++){if(l.char=n[l.i],l.quoted)if(l.char==="\\")l.str+=n[++l.i];else if(l.char==='"')w.push(u?u(l.str):l.str),l.str="",l.quoted=n[l.i+1]==='"',l.last=l.i+2;else l.str+=l.char;else if(l.char==='"')l.quoted=!0;else if(l.char==="{")l.last=++l.i,w.push(Kh(l,n,u,c));else if(l.char==="}"){l.quoted=!1,l.last<l.i&&w.push(u?u(n.slice(l.last,l.i)):n.slice(l.last,l.i)),l.last=l.i+1;break}else if(l.char===E&&l.p!=="}"&&l.p!=='"')w.push(u?u(n.slice(l.last,l.i)):n.slice(l.last,l.i)),l.last=l.i+1;l.p=l.char}return l.last<l.i&&w.push(u?u(n.slice(l.last,l.i+1)):n.slice(l.last,l.i+1)),w}var Sl=(l)=>{let n=l[0];for(let u=1;u<l.length;u++)n+=l[u]==="_"?l[++u].toUpperCase():l[u];return n},Gl=(l)=>{let n=l[0].toUpperCase();for(let u=1;u<l.length;u++)n+=l[u]==="_"?l[++u].toUpperCase():l[u];return n},jl=(l)=>l.replace(/_/g,"-"),Fl=(l)=>l.replace(/([A-Z])/g,"_$1").toLowerCase(),Hl=(l)=>(l.slice(0,1)+l.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),zl=(l)=>l.replace(/-/g,"_");function Oh(l){return function n(u,c){return typeof u==="object"&&u!==null&&(c.type===114||c.type===3802)?Array.isArray(u)?u.map((w)=>n(w,c)):Object.entries(u).reduce((w,[E,t])=>Object.assign(w,{[l(E)]:n(t,c)}),{}):u}}Sl.column={from:Sl};Sl.value={from:Oh(Sl)};Fl.column={to:Fl};var Eh={...Sl};Eh.column.to=Fl;Gl.column={from:Gl};Gl.value={from:Oh(Gl)};Hl.column={to:Hl};var Ah={...Gl};Ah.column.to=Hl;jl.column={from:jl};jl.value={from:Oh(jl)};zl.column={to:zl};var Uh={...jl};Uh.column.to=zl;import vh from"net";import qn from"tls";import Jl from"crypto";import $h from"stream";import{performance as mh}from"perf_hooks";class Ml extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var hl=yn;function yn(l=[]){let n=l.slice(),u=0;return{get length(){return n.length-u},remove:(c)=>{let w=n.indexOf(c);return w===-1?null:(n.splice(w,1),c)},push:(c)=>(n.push(c),c),shift:()=>{let c=n[u++];if(u===n.length)u=0,n=[];else n[u-1]=void 0;return c}}}var p=Buffer.allocUnsafe(256),rn="BCcDdEFfHPpQSX".split("").reduce((l,n)=>{let u=n.charCodeAt(0);return l[n]=()=>{return p[0]=u,R.i=5,R},l},{}),R=Object.assign(sn,rn,{N:String.fromCharCode(0),i:0,inc(l){return R.i+=l,R},str(l){let n=Buffer.byteLength(l);return kl(n),R.i+=p.write(l,R.i,n,"utf8"),R},i16(l){return kl(2),p.writeUInt16BE(l,R.i),R.i+=2,R},i32(l,n){if(n||n===0)return p.writeUInt32BE(l,n),R;return kl(4),p.writeUInt32BE(l,R.i),R.i+=4,R},z(l){return kl(l),p.fill(0,R.i,R.i+l),R.i+=l,R},raw(l){return p=Buffer.concat([p.subarray(0,R.i),l]),R.i=p.length,R},end(l=1){p.writeUInt32BE(R.i-l,l);let n=p.subarray(0,R.i);return R.i=0,p=Buffer.allocUnsafe(256),n}}),$=R;function kl(l){if(p.length-R.i<l){let n=p,u=n.length;p=Buffer.allocUnsafe(u+(u>>1)+l),n.copy(p)}}function sn(){return R.i=0,R}var Bh=eh,xn=1,Bl=$().S().end(),bh=$().H().end(),lu=$().i32(8).i32(80877103).end(8),hu=Buffer.concat([$().E().str($.N).i32(0).end(),Bl]),nu=$().D().str("S").str($.N).end(),Rl=()=>{},uu=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),fu={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function eh(l,n={},{onopen:u=Rl,onend:c=Rl,onclose:w=Rl}={}){let{sslnegotiation:E,ssl:t,max:_,user:B,host:Q,port:T,database:Y,parsers:j,transform:M,onnotice:H,onnotify:I,onparameter:b,max_pipeline:Z,keep_alive:cl,backoff:nl,target_session_attrs:x}=l,d=hl(),Ul=xn++,_l={pid:null,secret:null},Pl=gh(xl,l.idle_timeout),Il=gh(xl,l.max_lifetime),L=gh(xh,l.connect_timeout),U=null,Ol,q=null,N=new Ml,y=Buffer.alloc(0),dl=l.fetch_types,El={},O={},S=Math.random().toString(36).slice(2),F=1,v=0,V=0,G=0,D=0,i=0,J=0,m=0,r=null,X=null,Al=!1,tl=null,$l=null,e=null,z=null,C=null,ll=null,Ql=null,sl=null,A=null,Tl=null,k={queue:n.closed,idleTimer:Pl,connect(h){e=h,Lh()},terminate:Zl,execute:Xl,cancel:yh,end:xl,count:0,id:Ul};return n.closed&&n.closed.push(k),k;async function ph(){let h;try{h=l.socket?await Promise.resolve(l.socket(l)):new vh.Socket}catch(f){Nl(f);return}return h.on("error",Nl),h.on("close",Nh),h.on("drain",Ph),h}async function yh({pid:h,secret:f},g,P){try{Ol=$().i32(16).i32(80877102).i32(h).i32(f).end(16),await dh(),U.once("error",P),U.once("close",g)}catch(W){P(W)}}function Xl(h){if(Al)return Cl(h,K.connection("CONNECTION_DESTROYED",l));if(C)return Cl(h,K.generic("COPY_IN_PROGRESS","You cannot execute queries during copy"));if(h.cancelled)return;try{return h.state=_l,A?d.push(h):(A=h,A.active=!0),qh(h),a(rh(h))&&!h.describeFirst&&!h.cursorFn&&d.length<Z&&(!h.options.onexecute||h.options.onexecute(k))}catch(f){return d.length===0&&a(Bl),ul(f),!0}}function rh(h){if(h.parameters.length>=65534)throw K.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return h.options.simple?$().Q().str(h.statement.string+$.N).end():h.describeFirst?Buffer.concat([Gh(h),bh]):h.prepare?h.prepared?Vl(h):Buffer.concat([Gh(h),Vl(h)]):sh(h)}function Gh(h){return Buffer.concat([Yh(h.statement.string,h.parameters,h.statement.types,h.statement.name),Vn("S",h.statement.name)])}function Vl(h){return Buffer.concat([Qn(h.parameters,h.statement.types,h.statement.name,h.cursorName),h.cursorFn?Rh("",h.cursorRows):hu])}function sh(h){return Buffer.concat([Yh(h.statement.string,h.parameters,h.statement.types),nu,Vl(h)])}function qh(h){let f=[],g=[],P=th(h,h.strings[0],h.args[0],f,g,l);!h.tagged&&h.args.forEach((W)=>al(W,f,g,l)),h.prepare=l.prepare&&("prepare"in h.options?h.options.prepare:!0),h.string=P,h.signature=h.prepare&&g+P,h.onlyDescribe&&delete O[h.signature],h.parameters=h.parameters||f,h.prepared=h.prepare&&h.signature in O,h.describeFirst=h.onlyDescribe||f.length&&!h.prepared,h.statement=h.prepared?O[h.signature]:{string:P,types:g,name:h.prepare?S+F++:""},typeof l.debug==="function"&&l.debug(Ul,P,f,g)}function a(h,f){if(ll=ll?Buffer.concat([ll,h]):Buffer.from(h),f||ll.length>=1024)return jh(f);return X===null&&(X=setImmediate(jh)),!0}function jh(h){let f=U.write(ll,h);return X!==null&&clearImmediate(X),ll=X=null,f}function xh(){ul(K.connection("CONNECT_TIMEOUT",l,U)),U.destroy()}async function Mh(){if(E!=="direct"){if(a(lu),!await new Promise((g)=>U.once("data",(P)=>g(P[0]===83)))&&t==="prefer")return Ll()}let h={socket:U,servername:vh.isIP(U.host)?void 0:U.host};if(E==="direct")h.ALPNProtocols=["postgresql"];if(t==="require"||t==="allow"||t==="prefer")h.rejectUnauthorized=!1;else if(typeof t==="object")Object.assign(h,t);U.removeAllListeners(),U=qn.connect(h),U.on("secureConnect",Ll),U.on("error",Nl),U.on("close",Nh),U.on("drain",Ph)}function Ph(){!A&&u(k)}function ql(h){if(tl){if(tl.push(h),V-=h.length,V>0)return}y=tl?Buffer.concat(tl,i-V):y.length===0?h:Buffer.concat([y,h],y.length+h.length);while(y.length>4){if(i=y.readUInt32BE(1),i>=y.length){V=i-y.length,tl=[y];break}try{ln(y.subarray(0,i+1))}catch(f){A&&(A.cursorFn||A.describeFirst)&&a(Bl),ul(f)}y=y.subarray(i+1),V=0,tl=null}}async function dh(){if(Al=!1,El={},U||(U=await ph()),!U)return;if(L.start(),l.socket)return t?Mh():Ll();if(U.on("connect",t?Mh:Ll),l.path)return U.connect(l.path);U.ssl=t,U.connect(T[G],Q[G]),U.host=Q[G],U.port=T[G],G=(G+1)%T.length}function Lh(){setTimeout(dh,v?Math.max(0,v+J-mh.now()):0)}function Ll(){try{O={},dl=l.fetch_types,S=Math.random().toString(36).slice(2),F=1,Il.start(),U.on("data",ql),cl&&U.setKeepAlive&&U.setKeepAlive(!0,1000*cl);let h=Kn();a(h)}catch(h){Nl(h)}}function Nl(h){if(k.queue===n.connecting&&l.host[D+1])return;ul(h);while(d.length)Cl(d.shift(),h)}function ul(h){C&&(C.destroy(h),C=null),A&&Cl(A,h),e&&(Cl(e,h),e=null)}function Cl(h,f){if(h.reserve)return h.reject(f);if(!f||typeof f!=="object")f=Error(f);"query"in f||"parameters"in f||Object.defineProperties(f,{stack:{value:f.stack+h.origin.replace(/.*\n/,`
|
|
2
|
+
import"./chunk-tbhtx2t0.js";import Eu from"os";import Au from"fs";var Wl=new Map,hh=new Map,nh=Symbol("OriginError"),Dl={};class fl extends Promise{constructor(l,n,u,c,w={}){let E,t;super((_,B)=>{E=_,t=B});this.tagged=Array.isArray(l.raw),this.strings=l,this.args=n,this.handler=u,this.canceller=c,this.options=w,this.state=null,this.statement=null,this.resolve=(_)=>(this.active=!1,E(_)),this.reject=(_)=>(this.active=!1,t(_)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[nh]=this.handler.debug?Error():this.tagged&&vn(this.strings)}get origin(){return(this.handler.debug?this[nh].stack:this.tagged&&hh.has(this.strings)?hh.get(this.strings):hh.set(this.strings,this[nh].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(l=1,n){if(this.options.simple=!1,typeof l==="function")n=l,l=1;if(this.cursorRows=l,typeof n==="function")return this.cursorFn=n,this;let u;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};u&&u();let c=new Promise((w,E)=>{this.cursorFn=(t)=>{return w({value:t,done:!1}),new Promise((_)=>u=_)},this.resolve=()=>(this.active=!1,w({done:!0})),this.reject=(t)=>(this.active=!1,E(t))});return this.execute(),c},return(){return u&&u(Dl),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw Error(".stream has been renamed to .forEach")}forEach(l){return this.forEachFn=l,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function vn(l){if(Wl.has(l))return Wl.get(l);let n=Error.stackTraceLimit;return Error.stackTraceLimit=4,Wl.set(l,Error()),Error.stackTraceLimit=n,Wl.get(l)}class Yl extends Error{constructor(l){super(l.message);this.name=this.constructor.name,Object.assign(this,l)}}var K={connection:Th,postgres:Xh,generic:Ch,notSupported:Zh};function Th(l,n,u){let{host:c,port:w}=u||n,E=Object.assign(Error("write "+l+" "+(n.path||c+":"+w)),{code:l,errno:l,address:n.path||c},n.path?{}:{port:w});return Error.captureStackTrace(E,Th),E}function Xh(l){let n=new Yl(l);return Error.captureStackTrace(n,Xh),n}function Ch(l,n){let u=Object.assign(Error(l+": "+n),{code:l});return Error.captureStackTrace(u,Ch),u}function Zh(l){let n=Object.assign(Error(l+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:l});return Error.captureStackTrace(n,Zh),n}var mn={string:{to:25,from:null,serialize:(l)=>""+l},number:{to:0,from:[21,23,26,700,701],serialize:(l)=>""+l,parse:(l)=>+l},json:{to:114,from:[114,3802],serialize:(l)=>JSON.stringify(l),parse:(l)=>JSON.parse(l)},boolean:{to:16,from:16,serialize:(l)=>l===!0?"t":"f",parse:(l)=>l==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(l)=>(l instanceof Date?l:new Date(l)).toISOString(),parse:(l)=>new Date(l)},bytea:{to:17,from:17,serialize:(l)=>"\\x"+Buffer.from(l).toString("hex"),parse:(l)=>Buffer.from(l.slice(2),"hex")}};class ml{then(){uh()}catch(){uh()}finally(){uh()}}class il extends ml{constructor(l){super();this.value=el(l)}}class wl extends ml{constructor(l,n,u){super();this.value=l,this.type=n,this.array=u}}class bl extends ml{constructor(l,n){super();this.first=l,this.rest=n}build(l,n,u,c){let w=bn.map(([E,t])=>({fn:t,i:l.search(E)})).sort((E,t)=>E.i-t.i).pop();return w.i===-1?_h(this.first,c):w.fn(this.first,this.rest,n,u,c)}}function al(l,n,u,c){let w=l instanceof wl?l.value:l;if(w===void 0){if(l instanceof wl?l.value=c.transform.undefined:w=l=c.transform.undefined,w===void 0)throw K.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+u.push(l instanceof wl?(n.push(l.value),l.array?l.array[l.type||vl(l.value)]||l.type||ih(l.value):l.type):(n.push(l),vl(l)))}var Hh=Qh(mn);function th(l,n,u,c,w,E){for(let t=1;t<l.strings.length;t++)n+=wh(n,u,c,w,E)+l.strings[t],u=l.args[t];return n}function wh(l,n,u,c,w){return n instanceof bl?n.build(l,u,c,w):n instanceof fl?ch(n,u,c,w):n instanceof il?n.value:n&&n[0]instanceof fl?n.reduce((E,t)=>E+" "+ch(t,u,c,w),""):al(n,u,c,w)}function ch(l,n,u,c){return l.fragment=!0,th(l,l.strings[0],l.args[0],n,u,c)}function zh(l,n,u,c,w){return l.map((E)=>"("+c.map((t)=>wh("values",E[t],n,u,w)).join(",")+")").join(",")}function Fh(l,n,u,c,w){let E=Array.isArray(l[0]),t=n.length?n.flat():Object.keys(E?l[0]:l);return zh(E?l:[l],u,c,t,w)}function Kl(l,n,u,c,w){if(typeof l==="string"&&(l=[l].concat(n)),Array.isArray(l))return _h(l,w);let E;return(n.length?n.flat():Object.keys(l)).map((_)=>{return E=l[_],(E instanceof fl?ch(E,u,c,w):E instanceof il?E.value:al(E,u,c,w))+" as "+el(w.transform.column.to?w.transform.column.to(_):_)}).join(",")}var bn=Object.entries({values:Fh,in:(...l)=>{let n=Fh(...l);return n==="()"?"(null)":n},select:Kl,as:Kl,returning:Kl,"\\(":Kl,update(l,n,u,c,w){return(n.length?n.flat():Object.keys(l)).map((E)=>el(w.transform.column.to?w.transform.column.to(E):E)+"="+wh("values",l[E],u,c,w))},insert(l,n,u,c,w){let E=n.length?n.flat():Object.keys(Array.isArray(l)?l[0]:l);return"("+_h(E,w)+")values"+zh(Array.isArray(l)?l:[l],u,c,E,w)}}).map(([l,n])=>[new RegExp("((?:^|[\\s(])"+l+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),n]);function uh(){throw K.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:an,parsers:en}=Hh;function ih(l){if(Array.isArray(l))return ih(l[0]);return typeof l==="string"?1009:0}var Jh=function(l){let n=Qh(l||{});return{serializers:Object.assign({},an,n.serializers),parsers:Object.assign({},en,n.parsers)}};function Qh(l){return Object.keys(l).reduce((n,u)=>{if(l[u].from&&[].concat(l[u].from).forEach((c)=>n.parsers[c]=l[u].parse),l[u].serialize)n.serializers[l[u].to]=l[u].serialize,l[u].from&&[].concat(l[u].from).forEach((c)=>n.serializers[c]=l[u].serialize);return n},{parsers:{},serializers:{}})}function _h(l,{transform:{column:n}}){return l.map((u)=>el(n.to?n.to(u):u)).join(",")}var el=function(n){return'"'+n.replace(/"/g,'""').replace(/\./g,'"."')+'"'},vl=function l(n){return n instanceof wl?n.type:n instanceof Date?1184:n instanceof Uint8Array?17:n===!0||n===!1?16:typeof n==="bigint"?20:Array.isArray(n)?l(n[0]):0},kn=/\\/g,on=/"/g;function pn(l){return l.replace(kn,"\\\\").replace(on,"\\\"")}var Vh=function l(n,u,c,w){if(Array.isArray(n)===!1)return n;if(!n.length)return"{}";let E=n[0],t=w===1020?";":",";if(Array.isArray(E)&&!E.type)return"{"+n.map((_)=>l(_,u,c,w)).join(t)+"}";return"{"+n.map((_)=>{if(_===void 0){if(_=c.transform.undefined,_===void 0)throw K.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return _===null?"null":'"'+pn(u?u(_.type?_.value:_):""+_)+'"'}).join(t)+"}"},fh={i:0,char:null,str:"",quoted:!1,last:0},Wh=function(n,u,c){return fh.i=fh.last=0,Kh(fh,n,u,c)};function Kh(l,n,u,c){let w=[],E=c===1020?";":",";for(;l.i<n.length;l.i++){if(l.char=n[l.i],l.quoted)if(l.char==="\\")l.str+=n[++l.i];else if(l.char==='"')w.push(u?u(l.str):l.str),l.str="",l.quoted=n[l.i+1]==='"',l.last=l.i+2;else l.str+=l.char;else if(l.char==='"')l.quoted=!0;else if(l.char==="{")l.last=++l.i,w.push(Kh(l,n,u,c));else if(l.char==="}"){l.quoted=!1,l.last<l.i&&w.push(u?u(n.slice(l.last,l.i)):n.slice(l.last,l.i)),l.last=l.i+1;break}else if(l.char===E&&l.p!=="}"&&l.p!=='"')w.push(u?u(n.slice(l.last,l.i)):n.slice(l.last,l.i)),l.last=l.i+1;l.p=l.char}return l.last<l.i&&w.push(u?u(n.slice(l.last,l.i+1)):n.slice(l.last,l.i+1)),w}var Sl=(l)=>{let n=l[0];for(let u=1;u<l.length;u++)n+=l[u]==="_"?l[++u].toUpperCase():l[u];return n},Gl=(l)=>{let n=l[0].toUpperCase();for(let u=1;u<l.length;u++)n+=l[u]==="_"?l[++u].toUpperCase():l[u];return n},jl=(l)=>l.replace(/_/g,"-"),Fl=(l)=>l.replace(/([A-Z])/g,"_$1").toLowerCase(),Hl=(l)=>(l.slice(0,1)+l.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),zl=(l)=>l.replace(/-/g,"_");function Oh(l){return function n(u,c){return typeof u==="object"&&u!==null&&(c.type===114||c.type===3802)?Array.isArray(u)?u.map((w)=>n(w,c)):Object.entries(u).reduce((w,[E,t])=>Object.assign(w,{[l(E)]:n(t,c)}),{}):u}}Sl.column={from:Sl};Sl.value={from:Oh(Sl)};Fl.column={to:Fl};var Eh={...Sl};Eh.column.to=Fl;Gl.column={from:Gl};Gl.value={from:Oh(Gl)};Hl.column={to:Hl};var Ah={...Gl};Ah.column.to=Hl;jl.column={from:jl};jl.value={from:Oh(jl)};zl.column={to:zl};var Uh={...jl};Uh.column.to=zl;import vh from"net";import qn from"tls";import Jl from"crypto";import $h from"stream";import{performance as mh}from"perf_hooks";class Ml extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var hl=yn;function yn(l=[]){let n=l.slice(),u=0;return{get length(){return n.length-u},remove:(c)=>{let w=n.indexOf(c);return w===-1?null:(n.splice(w,1),c)},push:(c)=>(n.push(c),c),shift:()=>{let c=n[u++];if(u===n.length)u=0,n=[];else n[u-1]=void 0;return c}}}var p=Buffer.allocUnsafe(256),rn="BCcDdEFfHPpQSX".split("").reduce((l,n)=>{let u=n.charCodeAt(0);return l[n]=()=>{return p[0]=u,R.i=5,R},l},{}),R=Object.assign(sn,rn,{N:String.fromCharCode(0),i:0,inc(l){return R.i+=l,R},str(l){let n=Buffer.byteLength(l);return kl(n),R.i+=p.write(l,R.i,n,"utf8"),R},i16(l){return kl(2),p.writeUInt16BE(l,R.i),R.i+=2,R},i32(l,n){if(n||n===0)return p.writeUInt32BE(l,n),R;return kl(4),p.writeUInt32BE(l,R.i),R.i+=4,R},z(l){return kl(l),p.fill(0,R.i,R.i+l),R.i+=l,R},raw(l){return p=Buffer.concat([p.subarray(0,R.i),l]),R.i=p.length,R},end(l=1){p.writeUInt32BE(R.i-l,l);let n=p.subarray(0,R.i);return R.i=0,p=Buffer.allocUnsafe(256),n}}),$=R;function kl(l){if(p.length-R.i<l){let n=p,u=n.length;p=Buffer.allocUnsafe(u+(u>>1)+l),n.copy(p)}}function sn(){return R.i=0,R}var Bh=eh,xn=1,Bl=$().S().end(),bh=$().H().end(),lu=$().i32(8).i32(80877103).end(8),hu=Buffer.concat([$().E().str($.N).i32(0).end(),Bl]),nu=$().D().str("S").str($.N).end(),Rl=()=>{},uu=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),fu={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function eh(l,n={},{onopen:u=Rl,onend:c=Rl,onclose:w=Rl}={}){let{sslnegotiation:E,ssl:t,max:_,user:B,host:Q,port:T,database:Y,parsers:j,transform:M,onnotice:H,onnotify:I,onparameter:b,max_pipeline:Z,keep_alive:cl,backoff:nl,target_session_attrs:x}=l,d=hl(),Ul=xn++,_l={pid:null,secret:null},Pl=gh(xl,l.idle_timeout),Il=gh(xl,l.max_lifetime),L=gh(xh,l.connect_timeout),U=null,Ol,q=null,N=new Ml,y=Buffer.alloc(0),dl=l.fetch_types,El={},O={},S=Math.random().toString(36).slice(2),F=1,v=0,V=0,G=0,D=0,i=0,J=0,m=0,r=null,X=null,Al=!1,tl=null,$l=null,e=null,z=null,C=null,ll=null,Ql=null,sl=null,A=null,Tl=null,k={queue:n.closed,idleTimer:Pl,connect(h){e=h,Lh()},terminate:Zl,execute:Xl,cancel:yh,end:xl,count:0,id:Ul};return n.closed&&n.closed.push(k),k;async function ph(){let h;try{h=l.socket?await Promise.resolve(l.socket(l)):new vh.Socket}catch(f){Nl(f);return}return h.on("error",Nl),h.on("close",Nh),h.on("drain",Ph),h}async function yh({pid:h,secret:f},g,P){try{Ol=$().i32(16).i32(80877102).i32(h).i32(f).end(16),await dh(),U.once("error",P),U.once("close",g)}catch(W){P(W)}}function Xl(h){if(Al)return Cl(h,K.connection("CONNECTION_DESTROYED",l));if(C)return Cl(h,K.generic("COPY_IN_PROGRESS","You cannot execute queries during copy"));if(h.cancelled)return;try{return h.state=_l,A?d.push(h):(A=h,A.active=!0),qh(h),a(rh(h))&&!h.describeFirst&&!h.cursorFn&&d.length<Z&&(!h.options.onexecute||h.options.onexecute(k))}catch(f){return d.length===0&&a(Bl),ul(f),!0}}function rh(h){if(h.parameters.length>=65534)throw K.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return h.options.simple?$().Q().str(h.statement.string+$.N).end():h.describeFirst?Buffer.concat([Gh(h),bh]):h.prepare?h.prepared?Vl(h):Buffer.concat([Gh(h),Vl(h)]):sh(h)}function Gh(h){return Buffer.concat([Yh(h.statement.string,h.parameters,h.statement.types,h.statement.name),Vn("S",h.statement.name)])}function Vl(h){return Buffer.concat([Qn(h.parameters,h.statement.types,h.statement.name,h.cursorName),h.cursorFn?Rh("",h.cursorRows):hu])}function sh(h){return Buffer.concat([Yh(h.statement.string,h.parameters,h.statement.types),nu,Vl(h)])}function qh(h){let f=[],g=[],P=th(h,h.strings[0],h.args[0],f,g,l);!h.tagged&&h.args.forEach((W)=>al(W,f,g,l)),h.prepare=l.prepare&&("prepare"in h.options?h.options.prepare:!0),h.string=P,h.signature=h.prepare&&g+P,h.onlyDescribe&&delete O[h.signature],h.parameters=h.parameters||f,h.prepared=h.prepare&&h.signature in O,h.describeFirst=h.onlyDescribe||f.length&&!h.prepared,h.statement=h.prepared?O[h.signature]:{string:P,types:g,name:h.prepare?S+F++:""},typeof l.debug==="function"&&l.debug(Ul,P,f,g)}function a(h,f){if(ll=ll?Buffer.concat([ll,h]):Buffer.from(h),f||ll.length>=1024)return jh(f);return X===null&&(X=setImmediate(jh)),!0}function jh(h){let f=U.write(ll,h);return X!==null&&clearImmediate(X),ll=X=null,f}function xh(){ul(K.connection("CONNECT_TIMEOUT",l,U)),U.destroy()}async function Mh(){if(E!=="direct"){if(a(lu),!await new Promise((g)=>U.once("data",(P)=>g(P[0]===83)))&&t==="prefer")return Ll()}let h={socket:U,servername:vh.isIP(U.host)?void 0:U.host};if(E==="direct")h.ALPNProtocols=["postgresql"];if(t==="require"||t==="allow"||t==="prefer")h.rejectUnauthorized=!1;else if(typeof t==="object")Object.assign(h,t);U.removeAllListeners(),U=qn.connect(h),U.on("secureConnect",Ll),U.on("error",Nl),U.on("close",Nh),U.on("drain",Ph)}function Ph(){!A&&u(k)}function ql(h){if(tl){if(tl.push(h),V-=h.length,V>0)return}y=tl?Buffer.concat(tl,i-V):y.length===0?h:Buffer.concat([y,h],y.length+h.length);while(y.length>4){if(i=y.readUInt32BE(1),i>=y.length){V=i-y.length,tl=[y];break}try{ln(y.subarray(0,i+1))}catch(f){A&&(A.cursorFn||A.describeFirst)&&a(Bl),ul(f)}y=y.subarray(i+1),V=0,tl=null}}async function dh(){if(Al=!1,El={},U||(U=await ph()),!U)return;if(L.start(),l.socket)return t?Mh():Ll();if(U.on("connect",t?Mh:Ll),l.path)return U.connect(l.path);U.ssl=t,U.connect(T[G],Q[G]),U.host=Q[G],U.port=T[G],G=(G+1)%T.length}function Lh(){setTimeout(dh,v?Math.max(0,v+J-mh.now()):0)}function Ll(){try{O={},dl=l.fetch_types,S=Math.random().toString(36).slice(2),F=1,Il.start(),U.on("data",ql),cl&&U.setKeepAlive&&U.setKeepAlive(!0,1000*cl);let h=Kn();a(h)}catch(h){Nl(h)}}function Nl(h){if(k.queue===n.connecting&&l.host[D+1])return;ul(h);while(d.length)Cl(d.shift(),h)}function ul(h){C&&(C.destroy(h),C=null),A&&Cl(A,h),e&&(Cl(e,h),e=null)}function Cl(h,f){if(h.reserve)return h.reject(f);if(!f||typeof f!=="object")f=Error(f);"query"in f||"parameters"in f||Object.defineProperties(f,{stack:{value:f.stack+h.origin.replace(/.*\n/,`
|
|
3
3
|
`),enumerable:l.debug},query:{value:h.string,enumerable:l.debug},parameters:{value:h.parameters,enumerable:l.debug},args:{value:h.args,enumerable:l.debug},types:{value:h.statement&&h.statement.types,enumerable:l.debug}}),h.reject(f)}function xl(){return z||(!k.reserved&&c(k),!k.reserved&&!e&&!A&&d.length===0?(Zl(),new Promise((h)=>U&&U.readyState!=="closed"?U.once("close",h):h())):z=new Promise((h)=>Ql=h))}function Zl(){if(Al=!0,C||A||e||d.length)Nl(K.connection("CONNECTION_DESTROYED",l));if(clearImmediate(X),U)U.removeListener("data",ql),U.removeListener("connect",Ll),U.readyState==="open"&&U.end($().X().end());Ql&&(Ql(),z=Ql=null)}async function Nh(h){if(y=Buffer.alloc(0),V=0,tl=null,clearImmediate(X),U.removeListener("data",ql),U.removeListener("connect",Ll),Pl.cancel(),Il.cancel(),L.cancel(),U.removeAllListeners(),U=null,e)return Lh();!h&&(A||d.length)&&Nl(K.connection("CONNECTION_CLOSED",l,U)),v=mh.now(),h&&l.shared.retries++,J=(typeof nl==="function"?nl(l.shared.retries):nl)*1000,w(k,K.connection("CONNECTION_CLOSED",l,U))}function ln(h,f=h[0]){(f===68?hn:f===100?Tn:f===65?dn:f===83?nn:f===90?un:f===67?fn:f===50?Dh:f===49?cn:f===116?tn:f===84?wn:f===82?_n:f===110?gn:f===75?Bn:f===69?Mn:f===115?Ln:f===51?Nn:f===71?Dn:f===78?Cn:f===72?Yn:f===99?Xn:f===73?Zn:f===86?Fn:f===118?Hn:f===87?Rn:zn)(h)}function hn(h){let f=7,g,P,W,o=A.isRaw?Array(A.statement.columns.length):{};for(let s=0;s<A.statement.columns.length;s++)P=A.statement.columns[s],g=h.readInt32BE(f),f+=4,W=g===-1?null:A.isRaw===!0?h.subarray(f,f+=g):P.parser===void 0?h.toString("utf8",f,f+=g):P.parser.array===!0?P.parser(h.toString("utf8",f+1,f+=g)):P.parser(h.toString("utf8",f,f+=g)),A.isRaw?o[s]=A.isRaw===!0?W:M.value.from?M.value.from(W,P):W:o[P.name]=M.value.from?M.value.from(W,P):W;A.forEachFn?A.forEachFn(M.row.from?M.row.from(o):o,N):N[m++]=M.row.from?M.row.from(o):o}function nn(h){let[f,g]=h.toString("utf8",5,h.length-1).split($.N);if(El[f]=g,l.parameters[f]!==g)l.parameters[f]=g,b&&b(f,g)}function un(h){if(A)if(q)A.retried?ul(A.retried):A.prepared&&uu.has(q.routine)?Pn(A,q):ul(q);else A.resolve($l||N);else if(q)ul(q);if(A=$l=q=null,N=new Ml,L.cancel(),e){if(x){if(!El.in_hot_standby||!El.default_transaction_read_only)return jn();else if(Gn(x,El))return Zl()}if(dl)return e.reserve&&(e=null),In();e&&!e.reserve&&Xl(e),l.shared.retries=D=0,e=null;return}while(d.length&&(A=d.shift())&&(A.active=!0,A.cancelled))eh(l).cancel(A.state,A.cancelled.resolve,A.cancelled.reject);if(A)return;k.reserved?!k.reserved.release&&h[5]===73?z?Zl():(k.reserved=null,u(k)):k.reserved():z?Zl():u(k)}function fn(h){m=0;for(let f=h.length-1;f>0;f--){if(h[f]===32&&h[f+1]<58&&N.count===null)N.count=+h.toString("utf8",f+1,h.length-1);if(h[f-1]>=65){N.command=h.toString("utf8",5,f),N.state=_l;break}}if(Tl&&(Tl(),Tl=null),N.command==="BEGIN"&&_!==1&&!k.reserved)return ul(K.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(A.options.simple)return Dh();if(A.cursorFn)N.count&&A.cursorFn(N),a(Bl)}function cn(){A.parsing=!1}function Dh(){!N.statement&&(N.statement=A.statement),N.columns=A.statement.columns}function tn(h){let f=h.readUInt16BE(5);for(let g=0;g<f;++g)!A.statement.types[g]&&(A.statement.types[g]=h.readUInt32BE(7+g*4));A.prepare&&(O[A.signature]=A.statement),A.describeFirst&&!A.onlyDescribe&&(a(Vl(A)),A.describeFirst=!1)}function wn(h){if(N.command)$l=$l||[N],$l.push(N=new Ml),N.count=null,A.statement.columns=null;let f=h.readUInt16BE(5),g=7,P;A.statement.columns=Array(f);for(let W=0;W<f;++W){P=g;while(h[g++]!==0);let o=h.readUInt32BE(g),s=h.readUInt16BE(g+4),gl=h.readUInt32BE(g+6);A.statement.columns[W]={name:M.column.from?M.column.from(h.toString("utf8",P,g-1)):h.toString("utf8",P,g-1),parser:j[gl],table:o,number:s,type:gl},g+=18}if(N.statement=A.statement,A.onlyDescribe)return A.resolve(A.statement),a(Bl)}async function _n(h,f=h.readUInt32BE(5)){(f===3?On:f===5?En:f===10?An:f===11?Un:f===12?$n:f!==0?Jn:Rl)(h,f)}async function On(){let h=await lh();a($().p().str(h).z(1).end())}async function En(h){let f="md5"+await ah(Buffer.concat([Buffer.from(await ah(await lh()+B)),h.subarray(9)]));a($().p().str(f).z(1).end())}async function An(){sl=(await Jl.randomBytes(18)).toString("base64"),$().p().str("SCRAM-SHA-256"+$.N);let h=$.i;a($.inc(4).str("n,,n=*,r="+sl).i32($.i-h-4,h).end())}async function Un(h){let f=h.toString("utf8",9).split(",").reduce((s,gl)=>(s[gl[0]]=gl.slice(2),s),{}),g=await Jl.pbkdf2Sync(await lh(),Buffer.from(f.s,"base64"),parseInt(f.i),32,"sha256"),P=await pl(g,"Client Key"),W="n=*,r="+sl+",r="+f.r+",s="+f.s+",i="+f.i+",c=biws,r="+f.r;r=(await pl(await pl(g,"Server Key"),W)).toString("base64");let o="c=biws,r="+f.r+",p="+tu(P,Buffer.from(await pl(await cu(P),W))).toString("base64");a($().p().str(o).end())}function $n(h){if(h.toString("utf8",9).split($.N,1)[0].slice(2)===r)return;ul(K.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),U.destroy()}function lh(){return Promise.resolve(typeof l.pass==="function"?l.pass():l.pass)}function gn(){if(N.statement=A.statement,N.statement.columns=[],A.onlyDescribe)return A.resolve(A.statement),a(Bl)}function Bn(h){_l.pid=h.readUInt32BE(5),_l.secret=h.readUInt32BE(9)}async function In(){dl=!1,(await new fl([`
|
|
4
4
|
select b.oid, b.typarray
|
|
5
5
|
from pg_catalog.pg_type a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{i as
|
|
2
|
+
import{Hj as k,mj as g,nj as m}from"./chunk-e9xbdgb2.js";import{Tk as p}from"./chunk-kddgfct7.js";import{pl as n}from"./chunk-tbhtx2t0.js";var b={};n(b,{registeredNames:()=>x,register:()=>i,has:()=>S,get:()=>_,clearRegistry:()=>a});var M=new Map;function i(q,z){M.set(q,z)}function S(q){return M.has(q)}function _(q){let z=M.get(q);if(z===void 0)throw new k(q,[...M.keys()]);return z}function x(){return[...M.keys()]}function a(){M.clear()}import{createCipheriv as r,createDecipheriv as e,randomBytes as qq}from"crypto";class Y{static token="encrypter";keys=new Map;currentId;constructor(q={}){for(let[z,J]of Object.entries(q.keys??{})){if(!u.test(z))throw new U(`Encryption key id "${z}" is not valid. Use 1-32 letters, digits, "_" or "-": the id is written into every encrypted value.`);this.keys.set(z,zq(z,J))}if(q.current!==void 0){if(!this.keys.has(q.current))throw new U(`encryption.current is "${q.current}", but encryption.keys has no key by that id (${I(this.keys)}).`);this.currentId=q.current}else if(this.keys.size===1)this.currentId=[...this.keys.keys()][0];else if(this.keys.size>1)throw new U(`encryption.keys has ${this.keys.size} keys (${I(this.keys)}) and no encryption.current to say which one encrypts new values.`)}get configured(){return this.currentId!==void 0}get currentKeyId(){return this.requireCurrent()}encrypt(q){if(typeof q!=="string")throw TypeError(`Encrypter.encrypt takes a string, got ${Jq(q)}. Serialise other values first (JSON.stringify).`);let z=this.requireCurrent(),J=this.keys.get(z),Q=`${j}:${z}`,Z=qq(y),$=r(E,J,Z);$.setAAD(Buffer.from(Q));let X=Buffer.concat([$.update(q,"utf8"),$.final(),$.getAuthTag()]);return`${Q}:${Z.toString("base64url")}:${X.toString("base64url")}`}decrypt(q){let z=D(q);if(!z)throw new N("malformed","The value is not an encrypted envelope.");if(!this.configured)this.requireCurrent();let J=this.keys.get(z.keyId);if(!J)throw new N("unknown_key",`The value was encrypted with key "${z.keyId}", which is not in encryption.keys (${I(this.keys)}). Keep a key configured until encryption:rotate has re-encrypted the values written with it.`);try{let Q=e(E,J,z.iv);return Q.setAAD(Buffer.from(`${j}:${z.keyId}`)),Q.setAuthTag(z.tag),Buffer.concat([Q.update(z.ciphertext),Q.final()]).toString("utf8")}catch{throw new N("invalid",`The value did not authenticate under key "${z.keyId}": it was altered, or encrypted with a different key under the same id.`)}}isEncrypted(q){return D(q)!==null}keyIdOf(q){return D(q)?.keyId??null}needsReencryption(q){return this.keyIdOf(q)!==this.requireCurrent()}requireCurrent(){if(this.currentId===void 0)throw new U("No encryption key is configured. Add app/config/encryption.ts (defineEncryptionConfig({ keys: { k1: process.env.APP_ENCRYPTION_KEY } })) and list it as `encryption` in your Kernel's config. Generate a key with `openssl rand -base64 32`.");return this.currentId}}class U extends Error{constructor(q){super(q);this.name="EncryptionKeyError"}}class N extends Error{reason;column;constructor(q,z){super(z);this.reason=q;this.name="DecryptionError"}}var j="v1",E="aes-256-gcm",f=32,y=12,A=16,u=/^[A-Za-z0-9_-]{1,32}$/,v=/^[A-Za-z0-9_-]+$/;function zq(q,z){if(typeof z!=="string"||z.trim()==="")throw new U(`Encryption key "${q}" is empty. Is the environment variable it reads set?`);let J=z.trim().replace(/^base64:/,""),Q=/^[A-Za-z0-9+/=_-]+$/.test(J)?Buffer.from(J,"base64"):Buffer.alloc(0);if(Q.length!==f)throw new U(`Encryption key "${q}" is not ${f} bytes of base64 (it decodes to ${Q.length}). Generate one with \`openssl rand -base64 32\`.`);return Q}function D(q){if(typeof q!=="string")return null;let z=q.split(":");if(z.length!==4||z[0]!==j)return null;let[,J,Q,Z]=z;if(!u.test(J)||!v.test(Q)||!v.test(Z))return null;let $=Buffer.from(Q,"base64url"),X=Buffer.from(Z,"base64url");if($.length!==y||X.length<A)return null;return{keyId:J,iv:$,ciphertext:X.subarray(0,X.length-A),tag:X.subarray(X.length-A)}}function I(q){return q.size===0?"none configured":[...q.keys()].map((z)=>`"${z}"`).join(", ")}function Jq(q){return q===null?"null":Array.isArray(q)?"an array":`a ${typeof q}`}var h=new WeakMap;function T(q){let z=h.get(q);if(z===void 0)z=Object.values(q.fields).filter((J)=>J.encrypted===!0).map((J)=>J.name),h.set(q,z);return z}function Mq(){let q=new Set,z=[];for(let J of x()){let Q=O(J);if(!Q||q.has(Q.name))continue;q.add(Q.name);for(let Z of T(Q))z.push(`${Q.name}.${Z}`)}return z}function c(){let q=p();if(!q.bound(Y))throw new U("Encrypted columns need an Encrypter, and none is bound in this application. A booted Kernel binds one from the `encryption` config slice; a hand-built Application can bind its own: `application.instance(Encrypter, new Encrypter({ keys: { k1: key } }))`.");return q.make(Y)}var l=Symbol("gemi.orm.encryptedColumnsRaw");function Nq(q){return{...q,[l]:!0}}function Vq(q){return typeof q==="object"&&q!==null&&q[l]===!0}function Lq(q,z,J){if(!P(J))return;let Q={model:q.name,operation:z};d(q,J,Q,0);for(let Z of["by","_min","_max","_avg","_sum"])if(J[Z]!==void 0)o(q,J[Z],Z,Q);if(J.having!==void 0)B(q,J.having,Q)}var w=64;function d(q,z,J,Q){if(Q>w)return;if(z.where!==void 0)W(q,z.where,"where",J,Q);if(z.cursor!==void 0)W(q,z.cursor,"cursor",J,Q);if(z.orderBy!==void 0)K(q,z.orderBy,J,Q);if(z.distinct!==void 0)o(q,z.distinct,"distinct",J);for(let Z of[z.include,z.select]){if(!P(Z))continue;for(let[$,X]of Object.entries(Z)){if(!P(X))continue;if($==="_count"){if(!P(X.select))continue;for(let[G,F]of Object.entries(X.select)){let H=R(q,G);if(H&&P(F)&&F.where!==void 0)W(H,F.where,"where",J,Q+1)}continue}let C=R(q,$);if(C)d(C,X,J,Q+1)}}}var Qq=["some","every","none","is","isNot"];function W(q,z,J,Q,Z){if(Z>w)return;if(Array.isArray(z)){for(let $ of z)W(q,$,J,Q,Z);return}if(!P(z))return;for(let[$,X]of Object.entries(z)){if(X===void 0)continue;if($==="AND"||$==="OR"||$==="NOT"){W(q,X,J,Q,Z);continue}let C=q.fields[$];if(C){if(C.encrypted===!0&&!t(X))L(q,$,J,Q);continue}let G=R(q,$);if(G){if(!P(X))continue;let F=Object.keys(X).filter((H)=>Qq.includes(H));if(F.length>0)for(let H of F)W(G,X[H],J,Q,Z+1);else W(G,X,J,Q,Z+1);continue}if(P(X)){for(let F of Object.keys(X))if(q.fields[F]?.encrypted===!0)L(q,F,J,Q)}}}function K(q,z,J,Q){if(Q>w)return;if(Array.isArray(z)){for(let Z of z)K(q,Z,J,Q);return}if(!P(z))return;for(let[Z,$]of Object.entries(z)){if(q.fields[Z]?.encrypted===!0)L(q,Z,"orderBy",J);let X=R(q,Z);if(X&&P($)&&!("_count"in $))K(X,$,J,Q+1)}}function o(q,z,J,Q){let Z=typeof z==="string"?[z]:Array.isArray(z)?z.filter(($)=>typeof $==="string"):P(z)?Object.keys(z).filter(($)=>z[$]):[];for(let $ of Z)if(q.fields[$]?.encrypted===!0)L(q,$,J,Q)}function B(q,z,J){if(Array.isArray(z)){for(let Q of z)B(q,Q,J);return}if(!P(z))return;for(let[Q,Z]of Object.entries(z)){if(Q==="AND"||Q==="OR"||Q==="NOT"){B(q,Z,J);continue}if(q.fields[Q]?.encrypted===!0&&!t(Z))L(q,Q,"having",J)}}function t(q){if(q===null)return!0;if(!P(q))return!1;let z=Object.entries(q).filter(([,J])=>J!==void 0);return z.length>0&&z.every(([J,Q])=>(J==="equals"||J==="not")&&Q===null)}function L(q,z,J,Q){throw new m(J,Q.model,Q.operation,`${q.name}.${z} is an encrypted column: each write stores a different random ciphertext, so the database cannot compare, sort or group by it. Only null checks work on it ({ ${z}: null } or { ${z}: { not: null } }). To look a row up by a secret, store a keyed hash of it in a separate column and filter on that.`)}function Yq(q,z,J){let Q=T(q);if(Q.length===0||!P(J))return J;let Z={model:q.name,operation:z},$,X=(F)=>($??=c()).encrypt(F),C=J,G=(F,H)=>{if(H===C[F])return;if(C===J)C={...J};C[F]=H};switch(z){case"create":case"update":case"updateMany":G("data",V(Q,J.data,X,Z));break;case"createMany":G("data",Array.isArray(J.data)?Zq(J.data,(F)=>V(Q,F,X,Z)):V(Q,J.data,X,Z));break;case"upsert":G("create",V(Q,J.create,X,Z)),G("update",V(Q,J.update,X,Z));break}return C}function V(q,z,J,Q){if(!P(z))return z;let Z;for(let $ of q){if(!($ in z))continue;let X=z[$],C=s($,X,J,Q);if(C!==X)(Z??={...z})[$]=C}return Z??z}function s(q,z,J,Q){if(z===void 0||z===null)return z;if(typeof z==="string")return J(z);if(P(z)&&Object.keys(z).length===1&&"set"in z){let Z=z.set;return Z===null||Z===void 0?z:{set:s(q,Z,J,Q)}}throw new g("data",Q.model,Q.operation,`${Q.model}.${q} is an encrypted column and takes a string or null (or { set: string | null }); got ${Cq(z)}.`)}function Zq(q,z){let J;return q.forEach((Q,Z)=>{let $=z(Q);if($!==Q)(J??=[...q])[Z]=$}),J??q}function $q(q,z){let J=T(q);if(J.length===0||z.length===0)return;let Q;for(let Z of z){if(!P(Z))continue;for(let $ of J){let X=Z[$];if(typeof X!=="string")continue;Q??=c();try{Z[$]=Q.decrypt(X)}catch(C){if(C instanceof N)C.column={model:q.name,field:$},C.message=`Could not decrypt ${q.name}.${$}: ${C.message}`;throw C}}}}function Xq(q,z){let J=O(q.model),Q=[];for(let Z of z){if(!P(Z))continue;let $=Z[q.as];if(Array.isArray($))Q.push(...$);else if(P($))Q.push($)}if(Q.length===0)return;if(J)$q(J,Q);for(let Z of q.folded??[])Xq(Z,Q)}function O(q){if(!S(q))return;return _(q).$schema}function R(q,z){let J=q.relations[z];return J?O(J.model):void 0}function P(q){return typeof q==="object"&&q!==null&&!Array.isArray(q)&&!(q instanceof Date)}function Cq(q){if(Array.isArray(q))return"an array";if(q instanceof Date)return"a Date";return`a ${typeof q}`}
|
|
3
|
+
export{i as Wi,S as Xi,_ as Yi,x as Zi,b as _i,Y as $i,U as aj,N as bj,T as cj,Mq as dj,c as ej,Nq as fj,Vq as gj,Lq as hj,Yq as ij,$q as jj,Xq as kj};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=7B54FE4E8E87DFDD64756E2164756E21
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"import { app } from \"../foundation/app\";\nimport {\n DecryptionError,\n Encrypter,\n EncryptionKeyError,\n} from \"../services/encryption/Encrypter\";\nimport { InvalidArgumentError, UnsupportedByDesignError } from \"./errors\";\nimport * as registry from \"./registry\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * Encrypted columns: a `String` field marked `/// @gemi.encrypted` in the\n * Prisma schema is stored as an `Encrypter` envelope and read back as the\n * plaintext.\n *\n * Applied in `Model.$exec`, per model, at the two places a value crosses the\n * boundary:\n *\n * - **Writes** encrypt the model's *own* columns in `data` (and an upsert's\n * `create` / `update`). A nested write into a related model is not touched\n * here: every nested write runs through the related model's own `$exec`,\n * which encrypts its own columns, so encrypting it here as well would\n * encrypt it twice.\n * - **Reads** decrypt the model's own rows after shaping. A batched `include`\n * comes back through the child's `$exec` and is already decrypted; a folded\n * (lateral) one never enters it, so the parent decrypts those rows on the\n * child's behalf (`decryptFolded`) — the same split `redactFolded` handles\n * for policies.\n *\n * The schema, not the model class, says which columns are encrypted. That is\n * deliberate: a column that is encrypted when written through `FigmaConnection`\n * and plaintext when written through `FigmaConnectionModel` is not encrypted\n * at rest. The generated base, the subclass and every `Model.on(...)` variant\n * share one `$schema`, so none of them can write the column in the clear.\n *\n * A filter, sort or grouping on an encrypted column is refused: every write\n * stores a different random ciphertext, so the database cannot compare it to\n * anything. A null check is the exception, because a NULL column is stored as\n * NULL.\n */\n\nconst fieldsBySchema = new WeakMap<ModelSchema, readonly string[]>();\n\n/** The schema's encrypted fields, in declaration order. Empty for most models. */\nexport function encryptedFields(schema: ModelSchema): readonly string[] {\n let fields = fieldsBySchema.get(schema);\n if (fields === undefined) {\n fields = Object.values(schema.fields)\n .filter((field) => field.encrypted === true)\n .map((field) => field.name);\n fieldsBySchema.set(schema, fields);\n }\n return fields;\n}\n\n/** `Model.field` for every encrypted column of every registered model. */\nexport function encryptedColumnsInRegistry(): string[] {\n const seen = new Set<string>();\n const columns: string[] = [];\n for (const name of registry.registeredNames()) {\n const schema = schemaOf(name);\n if (!schema || seen.has(schema.name)) continue;\n seen.add(schema.name);\n for (const field of encryptedFields(schema)) columns.push(`${schema.name}.${field}`);\n }\n return columns;\n}\n\n/**\n * The application's `Encrypter`. An application booted without the\n * framework's providers (a test harness that binds only the database) gets a\n * typed error naming the fix rather than a container error.\n */\nexport function currentEncrypter(): Encrypter {\n const application = app();\n if (!application.bound(Encrypter)) {\n throw new EncryptionKeyError(\n \"Encrypted columns need an Encrypter, and none is bound in this \" +\n \"application. A booted Kernel binds one from the `encryption` config \" +\n \"slice; a hand-built Application can bind its own: \" +\n \"`application.instance(Encrypter, new Encrypter({ keys: { k1: key } }))`.\",\n );\n }\n return application.make(Encrypter);\n}\n\n// --- the internal raw mode ---------------------------------------------------\n\n/**\n * Marks an `$exec` call as reading and writing encrypted columns *as stored*:\n * no decryption of results, no encryption of `data`, and filters on encrypted\n * columns allowed (compared against the envelope). Used by `encryption:rotate`\n * to compare-and-swap one envelope for another. A module-private symbol, like\n * the other `$exec` markers, so an application cannot set it.\n */\nconst RAW = Symbol(\"gemi.orm.encryptedColumnsRaw\");\n\nexport function markEncryptionRaw<T extends object>(options: T): T {\n return { ...options, [RAW]: true };\n}\n\nexport function isEncryptionRaw(options: unknown): boolean {\n return (\n typeof options === \"object\" &&\n options !== null &&\n (options as Record<symbol, unknown>)[RAW] === true\n );\n}\n\n// --- refusing filters --------------------------------------------------------\n\ninterface Origin {\n model: string;\n operation: string;\n}\n\n/**\n * Refuses any argument that would make the database compare, sort or group an\n * encrypted column: `where` (including relation filters into other models),\n * `orderBy`, `distinct`, `cursor`, `groupBy`'s `by` and `having`, the\n * `_min` / `_max` aggregates, and the same arguments nested inside an\n * `include` or `select`.\n *\n * Walked whether or not this model has encrypted columns, because a relation\n * filter or an include reaches other models'.\n */\nexport function assertNoEncryptedFilters(schema: ModelSchema, op: string, args: unknown): void {\n if (!isObject(args)) return;\n const origin: Origin = { model: schema.name, operation: op };\n readArgs(schema, args, origin, 0);\n for (const key of [\"by\", \"_min\", \"_max\", \"_avg\", \"_sum\"]) {\n if (args[key] !== undefined) fieldList(schema, args[key], key, origin);\n }\n if (args.having !== undefined) having(schema, args.having, origin);\n}\n\n/** Generous: relation depth is bounded by `MAX_RELATION_DEPTH` long before this. */\nconst MAX_WALK_DEPTH = 64;\n\nfunction readArgs(schema: ModelSchema, args: Record<string, any>, origin: Origin, depth: number) {\n if (depth > MAX_WALK_DEPTH) return;\n if (args.where !== undefined) where(schema, args.where, \"where\", origin, depth);\n if (args.cursor !== undefined) where(schema, args.cursor, \"cursor\", origin, depth);\n if (args.orderBy !== undefined) orderBy(schema, args.orderBy, origin, depth);\n if (args.distinct !== undefined) fieldList(schema, args.distinct, \"distinct\", origin);\n\n for (const projection of [args.include, args.select]) {\n if (!isObject(projection)) continue;\n for (const [key, value] of Object.entries(projection)) {\n if (!isObject(value)) continue;\n if (key === \"_count\") {\n if (!isObject(value.select)) continue;\n for (const [name, count] of Object.entries(value.select)) {\n const target = relationTarget(schema, name);\n if (target && isObject(count) && count.where !== undefined) {\n where(target, count.where, \"where\", origin, depth + 1);\n }\n }\n continue;\n }\n const target = relationTarget(schema, key);\n if (target) readArgs(target, value, origin, depth + 1);\n }\n }\n}\n\nconst RELATION_FILTERS = [\"some\", \"every\", \"none\", \"is\", \"isNot\"];\n\nfunction where(\n schema: ModelSchema,\n node: unknown,\n argument: string,\n origin: Origin,\n depth: number,\n): void {\n if (depth > MAX_WALK_DEPTH) return;\n if (Array.isArray(node)) {\n for (const item of node) where(schema, item, argument, origin, depth);\n return;\n }\n if (!isObject(node)) return;\n\n for (const [key, value] of Object.entries(node)) {\n if (value === undefined) continue;\n\n if (key === \"AND\" || key === \"OR\" || key === \"NOT\") {\n where(schema, value, argument, origin, depth);\n continue;\n }\n\n const field = schema.fields[key];\n if (field) {\n if (field.encrypted === true && !isNullCheck(value)) {\n refuse(schema, key, argument, origin);\n }\n continue;\n }\n\n const target = relationTarget(schema, key);\n if (target) {\n if (!isObject(value)) continue;\n const filters = Object.keys(value).filter((name) => RELATION_FILTERS.includes(name));\n if (filters.length > 0) {\n for (const name of filters) where(target, value[name], argument, origin, depth + 1);\n } else {\n where(target, value, argument, origin, depth + 1);\n }\n continue;\n }\n\n // A compound unique key — `provider_providerId: { provider, providerId }`.\n if (isObject(value)) {\n for (const name of Object.keys(value)) {\n if (schema.fields[name]?.encrypted === true) refuse(schema, name, argument, origin);\n }\n }\n }\n}\n\nfunction orderBy(schema: ModelSchema, node: unknown, origin: Origin, depth: number): void {\n if (depth > MAX_WALK_DEPTH) return;\n if (Array.isArray(node)) {\n for (const item of node) orderBy(schema, item, origin, depth);\n return;\n }\n if (!isObject(node)) return;\n for (const [key, value] of Object.entries(node)) {\n if (schema.fields[key]?.encrypted === true) refuse(schema, key, \"orderBy\", origin);\n const target = relationTarget(schema, key);\n if (target && isObject(value) && !(\"_count\" in value)) {\n orderBy(target, value, origin, depth + 1);\n }\n }\n}\n\n/** `distinct`, `by`, and the `_min` / `_max` / `_avg` / `_sum` selections. */\nfunction fieldList(schema: ModelSchema, node: unknown, argument: string, origin: Origin): void {\n const names =\n typeof node === \"string\"\n ? [node]\n : Array.isArray(node)\n ? node.filter((name): name is string => typeof name === \"string\")\n : isObject(node)\n ? Object.keys(node).filter((name) => node[name])\n : [];\n for (const name of names) {\n if (schema.fields[name]?.encrypted === true) refuse(schema, name, argument, origin);\n }\n}\n\nfunction having(schema: ModelSchema, node: unknown, origin: Origin): void {\n if (Array.isArray(node)) {\n for (const item of node) having(schema, item, origin);\n return;\n }\n if (!isObject(node)) return;\n for (const [key, value] of Object.entries(node)) {\n if (key === \"AND\" || key === \"OR\" || key === \"NOT\") {\n having(schema, value, origin);\n continue;\n }\n if (schema.fields[key]?.encrypted === true && !isNullCheck(value)) {\n refuse(schema, key, \"having\", origin);\n }\n }\n}\n\n/** `null`, `{ equals: null }`, `{ not: null }` — the only comparisons a ciphertext supports. */\nfunction isNullCheck(value: unknown): boolean {\n if (value === null) return true;\n if (!isObject(value)) return false;\n const entries = Object.entries(value).filter(([, operand]) => operand !== undefined);\n return (\n entries.length > 0 &&\n entries.every(([operator, operand]) => (operator === \"equals\" || operator === \"not\") && operand === null)\n );\n}\n\nfunction refuse(schema: ModelSchema, field: string, argument: string, origin: Origin): never {\n throw new UnsupportedByDesignError(\n argument,\n origin.model,\n origin.operation,\n `${schema.name}.${field} is an encrypted column: each write stores a ` +\n `different random ciphertext, so the database cannot compare, sort or ` +\n `group by it. Only null checks work on it ({ ${field}: null } or ` +\n `{ ${field}: { not: null } }). To look a row up by a secret, store a ` +\n `keyed hash of it in a separate column and filter on that.`,\n );\n}\n\n// --- writes ------------------------------------------------------------------\n\n/**\n * `args` with this model's encrypted columns encrypted, or `args` itself when\n * there is nothing to encrypt. Never mutates the caller's objects: the same\n * `data` may be reused for a second call.\n *\n * Only `data` (and an upsert's `create` / `update`) at this level. Nested\n * relation writes are left as they are; see the note at the top of the file.\n */\nexport function encryptWriteArgs(schema: ModelSchema, op: string, args: any): any {\n const fields = encryptedFields(schema);\n if (fields.length === 0 || !isObject(args)) return args;\n\n const origin: Origin = { model: schema.name, operation: op };\n let encrypter: Encrypter | undefined;\n const encrypt = (value: string) => (encrypter ??= currentEncrypter()).encrypt(value);\n\n let next = args;\n const replace = (key: string, value: unknown) => {\n if (value === next[key]) return;\n if (next === args) next = { ...args };\n next[key] = value;\n };\n\n switch (op) {\n case \"create\":\n case \"update\":\n case \"updateMany\":\n replace(\"data\", encryptData(fields, args.data, encrypt, origin));\n break;\n case \"createMany\":\n replace(\n \"data\",\n Array.isArray(args.data)\n ? mapIfChanged(args.data, (row) => encryptData(fields, row, encrypt, origin))\n : encryptData(fields, args.data, encrypt, origin),\n );\n break;\n case \"upsert\":\n replace(\"create\", encryptData(fields, args.create, encrypt, origin));\n replace(\"update\", encryptData(fields, args.update, encrypt, origin));\n break;\n }\n return next;\n}\n\nfunction encryptData(\n fields: readonly string[],\n data: unknown,\n encrypt: (value: string) => string,\n origin: Origin,\n): unknown {\n if (!isObject(data)) return data;\n let copy: Record<string, unknown> | undefined;\n for (const name of fields) {\n if (!(name in data)) continue;\n const value = data[name];\n const next = encryptValue(name, value, encrypt, origin);\n if (next !== value) (copy ??= { ...data })[name] = next;\n }\n return copy ?? data;\n}\n\nfunction encryptValue(\n field: string,\n value: unknown,\n encrypt: (value: string) => string,\n origin: Origin,\n): unknown {\n if (value === undefined || value === null) return value;\n if (typeof value === \"string\") return encrypt(value);\n // Prisma's `{ set: value }` spelling of a scalar update.\n if (isObject(value) && Object.keys(value).length === 1 && \"set\" in value) {\n const set = value.set;\n return set === null || set === undefined ? value : { set: encryptValue(field, set, encrypt, origin) };\n }\n throw new InvalidArgumentError(\n \"data\",\n origin.model,\n origin.operation,\n `${origin.model}.${field} is an encrypted column and takes a string or ` +\n `null (or { set: string | null }); got ${describe(value)}.`,\n );\n}\n\nfunction mapIfChanged<T>(items: T[], fn: (item: T) => T): T[] {\n let copy: T[] | undefined;\n items.forEach((item, index) => {\n const next = fn(item);\n if (next !== item) (copy ??= [...items])[index] = next;\n });\n return copy ?? items;\n}\n\n// --- reads -------------------------------------------------------------------\n\n/**\n * Decrypts this model's encrypted columns on `rows`, in place. A value that\n * does not decrypt raises `DecryptionError` naming the column — a ciphertext\n * is never handed back as if it were the value.\n */\nexport function decryptRows(schema: ModelSchema, rows: readonly unknown[]): void {\n const fields = encryptedFields(schema);\n if (fields.length === 0 || rows.length === 0) return;\n\n let encrypter: Encrypter | undefined;\n for (const row of rows) {\n if (!isObject(row)) continue;\n for (const field of fields) {\n const value = row[field];\n if (typeof value !== \"string\") continue;\n encrypter ??= currentEncrypter();\n try {\n row[field] = encrypter.decrypt(value);\n } catch (error) {\n if (error instanceof DecryptionError) {\n error.column = { model: schema.name, field };\n error.message = `Could not decrypt ${schema.name}.${field}: ${error.message}`;\n }\n throw error;\n }\n }\n }\n}\n\n/**\n * Decrypts the rows a strategy folded into the parent's statement, which never\n * passed through their own model's `$exec`. Recursive, because the fold is.\n */\nexport function decryptFolded(\n relation: { as: string; model: string; folded?: readonly { as: string; model: string; folded?: readonly unknown[] }[] },\n parents: readonly unknown[],\n): void {\n const schema = schemaOf(relation.model);\n const rows: unknown[] = [];\n for (const parent of parents) {\n if (!isObject(parent)) continue;\n const value = parent[relation.as];\n if (Array.isArray(value)) rows.push(...value);\n else if (isObject(value)) rows.push(value);\n }\n if (rows.length === 0) return;\n if (schema) decryptRows(schema, rows);\n for (const child of relation.folded ?? []) {\n decryptFolded(child as Parameters<typeof decryptFolded>[0], rows);\n }\n}\n\n// --- helpers -----------------------------------------------------------------\n\nfunction schemaOf(model: string): ModelSchema | undefined {\n if (!registry.has(model)) return undefined;\n return registry.get<{ $schema?: ModelSchema }>(model).$schema;\n}\n\nfunction relationTarget(schema: ModelSchema, name: string): ModelSchema | undefined {\n const relation = schema.relations[name];\n return relation ? schemaOf(relation.model) : undefined;\n}\n\nfunction isObject(value: unknown): value is Record<string, any> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) && !(value instanceof Date);\n}\n\nfunction describe(value: unknown): string {\n if (Array.isArray(value)) return \"an array\";\n if (value instanceof Date) return \"a Date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64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ll as J}from"./chunk-5aj27bgc.js";class L{kernel;onException;constructor(f){this.kernel=new f.kernel,this.kernel.boot.call(this.kernel),this.onException=f.onException??((A)=>{console.error("Unhandled exception in App:",A)})}async waitForBoot(){await this.kernel.waitForBoot()}getComponentTree(){return this.kernel.viewRoutes().componentTree}getFlatComponentTree(){let f=new Set;for(let A of this.kernel.domains().viewDispatchers())for(let C of A.flatComponentTree)f.add(C);return Array.from(f)}devAllowedHosts(){let f=this.kernel.domains();if(!f.resolver)return[];return f.acceptsCustomDomains?!0:[`.${f.resolver.root}`]}sockets(){return this.kernel.sockets.call(this.kernel)}applyTrustedClientIp(f){this.kernel.domains().resolver?.applyClientIp(f)}getRouteManifest(){return this.kernel.viewRoutes().routeManifest}globallyGated=new WeakMap;async withGlobalMiddleware(f,A,C){let z;try{z=await this.kernel.run.call(this.kernel,()=>this.kernel.globalMiddleware(f))}catch(F){return await C(F)}if(z.refusal)return z.refusal;return this.globallyGated.set(f,z.carried),z.apply(await A(f))}async fetch(f){let A=new URL(f.url);return this.kernel.run.call(this.kernel,async()=>{this.applyTrustedClientIp(f);let C=this.globallyGated.has(f),z=C?null:await this.kernel.globalMiddleware(f),F=C?this.globallyGated.get(f):z.carried;if(z?.refusal)return z.refusal;let H=this.kernel.mcpHttp();if(H){let B=await H.handle(f);if(B)return z?z.apply(B):B}let I=this.kernel.domains(),D=await I.ask(f)??await I.route(f);if(D instanceof Response)return z?z.apply(D):D;if(!D){let B=new Response("Unknown host",{status:404});return z?z.apply(B):B}let G=J(A.pathname)?await D.api.handleApiRequest(f,F):await D.view.handleViewRequest(f,F);if(!z)return G;if(typeof G==="function"){let B=G;return async(...M)=>z.apply(await B(...M))}return z.apply(G)})}dispatchJob(f,A){return this.kernel.run.bind(this.kernel)(()=>{return this.kernel.queue().dispatchJob(f,A)})}shutdown(f){return this.kernel.shutdown(f)}destroy(){this.kernel.destroy()}clone(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)}}export{L as Da};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=18FFF6D4AD4E3DB664756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { Kernel } from \"../kernel\";\nimport type { CarriedContext } from \"../http/requestContext\";\nimport { isApiPath } from \"../services/router/apiPath\";\nimport type { SocketHub } from \"../services/broadcast/SocketHub\";\n\n/** What the servers use of the broadcast `SocketHub`. */\nexport type SocketTransport = Pick<\n SocketHub,\n \"matches\" | \"upgrade\" | \"websocket\" | \"socketOptions\" | \"start\" | \"shutdown\"\n>;\n\ninterface AppParams {\n kernel: new () => Kernel;\n onException?: (error: Error) => void;\n}\n\nexport class App {\n private kernel: Kernel;\n public onException?: (error: Error) => void;\n\n constructor(params: AppParams) {\n this.kernel = new params.kernel();\n this.kernel.boot.call(this.kernel);\n this.onException =\n params.onException ??\n ((error: Error) => {\n console.error(\"Unhandled exception in App:\", error);\n });\n }\n\n // Every service this class touches is resolved through a `this.kernel.*`\n // accessor rather than by importing the service class and calling `app()`\n // here. That is deliberate: the built bin (`dist/bin/gemi.js`) bundles its own\n // copy of gemi, while the app's Kernel is loaded from source and resolves\n // `gemi/*` to the source modules — so the two copies have *different*\n // `kernelContext` AsyncLocalStorage instances and different `Application`\n // class objects. A method call on the Kernel executes in the app's copy and\n // reads the app's container; a resolution attempted here would not. Service\n // *tokens* still cross the boundary safely (they are plain strings), which is\n // why `kernel.resolve()` works from either side.\n public async waitForBoot() {\n await this.kernel.waitForBoot();\n }\n\n public getComponentTree() {\n return this.kernel.viewRoutes().componentTree;\n }\n\n // Every host group's views, not just the root's: the servers load these\n // modules up front, and a view only an `admin.` group routes to still has\n // to be among them.\n public getFlatComponentTree() {\n const views = new Set<string>();\n for (const dispatcher of this.kernel.domains().viewDispatchers()) {\n for (const view of dispatcher.flatComponentTree) {\n views.add(view);\n }\n }\n return Array.from(views);\n }\n\n /**\n * The hosts the dev server's Vite may answer: the `route.domains` root and\n * its subdomains, or any host when custom domains are on, since those are\n * only known to the app's resolver.\n */\n public devAllowedHosts(): true | string[] {\n const domains = this.kernel.domains();\n if (!domains.resolver) {\n return [];\n }\n return domains.acceptsCustomDomains ? true : [`.${domains.resolver.root}`];\n }\n\n /**\n * The broadcast WebSocket endpoint the servers wire into `Bun.serve`, or\n * `null` when the app has no `route.channels`. Typed structurally: the hub\n * belongs to the app's copy of gemi (see the note above).\n */\n public sockets(): SocketTransport | null {\n return this.kernel.sockets.call(this.kernel);\n }\n\n /**\n * Applies `route.domains.trustProxy.clientIpHeader`: on a request that\n * carries the proxy's secret, the address that header names becomes the\n * one in `X-Forwarded-For`. The servers call it right after settling\n * `X-Forwarded-For` (`GEMI_TRUST_PROXY`) and before anything reads it —\n * the socket upgrade and the global middleware included. `fetch` calls it\n * too, for a caller that is not one of the servers. Idempotent.\n */\n public applyTrustedClientIp(req: Request) {\n this.kernel.domains().resolver?.applyClientIp(req);\n }\n\n public getRouteManifest() {\n return this.kernel.viewRoutes().routeManifest;\n }\n\n // Requests `withGlobalMiddleware` already ran the global middleware for, so\n // `fetch` inside it does not run the list a second time, and can still hand\n // the route what the list carried. Keyed by the Request object: the servers\n // hand `fetch` the same one they gated.\n private globallyGated = new WeakMap<Request, CarriedContext | null>();\n\n /**\n * Runs the `global` middleware list, then `next` — what the servers put in\n * front of everything they serve, so the list covers static files, which\n * never reach `fetch`, as well as routes. A refusal is answered without\n * calling `next`. A global middleware that throws something other than a\n * break is answered by `onError` rather than by `next`, since a gate that\n * failed must not let a static file through.\n */\n public async withGlobalMiddleware(\n req: Request,\n next: (req: Request) => Promise<Response>,\n onError: (err: unknown) => Response | Promise<Response>,\n ): Promise<Response> {\n let outcome: Awaited<ReturnType<Kernel[\"globalMiddleware\"]>>;\n try {\n outcome = await this.kernel.run.call(this.kernel, () => this.kernel.globalMiddleware(req));\n } catch (err) {\n return await onError(err);\n }\n if (outcome.refusal) {\n return outcome.refusal;\n }\n this.globallyGated.set(req, outcome.carried);\n return outcome.apply(await next(req));\n }\n\n public async fetch(req: Request): Promise<Response> {\n const url = new URL(req.url);\n return this.kernel.run.call(this.kernel, async () => {\n // Repeated from the servers, for a caller that is not one of them.\n this.applyTrustedClientIp(req);\n // Run here too for a caller that is not one of the servers, a test or an\n // app's own `Bun.serve`, so the list is not skipped by calling `fetch`.\n const gated = this.globallyGated.has(req);\n const outcome = gated ? null : await this.kernel.globalMiddleware(req);\n const carried = gated ? this.globallyGated.get(req) : outcome.carried;\n if (outcome?.refusal) {\n return outcome.refusal;\n }\n // The MCP endpoint, and its OAuth endpoints, on the host it is\n // configured for. Ahead of routing, so no route can shadow it, and after\n // the global middleware, which covers it as it covers everything.\n const mcp = this.kernel.mcpHttp();\n if (mcp) {\n const answered = await mcp.handle(req);\n if (answered) {\n return outcome ? outcome.apply(answered) : answered;\n }\n }\n const domains = this.kernel.domains();\n const dispatchers = (await domains.ask(req)) ?? (await domains.route(req));\n if (dispatchers instanceof Response) {\n return outcome ? outcome.apply(dispatchers) : dispatchers;\n }\n if (!dispatchers) {\n const unknown = new Response(\"Unknown host\", { status: 404 });\n return outcome ? outcome.apply(unknown) : unknown;\n }\n const result = isApiPath(url.pathname)\n ? await dispatchers.api.handleApiRequest(req, carried)\n : await dispatchers.view.handleViewRequest(req, carried);\n if (!outcome) {\n return result;\n }\n // A document comes back as a render function the server calls with its\n // manifests, and the Response only exists once it has.\n if (typeof result === \"function\") {\n const render = result as (...args: any[]) => Promise<Response>;\n return (async (...args: any[]) => outcome.apply(await render(...args))) as any;\n }\n return outcome.apply(result);\n });\n }\n\n public dispatchJob(jobName: string, args: string) {\n const kernelRun = this.kernel.run.bind(this.kernel);\n return kernelRun(() => {\n return this.kernel.queue().dispatchJob(jobName, args);\n });\n }\n\n /** Every provider's `shutdown()`; see `Kernel.shutdown`. */\n public shutdown(options?: { timeoutMs?: number }) {\n return this.kernel.shutdown(options);\n }\n\n public destroy() {\n this.kernel.destroy();\n }\n\n public clone() {\n return Object.assign(Object.create(Object.getPrototypeOf(this)), this);\n }\n}\n\nexport type FetchHandler = InstanceType<typeof App>[\"fetch\"];\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";yCAgBO,MAAM,CAAI,CACP,OACD,YAEP,WAAW,CAAC,EAAmB,CAC7B,KAAK,OAAS,IAAI,EAAO,OACzB,KAAK,OAAO,KAAK,KAAK,KAAK,MAAM,EACjC,KAAK,YACH,EAAO,cACN,CAAC,IAAiB,CACjB,QAAQ,MAAM,8BAA+B,CAAK,SAc3C,YAAW,EAAG,CACzB,MAAM,KAAK,OAAO,YAAY,EAGzB,gBAAgB,EAAG,CACxB,OAAO,KAAK,OAAO,WAAW,EAAE,cAM3B,oBAAoB,EAAG,CAC5B,IAAM,EAAQ,IAAI,IAClB,QAAW,KAAc,KAAK,OAAO,QAAQ,EAAE,gBAAgB,EAC7D,QAAW,KAAQ,EAAW,kBAC5B,EAAM,IAAI,CAAI,EAGlB,OAAO,MAAM,KAAK,CAAK,EAQlB,eAAe,EAAoB,CACxC,IAAM,EAAU,KAAK,OAAO,QAAQ,EACpC,GAAI,CAAC,EAAQ,SACX,MAAO,CAAC,EAEV,OAAO,EAAQ,qBAAuB,GAAO,CAAC,IAAI,EAAQ,SAAS,MAAM,EAQpE,OAAO,EAA2B,CACvC,OAAO,KAAK,OAAO,QAAQ,KAAK,KAAK,MAAM,EAWtC,oBAAoB,CAAC,EAAc,CACxC,KAAK,OAAO,QAAQ,EAAE,UAAU,cAAc,CAAG,EAG5C,gBAAgB,EAAG,CACxB,OAAO,KAAK,OAAO,WAAW,EAAE,cAO1B,cAAgB,IAAI,aAUf,qBAAoB,CAC/B,EACA,EACA,EACmB,CACnB,IAAI,EACJ,GAAI,CACF,EAAU,MAAM,KAAK,OAAO,IAAI,KAAK,KAAK,OAAQ,IAAM,KAAK,OAAO,iBAAiB,CAAG,CA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,MAAM,EAAO,GAAG,CAAI,CAAC,EAEvE,OAAO,EAAQ,MAAM,CAAM,EAC5B,EAGI,WAAW,CAAC,EAAiB,EAAc,CAEhD,OADkB,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EACjC,IAAM,CACrB,OAAO,KAAK,OAAO,MAAM,EAAE,YAAY,EAAS,CAAI,EACrD,EAII,QAAQ,CAAC,EAAkC,CAChD,OAAO,KAAK,OAAO,SAAS,CAAO,EAG9B,OAAO,EAAG,CACf,KAAK,OAAO,QAAQ,EAGf,KAAK,EAAG,CACb,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,eAAe,IAAI,CAAC,EAAG,IAAI,EAEzE",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "18FFF6D4AD4E3DB664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-dvwdehnp.js";import"./chunk-yxhg3wjf.js";import"./chunk-jrvg80jw.js";import"./chunk-tbhtx2t0.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
|
|
3
3
|
|
|
4
4
|
//# debugId=30E142423ED216F064756E2164756E21
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Aj as P,oj as X}from"./chunk-pv2mtg8n.js";function f(){return{now:new Date,resolved:{}}}var b={now:new Date(0),resolved:{}};function x(z){return(G,H=b)=>{let V=[];for(let Z=0;Z<z.length;Z++)V.push(z[Z](G,H));return V}}var j="\x00";function W(z){return{text:z,binders:[]}}function Q(z,G=""){return{text:j+G,binders:[z]}}function p(z){return z.text.split(j)}function m(z,G){return{text:z.join(j),binders:G}}function $(...z){return I(z,"")}function I(z,G){let H="",V=[];for(let Z=0;Z<z.length;Z++){if(Z>0)H+=G;H+=z[Z].text;for(let Y of z[Z].binders)V.push(Y)}return{text:H,binders:V}}function c(z,G,H){let V=z.text.split(j),Z=V.length-1;if(Z!==z.binders.length)throw Error(`Compiled ${Z} parameter placeholders but collected ${z.binders.length} binders.`);if(Z>G.maxBoundParameters)throw new P(H.model,H.operation,Z,G.maxBoundParameters,G.name,G.bindsListAsOneParameter?"That is one parameter per value in the statement.":`That is one parameter per value, and on ${G.name} each element of an 'in' list counts separately.`);let Y=V[0];for(let B=0;B<Z;B++)Y+=G.placeholder(B)+V[B+1];return{text:Y,binders:z.binders}}class K{name="postgres";supportsInsensitiveMode=!0;bindsListAsOneParameter=!0;supportsReturning=!0;maxBoundParameters=65535;typesParametersFromStatement=!0;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return`$${z+1}`}inList(z,G,H,V){return $(W(`${z} ${G?"<> all":"= any"} (`),Q((Y,B)=>C(V(Y,B))),W(")"))}static COMPOSITE_IN_TYPES={Int:"int",BigInt:"bigint",String:"text",Boolean:"boolean"};canBindCompositeIn(z){return z.length>0&&z.every((G)=>K.COMPOSITE_IN_TYPES[G])}compositeIn(z,G,H){let V=z.map((Z,Y)=>$(Q((B,J)=>C(H(B,J).map((F)=>F[Y]))),W(`::${K.COMPOSITE_IN_TYPES[G[Y]]}[]`)));return $(W(`(${z.join(", ")}) in (select * from unnest(`),...V.flatMap((Z,Y)=>Y===0?[Z]:[W(", "),Z]),W("))"))}listFilters=new Set(["equals","has","hasEvery","hasSome","isEmpty"]);listHas(z,G){return $(G,W(` = any(${z})`))}listHasEvery(z,G){return $(W(`${z} @> `),G)}listHasSome(z,G){return $(W(`${z} && `),G)}listIsEmpty(z,G){return $(W(`${z} ${G?"=":"<>"} `),Q(()=>C([])))}listPush(z,G){return $(W(`array_cat(${z}, `),G,W(")"))}jsonPathSyntax="array";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"]);jsonComparesAsText=!0;jsonExtract(z,G,H){return $(W(`${z} ${H?"#>>":"#>"} `),Q((V,Z)=>C(G(V,Z))))}jsonValueAt(z,G){return $(W("("),this.jsonExtract(z,G,!1),W(")::jsonb"))}jsonHasKeys(z,G,H,V){let Z=()=>G===void 0?W(`(${z})::jsonb`):$(W("("),this.jsonExtract(z,G,!1),W(")::jsonb")),Y=V==="one"?$(Q(H),W("::text")):$(Q((J,F)=>C(H(J,F)??[])),W("::text[]")),B=V==="one"?"?":V==="some"?"?|":"?&";return $(W("(jsonb_typeof("),Z(),W(") = 'object' and "),Z(),W(` ${B} `),Y,W(")"))}distinctFrom(z,G,H){let V=H.type==="Json"&&!H.isList;return $(W(V?`(${z})::jsonb is distinct from `:`${z} is distinct from `),G)}jsonArrayContains(z,G,H){return $(W("("),this.jsonExtract(z,G,!1),W(") @> "),Q((V,Z)=>{let Y=H(V,Z);if(Y===null||Y===void 0)return null;return typeof Y==="string"||typeof Y==="object"?Y:JSON.stringify(Y)}),W("::jsonb"))}like(z,G,H){return $(W(`${z} ${G?"ilike":"like"} `),Q(H))}ignoreConflicts(){return W(" on conflict do nothing")}rowLock(z,G){let H=z.onLocked==="skipLocked"?" skip locked":z.onLocked==="noWait"?" nowait":"";return W(` for ${z.mode==="share"?"share":"update"} of ${this.quoteIdent(G)}${H}`)}paginate(z,G){let H=[];if(z)H.push($(W(" limit "),Q(z)));if(G)H.push($(W(" offset "),Q(G)));return $(...H)}constraintViolation(z){let G=z;if(!G)return null;if(String(G.errno??G.code??"")!=="23505")return null;let V=typeof G.constraint==="string"&&G.constraint!==""?G.constraint:void 0,Z=typeof G.detail==="string"?G.detail:"",Y=/\((.+?)\)=/.exec(Z);return{kind:"unique",columns:Y?(Y[1].match(/"(?:[^"]|"")*"|[^,]+/g)??[]).map((J)=>J.trim()).filter((J)=>J!=="").map((J)=>/^".*"$/s.test(J)?J.slice(1,-1).replace(/""/g,'"'):J):[],constraint:V}}castParameter(z){if(z.isList)return"";return z.type==="Json"?"::text::jsonb":""}encode(z,G){if(z===null||z===void 0)return null;if(G.isList){if(!Array.isArray(z))throw Error(`gemi ORM bug: a non-array reached the parameter binder for the scalar list '${G.column}' (received ${typeof z}). Every path that binds a list is supposed to have checked its operand.`);return C(G.type==="Json"?z.map((H)=>H===null||H===void 0?null:JSON.stringify(H)):z)}return z}encodeUntyped(z){return z}needsDecode(z){return z.isList===!0||z.type==="BigInt"||z.type==="Bytes"}decode(z,G){if(z===null||z===void 0)return null;if(G.isList)return this.decodeList(z,G);return this.decodeScalar(z,G)}decodeList(z,G){let H=Array.isArray(z)?z:typeof z==="string"?E(z,G):ArrayBuffer.isView(z)?Array.from(z):null;if(H===null)throw new X(G,z);return H.map((V)=>V===null||V===void 0?null:this.decodeScalar(V,G))}decodeScalar(z,G){switch(G.type){case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":return z;case"Bytes":return Buffer.isBuffer(z)?new Uint8Array(z.buffer,z.byteOffset,z.byteLength):z;default:return z}}}function C(z){let G="{";for(let H=0;H<z.length;H++){if(H>0)G+=",";G+=D(z[H])}return G+"}"}function D(z){if(z===null||z===void 0)return"NULL";if(z instanceof Date)return`"${z.toISOString()}"`;if(ArrayBuffer.isView(z)){let H="";for(let V of new Uint8Array(z.buffer,z.byteOffset,z.byteLength))H+=V.toString(16).padStart(2,"0");return`"\\\\x${H}"`}return`"${(typeof z==="string"?z:String(z)).replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function E(z,G){if(!z.startsWith("{")||!z.endsWith("}"))throw new X(G,z);if(z==="{}")return[];let H=[],V=1,Z=z.length-1;while(V<=Z){let Y="",B=!1;if(z[V]==='"'){B=!0,V++;while(V<Z&&z[V]!=='"')Y+=z[V]==="\\"?z[++V]:z[V],V++;V++}else while(V<Z&&z[V]!==","){if(z[V]==="{")throw new X(G,z);Y+=z[V],V++}if(H.push(!B&&Y.toUpperCase()==="NULL"?null:Y),V<Z&&z[V]!==",")throw new X(G,z);V++}if(G.type!=="Json")return H;return H.map((Y)=>{if(Y===null)return null;try{return JSON.parse(Y)}catch{throw new X(G,Y)}})}var k={"Prisma.DbNull":"db","Prisma.JsonNull":"json","Prisma.AnyNull":"any"};function _(z){return new class{toString(){return z}}}var s=_("Prisma.DbNull"),y=_("Prisma.JsonNull"),u=_("Prisma.AnyNull"),r=y;function A(z){if(typeof z!=="object"||z===null)return null;for(let H in z)return null;if(Object.getOwnPropertyNames(z).length>0)return null;let G;try{G=String(z)}catch{return null}return k[G]??null}var h=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/;function q(z,G){if(z instanceof Date)return z;let H;if(typeof z==="number")H=new Date(z);else if(typeof z==="bigint")H=new Date(Number(z));else if(typeof z==="string")H=new Date(h.test(z)?`${z.replace(" ","T")}Z`:z);else throw new X(G,z);if(Number.isNaN(H.getTime()))throw new X(G,z);return H}class S{name="sqlite";supportsInsensitiveMode=!1;bindsListAsOneParameter=!1;supportsReturning=!0;maxBoundParameters=32766;typesParametersFromStatement=!1;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return"?"}inList(z,G,H,V){let Z=G?"not in":"in",Y=[];for(let B=0;B<H;B++)Y.push(Q((J,F)=>V(J,F)[B]));return $(W(`${z} ${Z} (`),I(Y,", "),W(")"))}canBindCompositeIn(){return!1}compositeIn(){throw Error("SQLite cannot bind a composite `in`; `canBindCompositeIn` is the guard.")}listFilters=new Set;listHas(){throw Error(N("has"))}listHasEvery(){throw Error(N("hasEvery"))}listHasSome(){throw Error(N("hasSome"))}listIsEmpty(){throw Error(N("isEmpty"))}listPush(){throw Error(N("push"))}jsonPathSyntax="jsonpath";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with"]);jsonComparesAsText=!1;jsonExtract(z,G,H){return $(W(`json_extract(${z}, `),Q(G),W(")"))}jsonValueAt(z,G){return $(W(`(${z} -> `),Q(G),W(")"))}jsonHasKeys(z,G,H,V,Z){let Y=(O,U)=>G===void 0?"$":G(O,U),B=(O)=>$(W(`json_type(${z}, `),Q((U,M)=>{let w=H(U,M),L=O===void 0?w:w[O];return`${Y(U,M)}.${JSON.stringify(String(L))}`}),W(") is not null")),J=V==="one"?[B(void 0)]:Array.from({length:Z},(O,U)=>B(U)),F=J.length===0?W(V==="some"?"0":"1"):I(J,V==="every"?" and ":" or ");return $(W(`(json_type(${z}, `),Q(Y),W(") = 'object' and ("),F,W("))"))}distinctFrom(z,G,H){if(H.type==="Json"&&!H.isList)return $(W(`json(${z}) is not json(`),G,W(")"));return $(W(`${z} is not `),G)}jsonArrayContains(){throw Error("SQLite cannot express array_contains; `jsonFilters` is the guard.")}like(z,G,H){return $(W(`${z} like `),Q(H))}ignoreConflicts(){return null}rowLock(z,G){return W("")}paginate(z,G){if(!z&&!G)return W("");if(!G)return $(W(" limit "),Q(z));return $(W(" limit "),Q(z??(()=>-1)),W(" offset "),Q(G))}constraintViolation(z){let G=z?.code;if(G!=="SQLITE_CONSTRAINT_UNIQUE"&&G!=="SQLITE_CONSTRAINT_PRIMARYKEY")return null;let H=String(z.message??""),V=/constraint failed:\s*(.+)$/.exec(H);if(!V)return{kind:"unique",columns:[]};return{kind:"unique",columns:V[1].split(",").map((Y)=>Y.trim()).map((Y)=>{let B=Y.indexOf(".");return B===-1?Y:Y.slice(B+1)}).filter((Y)=>Y!=="")}}castParameter(z){return""}encode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return z instanceof Date?z.getTime():z;case"Boolean":return typeof z==="boolean"?z?1:0:z;case"Json":{let H=A(z);if(H==="db")return null;if(H==="json")return"null";if(H==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the SQLite encoder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.")}return JSON.stringify(z);default:return z}}encodeUntyped(z){if(z instanceof Date)return z.getTime();if(typeof z==="boolean")return z?1:0;return z}needsDecode(z){switch(z.type){case"DateTime":case"Boolean":case"BigInt":case"Json":return!0;default:return!1}}decode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return q(z,G);case"Boolean":if(typeof z==="boolean")return z;return Number(z)!==0;case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":try{return typeof z==="string"?JSON.parse(z):z}catch{throw new X(G,z)}default:return z}}}function N(z){return`SQLite has no array type, so it cannot express '${z}' on a scalar list; \`listFilters\` is the guard.`}class R extends Error{constructor(z){super(`The gemi ORM does not support the '${z}' dialect. Only sqlite `+"and postgres are implemented \u2014 see the supported matrix in "+`docs/orm.md.
|
|
2
|
+
import{Bj as P,pj as X}from"./chunk-e9xbdgb2.js";function f(){return{now:new Date,resolved:{}}}var b={now:new Date(0),resolved:{}};function x(z){return(G,H=b)=>{let V=[];for(let Z=0;Z<z.length;Z++)V.push(z[Z](G,H));return V}}var j="\x00";function W(z){return{text:z,binders:[]}}function Q(z,G=""){return{text:j+G,binders:[z]}}function p(z){return z.text.split(j)}function m(z,G){return{text:z.join(j),binders:G}}function $(...z){return I(z,"")}function I(z,G){let H="",V=[];for(let Z=0;Z<z.length;Z++){if(Z>0)H+=G;H+=z[Z].text;for(let Y of z[Z].binders)V.push(Y)}return{text:H,binders:V}}function c(z,G,H){let V=z.text.split(j),Z=V.length-1;if(Z!==z.binders.length)throw Error(`Compiled ${Z} parameter placeholders but collected ${z.binders.length} binders.`);if(Z>G.maxBoundParameters)throw new P(H.model,H.operation,Z,G.maxBoundParameters,G.name,G.bindsListAsOneParameter?"That is one parameter per value in the statement.":`That is one parameter per value, and on ${G.name} each element of an 'in' list counts separately.`);let Y=V[0];for(let B=0;B<Z;B++)Y+=G.placeholder(B)+V[B+1];return{text:Y,binders:z.binders}}class K{name="postgres";supportsInsensitiveMode=!0;bindsListAsOneParameter=!0;supportsReturning=!0;maxBoundParameters=65535;typesParametersFromStatement=!0;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return`$${z+1}`}inList(z,G,H,V){return $(W(`${z} ${G?"<> all":"= any"} (`),Q((Y,B)=>C(V(Y,B))),W(")"))}static COMPOSITE_IN_TYPES={Int:"int",BigInt:"bigint",String:"text",Boolean:"boolean"};canBindCompositeIn(z){return z.length>0&&z.every((G)=>K.COMPOSITE_IN_TYPES[G])}compositeIn(z,G,H){let V=z.map((Z,Y)=>$(Q((B,J)=>C(H(B,J).map((F)=>F[Y]))),W(`::${K.COMPOSITE_IN_TYPES[G[Y]]}[]`)));return $(W(`(${z.join(", ")}) in (select * from unnest(`),...V.flatMap((Z,Y)=>Y===0?[Z]:[W(", "),Z]),W("))"))}listFilters=new Set(["equals","has","hasEvery","hasSome","isEmpty"]);listHas(z,G){return $(G,W(` = any(${z})`))}listHasEvery(z,G){return $(W(`${z} @> `),G)}listHasSome(z,G){return $(W(`${z} && `),G)}listIsEmpty(z,G){return $(W(`${z} ${G?"=":"<>"} `),Q(()=>C([])))}listPush(z,G){return $(W(`array_cat(${z}, `),G,W(")"))}jsonPathSyntax="array";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"]);jsonComparesAsText=!0;jsonExtract(z,G,H){return $(W(`${z} ${H?"#>>":"#>"} `),Q((V,Z)=>C(G(V,Z))))}jsonValueAt(z,G){return $(W("("),this.jsonExtract(z,G,!1),W(")::jsonb"))}jsonHasKeys(z,G,H,V){let Z=()=>G===void 0?W(`(${z})::jsonb`):$(W("("),this.jsonExtract(z,G,!1),W(")::jsonb")),Y=V==="one"?$(Q(H),W("::text")):$(Q((J,F)=>C(H(J,F)??[])),W("::text[]")),B=V==="one"?"?":V==="some"?"?|":"?&";return $(W("(jsonb_typeof("),Z(),W(") = 'object' and "),Z(),W(` ${B} `),Y,W(")"))}distinctFrom(z,G,H){let V=H.type==="Json"&&!H.isList;return $(W(V?`(${z})::jsonb is distinct from `:`${z} is distinct from `),G)}jsonArrayContains(z,G,H){return $(W("("),this.jsonExtract(z,G,!1),W(") @> "),Q((V,Z)=>{let Y=H(V,Z);if(Y===null||Y===void 0)return null;return typeof Y==="string"||typeof Y==="object"?Y:JSON.stringify(Y)}),W("::jsonb"))}like(z,G,H){return $(W(`${z} ${G?"ilike":"like"} `),Q(H))}ignoreConflicts(){return W(" on conflict do nothing")}rowLock(z,G){let H=z.onLocked==="skipLocked"?" skip locked":z.onLocked==="noWait"?" nowait":"";return W(` for ${z.mode==="share"?"share":"update"} of ${this.quoteIdent(G)}${H}`)}paginate(z,G){let H=[];if(z)H.push($(W(" limit "),Q(z)));if(G)H.push($(W(" offset "),Q(G)));return $(...H)}constraintViolation(z){let G=z;if(!G)return null;if(String(G.errno??G.code??"")!=="23505")return null;let V=typeof G.constraint==="string"&&G.constraint!==""?G.constraint:void 0,Z=typeof G.detail==="string"?G.detail:"",Y=/\((.+?)\)=/.exec(Z);return{kind:"unique",columns:Y?(Y[1].match(/"(?:[^"]|"")*"|[^,]+/g)??[]).map((J)=>J.trim()).filter((J)=>J!=="").map((J)=>/^".*"$/s.test(J)?J.slice(1,-1).replace(/""/g,'"'):J):[],constraint:V}}castParameter(z){if(z.isList)return"";return z.type==="Json"?"::text::jsonb":""}encode(z,G){if(z===null||z===void 0)return null;if(G.isList){if(!Array.isArray(z))throw Error(`gemi ORM bug: a non-array reached the parameter binder for the scalar list '${G.column}' (received ${typeof z}). Every path that binds a list is supposed to have checked its operand.`);return C(G.type==="Json"?z.map((H)=>H===null||H===void 0?null:JSON.stringify(H)):z)}return z}encodeUntyped(z){return z}needsDecode(z){return z.isList===!0||z.type==="BigInt"||z.type==="Bytes"}decode(z,G){if(z===null||z===void 0)return null;if(G.isList)return this.decodeList(z,G);return this.decodeScalar(z,G)}decodeList(z,G){let H=Array.isArray(z)?z:typeof z==="string"?E(z,G):ArrayBuffer.isView(z)?Array.from(z):null;if(H===null)throw new X(G,z);return H.map((V)=>V===null||V===void 0?null:this.decodeScalar(V,G))}decodeScalar(z,G){switch(G.type){case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":return z;case"Bytes":return Buffer.isBuffer(z)?new Uint8Array(z.buffer,z.byteOffset,z.byteLength):z;default:return z}}}function C(z){let G="{";for(let H=0;H<z.length;H++){if(H>0)G+=",";G+=D(z[H])}return G+"}"}function D(z){if(z===null||z===void 0)return"NULL";if(z instanceof Date)return`"${z.toISOString()}"`;if(ArrayBuffer.isView(z)){let H="";for(let V of new Uint8Array(z.buffer,z.byteOffset,z.byteLength))H+=V.toString(16).padStart(2,"0");return`"\\\\x${H}"`}return`"${(typeof z==="string"?z:String(z)).replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`}function E(z,G){if(!z.startsWith("{")||!z.endsWith("}"))throw new X(G,z);if(z==="{}")return[];let H=[],V=1,Z=z.length-1;while(V<=Z){let Y="",B=!1;if(z[V]==='"'){B=!0,V++;while(V<Z&&z[V]!=='"')Y+=z[V]==="\\"?z[++V]:z[V],V++;V++}else while(V<Z&&z[V]!==","){if(z[V]==="{")throw new X(G,z);Y+=z[V],V++}if(H.push(!B&&Y.toUpperCase()==="NULL"?null:Y),V<Z&&z[V]!==",")throw new X(G,z);V++}if(G.type!=="Json")return H;return H.map((Y)=>{if(Y===null)return null;try{return JSON.parse(Y)}catch{throw new X(G,Y)}})}var k={"Prisma.DbNull":"db","Prisma.JsonNull":"json","Prisma.AnyNull":"any"};function _(z){return new class{toString(){return z}}}var s=_("Prisma.DbNull"),y=_("Prisma.JsonNull"),u=_("Prisma.AnyNull"),r=y;function A(z){if(typeof z!=="object"||z===null)return null;for(let H in z)return null;if(Object.getOwnPropertyNames(z).length>0)return null;let G;try{G=String(z)}catch{return null}return k[G]??null}var h=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/;function q(z,G){if(z instanceof Date)return z;let H;if(typeof z==="number")H=new Date(z);else if(typeof z==="bigint")H=new Date(Number(z));else if(typeof z==="string")H=new Date(h.test(z)?`${z.replace(" ","T")}Z`:z);else throw new X(G,z);if(Number.isNaN(H.getTime()))throw new X(G,z);return H}class S{name="sqlite";supportsInsensitiveMode=!1;bindsListAsOneParameter=!1;supportsReturning=!0;maxBoundParameters=32766;typesParametersFromStatement=!1;quoteIdent(z){if(z.includes("\x00"))throw Error(`Refusing to quote the identifier ${JSON.stringify(z)}: it contains a NUL byte, which is reserved as the parameter marker.`);return`"${z.replace(/"/g,'""')}"`}placeholder(z){return"?"}inList(z,G,H,V){let Z=G?"not in":"in",Y=[];for(let B=0;B<H;B++)Y.push(Q((J,F)=>V(J,F)[B]));return $(W(`${z} ${Z} (`),I(Y,", "),W(")"))}canBindCompositeIn(){return!1}compositeIn(){throw Error("SQLite cannot bind a composite `in`; `canBindCompositeIn` is the guard.")}listFilters=new Set;listHas(){throw Error(N("has"))}listHasEvery(){throw Error(N("hasEvery"))}listHasSome(){throw Error(N("hasSome"))}listIsEmpty(){throw Error(N("isEmpty"))}listPush(){throw Error(N("push"))}jsonPathSyntax="jsonpath";jsonFilters=new Set(["equals","not","string_contains","string_starts_with","string_ends_with"]);jsonComparesAsText=!1;jsonExtract(z,G,H){return $(W(`json_extract(${z}, `),Q(G),W(")"))}jsonValueAt(z,G){return $(W(`(${z} -> `),Q(G),W(")"))}jsonHasKeys(z,G,H,V,Z){let Y=(O,U)=>G===void 0?"$":G(O,U),B=(O)=>$(W(`json_type(${z}, `),Q((U,M)=>{let w=H(U,M),L=O===void 0?w:w[O];return`${Y(U,M)}.${JSON.stringify(String(L))}`}),W(") is not null")),J=V==="one"?[B(void 0)]:Array.from({length:Z},(O,U)=>B(U)),F=J.length===0?W(V==="some"?"0":"1"):I(J,V==="every"?" and ":" or ");return $(W(`(json_type(${z}, `),Q(Y),W(") = 'object' and ("),F,W("))"))}distinctFrom(z,G,H){if(H.type==="Json"&&!H.isList)return $(W(`json(${z}) is not json(`),G,W(")"));return $(W(`${z} is not `),G)}jsonArrayContains(){throw Error("SQLite cannot express array_contains; `jsonFilters` is the guard.")}like(z,G,H){return $(W(`${z} like `),Q(H))}ignoreConflicts(){return null}rowLock(z,G){return W("")}paginate(z,G){if(!z&&!G)return W("");if(!G)return $(W(" limit "),Q(z));return $(W(" limit "),Q(z??(()=>-1)),W(" offset "),Q(G))}constraintViolation(z){let G=z?.code;if(G!=="SQLITE_CONSTRAINT_UNIQUE"&&G!=="SQLITE_CONSTRAINT_PRIMARYKEY")return null;let H=String(z.message??""),V=/constraint failed:\s*(.+)$/.exec(H);if(!V)return{kind:"unique",columns:[]};return{kind:"unique",columns:V[1].split(",").map((Y)=>Y.trim()).map((Y)=>{let B=Y.indexOf(".");return B===-1?Y:Y.slice(B+1)}).filter((Y)=>Y!=="")}}castParameter(z){return""}encode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return z instanceof Date?z.getTime():z;case"Boolean":return typeof z==="boolean"?z?1:0:z;case"Json":{let H=A(z);if(H==="db")return null;if(H==="json")return"null";if(H==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the SQLite encoder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.")}return JSON.stringify(z);default:return z}}encodeUntyped(z){if(z instanceof Date)return z.getTime();if(typeof z==="boolean")return z?1:0;return z}needsDecode(z){switch(z.type){case"DateTime":case"Boolean":case"BigInt":case"Json":return!0;default:return!1}}decode(z,G){if(z===null||z===void 0)return null;switch(G.type){case"DateTime":return q(z,G);case"Boolean":if(typeof z==="boolean")return z;return Number(z)!==0;case"BigInt":if(typeof z==="bigint")return z;try{return BigInt(z)}catch{throw new X(G,z)}case"Json":try{return typeof z==="string"?JSON.parse(z):z}catch{throw new X(G,z)}default:return z}}}function N(z){return`SQLite has no array type, so it cannot express '${z}' on a scalar list; \`listFilters\` is the guard.`}class R extends Error{constructor(z){super(`The gemi ORM does not support the '${z}' dialect. Only sqlite `+"and postgres are implemented \u2014 see the supported matrix in "+`docs/orm.md.
|
|
3
3
|
|
|
4
4
|
The *connection* is fine: Bun's client speaks ${z}, so raw SQL through DB.query / DB.sql and transactions all work. It is the query compiler that has no ${z} dialect, so every model operation raises this.
|
|
5
5
|
|
|
6
6
|
Point DATABASE_URL at Postgres or SQLite to use the ORM, or keep using Prisma's own client for this database.`);this.name="UnsupportedDialectError"}}function Vz(z){return T[z]!==null}function Wz(){return Object.keys(T)}var T={sqlite:new S,postgres:new K,mysql:null,mariadb:null};function Yz(z){let G=T[z];if(G===null)throw new R(z);return G}
|
|
7
|
-
export{f as
|
|
7
|
+
export{f as $g,x as ah,W as bh,Q as ch,p as dh,m as eh,$ as fh,I as gh,c as hh,K as ih,s as jh,y as kh,u as lh,r as mh,A as nh,S as oh,R as ph,Vz as qh,Wz as rh,Yz as sh};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
9
|
+
//# debugId=B6A51D5548B34BEA64756E2164756E21
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"import type { Dialect } from \"../../database/dialect\";\nimport type { Binder, Fragment } from \"../compile/fragment\";\nimport type { RowLockClause } from \"../compile/lock\";\nimport type { FieldSchema, ScalarType } from \"../schema\";\nimport { PostgresDialect } from \"./postgres\";\nimport { SqliteDialect } from \"./sqlite\";\n\n/**\n * The per-database strategy.\n *\n * The rule this interface exists to enforce: no `if (dialect === \"postgres\")`\n * ever appears inside the compiler. When something genuinely cannot be\n * expressed through the interface, the interface widens — which is why\n * `inList`, `like` and `paginate` return `Fragment`s rather than strings. Each\n * of the three is a place where SQLite and Postgres disagree about *structure*,\n * not just spelling:\n *\n * - `inList` — SQLite expands one placeholder per element, so `in: [1,2]` and\n * `in: [1,2,3]` are different SQL and different plans. Postgres binds the\n * whole array to one parameter with `= any($1)`, so every length shares a\n * single plan and a single prepared statement.\n * - `like` — Postgres has `ilike` for `mode: \"insensitive\"`; SQLite has no\n * equivalent, and Prisma rejects the argument there outright.\n * - `paginate` — SQLite cannot parse `offset` without a preceding `limit`.\n */\nexport interface SqlDialect {\n readonly name: Dialect;\n\n /**\n * Whether `mode: \"insensitive\"` can be expressed at all. False on SQLite,\n * where Prisma rejects the argument rather than emulating it.\n */\n readonly supportsInsensitiveMode: boolean;\n\n /**\n * Whether an `in` list binds as a single parameter however long it is.\n *\n * True on Postgres (`= any($1)`), false on SQLite (`in (?, ?, ?)`). It is the\n * plan *cache* that needs to know: where the length does not change the SQL\n * text, it must not change the cache key either, or every distinct list\n * length mints another entry holding SQL identical to its neighbours'. That\n * matters most for relations, where the list length is the parent row count\n * and so varies with the data rather than with the code.\n */\n readonly bindsListAsOneParameter: boolean;\n\n /**\n * Whether `insert`/`update`/`delete` can return the rows they touched.\n *\n * True on both implemented dialects — Postgres has had `RETURNING` forever,\n * and SQLite since 3.35 (Bun 1.3.14 bundles 3.51.0, verified by querying\n * `sqlite_version()` rather than by reading a changelog).\n *\n * It is a capability rather than an assumption because MySQL and MariaDB have\n * no `RETURNING` at all. Their fallback — `lastInsertRowid` plus a re-select,\n * and no way to identify the rows an `updateMany` touched — is a different\n * statement shape, not a different spelling. Iteration 4 does not build it,\n * but it must stay expressible, so the write compiler asks rather than\n * assumes and raises a clear error when the answer is no.\n */\n readonly supportsReturning: boolean;\n\n /**\n * How many parameters one statement may bind.\n *\n * A hard protocol/driver limit, not a tuning knob: Postgres sends the\n * parameter count as an int16 in the Bind message, and SQLite compiles\n * `SQLITE_MAX_VARIABLE_NUMBER` in.\n *\n * Three shapes can approach it, all of them scaling with the caller's *data*\n * rather than with the query's shape:\n *\n * - `createMany`, at `rows × columns`.\n * - An `in` list on SQLite, which binds one placeholder per element — and\n * such a list is routinely request-derived (`?ids=…`).\n * - A to-many `include` on SQLite, which batches an `in` over the parent\n * keys, so a large enough `findMany` reaches it with no big list in sight.\n *\n * Postgres escapes the last two: `= any($1)` is one parameter however long\n * the array. The check itself lives in `compile/fragment.ts`'s `render`,\n * because that is the one place that sees a statement's final count.\n *\n * It lives *here* rather than as a constant in the compiler for the usual\n * reason: the number differs per dialect, and the compiler is not allowed to\n * know which dialect it is compiling for.\n */\n readonly maxBoundParameters: number;\n\n /**\n * Whether the **statement** decides a parameter's type, so a cast the caller\n * wrote onto their own placeholder changes how the driver encodes the value.\n *\n * True on Postgres: the server describes the statement, the client is told\n * the parameter is `jsonb`, and Bun then JSON-*encodes* whatever JS value it\n * was handed. That is the whole of #376 — the reason `json-param.ts` retypes\n * such a parameter through `text` and serialises it to match.\n *\n * False on SQLite, and not merely because the correction is unnecessary\n * there: it would be **wrong**, and it would not parse. A parameter's type is\n * the bound value's, and `cast(x as json)` is not a JSON cast at all — SQLite\n * takes any type name and applies affinity rules, and a name containing none\n * of INT/CHAR/CLOB/TEXT/BLOB/REAL/FLOA/DOUB gets NUMERIC affinity, so\n * `cast('{\"a\":1}' as json)` is `0`. Measured through `bun:sqlite` (Bun\n * 1.3.14):\n *\n * select cast(? as jsonb) -> 0 (runs)\n * select json_set('{\"a\":1}','$.b', cast(? as json)) -> {\"a\":1,\"b\":2}\n * select cast(? as text)::json -> ERROR unrecognized token: \":\"\n *\n * So the retyping's rewrite — `cast(? as text)::json` — turns a statement\n * that runs on SQLite today into a syntax error. `::` genuinely cannot fire\n * there (it does not parse), but `cast(… as …)` is not Postgres-only syntax,\n * and \"SQLite has no jsonb type\" is a claim about semantics rather than about\n * what the parser accepts. Asking here rather than matching on `name` is what\n * makes that a fact `tsc` and a test can hold.\n */\n readonly typesParametersFromStatement: boolean;\n\n /** Quote a table or column name. Only ever called with names from the schema. */\n quoteIdent(name: string): string;\n\n /**\n * The parameter marker for the `index`-th (0-based) parameter in a statement.\n * SQLite ignores the index and returns `?`; Postgres returns `$1`, `$2`, ...\n */\n placeholder(index: number): string;\n\n /**\n * Prisma-shaped value -> the value the driver must be handed for this field.\n * The mirror of `decode`, and just as load-bearing: Bun's SQLite driver binds\n * a `Date` to `NULL`, so an unencoded `where: { createdAt: date }` would\n * return no rows rather than failing.\n *\n * Applied at bind time, not compile time — it is a function of the value.\n * Which encoder runs is still decided from the schema, so compile stays pure.\n */\n encode(value: unknown, field: FieldSchema): unknown;\n\n /**\n * SQL appended to this field's placeholder, or `\"\"` for none.\n *\n * The one string a dialect contributes to the statement that is not a\n * parameter, so it must be a constant — never derived from a value, and never\n * from anything an application supplies. `fieldParam` is the only caller, and\n * a non-empty cast also means it serialises the value; the two travel\n * together and neither is correct alone (#209).\n */\n castParameter(field: FieldSchema): string;\n\n /**\n * The same, for a value with **no declared column type** — a parameter\n * interpolated into a composed raw fragment, where there is no schema to ask.\n *\n * It exists because \"raw\" cannot mean \"unportable\". Bun's SQLite driver\n * rejects a `Date` outright (`Binding expected string, TypedArray, boolean,\n * number, bigint or null`) while Postgres takes one, so\n * ``sql`where \"createdAt\" > ${date}` `` would work on one dialect and throw on\n * the other — and the caller has no dialect-independent value to reach for\n * instead, because milliseconds are only correct if that is what the ORM\n * stored. Which it is: this converts to exactly what `encode` writes for a\n * `DateTime`, so a raw statement compares against ORM-written rows correctly.\n *\n * Deliberately narrow. It normalises the JavaScript types whose SQL form the\n * ORM has already decided — a `Date`, a boolean — and touches nothing else. A\n * plain object is *not* JSON-encoded here: the compiler only knows to do that\n * because a field says `Json`, and guessing from the value would turn a\n * mistyped parameter into a successfully-written string.\n *\n * The exception is a parameter the *caller* cast to `json`/`jsonb`, which is\n * a declared type by another route and does not reach this at all — see\n * `json-param.ts`. It is still not a guess from the value: the statement says\n * so.\n */\n encodeUntyped(value: unknown): unknown;\n\n /** Driver value -> the value Prisma would have returned for this field. */\n decode(value: unknown, field: FieldSchema): unknown;\n\n /**\n * False when the driver already returns exactly what Prisma would for this\n * field, letting the shaper skip the call entirely on the hot path.\n */\n needsDecode(field: FieldSchema): boolean;\n\n /**\n * `<lhs> in (...)` / `<lhs> not in (...)`.\n *\n * `length` is the element count, which is shape information and is already\n * part of the plan key. `values` returns the whole array at bind time; how it\n * is spread across parameters is the dialect's business.\n */\n inList(\n lhs: string,\n negated: boolean,\n length: number,\n values: Binder,\n ): Fragment;\n\n /** `<lhs> like <pattern>`, case-insensitively when the dialect can. */\n like(lhs: string, insensitive: boolean, pattern: Binder): Fragment;\n\n /**\n * Whether this dialect can match a **tuple** of columns against a list of\n * tuples in a statement whose text does not grow with the list.\n *\n * The single-column case is `inList`, and on Postgres `= any($1)` already\n * gives one SQL text for every length — which is what lets `collapsedList`\n * keep a batched relation query to one plan entry however many parents it\n * has. A relation joining on *more than one* field cannot use it, so the\n * loader falls back to an `OR` of `AND`s whose text does grow, and the plan\n * cache churns with the parent count (#97).\n *\n * `unnest` closes that on Postgres — one array parameter per *column*, so the\n * text is fixed — but it needs each column's SQL type for the cast, and the\n * types are asked about here rather than assumed: a dialect that cannot spell\n * one of them says so and the caller keeps the portable `OR`.\n */\n canBindCompositeIn(types: readonly ScalarType[]): boolean;\n\n /**\n * `(a, b) in (select * from unnest($1::t[], $2::u[]))`.\n *\n * `values` yields one tuple per parent at bind time; the dialect decides how\n * they are transposed into per-column arrays. Only called when\n * {@link canBindCompositeIn} returned true for these types.\n */\n compositeIn(\n columns: readonly string[],\n types: readonly ScalarType[],\n values: Binder,\n ): Fragment;\n\n /**\n * The filters this dialect can apply to a **scalar list** — `tags String[]`.\n *\n * **Empty is the whole of SQLite's answer**, and it is a capability rather\n * than a gap in this ORM: SQLite has no array type, and Prisma refuses the\n * declaration there at validation time — *\"Field `tags` in model `User` can't\n * be a list. The current connector does not support lists of primitive\n * types.\"* So a SQLite database cannot hold such a column to begin with.\n *\n * The refusal lives here rather than in the generator, which is where it used\n * to live (#300). The generated artifact is dialect-agnostic on purpose —\n * `DATABASE_URL` can name a different database than `prisma generate` saw —\n * so a generator that refused a scalar list refused it for Postgres too, and\n * one `String[]` anywhere meant no artifact for *any* model. Asking the\n * dialect at compile time refuses exactly the combination that cannot work,\n * and names it, which is the shape {@link UnsupportedDialectError} already\n * has for the dialects with no compiler at all.\n */\n readonly listFilters: ReadonlySet<string>;\n\n /**\n * `<value> = any(<column>)` — is this element in the list?\n *\n * The mirror of {@link inList} rather than a variant of it, and the two are\n * easy to confuse: there, one column is matched against a caller's list;\n * here, one caller value is matched against a column that *is* a list.\n *\n * **These four take a `Fragment` where every other member here takes a\n * `Binder`**, which is a deliberate exception. A list operand may need a cast\n * on its placeholder — a single element of a `Json[]` needs #209's\n * `::text::jsonb`, and the serialisation that must travel with it — so the\n * parameter is built by `fieldParam` before it arrives and the dialect\n * chooses only the operator. Handing over a `Binder` instead would oblige\n * each dialect to restate `fieldParam`'s rule, and restating it slightly\n * wrong is silent: `$1::jsonb = any(col)` answers *false* where\n * `$1::text::jsonb = any(col)` answers true, with no error on either.\n */\n listHas(column: string, value: Fragment): Fragment;\n\n /** `hasEvery` — every element of the operand is present in the column. */\n listHasEvery(column: string, values: Fragment): Fragment;\n\n /** `hasSome` — the column and the operand share at least one element. */\n listHasSome(column: string, values: Fragment): Fragment;\n\n /**\n * `isEmpty: true`, or its negation when `empty` is false.\n *\n * The odd one out with no operand at all: the value being compared against is\n * the empty list, which is the compiler's own constant rather than the\n * caller's. It stays a bound parameter regardless — see `jsonNullComparison`,\n * which declines the same exception for the same reason.\n */\n listIsEmpty(column: string, empty: boolean): Fragment;\n\n /**\n * The right-hand side of a `push`: the column's current value with the\n * operand appended. An expression rather than a statement, because it is\n * assigned by the write compiler like any other `set` value.\n */\n listPush(column: string, values: Fragment): Fragment;\n\n /**\n * How this dialect spells a JSON path, and which filters it can apply to one.\n *\n * The **path grammar itself differs**, which is unusual enough to be worth\n * stating rather than hiding: Prisma takes `path: [\"a\", \"b\"]` on Postgres and\n * `path: \"$.a.b\"` on SQLite, and refuses the other form on each. That is not\n * a gemi choice — it is the shape the generated client accepts, measured on\n * both — so reproducing it is what \"Prisma-compatible\" means here.\n *\n * `jsonFilters` is the set of scalar filters the dialect can apply to an\n * extracted value. Prisma refuses `array_contains` and the numeric\n * comparisons on SQLite with *\"Unknown argument\"*, so refusing them here is\n * matching it rather than falling short of it.\n */\n readonly jsonPathSyntax: \"array\" | \"jsonpath\";\n readonly jsonFilters: ReadonlySet<string>;\n\n /**\n * Whether an extracted value compares as **text**.\n *\n * Postgres's `#>>` yields `text`, so `equals: 3` has to bind `\"3\"` — comparing\n * text to an integer parameter is a type error there. SQLite's `json_extract`\n * yields a native value, so the same filter has to bind `3`: bind `\"3\"` and\n * SQLite compares an INTEGER to a TEXT, which is silently *false* rather than\n * an error. One filter, two encodings, and the wrong one is a returned-no-rows\n * bug on one dialect and a raised error on the other.\n */\n readonly jsonComparesAsText: boolean;\n\n /**\n * The extracted value, as a fragment whose path is **bound**.\n *\n * A JSON path is the one place a caller's *value* decides part of an\n * expression's meaning, which makes it the obvious place to interpolate by\n * accident and break invariant 2. Both dialects can take it as a parameter —\n * Postgres's `#>` accepts a `text[]`, SQLite's `json_extract` a string — so\n * nothing has to be bent to keep it out of the SQL text.\n *\n * `asText` picks the extraction that yields SQL text rather than JSON. Every\n * comparison in `jsonComparison` passes `true` — the string filters compare\n * against text, and `equals` / `not` / the numeric operators compare an\n * extracted *scalar*, which is what the text form gives them. The JSON form\n * has exactly one caller, `jsonArrayContains`, because containment is the one\n * operator whose right-hand side is a document.\n *\n * SQLite ignores the flag: `json_extract` already yields a SQL value rather\n * than a JSON document for a scalar at the path. That is why the null\n * sentinels need {@link jsonValueAt} instead of this — see there.\n */\n jsonExtract(column: string, path: Binder, asText: boolean): Fragment;\n\n /** `<extracted> @> <value>` — Postgres only; see `jsonFilters`. */\n jsonArrayContains(column: string, path: Binder, value: Binder): Fragment;\n\n /**\n * The value at `path` **as JSON**, in the form two JSON values compare in.\n *\n * The difference from {@link jsonExtract} is the whole of #407, and it is the\n * distinction the null sentinels are made of. Both dialects have an\n * extraction that collapses \"the key is absent\" into \"the key holds the JSON\n * value `null`\", and both have one that does not:\n *\n * | | collapses | keeps the distinction |\n * | --- | --- | --- |\n * | postgres | `#>>` (text) | `#>` (jsonb) |\n * | sqlite | `json_extract` | `->` (JSON text) |\n *\n * `jsonExtract` is the left column at `asText: true`, which is what every\n * scalar comparison wants — a value to compare, not a document. This is the\n * right column, and it is what lets `equals: DbNull` compile to\n * `<value at path> is null` while `equals: JsonNull` compiles to\n * `<value at path> = <the JSON null>`. Refusing them because `#>>` cannot\n * tell the two apart was true of `#>>` and not of the dialect.\n *\n * **Postgres casts and SQLite does not**, and the cast is not decoration:\n * `#>` on a `json` column (a `@db.Json` field) yields `json`, which has no\n * equality operator at all — *\"operator does not exist: json = jsonb\"*, a\n * raised error rather than a wrong answer, but still one Prisma does not\n * raise. Prisma emits `(…#>…)::jsonb` for exactly this reason and so does\n * this. SQLite's `->` already yields the JSON text form.\n *\n * Bound, never interpolated, for the same reason `jsonExtract` is.\n */\n jsonValueAt(column: string, path: Binder): Fragment;\n\n /**\n * Whether the JSON value at `path` — the column itself when `path` is\n * `undefined` — is an **object** holding the key, any of the keys, or all of\n * them: `has_key`, `has_some_keys`, `has_every_key` (#664).\n *\n * `keys` binds a string for `\"one\"` and a string array for the other two;\n * `count` is that array's length, which SQLite needs because it tests one\n * key per term. Postgres binds the array whole, so its text does not depend\n * on `count` and the plan key collapses the list (`LIST_KEYS` in `plan.ts`).\n *\n * **Objects only, on both dialects.** Postgres's `?` also matches a string\n * *element* of a top-level array; SQLite's path lookup does not. Both forms\n * are guarded with \"the value is an object\" so the two answer the same rows:\n * `has_every_key: []` is \"is an object\", and `has_some_keys: []` is false.\n * A key holding the JSON value `null` exists.\n */\n jsonHasKeys(\n column: string,\n path: Binder | undefined,\n keys: Binder,\n mode: \"one\" | \"some\" | \"every\",\n count: number,\n ): Fragment;\n\n /**\n * `lhs` differs from `rhs`, treating NULL as equal to NULL — the guard\n * `skipIfUnchanged` adds to an update's `where` (#664).\n *\n * `rhs` is the same parameter the `set` binds, so the comparison is against\n * the stored encoding of the value. A `Json` column compares as JSON rather\n * than as text: `jsonb` equality on Postgres (key order and whitespace do not\n * matter), and `json()`-normalised text on SQLite (whitespace does not\n * matter; key order does).\n */\n distinctFrom(lhs: string, rhs: Fragment, field: FieldSchema): Fragment;\n\n /**\n * `limit`/`offset`. Both are values and therefore parameters — this is the\n * single most tempting place in the compiler to inline a number.\n */\n paginate(take: Binder | null, skip: Binder | null): Fragment;\n\n /**\n * The clause that makes an insert skip rows violating a unique constraint —\n * `createMany({ skipDuplicates: true })` — or `null` where it is not offered.\n *\n * **`null` is a parity decision, not a missing feature**, and that is worth\n * knowing before someone \"fixes\" SQLite by returning `insert or ignore`.\n * SQLite has `on conflict do nothing` and has since 3.24; Prisma nonetheless\n * rejects the *argument* on SQLite — `Unknown argument 'skipDuplicates'`,\n * whatever its value, verified against a generated 6.19 client. Offering it\n * here would make gemi a silent superset of Prisma on the one dialect the\n * differential harness could then no longer compare, which is the trade this\n * project has declined every other time it came up.\n *\n * A method rather than a boolean because the SQL differs where it exists, and\n * a `Fragment` because everything the compiler emits is one.\n */\n ignoreConflicts(): Fragment | null;\n\n /**\n * The clause a locking read ends with — `lock: \"update\"` on a `findMany` —\n * naming `table` as the only table whose rows are locked.\n *\n * Scoped to the root table (`for update of \"User\"`) rather than left bare,\n * because a folded `include` puts a lateral subquery in the `from` clause and\n * Postgres refuses to lock through one (`FOR UPDATE is not allowed with\n * aggregate functions`). Scoping it also matches the documented contract on\n * both strategies: the root rows are locked, related rows never are.\n *\n * **Empty on SQLite, and that is a decision.** SQLite has no row locks, and\n * does not need them for what a locking read is for: its transactions are\n * serializable, with one writer at a time on the whole database, so the lost\n * update a row lock prevents cannot happen there. Two transactions that race\n * wait on (or fail with `SQLITE_BUSY` on) the database lock instead of the\n * row's, and `skipLocked` / `noWait` have no row lock to react to. Refusing\n * would stop code that runs on Postgres in production from running against\n * SQLite in development and tests, for no gain. The one misuse that matters\n * on both — a lock outside a transaction — is refused in `Model.$execute`\n * on every dialect.\n */\n rowLock(lock: RowLockClause, table: string): Fragment;\n\n /**\n * Recognise a driver error as a constraint violation, and say which columns\n * it names.\n *\n * Returns `null` for anything else, including the *other* constraint kinds:\n * SQLite reports NOT NULL and FOREIGN KEY failures through the same exception\n * type, and reporting one of those as a duplicate-key error would send a\n * caller looking for a row that does not exist.\n *\n * Columns, not fields — the driver only knows the database's names. The\n * caller maps them back through the schema, where `@map` is in scope.\n */\n constraintViolation(error: unknown): ConstraintViolation | null;\n}\n\n/** A driver error identified as a constraint failure, in dialect-neutral terms. */\nexport interface ConstraintViolation {\n /** Only `unique` is translated today; the rest surface as the raw error. */\n kind: \"unique\";\n /** Database column names, in the order the driver reported them. */\n columns: string[];\n /** The constraint's own name, when the driver gives one. Postgres does. */\n constraint?: string;\n}\n\n/**\n * The ORM was asked to compile against a dialect it does not implement.\n *\n * **The split this message has to convey**, because it is the surprising part:\n * `DatabaseManager` connects to MySQL and MariaDB perfectly well — Bun's client\n * speaks all four — so raw SQL through `DB.query` / `DB.sql` works, and\n * transactions work. What does not exist is a `SqlDialect` for them, so\n * everything that *compiles* a statement stops here.\n *\n * A caller who reads only \"not supported\" reasonably concludes the connection\n * is unusable, which is wrong and is the more expensive misreading: it is the\n * ORM that is unavailable, not the database.\n */\nexport class UnsupportedDialectError extends Error {\n constructor(dialect: Dialect) {\n super(\n `The gemi ORM does not support the '${dialect}' dialect. Only sqlite ` +\n `and postgres are implemented — see the supported matrix in ` +\n `docs/orm.md.\\n\\n` +\n `The *connection* is fine: Bun's client speaks ${dialect}, so raw SQL ` +\n `through DB.query / DB.sql and transactions all work. It is the query ` +\n `compiler that has no ${dialect} dialect, so every model operation ` +\n `raises this.\\n\\n` +\n `Point DATABASE_URL at Postgres or SQLite to use the ORM, or keep ` +\n `using Prisma's own client for this database.`,\n );\n this.name = \"UnsupportedDialectError\";\n }\n}\n\n/**\n * Whether the ORM can compile for this dialect at all.\n *\n * Exported so an application can find out at **boot** rather than on its first\n * query. That is the whole gap this closes: `DatabaseManager` constructs\n * happily against MySQL, so a deploy pointed at one starts, passes a health\n * check, serves traffic, and fails on the first model read — which is the\n * latest and most expensive moment to learn it.\n */\nexport function ormSupports(dialect: Dialect): boolean {\n return COMPILERS[dialect] !== null;\n}\n\n/** Every dialect `Dialect` names, for anything that has to walk them all. */\nexport function everyDialect(): Dialect[] {\n return Object.keys(COMPILERS) as Dialect[];\n}\n\n/**\n * The compiler for each dialect, or `null` where the ORM has none.\n *\n * **One map rather than two lists, and `satisfies` rather than a lookup.** The\n * supported set used to be written three times — `ormSupports`' `||` chain,\n * `dialectFor`'s `if` chain, and a test enumerating a hand-written copy of the\n * `Dialect` union — so adding a fifth member to that union changed nothing\n * anywhere: `tsc` clean, tests green, the new dialect silently reported as\n * unsupported by one function and unknown to the other.\n *\n * That moment is exactly what the guard exists for. Adding a dialect to the\n * union is the *first step of implementing one*, and it is the step where a\n * half-added dialect would disagree with itself.\n *\n * `satisfies Record<Dialect, …>` makes it a compile error in a file the build\n * actually checks. It has to live here rather than in a test: `tsconfig.json`\n * excludes test files and vitest transpiles without type-checking, so an\n * exhaustiveness check written there is a type error nothing ever evaluates.\n *\n * The sixth thing in this codebase made `tsc`'s job rather than a convention's\n * — see the note on `resolveLink`'s `operation`.\n */\nconst COMPILERS = {\n sqlite: new SqliteDialect(),\n postgres: new PostgresDialect(),\n // Bun's client speaks both; the ORM has no compiler for either. See\n // `UnsupportedDialectError`, which is careful to say that the *connection*\n // still works.\n mysql: null,\n mariadb: null,\n} satisfies Record<Dialect, SqlDialect | null>;\n\n/**\n * Resolved per call from `DatabaseManager.dialect`, never baked into a\n * generated artifact — `DATABASE_URL` can point at a different database than\n * the one `prisma generate` saw.\n */\nexport function dialectFor(dialect: Dialect): SqlDialect {\n const compiler = COMPILERS[dialect];\n if (compiler === null) throw new UnsupportedDialectError(dialect);\n return compiler;\n}\n\nexport { PostgresDialect, SqliteDialect };\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";iDAoCO,SAAS,CAAiB,EAAgB,CAC/C,MAAO,CAAE,IAAK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A6B,CAIlD,GAAI,IAAU,MAAQ,IAAU,OAAW,OAAO,KAElD,OAAQ,EAAM,UACP,WACH,OAAO,EAAO,EAAO,CAAK,MACvB,UACH,GAAI,OAAO,IAAU,UAAW,OAAO,EAGvC,OAAO,OAAO,CAAK,IAAM,MACtB,SACH,GAAI,OAAO,IAAU,SAAU,OAAO,EACtC,GAAI,CACF,OAAO,OAAO,CAAe,EAC7B,KAAM,CAGN,MAAM,IAAI,EAAY,EAAO,CAAK,MAEjC,OACH,GAAI,CACF,OAAO,OAAO,IAAU,SAAW,KAAK,MAAM,CAAK,EAAI,EACvD,KAAM,CACN,MAAM,IAAI,EAAY,EAAO,CAAK,UAGpC,OAAO,GAGf,CAEA,SAAS,CAAe,CAAC,EAA0B,CACjD,MACE,mDAAmD,qDC/ChD,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAkB,CAC5B,MACE,sCAAsC,2BACpC,mEACA;AAAA;AAAA,gDACiD,2GAEzB;AAAA;AAAA,8GAI5B,EACA,KAAK,KAAO,0BAEhB,CAWO,SAAS,EAAW,CAAC,EAA2B,CACrD,OAAO,EAAU,KAAa,KAIzB,SAAS,EAAY,EAAc,CACxC,OAAO,OAAO,KAAK,CAAS,EAyB9B,IAAM,EAAY,CAChB,OAAQ,IAAI,EACZ,SAAU,IAAI,EAId,MAAO,KACP,QAAS,IACX,EAOO,SAAS,EAAU,CAAC,EAA8B,CACvD,IAAM,EAAW,EAAU,GAC3B,GAAI,IAAa,KAAM,MAAM,IAAI,EAAwB,CAAO,EAChE,OAAO",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "B6A51D5548B34BEA64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"/**\n * The prefix every api route is served under. The browser adds it when it\n * fetches (`/api${path}`) and the server strips it before matching, so an api\n * router's own paths never carry it.\n */\nexport const API_PREFIX = \"/api\";\n\n/**\n * Whether a request pathname is an api request: `/api` itself or anything\n * under `/api/`. A bare `startsWith(\"/api\")` also claims `/apidocs`,\n * `/api-keys` and `/apiary`, so a view route there would never render — the\n * api dispatcher would answer its 404 JSON instead.\n */\nexport function isApiPath(pathname: string): boolean {\n return pathname === API_PREFIX || pathname.startsWith(`${API_PREFIX}/`);\n}\n\n/**\n * The api router path a request pathname addresses: `/api/users/1` is\n * `/users/1`, `/api/` is `/` and `/api` is `\"\"`. Only the leading prefix is\n * stripped — `replace(\"/api\", \"\")` would also strip an `/api` inside the path\n * of a request that did not start with one (`/files/api` becoming `/files`).\n * A pathname outside `/api` comes back unchanged, so the dispatcher can still\n * be handed a request by its route path directly.\n */\nexport function apiPath(pathname: string): string {\n return isApiPath(pathname) ? pathname.slice(API_PREFIX.length) : pathname;\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAaO,SAAS,CAAS,CAAC,EAA2B,CACnD,OAAO,IATiB,QASU,EAAS,WAAW,OAAgB,EAWjE,SAAS,CAAO,CAAC,EAA0B,CAChD,OAAO,EAAU,CAAQ,EAAI,EAAS,MAAM,CAAiB,EAAI",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "275AFEE3302EE19B64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Zd as o}from"./chunk-c7ecv545.js";import{_d as i}from"./chunk-6hs102jh.js";import{Pj as t}from"./chunk-ks7msv3e.js";import{Pk as r}from"./chunk-rw4z3n9b.js";class n extends i{register(){this.app.singleton(r,()=>new r(t(o(),this.app.config.get("translation",{}))))}}
|
|
3
|
+
export{n as ab};
|
|
4
|
+
|
|
5
|
+
//# debugId=AA8C2C73FB2992BE64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { Translator } from \"./Translator\";\nimport { translationConfigDefaults, type TranslationConfig } from \"./config\";\n\nexport class TranslationServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n Translator,\n () =>\n new Translator(\n withDefaults(\n translationConfigDefaults(),\n this.app.config.get<TranslationConfig>(\"translation\", {}),\n ),\n ),\n );\n }\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sLAKO,AAAM,IAAmC,LAAgB,CAC9D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IACE,IAAI,EACF,EACE,EAA0B,EAC1B,KAAK,IAAI,OAAO,IAAuB,cAAe,CAAC,CAAC,CAC1D,CACF,CACJ,EAEJ",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "AA8C2C73FB2992BE64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|