prisma 6.6.0-integration-mcp.4 → 6.6.0-integration-mcp.5

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.
@@ -1,4 +1,4 @@
1
- "use strict";var lu=Object.create;var Mr=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jt=(e,t)=>{for(var r in t)Mr(e,r,{get:t[r],enumerable:!0})},Co=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!du.call(e,i)&&i!==r&&Mr(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var O=(e,t,r)=>(r=e!=null?lu(pu(e)):{},Co(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>Co(Mr({},"__esModule",{value:!0}),e);var li=ie((Of,Zo)=>{"use strict";Zo.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var ts=ie((_f,es)=>{"use strict";var Zu=require("os"),Xo=require("tty"),me=li(),{env:G}=process,Je;me("no-color")||me("no-colors")||me("color=false")||me("color=never")?Je=0:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(Je=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Je=1:G.FORCE_COLOR==="false"?Je=0:Je=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function ui(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ci(e,t){if(Je===0)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(e&&!t&&Je===void 0)return 0;let r=Je||0;if(G.TERM==="dumb")return r;if(process.platform==="win32"){let n=Zu.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:r}function Xu(e){let t=ci(e,e&&e.isTTY);return ui(t)}es.exports={supportsColor:Xu,stdout:ui(ci(!0,Xo.isatty(1))),stderr:ui(ci(!0,Xo.isatty(2)))}});var is=ie((Df,ns)=>{"use strict";var ec=ts(),ht=li();function rs(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function pi(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(ht("no-hyperlink")||ht("no-hyperlinks")||ht("hyperlink=false")||ht("hyperlink=never"))return!1;if(ht("hyperlink=true")||ht("hyperlink=always")||"NETLIFY"in t)return!0;if(!ec.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=rs(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=rs(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}ns.exports={supportsHyperlink:pi,stdout:pi(process.stdout),stderr:pi(process.stderr)}});var os=ie((Jf,tc)=>{tc.exports={name:"@prisma/internals",version:"6.6.0-integration-mcp.4",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@antfu/ni":"0.21.12","@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.24.2","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"3.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.6.0-26.47cb872770bc2c9ff45909bd09f7326df36d9130","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var fi=ie((Kf,ic)=>{ic.exports={name:"@prisma/engines-version",version:"6.6.0-26.47cb872770bc2c9ff45909bd09f7326df36d9130",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"47cb872770bc2c9ff45909bd09f7326df36d9130"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var gi=ie(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.enginesVersion=void 0;Kr.enginesVersion=fi().prisma.enginesVersion});var cs=ie((fg,us)=>{"use strict";us.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Pi=ie((Eg,ms)=>{"use strict";ms.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ys=ie((xg,hs)=>{"use strict";hs.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Si=ie((Pg,Es)=>{"use strict";var fc=ys();Es.exports=e=>typeof e=="string"?e.replace(fc(),""):e});var bs=ie((Rg,gc)=>{gc.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var vs=ie((Sg,Le)=>{"use strict";var Ci=require("fs"),Ai=require("path"),hc=require("os"),yc=require("crypto"),Ec=bs(),Ii=Ec.version,bc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function wc(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
1
+ "use strict";var lu=Object.create;var Mr=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jt=(e,t)=>{for(var r in t)Mr(e,r,{get:t[r],enumerable:!0})},Co=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!du.call(e,i)&&i!==r&&Mr(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var O=(e,t,r)=>(r=e!=null?lu(pu(e)):{},Co(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>Co(Mr({},"__esModule",{value:!0}),e);var li=ie((Of,Zo)=>{"use strict";Zo.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var ts=ie((_f,es)=>{"use strict";var Zu=require("os"),Xo=require("tty"),me=li(),{env:G}=process,Je;me("no-color")||me("no-colors")||me("color=false")||me("color=never")?Je=0:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(Je=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Je=1:G.FORCE_COLOR==="false"?Je=0:Je=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function ui(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ci(e,t){if(Je===0)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(e&&!t&&Je===void 0)return 0;let r=Je||0;if(G.TERM==="dumb")return r;if(process.platform==="win32"){let n=Zu.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:r}function Xu(e){let t=ci(e,e&&e.isTTY);return ui(t)}es.exports={supportsColor:Xu,stdout:ui(ci(!0,Xo.isatty(1))),stderr:ui(ci(!0,Xo.isatty(2)))}});var is=ie((Df,ns)=>{"use strict";var ec=ts(),ht=li();function rs(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function pi(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(ht("no-hyperlink")||ht("no-hyperlinks")||ht("hyperlink=false")||ht("hyperlink=never"))return!1;if(ht("hyperlink=true")||ht("hyperlink=always")||"NETLIFY"in t)return!0;if(!ec.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=rs(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=rs(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}ns.exports={supportsHyperlink:pi,stdout:pi(process.stdout),stderr:pi(process.stderr)}});var os=ie((Jf,tc)=>{tc.exports={name:"@prisma/internals",version:"6.6.0-integration-mcp.5",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@antfu/ni":"0.21.12","@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.24.2","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"3.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.6.0-27.ff4e67a11a395e489261256f882adb6d6a7eea11","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var fi=ie((Kf,ic)=>{ic.exports={name:"@prisma/engines-version",version:"6.6.0-27.ff4e67a11a395e489261256f882adb6d6a7eea11",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"ff4e67a11a395e489261256f882adb6d6a7eea11"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var gi=ie(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.enginesVersion=void 0;Kr.enginesVersion=fi().prisma.enginesVersion});var cs=ie((fg,us)=>{"use strict";us.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Pi=ie((Eg,ms)=>{"use strict";ms.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var ys=ie((xg,hs)=>{"use strict";hs.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Si=ie((Pg,Es)=>{"use strict";var fc=ys();Es.exports=e=>typeof e=="string"?e.replace(fc(),""):e});var bs=ie((Rg,gc)=>{gc.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var vs=ie((Sg,Le)=>{"use strict";var Ci=require("fs"),Ai=require("path"),hc=require("os"),yc=require("crypto"),Ec=bs(),Ii=Ec.version,bc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function wc(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
2
  `);let n;for(;(n=bc.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
3
  `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function xc(e){let t=Ps(e),r=U.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=xs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Tc(r,a);o=U.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return U.parse(o)}function Pc(e){console.log(`[dotenv@${Ii}][INFO] ${e}`)}function vc(e){console.log(`[dotenv@${Ii}][WARN] ${e}`)}function Zr(e){console.log(`[dotenv@${Ii}][DEBUG] ${e}`)}function xs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Tc(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function Ps(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Ci.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Ai.resolve(process.cwd(),".env.vault");return Ci.existsSync(t)?t:null}function ws(e){return e[0]==="~"?Ai.join(hc.homedir(),e.slice(1)):e}function Rc(e){Pc("Loading env from encrypted .env.vault");let t=U._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),U.populate(r,t,e),{parsed:t}}function Sc(e){let t=Ai.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Zr("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ws(e.path)];else{i=[];for(let l of e.path)i.push(ws(l))}let o,s={};for(let l of i)try{let u=U.parse(Ci.readFileSync(l,{encoding:r}));U.populate(s,u,e)}catch(u){n&&Zr(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),U.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function Cc(e){if(xs(e).length===0)return U.configDotenv(e);let t=Ps(e);return t?U._configVault(e):(vc(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),U.configDotenv(e))}function Ac(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=yc.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function Ic(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Zr(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var U={configDotenv:Sc,_configVault:Rc,_parseVault:xc,config:Cc,decrypt:Ac,parse:wc,populate:Ic};Le.exports.configDotenv=U.configDotenv;Le.exports._configVault=U._configVault;Le.exports._parseVault=U._parseVault;Le.exports.config=U.config;Le.exports.decrypt=U.decrypt;Le.exports.parse=U.parse;Le.exports.populate=U.populate;Le.exports=U});var Cs=ie((_g,en)=>{"use strict";en.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};en.exports.default=en.exports});var Vi=ie((Jh,Ks)=>{"use strict";Ks.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,f,g,h,I,T,S,E,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(t.charCodeAt(s+l));for(var fe=k.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),S=r.charCodeAt(s+(p=a+2)),E=r.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<fe;l+=2)g=k[l],h=k[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,S,h),f=e(p,d,f,E,h),k[l]=f,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),f=++a,l=0;l<fe;l+=2)g=k[l],k[l]=f=e(g,u,f,I,k[l+1]),u=g;return f}}()});var tf={};Jt(tf,{Debug:()=>Xn,Decimal:()=>ve,Extensions:()=>Kn,MetricsClient:()=>Dt,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>Z,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>j,PrismaClientValidationError:()=>X,Public:()=>Yn,Sql:()=>se,createParam:()=>ha,defineDmmfProperty:()=>va,deserializeJsonResponse:()=>Pt,deserializeRawResult:()=>Jn,dmmfToRuntimeDataModel:()=>Pa,empty:()=>Sa,getPrismaClient:()=>ou,getRuntime:()=>Ln,join:()=>Ra,makeStrictEnum:()=>su,makeTypedQueryFactory:()=>Ta,objectEnumValues:()=>xn,raw:()=>Ki,serializeJsonQuery:()=>An,skip:()=>Cn,sqltag:()=>Yi,warnEnvConflicts:()=>au,warnOnce:()=>rr});module.exports=mu(tf);var Kn={};Jt(Kn,{defineExtension:()=>Ao,getExtensionContext:()=>Io});function Ao(e){return typeof e=="function"?e:t=>t.$extends(e)}function Io(e){return e}var Yn={};Jt(Yn,{validator:()=>ko});function ko(...e){return t=>t}var $r={};Jt($r,{$:()=>Lo,bgBlack:()=>vu,bgBlue:()=>Cu,bgCyan:()=>Iu,bgGreen:()=>Ru,bgMagenta:()=>Au,bgRed:()=>Tu,bgWhite:()=>ku,bgYellow:()=>Su,black:()=>bu,blue:()=>rt,bold:()=>W,cyan:()=>_e,dim:()=>ke,gray:()=>Wt,green:()=>Ve,grey:()=>Pu,hidden:()=>yu,inverse:()=>hu,italic:()=>gu,magenta:()=>wu,red:()=>pe,reset:()=>fu,strikethrough:()=>Eu,underline:()=>z,white:()=>xu,yellow:()=>Oe});var zn,Oo,_o,Do,No=!0;typeof process<"u"&&({FORCE_COLOR:zn,NODE_DISABLE_COLORS:Oo,NO_COLOR:_o,TERM:Do}=process.env||{},No=process.stdout&&process.stdout.isTTY);var Lo={enabled:!Oo&&_o==null&&Do!=="dumb"&&(zn!=null&&zn!=="0"||No)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Lo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var fu=M(0,0),W=M(1,22),ke=M(2,22),gu=M(3,23),z=M(4,24),hu=M(7,27),yu=M(8,28),Eu=M(9,29),bu=M(30,39),pe=M(31,39),Ve=M(32,39),Oe=M(33,39),rt=M(34,39),wu=M(35,39),_e=M(36,39),xu=M(37,39),Wt=M(90,39),Pu=M(90,39),vu=M(40,49),Tu=M(41,49),Ru=M(42,49),Su=M(43,49),Cu=M(44,49),Au=M(45,49),Iu=M(46,49),ku=M(47,49);var Ou=100,Fo=["green","yellow","blue","magenta","cyan","red"],Ht=[],Mo=Date.now(),_u=0,Zn=typeof process<"u"?process.env:{};globalThis.DEBUG??=Zn.DEBUG??"";globalThis.DEBUG_COLORS??=Zn.DEBUG_COLORS?Zn.DEBUG_COLORS==="true":!0;var Kt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Du(e){let t={color:Fo[_u++%Fo.length],enabled:Kt.enabled(e),namespace:e,log:Kt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ht.push([o,...n]),Ht.length>Ou&&Ht.shift(),Kt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Nu(c)),u=`+${Date.now()-Mo}ms`;Mo=Date.now(),globalThis.DEBUG_COLORS?a($r[s](W(o)),...l,$r[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Xn=new Proxy(Du,{get:(e,t)=>Kt[t],set:(e,t,r)=>Kt[t]=r});function Nu(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function $o(e=7500){let t=Ht.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
4
  `);return t.length<e?t:t.slice(-e)}function qo(){Ht.length=0}var L=Xn;var Vo=O(require("fs"));function ei(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&Vo.default.existsSync(e))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')}var ti=["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"];var qr="libquery_engine";function Vr(e,t){let r=t==="url";return e.includes("windows")?r?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?r?`${qr}.dylib.node`:`${qr}-${e}.dylib.node`:r?`${qr}.so.node`:`${qr}-${e}.so.node`}var Qo=O(require("child_process")),si=O(require("fs/promises")),Gr=O(require("os"));var De=Symbol.for("@ts-pattern/matcher"),Lu=Symbol.for("@ts-pattern/isVariadic"),Br="@ts-pattern/anonymous-select-key",ri=e=>!!(e&&typeof e=="object"),jr=e=>e&&!!e[De],we=(e,t,r)=>{if(jr(e)){let n=e[De](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(ri(e)){if(!ri(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];jr(a)&&a[Lu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let s=t.slice(0,n.length),a=i.length===0?[]:t.slice(-i.length),l=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>we(u,s[c],r))&&i.every((u,c)=>we(u,a[c],r))&&(o.length===0||we(o[0],l,r))}return e.length===t.length&&e.every((s,a)=>we(s,t[a],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||jr(o=i)&&o[De]().matcherType==="optional")&&we(i,t[n],r);var o})}return Object.is(t,e)},Ge=e=>{var t,r,n;return ri(e)?jr(e)?(t=(r=(n=e[De]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Yt(e,Ge):Yt(Object.values(e),Ge):[]},Yt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function de(e){return Object.assign(e,{optional:()=>Fu(e),and:t=>V(e,t),or:t=>Mu(e,t),select:t=>t===void 0?jo(e):jo(t,e)})}function Fu(e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return t===void 0?(Ge(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:we(e,t,n),selections:r}},getSelectionKeys:()=>Ge(e),matcherType:"optional"})})}function V(...e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return{matched:e.every(i=>we(i,t,n)),selections:r}},getSelectionKeys:()=>Yt(e,Ge),matcherType:"and"})})}function Mu(...e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return Yt(e,Ge).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,t,n)),selections:r}},getSelectionKeys:()=>Yt(e,Ge),matcherType:"or"})})}function A(e){return{[De]:()=>({match:t=>({matched:!!e(t)})})}}function jo(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return de({[De]:()=>({match:n=>{let i={[t??Br]:n};return{matched:r===void 0||we(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??Br].concat(r===void 0?[]:Ge(r))})})}function Ee(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Be(e){return typeof e=="bigint"}var gf=de(A(function(e){return!0}));var Ue=e=>Object.assign(de(e),{startsWith:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.endsWith(r)))));var r},minLength:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length>=r))(t))),length:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length===r))(t))),maxLength:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length<=r))(t))),includes:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.includes(r)))));var r},regex:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&!!n.match(r)))));var r}}),hf=Ue(A(je)),be=e=>Object.assign(de(e),{between:(t,r)=>be(V(e,((n,i)=>A(o=>Ee(o)&&n<=o&&i>=o))(t,r))),lt:t=>be(V(e,(r=>A(n=>Ee(n)&&n<r))(t))),gt:t=>be(V(e,(r=>A(n=>Ee(n)&&n>r))(t))),lte:t=>be(V(e,(r=>A(n=>Ee(n)&&n<=r))(t))),gte:t=>be(V(e,(r=>A(n=>Ee(n)&&n>=r))(t))),int:()=>be(V(e,A(t=>Ee(t)&&Number.isInteger(t)))),finite:()=>be(V(e,A(t=>Ee(t)&&Number.isFinite(t)))),positive:()=>be(V(e,A(t=>Ee(t)&&t>0))),negative:()=>be(V(e,A(t=>Ee(t)&&t<0)))}),yf=be(A(Ee)),Qe=e=>Object.assign(de(e),{between:(t,r)=>Qe(V(e,((n,i)=>A(o=>Be(o)&&n<=o&&i>=o))(t,r))),lt:t=>Qe(V(e,(r=>A(n=>Be(n)&&n<r))(t))),gt:t=>Qe(V(e,(r=>A(n=>Be(n)&&n>r))(t))),lte:t=>Qe(V(e,(r=>A(n=>Be(n)&&n<=r))(t))),gte:t=>Qe(V(e,(r=>A(n=>Be(n)&&n>=r))(t))),positive:()=>Qe(V(e,A(t=>Be(t)&&t>0))),negative:()=>Qe(V(e,A(t=>Be(t)&&t<0)))}),Ef=Qe(A(Be)),bf=de(A(function(e){return typeof e=="boolean"})),wf=de(A(function(e){return typeof e=="symbol"})),xf=de(A(function(e){return e==null})),Pf=de(A(function(e){return e!=null}));var ni=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}},ii={matched:!1,value:void 0};function ft(e){return new oi(e,ii)}var oi=class e{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?ii:{matched:!0,value:r(o?Br in s?s[Br]:s:this.input,this.input)};return new e(this.input,l)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new e(this.input,n?{matched:!0,value:r(this.input,this.input)}:ii)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ni(this.input)}run(){return this.exhaustive()}returnType(){return this}};var Go=require("util");var $u={warn:Oe("prisma:warn")},qu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Ur(e,...t){qu.warn()&&console.warn(`${$u.warn} ${e}`,...t)}var Vu=(0,Go.promisify)(Qo.default.exec),te=L("prisma:get-platform"),ju=["1.0.x","1.1.x","3.0.x"];async function Jo(){let e=Gr.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Jr("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await Uu(),n=await zu(),i=Gu({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await Ju(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function Bu(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=ft({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return te(`Found distro info:
@@ -107,7 +107,7 @@ ${z(p)}
107
107
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
108
108
  To increase the chance of success, please post your schema and a snippet of
109
109
  how you used Prisma Client in the issue.
110
- `}function $t({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 R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var qn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ae=class extends qn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function C(e,t){return{...e,isRetryable:t}}var qt=class extends ae{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",C(t,!0))}};x(qt,"ForcedRetryError");var at=class extends ae{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,C(r,!1))}};x(at,"InvalidDatasourceError");var lt=class extends ae{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,C(r,!1))}};x(lt,"NotImplementedYetError");var q=class extends ae{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var ut=class extends q{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",C(t,!0))}};x(ut,"SchemaMissingError");var io="This request could not be understood by the server",Pr=class extends q{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||io,C(t,!1)),n&&(this.code=n)}};x(Pr,"BadRequestError");var vr=class extends q{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",C(t,!0)),this.logs=r}};x(vr,"HealthcheckTimeoutError");var Tr=class extends q{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,C(t,!0)),this.logs=n}};x(Tr,"EngineStartupError");var Rr=class extends q{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",C(t,!1))}};x(Rr,"EngineVersionNotSupportedError");var oo="Request timed out",Sr=class extends q{name="GatewayTimeoutError";code="P5009";constructor(t,r=oo){super(r,C(t,!1))}};x(Sr,"GatewayTimeoutError");var ym="Interactive transaction error",Cr=class extends q{name="InteractiveTransactionError";code="P5015";constructor(t,r=ym){super(r,C(t,!1))}};x(Cr,"InteractiveTransactionError");var Em="Request parameters are invalid",Ar=class extends q{name="InvalidRequestError";code="P5011";constructor(t,r=Em){super(r,C(t,!1))}};x(Ar,"InvalidRequestError");var so="Requested resource does not exist",Ir=class extends q{name="NotFoundError";code="P5003";constructor(t,r=so){super(r,C(t,!1))}};x(Ir,"NotFoundError");var ao="Unknown server error",Vt=class extends q{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||ao,C(t,!0)),this.logs=n}};x(Vt,"ServerError");var lo="Unauthorized, check your connection string",kr=class extends q{name="UnauthorizedError";code="P5007";constructor(t,r=lo){super(r,C(t,!1))}};x(kr,"UnauthorizedError");var uo="Usage exceeded, retry again later",Or=class extends q{name="UsageExceededError";code="P5008";constructor(t,r=uo){super(r,C(t,!0))}};x(Or,"UsageExceededError");async function bm(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function _r(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await bm(e);if(n.type==="QueryEngineError")throw new Z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new ut(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Rr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Tr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new vr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Cr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ar(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new kr(r,jt(lo,n));if(e.status===404)return new Ir(r,jt(so,n));if(e.status===429)throw new Or(r,jt(uo,n));if(e.status===504)throw new Sr(r,jt(oo,n));if(e.status>=500)throw new Vt(r,jt(ao,n));if(e.status>=400)throw new Pr(r,jt(io,n))}function jt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function gl(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function hl(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=$e[s]+$e[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=$e[s]+$e[a]+$e[l]+"="),r}function yl(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new R("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function wm(e){return e[0]*1e3+e[1]/1e6}function co(e){return new Date(wm(e))}var El={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.6.0-26.47cb872770bc2c9ff45909bd09f7326df36d9130","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Dr=class extends ae{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
110
+ `}function $t({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 R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var qn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ae=class extends qn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function C(e,t){return{...e,isRetryable:t}}var qt=class extends ae{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",C(t,!0))}};x(qt,"ForcedRetryError");var at=class extends ae{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,C(r,!1))}};x(at,"InvalidDatasourceError");var lt=class extends ae{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,C(r,!1))}};x(lt,"NotImplementedYetError");var q=class extends ae{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var ut=class extends q{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",C(t,!0))}};x(ut,"SchemaMissingError");var io="This request could not be understood by the server",Pr=class extends q{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||io,C(t,!1)),n&&(this.code=n)}};x(Pr,"BadRequestError");var vr=class extends q{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",C(t,!0)),this.logs=r}};x(vr,"HealthcheckTimeoutError");var Tr=class extends q{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,C(t,!0)),this.logs=n}};x(Tr,"EngineStartupError");var Rr=class extends q{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",C(t,!1))}};x(Rr,"EngineVersionNotSupportedError");var oo="Request timed out",Sr=class extends q{name="GatewayTimeoutError";code="P5009";constructor(t,r=oo){super(r,C(t,!1))}};x(Sr,"GatewayTimeoutError");var ym="Interactive transaction error",Cr=class extends q{name="InteractiveTransactionError";code="P5015";constructor(t,r=ym){super(r,C(t,!1))}};x(Cr,"InteractiveTransactionError");var Em="Request parameters are invalid",Ar=class extends q{name="InvalidRequestError";code="P5011";constructor(t,r=Em){super(r,C(t,!1))}};x(Ar,"InvalidRequestError");var so="Requested resource does not exist",Ir=class extends q{name="NotFoundError";code="P5003";constructor(t,r=so){super(r,C(t,!1))}};x(Ir,"NotFoundError");var ao="Unknown server error",Vt=class extends q{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||ao,C(t,!0)),this.logs=n}};x(Vt,"ServerError");var lo="Unauthorized, check your connection string",kr=class extends q{name="UnauthorizedError";code="P5007";constructor(t,r=lo){super(r,C(t,!1))}};x(kr,"UnauthorizedError");var uo="Usage exceeded, retry again later",Or=class extends q{name="UsageExceededError";code="P5008";constructor(t,r=uo){super(r,C(t,!0))}};x(Or,"UsageExceededError");async function bm(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function _r(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await bm(e);if(n.type==="QueryEngineError")throw new Z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new ut(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Rr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Tr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new vr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Cr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ar(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new kr(r,jt(lo,n));if(e.status===404)return new Ir(r,jt(so,n));if(e.status===429)throw new Or(r,jt(uo,n));if(e.status===504)throw new Sr(r,jt(oo,n));if(e.status>=500)throw new Vt(r,jt(ao,n));if(e.status>=400)throw new Pr(r,jt(io,n))}function jt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function gl(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function hl(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=$e[s]+$e[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=$e[s]+$e[a]+$e[l]+"="),r}function yl(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new R("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function wm(e){return e[0]*1e3+e[1]/1e6}function co(e){return new Date(wm(e))}var El={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.6.0-27.ff4e67a11a395e489261256f882adb6d6a7eea11","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Dr=class extends ae{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
111
111
  ${t}`,C(r,!0))}};x(Dr,"RequestError");async function ct(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Dr(a,{clientVersion:n,cause:s})}}var Pm=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,bl=L("prisma:client:dataproxyEngine");async function vm(e,t){let r=El["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Pm.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Tm(`<=${a}.${l}.${u}`),p=await ct(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();bl("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new lt("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function wl(e,t){let r=await vm(e,t);return bl("version",r),r}function Tm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var xl=3,Vn=L("prisma:client:dataproxyEngine"),po=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Nr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(t){yl(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=hl(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new po({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await wl(t,this.config),Vn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Vn(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:co(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:co(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ct(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Vn("schema response status",r.status);let n=await _r(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Lt(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Vn("graphql response status",a.status),await this.handleError(await _r(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await ct(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await _r(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await _r(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=$t({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==Yr)throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new at(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new lt("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ae)||!i.isRetryable)throw i;if(r>=xl)throw i instanceof qt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${xl} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await gl(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof ut)throw await this.uploadSchema(),new qt({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?Ft(t[0],this.config.clientVersion,this.config.activeProvider):new j(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function mo(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function jn(e){return{ok:!0,value:e,map(t){return jn(t(e))},flatMap(t){return t(e)}}}function pt(e){return{ok:!1,error:e,map(){return pt(e)},flatMap(){return pt(e)}}}var fo=class{registeredErrors=[];consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},go=e=>{let t=new fo,r={adapterName:e.adapterName,errorRegistry:t,queryRaw:qe(t,e.queryRaw.bind(e)),executeRaw:qe(t,e.executeRaw.bind(e)),executeScript:qe(t,e.executeScript.bind(e)),dispose:qe(t,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await qe(t,e.startTransaction.bind(e))(...n)).map(o=>Rm(t,o))};return e.getConnectionInfo&&(r.getConnectionInfo=Sm(t,e.getConnectionInfo.bind(e))),r},Rm=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:qe(e,t.queryRaw.bind(t)),executeRaw:qe(e,t.executeRaw.bind(t)),commit:qe(e,t.commit.bind(t)),rollback:qe(e,t.rollback.bind(t))});function qe(e,t){return async(...r)=>{try{return jn(await t(...r))}catch(n){if(mo(n))return pt(n.cause);let i=e.registerNewError(n);return pt({kind:"GenericJs",id:i})}}}function Sm(e,t){return(...r)=>{try{return jn(t(...r))}catch(n){if(mo(n))return pt(n.cause);let i=e.registerNewError(n);return pt({kind:"GenericJs",id:i})}}}function Pl(e){if(e?.kind==="itx")return e.options.id}var yo=O(require("os")),vl=O(require("path"));var ho=Symbol("PrismaLibraryEngineCache");function Cm(){let e=globalThis;return e[ho]===void 0&&(e[ho]={}),e[ho]}function Am(e){let t=Cm();if(t[e]!==void 0)return t[e];let r=vl.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=yo.default.constants.dlopen.RTLD_LAZY|yo.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var Tl={async loadLibrary(e){let t=await ai(),r=await ll("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Am(r))}catch(n){let i=Ei({e:n,platformInfo:t,id:r});throw new R(i,e.clientVersion)}}};var Eo,Rl={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Ln().prettyName})`,t);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",t);Eo===void 0&&(Eo=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Eo;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Im="P2036",Ae=L("prisma:client:libraryEngine");function km(e){return e.item_type==="query"&&"query"in e}function Om(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Sl=[...ti,"native"],_m=0xffffffffffffffffn,bo=1n;function Dm(){let e=bo++;return bo>_m&&(bo=1n),e}var Bt=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(t,r){this.libraryLoader=r??Tl,t.engineWasm!==void 0&&(this.libraryLoader=r??Rl),this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,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()}wrapEngine(t){return{applyPendingMigrations:t.applyPendingMigrations?.bind(t),commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t)}}withRequestId(t){return async(...r)=>{let n=Dm().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(t==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else t==="commit"?s=await this.engine?.commitTransaction(n.id,o):t==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Nm(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new Z(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new j(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(Ae("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;ei(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let t=await this.tracingHelper.runInChildSpan("detect_platform",()=>nt());if(!Sl.includes(t))throw new R(`Unknown ${pe("PRISMA_QUERY_ENGINE_LIBRARY")} ${pe(W(t))}. Possible binaryTargets: ${Ve(Sl.join(", "))} or a path to the query engine library.
112
112
  You may have to run ${Ve("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return t}}parseEngineResponse(t){if(!t)throw new j("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new j("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 WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(go));let r=await this.adapterPromise;r&&Ae("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",km(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Om(r)?this.loggerRustPanic=new ue(wo(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ae(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ae("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ae("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ae("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ae("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,Ae("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ae(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(wo(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new j(`${a.message}
113
113
  ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ae("requestBatch");let i=Lt(t,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Pl(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(t,r){if(t.user_facing_error.is_panic)return new ue(wo(this,t.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(t.user_facing_error,r);return n?n.error:Ft(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t,r){if(t.error_code===Im&&r){let n=t.meta?.id;zr(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return zr(i,"External error with reported id was not registered"),i}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function Nm(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function wo(e,t){return fl({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Cl({copyEngine:e=!0},t){let r;try{r=$t({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||wi(r));e&&n&&rr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=yt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["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."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["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 X(c.join(`
@@ -118,7 +118,7 @@ Example:
118
118
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
119
119
 
120
120
  More Information: https://pris.ly/d/execute-raw
121
- `)}var Po=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(kn(r))n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ut(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Il(r),i={values:Ut(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Nl(`prisma.${e}(${n}, ${i.values})`):Nl(`prisma.${e}(${n})`),{query:n,parameters:i}},Ll={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Fl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function vo(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ml(r(s)):Ml(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Ml(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Mm=mi.split(".")[0],$m={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},To=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${Mm}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??$m}};function $l(){return new To}function ql(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Vl(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)}var Un=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Bl=O(Si());function Qn(e){return typeof e.batchRequestIdx=="number"}function jl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Ro(e.query.arguments)),t.push(Ro(e.query.selection)),t.join("")}function Ro(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Ro(n)})`:r}).join(" ")})`}var qm={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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function So(e){return qm[e]}var Gn=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};function dt(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>dt("bigint",r));case"bytes-array":return t.map(r=>dt("bytes",r));case"decimal-array":return t.map(r=>dt("decimal",r));case"datetime-array":return t.map(r=>dt("datetime",r));case"date-array":return t.map(r=>dt("date",r));case"time-array":return t.map(r=>dt("time",r));default:return t}}function Jn(e){let t=[],r=Vm(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=dt(e.types[s],i[s]);t.push(o)}return t}function Vm(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var jm=L("prisma:client:request_handler"),Wn=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Gn({batchLoader:Ya(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>So(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Bm(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ul(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:So(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:jl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(jm(t),Um(t,i))throw t;if(t instanceof Z&&Qm(t)){let u=Ql(t.meta);Tn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=fn({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new Z(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(l,this.client._clientVersion);if(t instanceof j)throw new j(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof R)throw new R(l,this.client._clientVersion);if(t instanceof ue)throw new ue(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Bl.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Xi(o,s),l=i==="queryRaw"?Jn(a):Pt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Bm(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ul(e)};Ne(e,"Unknown transaction kind")}}function Ul(e){return{id:e.id,payload:e.payload}}function Um(e,t){return Qn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Qm(e){return e.code==="P2009"||e.code==="P2012"}function Ql(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ql)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var Gl="6.6.0-integration-mcp.4";var Jl=Gl;var zl=O(Vi());var D=class extends Error{constructor(t){super(t+`
121
+ `)}var Po=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(kn(r))n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ut(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Il(r),i={values:Ut(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Nl(`prisma.${e}(${n}, ${i.values})`):Nl(`prisma.${e}(${n})`),{query:n,parameters:i}},Ll={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Fl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function vo(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ml(r(s)):Ml(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function Ml(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Mm=mi.split(".")[0],$m={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},To=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${Mm}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??$m}};function $l(){return new To}function ql(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Vl(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)}var Un=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Bl=O(Si());function Qn(e){return typeof e.batchRequestIdx=="number"}function jl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Ro(e.query.arguments)),t.push(Ro(e.query.selection)),t.join("")}function Ro(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Ro(n)})`:r}).join(" ")})`}var qm={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,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function So(e){return qm[e]}var Gn=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};function dt(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>dt("bigint",r));case"bytes-array":return t.map(r=>dt("bytes",r));case"decimal-array":return t.map(r=>dt("decimal",r));case"datetime-array":return t.map(r=>dt("datetime",r));case"date-array":return t.map(r=>dt("date",r));case"time-array":return t.map(r=>dt("time",r));default:return t}}function Jn(e){let t=[],r=Vm(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=dt(e.types[s],i[s]);t.push(o)}return t}function Vm(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var jm=L("prisma:client:request_handler"),Wn=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Gn({batchLoader:Ya(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>So(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Bm(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ul(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:So(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:jl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(jm(t),Um(t,i))throw t;if(t instanceof Z&&Qm(t)){let u=Ql(t.meta);Tn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=fn({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new Z(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(l,this.client._clientVersion);if(t instanceof j)throw new j(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof R)throw new R(l,this.client._clientVersion);if(t instanceof ue)throw new ue(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Bl.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=Xi(o,s),l=i==="queryRaw"?Jn(a):Pt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Bm(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ul(e)};Ne(e,"Unknown transaction kind")}}function Ul(e){return{id:e.id,payload:e.payload}}function Um(e,t){return Qn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Qm(e){return e.code==="P2009"||e.code==="P2012"}function Ql(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ql)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var Gl="6.6.0-integration-mcp.5";var Jl=Gl;var zl=O(Vi());var D=class extends Error{constructor(t){super(t+`
122
122
  Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};x(D,"PrismaClientConstructorValidationError");var Wl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Hl=["pretty","colorless","minimal"],Kl=["info","query","warn","error"],Jm={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`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=Qt(r,t)||` Available datasources: ${t.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
123
123
  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 D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
124
124
  It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.