gemi 0.217.0 → 0.219.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai/index.js.map +2 -2
- package/dist/ai/testing/index.js +2 -2
- package/dist/ai/testing/index.js.map +1 -1
- package/dist/{chunk-ww62b10k.js → chunk-0egjv6cj.js} +2 -2
- package/dist/{chunk-ww62b10k.js.map → chunk-0egjv6cj.js.map} +1 -1
- package/dist/{chunk-q30f4r5x.js → chunk-2vktfp1f.js} +2 -2
- package/dist/{chunk-q30f4r5x.js.map → chunk-2vktfp1f.js.map} +1 -1
- package/dist/chunk-4g24ffv8.js +5 -0
- package/dist/{chunk-d6bgh2nr.js.map → chunk-4g24ffv8.js.map} +1 -1
- package/dist/chunk-4kkb85z8.js +8 -0
- package/dist/{chunk-xese0rng.js.map → chunk-4kkb85z8.js.map} +4 -5
- package/dist/{chunk-b1pps9bj.js → chunk-59p034g3.js} +2 -2
- package/dist/{chunk-b1pps9bj.js.map → chunk-59p034g3.js.map} +1 -1
- package/dist/{chunk-p18nfs9t.js → chunk-66re5qsr.js} +2 -2
- package/dist/{chunk-p18nfs9t.js.map → chunk-66re5qsr.js.map} +1 -1
- package/dist/{chunk-sqqh78tf.js → chunk-6my6c6b1.js} +2 -2
- package/dist/{chunk-sqqh78tf.js.map → chunk-6my6c6b1.js.map} +1 -1
- package/dist/chunk-71r1x773.js +19 -0
- package/dist/{chunk-b1btq22a.js.map → chunk-71r1x773.js.map} +3 -3
- package/dist/chunk-ak85ee4e.js +39 -0
- package/dist/chunk-ak85ee4e.js.map +20 -0
- package/dist/{chunk-gxd1388t.js → chunk-c250kpcm.js} +2 -2
- package/dist/{chunk-gxd1388t.js.map → chunk-c250kpcm.js.map} +1 -1
- package/dist/{chunk-4s72m6zx.js → chunk-cmyt2txd.js} +3 -3
- package/dist/{chunk-4s72m6zx.js.map → chunk-cmyt2txd.js.map} +1 -1
- package/dist/{chunk-fq7wkefg.js → chunk-cw50n89n.js} +2 -2
- package/dist/{chunk-fq7wkefg.js.map → chunk-cw50n89n.js.map} +1 -1
- package/dist/{chunk-c71g46aw.js → chunk-g5drp5xx.js} +2 -2
- package/dist/{chunk-c71g46aw.js.map → chunk-g5drp5xx.js.map} +1 -1
- package/dist/{chunk-snt0523y.js → chunk-gf3m0866.js} +2 -2
- package/dist/{chunk-snt0523y.js.map → chunk-gf3m0866.js.map} +1 -1
- package/dist/{chunk-94fdjkzf.js → chunk-jfpwjqvq.js} +2 -2
- package/dist/{chunk-94fdjkzf.js.map → chunk-jfpwjqvq.js.map} +1 -1
- package/dist/{chunk-gxfyd8wr.js → chunk-kt174y9e.js} +3 -3
- package/dist/{chunk-gxfyd8wr.js.map → chunk-kt174y9e.js.map} +1 -1
- package/dist/{chunk-s7jwsbfd.js → chunk-nrv7hdeh.js} +3 -3
- package/dist/{chunk-s7jwsbfd.js.map → chunk-nrv7hdeh.js.map} +1 -1
- package/dist/{chunk-7t13vyzg.js → chunk-p4b5hmr8.js} +2 -2
- package/dist/{chunk-7t13vyzg.js.map → chunk-p4b5hmr8.js.map} +1 -1
- package/dist/chunk-pnt0c59g.js +484 -0
- package/dist/chunk-pnt0c59g.js.map +24 -0
- package/dist/{chunk-m0pfdc1n.js → chunk-s4sx97fn.js} +3 -3
- package/dist/{chunk-m0pfdc1n.js.map → chunk-s4sx97fn.js.map} +1 -1
- package/dist/{chunk-ncw3zjxm.js → chunk-w4aw44zg.js} +2 -2
- package/dist/{chunk-ncw3zjxm.js.map → chunk-w4aw44zg.js.map} +1 -1
- package/dist/{chunk-7081awrd.js → chunk-w9a3b4vs.js} +2 -2
- package/dist/{chunk-7081awrd.js.map → chunk-w9a3b4vs.js.map} +1 -1
- package/dist/{chunk-bcfwa370.js → chunk-xm6hfksv.js} +2 -2
- package/dist/{chunk-bcfwa370.js.map → chunk-xm6hfksv.js.map} +1 -1
- package/dist/{chunk-k8nsefzb.js → chunk-xrkr2yzz.js} +2 -2
- package/dist/{chunk-k8nsefzb.js.map → chunk-xrkr2yzz.js.map} +1 -1
- package/dist/{chunk-tsjg2k2h.js → chunk-xvf1hcxg.js} +2 -2
- package/dist/{chunk-tsjg2k2h.js.map → chunk-xvf1hcxg.js.map} +2 -2
- package/dist/{chunk-eh3ktv8k.js → chunk-y12m6w7b.js} +2 -2
- package/dist/{chunk-eh3ktv8k.js.map → chunk-y12m6w7b.js.map} +1 -1
- package/dist/chunk-yv3y3r9q.js +88 -0
- package/dist/{chunk-sxxkkx75.js.map → chunk-yv3y3r9q.js.map} +3 -10
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +54 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/useWorkflow.d.ts +51 -0
- package/dist/client/useWorkflow.d.ts.map +1 -0
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/database/index.js +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/services/index.d.ts +4 -3
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -3
- package/dist/services/index.js.map +2 -2
- package/dist/services/queue/DatabaseQueueDriver.d.ts +8 -1
- package/dist/services/queue/DatabaseQueueDriver.d.ts.map +1 -1
- package/dist/services/queue/QueueManager.d.ts +2 -0
- package/dist/services/queue/QueueManager.d.ts.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/queue/workflow/DatabaseWorkflowStore.d.ts +20 -1
- package/dist/services/queue/workflow/DatabaseWorkflowStore.d.ts.map +1 -1
- package/dist/services/queue/workflow/MemoryWorkflowStore.d.ts +12 -1
- package/dist/services/queue/workflow/MemoryWorkflowStore.d.ts.map +1 -1
- package/dist/services/queue/workflow/Step.d.ts +124 -2
- package/dist/services/queue/workflow/Step.d.ts.map +1 -1
- package/dist/services/queue/workflow/Workflow.d.ts +37 -33
- package/dist/services/queue/workflow/Workflow.d.ts.map +1 -1
- package/dist/services/queue/workflow/WorkflowRuntime.d.ts +51 -0
- package/dist/services/queue/workflow/WorkflowRuntime.d.ts.map +1 -1
- package/dist/services/queue/workflow/WorkflowStore.d.ts +66 -16
- package/dist/services/queue/workflow/WorkflowStore.d.ts.map +1 -1
- package/dist/services/queue/workflow/wire.d.ts +71 -0
- package/dist/services/queue/workflow/wire.d.ts.map +1 -0
- package/dist/services/queue/workflow/workflowContract.d.ts +2 -0
- package/dist/services/queue/workflow/workflowContract.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-b1btq22a.js +0 -19
- package/dist/chunk-d6bgh2nr.js +0 -5
- package/dist/chunk-sxxkkx75.js +0 -117
- package/dist/chunk-wkmd81k4.js +0 -416
- package/dist/chunk-wkmd81k4.js.map +0 -23
- package/dist/chunk-xb0evp2m.js +0 -5
- package/dist/chunk-xb0evp2m.js.map +0 -12
- package/dist/chunk-xese0rng.js +0 -13
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type EachProgress, type WorkflowStepStatus, type WorkflowUpdate } from "../services/queue/workflow/wire";
|
|
2
|
+
import type { GetRPC } from "./useQuery";
|
|
3
|
+
import { type SubscriptionOptions, type SubscriptionStatus } from "./useSubscription";
|
|
4
|
+
export type { EachProgress, WorkflowStepStatus, WorkflowUpdate };
|
|
5
|
+
export type UseWorkflowConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* The workflow as the view read it (`Workflow.find`, or the route's
|
|
8
|
+
* data), shown until the first update arrives. Its `args` and `result`
|
|
9
|
+
* are not needed; pass `null` when the view has none yet.
|
|
10
|
+
*/
|
|
11
|
+
initial?: WorkflowUpdate | null;
|
|
12
|
+
/**
|
|
13
|
+
* Where to start, from `Workflow.cursor(id)` read with `initial`, so an
|
|
14
|
+
* update between the render and the connection is not missed.
|
|
15
|
+
*/
|
|
16
|
+
cursor?: string | null;
|
|
17
|
+
/** `false` disconnects. Default `true`. It also disconnects once the workflow has ended. */
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
/** Disconnect while the tab is hidden, and catch up once shown. Default `true`. */
|
|
20
|
+
pauseWhenHidden?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The stream could not catch up update by update (it was away longer than
|
|
23
|
+
* the feed keeps changes). The next update brings the whole status again;
|
|
24
|
+
* re-read the view's data here when the workflow may have ended meanwhile.
|
|
25
|
+
*/
|
|
26
|
+
onReset?: () => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Follows a workflow through a route that answers with `Workflow.stream`,
|
|
30
|
+
* and returns its latest status: `progress`, `status`, `currentStep`, and
|
|
31
|
+
* each step's own `progress` and `items` (a `step.each`).
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const { workflow } = useWorkflow(
|
|
35
|
+
* "/imports/:importId/progress",
|
|
36
|
+
* { params: { importId } },
|
|
37
|
+
* { initial: data.workflow, cursor: data.workflowCursor },
|
|
38
|
+
* );
|
|
39
|
+
* const rows = workflow?.steps.find((step) => step.key === "rows")?.items;
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Of two updates it keeps the later one (by `updatedAt`), so updates that
|
|
43
|
+
* two instances published out of order cannot move it backwards. Once the
|
|
44
|
+
* workflow has ended, it disconnects.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useWorkflow<T extends keyof GetRPC>(url: T, options?: SubscriptionOptions<T>, config?: UseWorkflowConfig): {
|
|
47
|
+
workflow: WorkflowUpdate | null;
|
|
48
|
+
status: SubscriptionStatus;
|
|
49
|
+
error: Error | null;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=useWorkflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkflow.d.ts","sourceRoot":"","sources":["../../client/useWorkflow.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAExB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,MAAM,EAChD,GAAG,EAAE,CAAC,EACN,OAAO,GAAE,mBAAmB,CAAC,CAAC,CAAM,EACpC,MAAM,GAAE,iBAAsB,GAC7B;IACD,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAsBA"}
|
package/dist/console/run.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qa as c}from"../chunk-
|
|
2
|
+
import{qa as c}from"../chunk-c250kpcm.js";import{qb as f,rb as o}from"../chunk-g6tqje74.js";import{be as A,ee as n,fe as u,pe as r}from"../chunk-71r1x773.js";import"../chunk-7xe5vd4w.js";import"../chunk-pnt0c59g.js";import{Qj as g,Uj as v}from"../chunk-kt174y9e.js";import{dk as h}from"../chunk-s4sx97fn.js";import"../chunk-w4aw44zg.js";import"../chunk-ak85ee4e.js";import{al as t}from"../chunk-yxtfg4wy.js";import"../chunk-xyv3y476.js";import"../chunk-qa528feb.js";import{jm as k}from"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-q0d45r2j.js";import{Em as a}from"../chunk-hmtn7996.js";import"../chunk-yedb5vvg.js";function E(){let z=Promise.resolve(),J=Promise.resolve(),Y=(Q,G)=>new Promise(($)=>{Q.write(G,()=>$())});return{stdout:(Q)=>{z=Y(process.stdout,Q)},stderr:(Q)=>{J=Y(process.stderr,Q)},flush:async()=>{await Promise.all([z,J])}}}function x(z){let J=z.writers??E();return{args:z.args,options:z.options,argv:z.argv,line:(Y="")=>J.stdout(`${Y}
|
|
3
3
|
`),error:(Y)=>J.stderr(`${Y}
|
|
4
4
|
`),fail:(Y,Q=1)=>{throw new A(Y,Q)}}}import b from"path";var Gz=u("encryption:rotate").describe("Re-encrypt encrypted columns that are still under an older key").arg("model",{description:"The model to rotate. Omit to rotate every model with encrypted columns"}).option("batchSize",{type:"number",default:500,description:"Rows read and rewritten per batch"}).option("dryRun",{type:"boolean",description:"Count what would be re-encrypted, and write nothing"}).option("encryptPlaintext",{type:"boolean",description:"Also encrypt values that are not encrypted yet (a column just marked @gemi.encrypted)"}).handle(async({args:z,options:J,line:Y,fail:Q})=>{let G=z.model?[z.model]:[...new Set(h().map((B)=>B.split(".")[0]))],$=z.model?null:Jz();if(G.length===0&&!$){Y("No model has encrypted columns.");return}if($){let B=await $.rotateEncryption({dryRun:J.dryRun});Y(`OAuth connections: ${B.scanned} rows, ${B.rotated} ${J.dryRun?"to re-encrypt":"re-encrypted"}`)}let _=0;for(let B of G){let V=await c(B,{batchSize:J.batchSize,dryRun:J.dryRun,encryptPlaintext:J.encryptPlaintext});_+=V.plaintext,Y(`${V.model} (${V.fields.join(", ")}): ${V.scanned} rows, ${V.rotated} ${J.dryRun?"to re-encrypt":"re-encrypted"}`+(V.skipped>0?`, ${V.skipped} changed meanwhile (already current)`:"")+(V.plaintext>0?`, ${V.plaintext} not encrypted yet`:""))}if(_>0)Q(`${_} value${_===1?" is":"s are"} not encrypted. If the column was just marked @gemi.encrypted, run again with --encrypt-plaintext.`)});function Jz(){let z=k();if(!z.bound(v))return null;let J=z.make(v);if(Object.keys(J.providers).length===0)return null;let Y=J.store;return Y instanceof g?Y:null}var m=[Gz];function R(z){return z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function Qz(z){let J=new Map,Y=new Map;for(let Q of z){J.set(R(Q.name),Q),J.set(Q.name,Q);let G="alias"in Q?Q.alias:void 0;if(G)Y.set(G,Q)}return{byName:J,byAlias:Y}}function l(z){if(z==="--")return!0;if(!z.startsWith("-"))return!1;if(z==="-")return!1;if(/^-(\d|\.\d)/.test(z))return!1;return!0}function p(z,J){let{byName:Y,byAlias:Q}=Qz(z.options),G=[],$=[],_=new Map,B=!Y.has("help"),V=!Q.has("h"),F=!1,N=!1,W=(X)=>G.push(`Unknown option ${X} for command "${z.commandName}".`),T=(X,Z)=>{if(Z==="--help"||Z==="-h")N=!0;G.push(Z===void 0?`Option ${X} needs a value.`:`Option ${X} needs a value, but the next token is ${JSON.stringify(Z)}, which is another option. If that really is the value, write ${X}=${Z}.`)},j=0;while(j<J.length){let X=J[j];if(X==="--"){$.push(...J.slice(j+1));break}if(X.startsWith("--")){let Z=X.slice(2),K=Z.indexOf("="),M=K===-1?Z:Z.slice(0,K),O=K===-1?void 0:Z.slice(K+1),P=Y.get(M),D=!1;if(!P&&M.startsWith("no-")){let S=Y.get(M.slice(3));if(S&&S.type==="boolean")P=S,D=!0}if(!P&&M==="help"&&B){F=!0,j+=1;continue}if(!P){W(`--${M}`),j+=1;continue}if(P.type==="boolean"){if(O!==void 0&&O!=="true"&&O!=="false")G.push(`Option --${R(P.name)} is a flag and takes no value, but got ${JSON.stringify(O)}.`);else{let S=O===void 0?!0:O==="true";_.set(P.name,D?!S:S)}j+=1;continue}if(O!==void 0){_.set(P.name,O),j+=1;continue}let L=J[j+1];if(L===void 0||l(L)){T(`--${R(P.name)}`,L),j+=1;continue}_.set(P.name,L),j+=2;continue}if(X.startsWith("-")&&X.length>1){let Z=X.slice(1),K=!1;for(let M=0;M<Z.length;M+=1){let O=Q.get(Z[M]);if(!O){if(Z[M]==="h"&&V){F=!0;continue}W(`-${Z[M]}`);break}if(O.type==="boolean"){_.set(O.name,!0);continue}let P=Z.slice(M+1),D=P.startsWith("=")?P.slice(1):P;if(D!==""){_.set(O.name,D);break}let L=J[j+1];if(L===void 0||l(L)){T(`-${O.alias}`,L);break}_.set(O.name,L),K=!0;break}j+=K?2:1;continue}$.push(X),j+=1}let H={},I=0;for(let X of z.args){if(X.variadic){let K=$.slice(I);if(I=$.length,H[X.name]=K,X.required&&K.length===0)G.push(`Missing required argument <${X.name}...>. Command "${z.commandName}" needs at least one.`);continue}let Z=$[I];if(I+=1,Z!==void 0){H[X.name]=Z;continue}if(X.default!==void 0){H[X.name]=X.default;continue}if(X.required)G.push(`Missing required argument <${X.name}>.`);H[X.name]=void 0}if(I<$.length){let X=$.slice(I);G.push(`Unexpected argument${X.length===1?"":"s"} ${X.map((Z)=>JSON.stringify(Z)).join(", ")}. Command "${z.commandName}" takes ${z.args.length} argument${z.args.length===1?"":"s"}.`)}let U={};for(let X of z.options){let Z=_.get(X.name);if(X.type==="boolean"){U[X.name]=Z===void 0?X.default??!1:Boolean(Z);continue}if(Z===void 0){if(X.default!==void 0)U[X.name]=X.default;else if(X.required)G.push(`Missing required option --${R(X.name)}.`),U[X.name]=void 0;else U[X.name]=void 0;continue}let K=String(Z);if(X.type==="number"){let M=Number(K);if(K.trim()===""||!Number.isFinite(M))G.push(`Option --${R(X.name)} expects a number, but got ${JSON.stringify(K)}.`),U[X.name]=void 0;else U[X.name]=M;continue}U[X.name]=K}let q=F&&!N;if(G.length>0)return{ok:!1,help:q,errors:G};return{ok:!0,help:q,args:H,options:U}}function C(z,J=" "){let Y=z.reduce((Q,[G])=>Math.max(Q,G.length),0);return z.map(([Q,G])=>G===""?`${J}${Q}`:`${J}${Q.padEnd(Y)} ${G}`)}function d(z){let J=z.variadic?`${z.name}...`:z.name;return z.required?`<${J}>`:`[${J}]`}function Xz(z){let J=(G)=>z.options.some(G),Y=J((G)=>G.name==="help"||R(G.name)==="help"),Q=J((G)=>("alias"in G)&&G.alias==="h");if(Y&&Q)return[];if(Y)return[["-h","Show this message"]];return[[`${Q?"":"-h, "}--help`,"Show this message"]]}function w(z){let J=[],Y=z.args.map(d).join(" "),Q=["gemi run",z.commandName,z.options.length>0?"[options]":"",Y].filter(Boolean).join(" ");if(J.push(`Usage: ${Q}`),z.description)J.push("",z.description);if(z.args.length>0)J.push("","Arguments:"),J.push(...C(z.args.map((G)=>{let $=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:""].filter(Boolean).join(" ");return[d(G),$]})));return J.push("","Options:"),J.push(...C([...z.options.map((G)=>{let $="alias"in G&&G.alias?`-${G.alias}, `:"",_=G.type==="boolean"?"":` <${G.type}>`,B=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:"","required"in G&&G.required?"(required)":""].filter(Boolean).join(" ");return[`${$}--${R(G.name)}${_}`,B]}),...Xz(z)])),J.join(`
|
|
5
5
|
`)}function i(z){return["Provided by gemi:","",...C(z.map((J)=>[J.commandName,J.description]))].join(`
|
|
@@ -15,4 +15,4 @@ ${i(j)}`);return 0}let H=W.get(z.name)??j.find((Z)=>Z.commandName===z.name);if($
|
|
|
15
15
|
${Q.message}
|
|
16
16
|
\`gemi run\` boots your application the way the server does, so it needs the Kernel. Run it from the root of a gemi project.`,{cause:Q})}if(typeof Y.default!=="function")throw new f(`${J} has no default export. gemi expects the Kernel subclass to be the default export of that file.`);return new Y.default}function s(z,J,Y,Q="returned"){if(z===void 0||z===null)return 0;if(typeof z==="number"&&Number.isInteger(z)&&z>=0&&z<=255)return z;let G=J?`Command "${J.commandName}"`:"The command";return Y(`${G} ${Q} ${JSON.stringify(z)}, which is not an exit `+"code \u2014 an exit code is an integer from 0 to 255. Treating this as a "+"failure."),1}var[Zz,..._z]=process.argv.slice(2),zz=E();e({rootDir:process.cwd(),name:Zz,argv:_z,writers:zz}).then(async(z)=>{await zz.flush(),process.exit(z)});
|
|
17
17
|
|
|
18
|
-
//# debugId=
|
|
18
|
+
//# debugId=B94E87E8EFC929D664756E2164756E21
|
package/dist/console/run.js.map
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"/**\n * The entry point `gemi run` spawns.\n *\n * Exposed through the exports map as `gemi/console/run` and resolved by the CLI\n * out of the *application's* `node_modules`, the same way `dev` and `start`\n * resolve `gemi/bun/preload`. That indirection is the point: the runner has to\n * be the application's copy of gemi, not the one bundled into `dist/bin/gemi.js`\n * — see the note at the top of `runner.ts`.\n *\n * Nothing but argv handling lives here, so that everything worth testing lives\n * in `runConsole`, which returns an exit code instead of taking one.\n */\nimport { processWriters } from \"./context\";\nimport { runConsole } from \"./runner\";\n\n// The tail is forwarded exactly as commander handed it over, `--` and all.\n// commander passes a `--` through as a literal operand (verified: `gemi run x --\n// --weird` arrives as `[\"--\", \"--weird\"]`), and `parse.ts` already treats a `--`\n// as \"everything after this is positional\". Stripping it here — which an earlier\n// draft did — consumed the escape hatch before the only thing that reads it,\n// leaving `-- --weird` reported as an unknown option and `-- --` the only way to\n// pass a flag-shaped value.\nconst [name, ...argv] = process.argv.slice(2);\n\nconst writers = processWriters();\n\n// `.then` rather than a top-level `await`, so this file typechecks under the\n// package's inherited `module: NodeNext` — the same TS1309 that keeps `bun/` out\n// of tsconfig.json's `include`. Bun runs it as ESM either way; this just avoids\n// buying a nested tsconfig for two lines.\nrunConsole({ rootDir: process.cwd(), name, argv, writers }).then(\n async (code) => {\n // Everything written has to reach the OS before the exit below discards it —\n // see `processWriters` for what that costs when it is skipped.\n await writers.flush();\n\n // Explicit, and not belt-and-braces. `kernel.destroy()` stops the scheduler,\n // but an open database pool, a Redis client or an unref'd timer will happily\n // hold the loop open after the work is done — a command that finishes and then\n // sits there, which is the failure `kernel/exit.test.ts` exists for and the\n // one `orm/context.test.ts` names by example.\n process.exit(code);\n },\n);\n"
|
|
11
11
|
],
|
|
12
12
|
"mappings": ";6sBA+FO,IAAS,JAAc,HAAmB,JAG/C,DAAI,HAAwB,GAAQ,GAAQ,HACxC,HAAwB,GAAQ,GAAQ,HAEtC,HAAQ,JAAC,HAA4B,IACzC,IAAI,QAAQ,CAAC,IAAY,CAIvB,EAAO,MAAM,EAAO,IAAM,EAAQ,CAAC,EACpC,EAEH,MAAO,CACL,OAAQ,CAAC,IAAU,CACjB,EAAS,EAAM,QAAQ,OAAQ,CAAK,GAEtC,OAAQ,CAAC,IAAU,CACjB,EAAS,EAAM,QAAQ,OAAQ,CAAK,GAEtC,MAAO,SAAY,CACjB,MAAM,QAAQ,IAAI,CAAC,EAAQ,CAAM,CAAC,EAEtC,EAGK,SAAS,CAAmB,CAAC,EAKX,CACvB,IAAM,EAAU,EAAO,SAAW,EAAe,EAEjD,MAAO,CACL,KAAM,EAAO,KACb,QAAS,EAAO,QAChB,KAAM,EAAO,KACb,KAAM,CAAC,EAAU,KAAO,EAAQ,OAAO,GAAG;AAAA,CAAW,EACrD,MAAO,CAAC,IAAoB,EAAQ,OAAO,GAAG;AAAA,CAAW,EACzD,KAAM,CAAC,EAAiB,EAAO,IAAM,CACnC,MAAM,IAAI,EAAc,EAAS,CAAI,EAEzC,EC3IF,oBCaO,IAAM,GAA0B,EAAc,mBAAmB,EACrE,SAAS,gEAAgE,EACzE,IAAI,QAAS,CACZ,YAAa,wEACf,CAAC,EACA,OAAO,YAAa,CACnB,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I,EAAO,QAgBpB,SAAS,CAAW,CAClB,EACA,EACA,EACA,EAAS,WACD,CACR,GAAI,IAAW,QAAa,IAAW,KAAM,MAAO,GAEpD,GACE,OAAO,IAAW,UAClB,OAAO,UAAU,CAAM,GACvB,GAAU,GACV,GAAU,IAEV,OAAO,EAGT,IAAM,EAAU,EAAU,YAAY,EAAQ,eAAiB,cAO/D,OALA,EACE,GAAG,KAAW,KAAU,KAAK,UAAU,CAAM,2BAC3C,4EACA,UACJ,EACO,EI7PT,IAAO,MAAS,IAAQ,QAAQ,KAAK,MAAM,CAAC,EAEtC,GAAU,EAAe,EAM/B,EAAW,CAAE,QAAS,QAAQ,IAAI,EAAG,QAAM,QAAM,UAAQ,CAAC,EAAE,KAC1D,MAAO,IAAS,CAGd,MAAM,GAAQ,MAAM,EAOpB,QAAQ,KAAK,CAAI,EAErB",
|
|
13
|
-
"debugId": "
|
|
13
|
+
"debugId": "B94E87E8EFC929D664756E2164756E21",
|
|
14
14
|
"names": []
|
|
15
15
|
}
|
package/dist/database/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ta as N}from"../chunk-
|
|
2
|
+
import{Ta as N}from"../chunk-59p034g3.js";import"../chunk-6my6c6b1.js";import"../chunk-cmyt2txd.js";import"../chunk-w4aw44zg.js";import"../chunk-yxtfg4wy.js";import{Al as w,Bl as x,Cl as z,Dl as A,El as E,Fl as F,Gl as G,Hl as H,Il as I,Jl as J,Kl as K,Ll as L,xl as j,yl as k}from"../chunk-qa528feb.js";import"../chunk-yedb5vvg.js";export{A as isSqlite,E as isMysqlFamily,z as inferDialect,j as defineDatabaseConfig,k as databaseConfigDefaults,w as UnknownDatabaseUrlError,H as UnknownConnectionError,I as ReservedConnectionNameError,x as MissingDatabaseUrlError,N as DatabaseServiceProvider,L as DatabaseManager,G as DEFAULT_CONNECTION,J as CrossConnectionTransactionError,K as Connection,F as AmbiguousSqlitePathError};
|
|
3
3
|
|
|
4
4
|
//# debugId=91BB06FFA450BB0864756E2164756E21
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$f as
|
|
2
|
+
import{$f as n,Cg as r,Dg as s,Eg as t,Fg as u,Jf as a,Mf as c,Nf as e,Of as f,Pf as h,Qf as i,Rf as j,Yf as k,Zf as l,_f as m,ag as o,bg as p,oh as v,rg as q}from"../chunk-yv3y3r9q.js";import"../chunk-nrv7hdeh.js";import"../chunk-cmyt2txd.js";import{Ti as b,sj as d,wj as g}from"../chunk-4kkb85z8.js";import"../chunk-y12m6w7b.js";import"../chunk-gf3m0866.js";import"../chunk-0egjv6cj.js";import"../chunk-kt174y9e.js";import"../chunk-s4sx97fn.js";import"../chunk-w4aw44zg.js";import"../chunk-xrkr2yzz.js";import"../chunk-ak85ee4e.js";import"../chunk-yxtfg4wy.js";import"../chunk-xyv3y476.js";import"../chunk-qa528feb.js";import"../chunk-jzqywxpj.js";import"../chunk-qstjm3cb.js";import"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-cwm5x7rf.js";import"../chunk-q0d45r2j.js";import"../chunk-hmtn7996.js";import"../chunk-rp2f9mq1.js";import"../chunk-yedb5vvg.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=2F8387C720942E1164756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$e as F,Ah as ja,Bh as ka,Ch as la,Dh as ma,Eh as na,Fh as oa,Gh as pa,Hf as J,Hh as qa,If as K,Ih as ra,Jh as sa,Kf as L,Kh as ta,Lf as M,Lh as ua,Ng as $,Re as t,Se as u,Te as v,Ue as w,Ve as x,We as E,cf as G,df as H,ef as I,ph as aa,qh as ba,rh as ca,uh as da,vh as ea,wh as fa,xh as ga,yh as ha,zh as ia}from"../chunk-yv3y3r9q.js";import"../chunk-nrv7hdeh.js";import"../chunk-cmyt2txd.js";import{Di as o,Ei as p,Fi as q,Gi as r,Li as s,Ni as y,Oi as z,Pi as A,Qi as B,Ri as C,Si as D,bj as N,cj as O,dj as P,ej as Q,fj as R,gj as S,hj as T,ij as U,ji as a,jj as V,ki as b,kj as W,li as d,lj as X,nj as Y,oj as Z,pj as _,qi as e,ri as f,si as g,ti as h,ui as i,vi as j,yi as n}from"../chunk-4kkb85z8.js";import{Aj as c}from"../chunk-y12m6w7b.js";import{Fj as k,Gj as l,Hj as m}from"../chunk-gf3m0866.js";import"../chunk-0egjv6cj.js";import"../chunk-kt174y9e.js";import"../chunk-s4sx97fn.js";import"../chunk-w4aw44zg.js";import"../chunk-xrkr2yzz.js";import"../chunk-ak85ee4e.js";import"../chunk-yxtfg4wy.js";import"../chunk-xyv3y476.js";import"../chunk-qa528feb.js";import"../chunk-jzqywxpj.js";import"../chunk-qstjm3cb.js";import"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-cwm5x7rf.js";import"../chunk-q0d45r2j.js";import"../chunk-hmtn7996.js";import"../chunk-rp2f9mq1.js";import"../chunk-yedb5vvg.js";export{g as toRangeHeaderValue,v as toMiddlewareList,k as stateKey,_ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,ia as middlewareConfigDefaults,u as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,qa as defineResourcePolicy,ha as defineMiddlewareConfig,n as cspNonce,w as createUnsatisfiableResponse,x as createStreamResponse,L as createFileResponse,I as clientIp,Y as classifyAddress,ca as authorizeChannel,M as ViewRouter,o as ValidationError,V as TooManyRedirectsError,T as TooLargeError,S as TimeoutError,ra as SitemapError,sa as Sitemap,K as SameSiteBounceMiddleware,Z as SafeResponse,N as SafeFetchError,J as SAME_SITE_BOUNCE_PARAM,ta as RobotsTxt,ua as Robots,pa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,H as RateLimitMiddleware,F as RateLimitExceededError,A as RangeNotSatisfiableError,na as PoliciesServiceProvider,oa as Policies,q as PayloadTooLargeError,B as NotFoundError,W as NetworkError,l as MissingRequestStateError,G as Middleware,fa as McpToolDeclaration,ga as McpRouter,ea as McpRouteDeclaration,da as McpModelParam,p as InvalidValidationRuleError,O as InvalidUrlError,z as InsufficientPermissionsError,X as HttpStatusError,t as HttpResponse,s as HttpRequest,C as FileNotFoundError,R as DnsError,la as CorsMiddleware,a as Controller,U as ContentTypeError,ba as ChannelRouter,aa as ChannelDeclaration,ka as CacheMiddleware,ma as CSRFMiddleware,$ as BodyLimitMiddleware,P as BlockedHostError,Q as BlockedAddressError,y as AuthorizationError,ja as AuthenticationMiddleware,D as AuthenticationError,E as ApiRouter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=0B33806790B7252364756E2164756E21
|
package/dist/http/index.js.map
CHANGED
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ra as T}from"../chunk-1nw9jhpt.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-
|
|
2
|
+
import{ra as T}from"../chunk-1nw9jhpt.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-4g24ffv8.js";import{Oe as b,Pe as w}from"../chunk-p4b5hmr8.js";import"../chunk-6my6c6b1.js";import{Mf as j}from"../chunk-yv3y3r9q.js";import"../chunk-nrv7hdeh.js";import"../chunk-cmyt2txd.js";import"../chunk-4kkb85z8.js";import"../chunk-y12m6w7b.js";import"../chunk-gf3m0866.js";import"../chunk-0egjv6cj.js";import"../chunk-kt174y9e.js";import"../chunk-s4sx97fn.js";import"../chunk-w4aw44zg.js";import"../chunk-xrkr2yzz.js";import"../chunk-ak85ee4e.js";import"../chunk-yxtfg4wy.js";import"../chunk-xyv3y476.js";import"../chunk-qa528feb.js";import"../chunk-jzqywxpj.js";import{am as V,bm as X,cm as E,dm as L,em as R,fm as S}from"../chunk-qstjm3cb.js";import"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-cwm5x7rf.js";import"../chunk-q0d45r2j.js";import"../chunk-hmtn7996.js";import"../chunk-rp2f9mq1.js";import"../chunk-yedb5vvg.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=46A78B586815C0AF64756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
"import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
|
|
8
8
|
],
|
|
9
9
|
"mappings": ";skCAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,JAEzE,DAAM,HAAS,EAAO,EAAO,JAAM,HAAE,AACnC,JAAC,DACC,EAAO,DAAU,OACjB,HAAgB,HAAkC,HAAE,JAAC,JACzD,HAMM,EAAQ,kDAEd,GAAI,CAAC,EAqCH,OAnCe,EAAS,QAAQ,EAAO,CAAC,EAAO,EAAM,EAAM,IAAY,CAErE,IAAM,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MAAM,GAAG,EAAE,GAAK,EAEtD,EAAQ,EAAO,GACrB,GAAI,IAAU,OACZ,OAAO,EAGT,GAAI,OAAO,IAAU,WAAY,CAG/B,IAAM,EAAiB,EADD,IAAY,OAAY,EAAU,EACd,EAE1C,GAAI,EAAe,CAAc,EAC/B,MAAU,MAAM,gCAAgC,EAElD,OAAO,OAAO,CAAc,EAI9B,GAAI,EACF,OAAQ,EAAK,YAAY,OAClB,SACH,OAAO,OAAO,CAAK,EAAE,SAAS,MAC3B,SACH,OAAO,OAAO,CAAK,MAChB,UACH,OAAO,QAAQ,CAAK,EAAE,SAAS,UAE/B,OAAO,OAAO,CAAK,EAGzB,OAAO,OAAO,CAAK,EACpB,EAEI,KAEL,IAAM,EAAqC,CAAC,EACxC,EAAY,EACZ,EAAgC,KAEpC,OAAQ,EAAQ,EAAM,KAAK,CAAQ,KAAO,KAAM,CAC9C,IAAO,EAAW,EAAM,EAAM,GAAW,EACnC,EAAa,EAAM,MAGnB,EAAY,EAAK,SAAS,GAAG,EAAI,EAAK,MAAM,GAAG,EA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7D,OAAoC,CAAC,EAAc,EAAiB,CACzE,OAAO,IAAI,EAAc,EAAM,CAAY,QAGtC,KAA+D,CACpE,KACG,EAWK,CACR,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,IAAO,EAAG,EAEtE,GAAI,CAAC,IAAU,GACb,MAAU,MAAM,6BAA6B,OAAO,CAAM,GAAG,EAG/D,OAAO,EAAiB,EAAQ,GAAS,GAAU,CAAC,CAAC,EAEzD,CC7EA,eAAsB,CAKrB,CACC,EACA,KACG,EAGc,CACjB,IAAQ,SAAS,EAAK,OAAO,EAAG,UAAW,CAAE,OAAQ,CAAC,KAAM,EAAK,EAAG,EAE9D,GADU,MAAM,EAAW,KAAK,OAAO,CAAM,CAAC,GAC3B,GAEzB,GAAI,OAAO,IAAa,SACtB,MAAU,MACR,8BAA8B,UAAY,OAAO,CAAM,kBAAkB,EAAW,KACtF,EAGF,OAAO,EAAiB,EAAW,GAAU,CAAC,CAAS",
|
|
10
|
-
"debugId": "
|
|
10
|
+
"debugId": "46A78B586815C0AF64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ta as E}from"../chunk-
|
|
2
|
+
import{Ta as E}from"../chunk-59p034g3.js";import{ob as l}from"../chunk-cw50n89n.js";import{pb as H}from"../chunk-4g24ffv8.js";import{$b as I,Cb as g,Db as W,Eb as _,Fb as p,Gb as P,Hb as u,Ib as $,Jb as V,Kb as q,Lb as B,Mb as K,Qb as L,Rb as Q,Sb as T,Wb as U,Xb as y,Yb as F,Zb as C,_b as D,cc as b,fc as f,gc as k,hc as m}from"../chunk-2vktfp1f.js";import"../chunk-xvf1hcxg.js";import"../chunk-xm6hfksv.js";import"../chunk-71r1x773.js";import"../chunk-7xe5vd4w.js";import{Ie as h}from"../chunk-pnt0c59g.js";import"../chunk-p4b5hmr8.js";import"../chunk-6my6c6b1.js";import{Ff as n,Gf as v,eh as w,ih as A,jf as d,kf as s,mh as R}from"../chunk-yv3y3r9q.js";import"../chunk-nrv7hdeh.js";import"../chunk-cmyt2txd.js";import"../chunk-4kkb85z8.js";import"../chunk-y12m6w7b.js";import"../chunk-gf3m0866.js";import"../chunk-0egjv6cj.js";import"../chunk-kt174y9e.js";import{Zj as M}from"../chunk-s4sx97fn.js";import"../chunk-w4aw44zg.js";import"../chunk-xrkr2yzz.js";import"../chunk-ak85ee4e.js";import"../chunk-yxtfg4wy.js";import"../chunk-xyv3y476.js";import"../chunk-qa528feb.js";import"../chunk-jzqywxpj.js";import"../chunk-zyvmbqcx.js";import"../chunk-qstjm3cb.js";import{gm as O,im as J}from"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-cwm5x7rf.js";import"../chunk-q0d45r2j.js";import"../chunk-hmtn7996.js";import"../chunk-rp2f9mq1.js";import"../chunk-yedb5vvg.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new J;boot(){if(this.models.length>0)l(...this.models);else a();this.app.config.merge(this.config),J.setInstance(this.app),this.app.registerMany([...N,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let z of this.services){let G=typeof z==="function"?new z:z,x=G.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(Z,G),this.serviceInstances.push(G),this.serviceTokens.add(x.token)}this.app.setShutdownHooks(this.serviceInstances.map((z)=>({name:`${z.constructor.name}.onShutdown`,shutdown:(G)=>z.onShutdown(G)})))}async waitForBoot(){await this.app.boot(),await this.bootServices(),p(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),J.getInstance()===this.app)J.setInstance(void 0);O.disable()}}function a(){if(Bun.env.NODE_ENV==="production")return;let j=M();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
|
@@ -13,4 +13,4 @@ import{Ta as E}from"../chunk-b1pps9bj.js";import{ob as l}from"../chunk-fq7wkefg.
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{s as oneTimeSecretMatches,d as hashOneTimeSecret,N as frameworkProviders,v as UserProvider,n as SESSION_SELECT,S as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=5D850527E31B585264756E2164756E21
|
package/dist/kernel/index.js.map
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { McpHttpServer } from \"../services/mcp/http/McpHttpServer\";\nimport { Application } from \"../foundation/Application\";\nimport type { ServiceProviderConstructor, ShutdownReport } from \"../foundation/Application\";\nimport type { ServiceToken } from \"../container/Container\";\nimport type { ConfigItems } from \"../support/Repository\";\nimport type { Service, ServiceConstructor } from \"../support/Service\";\nimport { registerModels } from \"../orm/registration\";\nimport { registeredNames } from \"../orm/registry\";\nimport { Scheduler } from \"../services/cron/Scheduler\";\nimport { QueueManager } from \"../services/queue/QueueManager\";\nimport { startClaimingIfServing } from \"../services/queue/QueueServiceProvider\";\nimport { ApiRouteDispatcher } from \"../services/router/ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"../services/router/ViewRouteDispatcher\";\nimport { DomainRouter } from \"../services/router/DomainRouter\";\nimport { runGlobalMiddleware } from \"../services/router/globalMiddleware\";\nimport { SocketHub } from \"../services/broadcast/SocketHub\";\nimport { kernelContext } from \"./context\";\nimport { frameworkProviders } from \"./providers\";\n\n/**\n * The app's entry point into the framework. A Kernel subclass declares what the\n * app adds — its `config` slices and any extra `providers` — and everything\n * else lives in the Application container it owns.\n */\nexport class Kernel {\n /**\n * App-level config, merged over the framework defaults. Each key is a config\n * slice: `{ mail: { ... }, route: { ... } }`, normally the modules under\n * `app/config`.\n */\n protected config: ConfigItems = {};\n\n /**\n * App-level providers, registered after the framework's own so they can\n * rebind anything the framework bound.\n */\n protected providers: ServiceProviderConstructor[] = [];\n\n /**\n * The app's own singleton services. Each is constructed during the\n * synchronous boot phase and its `boot()` awaited during the asynchronous\n * one, in the order listed — so a service whose `boot()` depends on another\n * goes after it.\n *\n * An entry is either the class itself or a configured instance from\n * `Service.with({ ... })`. Listing is explicit rather than discovered because\n * the order is load-bearing here, and because a service is always imported by\n * whatever injects it — there is no file the import graph would miss.\n */\n protected services: Array<ServiceConstructor | Service> = [];\n\n private serviceInstances: Service[] = [];\n private serviceTokens = new Set<string>();\n private servicesBooted = false;\n\n /**\n * The modules holding the app's model classes — normally\n * `[generated, models]`, the generated namespace and the barrel of subclasses\n * written over it. Every model class they export is registered under the name\n * its schema carries, later modules winning, and the whole set is audited\n * before anything else boots.\n *\n * ### Why this is a Kernel field and not a line in a file somewhere\n *\n * Registration used to be `register(\"User\", User)` next to each subclass, and\n * the failure mode of forgetting it is an authorization hole that nothing\n * reports: a relation read resolves its target by name, so an unregistered\n * policied subclass leaves the generated base owning the name and every\n * nested `include` of that model comes back unscoped. No error at the root\n * either, because `$exec`'s divergence guard begins `registered !== this` and\n * the base it is running on *is* the registered one. A model only ever read\n * through an include — a membership, a pivot, the kind that carries a tenant\n * scope — never trips anything.\n *\n * Listing the modules here says it once, in the same place the app already\n * declares its config slices and providers, and turns the mistake into a\n * failure to boot rather than a quiet cross-tenant read.\n *\n * It sees the modules it is given, so a model class in a file that no barrel\n * re-exports is still invisible. That is the residual, and it is a smaller\n * one: a barrel is a place to notice an omission, and thirteen `register`\n * lines scattered across thirteen files is not.\n */\n protected models: Array<Record<string, unknown>> = [];\n\n readonly app = new Application();\n\n /**\n * Phase one, synchronous: every provider is constructed and its `register()`\n * runs. Only bindings are recorded here — no service is instantiated, so this\n * is safe to call from a synchronous constructor (`new App({ kernel })`).\n * Phase two is `waitForBoot()`.\n */\n boot() {\n // Before the container, deliberately. This throws on a model whose policies\n // would be skipped, and the useful moment for that is the one where nothing\n // has been constructed and no request can be in flight.\n if (this.models.length > 0) registerModels(...this.models);\n else warnIfModelsAreRegisteredButUndeclared();\n\n this.app.config.merge(this.config);\n Application.setInstance(this.app);\n this.app.registerMany([...frameworkProviders, ...this.providers]);\n this.registerServices();\n }\n\n /**\n * Constructs every listed service and binds it into the container. Runs after\n * the providers have registered, so a provider's `boot()` can `inject()` one;\n * a `Service` constructor does no I/O, so doing this synchronously costs\n * nothing beyond the field initializers.\n */\n private registerServices() {\n // What a previous pass bound, so re-running this on the same kernel is not\n // mistaken for a collision with something else.\n const ours = this.serviceTokens;\n\n this.serviceInstances = [];\n this.serviceTokens = new Set();\n this.servicesBooted = false;\n\n const owners = new Map<string, string>();\n\n for (const declaration of this.services) {\n const instance =\n typeof declaration === \"function\" ? new declaration() : declaration;\n const ctor = instance.constructor as ServiceConstructor;\n\n if (!ctor.token) {\n throw new Error(\n `Service [${ctor.name}] is listed in \\`services\\` but does not declare a \\`static token\\`.`,\n );\n }\n\n // Two services under one token is the failure this refuses to have\n // silently: the second would replace the first in the container, and\n // every `inject()` written against either would hand back whichever was\n // listed last.\n const owner = owners.get(ctor.token);\n if (owner) {\n throw new Error(\n `Services [${owner}] and [${ctor.name}] both declare the token \"${ctor.token}\". Tokens are the container's keys, so they must be unique.`,\n );\n }\n owners.set(ctor.token, ctor.name);\n\n // The same failure one level out. `Container.instance()` writes into\n // `instances`, which `make()` consults before `bindings`, so a token that\n // is already spoken for is not shared with its owner — it replaces it, for\n // every `app()` and `inject()` in the process. An app service that named\n // itself \"mail\" would leave `Mail.send()` resolving to an object with no\n // `send`, and the boot that caused it would report nothing. Providers have\n // all registered by now, so anything bound here belongs to somebody else.\n const token = ctor as unknown as ServiceToken<Service>;\n if (!ours.has(ctor.token) && this.app.bound(token)) {\n throw new Error(\n `Service [${ctor.name}] declares the token \"${ctor.token}\", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`,\n );\n }\n\n this.app.instance(token, instance);\n this.serviceInstances.push(instance);\n this.serviceTokens.add(ctor.token);\n }\n this.app.setShutdownHooks(\n this.serviceInstances.map((service) => ({\n name: `${service.constructor.name}.onShutdown`,\n shutdown: (options) => service.onShutdown(options),\n })),\n );\n }\n\n /**\n * Phase two, asynchronous: every provider's `boot()` runs, in registration\n * order, after all of them have registered. Idempotent.\n */\n async waitForBoot() {\n await this.app.boot();\n await this.bootServices();\n // Last, once every job — queued listeners included — is registered.\n startClaimingIfServing(this.app);\n }\n\n /**\n * Phase two for services, after every provider's `boot()` — so a service may\n * use the facades and anything else a provider owns. Idempotent, like the\n * provider phase it follows.\n */\n private async bootServices() {\n if (this.servicesBooted) {\n return;\n }\n for (const service of this.serviceInstances) {\n await service.boot();\n }\n this.servicesBooted = true;\n }\n\n /**\n * Every provider's `shutdown()`, in reverse registration order, inside the\n * application context — so a hook may use the facades, as a cron tick or a\n * request would. See `Application.shutdown` for the deadline and the\n * report. Idempotent.\n */\n shutdown(options?: { timeoutMs?: number }): Promise<ShutdownReport> {\n return this.run(() => this.app.shutdown(options));\n }\n\n run<T>(cb: () => T) {\n return kernelContext.run(this.app, cb);\n }\n\n /**\n * Resolve a service by token. Callers outside this module should prefer the\n * named accessors below or `app()`; this exists for tooling that holds a\n * Kernel but no ambient context.\n */\n resolve<T>(token: ServiceToken<T>): T {\n return this.app.make(token);\n }\n\n // Named accessors. `app/App.ts` goes through these rather than importing the\n // service classes itself — see the note in that file about the two copies of\n // gemi that coexist at build time.\n apiRoutes(): ApiRouteDispatcher {\n return this.app.make(ApiRouteDispatcher);\n }\n\n viewRoutes(): ViewRouteDispatcher {\n return this.app.make(ViewRouteDispatcher);\n }\n\n domains(): DomainRouter {\n return this.app.make(DomainRouter);\n }\n\n queue(): QueueManager {\n return this.app.make(QueueManager);\n }\n\n /** The MCP endpoint, or `null` when `route.mcp.remote` is not enabled. */\n mcpHttp(): McpHttpServer | null {\n return this.app.config.get(\"route.mcp.remote.enabled\") === true\n ? this.app.make(McpHttpServer)\n : null;\n }\n\n /**\n * The broadcast WebSocket endpoint, or `null` when the app declares no\n * `route.channels` (nothing could be subscribed to, so nothing is upgraded).\n */\n sockets(): SocketHub | null {\n return this.app.config.get(\"route.channels\") ? this.app.make(SocketHub) : null;\n }\n\n /** The `global` middleware list for one request. Call it inside `run`. */\n globalMiddleware(req: Request) {\n return runGlobalMiddleware(req);\n }\n\n destroy() {\n // Only touch services that were actually resolved — resolving one here\n // would construct it purely to tear it down.\n if (this.app.resolved(Scheduler)) {\n this.app.make(Scheduler).stop();\n }\n\n this.app.flush();\n\n if (Application.getInstance() === this.app) {\n Application.setInstance(undefined);\n }\n\n kernelContext.disable();\n }\n}\n\n/**\n * Says something to an application that has models and has not declared them.\n *\n * Without this the fix for #316 defaults to off. `models` is `[]`, `boot()`\n * no-ops, and an app upgrading from 0.48 is in exactly the state the issue\n * describes until somebody edits their Kernel by hand — while the only place\n * that says to is the **Setup** section of `docs/orm.md`, which an existing app\n * read once and will not read again. #316 was filed by an app mid-migration\n * with a 79-model schema, which is precisely the reader who never sees it.\n *\n * The condition is what makes this worth printing. A populated registry with an\n * empty `models` means the generated `index.ts` was imported and its bases are\n * what every nested read resolves to — so if any policy lives on a subclass, it\n * is being skipped inside includes right now. A Kernel with no ORM at all has\n * an empty registry and hears nothing.\n *\n * Development only, and a warning rather than a throw: an app in this state is\n * running today, and turning a working deploy into a failure to start over an\n * arrangement that *might* be fine is not a patch-level thing to do. The\n * failure it points at is silent, so the fix for it has to be noisy somewhere,\n * and the terminal an author is already looking at is the cheapest somewhere\n * there is.\n */\nfunction warnIfModelsAreRegisteredButUndeclared(): void {\n if (process.env.NODE_ENV === \"production\") return;\n\n const registered = registeredNames();\n if (registered.length === 0) return;\n\n console.warn(\n `[gemi] ${registered.length} model${registered.length === 1 ? \" is\" : \"s are\"} ` +\n `registered, but Kernel.models is empty.\\n` +\n ` Nested relation reads resolve a model by name, so a policy on a ` +\n `subclass that does not own its\\n` +\n ` name is skipped inside every include — scoped at the root, ` +\n `unscoped in an include, with nothing\\n` +\n ` to notice it. Declaring the modules registers each class under ` +\n `its own name and audits the set:\\n\\n` +\n ` import * as generated from \"../models/generated\"\\n` +\n ` import * as models from \"../models\"\\n\\n` +\n ` export default class extends Kernel {\\n` +\n ` models = [generated, models]\\n` +\n ` }\\n\\n` +\n ` See docs/orm.md#your-model-class. Development only; this never ` +\n `prints in production.`,\n );\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";2hDA2CO,DAAM,HAAmD,JAC9D,HACA,HACA,HAIA,HAGA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,HACA,JACF,HC9CO,CAAM,JAAO,JAMR,EAAsB,JAAC,HAMvB,KAA0C,JAAC,HAa3C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E7B,QAAQ,KACN,UAAU,EAAW,eAAe,EAAW,SAAW,EAAI,MAAQ;AAAA;AAAA,EAIpE,2EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6FAUJ",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "5D850527E31B585264756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/orm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qa as g6}from"../chunk-gxd1388t.js";import{$a as w0,Ua as J9,Va as Y9,Wa as l,Xa as b9,Ya as E3,Za as E6,_a as w6,ab as e5,bb as w3,cb as x6,db as X3,eb as I0,fb as Z7,gb as X7,hb as z7,ib as d5,jb as J7,kb as Y7,lb as H7,mb as v6,nb as k6,ob as f6}from"../chunk-fq7wkefg.js";import{Uh as O6,Vh as A6,Wh as S6,Xh as b6,Yh as q6}from"../chunk-s7jwsbfd.js";import{$h as j,Zh as A0,_h as o,ai as n,di as R,ei as x,fi as c,gi as C6,hi as T6,ii as Y5,ji as R6,ki as p3,li as k,mi as I6,ni as U6,oi as N6,pi as F6,qi as a5}from"../chunk-4s72m6zx.js";import"../chunk-snt0523y.js";import{hk as G6,ik as a,jk as d,kk as P3,lk as u0,nk as _6,ok as L6,tk as t4,uk as r4,vk as a4,wk as e4,xk as $7}from"../chunk-m0pfdc1n.js";import{Ak as g0,Bk as g,Ck as $6,Dk as $0,Ek as Z6,Fk as c5,Gk as X6,Hk as T5,Ik as z6,Kk as J6,Lk as s5,Mk as Y6,Nk as H6,Ok as i5,Pk as R3,Qk as y0,Rk as s3,Sk as i3,Tk as s,Uk as V6,Vk as h0,Wk as n5,yk as K,zk as T}from"../chunk-ncw3zjxm.js";import{bl as B6,cl as E0,dl as T0,el as Z3,hl as D6,il as l4,kl as P6,ll as j6,ml as l5,nl as o5,ol as p5,pl as b3,ql as K6,rl as t5,sl as r5,tl as Q6,ul as o4}from"../chunk-xyv3y476.js";import{Hl as W6,Jl as M6,Ll as S3}from"../chunk-qa528feb.js";import{jm as A3}from"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-yedb5vvg.js";function N0($,Z,X,z,J,Y){let H=X0($,Z),G=B0($,H,Z,Y),V=X.quoteIdent(z),W=`${V}.`,M=G.parentFields.map((Q,L)=>{let F=`${W}${X.quoteIdent(z3(H,Z,G.childFields[L]))}`,N=`${J}${X.quoteIdent(z3($,Z,Q))}`;return`${F} = ${N}`}).join(" and ");if(!G.join)return{child:H,source:`${X.quoteIdent(H.table)} as ${V}`,correlation:M,qualifier:W};let B=`${W}${X.quoteIdent(z3(H,Z,G.childFields[0]))}`,D=`${J}${X.quoteIdent(z3($,Z,G.parentFields[0]))}`,P=X.quoteIdent(`${z}j`);return{child:H,source:`${X.quoteIdent(H.table)} as ${V} join ${X.quoteIdent(G.join.table)} as ${P} on ${P}.${X.quoteIdent(G.join.childColumn)} = ${B}`,correlation:`${P}.${X.quoteIdent(G.join.parentColumn)} = ${D}`,qualifier:W}}function z3($,Z,X){let z=$.fields[X];if(!z)throw new s($.name,Z.name,`it joins on '${X}', which is not a field on ${$.name}.`);return z.column}function u($,Z,X){let z=J3($);if(typeof Z!=="object"||Z===null||Array.isArray(Z))throw X9($,X,z);let J=Object.keys(Z).filter((H)=>Z[H]!==void 0),Y=Z;for(let H of z){if(H.length===1&&J.includes(H[0]))return Z9($,X,H[0],Y[H[0]]),H;let G=H.join("_");if(H.length>1&&J.includes(G)){let V=Y[G];if(V&&typeof V==="object"&&!Array.isArray(V))for(let W of H)Z9($,X,`${G}.${W}`,V[W]);return H}}throw X9($,X,z)}function f3($){if($===null||$===void 0)return!1;let Z=typeof $;if(Z!=="object")return Z!=="function"&&Z!=="symbol";if(Array.isArray($))return!1;if($ instanceof Date||ArrayBuffer.isView($))return!0;let X=Object.getPrototypeOf($);return X!==Object.prototype&&X!==null}function Z9($,Z,X,z){if(z===void 0||f3(z))return;throw new T(`${Z.argument}.${X}`,Z.model,Z.operation,`A unique key takes a plain value to match, not ${z===null?"null":Array.isArray(z)?"an array":"a filter object"}. Use findFirst/findMany (or updateMany/deleteMany) to filter on ${$.name}.${X.split(".").pop()}.`)}function g3($,Z,X){u($,Z,{model:$.name,operation:X,argument:"where"})}function J3($){let Z=[];if($.primaryKey.length>0)Z.push($.primaryKey);for(let X of $.uniques)Z.push(X);return Z}function X9($,Z,X){let z=X.map((H)=>H.length===1?H[0]:H.join("_")).join(", "),Y=Z.argument.startsWith("data.")?`Name it by one of those, or reach it through the ${$.name} model directly.`:`Use ${Z.operation==="delete"||Z.operation==="update"?`${Z.operation}Many`:"findFirst"} to query on anything else.`;return new K(Z.argument,Z.model,Z.operation,`${$.name} needs a unique field here. It declares: ${z}. ${Y}`)}function y($,Z,X){let z=Z.castParameter($);if(!z)return n(X);return n((J,Y)=>{let H=X(J,Y);if(H===null||H===void 0)return null;let G=k(H);if(G==="db")return null;if(G==="json")return"null";if(G==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the parameter binder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.");return JSON.stringify(H)},z)}function f($,Z,X,z){if(Z===void 0||Z===null)return null;if(typeof Z!=="object"||Array.isArray(Z))throw new T("where",$.name,X.operation,"Expected an object.");let J=[];for(let Y of Object.keys(Z).sort()){let H=Z[Y];if(H===void 0)continue;let G=(W)=>z(W)?.[Y];if(Y==="AND"||Y==="OR"){let W=z9($,H,X,G,Y);if(W)J.push(W);continue}if(Y===z0){J.push(_7($,H,X,G));continue}if(Y==="NOT"){let W=z9($,H,X,G,"AND");if(W)J.push(R(j("not "),v0(W)));continue}if(Y in $.relations){let W=j7($,$.relations[Y],H,X,G);if(W)J.push(W);continue}let V=$.fields[Y];if(!V){let W=Q7($,Y,H,X,G);if(W){J.push(W);continue}throw new g(Y,$.name,Object.keys($.fields))}J.push(d3($,V,H,X,G))}if(J.length===0)return null;if(J.length===1)return J[0];return t(J," and ")}function j7($,Z,X,z,J){let Y=J9(Z.kind),H=K7($,Z,X,Y,z),G=z.relationDepth??0,V=z.dialect,W=z.qualifier??`${V.quoteIdent($.table)}.`,M=N0($,Z,V,`_r${G}`,W,z.operation),B=M.child,D=j(M.correlation),P={...z,qualifier:M.qualifier,relationDepth:G+1},Q=[];for(let L of Y){if(!(L in H))continue;let F=H[L],N=(I)=>H.direct?J(I):J(I)?.[L];if(F===null){Q.push(y3(M,D,null,L==="is"));continue}let C=f(B,F,P,N);if(L==="every"){if(!C)continue;Q.push(y3(M,D,R(j("not "),v0(C)),!0));continue}let _=L==="none"||L==="isNot";Q.push(y3(M,D,C,_))}if(Q.length===0)return null;if(Q.length===1)return Q[0];return t(Q," and ")}function y3($,Z,X,z){let J=[j(`${z?"not ":""}exists (select 1 from ${$.source} where `),Z];if(X)J.push(j(" and "),X);return J.push(j(")")),R(...J)}function K7($,Z,X,z,J){let Y=`where.${Z.name}`,H=Z.kind==="many";if(X===null){if(H)throw new K(Y,$.name,J.operation,`${Z.name} is a to-many relation, so null is not a filter for it. Use { none: {} } for "has no related rows".`);return{is:null,direct:!0}}if(typeof X!=="object"||Array.isArray(X))throw new T(Y,$.name,J.operation,H?`Expected an object holding ${z.join(", ")}.`:"Expected an object, or null.");if(Y9(X,z))return X;if(H)throw new K(Y,$.name,J.operation,`Expected one of ${z.join(", ")}. A to-many relation has no `+"single reading of a bare filter \u2014 { some: \u2026 } and { every: \u2026 } mean "+"different things.");return{is:X,direct:!0}}function Q7($,Z,X,z,J){let Y=J3($).find((V)=>V.length>1&&V.join("_")===Z);if(!Y)return null;if(typeof X!=="object"||X===null||Array.isArray(X))throw new T(`where.${Z}`,$.name,z.operation,`Expected an object holding ${Y.join(" and ")}.`);let H=X,G=[];for(let V of Y){if(H[V]===void 0)throw new K(`where.${Z}`,$.name,z.operation,`Missing '${V}'. A composite key needs all of ${Y.join(", ")}.`);if(!f3(H[V]))throw new T(`where.${Z}.${V}`,$.name,z.operation,`A composite key takes a plain value for each of ${Y.join(", ")}, not a filter, an array or null.`);G.push(d3($,$.fields[V],H[V],z,(W)=>J(W)?.[V]))}return G.length===1?G[0]:t(G," and ")}function z9($,Z,X,z,J){let Y=[];if(Array.isArray(Z))for(let H=0;H<Z.length;H++){let G=f($,Z[H],X,(V)=>z(V)?.[H]);if(G)Y.push(G)}else{let H=f($,Z,X,z);if(H)Y.push(H)}if(Y.length===0)return J==="AND"?null:H9;if(Y.length===1)return Y[0];return t(Y,J==="AND"?" and ":" or ")}var H9=j("false");function t($,Z){return R(j("("),x($,Z),j(")"))}function v0($){return $.text.startsWith("(")?$:t([$],"")}var m3=new Set(["equals","not","in","notIn","lt","lte","gt","gte","contains","startsWith","endsWith","mode"]),V9={lt:"<",lte:"<=",gt:">",gte:">="},z0="$compositeIn",G9=Symbol("gemi.orm.compositeInFromPlanner");function W9($,Z){return{[G9]:!0,fields:$,values:Z}}function _7($,Z,X,z){let{dialect:J}=X,H=L7($,Z,X).map((V)=>{let W=$.fields[V];if(!W)throw new g(V,$.name,Object.keys($.fields));return W}),G=H.map((V)=>`${X.qualifier??""}${J.quoteIdent(V.column)}`);return J.compositeIn(G,H.map((V)=>V.type),(V)=>z(V).values)}function L7($,Z,X){let z=()=>{throw new g(z0,$.name,Object.keys($.fields))};if(typeof Z!=="object"||Z===null||Array.isArray(Z))return z();if(Z[G9]!==!0)return z();let J=(G)=>{throw new K(z0,$.name,X.operation,G)},{fields:Y,values:H}=Z;if(!Array.isArray(Y)||Y.length===0)return J(`the planner built a '${z0}' with no fields.`);if(!Y.every((G)=>typeof G==="string"))return J(`the planner built a '${z0}' with a non-string field.`);if(!Array.isArray(H))return J(`the planner built a '${z0}' with no values.`);if(!H.every((G)=>Array.isArray(G)&&G.length===Y.length))return J(`the planner built a '${z0}' whose tuples do not all have ${Y.length} value(s).`);return Y}var C7=["equals","has","hasEvery","hasSome","isEmpty"],h3=new Set(C7);function T7($,Z,X,z,J,Y){let{dialect:H}=J;if(O0($,Z,`where.${Z.name}`,J.operation,H),Array.isArray(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a bare array is not a filter on `+"one \u2014 Prisma rejects it here too. Say which comparison you mean: "+`{ ${Z.name}: { equals: [...] } } for the whole list, or { ${Z.name}: { hasEvery: [...] } } for "contains all of these". A bare array *is* accepted as a value in \`data\`.`);if(!c3(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list. Expected an object holding ${[...h3].sort().join(", ")}; received ${z===null?"null":typeof z}.`);let G=z,V=[];for(let W of Object.keys(G).sort()){let M=G[W];if(M===void 0)continue;if(!h3.has(W))throw new T(`where.${Z.name}.${W}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a list filter takes ${[...h3].sort().join(", ")}. The scalar operators \u2014 `+`${[...m3].sort().join(", ")} \u2014 apply to a single value and `+"Prisma does not offer them here.");let B=(D)=>Y(D)?.[W];V.push(R7($,Z,X,W,M,J,B))}if(V.length===0)return j("true");if(V.length===1)return V[0];return t(V," and ")}function R7($,Z,X,z,J,Y,H){let{dialect:G}=Y;if(z==="equals")return I7($,Z,X,J,Y,H);if(z==="isEmpty"){if(typeof J!=="boolean")throw new T(`where.${Z.name}.isEmpty`,$.name,Y.operation,`Expected true or false, received ${J===null?"null":typeof J}.`);return G.listIsEmpty(X,J)}if(z==="has"){let W=U7(Z);return G.listHas(X,y(W,G,F0(W,G,H)))}if(!Array.isArray(J))throw new T(`where.${Z.name}.${z}`,$.name,Y.operation,`Expected an array, received ${J===null?"null":typeof J}.`);let V=y(Z,G,F0(Z,G,H));return z==="hasEvery"?G.listHasEvery(X,V):G.listHasSome(X,V)}function I7($,Z,X,z,J,Y){let{dialect:H}=J;if(z===null)return j(`${X} is null`);if(!Array.isArray(z))throw new T(`where.${Z.name}.equals`,$.name,J.operation,`'${Z.name}' is a scalar list, so it compares against an array. Received ${typeof z}. For "is this element present", use { ${Z.name}: { has: \u2026 } }.`);return R(j(`${X} = `),y(Z,H,F0(Z,H,Y)))}function U7($){return{...$,isList:!1}}function O0($,Z,X,z,J){if(J.listFilters.size>0)return;throw new K(X,$.name,z,`'${Z.name}' is a scalar list, and ${J.name} has no array type to hold one. Prisma refuses the column itself on ${J.name} \u2014 `+'"the current connector does not support lists of primitive types" \u2014 so '+`this is a difference between the databases rather than a gap in the ORM. The generated artifact is dialect-agnostic, which is why this surfaces here rather than at \`prisma generate\`: the schema was generated against Postgres and DATABASE_URL names a ${J.name} database, which has no '${Z.column}' column either. It works on postgres.`)}var N7=["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"],u3=new Set(N7),F7=["has_key","has_some_keys","has_every_key"],Y3=new Set(F7);function M9($,Z,X,z,J,Y,H,G){let V=z!=="has_key",W=`where.${Z.name}.${z}`,M=(D)=>{if(!(V?Array.isArray(D)&&D.every((Q)=>typeof Q==="string"):typeof D==="string"))throw new T(W,$.name,Y.operation,V?"Expected an array of key names, like ['a', 'b'].":"Expected a key name, like 'a'.");return D};M(J);let B=(D,P)=>M(G(D,P));return Y.dialect.jsonHasKeys(X,H,B,z==="has_key"?"one":z==="has_some_keys"?"some":"every",Array.isArray(J)?J.length:0)}function O7($,Z,X,z,J,Y){let{dialect:H}=J;if(Z.type!=="Json")throw new K(`${Z.name}.path`,$.name,J.operation,`A 'path' filter reads inside a JSON document, and '${Z.name}' is a ${Z.type} column.`);q7($,Z,z.path,J);let G=(M)=>Y(M)?.path,V=Object.keys(z).filter((M)=>M!=="path"&&z[M]!==void 0).sort();if(V.length===0)throw new K(`${Z.name}.path`,$.name,J.operation,`A 'path' needs a filter beside it \u2014 ${[...u3,...Y3].sort().join(", ")}. Prisma refuses a bare path too.`);let W=[];for(let M of V){if(Y3.has(M)){W.push(M9($,Z,X,M,z[M],J,G,(P)=>Y(P)?.[M]));continue}if(!u3.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`A JSON path filter takes ${[...u3,...Y3].sort().join(", ")}.`);if(!H.jsonFilters.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`'${M}' on a JSON path is not available on ${H.name}. Prisma refuses it here too, so this is a difference between the databases rather than a gap in the ORM. It works on postgres.`);let B=z[M],D=B===null?"json":k(B);if(D&&(M==="equals"||M==="not")){W.push(A7(D,X,G,Z,H,M==="not"));continue}if(D&&B!==null){let P=M==="array_contains"?"'array_contains' tests containment against a document, and a sentinel is not one":`'${M}' compares an extracted value against a scalar, and a sentinel is not one`;throw new T(`where.${Z.name}.${M}`,$.name,J.operation,`${k0(D)} asks which kind of null a value is, which `+`only 'equals' and 'not' can express \u2014 ${P}. Prisma refuses it under this operator too. Write { ${Z.name}: { path: [\u2026], equals: ${k0(D)} } }, `+"or filter the column itself \u2014 "+`{ ${Z.name}: { equals: ${k0(D)} } }.`)}if(B9(B))throw new T(`where.${Z.name}.${M}`,$.name,J.operation,"Prisma.AnyNull is a question rather than a value \u2014 'either kind of "+"null' \u2014 so it cannot appear inside a document. Ask it directly: "+`{ ${Z.name}: { path: [\u2026], equals: Prisma.AnyNull } }.`);S7(M,B,$,Z,J),W.push(b7(M,X,G,Z,H,(P)=>Y(P)?.[M]))}return W.length===1?W[0]:t(W," and ")}function A7($,Z,X,z,J,Y){let H=()=>R(J.jsonValueAt(Z,X),j(Y?" is not null":" is null")),G=()=>R(J.jsonValueAt(Z,X),j(Y?" <> ":" = "),y(z,J,()=>J.encode(p3,z)));if($==="db")return H();if($==="json")return G();return t([G(),H()],Y?" and ":" or ")}function S7($,Z,X,z,J){let Y=$==="string_contains"||$==="string_starts_with"||$==="string_ends_with";if(Y&&typeof Z!=="string")throw new T(`where.${z.name}.${$}`,X.name,J.operation,`Expected a string, received ${Z===null?"null":typeof Z}. Prisma raises here too \u2014 without this the pattern becomes `+`'%${String(Z)}%', which runs and returns the wrong rows.`);if(Z===null)throw new T(`where.${z.name}.${$}`,X.name,J.operation,$==="array_contains"?"null cannot be tested for containment through a JSON path: the operand binds as SQL NULL rather than as the JSON value, and "+"'x @> NULL' is NULL rather than true \u2014 the query would run and "+`match nothing. A null *inside* the document is an ordinary value and still compiles: { ${z.name}: { path: [\u2026], array_contains: [null] } }.`:`null cannot be compared through a JSON path with '${$}', which `+"compares the extracted value as a number \u2014 the comparison against "+`NULL is NULL rather than true, so the query would run and match nothing. Prisma refuses it here too. For "the value at this path is a JSON null", use equals or not: { ${z.name}: { path: [\u2026], equals: null } }.`);if($==="array_contains"||Y)return;if(typeof Z==="object")throw new K(`where.${z.name}.${$}`,X.name,J.operation,`'${$}' on a JSON path compares the extracted value as a scalar, so `+"an object or array operand cannot be expressed \u2014 it would bind as "+`'${String(Z)}' and match nothing. Prisma accepts one here; gemi does not yet. Use array_contains for containment, or narrow the path until it names a scalar.`)}function b7($,Z,X,z,J,Y){if($==="array_contains")return J.jsonArrayContains(Z,X,Y);let H=$==="string_contains"||$==="string_starts_with"||$==="string_ends_with",G=J.jsonExtract(Z,X,!0);if(H){let B=$==="string_contains"?(D)=>`%${D}%`:$==="string_starts_with"?(D)=>`${D}%`:(D)=>`%${D}`;return R(j("("),G,j(") like "),n((D,P)=>{let Q=Y(D,P);return Q===null||Q===void 0?null:B(String(Q))}))}let V=$==="equals"?"=":$==="not"?"<>":V9[$],W=$!=="equals"&&$!=="not",M=W?R(j("cast(("),G,j(") as real)")):R(j("("),G,j(")"));return R(M,j(` ${V} `),n((B,D)=>{let P=Y(B,D);if(P===null||P===void 0)return null;if(W)return Number(P);return J.jsonComparesAsText?String(P):P}))}function q7($,Z,X,z){let{dialect:J}=z,Y=J.jsonPathSyntax==="array"?"array":"jsonpath",H=Array.isArray(X)?"array":typeof X==="string"?"jsonpath":"other";if(Array.isArray(X)&&X.length===0||X==="")throw new K(`${Z.name}.path`,$.name,z.operation,`A JSON path cannot be empty. ${J.jsonPathSyntax==="array"?`On ${J.name} an empty array selects the whole document, `+"which is a filter on the column rather than on a path \u2014 write "+`{ ${Z.name}: { equals: \u2026 } } if that is what you meant.`:`On ${J.name} an empty string raises inside json_extract.`}`);if(H===Y){if(Y!=="array")return;let V=X.findIndex((B)=>typeof B!=="string");if(V===-1)return;let W=X[V],M=W===null?"null":W===void 0?"undefined":Array.isArray(W)?"an array":typeof W==="object"?"an object":`a ${typeof W}`;throw new K(`${Z.name}.path`,$.name,z.operation,`A JSON path is an array of strings, and path[${V}] is ${M}. `+(typeof W==="number"?'An array index is a key too \u2014 write ["items", "0"] rather than '+`["items", 0]; it reaches the same element, because ${J.name} takes the path as text. Prisma's path is string[] and its client refuses a number here too.`:"Prisma's path is string[] too."))}throw new K(`${Z.name}.path`,$.name,z.operation,J.jsonPathSyntax==="array"?`On ${J.name} a JSON path is an array of keys \u2014 ["a", "b"] \u2014 `+"not a JSONPath string. Prisma splits them the same way, and refuses the other form on each database.":`On ${J.name} a JSON path is a JSONPath string \u2014 "$.a.b" \u2014 not `+"an array of keys. Prisma splits them the same way, and refuses the other form on each database.")}function d3($,Z,X,z,J){let{dialect:Y}=z,H=`${z.qualifier??""}${Y.quoteIdent(Z.column)}`,G=k(X);if(G)throw new T(`where.${Z.name}`,$.name,z.operation,`${k0(G)} is not a filter on `+"its own \u2014 Prisma rejects it here too. Write it as an explicit "+`comparison: { ${Z.name}: { equals: ${k0(G)} } }.`);if(Z.isList)return T7($,Z,H,X,z,J);if(!c3(X))return H3(H,Z,X,Y,J);let V=X,W=Object.keys(V).sort();if(V.path!==void 0)return O7($,Z,H,V,z,J);let M=V.mode==="insensitive";if(V.mode!==void 0&&V.mode!=="default"){if(!M)throw new T(`mode: ${JSON.stringify(V.mode)}`,$.name,z.operation,"Prisma takes 'default' or 'insensitive'.");if(!Y.supportsInsensitiveMode)throw new K('mode: "insensitive"',$.name,z.operation,`The ${Y.name} dialect cannot express it \u2014 Prisma rejects it `+"here too. Note SQLite's LIKE is already case-insensitive for ASCII.")}let B=[];for(let D of W){let P=V[D];if(P===void 0||D==="mode")continue;if(Z.type==="Json"&&Y3.has(D)){B.push(M9($,Z,H,D,P,z,void 0,(L)=>J(L)?.[D]));continue}if(!m3.has(D))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`A scalar filter takes ${[...m3].sort().join(", ")}.`);if(D!=="equals"&&D!=="not"&&B9(P))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`Prisma.AnyNull means 'either kind of null', which only 'equals' and 'not' can express. Write { ${Z.name}: { equals: Prisma.AnyNull } }, or name the one you mean with Prisma.DbNull or Prisma.JsonNull.`);let Q=(L)=>J(L)?.[D];switch(D){case"equals":B.push(H3(H,Z,P,Y,Q));break;case"not":B.push(E7($,Z,P,z,Q,H));break;case"in":case"notIn":B.push(x7($,H,Z,P,z,Q,D==="notIn"));break;case"lt":case"lte":case"gt":case"gte":B.push(R(j(`${H} ${V9[D]} `),y(Z,Y,F0(Z,Y,Q))));break;case"contains":case"startsWith":case"endsWith":if(typeof P!=="string")throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`Expected a string, received ${P===null?"null":typeof P}.`);if(Z.type!=="String")throw new K(`where.${Z.name}.${D}`,$.name,z.operation,`'${Z.name}' is a ${Z.type}, and ${D} only applies to strings.`);B.push(Y.like(H,M,v7(D,Q)));break}}if(B.length===0)return j("true");if(B.length===1)return B[0];return t(B," and ")}function k0($){return`Prisma.${$==="db"?"DbNull":$==="json"?"JsonNull":"AnyNull"}`}function B9($){if(k($)==="any")return!0;return Array.isArray($)&&$.some((Z)=>k(Z)==="any")}function E7($,Z,X,z,J,Y){if(X===null||k(X)==="db")return j(`${Y} is not null`);if(k(X)==="json")return R(j("not "),v0(H3(Y,Z,X,z.dialect,J)));if(k(X)==="any")return R(j("not "),v0(H3(Y,Z,X,z.dialect,J)));if(!c3(X))return R(j(`${Y} <> `),y(Z,z.dialect,F0(Z,z.dialect,J)));let H=d3($,Z,X,z,J);return R(j("not "),v0(H))}function H3($,Z,X,z,J){if(X===null||k(X)==="db")return j(`${$} is null`);if(k(X)==="any")return t([j(`${$} is null`),w7($,Z,z)]," or ");return R(j(`${$} = `),y(Z,z,F0(Z,z,J)))}function w7($,Z,X){return R(j(`${$} = `),y(Z,X,()=>X.encode(p3,Z)))}function x7($,Z,X,z,J,Y,H){let{dialect:G}=J;if(!Array.isArray(z))throw new T(`where.${X.name}.${H?"notIn":"in"}`,$.name,J.operation,"Expected an array.");if(z.length===0)return H?j("true"):H9;return G.inList(Z,H,z.length,(V)=>{return Y(V).map((M)=>G.encode(M,X))})}function v7($,Z){return(X)=>{let z=String(Z(X));if($==="contains")return`%${z}%`;if($==="startsWith")return`${z}%`;return`%${z}`}}function F0($,Z,X){return(z)=>Z.encode(X(z),$)}function c3($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&!($ instanceof Date)&&!ArrayBuffer.isView($)}function D9($,Z,X,z,J,Y,H){let G=`orderBy.${Z.name}`;if(typeof X!=="object"||X===null||Array.isArray(X))throw new T(G,$.name,z,Z.kind==="many"?'Expected { _count: "asc" | "desc" }.':`Expected an object naming one field of ${Z.model}.`);let V=X,W=Object.keys(V).filter((L)=>L!=="where");if(W.length!==1)throw new K(G,$.name,z,W.length===0?"Name the field to order by.":`Name exactly one field to order by; got ${W.join(", ")}. `+"Order by several with an array: [{ a: \u2026 }, { b: \u2026 }].");let[M]=W,B=N0($,Z,J,`_o${H}`,`${J.quoteIdent($.table)}.`,z),D=k7($,Z,B.child,M,V[M],z,B.qualifier,J),P=f(B.child,V.where,{dialect:J,operation:z,qualifier:B.qualifier},(L)=>Y(L)?.where),Q=[j(`(select ${D.expression} from ${B.source} where ${B.correlation}`)];if(P)Q.push(j(" and "),P);return Q.push(j(")")),{expression:R(...Q),direction:D.direction,nulls:D.nulls}}function k7($,Z,X,z,J,Y,H,G){let V=`orderBy.${Z.name}.${z}`,{direction:W,nulls:M}=f7($,V,J,Y);if(z===l){if(Z.kind!=="many")throw new K(V,$.name,Y,`${Z.name} is a to-one relation, so its count is 0 or 1. Order by one of ${X.name}'s fields instead.`);return{expression:"count(*)",direction:W,nulls:M}}if(Z.kind==="many")throw new K(V,$.name,Y,`${Z.name} is a to-many relation, so ordering by '${z}' has no single answer for a parent with several children. Only `+"{ _count: \u2026 } is supported.");let B=X.fields[z];if(!B)throw new K(V,$.name,Y,`'${z}' is not a field on ${X.name}. Known fields: ${Object.keys(X.fields).join(", ")}.`);return{expression:`${H}${G.quoteIdent(B.column)}`,direction:W,nulls:M}}function f7($,Z,X,z){if(X==="asc"||X==="desc")return{direction:X};if(typeof X==="object"&&X!==null){let{sort:J,nulls:Y}=X;if(J!=="asc"&&J!=="desc")throw new T(Z,$.name,z,'Expected "asc" or "desc".');if(Y===void 0)return{direction:J};if(Y!=="first"&&Y!=="last")throw new K(`${Z}.nulls`,$.name,z,'Expected "first" or "last".');return{direction:J,nulls:Y}}throw new K(Z,$.name,z,'Expected "asc", "desc", or { sort, nulls }.')}var g7=new Set(["asc","desc"]),y7=new Set(["first","last"]);function D0($,Z,X,z){if(Z===void 0||Z===null)return[];let J=Array.isArray(Z),Y=J?Z:[Z],H=[];for(let G=0;G<Y.length;G++){let V=Y[G],W=(M)=>{let B=z?.locate(M);return J?B?.[G]:B};if(typeof V!=="object"||V===null)throw new T("orderBy",$.name,X,"Expected an object or an array of objects.");for(let[M,B]of Object.entries(V)){if(B===void 0)continue;if(M in $.relations){if(!z)throw new K(`orderBy.${M}`,$.name,X,"Ordering by a relation is not implemented here.");let P=D9($,$.relations[M],B,X,z.dialect,(Q)=>W(Q)?.[M],H.length);H.push({column:M,direction:P.direction,...P.nulls?{nulls:P.nulls}:{},expression:P.expression});continue}let D=$.fields[M];if(!D)throw new g(M,$.name,Object.keys($.fields));H.push({column:D.column,...P9($,M,B,X)})}}return H}function P9($,Z,X,z){if(typeof X==="string"){if(!g7.has(X))throw new T(`orderBy.${Z}: ${JSON.stringify(X)}`,$.name,z,'Expected "asc" or "desc".');return{direction:X}}if(typeof X==="object"&&X!==null){let{sort:J,nulls:Y}=X,H=P9($,Z,J,z).direction;if(Y===void 0)return{direction:H};if(typeof Y!=="string"||!y7.has(Y))throw new K(`orderBy.${Z}.nulls: ${JSON.stringify(Y)}`,$.name,z,'Expected "first" or "last".');return{direction:H,nulls:Y}}throw new K(`orderBy.${Z}`,$.name,z,'Expected "asc", "desc", or { sort, nulls }.')}function V3($){return $.map((Z)=>({...Z,direction:Z.direction==="asc"?"desc":"asc",...Z.nulls?{nulls:Z.nulls==="first"?"last":"first"}:{}}))}function r($,Z,X){if($.length===0)return null;return x($.map((z)=>{let J=` ${z.direction}`+(z.nulls?` nulls ${z.nulls}`:"");if(z.expression)return x([z.expression,j(J)],"");return j(`${X??""}${Z.quoteIdent(z.column)}${J}`)}),", ")}function G3($,Z,X,z,J){if(typeof J!=="number"||!Number.isInteger(J))throw new T(X,$,Z,`Expected an integer, got ${JSON.stringify(J)}.`);if(z==="skip"&&J<0)throw new T(X,$,Z,"A 'skip' counts rows to pass over, so it cannot be negative. Prisma rejects one too.")}function Q0($,Z,X,z,J,Y=!1){if(X?.take!==void 0)G3($.name,Z,"take","take",X.take);if(X?.skip!==void 0)G3($.name,Z,"skip","skip",X.skip);let H=Y?1:X?.take,G=X?.skip,V=J;if((H!==void 0||G!==void 0)&&V.length===0&&!Y)V=$.primaryKey.map((P)=>({column:$.fields[P]?.column??P,direction:"asc"}));let M=typeof H==="number"&&H<0;if(M)V=V3(V);let B=H===void 0?null:Y?()=>1:(P)=>Math.abs(Number(P?.take)),D=G===void 0?null:(P)=>Number(P?.skip);return{clause:z.paginate(B,D),terms:V,reversed:M}}function J0($,Z,X){let z=Z?.select,J=Z?.omit;if(z!==void 0&&Z?.include!==void 0)throw new K("select + include",$.name,X,"Prisma allows only one of them on the same query.");if(z!==void 0&&J!==void 0)throw new K("select + omit",$.name,X,"'select' names what to keep and 'omit' what to drop, so the two describe different column lists. Prisma allows only one of them on "+"the same query. Drop the 'omit' \u2014 a 'select' already excludes "+"everything it does not name.");if(z===void 0||z===null)return h7($,J,X);if(typeof z!=="object"||Array.isArray(z))throw new T("select",$.name,X,"Expected an object.");let Y=[];for(let[G,V]of Object.entries($.fields))if(z[G]===!0)Y.push(V);let H=0;for(let G of Object.keys(z)){let V=z[G];if(V===void 0)continue;if(G in $.relations){if(V!==!1)H++;continue}if(G===l){if(V!==!1)H++;continue}if(!(G in $.fields))throw new g(G,$.name,Object.keys($.fields));if(typeof V!=="boolean")throw new T(`select.${G}`,$.name,X,"Expected true or false.")}if(Y.length===0&&H===0)throw new K("select",$.name,X,"At least one field must be selected.");return Y}function h7($,Z,X){if(Z===void 0||Z===null)return Object.values($.fields);if(typeof Z!=="object"||Array.isArray(Z))throw new T("omit",$.name,X,"Expected an object of fields.");let z=new Set;for(let Y of Object.keys(Z)){let H=Z[Y];if(H===void 0)continue;if(Y in $.relations)throw new K(`omit.${Y}`,$.name,X,`'${Y}' is a relation, not a column. A relation is already absent unless an 'include' asks for it.`);if(!(Y in $.fields))throw new g(Y,$.name,Object.keys($.fields));if(typeof H!=="boolean")throw new T(`omit.${Y}`,$.name,X,"Expected true or false.");if(H)z.add(Y)}let J=Object.values($.fields).filter((Y)=>!z.has(Y.name));if(J.length===0)throw new K("omit",$.name,X,`It omits every field on ${$.name}, which leaves no column to select. Prisma rejects that too.`);return J}function W3($,Z,X){if(X.length===0)return{fields:Z};let z=new Set(Z.map((H)=>H.name)),J=X.filter((H)=>!z.has(H));if(J.length===0)return{fields:Z};let Y=new Set([...z,...J]);return{fields:Object.values($.fields).filter((H)=>Y.has(H.name)),hidden:J}}var j9=new Set(["where","orderBy","select","omit","include","take","skip"]),K9=new Set(["where","select","omit","include"]),D3=10;function m0($){return[...new Set($.map((Z)=>Z.strategy))].sort()}function S0($,Z,X,z,J=P0){let Y=p0($,Z,z);if(Y.length===0)return{plans:[],keyFields:[]};let H=[],G=new Set;for(let V of Y){T9($,V,z);let W=U9($,V);R9(W,V.node,z,2);let M=J.plan({parent:$,child:W,relation:V.relation,as:V.as,node:V.node,locate:V.locate,dialect:X,operation:z});H.push(M);for(let B of M.parentFields)G.add(B)}return{plans:H,keyFields:[...G]}}async function j3($,Z,X,z,J){let Y=Array.isArray(X)?X:X===null||X===void 0?[]:[X];if(Y.length===0)return;for(let H of $){if(H.root)continue;await H.load(Y,z,J)}if(Z&&Z.length>0)for(let H of Y)for(let G of Z)delete H[G]}function p0($,Z,X){if(Z===void 0||Z===null)return[];let{include:z,select:J}=Z;C9($,z,J,X);let Y=[];if(z!==void 0&&z!==null){if(typeof z!=="object"||Array.isArray(z))throw new T("include",$.name,X,"Expected an object.");for(let H of Object.keys(z).sort()){let G=z[H];if(G===void 0||G===!1)continue;if(H===l)continue;let V=$.relations[H];if(!V)throw new y0(H,$.name,Object.keys($.relations));Y.push({as:H,relation:V,node:G,locate:(W)=>W?.include?.[H]})}return Y}if(J!==void 0&&J!==null&&typeof J==="object")for(let H of Object.keys(J).sort()){let G=J[H];if(G===void 0||G===!1)continue;let V=$.relations[H];if(!V)continue;Y.push({as:H,relation:V,node:G,locate:(W)=>W?.select?.[H]})}return Y}function C9($,Z,X,z,J){if(Z===void 0||X===void 0)return;throw new K(J?`${J}: select + include`:"select + include",$.name,z,"Prisma allows only one of them on the same query, at any level.")}function T9($,Z,X){let z=Z.node;if(z===!0)return;if(typeof z!=="object"||z===null||Array.isArray(z))throw new T(Z.as,$.name,X,"Expected true or an object of relation arguments.");let J=z;C9($,J.include,J.select,X,Z.as);let Y=Z.relation.kind==="many";for(let H of Object.keys(J).sort()){if(J[H]===void 0)continue;if(Y&&(H==="take"||H==="skip")){u7($,Z,X,H,J[H]);continue}if(Y?j9.has(H):K9.has(H))continue;if(H==="lock")throw new g0(`${Z.as}.lock`,$.name,X,"'lock' locks the rows of the model being queried, not an included relation's. Lock the related rows with their own locking read in the same transaction.");if(H==="orderBy"&&!Y)throw new K(`${Z.as}.orderBy`,$.name,X,"Prisma does not accept 'orderBy' on a to-one relation \u2014 there is at "+"most one row to order.");if(H==="take"||H==="skip")throw new K(`${Z.as}.${H}`,$.name,X,`Prisma does not accept '${H}' on a to-one relation.`);throw new K(`${Z.as}.${H}`,$.name,X,`A relation node takes ${[...Y?j9:K9].sort().join(", ")}.`)}}function u7($,Z,X,z,J){G3($.name,X,`${Z.as}.${z}`,z,J)}function n3($,Z){let X=$.node;if(typeof X!=="object"||X===null||Array.isArray(X))return;for(let z of["take","skip"]){if(X[z]===void 0)continue;throw new K(`${$.as}.${z}`,$.parent.name,$.operation,`A '${z}' inside a to-many relation is per parent, and the batched `+"relation planner serves every parent from one query \u2014 so the only "+`limit it could emit would page every parent's children as one set. Only the lateral join strategy can express it, by paginating inside a subquery that already runs once per parent row, and it needs Postgres: ${Z}. Load '${$.as}' as its own query, or narrow it with 'where'.`)}}function R9($,Z,X,z){if(typeof Z!=="object"||Z===null||Array.isArray(Z))return;if(Z.select!==void 0)J0($,Z,X);let J=p0($,Z,X);if(J.length===0)return;if(z>D3)throw new s3($.name,D3);for(let Y of J)T9($,Y,X),R9(U9($,Y),Y.node,X,z+1)}function I9($,Z,X,z){if($.parentFields.length!==1)throw new K(X.name,Z.name,z,`${X.name} joins on ${$.parentFields.length} fields (${$.parentFields.join(", ")}), and it is planned through a join table, which links two models by a single primary key each side. Prisma does not build an implicit many-to-many over a composite key.`);return{parentField:$.parentFields[0],childField:$.childFields[0],join:$.join}}function B0($,Z,X,z){if(X.joinTable)return p7($,Z,X);if(X.from.length>0)return Q9($,X,X.from,X.to,z);let J=m7($,Z,X);if(J.from.length===0)throw new s($.name,X.name,`neither ${$.name}.${X.name} nor ${Z.name}.${J.name} holds the foreign key.`);return Q9($,X,J.to,J.from,z)}function Q9($,Z,X,z,J){if(X.length===0)throw new K(Z.name,$.name,J,`${Z.name} names no join fields.`);if(X.length!==z.length)throw new s($.name,Z.name,`it joins ${X.length} field(s) to ${z.length}: ${X.join(", ")} against ${z.join(", ")}.`);return{parentFields:X,childFields:z}}function m7($,Z,X){let z=Object.values(Z.relations).filter((J)=>J.relationName===X.relationName&&!(Z.name===$.name&&J.name===X.name));if(z.length!==1)throw new s($.name,X.name,z.length===0?`${Z.name} declares no relation named '${X.relationName}'.`:`${Z.name} declares ${z.length} relations named '${X.relationName}'.`);return z[0]}function p7($,Z,X){let{table:z,a:J,b:Y}=X.joinTable;if(J===Y){let G=X.joinTable.ownerColumn;if(!G)throw new K(X.name,$.name,"include",`${X.name} is a self-referential implicit many-to-many, and the generated artifact predates support for one. Re-run \`prisma generate\`.`);return{parentFields:[M3($,X)],childFields:[M3(Z,X)],join:{table:z,parentColumn:G,childColumn:G==="A"?"B":"A"}}}if($.name!==J&&$.name!==Y)throw new s($.name,X.name,`the join table '${z}' connects ${J} and ${Y}, neither of which is ${$.name}.`);let H=$.name===J?"A":"B";return{parentFields:[M3($,X)],childFields:[M3(Z,X)],join:{table:z,parentColumn:H,childColumn:H==="A"?"B":"A"}}}function M3($,Z){if($.primaryKey.length!==1)throw new s($.name,Z.name,`an implicit many-to-many joins on ${$.name}'s primary key, which has ${$.primaryKey.length} fields.`);return $.primaryKey[0]}function B3($,Z,X){let z=$.fields[X];if(!z)throw new s($.name,Z.name,`it joins on '${X}', which is not a field on ${$.name}.`);return z}function U9($,Z){return X0($,Z.relation,Z.as)}function X0($,Z,X=Z.name){let z=Z.model;if(!a(z))throw new i3($.name,X,z,P3());let J=d(z)?.$schema;if(!J)throw new h0(z);return J}var _9="batched",P0={name:_9,plan($){n3($,"this query planned with the batched strategy");let Z=B0($.parent,$.child,$.relation,$.operation);for(let Y of Z.parentFields)L9($.parent,$.relation,B3($.parent,$.relation,Y));for(let Y of Z.childFields)L9($.child,$.relation,B3($.child,$.relation,Y));let X=B3($.parent,$.relation,Z.parentFields[0]),z=B3($.child,$.relation,Z.childFields[0]),J=$.relation.kind==="many";return{as:$.as,model:$.relation.model,kind:$.relation.kind,parentFields:Z.parentFields,strategy:_9,load(Y,H,G){let V={parentKeyField:X,childKeyField:z,many:J,parents:Y,args:H,executor:G};return Z.join?c7($,Z,V):d7($,Z,V)}}}};async function d7($,Z,X){let{keys:z,byKey:J}=O9(X.parents,Z.parentFields);if(z.length===0)return;let Y=$.locate(X.args),H=N9(Y,Z.childFields,z,$.child,$.dialect),G=await X.executor.exec($.relation.model,"findMany",H.args,!0);for(let V of G){let W=J.get(f0(Z.childFields.map((M)=>V[M])));if(!W)continue;for(let M of W)F9(M,$.as,V,X.many)}if(H.hidden)for(let V of G)for(let W of Z.childFields)delete V[W]}async function c7($,Z,X){let{keys:z,byKey:J}=O9(X.parents,Z.parentFields);if(z.length===0)return;let{dialect:Y}=$,H=Z.join,G=await s7(Y,H,z.map((P)=>Y.encode(P[0],X.parentKeyField)),X.executor),V=new Map,W=[];for(let P of G){let Q=f0([Y.decode(P[H.parentColumn],X.parentKeyField)]),L=J.get(Q);if(!L)continue;let F=Y.decode(P[H.childColumn],X.childKeyField),N=f0([F]),C=V.get(N);if(C===void 0)C=[],V.set(N,C),W.push([F]);for(let _ of L)C.push(_)}if(W.length===0)return;let M=$.locate(X.args),B=N9(M,Z.childFields,W,$.child,$.dialect),D=await X.executor.exec($.relation.model,"findMany",B.args,!0);for(let P of D){let Q=V.get(f0([P[Z.childFields[0]]]));if(!Q)continue;for(let L of Q)F9(L,$.as,P,X.many)}if(B.hidden)for(let P of D)delete P[Z.childFields[0]]}async function s7($,Z,X,z){let J=R(j(`select ${$.quoteIdent(Z.parentColumn)}, ${$.quoteIdent(Z.childColumn)} from ${$.quoteIdent(Z.table)} where `),$.inList($.quoteIdent(Z.parentColumn),!1,X.length,()=>X)),{text:Y,binders:H}=c(J,$,{model:Z.table,operation:"include"}),G=A0();return z.query(Y,H.map((V)=>V(void 0,G)))}function N9($,Z,X,z,J){let Y=$===!0||$===null||typeof $!=="object"?{}:$,H=Z.length===1?{[Z[0]]:{in:X.map((B)=>B[0])}}:i7(z,Z,X,J),G={where:Y.where===void 0?H:{AND:[Y.where,H]}};if(Y.orderBy!==void 0)G.orderBy=Y.orderBy;if(Y.include!==void 0)G.include=Y.include;let V=Y.omit;if(V!==void 0){let B=Z.filter((D)=>V[D]===!0);if(B.length===0)G.omit=V;else{let D={...V};for(let P of B)delete D[P];return G.omit=D,{args:G,hidden:!0}}}let W=Y.select;if(W===void 0)return{args:G,hidden:!1};let M=Z.filter((B)=>W[B]!==!0);if(M.length===0)return G.select=W,{args:G,hidden:!1};G.select={...W};for(let B of M)G.select[B]=!0;return{args:G,hidden:!0}}function i7($,Z,X,z){let J=Z.map((Y)=>$.fields[Y]?.type);if(J.every((Y)=>Y!==void 0)&&z.canBindCompositeIn(J))return{[z0]:W9(Z,X)};return{OR:X.map((Y)=>Object.fromEntries(Z.map((H,G)=>[H,Y[G]])))}}function f0($){return JSON.stringify($.map(n7))}function F9($,Z,X,z){if(z){$[Z].push(X);return}if($[Z]===null)$[Z]=X}function O9($,Z){let X=new Map,z=[];for(let J of $){let Y=Z.map((V)=>J[V]);if(Y.some((V)=>V===null||V===void 0))continue;let H=f0(Y),G=X.get(H);if(G===void 0)G=[],X.set(H,G),z.push(Y);G.push(J)}return{keys:z,byKey:X}}function n7($){if(typeof $!=="object"||$===null)return $;if($ instanceof Date)return $.getTime();if(ArrayBuffer.isView($)){let Z=new Uint8Array($.buffer,$.byteOffset,$.byteLength),X="";for(let z of Z)X+=z.toString(16).padStart(2,"0");return`bytes:${X}`}throw Error(`Cannot key a relation stitch on ${Object.prototype.toString.call($)}.`)}function L9($,Z,X){if(X.isList)throw new s($.name,Z.name,`it joins on '${X.name}', a ${X.type} list \u2014 which decodes to a new `+"array per row and so cannot be compared between the two sides.");if(X.type!=="Json")return;throw new s($.name,Z.name,`it joins on '${X.name}', a ${X.type} \u2014 which decodes to a new object `+"per row and so cannot be compared between the two sides.")}var A9=(()=>{try{return Function("return 1")()===1}catch{return!1}})(),S9=!0;function l7($){S9=$}function o7(){return A9}function d0($,Z,X=[]){if(A9&&S9)return t7($,Z,X);return l3($,Z,X)}function l3($,Z,X=[]){let z=$.map((G)=>({key:G.name,column:G.column,field:G,decode:Z.needsDecode(G)})),J=z.length,Y=X.map((G)=>({key:G.key,many:G.kind==="many"})),H=Y.length;return(G)=>{let V=[];for(let W=0;W<G.length;W++){let M=G[W],B={};for(let D=0;D<J;D++){let P=z[D],Q=M[P.column];B[P.key]=P.decode?Z.decode(Q,P.field):Q??null}for(let D=0;D<H;D++)B[Y[D].key]=Y[D].many?[]:null;V.push(B)}return V}}function t7($,Z,X){let z=[];for(let Y=0;Y<$.length;Y++){let H=$[Y],G=JSON.stringify(H.name),V=JSON.stringify(H.column);z.push(Z.needsDecode(H)?`${G}: d.decode(row[${V}], f[${Y}])`:`${G}: row[${V}] ?? null`)}for(let Y of X)z.push(`${JSON.stringify(Y.key)}: ${Y.kind==="many"?"[]":"null"}`);let J=`
|
|
2
|
+
import{qa as g6}from"../chunk-c250kpcm.js";import{$a as w0,Ua as J9,Va as Y9,Wa as l,Xa as b9,Ya as E3,Za as E6,_a as w6,ab as e5,bb as w3,cb as x6,db as X3,eb as I0,fb as Z7,gb as X7,hb as z7,ib as d5,jb as J7,kb as Y7,lb as H7,mb as v6,nb as k6,ob as f6}from"../chunk-cw50n89n.js";import{Mh as O6,Nh as A6,Oh as S6,Ph as b6,Qh as q6}from"../chunk-nrv7hdeh.js";import{$h as T6,Rh as A0,Sh as o,Th as j,Uh as n,Xh as R,Yh as x,Zh as c,_h as C6,ai as Y5,bi as R6,ci as p3,di as k,ei as I6,fi as U6,gi as N6,hi as F6,ii as a5}from"../chunk-cmyt2txd.js";import"../chunk-gf3m0866.js";import{Wj as G6,Xj as a,Yj as d,Zj as P3,_j as u0,ak as _6,bk as L6,gk as t4,hk as r4,ik as a4,jk as e4,kk as $7}from"../chunk-s4sx97fn.js";import{Ak as H6,Bk as i5,Ck as R3,Dk as y0,Ek as s3,Fk as i3,Gk as s,Hk as V6,Ik as h0,Jk as n5,lk as K,mk as T,nk as g0,ok as g,pk as $6,qk as $0,rk as Z6,sk as c5,tk as X6,uk as T5,vk as z6,xk as J6,yk as s5,zk as Y6}from"../chunk-w4aw44zg.js";import{bl as B6,cl as E0,dl as T0,el as Z3,hl as D6,il as l4,kl as P6,ll as j6,ml as l5,nl as o5,ol as p5,pl as b3,ql as K6,rl as t5,sl as r5,tl as Q6,ul as o4}from"../chunk-xyv3y476.js";import{Hl as W6,Jl as M6,Ll as S3}from"../chunk-qa528feb.js";import{jm as A3}from"../chunk-aes0ecnp.js";import"../chunk-sba3s380.js";import"../chunk-yedb5vvg.js";function N0($,Z,X,z,J,Y){let H=X0($,Z),G=B0($,H,Z,Y),V=X.quoteIdent(z),W=`${V}.`,M=G.parentFields.map((Q,L)=>{let F=`${W}${X.quoteIdent(z3(H,Z,G.childFields[L]))}`,N=`${J}${X.quoteIdent(z3($,Z,Q))}`;return`${F} = ${N}`}).join(" and ");if(!G.join)return{child:H,source:`${X.quoteIdent(H.table)} as ${V}`,correlation:M,qualifier:W};let B=`${W}${X.quoteIdent(z3(H,Z,G.childFields[0]))}`,D=`${J}${X.quoteIdent(z3($,Z,G.parentFields[0]))}`,P=X.quoteIdent(`${z}j`);return{child:H,source:`${X.quoteIdent(H.table)} as ${V} join ${X.quoteIdent(G.join.table)} as ${P} on ${P}.${X.quoteIdent(G.join.childColumn)} = ${B}`,correlation:`${P}.${X.quoteIdent(G.join.parentColumn)} = ${D}`,qualifier:W}}function z3($,Z,X){let z=$.fields[X];if(!z)throw new s($.name,Z.name,`it joins on '${X}', which is not a field on ${$.name}.`);return z.column}function u($,Z,X){let z=J3($);if(typeof Z!=="object"||Z===null||Array.isArray(Z))throw X9($,X,z);let J=Object.keys(Z).filter((H)=>Z[H]!==void 0),Y=Z;for(let H of z){if(H.length===1&&J.includes(H[0]))return Z9($,X,H[0],Y[H[0]]),H;let G=H.join("_");if(H.length>1&&J.includes(G)){let V=Y[G];if(V&&typeof V==="object"&&!Array.isArray(V))for(let W of H)Z9($,X,`${G}.${W}`,V[W]);return H}}throw X9($,X,z)}function f3($){if($===null||$===void 0)return!1;let Z=typeof $;if(Z!=="object")return Z!=="function"&&Z!=="symbol";if(Array.isArray($))return!1;if($ instanceof Date||ArrayBuffer.isView($))return!0;let X=Object.getPrototypeOf($);return X!==Object.prototype&&X!==null}function Z9($,Z,X,z){if(z===void 0||f3(z))return;throw new T(`${Z.argument}.${X}`,Z.model,Z.operation,`A unique key takes a plain value to match, not ${z===null?"null":Array.isArray(z)?"an array":"a filter object"}. Use findFirst/findMany (or updateMany/deleteMany) to filter on ${$.name}.${X.split(".").pop()}.`)}function g3($,Z,X){u($,Z,{model:$.name,operation:X,argument:"where"})}function J3($){let Z=[];if($.primaryKey.length>0)Z.push($.primaryKey);for(let X of $.uniques)Z.push(X);return Z}function X9($,Z,X){let z=X.map((H)=>H.length===1?H[0]:H.join("_")).join(", "),Y=Z.argument.startsWith("data.")?`Name it by one of those, or reach it through the ${$.name} model directly.`:`Use ${Z.operation==="delete"||Z.operation==="update"?`${Z.operation}Many`:"findFirst"} to query on anything else.`;return new K(Z.argument,Z.model,Z.operation,`${$.name} needs a unique field here. It declares: ${z}. ${Y}`)}function y($,Z,X){let z=Z.castParameter($);if(!z)return n(X);return n((J,Y)=>{let H=X(J,Y);if(H===null||H===void 0)return null;let G=k(H);if(G==="db")return null;if(G==="json")return"null";if(G==="any")throw Error("gemi ORM bug: Prisma.AnyNull reached the parameter binder. It is a filter operand only, and both the filter and write paths are supposed to have handled it before this point.");return JSON.stringify(H)},z)}function f($,Z,X,z){if(Z===void 0||Z===null)return null;if(typeof Z!=="object"||Array.isArray(Z))throw new T("where",$.name,X.operation,"Expected an object.");let J=[];for(let Y of Object.keys(Z).sort()){let H=Z[Y];if(H===void 0)continue;let G=(W)=>z(W)?.[Y];if(Y==="AND"||Y==="OR"){let W=z9($,H,X,G,Y);if(W)J.push(W);continue}if(Y===z0){J.push(_7($,H,X,G));continue}if(Y==="NOT"){let W=z9($,H,X,G,"AND");if(W)J.push(R(j("not "),v0(W)));continue}if(Y in $.relations){let W=j7($,$.relations[Y],H,X,G);if(W)J.push(W);continue}let V=$.fields[Y];if(!V){let W=Q7($,Y,H,X,G);if(W){J.push(W);continue}throw new g(Y,$.name,Object.keys($.fields))}J.push(d3($,V,H,X,G))}if(J.length===0)return null;if(J.length===1)return J[0];return t(J," and ")}function j7($,Z,X,z,J){let Y=J9(Z.kind),H=K7($,Z,X,Y,z),G=z.relationDepth??0,V=z.dialect,W=z.qualifier??`${V.quoteIdent($.table)}.`,M=N0($,Z,V,`_r${G}`,W,z.operation),B=M.child,D=j(M.correlation),P={...z,qualifier:M.qualifier,relationDepth:G+1},Q=[];for(let L of Y){if(!(L in H))continue;let F=H[L],N=(I)=>H.direct?J(I):J(I)?.[L];if(F===null){Q.push(y3(M,D,null,L==="is"));continue}let C=f(B,F,P,N);if(L==="every"){if(!C)continue;Q.push(y3(M,D,R(j("not "),v0(C)),!0));continue}let _=L==="none"||L==="isNot";Q.push(y3(M,D,C,_))}if(Q.length===0)return null;if(Q.length===1)return Q[0];return t(Q," and ")}function y3($,Z,X,z){let J=[j(`${z?"not ":""}exists (select 1 from ${$.source} where `),Z];if(X)J.push(j(" and "),X);return J.push(j(")")),R(...J)}function K7($,Z,X,z,J){let Y=`where.${Z.name}`,H=Z.kind==="many";if(X===null){if(H)throw new K(Y,$.name,J.operation,`${Z.name} is a to-many relation, so null is not a filter for it. Use { none: {} } for "has no related rows".`);return{is:null,direct:!0}}if(typeof X!=="object"||Array.isArray(X))throw new T(Y,$.name,J.operation,H?`Expected an object holding ${z.join(", ")}.`:"Expected an object, or null.");if(Y9(X,z))return X;if(H)throw new K(Y,$.name,J.operation,`Expected one of ${z.join(", ")}. A to-many relation has no `+"single reading of a bare filter \u2014 { some: \u2026 } and { every: \u2026 } mean "+"different things.");return{is:X,direct:!0}}function Q7($,Z,X,z,J){let Y=J3($).find((V)=>V.length>1&&V.join("_")===Z);if(!Y)return null;if(typeof X!=="object"||X===null||Array.isArray(X))throw new T(`where.${Z}`,$.name,z.operation,`Expected an object holding ${Y.join(" and ")}.`);let H=X,G=[];for(let V of Y){if(H[V]===void 0)throw new K(`where.${Z}`,$.name,z.operation,`Missing '${V}'. A composite key needs all of ${Y.join(", ")}.`);if(!f3(H[V]))throw new T(`where.${Z}.${V}`,$.name,z.operation,`A composite key takes a plain value for each of ${Y.join(", ")}, not a filter, an array or null.`);G.push(d3($,$.fields[V],H[V],z,(W)=>J(W)?.[V]))}return G.length===1?G[0]:t(G," and ")}function z9($,Z,X,z,J){let Y=[];if(Array.isArray(Z))for(let H=0;H<Z.length;H++){let G=f($,Z[H],X,(V)=>z(V)?.[H]);if(G)Y.push(G)}else{let H=f($,Z,X,z);if(H)Y.push(H)}if(Y.length===0)return J==="AND"?null:H9;if(Y.length===1)return Y[0];return t(Y,J==="AND"?" and ":" or ")}var H9=j("false");function t($,Z){return R(j("("),x($,Z),j(")"))}function v0($){return $.text.startsWith("(")?$:t([$],"")}var m3=new Set(["equals","not","in","notIn","lt","lte","gt","gte","contains","startsWith","endsWith","mode"]),V9={lt:"<",lte:"<=",gt:">",gte:">="},z0="$compositeIn",G9=Symbol("gemi.orm.compositeInFromPlanner");function W9($,Z){return{[G9]:!0,fields:$,values:Z}}function _7($,Z,X,z){let{dialect:J}=X,H=L7($,Z,X).map((V)=>{let W=$.fields[V];if(!W)throw new g(V,$.name,Object.keys($.fields));return W}),G=H.map((V)=>`${X.qualifier??""}${J.quoteIdent(V.column)}`);return J.compositeIn(G,H.map((V)=>V.type),(V)=>z(V).values)}function L7($,Z,X){let z=()=>{throw new g(z0,$.name,Object.keys($.fields))};if(typeof Z!=="object"||Z===null||Array.isArray(Z))return z();if(Z[G9]!==!0)return z();let J=(G)=>{throw new K(z0,$.name,X.operation,G)},{fields:Y,values:H}=Z;if(!Array.isArray(Y)||Y.length===0)return J(`the planner built a '${z0}' with no fields.`);if(!Y.every((G)=>typeof G==="string"))return J(`the planner built a '${z0}' with a non-string field.`);if(!Array.isArray(H))return J(`the planner built a '${z0}' with no values.`);if(!H.every((G)=>Array.isArray(G)&&G.length===Y.length))return J(`the planner built a '${z0}' whose tuples do not all have ${Y.length} value(s).`);return Y}var C7=["equals","has","hasEvery","hasSome","isEmpty"],h3=new Set(C7);function T7($,Z,X,z,J,Y){let{dialect:H}=J;if(O0($,Z,`where.${Z.name}`,J.operation,H),Array.isArray(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a bare array is not a filter on `+"one \u2014 Prisma rejects it here too. Say which comparison you mean: "+`{ ${Z.name}: { equals: [...] } } for the whole list, or { ${Z.name}: { hasEvery: [...] } } for "contains all of these". A bare array *is* accepted as a value in \`data\`.`);if(!c3(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list. Expected an object holding ${[...h3].sort().join(", ")}; received ${z===null?"null":typeof z}.`);let G=z,V=[];for(let W of Object.keys(G).sort()){let M=G[W];if(M===void 0)continue;if(!h3.has(W))throw new T(`where.${Z.name}.${W}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a list filter takes ${[...h3].sort().join(", ")}. The scalar operators \u2014 `+`${[...m3].sort().join(", ")} \u2014 apply to a single value and `+"Prisma does not offer them here.");let B=(D)=>Y(D)?.[W];V.push(R7($,Z,X,W,M,J,B))}if(V.length===0)return j("true");if(V.length===1)return V[0];return t(V," and ")}function R7($,Z,X,z,J,Y,H){let{dialect:G}=Y;if(z==="equals")return I7($,Z,X,J,Y,H);if(z==="isEmpty"){if(typeof J!=="boolean")throw new T(`where.${Z.name}.isEmpty`,$.name,Y.operation,`Expected true or false, received ${J===null?"null":typeof J}.`);return G.listIsEmpty(X,J)}if(z==="has"){let W=U7(Z);return G.listHas(X,y(W,G,F0(W,G,H)))}if(!Array.isArray(J))throw new T(`where.${Z.name}.${z}`,$.name,Y.operation,`Expected an array, received ${J===null?"null":typeof J}.`);let V=y(Z,G,F0(Z,G,H));return z==="hasEvery"?G.listHasEvery(X,V):G.listHasSome(X,V)}function I7($,Z,X,z,J,Y){let{dialect:H}=J;if(z===null)return j(`${X} is null`);if(!Array.isArray(z))throw new T(`where.${Z.name}.equals`,$.name,J.operation,`'${Z.name}' is a scalar list, so it compares against an array. Received ${typeof z}. For "is this element present", use { ${Z.name}: { has: \u2026 } }.`);return R(j(`${X} = `),y(Z,H,F0(Z,H,Y)))}function U7($){return{...$,isList:!1}}function O0($,Z,X,z,J){if(J.listFilters.size>0)return;throw new K(X,$.name,z,`'${Z.name}' is a scalar list, and ${J.name} has no array type to hold one. Prisma refuses the column itself on ${J.name} \u2014 `+'"the current connector does not support lists of primitive types" \u2014 so '+`this is a difference between the databases rather than a gap in the ORM. The generated artifact is dialect-agnostic, which is why this surfaces here rather than at \`prisma generate\`: the schema was generated against Postgres and DATABASE_URL names a ${J.name} database, which has no '${Z.column}' column either. It works on postgres.`)}var N7=["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"],u3=new Set(N7),F7=["has_key","has_some_keys","has_every_key"],Y3=new Set(F7);function M9($,Z,X,z,J,Y,H,G){let V=z!=="has_key",W=`where.${Z.name}.${z}`,M=(D)=>{if(!(V?Array.isArray(D)&&D.every((Q)=>typeof Q==="string"):typeof D==="string"))throw new T(W,$.name,Y.operation,V?"Expected an array of key names, like ['a', 'b'].":"Expected a key name, like 'a'.");return D};M(J);let B=(D,P)=>M(G(D,P));return Y.dialect.jsonHasKeys(X,H,B,z==="has_key"?"one":z==="has_some_keys"?"some":"every",Array.isArray(J)?J.length:0)}function O7($,Z,X,z,J,Y){let{dialect:H}=J;if(Z.type!=="Json")throw new K(`${Z.name}.path`,$.name,J.operation,`A 'path' filter reads inside a JSON document, and '${Z.name}' is a ${Z.type} column.`);q7($,Z,z.path,J);let G=(M)=>Y(M)?.path,V=Object.keys(z).filter((M)=>M!=="path"&&z[M]!==void 0).sort();if(V.length===0)throw new K(`${Z.name}.path`,$.name,J.operation,`A 'path' needs a filter beside it \u2014 ${[...u3,...Y3].sort().join(", ")}. Prisma refuses a bare path too.`);let W=[];for(let M of V){if(Y3.has(M)){W.push(M9($,Z,X,M,z[M],J,G,(P)=>Y(P)?.[M]));continue}if(!u3.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`A JSON path filter takes ${[...u3,...Y3].sort().join(", ")}.`);if(!H.jsonFilters.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`'${M}' on a JSON path is not available on ${H.name}. Prisma refuses it here too, so this is a difference between the databases rather than a gap in the ORM. It works on postgres.`);let B=z[M],D=B===null?"json":k(B);if(D&&(M==="equals"||M==="not")){W.push(A7(D,X,G,Z,H,M==="not"));continue}if(D&&B!==null){let P=M==="array_contains"?"'array_contains' tests containment against a document, and a sentinel is not one":`'${M}' compares an extracted value against a scalar, and a sentinel is not one`;throw new T(`where.${Z.name}.${M}`,$.name,J.operation,`${k0(D)} asks which kind of null a value is, which `+`only 'equals' and 'not' can express \u2014 ${P}. Prisma refuses it under this operator too. Write { ${Z.name}: { path: [\u2026], equals: ${k0(D)} } }, `+"or filter the column itself \u2014 "+`{ ${Z.name}: { equals: ${k0(D)} } }.`)}if(B9(B))throw new T(`where.${Z.name}.${M}`,$.name,J.operation,"Prisma.AnyNull is a question rather than a value \u2014 'either kind of "+"null' \u2014 so it cannot appear inside a document. Ask it directly: "+`{ ${Z.name}: { path: [\u2026], equals: Prisma.AnyNull } }.`);S7(M,B,$,Z,J),W.push(b7(M,X,G,Z,H,(P)=>Y(P)?.[M]))}return W.length===1?W[0]:t(W," and ")}function A7($,Z,X,z,J,Y){let H=()=>R(J.jsonValueAt(Z,X),j(Y?" is not null":" is null")),G=()=>R(J.jsonValueAt(Z,X),j(Y?" <> ":" = "),y(z,J,()=>J.encode(p3,z)));if($==="db")return H();if($==="json")return G();return t([G(),H()],Y?" and ":" or ")}function S7($,Z,X,z,J){let Y=$==="string_contains"||$==="string_starts_with"||$==="string_ends_with";if(Y&&typeof Z!=="string")throw new T(`where.${z.name}.${$}`,X.name,J.operation,`Expected a string, received ${Z===null?"null":typeof Z}. Prisma raises here too \u2014 without this the pattern becomes `+`'%${String(Z)}%', which runs and returns the wrong rows.`);if(Z===null)throw new T(`where.${z.name}.${$}`,X.name,J.operation,$==="array_contains"?"null cannot be tested for containment through a JSON path: the operand binds as SQL NULL rather than as the JSON value, and "+"'x @> NULL' is NULL rather than true \u2014 the query would run and "+`match nothing. A null *inside* the document is an ordinary value and still compiles: { ${z.name}: { path: [\u2026], array_contains: [null] } }.`:`null cannot be compared through a JSON path with '${$}', which `+"compares the extracted value as a number \u2014 the comparison against "+`NULL is NULL rather than true, so the query would run and match nothing. Prisma refuses it here too. For "the value at this path is a JSON null", use equals or not: { ${z.name}: { path: [\u2026], equals: null } }.`);if($==="array_contains"||Y)return;if(typeof Z==="object")throw new K(`where.${z.name}.${$}`,X.name,J.operation,`'${$}' on a JSON path compares the extracted value as a scalar, so `+"an object or array operand cannot be expressed \u2014 it would bind as "+`'${String(Z)}' and match nothing. Prisma accepts one here; gemi does not yet. Use array_contains for containment, or narrow the path until it names a scalar.`)}function b7($,Z,X,z,J,Y){if($==="array_contains")return J.jsonArrayContains(Z,X,Y);let H=$==="string_contains"||$==="string_starts_with"||$==="string_ends_with",G=J.jsonExtract(Z,X,!0);if(H){let B=$==="string_contains"?(D)=>`%${D}%`:$==="string_starts_with"?(D)=>`${D}%`:(D)=>`%${D}`;return R(j("("),G,j(") like "),n((D,P)=>{let Q=Y(D,P);return Q===null||Q===void 0?null:B(String(Q))}))}let V=$==="equals"?"=":$==="not"?"<>":V9[$],W=$!=="equals"&&$!=="not",M=W?R(j("cast(("),G,j(") as real)")):R(j("("),G,j(")"));return R(M,j(` ${V} `),n((B,D)=>{let P=Y(B,D);if(P===null||P===void 0)return null;if(W)return Number(P);return J.jsonComparesAsText?String(P):P}))}function q7($,Z,X,z){let{dialect:J}=z,Y=J.jsonPathSyntax==="array"?"array":"jsonpath",H=Array.isArray(X)?"array":typeof X==="string"?"jsonpath":"other";if(Array.isArray(X)&&X.length===0||X==="")throw new K(`${Z.name}.path`,$.name,z.operation,`A JSON path cannot be empty. ${J.jsonPathSyntax==="array"?`On ${J.name} an empty array selects the whole document, `+"which is a filter on the column rather than on a path \u2014 write "+`{ ${Z.name}: { equals: \u2026 } } if that is what you meant.`:`On ${J.name} an empty string raises inside json_extract.`}`);if(H===Y){if(Y!=="array")return;let V=X.findIndex((B)=>typeof B!=="string");if(V===-1)return;let W=X[V],M=W===null?"null":W===void 0?"undefined":Array.isArray(W)?"an array":typeof W==="object"?"an object":`a ${typeof W}`;throw new K(`${Z.name}.path`,$.name,z.operation,`A JSON path is an array of strings, and path[${V}] is ${M}. `+(typeof W==="number"?'An array index is a key too \u2014 write ["items", "0"] rather than '+`["items", 0]; it reaches the same element, because ${J.name} takes the path as text. Prisma's path is string[] and its client refuses a number here too.`:"Prisma's path is string[] too."))}throw new K(`${Z.name}.path`,$.name,z.operation,J.jsonPathSyntax==="array"?`On ${J.name} a JSON path is an array of keys \u2014 ["a", "b"] \u2014 `+"not a JSONPath string. Prisma splits them the same way, and refuses the other form on each database.":`On ${J.name} a JSON path is a JSONPath string \u2014 "$.a.b" \u2014 not `+"an array of keys. Prisma splits them the same way, and refuses the other form on each database.")}function d3($,Z,X,z,J){let{dialect:Y}=z,H=`${z.qualifier??""}${Y.quoteIdent(Z.column)}`,G=k(X);if(G)throw new T(`where.${Z.name}`,$.name,z.operation,`${k0(G)} is not a filter on `+"its own \u2014 Prisma rejects it here too. Write it as an explicit "+`comparison: { ${Z.name}: { equals: ${k0(G)} } }.`);if(Z.isList)return T7($,Z,H,X,z,J);if(!c3(X))return H3(H,Z,X,Y,J);let V=X,W=Object.keys(V).sort();if(V.path!==void 0)return O7($,Z,H,V,z,J);let M=V.mode==="insensitive";if(V.mode!==void 0&&V.mode!=="default"){if(!M)throw new T(`mode: ${JSON.stringify(V.mode)}`,$.name,z.operation,"Prisma takes 'default' or 'insensitive'.");if(!Y.supportsInsensitiveMode)throw new K('mode: "insensitive"',$.name,z.operation,`The ${Y.name} dialect cannot express it \u2014 Prisma rejects it `+"here too. Note SQLite's LIKE is already case-insensitive for ASCII.")}let B=[];for(let D of W){let P=V[D];if(P===void 0||D==="mode")continue;if(Z.type==="Json"&&Y3.has(D)){B.push(M9($,Z,H,D,P,z,void 0,(L)=>J(L)?.[D]));continue}if(!m3.has(D))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`A scalar filter takes ${[...m3].sort().join(", ")}.`);if(D!=="equals"&&D!=="not"&&B9(P))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`Prisma.AnyNull means 'either kind of null', which only 'equals' and 'not' can express. Write { ${Z.name}: { equals: Prisma.AnyNull } }, or name the one you mean with Prisma.DbNull or Prisma.JsonNull.`);let Q=(L)=>J(L)?.[D];switch(D){case"equals":B.push(H3(H,Z,P,Y,Q));break;case"not":B.push(E7($,Z,P,z,Q,H));break;case"in":case"notIn":B.push(x7($,H,Z,P,z,Q,D==="notIn"));break;case"lt":case"lte":case"gt":case"gte":B.push(R(j(`${H} ${V9[D]} `),y(Z,Y,F0(Z,Y,Q))));break;case"contains":case"startsWith":case"endsWith":if(typeof P!=="string")throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`Expected a string, received ${P===null?"null":typeof P}.`);if(Z.type!=="String")throw new K(`where.${Z.name}.${D}`,$.name,z.operation,`'${Z.name}' is a ${Z.type}, and ${D} only applies to strings.`);B.push(Y.like(H,M,v7(D,Q)));break}}if(B.length===0)return j("true");if(B.length===1)return B[0];return t(B," and ")}function k0($){return`Prisma.${$==="db"?"DbNull":$==="json"?"JsonNull":"AnyNull"}`}function B9($){if(k($)==="any")return!0;return Array.isArray($)&&$.some((Z)=>k(Z)==="any")}function E7($,Z,X,z,J,Y){if(X===null||k(X)==="db")return j(`${Y} is not null`);if(k(X)==="json")return R(j("not "),v0(H3(Y,Z,X,z.dialect,J)));if(k(X)==="any")return R(j("not "),v0(H3(Y,Z,X,z.dialect,J)));if(!c3(X))return R(j(`${Y} <> `),y(Z,z.dialect,F0(Z,z.dialect,J)));let H=d3($,Z,X,z,J);return R(j("not "),v0(H))}function H3($,Z,X,z,J){if(X===null||k(X)==="db")return j(`${$} is null`);if(k(X)==="any")return t([j(`${$} is null`),w7($,Z,z)]," or ");return R(j(`${$} = `),y(Z,z,F0(Z,z,J)))}function w7($,Z,X){return R(j(`${$} = `),y(Z,X,()=>X.encode(p3,Z)))}function x7($,Z,X,z,J,Y,H){let{dialect:G}=J;if(!Array.isArray(z))throw new T(`where.${X.name}.${H?"notIn":"in"}`,$.name,J.operation,"Expected an array.");if(z.length===0)return H?j("true"):H9;return G.inList(Z,H,z.length,(V)=>{return Y(V).map((M)=>G.encode(M,X))})}function v7($,Z){return(X)=>{let z=String(Z(X));if($==="contains")return`%${z}%`;if($==="startsWith")return`${z}%`;return`%${z}`}}function F0($,Z,X){return(z)=>Z.encode(X(z),$)}function c3($){return typeof $==="object"&&$!==null&&!Array.isArray($)&&!($ instanceof Date)&&!ArrayBuffer.isView($)}function D9($,Z,X,z,J,Y,H){let G=`orderBy.${Z.name}`;if(typeof X!=="object"||X===null||Array.isArray(X))throw new T(G,$.name,z,Z.kind==="many"?'Expected { _count: "asc" | "desc" }.':`Expected an object naming one field of ${Z.model}.`);let V=X,W=Object.keys(V).filter((L)=>L!=="where");if(W.length!==1)throw new K(G,$.name,z,W.length===0?"Name the field to order by.":`Name exactly one field to order by; got ${W.join(", ")}. `+"Order by several with an array: [{ a: \u2026 }, { b: \u2026 }].");let[M]=W,B=N0($,Z,J,`_o${H}`,`${J.quoteIdent($.table)}.`,z),D=k7($,Z,B.child,M,V[M],z,B.qualifier,J),P=f(B.child,V.where,{dialect:J,operation:z,qualifier:B.qualifier},(L)=>Y(L)?.where),Q=[j(`(select ${D.expression} from ${B.source} where ${B.correlation}`)];if(P)Q.push(j(" and "),P);return Q.push(j(")")),{expression:R(...Q),direction:D.direction,nulls:D.nulls}}function k7($,Z,X,z,J,Y,H,G){let V=`orderBy.${Z.name}.${z}`,{direction:W,nulls:M}=f7($,V,J,Y);if(z===l){if(Z.kind!=="many")throw new K(V,$.name,Y,`${Z.name} is a to-one relation, so its count is 0 or 1. Order by one of ${X.name}'s fields instead.`);return{expression:"count(*)",direction:W,nulls:M}}if(Z.kind==="many")throw new K(V,$.name,Y,`${Z.name} is a to-many relation, so ordering by '${z}' has no single answer for a parent with several children. Only `+"{ _count: \u2026 } is supported.");let B=X.fields[z];if(!B)throw new K(V,$.name,Y,`'${z}' is not a field on ${X.name}. Known fields: ${Object.keys(X.fields).join(", ")}.`);return{expression:`${H}${G.quoteIdent(B.column)}`,direction:W,nulls:M}}function f7($,Z,X,z){if(X==="asc"||X==="desc")return{direction:X};if(typeof X==="object"&&X!==null){let{sort:J,nulls:Y}=X;if(J!=="asc"&&J!=="desc")throw new T(Z,$.name,z,'Expected "asc" or "desc".');if(Y===void 0)return{direction:J};if(Y!=="first"&&Y!=="last")throw new K(`${Z}.nulls`,$.name,z,'Expected "first" or "last".');return{direction:J,nulls:Y}}throw new K(Z,$.name,z,'Expected "asc", "desc", or { sort, nulls }.')}var g7=new Set(["asc","desc"]),y7=new Set(["first","last"]);function D0($,Z,X,z){if(Z===void 0||Z===null)return[];let J=Array.isArray(Z),Y=J?Z:[Z],H=[];for(let G=0;G<Y.length;G++){let V=Y[G],W=(M)=>{let B=z?.locate(M);return J?B?.[G]:B};if(typeof V!=="object"||V===null)throw new T("orderBy",$.name,X,"Expected an object or an array of objects.");for(let[M,B]of Object.entries(V)){if(B===void 0)continue;if(M in $.relations){if(!z)throw new K(`orderBy.${M}`,$.name,X,"Ordering by a relation is not implemented here.");let P=D9($,$.relations[M],B,X,z.dialect,(Q)=>W(Q)?.[M],H.length);H.push({column:M,direction:P.direction,...P.nulls?{nulls:P.nulls}:{},expression:P.expression});continue}let D=$.fields[M];if(!D)throw new g(M,$.name,Object.keys($.fields));H.push({column:D.column,...P9($,M,B,X)})}}return H}function P9($,Z,X,z){if(typeof X==="string"){if(!g7.has(X))throw new T(`orderBy.${Z}: ${JSON.stringify(X)}`,$.name,z,'Expected "asc" or "desc".');return{direction:X}}if(typeof X==="object"&&X!==null){let{sort:J,nulls:Y}=X,H=P9($,Z,J,z).direction;if(Y===void 0)return{direction:H};if(typeof Y!=="string"||!y7.has(Y))throw new K(`orderBy.${Z}.nulls: ${JSON.stringify(Y)}`,$.name,z,'Expected "first" or "last".');return{direction:H,nulls:Y}}throw new K(`orderBy.${Z}`,$.name,z,'Expected "asc", "desc", or { sort, nulls }.')}function V3($){return $.map((Z)=>({...Z,direction:Z.direction==="asc"?"desc":"asc",...Z.nulls?{nulls:Z.nulls==="first"?"last":"first"}:{}}))}function r($,Z,X){if($.length===0)return null;return x($.map((z)=>{let J=` ${z.direction}`+(z.nulls?` nulls ${z.nulls}`:"");if(z.expression)return x([z.expression,j(J)],"");return j(`${X??""}${Z.quoteIdent(z.column)}${J}`)}),", ")}function G3($,Z,X,z,J){if(typeof J!=="number"||!Number.isInteger(J))throw new T(X,$,Z,`Expected an integer, got ${JSON.stringify(J)}.`);if(z==="skip"&&J<0)throw new T(X,$,Z,"A 'skip' counts rows to pass over, so it cannot be negative. Prisma rejects one too.")}function Q0($,Z,X,z,J,Y=!1){if(X?.take!==void 0)G3($.name,Z,"take","take",X.take);if(X?.skip!==void 0)G3($.name,Z,"skip","skip",X.skip);let H=Y?1:X?.take,G=X?.skip,V=J;if((H!==void 0||G!==void 0)&&V.length===0&&!Y)V=$.primaryKey.map((P)=>({column:$.fields[P]?.column??P,direction:"asc"}));let M=typeof H==="number"&&H<0;if(M)V=V3(V);let B=H===void 0?null:Y?()=>1:(P)=>Math.abs(Number(P?.take)),D=G===void 0?null:(P)=>Number(P?.skip);return{clause:z.paginate(B,D),terms:V,reversed:M}}function J0($,Z,X){let z=Z?.select,J=Z?.omit;if(z!==void 0&&Z?.include!==void 0)throw new K("select + include",$.name,X,"Prisma allows only one of them on the same query.");if(z!==void 0&&J!==void 0)throw new K("select + omit",$.name,X,"'select' names what to keep and 'omit' what to drop, so the two describe different column lists. Prisma allows only one of them on "+"the same query. Drop the 'omit' \u2014 a 'select' already excludes "+"everything it does not name.");if(z===void 0||z===null)return h7($,J,X);if(typeof z!=="object"||Array.isArray(z))throw new T("select",$.name,X,"Expected an object.");let Y=[];for(let[G,V]of Object.entries($.fields))if(z[G]===!0)Y.push(V);let H=0;for(let G of Object.keys(z)){let V=z[G];if(V===void 0)continue;if(G in $.relations){if(V!==!1)H++;continue}if(G===l){if(V!==!1)H++;continue}if(!(G in $.fields))throw new g(G,$.name,Object.keys($.fields));if(typeof V!=="boolean")throw new T(`select.${G}`,$.name,X,"Expected true or false.")}if(Y.length===0&&H===0)throw new K("select",$.name,X,"At least one field must be selected.");return Y}function h7($,Z,X){if(Z===void 0||Z===null)return Object.values($.fields);if(typeof Z!=="object"||Array.isArray(Z))throw new T("omit",$.name,X,"Expected an object of fields.");let z=new Set;for(let Y of Object.keys(Z)){let H=Z[Y];if(H===void 0)continue;if(Y in $.relations)throw new K(`omit.${Y}`,$.name,X,`'${Y}' is a relation, not a column. A relation is already absent unless an 'include' asks for it.`);if(!(Y in $.fields))throw new g(Y,$.name,Object.keys($.fields));if(typeof H!=="boolean")throw new T(`omit.${Y}`,$.name,X,"Expected true or false.");if(H)z.add(Y)}let J=Object.values($.fields).filter((Y)=>!z.has(Y.name));if(J.length===0)throw new K("omit",$.name,X,`It omits every field on ${$.name}, which leaves no column to select. Prisma rejects that too.`);return J}function W3($,Z,X){if(X.length===0)return{fields:Z};let z=new Set(Z.map((H)=>H.name)),J=X.filter((H)=>!z.has(H));if(J.length===0)return{fields:Z};let Y=new Set([...z,...J]);return{fields:Object.values($.fields).filter((H)=>Y.has(H.name)),hidden:J}}var j9=new Set(["where","orderBy","select","omit","include","take","skip"]),K9=new Set(["where","select","omit","include"]),D3=10;function m0($){return[...new Set($.map((Z)=>Z.strategy))].sort()}function S0($,Z,X,z,J=P0){let Y=p0($,Z,z);if(Y.length===0)return{plans:[],keyFields:[]};let H=[],G=new Set;for(let V of Y){T9($,V,z);let W=U9($,V);R9(W,V.node,z,2);let M=J.plan({parent:$,child:W,relation:V.relation,as:V.as,node:V.node,locate:V.locate,dialect:X,operation:z});H.push(M);for(let B of M.parentFields)G.add(B)}return{plans:H,keyFields:[...G]}}async function j3($,Z,X,z,J){let Y=Array.isArray(X)?X:X===null||X===void 0?[]:[X];if(Y.length===0)return;for(let H of $){if(H.root)continue;await H.load(Y,z,J)}if(Z&&Z.length>0)for(let H of Y)for(let G of Z)delete H[G]}function p0($,Z,X){if(Z===void 0||Z===null)return[];let{include:z,select:J}=Z;C9($,z,J,X);let Y=[];if(z!==void 0&&z!==null){if(typeof z!=="object"||Array.isArray(z))throw new T("include",$.name,X,"Expected an object.");for(let H of Object.keys(z).sort()){let G=z[H];if(G===void 0||G===!1)continue;if(H===l)continue;let V=$.relations[H];if(!V)throw new y0(H,$.name,Object.keys($.relations));Y.push({as:H,relation:V,node:G,locate:(W)=>W?.include?.[H]})}return Y}if(J!==void 0&&J!==null&&typeof J==="object")for(let H of Object.keys(J).sort()){let G=J[H];if(G===void 0||G===!1)continue;let V=$.relations[H];if(!V)continue;Y.push({as:H,relation:V,node:G,locate:(W)=>W?.select?.[H]})}return Y}function C9($,Z,X,z,J){if(Z===void 0||X===void 0)return;throw new K(J?`${J}: select + include`:"select + include",$.name,z,"Prisma allows only one of them on the same query, at any level.")}function T9($,Z,X){let z=Z.node;if(z===!0)return;if(typeof z!=="object"||z===null||Array.isArray(z))throw new T(Z.as,$.name,X,"Expected true or an object of relation arguments.");let J=z;C9($,J.include,J.select,X,Z.as);let Y=Z.relation.kind==="many";for(let H of Object.keys(J).sort()){if(J[H]===void 0)continue;if(Y&&(H==="take"||H==="skip")){u7($,Z,X,H,J[H]);continue}if(Y?j9.has(H):K9.has(H))continue;if(H==="lock")throw new g0(`${Z.as}.lock`,$.name,X,"'lock' locks the rows of the model being queried, not an included relation's. Lock the related rows with their own locking read in the same transaction.");if(H==="orderBy"&&!Y)throw new K(`${Z.as}.orderBy`,$.name,X,"Prisma does not accept 'orderBy' on a to-one relation \u2014 there is at "+"most one row to order.");if(H==="take"||H==="skip")throw new K(`${Z.as}.${H}`,$.name,X,`Prisma does not accept '${H}' on a to-one relation.`);throw new K(`${Z.as}.${H}`,$.name,X,`A relation node takes ${[...Y?j9:K9].sort().join(", ")}.`)}}function u7($,Z,X,z,J){G3($.name,X,`${Z.as}.${z}`,z,J)}function n3($,Z){let X=$.node;if(typeof X!=="object"||X===null||Array.isArray(X))return;for(let z of["take","skip"]){if(X[z]===void 0)continue;throw new K(`${$.as}.${z}`,$.parent.name,$.operation,`A '${z}' inside a to-many relation is per parent, and the batched `+"relation planner serves every parent from one query \u2014 so the only "+`limit it could emit would page every parent's children as one set. Only the lateral join strategy can express it, by paginating inside a subquery that already runs once per parent row, and it needs Postgres: ${Z}. Load '${$.as}' as its own query, or narrow it with 'where'.`)}}function R9($,Z,X,z){if(typeof Z!=="object"||Z===null||Array.isArray(Z))return;if(Z.select!==void 0)J0($,Z,X);let J=p0($,Z,X);if(J.length===0)return;if(z>D3)throw new s3($.name,D3);for(let Y of J)T9($,Y,X),R9(U9($,Y),Y.node,X,z+1)}function I9($,Z,X,z){if($.parentFields.length!==1)throw new K(X.name,Z.name,z,`${X.name} joins on ${$.parentFields.length} fields (${$.parentFields.join(", ")}), and it is planned through a join table, which links two models by a single primary key each side. Prisma does not build an implicit many-to-many over a composite key.`);return{parentField:$.parentFields[0],childField:$.childFields[0],join:$.join}}function B0($,Z,X,z){if(X.joinTable)return p7($,Z,X);if(X.from.length>0)return Q9($,X,X.from,X.to,z);let J=m7($,Z,X);if(J.from.length===0)throw new s($.name,X.name,`neither ${$.name}.${X.name} nor ${Z.name}.${J.name} holds the foreign key.`);return Q9($,X,J.to,J.from,z)}function Q9($,Z,X,z,J){if(X.length===0)throw new K(Z.name,$.name,J,`${Z.name} names no join fields.`);if(X.length!==z.length)throw new s($.name,Z.name,`it joins ${X.length} field(s) to ${z.length}: ${X.join(", ")} against ${z.join(", ")}.`);return{parentFields:X,childFields:z}}function m7($,Z,X){let z=Object.values(Z.relations).filter((J)=>J.relationName===X.relationName&&!(Z.name===$.name&&J.name===X.name));if(z.length!==1)throw new s($.name,X.name,z.length===0?`${Z.name} declares no relation named '${X.relationName}'.`:`${Z.name} declares ${z.length} relations named '${X.relationName}'.`);return z[0]}function p7($,Z,X){let{table:z,a:J,b:Y}=X.joinTable;if(J===Y){let G=X.joinTable.ownerColumn;if(!G)throw new K(X.name,$.name,"include",`${X.name} is a self-referential implicit many-to-many, and the generated artifact predates support for one. Re-run \`prisma generate\`.`);return{parentFields:[M3($,X)],childFields:[M3(Z,X)],join:{table:z,parentColumn:G,childColumn:G==="A"?"B":"A"}}}if($.name!==J&&$.name!==Y)throw new s($.name,X.name,`the join table '${z}' connects ${J} and ${Y}, neither of which is ${$.name}.`);let H=$.name===J?"A":"B";return{parentFields:[M3($,X)],childFields:[M3(Z,X)],join:{table:z,parentColumn:H,childColumn:H==="A"?"B":"A"}}}function M3($,Z){if($.primaryKey.length!==1)throw new s($.name,Z.name,`an implicit many-to-many joins on ${$.name}'s primary key, which has ${$.primaryKey.length} fields.`);return $.primaryKey[0]}function B3($,Z,X){let z=$.fields[X];if(!z)throw new s($.name,Z.name,`it joins on '${X}', which is not a field on ${$.name}.`);return z}function U9($,Z){return X0($,Z.relation,Z.as)}function X0($,Z,X=Z.name){let z=Z.model;if(!a(z))throw new i3($.name,X,z,P3());let J=d(z)?.$schema;if(!J)throw new h0(z);return J}var _9="batched",P0={name:_9,plan($){n3($,"this query planned with the batched strategy");let Z=B0($.parent,$.child,$.relation,$.operation);for(let Y of Z.parentFields)L9($.parent,$.relation,B3($.parent,$.relation,Y));for(let Y of Z.childFields)L9($.child,$.relation,B3($.child,$.relation,Y));let X=B3($.parent,$.relation,Z.parentFields[0]),z=B3($.child,$.relation,Z.childFields[0]),J=$.relation.kind==="many";return{as:$.as,model:$.relation.model,kind:$.relation.kind,parentFields:Z.parentFields,strategy:_9,load(Y,H,G){let V={parentKeyField:X,childKeyField:z,many:J,parents:Y,args:H,executor:G};return Z.join?c7($,Z,V):d7($,Z,V)}}}};async function d7($,Z,X){let{keys:z,byKey:J}=O9(X.parents,Z.parentFields);if(z.length===0)return;let Y=$.locate(X.args),H=N9(Y,Z.childFields,z,$.child,$.dialect),G=await X.executor.exec($.relation.model,"findMany",H.args,!0);for(let V of G){let W=J.get(f0(Z.childFields.map((M)=>V[M])));if(!W)continue;for(let M of W)F9(M,$.as,V,X.many)}if(H.hidden)for(let V of G)for(let W of Z.childFields)delete V[W]}async function c7($,Z,X){let{keys:z,byKey:J}=O9(X.parents,Z.parentFields);if(z.length===0)return;let{dialect:Y}=$,H=Z.join,G=await s7(Y,H,z.map((P)=>Y.encode(P[0],X.parentKeyField)),X.executor),V=new Map,W=[];for(let P of G){let Q=f0([Y.decode(P[H.parentColumn],X.parentKeyField)]),L=J.get(Q);if(!L)continue;let F=Y.decode(P[H.childColumn],X.childKeyField),N=f0([F]),C=V.get(N);if(C===void 0)C=[],V.set(N,C),W.push([F]);for(let _ of L)C.push(_)}if(W.length===0)return;let M=$.locate(X.args),B=N9(M,Z.childFields,W,$.child,$.dialect),D=await X.executor.exec($.relation.model,"findMany",B.args,!0);for(let P of D){let Q=V.get(f0([P[Z.childFields[0]]]));if(!Q)continue;for(let L of Q)F9(L,$.as,P,X.many)}if(B.hidden)for(let P of D)delete P[Z.childFields[0]]}async function s7($,Z,X,z){let J=R(j(`select ${$.quoteIdent(Z.parentColumn)}, ${$.quoteIdent(Z.childColumn)} from ${$.quoteIdent(Z.table)} where `),$.inList($.quoteIdent(Z.parentColumn),!1,X.length,()=>X)),{text:Y,binders:H}=c(J,$,{model:Z.table,operation:"include"}),G=A0();return z.query(Y,H.map((V)=>V(void 0,G)))}function N9($,Z,X,z,J){let Y=$===!0||$===null||typeof $!=="object"?{}:$,H=Z.length===1?{[Z[0]]:{in:X.map((B)=>B[0])}}:i7(z,Z,X,J),G={where:Y.where===void 0?H:{AND:[Y.where,H]}};if(Y.orderBy!==void 0)G.orderBy=Y.orderBy;if(Y.include!==void 0)G.include=Y.include;let V=Y.omit;if(V!==void 0){let B=Z.filter((D)=>V[D]===!0);if(B.length===0)G.omit=V;else{let D={...V};for(let P of B)delete D[P];return G.omit=D,{args:G,hidden:!0}}}let W=Y.select;if(W===void 0)return{args:G,hidden:!1};let M=Z.filter((B)=>W[B]!==!0);if(M.length===0)return G.select=W,{args:G,hidden:!1};G.select={...W};for(let B of M)G.select[B]=!0;return{args:G,hidden:!0}}function i7($,Z,X,z){let J=Z.map((Y)=>$.fields[Y]?.type);if(J.every((Y)=>Y!==void 0)&&z.canBindCompositeIn(J))return{[z0]:W9(Z,X)};return{OR:X.map((Y)=>Object.fromEntries(Z.map((H,G)=>[H,Y[G]])))}}function f0($){return JSON.stringify($.map(n7))}function F9($,Z,X,z){if(z){$[Z].push(X);return}if($[Z]===null)$[Z]=X}function O9($,Z){let X=new Map,z=[];for(let J of $){let Y=Z.map((V)=>J[V]);if(Y.some((V)=>V===null||V===void 0))continue;let H=f0(Y),G=X.get(H);if(G===void 0)G=[],X.set(H,G),z.push(Y);G.push(J)}return{keys:z,byKey:X}}function n7($){if(typeof $!=="object"||$===null)return $;if($ instanceof Date)return $.getTime();if(ArrayBuffer.isView($)){let Z=new Uint8Array($.buffer,$.byteOffset,$.byteLength),X="";for(let z of Z)X+=z.toString(16).padStart(2,"0");return`bytes:${X}`}throw Error(`Cannot key a relation stitch on ${Object.prototype.toString.call($)}.`)}function L9($,Z,X){if(X.isList)throw new s($.name,Z.name,`it joins on '${X.name}', a ${X.type} list \u2014 which decodes to a new `+"array per row and so cannot be compared between the two sides.");if(X.type!=="Json")return;throw new s($.name,Z.name,`it joins on '${X.name}', a ${X.type} \u2014 which decodes to a new object `+"per row and so cannot be compared between the two sides.")}var A9=(()=>{try{return Function("return 1")()===1}catch{return!1}})(),S9=!0;function l7($){S9=$}function o7(){return A9}function d0($,Z,X=[]){if(A9&&S9)return t7($,Z,X);return l3($,Z,X)}function l3($,Z,X=[]){let z=$.map((G)=>({key:G.name,column:G.column,field:G,decode:Z.needsDecode(G)})),J=z.length,Y=X.map((G)=>({key:G.key,many:G.kind==="many"})),H=Y.length;return(G)=>{let V=[];for(let W=0;W<G.length;W++){let M=G[W],B={};for(let D=0;D<J;D++){let P=z[D],Q=M[P.column];B[P.key]=P.decode?Z.decode(Q,P.field):Q??null}for(let D=0;D<H;D++)B[Y[D].key]=Y[D].many?[]:null;V.push(B)}return V}}function t7($,Z,X){let z=[];for(let Y=0;Y<$.length;Y++){let H=$[Y],G=JSON.stringify(H.name),V=JSON.stringify(H.column);z.push(Z.needsDecode(H)?`${G}: d.decode(row[${V}], f[${Y}])`:`${G}: row[${V}] ?? null`)}for(let Y of X)z.push(`${JSON.stringify(Y.key)}: ${Y.kind==="many"?"[]":"null"}`);let J=`
|
|
3
3
|
return function shape(rows) {
|
|
4
4
|
const out = [];
|
|
5
5
|
for (let i = 0; i < rows.length; i++) {
|
|
@@ -12,4 +12,4 @@ import{qa as g6}from"../chunk-gxd1388t.js";import{$a as w0,Ua as J9,Va as Y9,Wa
|
|
|
12
12
|
Columns marked [sensitive] hold secrets: never select them.`:"";return X.join(`
|
|
13
13
|
`)+z}function o8($){let Z=$.column===$.field?$.field:`${$.field}@${$.column}`,X=($.enum?`${$.enum}(enum)`:$.type)+($.list?"[]":""),z=[$.primaryKey?"pk":null,$.unique?"unique":null,$.sensitive?"sensitive":null].filter(Boolean);return`${Z}:${X}${$.nullable?"?":""}${z.length>0?` [${z.join(", ")}]`:""}`}function t8($){let Z=`${$.model}${$.kind==="many"?"[]":$.nullable?"?":""}`;if($.joinTable)return`${$.name} -> ${Z} via "${$.joinTable}"`;if($.from.length>0){let X=$.from.map((z,J)=>`${z} = ${$.model}.${$.to[J]??"?"}`).join(" and ");return`${$.name} -> ${Z} on ${X}`}return`${$.name} -> ${Z}`}function r8($,Z,X){let z=X.find((J)=>J.name===$.model);return{name:$.name,model:$.model,kind:$.kind,nullable:$.nullable,from:$.from.map(Z),to:$.to.map((J)=>z?.fields[J]?.column??J),...$.joinTable?{joinTable:$.joinTable.table}:{}}}function a8($){return typeof $==="object"&&$!==null&&typeof $.name==="string"&&typeof $.table==="string"&&typeof $.fields==="object"&&typeof $.relations==="object"}function e8($){if($!==void 0)return(Array.isArray($)?$:Object.values($)).filter(a8);let Z=new Set,X=[];for(let z of P3()){let J=d(z).$schema;if(!J||Z.has(J.name))continue;Z.add(J.name),X.push(J)}return X}export{r5 as withTransaction,b6 as unsafeSql,j6 as transactionDepth,F3 as track,m0 as strategiesOf,O6 as sql,w8 as softDeletes,v8 as softDeleteMany,x8 as softDelete,o7 as shaperCompilationAvailable,l7 as setShaperCompilation,t5 as runAsUser,o5 as runAsSystem,g6 as rotateEncryptedColumns,$5 as resolveStrategy,O3 as resnapshot,q6 as renderFragment,u0 as registry,f6 as registerModels,G6 as register,x6 as redactNullable,R0 as provenanceOf,E3 as policyContext,w0 as policiesFor,S0 as planRelations,k4 as planKey,A8 as planCacheStats,n8 as paginate,N6 as ormSupports,B6 as ormContext,l0 as lateralStrategy,k as jsonNullKind,A6 as join,X6 as isUniqueConstraintError,q8 as isTracked,l5 as isSystemScope,Z6 as isRecordNotFoundError,i9 as isClientSideDefault,o0 as hasClientSideValue,$3 as getOrCompile,F6 as everyDialect,S6 as empty,a5 as dialectFor,D7 as describeSchemaModels,l8 as describeSchema,p9 as defaultStrategy,X3 as currentUser,E0 as currentTransaction,K6 as currentActor,t9 as createUuid,o9 as createUlid,l9 as createNanoid,n9 as createCuid,A0 as createBindContext,I5 as compileWrite,e3 as compileRead,k5 as compile,H5 as clientSideValue,S8 as clearPlanCache,h5 as changedFields,V0 as canonicalShape,d0 as buildRowShaper,l3 as buildInterpretedShaper,P0 as batchedStrategy,k6 as auditModelRegistrations,j3 as attachRelations,j2 as assertSchemaArtifactVersion,v6 as assertPoliciesRegistered,w3 as applyRedaction,e5 as applyPolicies,D6 as afterCommit,K as UnsupportedQueryError,U6 as UnsupportedDialectError,g0 as UnsupportedByDesignError,i3 as UnregisteredRelationTargetError,s5 as UnregisteredPolicyClassError,y0 as UnknownRelationError,g as UnknownFieldError,W6 as UnknownConnectionError,c5 as UniqueConstraintError,P6 as TransactionDependencyError,X5 as StaleSchemaArtifactError,I6 as SqliteDialect,Q6 as SessionSettingConflictError,w6 as ScopedPolicy,J6 as ScopeEscapeError,b5 as ScalarColumnError,P2 as SCHEMA_ARTIFACT_VERSION,T5 as ReturningUnsupportedError,s3 as RelationDepthExceededError,$0 as RecordNotFoundError,C6 as PostgresDialect,z6 as PolicyDeniedError,E6 as Policy,i5 as ParameterLimitError,V6 as ModelNotRegisteredError,x3 as Model,R3 as MissingRequiredValueError,h0 as MissingModelSchemaError,s as MalformedRelationError,D3 as MAX_RELATION_DEPTH,n5 as LockOutsideTransactionError,Y5 as JsonNull,S5 as JsonColumnError,Y6 as InvalidPolicyEntryError,T as InvalidArgumentError,_6 as EncryptionKeyError,L6 as DecryptionError,$6 as DecodeError,T6 as DbNull,M6 as CrossConnectionTransactionError,R6 as AnyNull,H6 as AmbiguousModelRegistrationError,M7 as ActiveRecordModel};
|
|
14
14
|
|
|
15
|
-
//# debugId=
|
|
15
|
+
//# debugId=C572A66B405C084D64756E2164756E21
|