81 lines
168 KiB
JavaScript
81 lines
168 KiB
JavaScript
|
"use strict";var zs=Object.create;var Zt=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Xs=Object.getPrototypeOf,ea=Object.prototype.hasOwnProperty;var _e=(e,t)=>()=>(e&&(t=e(e=0)),t);var ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Et=(e,t)=>{for(var r in t)Zt(e,r,{get:t[r],enumerable:!0})},Un=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zs(t))!ea.call(e,i)&&i!==r&&Zt(e,i,{get:()=>t[i],enumerable:!(n=Ys(t,i))||n.enumerable});return e};var he=(e,t,r)=>(r=e!=null?zs(Xs(e)):{},Un(t||!e||!e.__esModule?Zt(r,"default",{value:e,enumerable:!0}):r,e)),ta=e=>Un(Zt({},"__esModule",{value:!0}),e);var y,c=_e(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var v,p=_e(()=>{"use strict";v=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=_e(()=>{"use strict";E=()=>{};E.prototype=E});var b,f=_e(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});var ai=ge(et=>{"use strict";m();c();p();d();f();var Wn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ra=Wn(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o<s;++o)t[o]=i[o],r[i.charCodeAt(o)]=o;var o,s;r[45]=62,r[95]=63;function a(C){var A=C.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=A);var I=F===A?0:4-F%4;return[F,I]}function l(C){var A=a(C),F=A[0],I=A[1];return(F+I)*3/4-I}function u(C,A,F){return(A+F)*3/4-F}function g(C){var A,F=a(C),I=F[0],N=F[1],M=new n(u(C,I,N)),O=0,Y=N>0?I-4:I,q;for(q=0;q<Y;q+=4)A=r[C.charCodeAt(q)]<<18|r[C.charCodeAt(q+1)]<<12|r[C.charCodeAt(q+2)]<<6|r[C.charCodeAt(q+3)],M[O++]=A>>16&255,M[O++]=A>>8&255,M[O++]=A&255;return N===2&&(A=r[C.charCodeAt(q)]<<2|r[C.charCodeAt(q+1)]>>4,M[O++]=A&255),N===1&&(A=r[C.charCodeAt(q)]<<10|r[C.charCodeAt(q+1)]<<4|r[C.charCodeAt(q+2)]>>2,M[O++]=A>>8&255,M[O++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,F){for(var I,N=[],M=A;M<F;M+=3)I=(C[M]<<16&16711680)+(C[M+1]<<8&65280)+(C[M+2]&255),N.push(h(I));return N.join("")}function S(C){for(var A,F=C.length,I=F%3,N=[],M=16383,O=0,Y=F-I;O<Y;O+=M)N.push(x(C,O,O+M>Y?Y:O+M));return I===1?(A=C[F-1],N.push(t[A>>2]+t[A<<4&63]+"==")):I===2&&(A=(C[F-2]<<8)+C[F-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}}),na=Wn(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<<l)-1,g=u>>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<<g)-1,x=h>>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,F=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+x>=1?r+=S/u:r+=S*Math.pow(2,1-x),r*u>=2&&(a++,u/=2),a+x>=h?(l=0,a=h):a+x>=1?(l=(r*u-1)*Math.pow(2,o),a=a+x):(l=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<<o|l,g+=o;g>0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=F*128}}),Ur=ra(),Ze=na(),Vn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;et.Buffer=T;et.SlowBuffer=ua;et.INSPECT_MAX_BYTES=50;var Xt=2147483647;et.kMaxLength=Xt;T.TYPED_ARRAY_SUPPORT=ia();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ia(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),O
|
||
|
`);return t.length<e?t:t.slice(-e)}function bi(){Rt.length=0}var le=en;m();c();p();d();f();m();c();p();d();f();var tn=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];m();c();p();d();f();var xi="library";function Ot(e){let t=nl();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":xi)}function nl(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}m();c();p();d();f();m();c();p();d();f();var Le;(t=>{let e;(O=>(O.findUnique="findUnique",O.findUniqueOrThrow="findUniqueOrThrow",O.findFirst="findFirst",O.findFirstOrThrow="findFirstOrThrow",O.findMany="findMany",O.create="create",O.createMany="createMany",O.createManyAndReturn="createManyAndReturn",O.update="update",O.updateMany="updateMany",O.upsert="upsert",O.delete="delete",O.deleteMany="deleteMany",O.groupBy="groupBy",O.count="count",O.aggregate="aggregate",O.findRaw="findRaw",O.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Le||={});m();c();p();d();f();rn();function nn(e){return we.sep===we.posix.sep?e:e.split(we.sep).join(we.posix.sep)}var Ft={};Et(Ft,{error:()=>al,info:()=>sl,log:()=>ol,query:()=>ll,should:()=>Oi,tags:()=>kt,warn:()=>on});m();c();p();d();f();var kt={error:Qe("prisma:error"),warn:Ct("prisma:warn"),info:Se("prisma:info"),query:Je("prisma:query")},Oi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function ol(...e){console.log(...e)}function on(e,...t){Oi.warn()&&console.warn(`${kt.warn} ${e}`,...t)}function sl(e,...t){console.info(`${kt.info} ${e}`,...t)}function al(e,...t){console.error(`${kt.error} ${e}`,...t)}function ll(e,...t){console.log(`${kt.query} ${e}`,...t)}m();c();p();d();f();function ir(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();d();f();function Oe(e,t){throw new Error(t)}m();c();p();d();f();function an(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();d();f();var ln=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});m();c();p();d();f();function tt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();d();f();function un(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}m();c();p();d();f();function re(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();d();f();var Ii=new Set,Mt=(e,t,...r)=>{Ii.has(e)||(Ii.add(e),on(t,...r))};m();c();p();d();f();var W=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};re(W,"PrismaClientKnownRequestError");var ke=class extends W{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};re(ke,"NotFoundError");m();c();p();d();f();var V=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};re(V,"PrismaClientInitializationError");m();c();p();d();f();var ue=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};re(ue,"PrismaClientRustPanicError");m();c();p();d();f();var K=class extends Error{constructor(t,{client
|
||
|
`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};m();c();p();d();f();m();c();p();d();f();function Qi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();d();f();function ot(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function pr(e){return e.toString()!=="Invalid Date"}m();c();p();d();f();m();c();p();d();f();var st=9e15,Be=1e9,wn="0123456789abcdef",fr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",mr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-st,maxE:st,crypto:!1},Ki,Me,L=!0,hr="[DecimalError] ",$e=hr+"Invalid argument: ",Hi=hr+"Precision limit exceeded",zi=hr+"crypto unavailable",Yi="[object Decimal]",te=Math.floor,J=Math.pow,gl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,hl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,yl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Zi=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe=1e7,_=7,wl=9007199254740991,bl=fr.length-1,En=mr.length-1,R={toStringTag:Yi};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error($e+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=El(n,no(n,r)),n.precision=e,n.rounding=t,k(Me==2||Me==
|
||
|
`)}};function ft(e){return new Tn(ao(e))}function ao(e){let t=new dt;for(let[r,n]of Object.entries(e)){let i=new vr(r,lo(n));t.addField(i)}return t}function lo(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(lt(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=pr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Fe?new z(`Prisma.${e._getName()}`):ut(e)?new z(`prisma.${Qi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?uu(e):typeof e=="object"?ao(e):new z(Object.prototype.toString.call(e))}function uu(e){let t=new pt;for(let r of e)t.addItem(lo(r));return t}function Pr(e,t){let r=t==="pretty"?oo:xr,n=e.renderAllMessages(r),i=new it(0,{colors:r}).write(e).toString();return{message:n,args:i}}function uo(e){if(e===void 0)return"";let t=ft(e);return new it(0,{colors:xr}).write(t).toString()}m();c();p();d();f();var cu="P2037";function Tr({error:e,user_facing_error:t},r,n){return t.error_code?new W(pu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new K(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function pu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===cu&&(r+=`
|
||
|
Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var Vt="<unknown>";function co(e){var t=e.split(`
|
||
|
`);return t.reduce(function(r,n){var i=mu(n)||hu(n)||bu(n)||Pu(n)||xu(n);return i&&r.push(i),r},[])}var du=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fu=/\((\S*)(?::(\d+))(?::(\d+))\)/;function mu(e){var t=du.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=fu.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Vt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var gu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function hu(e){var t=gu.exec(e);return t?{file:t[2],methodName:t[1]||Vt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var yu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,wu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function bu(e){var t=yu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=wu.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Vt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Eu=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function xu(e){var t=Eu.exec(e);return t?{file:t[3],methodName:t[1]||Vt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var vu=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Pu(e){var t=vu.exec(e);return t?{file:t[2],methodName:t[1]||Vt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Cn=class{getLocation(){return null}},An=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=co(t).find(i=>{if(!i.file)return!1;let o=nn(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function qe(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Cn:new An}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var po={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function mt(e={}){let t=Cu(e);return Object.entries(t).reduce((n,[i,o])=>(po[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Cu(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Cr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function fo(e,t){let r=Cr(e);return t({action:"aggregate",unpacker:r,argsMapper:mt})(e)}m();c();p();d();f();function Au(e={}){let{select:t,...r}=e;return typeof t=="object"?mt({...r,_count:t}):mt({...r,_count:{_all:!0}})}function Ru(e={}){return typeof e.select=="object"?t=>Cr(e)(t)._count:t=>Cr(e)(t)._count._all}function mo(e,t){return t({action:"count",unpacker:Ru(e),argsMapper:Au})(e)}m();c();p();d();f();function Su(e={}){let t=mt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Ou(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function go(e,t){return t({action:"groupBy",unpacker:Ou(e),argsMapper:Su})(e)}function ho(e,t,r){if(t==="aggregate")return n=>fo(n,r);if(t==="count")return n=>mo(n,r);if(t==="groupBy")return n=>go(n,r)}m();c();p();d();f();function yo(e,t){let r=t.fields.filter(i=>!i.relationName),n=ln(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Ut(e,o,s.type,s.isList,s.kind==="enum")},...ur(Object.keys(n))}
|
||
|
`);return new e(t,Po(n).split(`
|
||
|
`))}highlight(){let t=xo(this.toString());return new e(this.firstLineNumber,t.split(`
|
||
|
`))}toString(){return this.lines.join(`
|
||
|
`)}};var Du={red:Qe,gray:At,dim:vt,bold:pe,underline:Pt,highlightSource:e=>e.highlight()},$u={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Bu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function ju({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Bu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Rr.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=Uu(g),x=qu(g);if(!x)return s;s.functionName=`${x.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,x.openingBraceIndex))),u=o.highlightSource(u);let S=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(S))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+S+1;C+=2,s.callArguments=(0,To.default)(i,C).slice(C)}}return s}function qu(e){let t=Object.keys(Le.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Uu(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Vu({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(Qu(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
|
||
|
`)}function Qu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function gt(e){let t=e.showColors?Du:$u,r;return r=ju(e,t),Vu(r,t)}function Co(e,t,r,n){return e===Le.ModelAction.findFirstOrThrow||e===Le.ModelAction.findUniqueOrThrow?Ju(t,r,n):n}function Ju(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=gt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new H(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof W&&o.code==="P2025"?new ke(`No ${e} found`,t):o})}}m();c();p();d();f();function Te(e){return e.replace(/^./,t=>t.toLowerCase())}var Gu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Wu=["aggregate","count","groupBy"];function On(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Ku(e,t),zu(e,t),jt(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return Ee({},n)}function Ku(e,t){let r=Te(t),n=Object.keys(Le.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Co(o,t,e._clientVersion,s);let a=l=>u=>{let g=qe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...l})})};return Gu.includes(o)?Sn(e,t,a):Hu(i)?ho(e,i,a):a({})}}}function Hu(e){return Wu.includes(e)}function zu(e,t){return We(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return yo(t,r)}))}m();c();p();d();f();function Ao(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function Qt(e){let t=[Yu(e),ne(kn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(jt(r)),Ee(e,t)}function Yu(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return We({getKeys(){return n},getPropertyValue(i){let o=Ao(i);if(e._runtimeDataModel.models[o]!==void 0)return On(e,o);if(e._runtimeDataModel.models[i]!==void 0)return On(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Ro(e){return e[kn]?e[kn]:e}function So(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Qt(t)}m();c();p();d();f();m();c();p();d();f();function Oo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(nt(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(nt(u))}Zu(e,l.needs)&&s.push(Xu(l,Ee(e,s)))}return s.length>0||a.length>0?Ee(e,[...s,...a]):e}function Zu(e,t){return t.every(r=>an(e,r))}function Xu(e,t){return We(ne(e.name,()=>e.compute(t)))}m();c();p();d();f();function Sr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=Sr({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&ko({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&ko({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function ko({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null)continue;let l=n.models[r].fields.find(g=>g.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=Sr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Fo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==
|
||
|
|
||
|
Learn how: https://pris.ly/d/${Qo[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();d();f();function Go(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();d();f();m();c();p();d();f();m();c();p();d();f();var nc="Cloudflare-Workers",ic="node";function Wo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===nc?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===ic?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var oc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Ko(){let e=Wo();return{id:e,prettyName:oc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();d();f();m();c();p();d();f();var Fn=he(sn());m();c();p();d();f();function Ho(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();d();f();function zo(e){return e.split(`
|
||
|
`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(`
|
||
|
`)}m();c();p();d();f();var Yo=he(_i());function Zo({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,Yo.default)({user:t,repo:r,template:n,title:e,body:i})}function Xo({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=wi(6e3-(s?.length??0)),l=zo((0,Fn.default)(a)),u=n?`# Description
|
||
|
\`\`\`
|
||
|
${n}
|
||
|
\`\`\``:"",g=(0,Fn.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
|
||
|
## Versions
|
||
|
|
||
|
| Name | Version |
|
||
|
|-----------------|--------------------|
|
||
|
| Node | ${y.version?.padEnd(19)}|
|
||
|
| OS | ${t?.padEnd(19)}|
|
||
|
| Prisma Client | ${e?.padEnd(19)}|
|
||
|
| Query Engine | ${i?.padEnd(19)}|
|
||
|
| Database | ${o?.padEnd(19)}|
|
||
|
|
||
|
${u}
|
||
|
|
||
|
## Logs
|
||
|
\`\`\`
|
||
|
${l}
|
||
|
\`\`\`
|
||
|
|
||
|
## Client Snippet
|
||
|
\`\`\`ts
|
||
|
// PLEASE FILL YOUR CODE SNIPPET HERE
|
||
|
\`\`\`
|
||
|
|
||
|
## Schema
|
||
|
\`\`\`prisma
|
||
|
// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
|
||
|
\`\`\`
|
||
|
|
||
|
## Prisma Engine Query
|
||
|
\`\`\`
|
||
|
${s?Ho(s):""}
|
||
|
\`\`\`
|
||
|
`),h=Zo({title:r,body:g});return`${r}
|
||
|
|
||
|
This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
|
||
|
|
||
|
${Pt(h)}
|
||
|
|
||
|
If you want the Prisma team to look into it, please open the link above \u{1F64F}
|
||
|
To increase the chance of success, please post your schema and a snippet of
|
||
|
how you used Prisma Client in the issue.
|
||
|
`}m();c();p();d();f();function Fr({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();d();f();m();c();p();d();f();function es(e){if(e?.kind==="itx")return e.options.id}m();c();p();d();f();var Mn=class{constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r})}async connect(t){return __PrismaProxy.connect(this.engineObject,t)}async disconnect(t){return __PrismaProxy.disconnect(this.engineObject,t)}query(t,r,n){return __PrismaProxy.execute(this.engineObject,t,r,n)}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r){return __PrismaProxy.startTransaction(this.engineObject,t,r)}async commitTransaction(t,r){return __PrismaProxy.commitTransaction(this.engineObject,t,r)}async rollbackTransaction(t,r){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}},ts={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:Mn}}};var sc="P2036",Ce=le("prisma:client:libraryEngine");function ac(e){return e.item_type==="query"&&"query"in e}function lc(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var wC=[...tn,"native"],Gt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=ts,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(uc(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new W(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Ce("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new K("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new K("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&Ce("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLev
|
||
|
${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ce("requestBatch");let i=cr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),es(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new K(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new ue(_n(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:Tr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===sc&&this.config.adapter){let r=t.meta?.id;ir(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return ir(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function uc(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function _n(e,t){return Xo({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function rs({copyEngine:e=!0},t){let r;try{r=Fr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&Mt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Ot(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?r?.startsWith("prisma://")?l=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new H(l.join(`
|
||
|
`),{clientVersion:t.clientVersion})}return new Gt(t)}m();c();p();d();f();function Mr({generator:e}){return e?.previewFeatures??[]}m();c();p();d();f();m();c();p();d();f();function ht(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();d();f();m();c();p();d();f();var ls=he(In());m();c();p();d();f();function ss(e,t,r){let n=as(e),i=cc(n),o=dc(i);o?_r(o,t,r):t.addErrorMessage(()=>"Unknown error")}function as(e){return e.errors.flatMap(t=>t.kind==="Union"?as(t):[t])}function cc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:pc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function pc(e,t){return[...new Set(e.concat(t))]}function dc(e){return un(e,(t,r)=>{let n=is(t),i=is(r);return n!==i?n-i:os(t)-os(r)})}function is(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function os(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();d();f();var ce=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};m();c();p();d();f();var Wt=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(ct,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function _r(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":fc(e,t);break;case"IncludeOnScalar":mc(e,t);break;case"EmptySelection":gc(e,t,r);break;case"UnknownSelectionField":bc(e,t);break;case"UnknownArgument":Ec(e,t);break;case"UnknownInputField":xc(e,t);break;case"RequiredArgumentMissing":vc(e,t);break;case"InvalidArgumentType":Pc(e,t);break;case"InvalidArgumentValue":Tc(e,t);break;case"ValueTooLarge":Cc(e,t);break;case"SomeFieldsMissing":Ac(e,t);break;case"TooManyFieldsGiven":Rc(e,t);break;case"Union":ss(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function fc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function mc(e,t){let[r,n]=Kt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new ce(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Ht(s)}`:a+=".",a+=`
|
||
|
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function gc(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){hc(e,t,i);return}if(n.hasField("select")){yc(e,t);return}}if(r?.[ht(e.outputType.name)]){wc(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function hc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ce(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function yc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ps(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Ht(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function wc(e,t){let r=new Wt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ce("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Kt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new dt;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function bc(e,t){let[r,n]=Kt(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),ps(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),Sc(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Oc(l,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(Ht(s)),a.join(" ")})}function Ec(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),kc(n,e.arguments)),t.addErrorMessage(i=>us(i,r,e.arguments.map(o=>o.name)))}function xc(e,t){let[r,n]=Kt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ds(o,e.inputType)}t.addErrorMessage(o=>us(o,n,e.inputType.fields.map(s=>s.name)))}function us(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Mc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Ht(e)),n.join(" ")}function vc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof z&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Kt(e.argumentPath),s=new Wt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new ce(o,s).makeRequired())}else{let l=e.inputTypes.map(cs).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function cs(e){return e.kind==="list"?`${cs(e.elementType)}[]`:e.name}function Pc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Ir("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function Tc(e,t){let r=e.argument.name,n=t.arguments.getDeepS
|
||
|
Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.
|
||
|
|
||
|
Example:
|
||
|
await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
|
||
|
|
||
|
More Information: https://pris.ly/d/execute-raw
|
||
|
`)}var Dn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(r instanceof $t)n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:yt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=ys(r),i={values:yt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Ps(`prisma.${e}(${n}, ${i.values})`):Ps(`prisma.${e}(${n})`),{query:n,parameters:i}},Ts={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Cs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();d();f();function $n(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=As(r(o)):As(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function As(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();d();f();var Rs={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Bn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Rs}};function Ss(e){return e.includes("tracing")?new Bn:Rs}m();c();p();d();f();function Os(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();d();f();function ks(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}m();c();p();d();f();var Nr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();d();f();var _s=he(sn());m();c();p();d();f();function Dr(e){return typeof e.batchRequestIdx=="number"}m();c();p();d();f();function $r(e){return e===null?e:Array.isArray(e)?e.map($r):typeof e=="object"?Jc(e)?Gc(e):tt(e,$r):e}function Jc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Gc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:Oe(t,"Unknown tagged value")}}m();c();p();d();f();function Fs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(jn(e.query.arguments)),t.push(jn(e.query.selection)),t.join("")}function jn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${jn(n)})`:r}).join(" ")})`}m();c();p();d();f();var Wc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function qn(e){return Wc[e]}m();c();p();d();f();var Br=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0
|
||
|
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};re(B,"PrismaClientConstructorValidationError");var $s=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Bs=["pretty","colorless","minimal"],js=["info","query","warn","error"],ep={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=wt(r,t)||` Available datasources: ${t.join(", ")}`;throw new B(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
|
||
|
It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new B(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
|
||
|
It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new B(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
|
||
|
It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new B('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Mr(t).includes("driverAdapters"))throw new B('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ot()==="binary")throw new B('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
|
||
|
Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new B(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Bs.includes(e)){let t=wt(e,Bs);throw new B(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new B(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!js.includes(r)){let n=wt(r,js);throw new B(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=wt(i,o);throw new B(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new B(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new B(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new B(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new B('"omit" option is expected to be an object.');if(e===null)throw new B('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=rp(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new B(np(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new B(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=wt(r,t);throw new B(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Vs(e,t){for(let[r,n]of Object.entries(e)){if(!$s.includes(r)){let i=wt(r,$s);throw new B(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}ep[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new B('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function wt(e,t){if(t.length===0||typeof e!="string")return"";let r=tp(e,t);return r?` Did you mean "${r}"?`:""}function tp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Us.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function rp(e,t){return qs(t.models,e)??qs(t.types,e)}function qs(e,t){let r=Object.keys(e).find(n=>ht(n)===t);if(r)return e[r]}function np(e,t){let r=ft(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=Pr(r,"colorless");return`Error validating "omit" option:
|
||
|
|
||
|
${i}
|
||
|
|
||
|
${n}`}m();c();p();d();f();function Qs(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(g=>{n[u]=g,a()},g=>{if(!Dr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Ue=le("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ip={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},op=Symbol.for("prisma.client.transaction.id"),sp={id:0,nextId(){return++this.id}};function Ws(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Nr;this._createPrismaPromise=$n();this.$extends=So;e=n?.__internal?.configOverride?.(e)??e,Jo(e),n&&Vs(n,e);let i=new nr().on("error",()=>{});this._extensions=kr.empty(),this._previewFeatures=Mr(e),this._clientVersion=e.clientVersion??Ds,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=Ss(this._previewFeatures);let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=gn(n.adapter);let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new V(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new V("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&le.enable("prisma:client");let h=we.resolve(e.dirname,e.relativePath);tr.existsSync(h)||(h=e.dirname),Ue("dirname",e.dirname),Ue("relativePath",e.relativePath),Ue("cwd",h);let x=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:x.allowTriggerPanic,datamodelPath:we.join(e.dirname,e.filename??"schema.prisma"),prismaPath:x.binaryPath??void 0,engineEndpoint:x.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&ks(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(S=>typeof S=="string"?S==="query":S.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Go(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Fr,getBatchRequestPayload:cr,prismaGraphQLToJSError:Tr,PrismaClientUnknownRequestError:K,PrismaClientInitializationError:V,PrismaClientKnownRequestError:W,debug:le("prisma:client:accelerateEngine"),engineVersion:Gs.version,clientVersion:e.clientVersion}},Ue("clientVersion",e.clientVersion),this._engine=rs(e,this._engineConfig),this._requestHandler=new jr(this,i),l.log)for(let S of l.log){let C=typeof S=="string"?S:S.emit==="stdout"?S.level:null;C&&this.$on(C,A=>{Ft.log(`${Ft.tags[C]??""}`,A.message||A.query)})}this._metrics=new rt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Qt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="before
|
||
|
`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new H("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Js(e,t){return ap(e)?[new se(e,t),Ts]:[e,Cs]}function ap(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();d();f();var lp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ks(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!lp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();d();f();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce});
|
||
|
//# sourceMappingURL=react-native.js.map
|