Erster Docker-Stand

This commit is contained in:
Ali
2026-02-20 16:06:40 +09:00
commit f31e2e8ed3
8818 changed files with 1605323 additions and 0 deletions

File diff suppressed because one or more lines are too long

3
_node_modules/@prisma/dev/dist/chunk-7NDL3ECU.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import{a as P,c as b,d as v}from"./chunk-ITQ6ILGR.js";import{minLength as B,object as j,optional as K,parseJson as L,pipe as y,regex as R,safeParse as _,string as w,url as A}from"valibot";var S=/^(postgres|postgresql):\/\//,N=y(w(),L(),j({databaseUrl:y(w(),A(),R(S)),name:K(y(w(),B(1))),shadowDatabaseUrl:y(w(),A(),R(S))}));function Y(r){return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(r).sort(([[e],[n]])=>e.localeCompare(n)))),"utf8").toString("base64url")}function Q(r){let e=Buffer.from(r,"base64url").toString("utf8"),{issues:n,output:s,success:t}=_(N,e,{abortEarly:!0});return t?[null,s]:[n]}var X=async(r,e)=>{let{authorization:n}=r,{HTTPException:s}=await import("hono/http-exception");if(!n)throw new s(401,{message:"Missing API Key"});let[t,o="",i]=n.split(" ");if(t!=="Bearer"||i)throw new s(401,{message:"Invalid API Key"});let[a,m]=Q(o);if(a)throw new s(401,{message:"Invalid API Key",cause:a.join(", ")});let{databaseUrl:h,name:c,shadowDatabaseUrl:d}=m,l=e.get("name"),g=new URL(e.req.url).port;if(!c)throw new s(401,{message:`Wrong API Key; The Prisma Dev server running at port ${g} requires an API Key from a newer version of \`prisma dev\`. Check the "${l}" server's output for the updated \`DATABASE_URL\` value.`});if(c!==l)throw new s(401,{message:`Wrong API Key; The Prisma Dev server running at port ${g} is named "${l}", but the API Key is for "${c}"`});let{hostname:f,port:E}=new URL(h),{port:$}=e.get("db"),{hostname:C,port:D}=new URL(d),H=e.get("shadowDBPort");if(f!=="localhost"||Number(E)!==$||C!=="localhost"||Number(D)!==H)throw new s(401,{message:"Wrong API Key; Check your Prisma schema's `provider.url` value (probably defined in `.env`'s `DATABASE_URL` environment variable) is aligned with `prisma dev`'s output"});return{decodedAPIKey:m}};import{spawn as U}from"child_process";import{once as F}from"events";import{mkdir as V}from"fs/promises";import{join as q}from"path";import{setTimeout as z}from"timers/promises";function O(r){let e,n,s=new Promise((i,a)=>{e=i,n=a}),t=i=>{t=o=null,n(i),r?.onRejected?.(i),r?.onFulfilled?.()},o=i=>{o=t=null,e(i),r?.onResolved?.(i),r?.onFulfilled?.()};return{isFulfilled:()=>o===t,promise:s,reject:i=>t?.(i),resolve:i=>o?.(i)}}import{process as M}from"std-env";var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:J,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:G,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:I}=M.env,x=class r{static#t=new Map;#e;#n;constructor(e){this.#e=e,this.#n=null}static async get(e){let{debug:n}=e,s=`${e.schemaHash}:${e.clientVersion}`;try{let t=r.#t.get(s);if(t)return t;let o=new r(e);return r.#t.set(s,o),n&&console.debug("[Query Engine] starting...",e),await o.start(),n&&console.debug("[Query Engine] started!"),o}finally{r.stopAll(s)}}static async stopAll(e){let s=(await Promise.allSettled(Array.from(r.#t.entries()).filter(([t])=>t!==e).map(async([t,o])=>{try{await o.stop()}finally{r.#t.delete(t)}}))).filter(t=>t.status==="rejected").map(t=>t.reason);if(s.length>0)throw new AggregateError(s,"Failed to stop engines")}async commitTransaction(e,n){return await this.#i(e,n,"commit")}async request(e,n){let{url:s}=await this.start(),t=this.#s(n),o=await fetch(s,{body:typeof e=="string"?e:JSON.stringify(e),headers:{...t,"Content-Type":"application/json"},method:"POST"});if(!o.ok)throw await u.fromResponse(o);return await o.text()}async rollbackTransaction(e,n){return await this.#i(e,n,"rollback")}async startTransaction(e,n){let{url:s}=await this.start(),t=this.#s(n),o=await fetch(`${s}/transaction/start`,{body:JSON.stringify(e),headers:{...t,"Content-Type":"application/json"},method:"POST"});if(!o.ok)throw await u.fromResponse(o);return await o.json()}async start(){if(this.#n!=null)return await this.#n;let{promise:e,reject:n,resolve:s}=O();this.#n=e;let t=G||await this.#o();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",t);let{proxySignals:o}=await import("foreground-child/proxy-signals"),i=U(t,["--enable-raw-queries","--enable-telemetry-in-response","--port","0"],{env:{LOG_QUERIES:"y",PRISMA_DML:this.#e.base64Schema,QE_LOG_LEVEL:"TRACE",RUST_BACKTRACE:"1",RUST_LOG:"info"},stdio:["ignore","pipe","pipe"],windowsHide:!0});o(i),i.stderr.setEncoding("utf8"),i.stdout.setEncoding("utf8");let a=c=>{let d=c.split(`
`).find(E=>E.includes("Started query engine http server"));if(!d)return;i.stdout.removeListener("data",a);let{fields:l}=JSON.parse(d);if(l==null)return n(new Error(`Unexpected data during initialization, "fields" are missing: ${c}`));let{ip:g,port:f}=l;if(g==null||f==null)return n(new Error(`This version of query-engine is not compatible with minippg, "ip" and "port" are missing in the startup log entry.
Received data: ${c}`));s({childProcess:i,url:`http://${g}:${f}`})},m=c=>{this.#n=null,n(new p(String(c))),i.removeListener("exit",h),i.kill()};i.once("error",m);let h=(c,d)=>{this.#n=null,n(new p(`Query Engine exited with code ${c} and signal ${d}`))};return i.once("exit",h),i.stdout.on("data",a),this.#e.debug&&(i.stderr.on("data",console.error.bind(console,"[Query Engine]")),i.stdout.on("data",console.debug.bind(console,"[Query Engine]"))),await this.#n}async stop(){if(this.#n==null)return;let{childProcess:e}=await this.#n;e.exitCode==null&&e.signalCode==null&&(this.#n=null,e.kill(),await F(e,"exit"))}async#o(){this.#e.debug&&console.debug("[Query Engine] getting engine commit hash...");let e=await this.#r();this.#e.debug&&console.debug("[Query Engine] got engine commit hash",e);let n=P(this.#e.clientVersion,e);this.#e.debug&&console.debug("[Query Engine] cache directory path",n),await V(n,{recursive:!0});let{binaryTarget:s}=this.#e.platform,t=s==="windows"?".exe":"",o=q(n,`query-engine-${s}${t}`);return this.#e.debug&&console.debug("[Query Engine] binary path",o),(J==="1"||await b(o)===!1)&&await this.#a({commitHash:e,extension:t,engineBinaryPath:o}),o}async#r(){let e=await fetch(`https://registry.npmjs.org/@prisma/client/${this.#e.clientVersion}`);if(!e.ok)throw new Error(`Couldn't fetch package.json from npm registry, status code: ${e.status}`);let s=(await e.json()).devDependencies?.["@prisma/engines-version"];if(!s)throw new Error("Couldn't find engines version in package.json");let t=s.split(".").at(-1);if(!t)throw new Error("Couldn't find commit hash in engines version");return t}async#a(e){let{commitHash:n,extension:s,engineBinaryPath:t}=e,{binaryTarget:o}=this.#e.platform,i=`https://binaries.prisma.sh/all_commits/${n}/${o}/query-engine${s}.gz`;this.#e.debug&&console.debug("[Query Engine] downloading engine from url",i);let a=await fetch(i);if(!a.ok)throw new Error(`Couldn't download engine. URL: ${i}, status code: ${a.status}`);I&&await z(Number(I)),await v(await a.arrayBuffer(),t),this.#e.debug&&console.debug("[Query Engine] downloaded and saved at",t)}#s(e){let n={};for(let[s,t]of Object.entries(e))t!=null&&(n[s]=t);return n}async#i(e,n,s){let{url:t}=await this.#n,o=this.#s(n),i=await fetch(`${t}/transaction/${e}/${s}`,{headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw await u.fromResponse(i);try{return await i.json()}catch{return{}}}};function ue(r,e){return console.error(r),r instanceof p?e.json({EngineNotStarted:{reason:{EngineStartupError:{logs:[],msg:r.message}}}},500):r instanceof u?e.text(r.responseBody,r.statusCode):e.body(null,500)}var p=class extends Error{name="EngineStartError"},u=class r extends Error{constructor(n,s,t){super(`${n}: Query Engine response status ${s}, body: ${t}`);this.action=n;this.statusCode=s;this.responseBody=t}name="EngineHttpError";static async fromResponse(n){let s=new URL(n.url),t=await n.text();return new r(s.pathname,n.status,t)}};export{Y as a,X as b,O as c,x as d,ue as e};

1
_node_modules/@prisma/dev/dist/chunk-ITQ6ILGR.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{createWriteStream as w,WriteStream as A}from"fs";import{access as D,chmod as x,constants as P,mkdir as T,readdir as E,readFile as _,rm as F,writeFile as O}from"fs/promises";import{promisify as v}from"util";import{unzip as C}from"zlib";import o from"path";import g from"os";import c from"process";var n=g.homedir(),a=g.tmpdir(),{env:e}=c,h=t=>{let r=o.join(n,"Library");return{data:o.join(r,"Application Support",t),config:o.join(r,"Preferences",t),cache:o.join(r,"Caches",t),log:o.join(r,"Logs",t),temp:o.join(a,t)}},y=t=>{let r=e.APPDATA||o.join(n,"AppData","Roaming"),i=e.LOCALAPPDATA||o.join(n,"AppData","Local");return{data:o.join(i,t,"Data"),config:o.join(r,t,"Config"),cache:o.join(i,t,"Cache"),log:o.join(i,t,"Log"),temp:o.join(a,t)}},j=t=>{let r=o.basename(n);return{data:o.join(e.XDG_DATA_HOME||o.join(n,".local","share"),t),config:o.join(e.XDG_CONFIG_HOME||o.join(n,".config"),t),cache:o.join(e.XDG_CACHE_HOME||o.join(n,".cache"),t),log:o.join(e.XDG_STATE_HOME||o.join(n,".local","state"),t),temp:o.join(a,r,t)}};function p(t,{suffix:r="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return r&&(t+=`-${r}`),c.platform==="darwin"?h(t):c.platform==="win32"?y(t):j(t)}import L from"zeptomatch";var l=p("prisma-dev"),G=v(C);function z(t,r){return`${l.cache}/engine/${t}/${r}`}function B(t){return`${l.data}/${t}`}async function J(t){try{return await D(t,P.F_OK),!0}catch(r){if(u(r))return!1;throw r}}async function K(t,r){let i=await G(t);await O(r,i),await x(r,"755")}async function q(t,r){await t.stream().pipeTo(A.toWeb(w(r,{encoding:"utf8"})))}function u(t){return t!=null&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"}async function Q(t){try{return await _(t,{encoding:"utf-8"})}catch(r){if(u(r))return null;throw r}}async function U(t){await T(t,{recursive:!0})}async function V(t,r){try{return(await E(t,{withFileTypes:!0})).reduce((f,s)=>(s.isDirectory()&&!s.name.startsWith(".")&&(!r||L(r,s.name))&&f.push(s.name),f),[])}catch(i){if(u(i))return[];throw i}}async function Y(t){await F(t,{force:!0,recursive:!0})}export{z as a,B as b,J as c,K as d,q as e,Q as f,U as g,V as h,Y as i};

3
_node_modules/@prisma/dev/dist/chunk-LKYVOPH3.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import{d as h,e as f,f as y}from"./chunk-OTI5SWIV.js";import{b as l,f as O,g as V,h as N,i as C}from"./chunk-ITQ6ILGR.js";import{writeFile as Q}from"fs/promises";import{join as c}from"pathe";import{check as W,lock as X,unlock as ee}from"proper-lockfile";import{process as j}from"std-env";import{integer as F,literal as te,minLength as re,minValue as q,number as H,object as v,optional as g,parseJson as se,pipe as m,safeParse as ae,string as w,url as oe}from"valibot";import{setTimeout as z}from"timers/promises";import{process as P}from"std-env";function x(r,e){if(r==null)return!1;try{return P.kill?.(r,0)??!0}catch(t){return e&&console.error(`Error checking if process with PID ${r} exists:`,t),!1}}async function A(r,e){if(!P.kill)return!1;try{P.kill(r,"SIGTERM")}catch(s){return e&&console.error(`Error killing process with PID ${r}:`,s),!1}let t=0;do{if(!x(r,e))return!0;await z(100)}while(++t<50);try{return P.kill(r,"SIGKILL")}catch(s){return e&&console.error(`Error forcefully killing process with PID ${r}:`,s),!1}}var _=m(w(),oe()),L=v({connectionString:_,prismaORMConnectionString:g(_),terminalCommand:g(w())}),J=v({url:_}),M=m(H(),F(),q(1)),ie=v({database:L,http:J,ppg:J,shadowDatabase:L}),ne=v({databasePort:M,exports:g(ie),name:m(w(),re(1)),pid:g(m(H(),F(),q(0))),port:M,shadowDatabasePort:M,version:te("1")}),E=Symbol("initialize"),k="default",u=class{_databasePort;databaseConnectTimeoutMillis;databaseIdleTimeoutMillis;debug;dryRun;name;persistenceMode;pid;shadowDatabaseConnectTimeoutMillis;shadowDatabaseIdleTimeoutMillis;_port;_shadowDatabasePort;constructor(e){this._databasePort=e.databasePort??f,this.databaseConnectTimeoutMillis=e.databaseConnectTimeoutMillis??6e4,this.databaseIdleTimeoutMillis=e.databaseIdleTimeoutMillis??1/0,this.debug=e.debug??!1,this.dryRun=e.dryRun??!1,this.name=e.name??k,this.persistenceMode=e.persistenceMode,this.pid=e.pid??j.pid,this.shadowDatabaseConnectTimeoutMillis=e.shadowDatabaseConnectTimeoutMillis??this.databaseConnectTimeoutMillis,this.shadowDatabaseIdleTimeoutMillis=e.shadowDatabaseIdleTimeoutMillis??this.databaseIdleTimeoutMillis,this._port=e.port??f,this._shadowDatabasePort=e.shadowDatabasePort??f}static async createExclusively(e){let t=e?.dryRun!==!0&&e?.persistenceMode==="stateful"?new p(e):new I(e);return await t[E](),t}static async fromServerDump(e){let{debug:t,name:s=k}=e??{},o=l(s),i=p.getServerDumpPath(o),a=await O(i);if(a==null)return t&&console.debug(`[State] No server dump file found at: ${i}`),null;t&&(console.debug(`[State] server dump file found at "${i}":`),console.debug(a));let{issues:n,output:d,success:b}=ae(m(w(),se(),ne),a);if(!b)throw t&&console.debug(`[State] Invalid server dump file at "${i}":
${JSON.stringify(n,null,2)}`),new Error(`Invalid Prisma Dev state for "${s}".`);return new p({databasePort:d.databasePort,debug:t,dryRun:!1,name:s,pid:d.pid,port:d.port,serverDump:d,shadowDatabasePort:d.shadowDatabasePort})}static async scan(e){let{debug:t,globs:s}=e??{},o=c(l(k),"..");t&&console.debug(`[State] scanning for server states in: ${o}`);let i=await N(o,s);return t&&console.debug(`[State] found server names: ${JSON.stringify(i)}`),await Promise.all(i.map(a=>K(a,e)))}get databasePort(){return this._databasePort}set databasePort(e){this.#t("databasePort",e)}get port(){return this._port}set port(e){this.#t("port",e)}get shadowDatabasePort(){return this._shadowDatabasePort}set shadowDatabasePort(e){this.#t("shadowDatabasePort",e)}#t(e,t){if(t<0||!Number.isInteger(t))throw new Error(`Invalid port number: ${t}`);let s=`_${e}`;if(this[s]!==h&&this[s]!==t)throw new Error(`\`${e}\` is already set to ${this[s]}, cannot change it to ${t}`);this[s]=t}},I=class extends u{constructor(e){super({...e,databasePort:e?.databasePort||h,persistenceMode:"stateless",port:e?.port||h,shadowDatabasePort:e?.shadowDatabasePort||h})}get databaseDumpPath(){return"<DUMP_PATH>"}get pgliteDataDirPath(){return"memory://"}async[E](){let e;try{e=await u.scan({debug:this.debug,onlyMetadata:!0})}catch(s){this.debug&&console.warn("[State] failed to scan for existing servers, assuming filesystem does not exist or other reasons.",s),e=[]}let t=await y({debug:this.debug,name:this.dryRun?this.name:"",requestedPorts:{databasePort:this.databasePort,port:this.port,shadowDatabasePort:this.shadowDatabasePort},servers:e});this._databasePort=t.databasePort,this._port=t.port,this._shadowDatabasePort=t.shadowDatabasePort}async close(){}async writeServerDump(){}},p=class r extends u{#t;#e;#s;#o;#i;#a;#r;constructor(e){super({...e,persistenceMode:"stateful"}),this.#a=!1,this.#e=l(this.name),this.#t=c(this.#e,"db_dump.bak"),this.#s=c(this.#e,".lock"),this.#o=c(this.#e,".pglite"),this.#r=e?.serverDump??null,this.#i=r.getServerDumpPath(this.#e)}static getServerDumpPath(e){return c(e,"server.json")}get databaseDumpPath(){return this.#t}get exports(){return this.#r?.exports}get pgliteDataDirPath(){return this.#o}async[E](){await V(this.#e),this.debug&&console.debug(`[State] using data directory: ${this.#e}`);try{await X(this.#e,{lockfilePath:this.#s}),this.debug&&console.debug(`[State] obtained lock on: ${this.#e}`);let e=await u.scan({debug:this.debug,onlyMetadata:!0}),t=await y({debug:this.debug,name:this.name,requestedPorts:{databasePort:this.databasePort,port:this.port,shadowDatabasePort:this.shadowDatabasePort},servers:e});this._databasePort=t.databasePort,this._port=t.port,this._shadowDatabasePort=t.shadowDatabasePort,await this.writeServerDump()}catch(e){throw e instanceof Error&&"code"in e&&e.code==="ELOCKED"?new T(this):e}}async close(){if(!this.#a)try{await ee(this.#e,{lockfilePath:this.#s}),this.#a=!0,this.debug&&console.debug(`[State] released lock on: ${this.#e}`)}catch(e){throw this.debug&&console.error(`[State] failed to release lock on: ${this.#e}`,e),e}}async writeServerDump(e){this.#r={name:this.name,version:"1",pid:j.pid,port:this.port,databasePort:this.databasePort,shadowDatabasePort:this.shadowDatabasePort,exports:e},await Q(this.#i,`${JSON.stringify(this.#r,null,2)}
`,{encoding:"utf-8"})}};async function Se(r,e){await de(r,e);let t=l(typeof r=="string"?r:r.name);await C(t)}async function K(r,e){let{debug:t,onlyMetadata:s}=e||{},o=typeof r=="string"?r:r.name,i=typeof r!="string"?r:void 0,a={databasePort:i?.databasePort??-1,exports:i?.exports,name:o,pid:i?.pid,port:i?.port??-1,shadowDatabasePort:i?.shadowDatabasePort??-1,version:"1"};try{let n=i||await u.fromServerDump({debug:t,name:o});if(!n)return t&&console.debug(`[State] no server state found for name: ${o}`),{...a,status:"no_such_server"};a.databasePort=n.databasePort,a.exports=n.exports,a.pid=n.pid,a.port=n.port,a.shadowDatabasePort=n.shadowDatabasePort;let{exports:d,pid:b}=n;if(s)return{...a,status:"unknown"};if(!x(b,t))return t&&console.debug(`[State] server state for "${o}" has no running process with PID: ${b}`),{...a,status:"not_running"};let R=l(o);try{if(!await W(R,{lockfilePath:c(R,".lock")}))return t&&console.debug(`[State] server state for "${o}" is not locked, indicating it is not running.`),{...a,status:"starting_up"}}catch(G){t&&console.error(`[State] server state for "${o}" failed to check lock:`,G)}if(!d)return{...a,status:"starting_up"};let{http:Y}=d,{hc:B}=await import("hono/client"),D=await B(Y.url).health.$get();if(!D.ok)return t&&console.debug(`[State] server state for "${o}" is not live: ${JSON.stringify(D)}`),{...a,status:"not_running"};let S=await D.json();return S.name!==r?(t&&console.debug(`[State] server state for "${o}" has mismatched health response: ${JSON.stringify(S)}`),{...a,status:"unknown"}):(t&&console.debug(`[State] server state for "${r}" is live: ${JSON.stringify(S)}`),{...a,status:"running"})}catch(n){return t&&console.error(`[State] failed to get server status for "${o}":`,n),{...a,status:"error"}}}function ue(r){let{status:e}=r;return e==="running"||e==="starting_up"}async function de(r,e){let{pid:t,...s}=typeof r=="string"?await K(r,{debug:e}):r;if(!ue(s))return!1;let o=await u.fromServerDump({debug:e,name:s.name});if(t==null){e&&console.debug(`[State] No PID found for server "${s.name}" to kill.`);try{await o?.close()}catch{}return!1}let i=await A(t,e);try{await o?.close()}catch{}return i}var $=class extends Error{name="ServerStateAlreadyExistsError";constructor(e){super(`A Prisma Dev server with the name "${e}" is already running.`)}},T=class extends ${#t;name="ServerAlreadyRunningError";constructor(e){super(e.name),this.#t=e}get server(){return u.fromServerDump({debug:this.#t.debug,name:this.#t.name})}};export{u as a,Se as b,K as c,ue as d,de as e,$ as f,T as g};

1
_node_modules/@prisma/dev/dist/chunk-OTI5SWIV.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{checkPort as w,getPort as m,isUnsafePort as O}from"get-port-please";import{difference as T,range as $}from"remeda";var v=51214,h=51213,S=51215,p=65535,k=0,P=-1/0;async function E(o){let{debug:t,name:r,requestedPorts:n,servers:u}=o,{portsUsedByOtherServers:e,portsUsedByThisServerLastTime:a}=B(r,u);t&&(console.debug(`ports used by other servers: ${Object.keys(e).join(", ")}`),console.debug(`ports used by "${r}" server last time: ${JSON.stringify(a)}`));let i={databasePort:P,port:P,shadowDatabasePort:P},s=["port","databasePort","shadowDatabasePort"];for(let c of s){let d=await x({debug:t,portKey:c,portsUsedByOtherServers:e,portsUsedByThisServerLastTime:a,requestedPorts:n})??await U({debug:t,pickedPorts:i,portKey:c,portsUsedByOtherServers:e,portsUsedByThisServerLastTime:a});t&&console.debug(`Got port for "${c}": ${d}`),i[c]=d}return t&&console.debug(`Picked ports: ${JSON.stringify(i)}`),i}async function x(o){let{debug:t,portKey:r,portsUsedByOtherServers:n,portsUsedByThisServerLastTime:u,requestedPorts:e}=o,{[r]:a,...i}=e;if(g(a))return await R({debug:t,otherRequestedPorts:i,portKey:r,portsUsedByOtherServers:n,requestedPort:a}),a;let s=u?.[r]??P;if(!g(s))return t&&console.debug(`No port specified for "${r}". Trying to pick a new port.`),null;let c=s in n;return c||Object.values(i).includes(s)?(t&&console.debug(`Port ${s} that was used last time for this server, ${c?"is also used by another server":"has been requested for another service"}. Trying to pick a new port.`),null):await w(s)===!1?(t&&console.debug(`Port ${s}, that was used last time for this server, is not available. Trying to pick a new port.`),null):(t&&console.debug(`Using port ${s} for "${r}" as it was used last time and is available.`),s)}async function U(o){let{debug:t,pickedPorts:r,portKey:n,portsUsedByOtherServers:u,portsUsedByThisServerLastTime:e}=o,a=Math.max(v,h,S)+1,i=[...Object.values(r),...Object.keys(u).map(Number),...Object.values(e||{})],s=Math.min(Math.max(a,...i)+100,p),c=T($(a,s),i),d={port:h,databasePort:v,shadowDatabasePort:S}[n];try{return await m({port:d in u||Object.values(r).includes(d)||Object.values(e||{}).includes(d)?void 0:d,ports:c})}catch(b){if(b instanceof Error&&b.name==="GetPortError"&&s+1<=p)return t&&console.debug(`Expanding port lookup to range [${s+1}, ${p}].`),await m({portRange:[s+1,p]});throw b}}function g(o){return Number.isFinite(o)&&o>=0}function B(o,t){let r={},n;for(let u of t){let{databasePort:e,port:a,shadowDatabasePort:i}=u;if(u.name===o){n={databasePort:e,port:a,shadowDatabasePort:i};continue}r[e]=!0,r[a]=!0,r[i]=!0}return{portsUsedByOtherServers:r,portsUsedByThisServerLastTime:n}}async function R(o){let{debug:t,otherRequestedPorts:r,portKey:n,portsUsedByOtherServers:u,requestedPort:e}=o;if(e!==k){if(e in u)throw t&&console.error(`Port ${e} was requested for "${n}", but is already used by another server.`),new y(e);if(Object.values(r).includes(e))throw t&&console.error(`Port ${e} was requested for "${n}", but also for another key.`),new l(e);if(O(e))throw t&&console.error(`Port ${e} was requested for "${n}", but is unsafe.`),new f(e);if(await w(e)===!1)throw t&&console.error(`Port ${e} was requested for "${n}", but is not available.`),new f(e)}}var f=class extends Error{constructor(r){super(`Port \`${r}\` is not available.`);this.port=r}name="PortNotAvailableError"},l=class extends Error{constructor(r){super(`Port number \`${r}\` was requested twice. Please choose a different port for each service.`);this.port=r}name="PortRequestedTwiceError"},y=class extends Error{constructor(r){super(`Port number \`${r}\` belongs to another Prisma Dev server. Please choose a different port.`);this.port=r}name="PortBelongsToAnotherServerError"};export{v as a,h as b,S as c,k as d,P as e,E as f,f as g};

1
_node_modules/@prisma/dev/dist/chunk-RJ42AYBU.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{a as d}from"./chunk-XMKRRRGB.js";import{a as P}from"./chunk-LKYVOPH3.js";import{g as u}from"./chunk-OTI5SWIV.js";import{a as f,c as v,d as g}from"./chunk-7NDL3ECU.js";import{createServer as A}from"http";import{promisify as R}from"util";import T from"@prisma/get-platform";async function y(o,e){let{port:r}=e;if(e.dryRun)return w(r,null);let n=await D(o,e),{promise:m,reject:l,resolve:a}=v(),{serve:c}=await import("@hono/node-server"),i=c({createServer:A,fetch:n.fetch,overrideGlobalObjects:!1,port:r},a);i.on("error",s=>{if(typeof s=="object"&&"code"in s&&s.code==="EADDRINUSE")return l(new u(r));console.error("[Accelerate]",s)});let{port:t}=await m;return e.port=t,w(t,i)}function w(o,e){return{async close(){e&&await Promise.allSettled([R(e.close.bind(e))(),g.stopAll()])},port:o,url:`http://localhost:${o}`}}async function D(o,e){let{debug:r}=e,[{Hono:n},{accelerateRoute:m},{utilityRoute:l}]=await Promise.all([import("hono/tiny"),import("./accelerate-EEKAFGN3.js"),import("./utility-Q5A254LJ.js")]),a=new n,c=await T.getPlatformInfo();if(r&&console.debug("[Accelerate] platform info: %s",JSON.stringify(c)),r){let{logger:t}=await import("hono/logger");a.use("*",t((...s)=>console.log("[Accelerate]",...s)))}a.use("*",async(t,s)=>(t.set("databaseDumpPath",e.databaseDumpPath),t.set("db",o),t.set("debug",!!r),t.set("name",e.name),t.set("platform",c),t.set("shadowDBPort",e.shadowDatabasePort),await s()));let i=new n;return i.route("/",m),i.route("/",l),a.route("/",i),a}async function E(o){let e=await P.createExclusively(o),[r,n]=await Promise.all([d("database",e),d("shadow_database",e)]),m=await y(r,e),l=`prisma+postgres://localhost:${m.port}/?${new URLSearchParams({api_key:f({databaseUrl:r.prismaORMConnectionString,name:e.name,shadowDatabaseUrl:n.prismaORMConnectionString})}).toString()}`,a={database:{connectionString:r.connectionString,prismaORMConnectionString:r.prismaORMConnectionString,terminalCommand:r.terminalCommand},http:{url:m.url},ppg:{url:l},shadowDatabase:{connectionString:n.prismaORMConnectionString,prismaORMConnectionString:n.prismaORMConnectionString,terminalCommand:n.terminalCommand}};return await e.writeServerDump(a),{...a,close:()=>c(e,[m,r,n]),name:e.name};async function c(i,t){let S=(await Promise.allSettled(t.map(p=>p.close()))).filter(p=>p.status==="rejected").map(p=>new Error(p.reason));try{await i.close()}catch(p){S.push(p)}if(S.length>0)throw new AggregateError(S,"Failed to close some servers")}}async function J(o){return await E(o)}export{E as a,J as b};

1
_node_modules/@prisma/dev/dist/chunk-XMKRRRGB.js generated vendored Normal file

File diff suppressed because one or more lines are too long

5
_node_modules/@prisma/dev/dist/daemon.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

17
_node_modules/@prisma/dev/dist/daemon.d.cts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import { Server } from './index.cjs';
import './state.cjs';
import 'valibot';
import './db.cjs';
import '@electric-sql/pglite';
interface DaemonMessageStarted {
type: "started";
server: Omit<Server, "close">;
}
interface DaemonMessageError {
type: "error";
error: string;
}
type DaemonMessage = DaemonMessageStarted | DaemonMessageError;
export type { DaemonMessage, DaemonMessageError, DaemonMessageStarted };

17
_node_modules/@prisma/dev/dist/daemon.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import { Server } from './index.js';
import './state.js';
import 'valibot';
import './db.js';
import '@electric-sql/pglite';
interface DaemonMessageStarted {
type: "started";
server: Omit<Server, "close">;
}
interface DaemonMessageError {
type: "error";
error: string;
}
type DaemonMessage = DaemonMessageStarted | DaemonMessageError;
export type { DaemonMessage, DaemonMessageError, DaemonMessageStarted };

1
_node_modules/@prisma/dev/dist/daemon.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{a as o}from"./chunk-RJ42AYBU.js";import"./chunk-XMKRRRGB.js";import"./chunk-LKYVOPH3.js";import"./chunk-OTI5SWIV.js";import"./chunk-7NDL3ECU.js";import"./chunk-ITQ6ILGR.js";import{setTimeout as n}from"timers/promises";var r;process.once("SIGTERM",()=>{console.log("SIGTERM received, shutting down..."),process.removeAllListeners("SIGINT"),process.exitCode=143,r?.close().finally(()=>process.exit())});process.once("SIGINT",()=>{console.log("SIGINT received, shutting down..."),process.removeAllListeners("SIGTERM"),process.exitCode=130,r?.close().finally(()=>process.exit())});async function a(){let[,,s]=process.argv;if(!s)return process.send?.({type:"error",error:'Missing "name" argument, server cannot be started'},void 0),process.exit(1);try{r=await o({debug:!0,persistenceMode:"stateful",name:s}),process.send?.({type:"started",server:r},void 0)}catch(e){console.error(e);let t=e instanceof Error?e.message:String(e);process.send?.({type:"error",error:t},void 0),await n(1e3),process.exit(1)}}a();

1
_node_modules/@prisma/dev/dist/db.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

40
_node_modules/@prisma/dev/dist/db.d.cts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import { PGlite } from '@electric-sql/pglite';
import { ServerState } from './state.cjs';
import 'valibot';
interface DBServer {
close(): Promise<void>;
readonly connectionLimit: number;
readonly connectionString: string;
readonly connectTimeout: number;
readonly database: string;
dump(destinationPath: string): Promise<void>;
readonly maxIdleConnectionLifetime: number;
readonly password: string;
readonly poolTimeout: number;
readonly port: number;
readonly prismaORMConnectionString: string;
readonly socketTimeout: number;
readonly sslMode: string;
readonly terminalCommand: string;
readonly username: string;
}
interface DBDump {
dumpPath: string;
}
type DBServerPurpose = "database" | "shadow_database";
declare function startDBServer(purpose: DBServerPurpose, serverState: ServerState): Promise<DBServer>;
type DumpDBOptions<D extends string> = {
dataDir: string;
db?: never;
debug?: boolean;
destinationPath?: D;
} | {
dataDir?: never;
db: PGlite;
debug?: boolean;
destinationPath?: D;
};
declare function dumpDB<D extends string = never>(options: DumpDBOptions<D>): Promise<[D] extends [never] ? string : void>;
export { type DBDump, type DBServer, type DBServerPurpose, type DumpDBOptions, dumpDB, startDBServer };

40
_node_modules/@prisma/dev/dist/db.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import { PGlite } from '@electric-sql/pglite';
import { ServerState } from './state.js';
import 'valibot';
interface DBServer {
close(): Promise<void>;
readonly connectionLimit: number;
readonly connectionString: string;
readonly connectTimeout: number;
readonly database: string;
dump(destinationPath: string): Promise<void>;
readonly maxIdleConnectionLifetime: number;
readonly password: string;
readonly poolTimeout: number;
readonly port: number;
readonly prismaORMConnectionString: string;
readonly socketTimeout: number;
readonly sslMode: string;
readonly terminalCommand: string;
readonly username: string;
}
interface DBDump {
dumpPath: string;
}
type DBServerPurpose = "database" | "shadow_database";
declare function startDBServer(purpose: DBServerPurpose, serverState: ServerState): Promise<DBServer>;
type DumpDBOptions<D extends string> = {
dataDir: string;
db?: never;
debug?: boolean;
destinationPath?: D;
} | {
dataDir?: never;
db: PGlite;
debug?: boolean;
destinationPath?: D;
};
declare function dumpDB<D extends string = never>(options: DumpDBOptions<D>): Promise<[D] extends [never] ? string : void>;
export { type DBDump, type DBServer, type DBServerPurpose, type DumpDBOptions, dumpDB, startDBServer };

1
_node_modules/@prisma/dev/dist/db.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{a,b}from"./chunk-XMKRRRGB.js";import"./chunk-OTI5SWIV.js";import"./chunk-ITQ6ILGR.js";export{b as dumpDB,a as startDBServer};

5
_node_modules/@prisma/dev/dist/index.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

33
_node_modules/@prisma/dev/dist/index.d.cts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import { Exports, ServerOptions } from './state.cjs';
export { ServerAlreadyRunningError } from './state.cjs';
import { DBServerPurpose } from './db.cjs';
import 'valibot';
import '@electric-sql/pglite';
declare const DEFAULT_DATABASE_PORT = 51214;
declare const DEFAULT_SERVER_PORT = 51213;
declare const DEFAULT_SHADOW_DATABASE_PORT = 51215;
type PortAssignableService = DBServerPurpose | "server";
declare class PortNotAvailableError extends Error {
readonly port: number;
name: string;
constructor(port: number);
}
interface Server extends Exports {
close(): Promise<void>;
name: string;
}
type ReadonlyServer = Omit<Server, "close">;
/**
* Starts a `prisma dev` server instance programmatically.
*
* DO NOT USE IN PRODUCTION. This is only intended for development and testing purposes.
*/
declare function startPrismaDevServer(options?: ServerOptions): Promise<Server>;
/**
* @deprecated use {@link startPrismaDevServer} instead.
*/
declare function unstable_startServer(options?: ServerOptions): Promise<Server>;
export { DEFAULT_DATABASE_PORT, DEFAULT_SERVER_PORT, DEFAULT_SHADOW_DATABASE_PORT, type PortAssignableService, PortNotAvailableError, type ReadonlyServer, type Server, ServerOptions, startPrismaDevServer, unstable_startServer };

33
_node_modules/@prisma/dev/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import { Exports, ServerOptions } from './state.js';
export { ServerAlreadyRunningError } from './state.js';
import { DBServerPurpose } from './db.js';
import 'valibot';
import '@electric-sql/pglite';
declare const DEFAULT_DATABASE_PORT = 51214;
declare const DEFAULT_SERVER_PORT = 51213;
declare const DEFAULT_SHADOW_DATABASE_PORT = 51215;
type PortAssignableService = DBServerPurpose | "server";
declare class PortNotAvailableError extends Error {
readonly port: number;
name: string;
constructor(port: number);
}
interface Server extends Exports {
close(): Promise<void>;
name: string;
}
type ReadonlyServer = Omit<Server, "close">;
/**
* Starts a `prisma dev` server instance programmatically.
*
* DO NOT USE IN PRODUCTION. This is only intended for development and testing purposes.
*/
declare function startPrismaDevServer(options?: ServerOptions): Promise<Server>;
/**
* @deprecated use {@link startPrismaDevServer} instead.
*/
declare function unstable_startServer(options?: ServerOptions): Promise<Server>;
export { DEFAULT_DATABASE_PORT, DEFAULT_SERVER_PORT, DEFAULT_SHADOW_DATABASE_PORT, type PortAssignableService, PortNotAvailableError, type ReadonlyServer, type Server, ServerOptions, startPrismaDevServer, unstable_startServer };

1
_node_modules/@prisma/dev/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{a as f,b as g}from"./chunk-RJ42AYBU.js";import"./chunk-XMKRRRGB.js";import{g as e}from"./chunk-LKYVOPH3.js";import{a,b,c,g as d}from"./chunk-OTI5SWIV.js";import"./chunk-7NDL3ECU.js";import"./chunk-ITQ6ILGR.js";export{a as DEFAULT_DATABASE_PORT,b as DEFAULT_SERVER_PORT,c as DEFAULT_SHADOW_DATABASE_PORT,d as PortNotAvailableError,e as ServerAlreadyRunningError,f as startPrismaDevServer,g as unstable_startServer};

3
_node_modules/@prisma/dev/dist/state.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

216
_node_modules/@prisma/dev/dist/state.d.cts generated vendored Normal file
View File

@@ -0,0 +1,216 @@
import * as valibot from 'valibot';
import { InferOutput } from 'valibot';
declare const exportsSchema: valibot.ObjectSchema<{
readonly database: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
readonly http: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly ppg: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly shadowDatabase: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
}, undefined>;
type Exports = InferOutput<typeof exportsSchema>;
declare const serverDumpV1Schema: valibot.ObjectSchema<{
readonly databasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly exports: valibot.OptionalSchema<valibot.ObjectSchema<{
readonly database: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
readonly http: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly ppg: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly shadowDatabase: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
}, undefined>, undefined>;
readonly name: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.MinLengthAction<string, 1, undefined>]>;
readonly pid: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 0, undefined>]>, undefined>;
readonly port: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly shadowDatabasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly version: valibot.LiteralSchema<"1", undefined>;
}, undefined>;
type ServerDumpV1 = InferOutput<typeof serverDumpV1Schema>;
interface ServerOptions {
/**
* Connection timeout in milliseconds for pending database connections.
*
* Starts ticking for every new client that attempts to connect. When exceeded,
* the pending client connection is evicted and closed.
*
* Default is 1 minute (60,000 milliseconds).
*
* Use it with caution, as it may lead to unexpected behavior. Best used with
* a pool client that retries connections.
*/
databaseConnectTimeoutMillis?: number;
/**
* Idle timeout in milliseconds for active database connections.
*
* Re-starts ticking after each message received on the active connection. When
* exceeded - meaning there hasn't been any activity for a while, the active
* client connection is closed, and a pending connection is promoted to active.
*
* Is not applied by default.
*
* Use it with caution, as it may lead to unexpected disconnections. Best used
* with a pool client that can handle disconnections gracefully.
*
* Set it if you suffer from client hanging indefinitely as the active connection
* remain open forever.
*/
databaseIdleTimeoutMillis?: number;
/**
* The port the database server will listen on.
*
* Defaults to `51214`.
*
* An error is thrown if the port is already in use.
*/
databasePort?: number;
/**
* Whether to enable debug logging.
*
* Defaults to `false`.
*/
debug?: boolean;
/**
* Whether to run the server in dry run mode.
*
* Defaults to `false`.
*/
dryRun?: boolean;
/**
* The name of the server.
*
* Defaults to `default`.
*/
name?: string;
/**
* The persistence mode of the server.
*
* Default is `stateless`.
*/
persistenceMode?: PersistenceMode;
/**
* The port the server will listen on.
*
* Defaults to `51213`.
*
* An error is thrown if the port is already in use.
*/
port?: number;
/**
* Connection timeout in milliseconds for pending shadow database connections.
*
* Default is {@link databaseConnectTimeoutMillis}.
*/
shadowDatabaseConnectTimeoutMillis?: number;
/**
* Idle timeout in milliseconds for active shadow database connections.
*
* Default is {@link databaseIdleTimeoutMillis}.
*/
shadowDatabaseIdleTimeoutMillis?: number;
/**
* The port the shadow database server will listen on.
*
* Defaults to `51215`.
*
* An error is thrown if the port is already in use.
*/
shadowDatabasePort?: number;
}
type ResolvedServerOptions = Required<ServerOptions>;
type PersistenceMode = "stateless" | "stateful";
interface ScanOptions {
debug?: boolean;
globs?: string[];
onlyMetadata?: boolean;
}
declare const PRIVATE_INITIALIZE_SYMBOL: unique symbol;
declare abstract class ServerState implements ResolvedServerOptions {
#private;
protected _databasePort: number;
readonly databaseConnectTimeoutMillis: number;
readonly databaseIdleTimeoutMillis: number;
readonly debug: boolean;
readonly dryRun: boolean;
readonly name: string;
readonly persistenceMode: PersistenceMode;
readonly pid: number | undefined;
readonly shadowDatabaseConnectTimeoutMillis: number;
readonly shadowDatabaseIdleTimeoutMillis: number;
protected _port: number;
protected _shadowDatabasePort: number;
protected constructor(options: Omit<ServerOptions, "persistenceMode"> & {
persistenceMode: PersistenceMode;
pid?: number | undefined;
});
static createExclusively(options: ServerOptions | undefined): Promise<ServerState>;
static fromServerDump(options?: Pick<ServerOptions, "debug" | "name">): Promise<StatefulServerState | null>;
static scan(options?: ScanOptions): Promise<ServerStatusV1[]>;
abstract get databaseDumpPath(): string;
abstract get pgliteDataDirPath(): string;
abstract [PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
abstract close(): Promise<void>;
abstract writeServerDump(exports?: Exports): Promise<void>;
get databasePort(): number;
set databasePort(value: number);
get port(): number;
set port(value: number);
get shadowDatabasePort(): number;
set shadowDatabasePort(value: number);
}
declare class StatefulServerState extends ServerState {
#private;
constructor(options: (Omit<ServerOptions, "persistenceMode"> & {
pid?: number | undefined;
serverDump?: ServerDumpV1;
}) | undefined);
static getServerDumpPath(dataDirPath: string): string;
get databaseDumpPath(): string;
get exports(): Exports | undefined;
get pgliteDataDirPath(): string;
[PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
close(): Promise<void>;
writeServerDump(exports?: Exports): Promise<void>;
}
interface ServerStatusV1 extends ServerDumpV1 {
status: "running" | "starting_up" | "not_running" | "no_such_server" | "unknown" | "error";
}
declare function deleteServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<void>;
declare function getServerStatus(nameOrState: string | StatefulServerState, options?: ScanOptions): Promise<ServerStatusV1>;
declare function isServerRunning(server: ServerStatusV1): boolean;
declare function killServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<boolean>;
/**
* @deprecated use `ServerAlreadyRunningError` instead. Will be removed in a future version.
*/
declare class ServerStateAlreadyExistsError extends Error {
name: string;
constructor(name: string);
}
declare class ServerAlreadyRunningError extends ServerStateAlreadyExistsError {
#private;
name: string;
constructor(server: ServerState);
get server(): Promise<ServerState | null>;
}
export { type Exports, type PersistenceMode, type ResolvedServerOptions, type ScanOptions, ServerAlreadyRunningError, type ServerDumpV1, type ServerOptions, ServerState, ServerStateAlreadyExistsError, type ServerStatusV1, deleteServer, getServerStatus, isServerRunning, killServer };

216
_node_modules/@prisma/dev/dist/state.d.ts generated vendored Normal file
View File

@@ -0,0 +1,216 @@
import * as valibot from 'valibot';
import { InferOutput } from 'valibot';
declare const exportsSchema: valibot.ObjectSchema<{
readonly database: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
readonly http: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly ppg: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly shadowDatabase: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
}, undefined>;
type Exports = InferOutput<typeof exportsSchema>;
declare const serverDumpV1Schema: valibot.ObjectSchema<{
readonly databasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly exports: valibot.OptionalSchema<valibot.ObjectSchema<{
readonly database: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
readonly http: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly ppg: valibot.ObjectSchema<{
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
}, undefined>;
readonly shadowDatabase: valibot.ObjectSchema<{
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
}, undefined>;
}, undefined>, undefined>;
readonly name: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.MinLengthAction<string, 1, undefined>]>;
readonly pid: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 0, undefined>]>, undefined>;
readonly port: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly shadowDatabasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
readonly version: valibot.LiteralSchema<"1", undefined>;
}, undefined>;
type ServerDumpV1 = InferOutput<typeof serverDumpV1Schema>;
interface ServerOptions {
/**
* Connection timeout in milliseconds for pending database connections.
*
* Starts ticking for every new client that attempts to connect. When exceeded,
* the pending client connection is evicted and closed.
*
* Default is 1 minute (60,000 milliseconds).
*
* Use it with caution, as it may lead to unexpected behavior. Best used with
* a pool client that retries connections.
*/
databaseConnectTimeoutMillis?: number;
/**
* Idle timeout in milliseconds for active database connections.
*
* Re-starts ticking after each message received on the active connection. When
* exceeded - meaning there hasn't been any activity for a while, the active
* client connection is closed, and a pending connection is promoted to active.
*
* Is not applied by default.
*
* Use it with caution, as it may lead to unexpected disconnections. Best used
* with a pool client that can handle disconnections gracefully.
*
* Set it if you suffer from client hanging indefinitely as the active connection
* remain open forever.
*/
databaseIdleTimeoutMillis?: number;
/**
* The port the database server will listen on.
*
* Defaults to `51214`.
*
* An error is thrown if the port is already in use.
*/
databasePort?: number;
/**
* Whether to enable debug logging.
*
* Defaults to `false`.
*/
debug?: boolean;
/**
* Whether to run the server in dry run mode.
*
* Defaults to `false`.
*/
dryRun?: boolean;
/**
* The name of the server.
*
* Defaults to `default`.
*/
name?: string;
/**
* The persistence mode of the server.
*
* Default is `stateless`.
*/
persistenceMode?: PersistenceMode;
/**
* The port the server will listen on.
*
* Defaults to `51213`.
*
* An error is thrown if the port is already in use.
*/
port?: number;
/**
* Connection timeout in milliseconds for pending shadow database connections.
*
* Default is {@link databaseConnectTimeoutMillis}.
*/
shadowDatabaseConnectTimeoutMillis?: number;
/**
* Idle timeout in milliseconds for active shadow database connections.
*
* Default is {@link databaseIdleTimeoutMillis}.
*/
shadowDatabaseIdleTimeoutMillis?: number;
/**
* The port the shadow database server will listen on.
*
* Defaults to `51215`.
*
* An error is thrown if the port is already in use.
*/
shadowDatabasePort?: number;
}
type ResolvedServerOptions = Required<ServerOptions>;
type PersistenceMode = "stateless" | "stateful";
interface ScanOptions {
debug?: boolean;
globs?: string[];
onlyMetadata?: boolean;
}
declare const PRIVATE_INITIALIZE_SYMBOL: unique symbol;
declare abstract class ServerState implements ResolvedServerOptions {
#private;
protected _databasePort: number;
readonly databaseConnectTimeoutMillis: number;
readonly databaseIdleTimeoutMillis: number;
readonly debug: boolean;
readonly dryRun: boolean;
readonly name: string;
readonly persistenceMode: PersistenceMode;
readonly pid: number | undefined;
readonly shadowDatabaseConnectTimeoutMillis: number;
readonly shadowDatabaseIdleTimeoutMillis: number;
protected _port: number;
protected _shadowDatabasePort: number;
protected constructor(options: Omit<ServerOptions, "persistenceMode"> & {
persistenceMode: PersistenceMode;
pid?: number | undefined;
});
static createExclusively(options: ServerOptions | undefined): Promise<ServerState>;
static fromServerDump(options?: Pick<ServerOptions, "debug" | "name">): Promise<StatefulServerState | null>;
static scan(options?: ScanOptions): Promise<ServerStatusV1[]>;
abstract get databaseDumpPath(): string;
abstract get pgliteDataDirPath(): string;
abstract [PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
abstract close(): Promise<void>;
abstract writeServerDump(exports?: Exports): Promise<void>;
get databasePort(): number;
set databasePort(value: number);
get port(): number;
set port(value: number);
get shadowDatabasePort(): number;
set shadowDatabasePort(value: number);
}
declare class StatefulServerState extends ServerState {
#private;
constructor(options: (Omit<ServerOptions, "persistenceMode"> & {
pid?: number | undefined;
serverDump?: ServerDumpV1;
}) | undefined);
static getServerDumpPath(dataDirPath: string): string;
get databaseDumpPath(): string;
get exports(): Exports | undefined;
get pgliteDataDirPath(): string;
[PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
close(): Promise<void>;
writeServerDump(exports?: Exports): Promise<void>;
}
interface ServerStatusV1 extends ServerDumpV1 {
status: "running" | "starting_up" | "not_running" | "no_such_server" | "unknown" | "error";
}
declare function deleteServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<void>;
declare function getServerStatus(nameOrState: string | StatefulServerState, options?: ScanOptions): Promise<ServerStatusV1>;
declare function isServerRunning(server: ServerStatusV1): boolean;
declare function killServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<boolean>;
/**
* @deprecated use `ServerAlreadyRunningError` instead. Will be removed in a future version.
*/
declare class ServerStateAlreadyExistsError extends Error {
name: string;
constructor(name: string);
}
declare class ServerAlreadyRunningError extends ServerStateAlreadyExistsError {
#private;
name: string;
constructor(server: ServerState);
get server(): Promise<ServerState | null>;
}
export { type Exports, type PersistenceMode, type ResolvedServerOptions, type ScanOptions, ServerAlreadyRunningError, type ServerDumpV1, type ServerOptions, ServerState, ServerStateAlreadyExistsError, type ServerStatusV1, deleteServer, getServerStatus, isServerRunning, killServer };

1
_node_modules/@prisma/dev/dist/state.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{a,b,c,d,e,f,g}from"./chunk-LKYVOPH3.js";import"./chunk-OTI5SWIV.js";import"./chunk-ITQ6ILGR.js";export{g as ServerAlreadyRunningError,a as ServerState,f as ServerStateAlreadyExistsError,b as deleteServer,c as getServerStatus,d as isServerRunning,e as killServer};

1
_node_modules/@prisma/dev/dist/utility-Q5A254LJ.js generated vendored Normal file
View File

@@ -0,0 +1 @@
import{Hono as n}from"hono/tiny";import{StatusCodes as p}from"http-status-codes";var o=new n;o.post("/database/dump",async t=>{let a=t.get("db"),e=t.get("databaseDumpPath");return await a.dump(e),t.json({dumpPath:e},p.CREATED)});var u=o.get("/health",t=>t.json({name:t.get("name")}));export{o as utilityRoute};

104
_node_modules/@prisma/dev/package.json generated Normal file
View File

@@ -0,0 +1,104 @@
{
"name": "@prisma/dev",
"version": "0.20.0",
"description": "A local Prisma Postgres server for development and testing",
"type": "module",
"author": "Igal Klebanov <igalklebanov@gmail.com> (https://github.com/igalklebanov)",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./internal/daemon": {
"import": {
"types": "./dist/daemon.d.ts",
"default": "./dist/daemon.js"
},
"require": {
"types": "./dist/daemon.d.cts",
"default": "./dist/daemon.cjs"
}
},
"./internal/db": {
"import": {
"types": "./dist/db.d.ts",
"default": "./dist/db.js"
},
"require": {
"types": "./dist/db.d.cts",
"default": "./dist/db.cjs"
}
},
"./internal/state": {
"import": {
"types": "./dist/state.d.ts",
"default": "./dist/state.js"
},
"require": {
"types": "./dist/state.d.cts",
"default": "./dist/state.cjs"
}
}
},
"keywords": [
"prisma",
"postgres",
"accelerate",
"local",
"development",
"dev",
"testing"
],
"license": "ISC",
"devDependencies": {
"@arethetypeswrong/cli": "0.18.2",
"@types/node": "25.0.9",
"@types/pako": "2.0.4",
"@types/proper-lockfile": "4.1.4",
"env-paths": "3.0.0",
"pkg-types": "2.3.0",
"tsup": "8.5.1",
"typescript": "5.9.3",
"vitest": "4.0.17",
"common-stuff": "^0.0.0"
},
"dependencies": {
"@electric-sql/pglite": "0.3.15",
"@electric-sql/pglite-socket": "0.0.20",
"@electric-sql/pglite-tools": "0.2.20",
"@hono/node-server": "1.19.9",
"@mrleebo/prisma-ast": "0.13.1",
"@prisma/get-platform": "7.2.0",
"@prisma/query-plan-executor": "7.2.0",
"foreground-child": "3.3.1",
"get-port-please": "3.2.0",
"hono": "4.11.4",
"http-status-codes": "2.3.0",
"pathe": "2.0.3",
"proper-lockfile": "4.1.2",
"remeda": "2.33.4",
"std-env": "3.10.0",
"valibot": "1.2.0",
"zeptomatch": "2.1.0"
},
"scripts": {
"build": "tsup",
"check:exports": "attw . --pack --profile node16",
"dev": "tsup --watch",
"lint": "eslint --fix .",
"test": "",
"typecheck": "tsc --noEmit"
}
}