gemi 0.196.2 → 0.197.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 +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-mgdrf89p.js → chunk-02jze3te.js} +2 -2
- package/dist/{chunk-mgdrf89p.js.map → chunk-02jze3te.js.map} +1 -1
- package/dist/{chunk-nk7nmtng.js → chunk-20y02g4n.js} +2 -2
- package/dist/{chunk-nk7nmtng.js.map → chunk-20y02g4n.js.map} +1 -1
- package/dist/{chunk-9dxp7t3n.js → chunk-2g2cntdm.js} +2 -2
- package/dist/{chunk-9dxp7t3n.js.map → chunk-2g2cntdm.js.map} +1 -1
- package/dist/{chunk-228w21t6.js → chunk-2qbfvb6m.js} +2 -2
- package/dist/{chunk-228w21t6.js.map → chunk-2qbfvb6m.js.map} +1 -1
- package/dist/{chunk-m0dfgmbj.js → chunk-2v83pskm.js} +1 -1
- package/dist/{chunk-652a9mr0.js → chunk-2z160r1b.js} +2 -2
- package/dist/{chunk-652a9mr0.js.map → chunk-2z160r1b.js.map} +1 -1
- package/dist/{chunk-28macaes.js → chunk-3am1e8ya.js} +2 -2
- package/dist/{chunk-28macaes.js.map → chunk-3am1e8ya.js.map} +1 -1
- package/dist/{chunk-rp6ss7v3.js → chunk-3bsw9sra.js} +2 -2
- package/dist/{chunk-rp6ss7v3.js.map → chunk-3bsw9sra.js.map} +1 -1
- package/dist/{chunk-j56zk5a0.js → chunk-4f2xy9ws.js} +3 -3
- package/dist/{chunk-j56zk5a0.js.map → chunk-4f2xy9ws.js.map} +1 -1
- package/dist/{chunk-08m9egzx.js → chunk-4ftk3z34.js} +2 -2
- package/dist/{chunk-08m9egzx.js.map → chunk-4ftk3z34.js.map} +1 -1
- package/dist/{chunk-7t60d5qy.js → chunk-4k62r4hv.js} +1 -1
- package/dist/{chunk-9hjxpdjt.js → chunk-51n7yky9.js} +1 -1
- package/dist/{chunk-wvq3c25z.js → chunk-5qaxde5h.js} +3 -3
- package/dist/{chunk-wvq3c25z.js.map → chunk-5qaxde5h.js.map} +1 -1
- package/dist/{chunk-pmt2jt9b.js → chunk-6nj9xjsm.js} +2 -2
- package/dist/{chunk-pmt2jt9b.js.map → chunk-6nj9xjsm.js.map} +1 -1
- package/dist/{chunk-g7h28xcr.js → chunk-7q42fej6.js} +2 -2
- package/dist/{chunk-g7h28xcr.js.map → chunk-7q42fej6.js.map} +1 -1
- package/dist/{chunk-p4eger3g.js → chunk-7sadg8d7.js} +3 -3
- package/dist/{chunk-p4eger3g.js.map → chunk-7sadg8d7.js.map} +1 -1
- package/dist/chunk-7xy7ebkx.js +117 -0
- package/dist/{chunk-5w3kcn4a.js.map → chunk-7xy7ebkx.js.map} +9 -10
- package/dist/{chunk-2485bwzs.js → chunk-8mmskn4g.js} +3 -3
- package/dist/{chunk-2485bwzs.js.map → chunk-8mmskn4g.js.map} +1 -1
- package/dist/{chunk-hswnqn33.js → chunk-8xckmvea.js} +2 -2
- package/dist/{chunk-hswnqn33.js.map → chunk-8xckmvea.js.map} +1 -1
- package/dist/{chunk-pqr01waj.js → chunk-9dnbf9q8.js} +2 -2
- package/dist/{chunk-pqr01waj.js.map → chunk-9dnbf9q8.js.map} +1 -1
- package/dist/{chunk-ermvtpy9.js → chunk-9ky5d5js.js} +3 -3
- package/dist/{chunk-ermvtpy9.js.map → chunk-9ky5d5js.js.map} +1 -1
- package/dist/{chunk-3fcd8a47.js → chunk-a4kk68xy.js} +2 -2
- package/dist/{chunk-3fcd8a47.js.map → chunk-a4kk68xy.js.map} +1 -1
- package/dist/{chunk-1x23scpn.js → chunk-a77w04sw.js} +2 -2
- package/dist/{chunk-1x23scpn.js.map → chunk-a77w04sw.js.map} +1 -1
- package/dist/{chunk-43599z6g.js → chunk-arb0qkrm.js} +2 -2
- package/dist/{chunk-43599z6g.js.map → chunk-arb0qkrm.js.map} +1 -1
- package/dist/{chunk-paawtkza.js → chunk-bcydd231.js} +2 -2
- package/dist/{chunk-paawtkza.js.map → chunk-bcydd231.js.map} +1 -1
- package/dist/{chunk-hmn6pa78.js → chunk-c601phyd.js} +2 -2
- package/dist/{chunk-hmn6pa78.js.map → chunk-c601phyd.js.map} +1 -1
- package/dist/{chunk-zcqz5xn9.js → chunk-cpgc5q74.js} +2 -2
- package/dist/{chunk-zcqz5xn9.js.map → chunk-cpgc5q74.js.map} +1 -1
- package/dist/{chunk-39w89wss.js → chunk-dbe8zgyb.js} +2 -2
- package/dist/{chunk-39w89wss.js.map → chunk-dbe8zgyb.js.map} +1 -1
- package/dist/{chunk-qrn6ch3t.js → chunk-degz94dk.js} +2 -2
- package/dist/{chunk-qrn6ch3t.js.map → chunk-degz94dk.js.map} +1 -1
- package/dist/{chunk-qg9pyxg7.js → chunk-e0d6az7p.js} +2 -2
- package/dist/{chunk-qg9pyxg7.js.map → chunk-e0d6az7p.js.map} +1 -1
- package/dist/{chunk-g02gqhq0.js → chunk-ecyq52t3.js} +3 -3
- package/dist/{chunk-g02gqhq0.js.map → chunk-ecyq52t3.js.map} +1 -1
- package/dist/chunk-es05kqtp.js +15 -0
- package/dist/{chunk-nphb176s.js.map → chunk-es05kqtp.js.map} +6 -5
- package/dist/{chunk-qjwv9xfq.js → chunk-evdca0b9.js} +2 -2
- package/dist/{chunk-qjwv9xfq.js.map → chunk-evdca0b9.js.map} +1 -1
- package/dist/{chunk-0xssrbar.js → chunk-ff16m7gm.js} +2 -2
- package/dist/{chunk-0xssrbar.js.map → chunk-ff16m7gm.js.map} +1 -1
- package/dist/{chunk-dn20caf2.js → chunk-fyk66c5e.js} +2 -2
- package/dist/{chunk-dn20caf2.js.map → chunk-fyk66c5e.js.map} +1 -1
- package/dist/{chunk-vgxkt9vd.js → chunk-fzy1z97a.js} +2 -2
- package/dist/{chunk-q1aaqhnw.js.map → chunk-fzy1z97a.js.map} +1 -1
- package/dist/{chunk-1ghbn9jg.js → chunk-g1th116z.js} +2 -2
- package/dist/{chunk-1ghbn9jg.js.map → chunk-g1th116z.js.map} +1 -1
- package/dist/{chunk-2yzv5v3m.js → chunk-gk0d26zw.js} +2 -2
- package/dist/{chunk-2yzv5v3m.js.map → chunk-gk0d26zw.js.map} +1 -1
- package/dist/{chunk-sqqby94y.js → chunk-gk12v51y.js} +1 -1
- package/dist/{chunk-ftvc1a0k.js → chunk-htnbmbx1.js} +2 -2
- package/dist/{chunk-ftvc1a0k.js.map → chunk-htnbmbx1.js.map} +1 -1
- package/dist/{chunk-pg5hm00s.js → chunk-j84r2j7a.js} +2 -2
- package/dist/{chunk-pg5hm00s.js.map → chunk-j84r2j7a.js.map} +1 -1
- package/dist/{chunk-1705yamg.js → chunk-kjgy7sk0.js} +2 -2
- package/dist/{chunk-1705yamg.js.map → chunk-kjgy7sk0.js.map} +1 -1
- package/dist/{chunk-6m9qrs6d.js → chunk-kjygnj7y.js} +2 -2
- package/dist/{chunk-6m9qrs6d.js.map → chunk-kjygnj7y.js.map} +1 -1
- package/dist/{chunk-n914rs58.js → chunk-kzy4pyqb.js} +3 -3
- package/dist/{chunk-n914rs58.js.map → chunk-kzy4pyqb.js.map} +1 -1
- package/dist/{chunk-07zfrfbg.js → chunk-mk4x0vtp.js} +2 -2
- package/dist/{chunk-07zfrfbg.js.map → chunk-mk4x0vtp.js.map} +1 -1
- package/dist/{chunk-gmcttf0f.js → chunk-mnmz8n5k.js} +2 -2
- package/dist/{chunk-gmcttf0f.js.map → chunk-mnmz8n5k.js.map} +1 -1
- package/dist/{chunk-wgqppqcn.js → chunk-n01mhwkj.js} +3 -3
- package/dist/{chunk-wgqppqcn.js.map → chunk-n01mhwkj.js.map} +1 -1
- package/dist/{chunk-xhkga697.js → chunk-nbry43s8.js} +2 -2
- package/dist/{chunk-xhkga697.js.map → chunk-nbry43s8.js.map} +1 -1
- package/dist/{chunk-beckfwe9.js → chunk-ng5qfkgp.js} +2 -2
- package/dist/{chunk-beckfwe9.js.map → chunk-ng5qfkgp.js.map} +1 -1
- package/dist/{chunk-aycfrzh1.js → chunk-nnn2f1ew.js} +2 -2
- package/dist/{chunk-aycfrzh1.js.map → chunk-nnn2f1ew.js.map} +1 -1
- package/dist/{chunk-reaty2mv.js → chunk-pvx66dq2.js} +3 -3
- package/dist/{chunk-reaty2mv.js.map → chunk-pvx66dq2.js.map} +1 -1
- package/dist/{chunk-j49vh5bs.js → chunk-qw6aa9fy.js} +2 -2
- package/dist/{chunk-j49vh5bs.js.map → chunk-qw6aa9fy.js.map} +1 -1
- package/dist/{chunk-28fz99pn.js → chunk-qx1vc11v.js} +2 -2
- package/dist/{chunk-28fz99pn.js.map → chunk-qx1vc11v.js.map} +1 -1
- package/dist/{chunk-9gpjn44n.js → chunk-rk34z2wa.js} +2 -2
- package/dist/{chunk-9gpjn44n.js.map → chunk-rk34z2wa.js.map} +1 -1
- package/dist/{chunk-m08p5mre.js → chunk-rnjjn09d.js} +2 -2
- package/dist/{chunk-m08p5mre.js.map → chunk-rnjjn09d.js.map} +1 -1
- package/dist/{chunk-q1aaqhnw.js → chunk-rqs2s5nh.js} +2 -2
- package/dist/{chunk-vgxkt9vd.js.map → chunk-rqs2s5nh.js.map} +1 -1
- package/dist/{chunk-zzdvdr5a.js → chunk-s57n552b.js} +4 -4
- package/dist/{chunk-zzdvdr5a.js.map → chunk-s57n552b.js.map} +1 -1
- package/dist/{chunk-ejktrxp2.js → chunk-spsheyx9.js} +1 -1
- package/dist/{chunk-7zf8rnsb.js → chunk-sxww1ka5.js} +2 -2
- package/dist/{chunk-7zf8rnsb.js.map → chunk-sxww1ka5.js.map} +1 -1
- package/dist/chunk-tgbky7fc.js +5 -0
- package/dist/{chunk-ggbf1web.js.map → chunk-tgbky7fc.js.map} +1 -1
- package/dist/{chunk-03q4j7wa.js → chunk-tv33103m.js} +1 -1
- package/dist/{chunk-p2vasd1z.js → chunk-tvdmx66x.js} +2 -2
- package/dist/{chunk-p2vasd1z.js.map → chunk-tvdmx66x.js.map} +1 -1
- package/dist/{chunk-f6css3z6.js → chunk-v4ka65g8.js} +2 -2
- package/dist/{chunk-f6css3z6.js.map → chunk-v4ka65g8.js.map} +1 -1
- package/dist/{chunk-a02bmp0q.js → chunk-wprzrnqh.js} +2 -2
- package/dist/{chunk-a02bmp0q.js.map → chunk-wprzrnqh.js.map} +1 -1
- package/dist/{chunk-tj7z65ba.js → chunk-x05mj7ye.js} +2 -2
- package/dist/{chunk-tj7z65ba.js.map → chunk-x05mj7ye.js.map} +1 -1
- package/dist/{chunk-2g2fsr71.js → chunk-xb9zjaes.js} +2 -2
- package/dist/{chunk-2g2fsr71.js.map → chunk-xb9zjaes.js.map} +1 -1
- package/dist/{chunk-b6zqjyn1.js → chunk-y50h3cd6.js} +2 -2
- package/dist/{chunk-b6zqjyn1.js.map → chunk-y50h3cd6.js.map} +1 -1
- package/dist/{chunk-5bfrr8x5.js → chunk-y9pzr1wc.js} +2 -2
- package/dist/{chunk-5bfrr8x5.js.map → chunk-y9pzr1wc.js.map} +1 -1
- package/dist/{chunk-8e17k7ht.js → chunk-yzazktke.js} +3 -3
- package/dist/{chunk-8e17k7ht.js.map → chunk-yzazktke.js.map} +3 -3
- package/dist/{chunk-6efjnt6r.js → chunk-zcmfkb9f.js} +2 -2
- package/dist/{chunk-6efjnt6r.js.map → chunk-zcmfkb9f.js.map} +1 -1
- package/dist/{chunk-trqt1kkd.js → chunk-zehvtpgm.js} +2 -2
- package/dist/{chunk-trqt1kkd.js.map → chunk-zehvtpgm.js.map} +1 -1
- package/dist/{chunk-bc7hr358.js → chunk-zrykhpn9.js} +3 -3
- package/dist/{chunk-bc7hr358.js.map → chunk-zrykhpn9.js.map} +1 -1
- package/dist/{chunk-8fdk8bfd.js → chunk-zryrem89.js} +3 -3
- package/dist/{chunk-8fdk8bfd.js.map → chunk-zryrem89.js.map} +1 -1
- package/dist/{chunk-fhfkcmkc.js → chunk-zv55h4x9.js} +2 -2
- package/dist/{chunk-fhfkcmkc.js.map → chunk-zv55h4x9.js.map} +1 -1
- package/dist/{chunk-dfmxvp8p.js → chunk-zzmgz14a.js} +2 -2
- package/dist/{chunk-dfmxvp8p.js.map → chunk-zzmgz14a.js.map} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/ApiRouter.d.ts +7 -0
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/http/BodyLimitMiddleware.d.ts +3 -0
- package/dist/http/BodyLimitMiddleware.d.ts.map +1 -1
- package/dist/http/HttpRequest.d.ts.map +1 -1
- package/dist/http/bodyLimit.d.ts +21 -1
- package/dist/http/bodyLimit.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/middleware-config.d.ts +12 -3
- package/dist/http/middleware-config.d.ts.map +1 -1
- package/dist/http/validate.d.ts +8 -0
- package/dist/http/validate.d.ts.map +1 -1
- package/dist/i18n/Translator.d.ts +5 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/probe/index.js +2 -2
- package/dist/probe/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/middleware/MiddlewareRegistry.d.ts +16 -5
- package/dist/services/middleware/MiddlewareRegistry.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/router/ApiRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/createFlatApiRoutes.d.ts +3 -0
- package/dist/services/router/createFlatApiRoutes.d.ts.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/vitest/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5w3kcn4a.js +0 -117
- package/dist/chunk-ggbf1web.js +0 -5
- package/dist/chunk-nphb176s.js +0 -15
- /package/dist/{chunk-m0dfgmbj.js.map → chunk-2v83pskm.js.map} +0 -0
- /package/dist/{chunk-7t60d5qy.js.map → chunk-4k62r4hv.js.map} +0 -0
- /package/dist/{chunk-9hjxpdjt.js.map → chunk-51n7yky9.js.map} +0 -0
- /package/dist/{chunk-sqqby94y.js.map → chunk-gk12v51y.js.map} +0 -0
- /package/dist/{chunk-ejktrxp2.js.map → chunk-spsheyx9.js.map} +0 -0
- /package/dist/{chunk-03q4j7wa.js.map → chunk-tv33103m.js.map} +0 -0
|
@@ -2,6 +2,8 @@ import { Middleware } from "./Middleware";
|
|
|
2
2
|
export interface BodyLimitMiddlewareConfig {
|
|
3
3
|
/** The limit when the DSL gives none: bytes, or a size such as `"64kb"`. */
|
|
4
4
|
limit?: string | number;
|
|
5
|
+
/** What `body-limit:upload` means, in bytes: the app's `uploadBodyLimit`. */
|
|
6
|
+
uploadLimit?: number;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
9
|
* Bounds a route's request body (#752).
|
|
@@ -9,6 +11,7 @@ export interface BodyLimitMiddlewareConfig {
|
|
|
9
11
|
* ```
|
|
10
12
|
* "body-limit:64kb" // 413 past 64 KiB
|
|
11
13
|
* "body-limit:1.5mb"
|
|
14
|
+
* "body-limit:upload" // the app's `uploadBodyLimit` (50 MiB unless configured)
|
|
12
15
|
* "body-limit:none" // lifts the app-wide `bodyLimit` default for this route
|
|
13
16
|
* ```
|
|
14
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyLimitMiddleware.d.ts","sourceRoot":"","sources":["../../http/BodyLimitMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"BodyLimitMiddleware.d.ts","sourceRoot":"","sources":["../../http/BodyLimitMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,mBAAoB,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IAC5E,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM;CAUnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpRequest.d.ts","sourceRoot":"","sources":["../../http/HttpRequest.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"HttpRequest.d.ts","sourceRoot":"","sources":["../../http/HttpRequest.ts"],"names":[],"mappings":"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"}
|
package/dist/http/bodyLimit.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export declare class PayloadTooLargeError extends RequestBreakerError {
|
|
|
15
15
|
* throws: a limit that silently read as "no limit" would be worse than none.
|
|
16
16
|
*/
|
|
17
17
|
export declare function parseByteSize(input: string | number): number;
|
|
18
|
+
/**
|
|
19
|
+
* What a framework route asks for in place of the app-wide `bodyLimit`:
|
|
20
|
+
* `"upload"` for `uploadBodyLimit` (an agent's `upload`), `"none"` for a
|
|
21
|
+
* route that bounds its own body as it reads it (an agent's `stream`, by
|
|
22
|
+
* `maxBodyBytes`). A route's `body-limit` still replaces either.
|
|
23
|
+
*/
|
|
24
|
+
export type RouteBodyLimitDefault = "upload" | "none";
|
|
18
25
|
/** Whether a body limit is installed on `request`, by a middleware or the default. */
|
|
19
26
|
export declare function hasBodyLimit(request: Request): boolean;
|
|
20
27
|
/** The limit installed on `request`, or `null` when there is none. */
|
|
@@ -37,9 +44,22 @@ export declare function bodyLimitExceeded(request: Request): boolean;
|
|
|
37
44
|
* forwarded stream all read through the same counter.
|
|
38
45
|
*
|
|
39
46
|
* Installing again replaces the limit, so a route's `body-limit` overrides its
|
|
40
|
-
* router's, and either overrides the app-wide default.
|
|
47
|
+
* router's, and either overrides the app-wide default. `uploadLimit` is passed
|
|
48
|
+
* only by the default, and lets `raiseDefaultBodyLimitForUpload` raise it.
|
|
41
49
|
*/
|
|
42
50
|
export declare function setBodyLimit(request: Request, limit: number, options?: {
|
|
43
51
|
checkDeclared?: boolean;
|
|
52
|
+
uploadLimit?: number;
|
|
44
53
|
}): void;
|
|
54
|
+
/**
|
|
55
|
+
* Raises a default limit for a body about to be read as an upload: a
|
|
56
|
+
* multipart body whose schema has file rules (`file`, `fileType`,
|
|
57
|
+
* `fileSize:…`). The new limit is the larger of the configured
|
|
58
|
+
* `uploadBodyLimit` and `fileBytes` (the schema's `fileSize` ceilings added
|
|
59
|
+
* up) plus the default, for the form's other fields.
|
|
60
|
+
*
|
|
61
|
+
* Only a default is raised: a limit a route set with `body-limit` is the
|
|
62
|
+
* route's answer and stays. Nothing happens once the body has been read.
|
|
63
|
+
*/
|
|
64
|
+
export declare function raiseDefaultBodyLimitForUpload(request: Request, fileBytes: number): void;
|
|
45
65
|
//# sourceMappingURL=bodyLimit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodyLimit.d.ts","sourceRoot":"","sources":["../../http/bodyLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB;IACxC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAGjC;AAYD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAe5D;
|
|
1
|
+
{"version":3,"file":"bodyLimit.d.ts","sourceRoot":"","sources":["../../http/bodyLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB;IACxC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAGjC;AAYD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAe5D;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAoBtD,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG3D;AAeD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,QAehE;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAKjF"}
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as
|
|
2
|
+
import{$g as fa,Ae as G,Be as H,Tg as $,Ug as aa,Vg as ba,Yg as ca,Zg as da,_g as ea,ah as ga,bh as ha,cf as I,ch as ia,df as J,dh as ja,eh as ka,ff as K,fh as la,gf as L,gh as ma,hh as na,ih as oa,jh as pa,kh as qa,lh as ra,me as s,mh as sa,ne as t,nh as ta,oe as u,pe as v,qe as w,re as D,rg as _,we as E,ze as F}from"../chunk-7xy7ebkx.js";import"../chunk-4f2xy9ws.js";import"../chunk-7sadg8d7.js";import{Gi as M,Hi as N,Ii as O,Ji as P,Ki as Q,Li as R,Mi as S,Nh as a,Ni as T,Oh as b,Oi as U,Ph as d,Pi as V,Qi as W,Si as X,Ti as Y,Uh as e,Ui as Z,Vh as f,Wh as g,Xh as h,Yh as i,Zh as j,ci as n,di as o,ei as p,fi as q,oi as r,qi as x,ri as y,si as z,ti as A,ui as B,vi as C}from"../chunk-es05kqtp.js";import{ij as c}from"../chunk-2qbfvb6m.js";import{nj as k,oj as l,pj as m}from"../chunk-zzmgz14a.js";import"../chunk-kzy4pyqb.js";import"../chunk-ecyq52t3.js";import"../chunk-kjgy7sk0.js";import"../chunk-g1th116z.js";import"../chunk-mnmz8n5k.js";import"../chunk-ng5qfkgp.js";import"../chunk-5qaxde5h.js";import"../chunk-htnbmbx1.js";import"../chunk-rnjjn09d.js";import"../chunk-yzazktke.js";import"../chunk-9ky5d5js.js";import"../chunk-a77w04sw.js";import"../chunk-qw6aa9fy.js";import"../chunk-y9pzr1wc.js";import"../chunk-nnn2f1ew.js";import"../chunk-xb9zjaes.js";import"../chunk-fzy1z97a.js";export{g as toRangeHeaderValue,u as toMiddlewareList,k as stateKey,Z as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,q as parseByteSize,ha as middlewareConfigDefaults,t as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,pa as defineResourcePolicy,ga as defineMiddlewareConfig,v as createUnsatisfiableResponse,w as createStreamResponse,K as createFileResponse,H as clientIp,X as classifyAddress,ba as authorizeChannel,L as ViewRouter,n as ValidationError,U as TooManyRedirectsError,S as TooLargeError,R as TimeoutError,qa as SitemapError,ra as Sitemap,J as SameSiteBounceMiddleware,Y as SafeResponse,M as SafeFetchError,I as SAME_SITE_BOUNCE_PARAM,sa as RobotsTxt,ta as Robots,oa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,G as RateLimitMiddleware,E as RateLimitExceededError,z as RangeNotSatisfiableError,ma as PoliciesServiceProvider,na as Policies,p as PayloadTooLargeError,A as NotFoundError,V as NetworkError,l as MissingRequestStateError,F as Middleware,ea as McpToolDeclaration,fa as McpRouter,da as McpRouteDeclaration,ca as McpModelParam,o as InvalidValidationRuleError,N as InvalidUrlError,y as InsufficientPermissionsError,W as HttpStatusError,s as HttpResponse,r as HttpRequest,B as FileNotFoundError,Q as DnsError,ka as CorsMiddleware,a as Controller,T as ContentTypeError,aa as ChannelRouter,$ as ChannelDeclaration,ja as CacheMiddleware,la as CSRFMiddleware,_ as BodyLimitMiddleware,O as BlockedHostError,P as BlockedAddressError,x as AuthorizationError,ia as AuthenticationMiddleware,C as AuthenticationError,D as ApiRouter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=BB2A37351FF5E34A64756E2164756E21
|
package/dist/http/index.js.map
CHANGED
|
@@ -12,12 +12,21 @@ export interface MiddlewareConfig {
|
|
|
12
12
|
global?: (string | MiddlewareClass)[];
|
|
13
13
|
/**
|
|
14
14
|
* The request body limit for every api route without a `body-limit` of its
|
|
15
|
-
* own: bytes, or a size such as `"1mb"`. A route's
|
|
16
|
-
* it, raising it as well as lowering it
|
|
17
|
-
*
|
|
15
|
+
* own: bytes, or a size such as `"1mb"`. `"1mb"` unless set. A route's
|
|
16
|
+
* `body-limit:…` replaces it, raising it as well as lowering it
|
|
17
|
+
* (`body-limit:none` lifts it). `null` (or `"none"`) turns the default off,
|
|
18
|
+
* leaving only Bun's server-wide `maxRequestBodySize`. See
|
|
18
19
|
* `docs/middleware.md`.
|
|
19
20
|
*/
|
|
20
21
|
bodyLimit?: string | number | null;
|
|
22
|
+
/**
|
|
23
|
+
* The default for upload routes, `"50mb"` unless set: a multipart body whose
|
|
24
|
+
* schema has file rules (`file`, `fileType`, `fileSize:…`) gets this or its
|
|
25
|
+
* `fileSize` ceilings plus `bodyLimit`, whichever is larger, instead of
|
|
26
|
+
* `bodyLimit`. Also what `body-limit:upload` and an agent's `upload` route
|
|
27
|
+
* use. Does nothing while `bodyLimit` is off.
|
|
28
|
+
*/
|
|
29
|
+
uploadBodyLimit?: string | number;
|
|
21
30
|
}
|
|
22
31
|
export declare function defineMiddlewareConfig(config: MiddlewareConfig): MiddlewareConfig;
|
|
23
32
|
export declare function middlewareConfigDefaults(): Required<MiddlewareConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-config.d.ts","sourceRoot":"","sources":["../../http/middleware-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,eAAe,GAAG,KAAK,GAAG,EAAE,WAAW,KAAK,UAAU,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC;IACtC
|
|
1
|
+
{"version":3,"file":"middleware-config.d.ts","sourceRoot":"","sources":["../../http/middleware-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,eAAe,GAAG,KAAK,GAAG,EAAE,WAAW,KAAK,UAAU,CAAC;AAG5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC;IACtC;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,CAElB;AAED,wBAAgB,wBAAwB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAOrE"}
|
package/dist/http/validate.d.ts
CHANGED
|
@@ -31,5 +31,13 @@ export declare const RULES: readonly ["required", "string", "boolean", "number",
|
|
|
31
31
|
export declare class InvalidValidationRuleError extends Error {
|
|
32
32
|
name: string;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* What a rules schema says about uploads: `null` when no field has a file rule
|
|
36
|
+
* (`file`, `fileType`, `fileSize:…`), otherwise the bytes its `fileSize`
|
|
37
|
+
* ceilings add up to (0 when none has one). Read before a multipart body is,
|
|
38
|
+
* so the request's default body limit can make room for the files. A
|
|
39
|
+
* `fileSize` it cannot read counts as nothing here; `validate` throws on it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function uploadBytesOf(schema: Record<string, Record<string, unknown>>): number | null;
|
|
34
42
|
export declare function validate(ruleName: string): (value: any) => boolean;
|
|
35
43
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../http/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkEH;;mDAEmD;AACnD,eAAO,MAAM,KAAK,gKAiBR,CAAC;AAEX;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,IAAI,SAAgC;CACrC;AAcD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,WA0BpB,GAAG,aA8IvB"}
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../http/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkEH;;mDAEmD;AACnD,eAAO,MAAM,KAAK,gKAiBR,CAAC;AAEX;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,IAAI,SAAgC;CACrC;AAcD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAgB5F;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,WA0BpB,GAAG,aA8IvB"}
|
|
@@ -41,6 +41,11 @@ export declare class Translator {
|
|
|
41
41
|
formatter(locale?: string, timeZone?: string): Formatter;
|
|
42
42
|
onLocaleChange(locale: string): Promise<void> | void;
|
|
43
43
|
detectLocale(req: HttpRequest<any, any>): string;
|
|
44
|
+
/**
|
|
45
|
+
* The legacy `prefetch` dictionaries for `locale` on `scope`, or `{}` when
|
|
46
|
+
* there are none: an app without translations, a locale it has none for, or
|
|
47
|
+
* a page no dictionary is prefetched for (#1199).
|
|
48
|
+
*/
|
|
44
49
|
getPageTranslations(locale: string, scope: string): any;
|
|
45
50
|
}
|
|
46
51
|
//# sourceMappingURL=Translator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Translator.d.ts","sourceRoot":"","sources":["../../i18n/Translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB,qBAAa,UAAU;IAMF,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IALtD,MAAM,CAAC,KAAK,SAAgB;IAE5B,YAAY,KAAM;IAClB,SAAS,UAAS;gBAEC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IA6BtD;;;;;;;;;;OAUG;IACH,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAEhD;IAED,+EAA+E;IAC/E,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;OAKG;IACH,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAUrE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAOxD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIpD,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC;IA8BvC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"Translator.d.ts","sourceRoot":"","sources":["../../i18n/Translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB,qBAAa,UAAU;IAMF,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IALtD,MAAM,CAAC,KAAK,SAAgB;IAE5B,YAAY,KAAM;IAClB,SAAS,UAAS;gBAEC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IA6BtD;;;;;;;;;;OAUG;IACH,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAEhD;IAED,+EAA+E;IAC/E,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;OAKG;IACH,cAAc,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAUrE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAOxD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIpD,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC;IA8BvC;;;;OAIG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAGlD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{da as y,ea as p}from"../chunk-
|
|
2
|
+
import{da as y,ea as p}from"../chunk-c601phyd.js";import{va as c,wa as d,ya as l}from"../chunk-mvd4mc8p.js";import{$k as e,al as i,cl as t,dl as r,el as o,fl as n,gl as a,hl as s}from"../chunk-rnjjn09d.js";import"../chunk-fzy1z97a.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=E1B506DAE2A1EA9D64756E2164756E21
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{da as T}from"../chunk-
|
|
2
|
+
import{da as T}from"../chunk-c601phyd.js";import"../chunk-mvd4mc8p.js";import{bb as D}from"../chunk-tgbky7fc.js";import{je as b,ke as w}from"../chunk-2z160r1b.js";import"../chunk-vqq0z746.js";import{hf as j}from"../chunk-7xy7ebkx.js";import"../chunk-4f2xy9ws.js";import"../chunk-7sadg8d7.js";import"../chunk-es05kqtp.js";import"../chunk-2qbfvb6m.js";import"../chunk-zzmgz14a.js";import"../chunk-kzy4pyqb.js";import"../chunk-ecyq52t3.js";import"../chunk-kjgy7sk0.js";import"../chunk-g1th116z.js";import"../chunk-mnmz8n5k.js";import"../chunk-ng5qfkgp.js";import"../chunk-5qaxde5h.js";import"../chunk-htnbmbx1.js";import"../chunk-rnjjn09d.js";import{ol as V,pl as X,ql as E,rl as L,sl as R,tl as S}from"../chunk-yzazktke.js";import"../chunk-9ky5d5js.js";import"../chunk-a77w04sw.js";import"../chunk-qw6aa9fy.js";import"../chunk-y9pzr1wc.js";import"../chunk-nnn2f1ew.js";import"../chunk-xb9zjaes.js";import"../chunk-fzy1z97a.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=63C07FB293241F6D64756E2164756E21
|
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": "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",
|
|
10
|
-
"debugId": "
|
|
10
|
+
"debugId": "63C07FB293241F6D64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fa as E}from"../chunk-
|
|
2
|
+
import{Fa as E}from"../chunk-zcmfkb9f.js";import{ab as p}from"../chunk-j84r2j7a.js";import{bb as H}from"../chunk-tgbky7fc.js";import{Cb as L,Db as Q,Eb as T,Ib as U,Jb as y,Kb as F,Lb as C,Mb as D,Nb as I,Qb as b,Tb as f,Ub as k,Vb as m,ob as g,pb as W,qb as _,rb as l,sb as P,tb as u,ub as $,vb as V,wb as q,xb as B,yb as K}from"../chunk-nbry43s8.js";import"../chunk-2g2cntdm.js";import"../chunk-sxww1ka5.js";import"../chunk-mndcq5z1.js";import{de as h}from"../chunk-dbe8zgyb.js";import"../chunk-2z160r1b.js";import"../chunk-vqq0z746.js";import{Ge as a,He as d,Ig as w,Mg as A,Qg as R,af as n,bf as v}from"../chunk-7xy7ebkx.js";import"../chunk-4f2xy9ws.js";import"../chunk-7sadg8d7.js";import"../chunk-es05kqtp.js";import"../chunk-2qbfvb6m.js";import"../chunk-zzmgz14a.js";import"../chunk-kzy4pyqb.js";import{Dj as M}from"../chunk-ecyq52t3.js";import"../chunk-kjgy7sk0.js";import"../chunk-g1th116z.js";import"../chunk-mnmz8n5k.js";import"../chunk-ng5qfkgp.js";import"../chunk-5qaxde5h.js";import"../chunk-htnbmbx1.js";import"../chunk-rnjjn09d.js";import"../chunk-pvx66dq2.js";import"../chunk-yzazktke.js";import{ul as O,wl as z}from"../chunk-9ky5d5js.js";import"../chunk-a77w04sw.js";import"../chunk-qw6aa9fy.js";import"../chunk-y9pzr1wc.js";import"../chunk-nnn2f1ew.js";import"../chunk-xb9zjaes.js";import"../chunk-fzy1z97a.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 z;boot(){if(this.models.length>0)p(...this.models);else s();this.app.config.merge(this.config),z.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 G of this.services){let J=typeof G==="function"?new G:G,x=J.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,J),this.serviceInstances.push(J),this.serviceTokens.add(x.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),l(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(),z.getInstance()===this.app)z.setInstance(void 0);O.disable()}}function s(){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{Fa as E}from"../chunk-6efjnt6r.js";import{ab as p}from"../chunk-pg5hm00s.
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{d as oneTimeSecretMatches,a as hashOneTimeSecret,N as frameworkProviders,v as UserProvider,n as SESSION_SELECT,S as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=0D26E58684F56AE564756E2164756E21
|
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 }\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": "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",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "0D26E58684F56AE564756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/orm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ca as v6}from"../chunk-dn20caf2.js";import{$a as w6,Ga as J9,Ha as Y9,Ia as l,Ja as b9,Ka as b3,La as S6,Ma as b6,Na as q0,Oa as e5,Pa as q3,Qa as q6,Ra as Z3,Sa as I0,Ta as e4,Ua as $7,Va as Z7,Wa as d5,Xa as X7,Ya as z7,Za as J7,_a as E6,ab as x6}from"../chunk-pg5hm00s.js";import{qh as U6,rh as N6,sh as F6,th as O6,uh as A6}from"../chunk-j56zk5a0.js";import{Bh as R,Ch as x,Dh as c,Eh as Q6,Fh as _6,Gh as z5,Hh as C6,Ih as u3,Jh as k,Kh as L6,Lh as T6,Mh as R6,Nh as I6,Oh as a5,vh as A0,wh as o,xh as j,yh as n}from"../chunk-p4eger3g.js";import"../chunk-dfmxvp8p.js";import{Aj as y0,Cj as j6,Dj as K6,Ij as l4,Jj as o4,Kj as t4,Lj as r4,Mj as a4,wj as H6,xj as a,yj as d,zj as D3}from"../chunk-g02gqhq0.js";import{$j as z6,Nj as K,Oj as T,Pj as k0,Qj as g,Rj as a8,Sj as $0,Tj as e8,Uj as c5,Vj as $6,Wj as C5,Xj as Z6,Zj as X6,_j as s5,ak as J6,bk as i5,ck as T3,dk as f0,ek as d3,fk as c3,gk as s,hk as Y6,ik as g0,jk as n5}from"../chunk-1705yamg.js";import{Ak as l5,Bk as o5,Ck as m5,Dk as A3,Ek as P6,Fk as t5,Gk as r5,qk as W6,rk as $3,sk as T0,tk as O3,wk as M6,yk as B6,zk as D6}from"../chunk-wvq3c25z.js";import{Rk as V6,Tk as G6,Vk as p5}from"../chunk-ftvc1a0k.js";import{tl as u5}from"../chunk-ermvtpy9.js";import"../chunk-1x23scpn.js";import"../chunk-vgxkt9vd.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,C)=>{let F=`${W}${X.quoteIdent(X3(H,Z,G.childFields[C]))}`,N=`${J}${X.quoteIdent(X3($,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(X3(H,Z,G.childFields[0]))}`,D=`${J}${X.quoteIdent(X3($,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 X3($,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=z3($);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 v3($){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||v3(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 k3($,Z,X){u($,Z,{model:$.name,operation:X,argument:"where"})}function z3($){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(K7($,H,X,G));continue}if(Y==="NOT"){let W=z9($,H,X,G,"AND");if(W)J.push(R(j("not "),w0(W)));continue}if(Y in $.relations){let W=D7($,$.relations[Y],H,X,G);if(W)J.push(W);continue}let V=$.fields[Y];if(!V){let W=j7($,Y,H,X,G);if(W){J.push(W);continue}throw new g(Y,$.name,Object.keys($.fields))}J.push(m3($,V,H,X,G))}if(J.length===0)return null;if(J.length===1)return J[0];return t(J," and ")}function D7($,Z,X,z,J){let Y=J9(Z.kind),H=P7($,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 C of Y){if(!(C in H))continue;let F=H[C],N=(I)=>H.direct?J(I):J(I)?.[C];if(F===null){Q.push(f3(M,D,null,C==="is"));continue}let L=f(B,F,P,N);if(C==="every"){if(!L)continue;Q.push(f3(M,D,R(j("not "),w0(L)),!0));continue}let _=C==="none"||C==="isNot";Q.push(f3(M,D,L,_))}if(Q.length===0)return null;if(Q.length===1)return Q[0];return t(Q," and ")}function f3($,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 P7($,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 j7($,Z,X,z,J){let Y=z3($).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(!v3(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(m3($,$.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 w0($){return $.text.startsWith("(")?$:t([$],"")}var h3=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 K7($,Z,X,z){let{dialect:J}=X,H=Q7($,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 Q7($,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 _7=["equals","has","hasEvery","hasSome","isEmpty"],g3=new Set(_7);function C7($,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(!p3(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list. Expected an object holding ${[...g3].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(!g3.has(W))throw new T(`where.${Z.name}.${W}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a list filter takes ${[...g3].sort().join(", ")}. The scalar operators \u2014 `+`${[...h3].sort().join(", ")} \u2014 apply to a single value and `+"Prisma does not offer them here.");let B=(D)=>Y(D)?.[W];V.push(L7($,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 L7($,Z,X,z,J,Y,H){let{dialect:G}=Y;if(z==="equals")return T7($,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=R7(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 T7($,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 R7($){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 I7=["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"],y3=new Set(I7),U7=["has_key","has_some_keys","has_every_key"],J3=new Set(U7);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 N7($,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.`);S7($,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 ${[...y3,...J3].sort().join(", ")}. Prisma refuses a bare path too.`);let W=[];for(let M of V){if(J3.has(M)){W.push(M9($,Z,X,M,z[M],J,G,(P)=>Y(P)?.[M]));continue}if(!y3.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`A JSON path filter takes ${[...y3,...J3].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(F7(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,`${x0(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: ${x0(D)} } }, `+"or filter the column itself \u2014 "+`{ ${Z.name}: { equals: ${x0(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 } }.`);O7(M,B,$,Z,J),W.push(A7(M,X,G,Z,H,(P)=>Y(P)?.[M]))}return W.length===1?W[0]:t(W," and ")}function F7($,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(u3,z)));if($==="db")return H();if($==="json")return G();return t([G(),H()],Y?" and ":" or ")}function O7($,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 A7($,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 S7($,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 m3($,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,`${x0(G)} is not a filter on `+"its own \u2014 Prisma rejects it here too. Write it as an explicit "+`comparison: { ${Z.name}: { equals: ${x0(G)} } }.`);if(Z.isList)return C7($,Z,H,X,z,J);if(!p3(X))return Y3(H,Z,X,Y,J);let V=X,W=Object.keys(V).sort();if(V.path!==void 0)return N7($,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"&&J3.has(D)){B.push(M9($,Z,H,D,P,z,void 0,(C)=>J(C)?.[D]));continue}if(!h3.has(D))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`A scalar filter takes ${[...h3].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=(C)=>J(C)?.[D];switch(D){case"equals":B.push(Y3(H,Z,P,Y,Q));break;case"not":B.push(b7($,Z,P,z,Q,H));break;case"in":case"notIn":B.push(E7($,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,w7(D,Q)));break}}if(B.length===0)return j("true");if(B.length===1)return B[0];return t(B," and ")}function x0($){return`Prisma.${$==="db"?"DbNull":$==="json"?"JsonNull":"AnyNull"}`}function B9($){if(k($)==="any")return!0;return Array.isArray($)&&$.some((Z)=>k(Z)==="any")}function b7($,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 "),w0(Y3(Y,Z,X,z.dialect,J)));if(k(X)==="any")return R(j("not "),w0(Y3(Y,Z,X,z.dialect,J)));if(!p3(X))return R(j(`${Y} <> `),y(Z,z.dialect,F0(Z,z.dialect,J)));let H=m3($,Z,X,z,J);return R(j("not "),w0(H))}function Y3($,Z,X,z,J){if(X===null||k(X)==="db")return j(`${$} is null`);if(k(X)==="any")return t([j(`${$} is null`),q7($,Z,z)]," or ");return R(j(`${$} = `),y(Z,z,F0(Z,z,J)))}function q7($,Z,X){return R(j(`${$} = `),y(Z,X,()=>X.encode(u3,Z)))}function E7($,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 w7($,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 p3($){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((C)=>C!=="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=x7($,Z,B.child,M,V[M],z,B.qualifier,J),P=f(B.child,V.where,{dialect:J,operation:z,qualifier:B.qualifier},(C)=>Y(C)?.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 x7($,Z,X,z,J,Y,H,G){let V=`orderBy.${Z.name}.${z}`,{direction:W,nulls:M}=v7($,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 v7($,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 k7=new Set(["asc","desc"]),f7=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(!k7.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"||!f7.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 H3($){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 V3($,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)V3($.name,Z,"take","take",X.take);if(X?.skip!==void 0)V3($.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=H3(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 g7($,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 g7($,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 G3($,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"]),B3=10;function h0($){return[...new Set($.map((Z)=>Z.strategy))].sort()}function S0($,Z,X,z,J=P0){let Y=u0($,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 P3($,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 u0($,Z,X){if(Z===void 0||Z===null)return[];let{include:z,select:J}=Z;L9($,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 f0(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 L9($,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;L9($,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")){y7($,Z,X,H,J[H]);continue}if(Y?j9.has(H):K9.has(H))continue;if(H==="lock")throw new k0(`${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 y7($,Z,X,z,J){V3($.name,X,`${Z.as}.${z}`,z,J)}function s3($,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=u0($,Z,X);if(J.length===0)return;if(z>B3)throw new d3($.name,B3);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 u7($,Z,X);if(X.from.length>0)return Q9($,X,X.from,X.to,z);let J=h7($,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 h7($,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 u7($,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:[W3($,X)],childFields:[W3(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:[W3($,X)],childFields:[W3(Z,X)],join:{table:z,parentColumn:H,childColumn:H==="A"?"B":"A"}}}function W3($,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 M3($,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 c3($.name,X,z,D3());let J=d(z)?.$schema;if(!J)throw new g0(z);return J}var _9="batched",P0={name:_9,plan($){s3($,"this query planned with the batched strategy");let Z=B0($.parent,$.child,$.relation,$.operation);for(let Y of Z.parentFields)C9($.parent,$.relation,M3($.parent,$.relation,Y));for(let Y of Z.childFields)C9($.child,$.relation,M3($.child,$.relation,Y));let X=M3($.parent,$.relation,Z.parentFields[0]),z=M3($.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?p7($,Z,V):m7($,Z,V)}}}};async function m7($,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(v0(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 p7($,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 d7(Y,H,z.map((P)=>Y.encode(P[0],X.parentKeyField)),X.executor),V=new Map,W=[];for(let P of G){let Q=v0([Y.decode(P[H.parentColumn],X.parentKeyField)]),C=J.get(Q);if(!C)continue;let F=Y.decode(P[H.childColumn],X.childKeyField),N=v0([F]),L=V.get(N);if(L===void 0)L=[],V.set(N,L),W.push([F]);for(let _ of C)L.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(v0([P[Z.childFields[0]]]));if(!Q)continue;for(let C of Q)F9(C,$.as,P,X.many)}if(B.hidden)for(let P of D)delete P[Z.childFields[0]]}async function d7($,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])}}:c7(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 c7($,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 v0($){return JSON.stringify($.map(s7))}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=v0(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 s7($){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 C9($,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 i7($){S9=$}function n7(){return A9}function m0($,Z,X=[]){if(A9&&S9)return l7($,Z,X);return i3($,Z,X)}function i3($,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 l7($,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{ca as v6}from"../chunk-fyk66c5e.js";import{$a as w6,Ga as J9,Ha as Y9,Ia as l,Ja as b9,Ka as b3,La as S6,Ma as b6,Na as q0,Oa as e5,Pa as q3,Qa as q6,Ra as Z3,Sa as I0,Ta as e4,Ua as $7,Va as Z7,Wa as d5,Xa as X7,Ya as z7,Za as J7,_a as E6,ab as x6}from"../chunk-j84r2j7a.js";import{oh as U6,ph as N6,qh as F6,rh as O6,sh as A6}from"../chunk-4f2xy9ws.js";import{Ah as x,Bh as c,Ch as Q6,Dh as _6,Eh as z5,Fh as C6,Gh as u3,Hh as k,Ih as L6,Jh as T6,Kh as R6,Lh as I6,Mh as a5,th as A0,uh as o,vh as j,wh as n,zh as R}from"../chunk-7sadg8d7.js";import"../chunk-zzmgz14a.js";import{Aj as H6,Bj as a,Cj as d,Dj as D3,Ej as y0,Gj as j6,Hj as K6,Mj as l4,Nj as o4,Oj as t4,Pj as r4,Qj as a4}from"../chunk-ecyq52t3.js";import{$j as Z6,Rj as K,Sj as T,Tj as k0,Uj as g,Vj as a8,Wj as $0,Xj as e8,Yj as c5,Zj as $6,_j as C5,bk as X6,ck as s5,dk as z6,ek as J6,fk as i5,gk as T3,hk as f0,ik as d3,jk as c3,kk as s,lk as Y6,mk as g0,nk as n5}from"../chunk-kjgy7sk0.js";import{Ak as M6,Ck as B6,Dk as D6,Ek as l5,Fk as o5,Gk as m5,Hk as A3,Ik as P6,Jk as t5,Kk as r5,uk as W6,vk as $3,wk as T0,xk as O3}from"../chunk-5qaxde5h.js";import{Vk as V6,Xk as G6,Zk as p5}from"../chunk-htnbmbx1.js";import{xl as u5}from"../chunk-9ky5d5js.js";import"../chunk-a77w04sw.js";import"../chunk-fzy1z97a.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,C)=>{let F=`${W}${X.quoteIdent(X3(H,Z,G.childFields[C]))}`,N=`${J}${X.quoteIdent(X3($,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(X3(H,Z,G.childFields[0]))}`,D=`${J}${X.quoteIdent(X3($,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 X3($,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=z3($);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 v3($){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||v3(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 k3($,Z,X){u($,Z,{model:$.name,operation:X,argument:"where"})}function z3($){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(K7($,H,X,G));continue}if(Y==="NOT"){let W=z9($,H,X,G,"AND");if(W)J.push(R(j("not "),w0(W)));continue}if(Y in $.relations){let W=D7($,$.relations[Y],H,X,G);if(W)J.push(W);continue}let V=$.fields[Y];if(!V){let W=j7($,Y,H,X,G);if(W){J.push(W);continue}throw new g(Y,$.name,Object.keys($.fields))}J.push(m3($,V,H,X,G))}if(J.length===0)return null;if(J.length===1)return J[0];return t(J," and ")}function D7($,Z,X,z,J){let Y=J9(Z.kind),H=P7($,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 C of Y){if(!(C in H))continue;let F=H[C],N=(I)=>H.direct?J(I):J(I)?.[C];if(F===null){Q.push(f3(M,D,null,C==="is"));continue}let L=f(B,F,P,N);if(C==="every"){if(!L)continue;Q.push(f3(M,D,R(j("not "),w0(L)),!0));continue}let _=C==="none"||C==="isNot";Q.push(f3(M,D,L,_))}if(Q.length===0)return null;if(Q.length===1)return Q[0];return t(Q," and ")}function f3($,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 P7($,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 j7($,Z,X,z,J){let Y=z3($).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(!v3(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(m3($,$.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 w0($){return $.text.startsWith("(")?$:t([$],"")}var h3=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 K7($,Z,X,z){let{dialect:J}=X,H=Q7($,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 Q7($,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 _7=["equals","has","hasEvery","hasSome","isEmpty"],g3=new Set(_7);function C7($,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(!p3(z))throw new T(`where.${Z.name}`,$.name,J.operation,`'${Z.name}' is a scalar list. Expected an object holding ${[...g3].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(!g3.has(W))throw new T(`where.${Z.name}.${W}`,$.name,J.operation,`'${Z.name}' is a scalar list, and a list filter takes ${[...g3].sort().join(", ")}. The scalar operators \u2014 `+`${[...h3].sort().join(", ")} \u2014 apply to a single value and `+"Prisma does not offer them here.");let B=(D)=>Y(D)?.[W];V.push(L7($,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 L7($,Z,X,z,J,Y,H){let{dialect:G}=Y;if(z==="equals")return T7($,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=R7(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 T7($,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 R7($){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 I7=["equals","not","string_contains","string_starts_with","string_ends_with","array_contains","lt","lte","gt","gte"],y3=new Set(I7),U7=["has_key","has_some_keys","has_every_key"],J3=new Set(U7);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 N7($,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.`);S7($,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 ${[...y3,...J3].sort().join(", ")}. Prisma refuses a bare path too.`);let W=[];for(let M of V){if(J3.has(M)){W.push(M9($,Z,X,M,z[M],J,G,(P)=>Y(P)?.[M]));continue}if(!y3.has(M))throw new K(`${Z.name}.${M}`,$.name,J.operation,`A JSON path filter takes ${[...y3,...J3].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(F7(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,`${x0(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: ${x0(D)} } }, `+"or filter the column itself \u2014 "+`{ ${Z.name}: { equals: ${x0(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 } }.`);O7(M,B,$,Z,J),W.push(A7(M,X,G,Z,H,(P)=>Y(P)?.[M]))}return W.length===1?W[0]:t(W," and ")}function F7($,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(u3,z)));if($==="db")return H();if($==="json")return G();return t([G(),H()],Y?" and ":" or ")}function O7($,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 A7($,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 S7($,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 m3($,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,`${x0(G)} is not a filter on `+"its own \u2014 Prisma rejects it here too. Write it as an explicit "+`comparison: { ${Z.name}: { equals: ${x0(G)} } }.`);if(Z.isList)return C7($,Z,H,X,z,J);if(!p3(X))return Y3(H,Z,X,Y,J);let V=X,W=Object.keys(V).sort();if(V.path!==void 0)return N7($,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"&&J3.has(D)){B.push(M9($,Z,H,D,P,z,void 0,(C)=>J(C)?.[D]));continue}if(!h3.has(D))throw new T(`where.${Z.name}.${D}`,$.name,z.operation,`A scalar filter takes ${[...h3].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=(C)=>J(C)?.[D];switch(D){case"equals":B.push(Y3(H,Z,P,Y,Q));break;case"not":B.push(b7($,Z,P,z,Q,H));break;case"in":case"notIn":B.push(E7($,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,w7(D,Q)));break}}if(B.length===0)return j("true");if(B.length===1)return B[0];return t(B," and ")}function x0($){return`Prisma.${$==="db"?"DbNull":$==="json"?"JsonNull":"AnyNull"}`}function B9($){if(k($)==="any")return!0;return Array.isArray($)&&$.some((Z)=>k(Z)==="any")}function b7($,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 "),w0(Y3(Y,Z,X,z.dialect,J)));if(k(X)==="any")return R(j("not "),w0(Y3(Y,Z,X,z.dialect,J)));if(!p3(X))return R(j(`${Y} <> `),y(Z,z.dialect,F0(Z,z.dialect,J)));let H=m3($,Z,X,z,J);return R(j("not "),w0(H))}function Y3($,Z,X,z,J){if(X===null||k(X)==="db")return j(`${$} is null`);if(k(X)==="any")return t([j(`${$} is null`),q7($,Z,z)]," or ");return R(j(`${$} = `),y(Z,z,F0(Z,z,J)))}function q7($,Z,X){return R(j(`${$} = `),y(Z,X,()=>X.encode(u3,Z)))}function E7($,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 w7($,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 p3($){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((C)=>C!=="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=x7($,Z,B.child,M,V[M],z,B.qualifier,J),P=f(B.child,V.where,{dialect:J,operation:z,qualifier:B.qualifier},(C)=>Y(C)?.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 x7($,Z,X,z,J,Y,H,G){let V=`orderBy.${Z.name}.${z}`,{direction:W,nulls:M}=v7($,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 v7($,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 k7=new Set(["asc","desc"]),f7=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(!k7.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"||!f7.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 H3($){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 V3($,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)V3($.name,Z,"take","take",X.take);if(X?.skip!==void 0)V3($.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=H3(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 g7($,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 g7($,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 G3($,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"]),B3=10;function h0($){return[...new Set($.map((Z)=>Z.strategy))].sort()}function S0($,Z,X,z,J=P0){let Y=u0($,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 P3($,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 u0($,Z,X){if(Z===void 0||Z===null)return[];let{include:z,select:J}=Z;L9($,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 f0(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 L9($,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;L9($,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")){y7($,Z,X,H,J[H]);continue}if(Y?j9.has(H):K9.has(H))continue;if(H==="lock")throw new k0(`${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 y7($,Z,X,z,J){V3($.name,X,`${Z.as}.${z}`,z,J)}function s3($,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=u0($,Z,X);if(J.length===0)return;if(z>B3)throw new d3($.name,B3);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 u7($,Z,X);if(X.from.length>0)return Q9($,X,X.from,X.to,z);let J=h7($,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 h7($,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 u7($,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:[W3($,X)],childFields:[W3(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:[W3($,X)],childFields:[W3(Z,X)],join:{table:z,parentColumn:H,childColumn:H==="A"?"B":"A"}}}function W3($,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 M3($,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 c3($.name,X,z,D3());let J=d(z)?.$schema;if(!J)throw new g0(z);return J}var _9="batched",P0={name:_9,plan($){s3($,"this query planned with the batched strategy");let Z=B0($.parent,$.child,$.relation,$.operation);for(let Y of Z.parentFields)C9($.parent,$.relation,M3($.parent,$.relation,Y));for(let Y of Z.childFields)C9($.child,$.relation,M3($.child,$.relation,Y));let X=M3($.parent,$.relation,Z.parentFields[0]),z=M3($.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?p7($,Z,V):m7($,Z,V)}}}};async function m7($,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(v0(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 p7($,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 d7(Y,H,z.map((P)=>Y.encode(P[0],X.parentKeyField)),X.executor),V=new Map,W=[];for(let P of G){let Q=v0([Y.decode(P[H.parentColumn],X.parentKeyField)]),C=J.get(Q);if(!C)continue;let F=Y.decode(P[H.childColumn],X.childKeyField),N=v0([F]),L=V.get(N);if(L===void 0)L=[],V.set(N,L),W.push([F]);for(let _ of C)L.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(v0([P[Z.childFields[0]]]));if(!Q)continue;for(let C of Q)F9(C,$.as,P,X.many)}if(B.hidden)for(let P of D)delete P[Z.childFields[0]]}async function d7($,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])}}:c7(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 c7($,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 v0($){return JSON.stringify($.map(s7))}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=v0(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 s7($){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 C9($,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 i7($){S9=$}function n7(){return A9}function m0($,Z,X=[]){if(A9&&S9)return l7($,Z,X);return i3($,Z,X)}function i3($,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 l7($,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{ca as v6}from"../chunk-dn20caf2.js";import{$a as w6,Ga as J9,Ha as Y9,Ia
|
|
|
12
12
|
Columns marked [sensitive] hold secrets: never select them.`:"";return X.join(`
|
|
13
13
|
`)+z}function n8($){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 l8($){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 o8($,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 t8($){return typeof $==="object"&&$!==null&&typeof $.name==="string"&&typeof $.table==="string"&&typeof $.fields==="object"&&typeof $.relations==="object"}function r8($){if($!==void 0)return(Array.isArray($)?$:Object.values($)).filter(t8);let Z=new Set,X=[];for(let z of D3()){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,O6 as unsafeSql,D6 as transactionDepth,N3 as track,h0 as strategiesOf,U6 as sql,q8 as softDeletes,w8 as softDeleteMany,E8 as softDelete,n7 as shaperCompilationAvailable,i7 as setShaperCompilation,t5 as runAsUser,o5 as runAsSystem,v6 as rotateEncryptedColumns,a3 as resolveStrategy,F3 as resnapshot,A6 as renderFragment,y0 as registry,x6 as registerModels,H6 as register,q6 as redactNullable,R0 as provenanceOf,b3 as policyContext,q0 as policiesFor,S0 as planRelations,k4 as planKey,F8 as planCacheStats,s8 as paginate,R6 as ormSupports,W6 as ormContext,i0 as lateralStrategy,k as jsonNullKind,N6 as join,$6 as isUniqueConstraintError,S8 as isTracked,l5 as isSystemScope,e8 as isRecordNotFoundError,i9 as isClientSideDefault,n0 as hasClientSideValue,a0 as getOrCompile,I6 as everyDialect,F6 as empty,a5 as dialectFor,M7 as describeSchemaModels,i8 as describeSchema,p9 as defaultStrategy,Z3 as currentUser,$3 as currentTransaction,P6 as currentActor,t9 as createUuid,o9 as createUlid,l9 as createNanoid,n9 as createCuid,A0 as createBindContext,T5 as compileWrite,r3 as compileRead,x5 as compile,J5 as clientSideValue,O8 as clearPlanCache,g5 as changedFields,V0 as canonicalShape,m0 as buildRowShaper,i3 as buildInterpretedShaper,P0 as batchedStrategy,w6 as auditModelRegistrations,P3 as attachRelations,D2 as assertSchemaArtifactVersion,E6 as assertPoliciesRegistered,q3 as applyRedaction,e5 as applyPolicies,M6 as afterCommit,K as UnsupportedQueryError,T6 as UnsupportedDialectError,k0 as UnsupportedByDesignError,c3 as UnregisteredRelationTargetError,s5 as UnregisteredPolicyClassError,f0 as UnknownRelationError,g as UnknownFieldError,V6 as UnknownConnectionError,c5 as UniqueConstraintError,B6 as TransactionDependencyError,$5 as StaleSchemaArtifactError,L6 as SqliteDialect,b6 as ScopedPolicy,X6 as ScopeEscapeError,A5 as ScalarColumnError,B2 as SCHEMA_ARTIFACT_VERSION,C5 as ReturningUnsupportedError,d3 as RelationDepthExceededError,$0 as RecordNotFoundError,Q6 as PostgresDialect,Z6 as PolicyDeniedError,S6 as Policy,i5 as ParameterLimitError,Y6 as ModelNotRegisteredError,E3 as Model,T3 as MissingRequiredValueError,g0 as MissingModelSchemaError,s as MalformedRelationError,B3 as MAX_RELATION_DEPTH,n5 as LockOutsideTransactionError,z5 as JsonNull,O5 as JsonColumnError,z6 as InvalidPolicyEntryError,T as InvalidArgumentError,j6 as EncryptionKeyError,K6 as DecryptionError,a8 as DecodeError,_6 as DbNull,G6 as CrossConnectionTransactionError,C6 as AnyNull,J6 as AmbiguousModelRegistrationError,G7 as ActiveRecordModel};
|
|
14
14
|
|
|
15
|
-
//# debugId=
|
|
15
|
+
//# debugId=584BEB7D2CD210F064756E2164756E21
|