gemi 0.54.3 → 0.55.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.
Files changed (211) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/app/index.js.map +1 -1
  3. package/dist/broadcasting/index.js +1 -1
  4. package/dist/bun/plugin.js +2 -2
  5. package/dist/bun/plugin.js.map +1 -1
  6. package/dist/bun/preload.js +2 -2
  7. package/dist/bun/preload.js.map +2 -2
  8. package/dist/{chunk-0weeq0ke.js → chunk-01am9k5v.js} +2 -2
  9. package/dist/{chunk-0weeq0ke.js.map → chunk-01am9k5v.js.map} +1 -1
  10. package/dist/chunk-02gdzs5t.js +4 -0
  11. package/dist/{chunk-4qkzdyj7.js.map → chunk-02gdzs5t.js.map} +1 -1
  12. package/dist/{chunk-71m47kad.js → chunk-1pwwrpa3.js} +2 -2
  13. package/dist/{chunk-71m47kad.js.map → chunk-1pwwrpa3.js.map} +2 -2
  14. package/dist/{chunk-h7mcwfg5.js → chunk-1zfsgffv.js} +4 -4
  15. package/dist/{chunk-h7mcwfg5.js.map → chunk-1zfsgffv.js.map} +2 -2
  16. package/dist/{chunk-kz39hphm.js → chunk-31kcf7dq.js} +3 -3
  17. package/dist/{chunk-kz39hphm.js.map → chunk-31kcf7dq.js.map} +1 -1
  18. package/dist/chunk-33wjsw4r.js +66 -0
  19. package/dist/{chunk-tpyhhdq5.js.map → chunk-33wjsw4r.js.map} +4 -54
  20. package/dist/{chunk-50vm7x98.js → chunk-3e88tyee.js} +3 -3
  21. package/dist/{chunk-50vm7x98.js.map → chunk-3e88tyee.js.map} +1 -1
  22. package/dist/{chunk-xxw0gz4q.js → chunk-3y75q5a2.js} +2 -2
  23. package/dist/{chunk-xxw0gz4q.js.map → chunk-3y75q5a2.js.map} +1 -1
  24. package/dist/chunk-4qwwy968.js +4 -0
  25. package/dist/{chunk-1snh7yc4.js.map → chunk-4qwwy968.js.map} +2 -2
  26. package/dist/{chunk-1sh6kqjn.js → chunk-4t80js0n.js} +3 -3
  27. package/dist/{chunk-1sh6kqjn.js.map → chunk-4t80js0n.js.map} +1 -1
  28. package/dist/chunk-4xx78ba9.js +4 -0
  29. package/dist/{chunk-r9z5rrk0.js.map → chunk-4xx78ba9.js.map} +2 -2
  30. package/dist/{chunk-g5tj10p8.js → chunk-4yafsffx.js} +2 -2
  31. package/dist/{chunk-g5tj10p8.js.map → chunk-4yafsffx.js.map} +1 -1
  32. package/dist/{chunk-gn9zjgep.js → chunk-5ad8era8.js} +2 -2
  33. package/dist/{chunk-gn9zjgep.js.map → chunk-5ad8era8.js.map} +1 -1
  34. package/dist/{chunk-3bw1jk21.js → chunk-62723jyy.js} +1 -1
  35. package/dist/chunk-62ke19q4.js +13 -0
  36. package/dist/chunk-62ke19q4.js.map +222 -0
  37. package/dist/{chunk-004bcmsa.js → chunk-64s1pzz1.js} +2 -2
  38. package/dist/{chunk-004bcmsa.js.map → chunk-64s1pzz1.js.map} +1 -1
  39. package/dist/{chunk-dwx2y7br.js → chunk-699z6d8y.js} +4 -4
  40. package/dist/{chunk-dwx2y7br.js.map → chunk-699z6d8y.js.map} +2 -2
  41. package/dist/{chunk-4zmcbmf9.js → chunk-77xj0dgc.js} +2 -2
  42. package/dist/{chunk-4zmcbmf9.js.map → chunk-77xj0dgc.js.map} +1 -1
  43. package/dist/{chunk-bb3zvxsf.js → chunk-8k1zqrvh.js} +3 -3
  44. package/dist/{chunk-bb3zvxsf.js.map → chunk-8k1zqrvh.js.map} +1 -1
  45. package/dist/{chunk-9nskvzpv.js → chunk-98a576s9.js} +3 -3
  46. package/dist/{chunk-9nskvzpv.js.map → chunk-98a576s9.js.map} +1 -1
  47. package/dist/{chunk-cz3szqhq.js → chunk-9c89q2mz.js} +3 -3
  48. package/dist/{chunk-cz3szqhq.js.map → chunk-9c89q2mz.js.map} +1 -1
  49. package/dist/chunk-9r0sb4zn.js +5 -0
  50. package/dist/{chunk-efsk1wy0.js.map → chunk-9r0sb4zn.js.map} +2 -2
  51. package/dist/chunk-9r1atj8w.js +6 -0
  52. package/dist/{chunk-p8fm3tjy.js.map → chunk-9r1atj8w.js.map} +2 -2
  53. package/dist/chunk-b50zmz3t.js +5 -0
  54. package/dist/{chunk-113khwbw.js.map → chunk-b50zmz3t.js.map} +1 -1
  55. package/dist/chunk-cn2r5jfj.js +5 -0
  56. package/dist/{chunk-dxw8k6f1.js.map → chunk-cn2r5jfj.js.map} +2 -2
  57. package/dist/{chunk-nncwsdzz.js → chunk-ct274qts.js} +2 -2
  58. package/dist/{chunk-nncwsdzz.js.map → chunk-ct274qts.js.map} +1 -1
  59. package/dist/{chunk-jp4pf3yt.js → chunk-d36dfqxw.js} +4 -4
  60. package/dist/{chunk-jp4pf3yt.js.map → chunk-d36dfqxw.js.map} +2 -2
  61. package/dist/chunk-dzzmqv0j.js +5 -0
  62. package/dist/{chunk-f13f68c0.js.map → chunk-dzzmqv0j.js.map} +2 -2
  63. package/dist/{chunk-f418jh9k.js → chunk-ejrcyzx8.js} +2 -2
  64. package/dist/{chunk-f418jh9k.js.map → chunk-ejrcyzx8.js.map} +1 -1
  65. package/dist/chunk-enhkf60v.js +9 -0
  66. package/dist/chunk-enhkf60v.js.map +12 -0
  67. package/dist/{chunk-n1tkn8gv.js → chunk-eqrd31ye.js} +2 -2
  68. package/dist/{chunk-n1tkn8gv.js.map → chunk-eqrd31ye.js.map} +1 -1
  69. package/dist/{chunk-k14dmqwh.js → chunk-f9mfw82d.js} +3 -3
  70. package/dist/{chunk-k14dmqwh.js.map → chunk-f9mfw82d.js.map} +1 -1
  71. package/dist/{chunk-kv2ep453.js → chunk-g30q4n5y.js} +18 -19
  72. package/dist/{chunk-kv2ep453.js.map → chunk-g30q4n5y.js.map} +4 -8
  73. package/dist/chunk-gasdfwva.js +4 -0
  74. package/dist/{chunk-c0wcsmpj.js.map → chunk-gasdfwva.js.map} +2 -2
  75. package/dist/{chunk-c22vcxty.js → chunk-gzdf2025.js} +2 -2
  76. package/dist/{chunk-c22vcxty.js.map → chunk-gzdf2025.js.map} +2 -2
  77. package/dist/{chunk-ms8qd7da.js → chunk-h3mwgbg7.js} +3 -3
  78. package/dist/{chunk-ms8qd7da.js.map → chunk-h3mwgbg7.js.map} +1 -1
  79. package/dist/{chunk-6j1z2cqt.js → chunk-hs5v3eqj.js} +2 -2
  80. package/dist/{chunk-6j1z2cqt.js.map → chunk-hs5v3eqj.js.map} +1 -1
  81. package/dist/chunk-javjeayw.js +5 -0
  82. package/dist/{chunk-jdgvdddd.js.map → chunk-javjeayw.js.map} +2 -2
  83. package/dist/chunk-jdj7k3r9.js +4 -0
  84. package/dist/{chunk-hk067634.js.map → chunk-jdj7k3r9.js.map} +2 -2
  85. package/dist/chunk-kgg1eqne.js +4 -0
  86. package/dist/{chunk-hrrmxreg.js.map → chunk-kgg1eqne.js.map} +2 -2
  87. package/dist/{chunk-7f5ad759.js → chunk-kgmr9qxx.js} +2 -2
  88. package/dist/{chunk-7f5ad759.js.map → chunk-kgmr9qxx.js.map} +1 -1
  89. package/dist/{chunk-pgjk5ft3.js → chunk-kry5vwam.js} +3 -3
  90. package/dist/{chunk-pgjk5ft3.js.map → chunk-kry5vwam.js.map} +1 -1
  91. package/dist/{chunk-r06rxn19.js → chunk-m0ggfy1m.js} +3 -3
  92. package/dist/{chunk-r06rxn19.js.map → chunk-m0ggfy1m.js.map} +1 -1
  93. package/dist/{chunk-bzhtymvv.js → chunk-npg72mez.js} +2 -2
  94. package/dist/{chunk-bzhtymvv.js.map → chunk-npg72mez.js.map} +1 -1
  95. package/dist/chunk-pvdbrt4z.js +5 -0
  96. package/dist/chunk-pvdbrt4z.js.map +13 -0
  97. package/dist/{chunk-e3mggavt.js → chunk-q0waxxz5.js} +2 -2
  98. package/dist/{chunk-e3mggavt.js.map → chunk-q0waxxz5.js.map} +1 -1
  99. package/dist/chunk-rgb69nh1.js +4 -0
  100. package/dist/{chunk-s6e7cvek.js.map → chunk-rgb69nh1.js.map} +2 -2
  101. package/dist/{chunk-jjvnmyw4.js → chunk-rjxdc0xh.js} +2 -2
  102. package/dist/{chunk-jjvnmyw4.js.map → chunk-rjxdc0xh.js.map} +2 -2
  103. package/dist/{chunk-sqp7kn7h.js → chunk-rsdg619q.js} +3 -3
  104. package/dist/{chunk-sqp7kn7h.js.map → chunk-rsdg619q.js.map} +1 -1
  105. package/dist/chunk-tja0c815.js +5 -0
  106. package/dist/{chunk-2pt6kyn9.js.map → chunk-tja0c815.js.map} +2 -2
  107. package/dist/{chunk-agabw2w1.js → chunk-tkdxv6cq.js} +2 -2
  108. package/dist/{chunk-agabw2w1.js.map → chunk-tkdxv6cq.js.map} +1 -1
  109. package/dist/chunk-tmnhkphv.js +19 -0
  110. package/dist/chunk-tmnhkphv.js.map +60 -0
  111. package/dist/{chunk-w6gb9gc5.js → chunk-v06qcyj5.js} +3 -3
  112. package/dist/{chunk-w6gb9gc5.js.map → chunk-v06qcyj5.js.map} +1 -1
  113. package/dist/{chunk-9taz1h3t.js → chunk-v6v6sem5.js} +3 -3
  114. package/dist/{chunk-9taz1h3t.js.map → chunk-v6v6sem5.js.map} +1 -1
  115. package/dist/{chunk-f4e7fh95.js → chunk-v7y8zm61.js} +3 -3
  116. package/dist/{chunk-f4e7fh95.js.map → chunk-v7y8zm61.js.map} +2 -2
  117. package/dist/{chunk-85av4ncy.js → chunk-vkngcrzq.js} +2 -2
  118. package/dist/{chunk-85av4ncy.js.map → chunk-vkngcrzq.js.map} +1 -1
  119. package/dist/chunk-w9k9s4wh.js +4 -0
  120. package/dist/{chunk-jb2nst6v.js.map → chunk-w9k9s4wh.js.map} +2 -2
  121. package/dist/chunk-wgpa04jb.js +5 -0
  122. package/dist/{chunk-6rhebm18.js.map → chunk-wgpa04jb.js.map} +2 -2
  123. package/dist/chunk-x14sk95v.js +9 -0
  124. package/dist/{chunk-k8endm5j.js.map → chunk-x14sk95v.js.map} +6 -6
  125. package/dist/chunk-xjy5apyr.js +4 -0
  126. package/dist/{chunk-07t0dmdg.js.map → chunk-xjy5apyr.js.map} +2 -2
  127. package/dist/{chunk-fcqc3e3r.js → chunk-xnytbrda.js} +2 -2
  128. package/dist/{chunk-fcqc3e3r.js.map → chunk-xnytbrda.js.map} +1 -1
  129. package/dist/chunk-y9fp58bg.js +4 -0
  130. package/dist/{chunk-br8ten26.js.map → chunk-y9fp58bg.js.map} +2 -2
  131. package/dist/{chunk-jb022m7n.js → chunk-yf8kxjr2.js} +2 -2
  132. package/dist/{chunk-jb022m7n.js.map → chunk-yf8kxjr2.js.map} +1 -1
  133. package/dist/config/index.js +1 -1
  134. package/dist/console/run.js +2 -2
  135. package/dist/console/run.js.map +1 -1
  136. package/dist/container/index.js +2 -2
  137. package/dist/container/index.js.map +1 -1
  138. package/dist/database/DatabaseManager.d.ts.map +1 -1
  139. package/dist/database/index.js +2 -2
  140. package/dist/database/index.js.map +1 -1
  141. package/dist/email/index.js +2 -2
  142. package/dist/email/index.js.map +1 -1
  143. package/dist/facades/Storage.d.ts +1 -1
  144. package/dist/facades/Storage.d.ts.map +1 -1
  145. package/dist/facades/index.js +2 -2
  146. package/dist/facades/index.js.map +1 -1
  147. package/dist/foundation/index.js +2 -2
  148. package/dist/foundation/index.js.map +1 -1
  149. package/dist/http/index.js +2 -2
  150. package/dist/http/index.js.map +1 -1
  151. package/dist/i18n/dictionaryRuntime.js +2 -2
  152. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  153. package/dist/i18n/index.js +2 -2
  154. package/dist/i18n/index.js.map +2 -2
  155. package/dist/kernel/index.js +2 -2
  156. package/dist/kernel/index.js.map +2 -2
  157. package/dist/orm/compile/relation-count.d.ts.map +1 -1
  158. package/dist/orm/corpus.d.ts.map +1 -1
  159. package/dist/orm/dialect/index.d.ts +32 -1
  160. package/dist/orm/dialect/index.d.ts.map +1 -1
  161. package/dist/orm/dialect/postgres.d.ts +14 -0
  162. package/dist/orm/dialect/postgres.d.ts.map +1 -1
  163. package/dist/orm/dialect/sqlite.d.ts +31 -0
  164. package/dist/orm/dialect/sqlite.d.ts.map +1 -1
  165. package/dist/orm/index.js +3 -3
  166. package/dist/orm/index.js.map +5 -5
  167. package/dist/orm/policy.d.ts.map +1 -1
  168. package/dist/orm/relation-filters.d.ts +24 -0
  169. package/dist/orm/relation-filters.d.ts.map +1 -1
  170. package/dist/orm/types.d.ts +129 -40
  171. package/dist/orm/types.d.ts.map +1 -1
  172. package/dist/server/index.js +2 -2
  173. package/dist/server/index.js.map +2 -2
  174. package/dist/services/email/drivers/ResendDriver.d.ts.map +1 -1
  175. package/dist/services/file-storage/drivers/S3Driver.d.ts +24 -1
  176. package/dist/services/file-storage/drivers/S3Driver.d.ts.map +1 -1
  177. package/dist/services/image-optimization/drivers/SharpDriver.d.ts.map +1 -1
  178. package/dist/services/index.js +9 -18
  179. package/dist/services/index.js.map +5 -99
  180. package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts.map +1 -1
  181. package/dist/services/redis/RedisManager.d.ts +19 -2
  182. package/dist/services/redis/RedisManager.d.ts.map +1 -1
  183. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  184. package/dist/support/index.js +2 -2
  185. package/dist/support/index.js.map +1 -1
  186. package/dist/support/sharp.d.ts +21 -0
  187. package/dist/support/sharp.d.ts.map +1 -0
  188. package/package.json +1 -1
  189. package/dist/chunk-07t0dmdg.js +0 -4
  190. package/dist/chunk-113khwbw.js +0 -5
  191. package/dist/chunk-1snh7yc4.js +0 -4
  192. package/dist/chunk-2pt6kyn9.js +0 -5
  193. package/dist/chunk-4qkzdyj7.js +0 -4
  194. package/dist/chunk-6rhebm18.js +0 -5
  195. package/dist/chunk-br8ten26.js +0 -4
  196. package/dist/chunk-c0wcsmpj.js +0 -4
  197. package/dist/chunk-dxw8k6f1.js +0 -5
  198. package/dist/chunk-efsk1wy0.js +0 -5
  199. package/dist/chunk-f13f68c0.js +0 -5
  200. package/dist/chunk-hk067634.js +0 -4
  201. package/dist/chunk-hrrmxreg.js +0 -4
  202. package/dist/chunk-jb2nst6v.js +0 -4
  203. package/dist/chunk-jdgvdddd.js +0 -5
  204. package/dist/chunk-k8endm5j.js +0 -9
  205. package/dist/chunk-p8fm3tjy.js +0 -6
  206. package/dist/chunk-r9z5rrk0.js +0 -4
  207. package/dist/chunk-s6e7cvek.js +0 -4
  208. package/dist/chunk-tpyhhdq5.js +0 -81
  209. package/dist/chunk-zckj6bs6.js +0 -9
  210. package/dist/chunk-zckj6bs6.js.map +0 -12
  211. /package/dist/{chunk-3bw1jk21.js.map → chunk-62723jyy.js.map} +0 -0
package/dist/app/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{u as a}from"../chunk-fcqc3e3r.js";import"../chunk-7f5ad759.js";export{a as App};
2
+ import{ra as a}from"../chunk-xnytbrda.js";import"../chunk-kgmr9qxx.js";export{a as App};
3
3
 
4
- //# debugId=3C617F3AC905609664756E2164756E21
4
+ //# debugId=F7647A953A166B1364756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "3C617F3AC905609664756E2164756E21",
7
+ "debugId": "F7647A953A166B1364756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-7f5ad759.js";class n{async subscribe(r){return!0}publish(r){return{}}}export{n as BroadcastingChannel};
2
+ import"../chunk-kgmr9qxx.js";class n{async subscribe(r){return!0}publish(r){return{}}}export{n as BroadcastingChannel};
3
3
 
4
4
  //# debugId=3E2D2EBC3796AA1A64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{g as a}from"../chunk-h7mcwfg5.js";import"../chunk-kz39hphm.js";import"../chunk-bb3zvxsf.js";import"../chunk-7f5ad759.js";export{a as gemiPlugin};
2
+ import{ca as a}from"../chunk-1zfsgffv.js";import"../chunk-31kcf7dq.js";import"../chunk-8k1zqrvh.js";import"../chunk-kgmr9qxx.js";export{a as gemiPlugin};
3
3
 
4
- //# debugId=4B1D72468CCAA79764756E2164756E21
4
+ //# debugId=DBAE3729A59FFE4464756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "4B1D72468CCAA79764756E2164756E21",
7
+ "debugId": "DBAE3729A59FFE4464756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{g as k}from"../chunk-h7mcwfg5.js";import"../chunk-kz39hphm.js";import{r as j}from"../chunk-f418jh9k.js";import"../chunk-bb3zvxsf.js";import"../chunk-7f5ad759.js";var{plugin:q}=globalThis.Bun;q(k());var y=await j(process.cwd());for(let x of y.bun?.plugins??[])q(x);
2
+ import{ca as k}from"../chunk-1zfsgffv.js";import"../chunk-31kcf7dq.js";import"../chunk-8k1zqrvh.js";import{oa as j}from"../chunk-ejrcyzx8.js";import"../chunk-kgmr9qxx.js";var{plugin:q}=globalThis.Bun;q(k());var y=await j(process.cwd());for(let x of y.bun?.plugins??[])q(x);
3
3
 
4
- //# debugId=43CD1E596F98328B64756E2164756E21
4
+ //# debugId=E8EDDD7A30C609E864756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import { plugin } from \"bun\";\nimport { gemiPlugin } from \"./plugin\";\nimport { loadGemiConfig } from \"../config/load\";\n\n// Registers gemi's custom-request transform plus any Bun plugins the app\n// declares in `gemi.config.ts` as Bun *runtime* plugins. Loaded via\n// `bun --hot|--preload gemi/bun/preload app/server.ts` (see the `dev`/`start`\n// commands in `bin/gemi.ts`) so controllers/routes are transformed on import —\n// the runtime counterpart to the same plugins passed to `Bun.build` in the\n// server build. Top-level `await` here completes before app code loads.\nplugin(gemiPlugin());\n\nconst config = await loadGemiConfig(process.cwd());\nfor (const p of config.bun?.plugins ?? []) {\n plugin(p);\n}\n"
6
6
  ],
7
- "mappings": ";6LAAA,wBAUA,HAAO,HAAW,JAAC,EAEnB,IAAM,EAAS,MAAM,EAAe,QAAQ,IAAI,CAAC,EACjD,QAAW,KAAK,EAAO,KAAK,SAAW,CAAC,EACtC,EAAO,CAAC",
8
- "debugId": "43CD1E596F98328B64756E2164756E21",
7
+ "mappings": ";+LAAA,wBAUA,HAAO,HAAW,JAAC,EAEnB,IAAM,EAAS,MAAM,EAAe,QAAQ,IAAI,CAAC,EACjD,QAAW,KAAK,EAAO,KAAK,SAAW,CAAC,EACtC,EAAO,CAAC",
8
+ "debugId": "E8EDDD7A30C609E864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -45,6 +45,6 @@ Say which, and registerModels will leave it alone:
45
45
  register("${j}", ${z[0]})
46
46
 
47
47
  A class that is only a typed view over the same rows belongs in a module you do not hand to registerModels.`);this.model=j;this.candidates=z;this.name="AmbiguousModelRegistrationError"}}class _ extends Error{model;operation;required;limit;dialect;constructor(j,z,A,B,D,F){super(`${j}.${z} would bind ${A} parameters, and the '${D}' driver accepts at most ${B} in one statement. ${F}`+(z==="createMany"?" A createMany over the ceiling is normally split across statements inside one transaction, so reaching this means splitting cannot help: a single row binds more than the driver accepts.":" Splitting is not something this operation can do for you \u2014 one "+"statement has to carry one answer. Narrow the query."));this.model=j;this.operation=z;this.required=A;this.limit=B;this.dialect=D;this.name="ParameterLimitError"}}class $ extends Error{model;operation;field;constructor(j,z,A){super(`${j}.${z} is missing a value for '${A}', which is required and has no default.`);this.model=j;this.operation=z;this.field=A;this.name="MissingRequiredValueError"}}class b extends Error{relation;model;constructor(j,z,A){super(`'${j}' is not a relation on model ${z}. `+(A.length>0?`Known relations: ${A.join(", ")}.`:`${z} declares no relations.`));this.relation=j;this.model=z;this.name="UnknownRelationError"}}class T extends Error{model;limit;constructor(j,z){super(`The include tree nests more than ${z} relations deep (at model ${j}). Deeply nested includes are legal, so this is a guard against a generated or malformed argument tree rather than a limit on `+"modelling \u2014 every level costs at least one query.");this.model=j;this.limit=z;this.name="RelationDepthExceededError"}}class x extends Error{model;relation;target;constructor(j,z,A,B){super(`${j}.${z} points at model '${A}', which nothing has registered. The generated artifact and the registry disagree: re-run \`prisma generate\`, and check that app/models/generated/index.ts is imported. `+(B.length>0?`Registered models: ${B.join(", ")}.`:"Nothing is registered at all."));this.model=j;this.relation=z;this.target=A;this.name="UnregisteredRelationTargetError"}}class C extends Error{model;relation;constructor(j,z,A){super(`Cannot resolve how ${j}.${z} joins: ${A} This means `+"app/models/generated is stale or hand-edited \u2014 re-run "+"`prisma generate`.");this.model=j;this.relation=z;this.name="MalformedRelationError"}}class N extends Error{constructor(j,z){super(`No model is registered under the name '${j}'. `+(z.length>0?`Registered models: ${z.join(", ")}.`:"Nothing is registered \u2014 is app/models/generated/index.ts imported?"));this.name="ModelNotRegisteredError"}}class v extends Error{constructor(j){super(`${j} has no $schema. Model subclasses must extend a generated base class from app/models/generated/models.ts.`);this.name="MissingModelSchemaError"}}
48
- export{H as we,L as xe,M as ye,O as ze,P as Ae,R as Be,I as Ce,y as De,S as Ee,V as Fe,W as Ge,X as He,Y as Ie,Z as Je,_ as Ke,$ as Le,b as Me,T as Ne,x as Oe,C as Pe,N as Qe,v as Re};
48
+ export{H as xe,L as ye,M as ze,O as Ae,P as Be,R as Ce,I as De,y as Ee,S as Fe,V as Ge,W as He,X as Ie,Y as Je,Z as Ke,_ as Le,$ as Me,b as Ne,T as Oe,x as Pe,C as Qe,N as Re,v as Se};
49
49
 
50
- //# debugId=9D67B83712D0BF3364756E2164756E21
50
+ //# debugId=BE9A06EF6D5FF97364756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "/**\n * Thrown when the compiler is handed an argument it does not implement yet.\n *\n * Every public operation accepts the full Prisma argument type from iteration 1\n * — signatures are final, capability grows underneath them. The price of that is\n * that anything unimplemented has to fail loudly: silently dropping a `take: 10`\n * and returning the whole table is the worst failure mode this ORM has.\n */\nexport class UnsupportedQueryError extends Error {\n constructor(\n public readonly argument: string,\n public readonly model: string,\n public readonly operation: string,\n /**\n * What cannot work, and what to do instead.\n *\n * **Required**, which is the second half of #61 — the first being the\n * `UnsupportedByDesignError` split beside this. It was optional, and the\n * refusals that omitted it were the highest-traffic ones: an argument the\n * operation does not accept, on the path a typo takes. Those said only\n * *that* something was refused, to the reader least likely to know why.\n *\n * Required rather than conventionally-supplied for the reason five other\n * parameters here are — `render`'s `origin`, `changedFields`' `schema`,\n * `RelationExecutor.exec`'s `preScoped`, `resolveLink`'s `operation`,\n * `assertPageArgument`'s reported name: where omitting an argument produces\n * a *worse* result rather than an error, `tsc` is the only thing that keeps\n * a convention. Ninety-five of a hundred call sites already passed one; the\n * five that did not are exactly the ones nobody revisited.\n *\n * `UnknownFieldError` and `UnknownRelationError` set the standard this\n * meets: both enumerate the valid names rather than only rejecting the\n * invalid one.\n */\n detail: string,\n ) {\n super(\n `gemi ORM does not support '${argument}' yet (${model}.${operation}). ` +\n detail,\n );\n this.name = \"UnsupportedQueryError\";\n }\n}\n\n/**\n * An argument the ORM has **decided not to implement**, as opposed to one it has\n * not implemented yet.\n *\n * The distinction is the whole point, and it is a distinction a caller can act\n * on: \"yet\" means wait for a release, \"will not\" means change the code. Sharing\n * one error for both meant `docs/orm.md` could list `omit` under *Not in scope*\n * while the runtime said \"yet\" — a contradiction a reader has no way to\n * resolve, and the one #68 exists to end.\n *\n * A subclass rather than a sibling, so `catch (e) { if (e instanceof\n * UnsupportedQueryError) … }` keeps working for callers that do not care which\n * kind it is.\n */\n/**\n * An argument the ORM **does** implement, given a value it cannot mean.\n *\n * The third category, and the one that made \"yet\" wrong four separate times —\n * #82, #88, #100 and #101 each corrected it at their own call site before #61\n * was found to own the problem. The taxonomy the three classes now draw:\n *\n * not implemented yet UnsupportedQueryError wait for a release\n * decided against UnsupportedByDesignError change the call (#78)\n * implemented, bad value InvalidArgumentError fix the value\n *\n * `take: \"-2\"` is the clearest case. `take` is implemented; `\"-2\"` is not a\n * take. Telling that caller the ORM \"does not support 'take' yet\" is wrong on\n * both halves — it does, and there is nothing to wait for — and it sends them\n * to a changelog when the fix is one character in their own code.\n *\n * **Extends `UnsupportedQueryError`**, so every existing `catch` and every test\n * asserting the base class keeps working. That is the same choice\n * `UnsupportedByDesignError` made, and it is what lets a taxonomy be added to a\n * shipped ORM without a breaking change: the specific classes are for the\n * reader, the base class is for the handler.\n *\n * **Where the taxonomy stops, and why it stops there.** An argument that is not\n * in the grammar at all keeps the base class and its \"yet\" — `{ nope: 1 }`\n * reports \"does not support 'nope' yet\". That is right for half of what reaches\n * that path and wrong for the other half: the same check refuses a typo and a\n * real Prisma argument this ORM has genuinely not implemented, and nothing at\n * that point can tell them apart. Splitting it would mean carrying Prisma's\n * full argument grammar per operation, which is a large amount of duplicated\n * schema for a small gain.\n *\n * What makes it tolerable is the sentence after it. Since #61's other half made\n * `detail` mandatory, that refusal always continues *\"findMany takes include,\n * omit, orderBy, select, skip, take, where\"* — so a caller who typed `nope`\n * learns it is not coming from the very next clause, without the class having\n * to know. Recorded here rather than left to be re-derived, because \"the third\n * class did not cover this one\" is the obvious first reading and it is not the\n * interesting part.\n */\nexport class InvalidArgumentError extends UnsupportedQueryError {\n constructor(\n argument: string,\n model: string,\n operation: string,\n /** What is wrong with the value, and what a good one looks like. */\n reason: string,\n ) {\n super(argument, model, operation, reason);\n this.name = \"InvalidArgumentError\";\n this.message = `Invalid '${argument}' (${model}.${operation}). ${reason}`;\n }\n}\n\nexport class UnsupportedByDesignError extends UnsupportedQueryError {\n constructor(\n argument: string,\n model: string,\n operation: string,\n /** What to use instead. Required — see #61: a refusal owes the caller a next step. */\n reason: string,\n ) {\n super(argument, model, operation, reason);\n this.name = \"UnsupportedByDesignError\";\n this.message =\n `gemi ORM does not implement '${argument}' (${model}.${operation}), ` +\n `and this is a decision rather than a gap. ${reason}`;\n }\n}\n\n/**\n * Thrown when an argument names something that is not a field on the model. A\n * `where` key with no matching field is an error, never a passthrough — that is\n * the rule that keeps user input out of the identifier positions in the SQL.\n */\nexport class UnknownFieldError extends Error {\n constructor(\n public readonly field: string,\n public readonly model: string,\n known: string[],\n ) {\n super(\n `'${field}' is not a field on model ${model}. ` +\n `Known fields: ${known.join(\", \")}.`,\n );\n this.name = \"UnknownFieldError\";\n }\n}\n\n/**\n * Thrown when a column holds something the generated schema says it cannot —\n * an unparseable timestamp, a fractional value in a `BigInt` column, malformed\n * JSON. Every dialect needs it, which is why it lives here rather than beside\n * one of them.\n *\n * It exists so those cases fail rather than decode into a plausible wrong\n * value: `new Date(\"nonsense\")` is an `Invalid Date`, not an error, and it\n * would travel a long way before anyone noticed.\n */\nexport class DecodeError extends Error {\n constructor(\n public readonly field: { column: string; type: string },\n public readonly value: unknown,\n ) {\n super(\n `Could not decode the value ${JSON.stringify(String(value))} from column ` +\n `'${field.column}' as ${field.type}. The column's contents do not match ` +\n `the Prisma schema — was it written by something other than Prisma or ` +\n `the gemi ORM?`,\n );\n this.name = \"DecodeError\";\n }\n}\n\n/**\n * Thrown by the `*OrThrow` operations when the query matched nothing. Prisma\n * raises `NotFoundError` / `P2025` for the same case; the differential harness\n * compares the fact of throwing, not the error type.\n */\nexport class RecordNotFoundError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n ) {\n super(`No ${model} found (${model}.${operation}).`);\n this.name = \"RecordNotFoundError\";\n }\n}\n\n/**\n * Thrown when a write violates a unique constraint.\n *\n * DECISION — gemi defines its own error rather than mirroring Prisma's codes.\n *\n * Prisma raises `PrismaClientKnownRequestError` with code `P2002` and\n * `meta.target` holding the field names. Mirroring that would ease a migration\n * for code already branching on `P2002`.\n *\n * **The premise this note used to rest on was wrong, and the conclusion is\n * unchanged.** It said \"nothing in this repository does (checked)\", which was\n * true of *this* repository and was never the question — the code that branches\n * on `P2002` lives in the applications the ORM is for. The first real port\n * measured four such guards, every one of them in concurrency-recovery code\n * (catch the collision, re-read, retry), and every one of them silently dead the\n * moment the write moved onto gemi: the `catch` still ran, the condition was\n * false, the recovery did not happen. Nor was the repository itself clean —\n * `templates/saas-starter/app/models/differential.ts:621` branches on `P2002`\n * today, and did when this was written.\n *\n * What the premise was doing was answering \"would anyone notice?\", and the\n * answer is that four people noticed at once. The decision never depended on it.\n * Carrying a `P` code implies the rest of the taxonomy is implemented too:\n * `P2003`, `P2025`, and the fifty others an application might reasonably then\n * expect to catch. Claiming a compatibility surface we have not built is worse\n * than asking the call sites that need it to catch a gemi error instead —\n * *especially* when the code in question is a retry loop, because a\n * compatibility surface that covers `P2002` and not `P2034` fails in exactly\n * the same silent way, one layer further in.\n *\n * A porter reaches for `isUniqueConstraintError` below. `UPGRADE.md` carries\n * the temporary `|| error.code === \"P2002\"` bridge, for a codebase halfway\n * through the move, with the marker that says when to delete it; it is\n * deliberately not exported, because a Prisma code in gemi's permanent surface\n * is the thing this note declined.\n *\n * What the contract does promise is the part that matters: the error is typed,\n * catchable, and names the fields — as *field* names, the way Prisma's\n * `meta.target` does, not as the database columns the driver reported.\n */\nexport class UniqueConstraintError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n /** Field names, mapped back through the schema from the driver's columns. */\n public readonly fields: string[],\n /** The constraint's own name, when the dialect reports one. */\n public readonly constraint?: string,\n options?: { cause?: unknown },\n ) {\n super(\n `Unique constraint violated on ${model}.${operation}` +\n (fields.length > 0 ? ` for ${fields.join(\", \")}` : \"\") +\n (constraint ? ` (constraint '${constraint}')` : \"\") +\n `. A ${model} with those values already exists.`,\n options,\n );\n this.name = \"UniqueConstraintError\";\n }\n}\n\n/**\n * The guard to write in a retry-on-collision `catch`, which is where a\n * `code === \"P2002\"` test almost always was:\n *\n * try {\n * return await Invite.create({ data: { token } })\n * } catch (error) {\n * if (!isUniqueConstraintError(error)) throw error\n * return await Invite.findUniqueOrThrow({ where: { token } })\n * }\n *\n * **Why this is worth shipping rather than telling people to write\n * `instanceof`**, which is the obvious objection and the reason it nearly was\n * not shipped. The second half of the test is the whole of it:\n *\n * error instanceof UniqueConstraintError || error.name === \"UniqueConstraintError\"\n *\n * `instanceof` compares against *this module instance's* class object, so it is\n * false across a duplicate copy of `gemi/orm` — two versions in one dependency\n * tree, a bundled build alongside a linked one, a monorepo package resolving\n * its own. The error is the right error, thrown by the right code, and the\n * guard silently does not fire. That is not a hypothetical: duck-typing rather\n * than importing the class is precisely what the ported application had already\n * done for Prisma's error, for precisely this reason, and shipping a predicate\n * that only does `instanceof` would hand it back the same trap under a new\n * name.\n *\n * So the name is load-bearing rather than a convenience: it is the identity\n * that survives module duplication, which is why every error in this file sets\n * `this.name` explicitly instead of relying on the class name surviving\n * minification.\n *\n * **The narrowing is a claim, and this is what it rests on.** The name branch\n * asserts `UniqueConstraintError` on the strength of a string — a second copy\n * of this module really does carry `model`, `operation` and `fields`, so the\n * claim holds for the case it exists for. An unrelated object named\n * `\"UniqueConstraintError\"` would defeat it, and that is not something that\n * happens by accident.\n *\n * **It deliberately does not match `code === \"P2002\"`.** See the DECISION\n * above: the temporary bridge for a half-ported codebase is in `UPGRADE.md`,\n * where it can carry a delete-me marker, rather than in gemi's permanent\n * surface, where it would have neither.\n */\nexport function isUniqueConstraintError(\n error: unknown,\n): error is UniqueConstraintError {\n if (error instanceof UniqueConstraintError) return true;\n\n return (\n typeof error === \"object\" &&\n error !== null &&\n (error as { name?: unknown }).name === \"UniqueConstraintError\"\n );\n}\n\n/**\n * Thrown when a write needs `RETURNING` and the dialect has none.\n *\n * Unreachable on SQLite and Postgres, which both support it. It exists so that\n * the MySQL / MariaDB path is a named gap rather than a wrong answer: the\n * fallback there is `lastInsertRowid` plus a re-select, which is a different\n * statement shape and is not implemented.\n */\nexport class ReturningUnsupportedError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly dialect: string,\n ) {\n super(\n `${model}.${operation} needs RETURNING to report its result, and the ` +\n `'${dialect}' dialect does not support it. The fallback — ` +\n `lastInsertRowid plus a re-select — is not implemented.`,\n );\n this.name = \"ReturningUnsupportedError\";\n }\n}\n\n/**\n * Thrown when a policy denies an operation.\n *\n * Two ways to get here, and the message distinguishes them because the fixes\n * are different: a policy's `before` returned false, or the model is policied\n * and there is no user in scope at all.\n *\n * The second is the deny-by-default rule, and it is the reason this error is\n * loud. A cron tick or a queue worker reading a policied model has no user, and\n * the alternative — treating \"no user\" as \"no policy\" — means the dangerous\n * case is the silent one: a request whose auth middleware was misconfigured\n * would read every tenant's rows rather than failing. So unscoped access is\n * always a decision written at the call site, through `Model.asSystem`.\n */\nexport class PolicyDeniedError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly reason: \"denied\" | \"no-user\" = \"denied\",\n ) {\n super(\n reason === \"no-user\"\n ? `${model}.${operation} is governed by a policy and there is no user ` +\n `in scope. If this is a cron tick, a queue worker or a script, say ` +\n `so at the call site: Model.asSystem(() => ...). Policies are ` +\n `never skipped just because a user failed to turn up.`\n : `${model}.${operation} was denied by ${model}'s policy.`,\n );\n this.name = \"PolicyDeniedError\";\n }\n}\n\n/**\n * Thrown when an `update` writes to a column its own policy's `scope` selects on,\n * and the policy has no `onUpdate` saying what that should mean.\n *\n * The shape it catches:\n *\n * scope: (ctx) => ({ organizationId: ctx.user.organizationId })\n * // ...and then\n * User.update({ where: { id }, data: { organizationId: 999 } })\n *\n * The scope did its job — only rows in the caller's own tenant could be selected\n * — and the statement still hands one of them to another tenant. Afterwards the\n * row is outside the scope, so it cannot be read back and cannot be put right by\n * the same caller: a one-way door rather than a visible failure. The usual way in\n * is not malice but mass assignment, a handler forwarding request fields into\n * `data`.\n *\n * This is `assertCreateCovered`'s question asked of the other write. There it is\n * \"you scoped reads but never said what an insert means\"; here it is \"you scoped\n * reads but never said whether an update may move a row out\". Both are answered\n * by writing the hook, including when the answer is \"allow it\" —\n * `onUpdate: (_ctx, data) => data` is a complete and legitimate answer, and\n * saying it out loud is the point.\n *\n * **What it cannot see.** The scope-owned columns are read off the top level of\n * the fragment the policy returned, so `{ organizationId: 7 }` is understood and\n * `{ OR: [...] }` is not — a scope built from combinators is not attributed to\n * any column and an update through it is not checked. Narrowing that would mean\n * either interpreting arbitrary `where` grammar or refusing every update on such\n * a model, and neither is worth it: the guard is a rail on the common shape, not\n * a proof.\n */\nexport class ScopeEscapeError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly fields: readonly string[],\n ) {\n const named = fields.map((field) => `'${field}'`).join(\", \");\n super(\n `${model}.${operation} writes ${named}, which ${model}'s policy also ` +\n `scopes on — so this update can move a row outside the scope that ` +\n `selected it, where the caller can no longer read or repair it.\\n\\n` +\n `Add an onUpdate to that policy. It may reassert the column ` +\n `(data => ({ ...data, ${fields[0]}: ctx.user.${fields[0]} })), reject ` +\n `the write, or allow it explicitly with (_ctx, data) => data — all ` +\n `three are fine, and the point is that the policy says which.`,\n );\n this.name = \"ScopeEscapeError\";\n }\n}\n\n/**\n * Thrown when a model class carries policies but is not the class the registry\n * resolves its name to.\n *\n * This exists because of a cross-tenant leak that shipped past review. The\n * generated `index.ts` registers the *generated* base — `register(\"Account\",\n * AccountModel)` — while an application authors its policy on a subclass:\n *\n * export class Account extends AccountModel {\n * static $policies = [{ scope: (ctx) => ({ organizationId: … }) }]\n * }\n *\n * A root query goes through `Account`, so `policiesFor(this)` finds the policy\n * and the scope applies. A **nested** relation read resolves through the\n * registry, gets `AccountModel`, and walks a prototype chain the policy is not\n * on — so `User.findMany({ include: { accounts: true } })` returned every\n * tenant's accounts. Root queries scoped, nested reads unscoped: exactly the\n * Prisma behaviour policies exist to fix, and silent.\n *\n * Raised at the first query through the unregistered class, naming the one-line\n * fix, because the alternative is data crossing a tenant boundary with nothing\n * to notice it.\n *\n * It fires on a divergence in the resolved policy *chain*, not merely on the two\n * classes differing. A plain subclass that adds no policy of its own inherits\n * the same policy objects in the same order, so a nested read resolving to its\n * parent applies exactly what the root query applied — no divergence, nothing\n * to refuse. An earlier version compared class identity and rejected\n * `class AdminUser extends User {}` for policies it had not written.\n */\nexport class UnregisteredPolicyClassError extends Error {\n constructor(\n public readonly model: string,\n /**\n * Under `carries: \"narrowing\"` this is the *ancestor* — the class the model\n * belongs to — rather than whatever the registry currently holds. The two\n * classes are on one prototype chain there, and which of them is registered\n * is the thing in question, so naming them by their relationship is what\n * makes the message readable.\n */\n public readonly registered: string,\n /** Under `carries: \"narrowing\"`, the descendant: the view that narrows. */\n public readonly queried: string,\n /**\n * Which side carries the policies that would be skipped, and therefore what\n * the author should do about it. Three, because they need three different\n * answers: a missing registration, a query through the wrong class, and a\n * view that should not be competing for the name at all.\n */\n public readonly carries: \"queried\" | \"registered\" | \"narrowing\" = \"queried\",\n ) {\n super(\n carries === \"narrowing\"\n ? `${queried} extends ${registered}, which owns the model '${model}', ` +\n `and carries policies of its own on top of it. A class that ` +\n `narrows an existing model is a view, and the registry holds one ` +\n `class per name — so registering ${queried} would apply its ` +\n `narrowing to every nested read of ${model}, and leaving ` +\n `${registered} registered would skip ${queried}'s policies ` +\n `entirely. Neither is a thing to choose for you.\\n\\n` +\n `Keep the view out of the modules you hand to Kernel.models, and ` +\n `query it directly where you want it:\\n\\n` +\n ` ${queried}.findMany(…) // narrowed, at the call site\\n\\n` +\n `If it is not a view but the model itself, move the policies onto ` +\n `${registered} — the class the model's name resolves to — and ` +\n `${queried} inherits them everywhere.\\n`\n : carries === \"queried\"\n ? `${queried} carries policies but the registry resolves '${model}' to ` +\n `${registered}. Nested relation reads go through the registry, so ` +\n `they would run on ${registered} and skip every policy on ` +\n `${queried} — scoped at the root, unscoped inside an include. ` +\n `Register the class that carries the policy:\\n\\n` +\n ` import { register } from \"gemi/orm\"\\n` +\n ` export class ${queried} extends ${registered} { … }\\n` +\n ` register(\"${model}\", ${queried})\\n`\n : `This query goes through ${queried}, but the registry resolves ` +\n `'${model}' to ${registered}, which carries policies ${queried} ` +\n `does not. Nested relation reads would be scoped and this query is ` +\n `not — the same policy applying to some queries and not others. ` +\n `Query ${registered} instead:\\n\\n` +\n ` ${registered}.findMany(…)\\n\\n` +\n `If skipping policies is intended, say so at the call site — that ` +\n `is what Model.asSystem() is for, and it is the only way to do it ` +\n `that a reader can see.\\n`,\n );\n this.name = \"UnregisteredPolicyClassError\";\n }\n}\n\n/**\n * Thrown when a `$policies` array holds something that is not a usable policy.\n *\n * Every case it covers is refused today — by `tsc`, at the class declaration,\n * with `TS2417`, because `Model` declares `static $policies?: readonly\n * PolicyEntry[]` and `ModelPolicy`'s members are all optional, so a typo'd key\n * trips weak-type detection. This is therefore a guard on the paths that import\n * user code *without* having type-checked it: `registerModels` at boot, and\n * `gemi check models`, whose whole job is to find mistakes in a file somebody is\n * still writing.\n *\n * Two failures, and the second is the one that matters.\n *\n * **A function the ORM cannot get a policy out of.** `resolveEntry` instantiates\n * every function entry with no arguments, and there are two ways that goes\n * wrong. A factory nobody called — `softDeletes` rather than\n * `softDeletes({ field })` — is not constructable at all and reached `new entry`\n * to produce `TypeError: function is not a constructor`. A class that *is*\n * constructable and whose constructor wants an argument gets through that check\n * and dies inside its own body instead, with\n * `TypeError: undefined is not an object (evaluating 'opts.field')`. Both are\n * loud and neither named the model, the index or the file, which on a 79-model\n * app leaves the first question unanswered; the second is the case that survived\n * a first pass at this error, because \"constructable\" is a fact about\n * `[[Construct]]` and says nothing about what the constructor then does.\n *\n * **An entry with no recognised hook.** `{ scopes: … }` and\n * `{ default: { scope: … } }` were accepted in silence: `applyPolicies`\n * dispatches on `before` / `scope` / `onCreate` / `onUpdate` and\n * `applyRedaction` on `redact`, so an entry spelling none of them contributes\n * nothing. The model then carries a visible `$policies` array, passes\n * `gemi check models` as correctly registered, and **reads unscoped** — the same\n * written-believed-not-in-effect shape `UnregisteredPolicyClassError` exists\n * for, arriving through a typo instead of through the registry.\n *\n * The line between *empty but valid* and *malformed* is drawn at \"would this\n * ever run\": an entry with at least one recognised hook that is callable is\n * accepted whatever else it carries, because a factory's return value and a\n * policy class routinely hold configuration and helpers beside the hooks, and\n * refusing unknown *extra* keys would reject code that works. An entry with no\n * callable hook at all is refused, `{}` included — it is indistinguishable from\n * a policy that was meant to do something, and a conditional policy belongs in\n * the array rather than in the entry.\n */\nexport class InvalidPolicyEntryError extends Error {\n constructor(\n /**\n * The class whose **own** `$policies` array holds the entry — the class the\n * author wrote the array on, which is not necessarily the model being\n * queried when the array is on a base.\n */\n public readonly model: string,\n /** The entry's index in that array. */\n public readonly index: number,\n public readonly reason:\n | \"not-a-policy\"\n | \"not-constructable\"\n | \"constructor-threw\"\n | \"no-hooks\"\n | \"hook-not-callable\",\n /** What was found in the entry's place, rendered for a human. */\n public readonly found: string,\n /**\n * The hook names the runtime dispatches on, supplied by `policy.ts` so the\n * list lives beside the code that reads it rather than being restated here.\n */\n hooks: readonly string[],\n /**\n * A key the entry actually spells and the hook it is within one edit of.\n *\n * **The pair, not the hook alone.** An unattributed \"Did you mean `scope`?\"\n * after a list of five keys does not say which of them was read as a\n * misspelling, so a reader who can see that none of them are has no way to\n * dismiss it — and this error is about an authorization rule that is not in\n * effect, where a suggestion followed wrongly costs a rename of something\n * that was never the problem.\n */\n public readonly suggestion?: { key: string; hook: string },\n options?: { cause?: unknown },\n ) {\n const where = `${model}.$policies[${index}]`;\n const named =\n hooks.length > 1\n ? `${hooks.slice(0, -1).join(\", \")} or ${hooks[hooks.length - 1]}`\n : (hooks[0] ?? \"\");\n\n super(\n reason === \"not-a-policy\"\n ? `${where} is ${found}, which is not a policy. An entry is either a ` +\n `policy object — { scope, onCreate, … } — or a class the ORM ` +\n `constructs with no arguments.\\n\\n` +\n `A policy that only sometimes applies belongs in the array rather ` +\n `than in the entry:\\n\\n` +\n ` static $policies = [...(multiTenant ? [tenantScope] : [])]\\n`\n : reason === \"not-constructable\"\n ? `${where} is ${found}, and a function entry is instantiated with ` +\n `no arguments — so an arrow function, a plain function, or a ` +\n `factory that was never called cannot be one.\\n\\n` +\n `If it is a factory, call it:\\n\\n` +\n ` static $policies = [softDeletes({ field: \"deletedAt\" })]\\n`\n : reason === \"constructor-threw\"\n ? `${where} is ${found}\\n\\n` +\n `A class entry is constructed with no arguments. If this one ` +\n `needs some, construct it yourself and put the instance in the ` +\n `array:\\n\\n` +\n ` static $policies = [new TenantPolicy({ field: \"orgId\" })]\\n\\n` +\n `If the constructor reaches for something that is not ready yet, ` +\n `note that it runs on the first query through this model, not at ` +\n `boot.\\n`\n : reason === \"hook-not-callable\"\n ? `${where} has a ${found}, and every hook is called — so this ` +\n `would throw on the first query that reached it rather than ` +\n `doing whatever it was meant to do. Give it a function, or ` +\n `leave the key out.\\n`\n : `${where} has none of ${named}, so it would never run. The ` +\n `model carries a visible $policies array and nothing in it ` +\n `applies to any query — which for a scope means the model ` +\n `reads unscoped. ${found}` +\n (suggestion\n ? ` Is '${suggestion.key}' meant to be \\`${suggestion.hook}\\`?`\n : \"\") +\n `\\n`,\n options,\n );\n this.name = \"InvalidPolicyEntryError\";\n }\n}\n\n/**\n * Thrown when `registerModels` finds two unrelated classes in one module both\n * claiming the same model name.\n *\n * Deriving registration from a module namespace works because the candidates\n * are normally a chain — a generated base, the application's subclass, perhaps\n * a typed view over it — and a chain has a least element to elect. Two classes\n * that extend the same base without extending each other do not: both were\n * written for this model, and only the author knows which one nested reads\n * should run.\n *\n * Refused rather than guessed at, because both guesses are silent. Picking\n * either would scope every `include` of the model by one class's policies while\n * the other's code keeps reading as though its own applied.\n *\n * **\"In one module\" is the exact scope, and the asymmetry is deliberate.**\n * Election happens per module, so two unrelated claims split across *different*\n * modules never meet inside one — the later import simply wins. What catches\n * that is the audit at the end of `registerModels` rather than this error, and\n * only when the two diverge in policies. Two unrelated *unpolicied* claims on\n * one name resolve by import order and nothing reports it, which is tolerable\n * for the same reason it is invisible: with no policies on either, the choice\n * changes no query's scope.\n */\nexport class AmbiguousModelRegistrationError extends Error {\n constructor(\n public readonly model: string,\n public readonly candidates: readonly string[],\n ) {\n const named = candidates.map((candidate) => `'${candidate}'`).join(\", \");\n super(\n `Two classes in one module claim the model '${model}' — ${named} — and ` +\n `neither extends the other, so there is no way to tell which one ` +\n `nested relation reads should run.\\n\\n` +\n `Say which, and registerModels will leave it alone:\\n\\n` +\n ` import { register } from \"gemi/orm\"\\n` +\n ` register(\"${model}\", ${candidates[0]})\\n\\n` +\n `A class that is only a typed view over the same rows belongs in a ` +\n `module you do not hand to registerModels.`,\n );\n this.name = \"AmbiguousModelRegistrationError\";\n }\n}\n\n/**\n * Thrown when a statement would bind more parameters than the driver's wire\n * protocol can carry.\n *\n * Three shapes reach it, all of them scaling with the caller's *data* rather\n * than with the query's shape: `createMany` at `rows × columns`, an `in` list on\n * SQLite (one placeholder per element, and such a list is routinely\n * request-derived), and a to-many `include` on SQLite, which batches an `in`\n * over the parent keys. Both limits are hard and low enough to hit with an\n * ordinary import — Postgres counts parameters in an int16 (65535), SQLite\n * defaults `SQLITE_MAX_VARIABLE_NUMBER` to 32766. Postgres escapes the last two\n * either way: `= any($1)` is one parameter however long the array.\n *\n * Prisma chunks the insert automatically. Doing that here means several\n * statements, which without a transaction is a partially-applied `createMany`\n * on failure — so it waits for iteration 5, and until then this is a named gap\n * rather than a driver error naming neither the model nor the cause. Same\n * treatment as `ReturningUnsupportedError`, for the same reason.\n */\nexport class ParameterLimitError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly required: number,\n public readonly limit: number,\n public readonly dialect: string,\n detail: string,\n ) {\n super(\n `${model}.${operation} would bind ${required} parameters, and the ` +\n `'${dialect}' driver accepts at most ${limit} in one statement. ` +\n `${detail}` +\n (operation === \"createMany\"\n ? ` A createMany over the ceiling is normally split across statements ` +\n `inside one transaction, so reaching this means splitting cannot ` +\n `help: a single row binds more than the driver accepts.`\n : ` Splitting is not something this operation can do for you — one ` +\n `statement has to carry one answer. Narrow the query.`),\n );\n this.name = \"ParameterLimitError\";\n }\n}\n\n/**\n * Thrown when a write omits a column that has no value to fall back on: not\n * supplied, no client-side default, no database default, and not nullable.\n *\n * Raised in the compiler rather than left to the database so the message names\n * the field and the model, instead of surfacing as `NOT NULL constraint failed`\n * with a column name and no context.\n */\nexport class MissingRequiredValueError extends Error {\n constructor(\n public readonly model: string,\n public readonly operation: string,\n public readonly field: string,\n ) {\n super(\n `${model}.${operation} is missing a value for '${field}', which is ` +\n `required and has no default.`,\n );\n this.name = \"MissingRequiredValueError\";\n }\n}\n\n/**\n * Thrown when an `include` — or a relation-shaped key inside a `select` — names\n * something the model does not declare as a relation.\n */\nexport class UnknownRelationError extends Error {\n constructor(\n public readonly relation: string,\n public readonly model: string,\n known: string[],\n ) {\n super(\n `'${relation}' is not a relation on model ${model}. ` +\n (known.length > 0\n ? `Known relations: ${known.join(\", \")}.`\n : `${model} declares no relations.`),\n );\n this.name = \"UnknownRelationError\";\n }\n}\n\n/**\n * Thrown when an include tree nests deeper than the guard allows.\n *\n * A cyclic include is legal and finite — `user -> accounts -> user` terminates\n * because the caller wrote a finite tree. What this catches is an *unbounded*\n * one: an argument tree built by a loop, or forwarded from a request body, that\n * describes a thousand levels. Under the batched planner every level is at least\n * one query, so the guard is what stops a malformed argument from becoming a\n * self-inflicted denial of service.\n */\nexport class RelationDepthExceededError extends Error {\n constructor(\n public readonly model: string,\n public readonly limit: number,\n ) {\n super(\n `The include tree nests more than ${limit} relations deep (at model ` +\n `${model}). Deeply nested includes are legal, so this is a guard ` +\n `against a generated or malformed argument tree rather than a limit on ` +\n `modelling — every level costs at least one query.`,\n );\n this.name = \"RelationDepthExceededError\";\n }\n}\n\n/**\n * Thrown when a relation names a model the registry does not hold. Every\n * relation in a generated artifact was emitted from a model in the same\n * `schema.prisma`, so this can only mean the artifact and the registry disagree.\n */\nexport class UnregisteredRelationTargetError extends Error {\n constructor(\n public readonly model: string,\n public readonly relation: string,\n public readonly target: string,\n known: string[],\n ) {\n super(\n `${model}.${relation} points at model '${target}', which nothing has ` +\n `registered. The generated artifact and the registry disagree: re-run ` +\n `\\`prisma generate\\`, and check that app/models/generated/index.ts is ` +\n `imported. ` +\n (known.length > 0\n ? `Registered models: ${known.join(\", \")}.`\n : `Nothing is registered at all.`),\n );\n this.name = \"UnregisteredRelationTargetError\";\n }\n}\n\n/**\n * Thrown when a relation is registered on both sides but the two sides do not\n * describe a link the planner can follow: no matching `relationName` on the\n * other model, or a `from` / `to` naming a field that is not there. Like\n * `UnregisteredRelationTargetError`, it means a stale generated artifact — a\n * consistent one cannot produce it.\n */\nexport class MalformedRelationError extends Error {\n constructor(\n public readonly model: string,\n public readonly relation: string,\n detail: string,\n ) {\n super(\n `Cannot resolve how ${model}.${relation} joins: ${detail} This means ` +\n `app/models/generated is stale or hand-edited — re-run ` +\n `\\`prisma generate\\`.`,\n );\n this.name = \"MalformedRelationError\";\n }\n}\n\n/** Thrown when a relation resolves to a model name nothing registered. */\nexport class ModelNotRegisteredError extends Error {\n constructor(name: string, known: string[]) {\n super(\n `No model is registered under the name '${name}'. ` +\n (known.length > 0\n ? `Registered models: ${known.join(\", \")}.`\n : `Nothing is registered — is app/models/generated/index.ts imported?`),\n );\n this.name = \"ModelNotRegisteredError\";\n }\n}\n\n/** Thrown when a model class is used before the generator has given it a schema. */\nexport class MissingModelSchemaError extends Error {\n constructor(className: string) {\n super(\n `${className} has no $schema. Model subclasses must extend a generated ` +\n `base class from app/models/generated/models.ts.`,\n );\n this.name = \"MissingModelSchemaError\";\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";AAQO,MAAM,UAA8B,KAAM,CAE7B,SACA,MACA,UAHlB,WAAW,CACO,EACA,EACA,EAsBhB,EACA,CACA,MACE,8BAA8B,WAAkB,KAAS,OACvD,CACJ,EA7BgB,gBACA,aACA,iBA4BhB,KAAK,KAAO,wBAEhB,CAuDO,MAAM,UAA6B,CAAsB,CAC9D,WAAW,CACT,EACA,EACA,EAEA,EACA,CACA,MAAM,EAAU,EAAO,EAAW,CAAM,EACxC,KAAK,KAAO,uBACZ,KAAK,QAAU,YAAY,OAAc,KAAS,OAAe,IAErE,CAEO,MAAM,UAAiC,CAAsB,CAClE,WAAW,CACT,EACA,EACA,EAEA,EACA,CACA,MAAM,EAAU,EAAO,EAAW,CAAM,EACxC,KAAK,KAAO,2BACZ,KAAK,QACH,gCAAgC,OAAc,KAAS,iDACV,IAEnD,CAOO,MAAM,UAA0B,KAAM,CAEzB,MACA,MAFlB,WAAW,CACO,EACA,EAChB,EACA,CACA,MACE,IA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ChB,CACA,MACE,oCAAoC,8BAC/B,kIAEH,wDACJ,EARgB,aACA,aAQhB,KAAK,KAAO,6BAEhB,CAOO,MAAM,UAAwC,KAAM,CAEvC,MACA,SACA,OAHlB,WAAW,CACO,EACA,EACA,EAChB,EACA,CACA,MACE,GAAG,KAAS,sBAA6B,8KAItC,EAAM,OAAS,EACZ,sBAAsB,EAAM,KAAK,IAAI,KACrC,gCACR,EAbgB,aACA,gBACA,cAYhB,KAAK,KAAO,kCAEhB,CASO,MAAM,UAA+B,KAAM,CAE9B,MACA,SAFlB,WAAW,CACO,EACA,EAChB,EACA,CACA,MACE,sBAAsB,KAAS,YAAmB,gBAChD,8DACA,oBACJ,EARgB,aACA,gBAQhB,KAAK,KAAO,yBAEhB,CAGO,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAc,EAAiB,CACzC,MACE,0CAA0C,QACvC,EAAM,OAAS,EACZ,sBAAsB,EAAM,KAAK,IAAI,KACrC,0EACR,EACA,KAAK,KAAO,0BAEhB,CAGO,MAAM,UAAgC,KAAM,CACjD,WAAW,CAAC,EAAmB,CAC7B,MACE,GAAG,4GAEL,EACA,KAAK,KAAO,0BAEhB",
8
- "debugId": "9D67B83712D0BF3364756E2164756E21",
8
+ "debugId": "BE9A06EF6D5FF97364756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{Q as a,R as b,S as c,T as d,U as e,V as f,W as g}from"./chunk-y9fp58bg.js";import"./chunk-3e88tyee.js";import"./chunk-h3mwgbg7.js";import"./chunk-kgmr9qxx.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
3
+
4
+ //# debugId=6F8D5665603FE0CC64756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "3D62F613BE1E083964756E2164756E21",
7
+ "debugId": "6F8D5665603FE0CC64756E2164756E21",
8
8
  "names": []
9
9
  }