gemi 0.64.0 → 0.66.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 (250) hide show
  1. package/dist/ai/Agent.d.ts +128 -1
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +75 -6
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/AgentProvider.d.ts +13 -45
  6. package/dist/ai/AgentProvider.d.ts.map +1 -1
  7. package/dist/ai/ImageModel.d.ts +127 -0
  8. package/dist/ai/ImageModel.d.ts.map +1 -0
  9. package/dist/ai/ImageProvider.d.ts +94 -0
  10. package/dist/ai/ImageProvider.d.ts.map +1 -0
  11. package/dist/ai/Schema.d.ts +62 -0
  12. package/dist/ai/Schema.d.ts.map +1 -1
  13. package/dist/ai/client/index.js +10 -4
  14. package/dist/ai/client/index.js.map +1 -1
  15. package/dist/ai/client/reducer.d.ts.map +1 -1
  16. package/dist/ai/index.d.ts +7 -1
  17. package/dist/ai/index.d.ts.map +1 -1
  18. package/dist/ai/index.js +11 -11
  19. package/dist/ai/index.js.map +14 -10
  20. package/dist/ai/live/harness.d.ts +5 -3
  21. package/dist/ai/live/harness.d.ts.map +1 -1
  22. package/dist/ai/providers/call.d.ts +12 -0
  23. package/dist/ai/providers/call.d.ts.map +1 -1
  24. package/dist/ai/providers/endpoints.d.ts +153 -0
  25. package/dist/ai/providers/endpoints.d.ts.map +1 -0
  26. package/dist/ai/providers/fakeProvider.d.ts +54 -0
  27. package/dist/ai/providers/fakeProvider.d.ts.map +1 -1
  28. package/dist/ai/providers/http.d.ts +28 -0
  29. package/dist/ai/providers/http.d.ts.map +1 -1
  30. package/dist/ai/providers/images.d.ts +126 -0
  31. package/dist/ai/providers/images.d.ts.map +1 -0
  32. package/dist/ai/store/Attachments.d.ts +52 -0
  33. package/dist/ai/store/Attachments.d.ts.map +1 -1
  34. package/dist/ai/types.d.ts +55 -1
  35. package/dist/ai/types.d.ts.map +1 -1
  36. package/dist/ai/useChat.d.ts +60 -4
  37. package/dist/ai/useChat.d.ts.map +1 -1
  38. package/dist/app/index.js +1 -1
  39. package/dist/bin/gemi.js +9 -1
  40. package/dist/bin/gemi.js.map +3 -3
  41. package/dist/broadcasting/index.js +1 -1
  42. package/dist/bun/plugin.js +1 -1
  43. package/dist/bun/preload.js +1 -1
  44. package/dist/{chunk-jv9k1qfr.js → chunk-2bb3rdqq.js} +3 -3
  45. package/dist/{chunk-jv9k1qfr.js.map → chunk-2bb3rdqq.js.map} +1 -1
  46. package/dist/{chunk-e785380d.js → chunk-2dvjj3ad.js} +2 -2
  47. package/dist/{chunk-e785380d.js.map → chunk-2dvjj3ad.js.map} +1 -1
  48. package/dist/{chunk-rj3fnc4h.js → chunk-2ghpxrw1.js} +1 -1
  49. package/dist/{chunk-dqbm9vd0.js → chunk-3mp9p38x.js} +2 -2
  50. package/dist/{chunk-dqbm9vd0.js.map → chunk-3mp9p38x.js.map} +1 -1
  51. package/dist/{chunk-cdpeh7tt.js → chunk-3pwn2r6s.js} +2 -2
  52. package/dist/{chunk-cdpeh7tt.js.map → chunk-3pwn2r6s.js.map} +1 -1
  53. package/dist/{chunk-7qfzrkab.js → chunk-45g3hd0e.js} +2 -2
  54. package/dist/{chunk-7qfzrkab.js.map → chunk-45g3hd0e.js.map} +1 -1
  55. package/dist/{chunk-wqmzad46.js → chunk-5g1j29p2.js} +2 -2
  56. package/dist/{chunk-wqmzad46.js.map → chunk-5g1j29p2.js.map} +1 -1
  57. package/dist/{chunk-bxtx4y4w.js → chunk-5pm9zvtp.js} +2 -2
  58. package/dist/{chunk-bxtx4y4w.js.map → chunk-5pm9zvtp.js.map} +1 -1
  59. package/dist/{chunk-pbx9p6g0.js → chunk-6waph5k8.js} +1 -1
  60. package/dist/{chunk-nnc40mf3.js → chunk-70y8wajy.js} +2 -2
  61. package/dist/{chunk-nnc40mf3.js.map → chunk-70y8wajy.js.map} +1 -1
  62. package/dist/{chunk-71yhw8aw.js → chunk-731etrh2.js} +2 -2
  63. package/dist/{chunk-71yhw8aw.js.map → chunk-731etrh2.js.map} +1 -1
  64. package/dist/{chunk-1s1cd1e8.js → chunk-7438nrkm.js} +3 -3
  65. package/dist/{chunk-1s1cd1e8.js.map → chunk-7438nrkm.js.map} +1 -1
  66. package/dist/{chunk-ssg20z9s.js → chunk-7wgk7q33.js} +3 -3
  67. package/dist/{chunk-ssg20z9s.js.map → chunk-7wgk7q33.js.map} +1 -1
  68. package/dist/chunk-7xc64j6p.js +5 -0
  69. package/dist/chunk-7xc64j6p.js.map +14 -0
  70. package/dist/{chunk-jmse5hec.js → chunk-7zg1mt1g.js} +2 -2
  71. package/dist/{chunk-jmse5hec.js.map → chunk-7zg1mt1g.js.map} +1 -1
  72. package/dist/{chunk-0qchadp1.js → chunk-87c0cy5v.js} +2 -2
  73. package/dist/{chunk-0qchadp1.js.map → chunk-87c0cy5v.js.map} +1 -1
  74. package/dist/{chunk-773qa4av.js → chunk-8bjxk57p.js} +2 -2
  75. package/dist/{chunk-773qa4av.js.map → chunk-8bjxk57p.js.map} +1 -1
  76. package/dist/{chunk-81yzec62.js → chunk-8jpvj3cj.js} +2 -2
  77. package/dist/{chunk-81yzec62.js.map → chunk-8jpvj3cj.js.map} +1 -1
  78. package/dist/{chunk-9e5c5e15.js → chunk-9ch1q7nd.js} +2 -2
  79. package/dist/{chunk-9e5c5e15.js.map → chunk-9ch1q7nd.js.map} +1 -1
  80. package/dist/{chunk-9e5v1t73.js → chunk-9x5eefh0.js} +2 -2
  81. package/dist/{chunk-9e5v1t73.js.map → chunk-9x5eefh0.js.map} +1 -1
  82. package/dist/{chunk-62xjrz5e.js → chunk-9zmcz7yq.js} +2 -2
  83. package/dist/{chunk-62xjrz5e.js.map → chunk-9zmcz7yq.js.map} +1 -1
  84. package/dist/{chunk-0amv13g6.js → chunk-a85fn4zf.js} +3 -3
  85. package/dist/{chunk-0amv13g6.js.map → chunk-a85fn4zf.js.map} +1 -1
  86. package/dist/chunk-adj6dnvj.js +5 -0
  87. package/dist/{chunk-dq2hgzje.js.map → chunk-adj6dnvj.js.map} +1 -1
  88. package/dist/{chunk-exwbtfe9.js → chunk-aq09ta7k.js} +2 -2
  89. package/dist/{chunk-exwbtfe9.js.map → chunk-aq09ta7k.js.map} +1 -1
  90. package/dist/{chunk-43xw9n4f.js → chunk-dmr7yzyr.js} +2 -2
  91. package/dist/{chunk-43xw9n4f.js.map → chunk-dmr7yzyr.js.map} +1 -1
  92. package/dist/{chunk-q4wdg0y3.js → chunk-e0v4byjp.js} +2 -2
  93. package/dist/{chunk-ptjexzn1.js.map → chunk-e0v4byjp.js.map} +1 -1
  94. package/dist/{chunk-8wpccvbt.js → chunk-e1fkxt82.js} +2 -2
  95. package/dist/{chunk-8wpccvbt.js.map → chunk-e1fkxt82.js.map} +1 -1
  96. package/dist/{chunk-xadk41cs.js → chunk-ex9ns7pf.js} +4 -4
  97. package/dist/{chunk-xadk41cs.js.map → chunk-ex9ns7pf.js.map} +1 -1
  98. package/dist/{chunk-95d8jj11.js → chunk-fd7wfcft.js} +2 -2
  99. package/dist/{chunk-95d8jj11.js.map → chunk-fd7wfcft.js.map} +1 -1
  100. package/dist/{chunk-kx7vgcjp.js → chunk-fmcq21hg.js} +3 -3
  101. package/dist/{chunk-kx7vgcjp.js.map → chunk-fmcq21hg.js.map} +1 -1
  102. package/dist/{chunk-k1wkvrj0.js → chunk-ftaxfq7p.js} +3 -3
  103. package/dist/{chunk-k1wkvrj0.js.map → chunk-ftaxfq7p.js.map} +1 -1
  104. package/dist/{chunk-zdj2wmbj.js → chunk-fxkh2rfd.js} +2 -2
  105. package/dist/{chunk-zdj2wmbj.js.map → chunk-fxkh2rfd.js.map} +1 -1
  106. package/dist/{chunk-9k5daets.js → chunk-g2ywq30n.js} +2 -2
  107. package/dist/{chunk-9k5daets.js.map → chunk-g2ywq30n.js.map} +1 -1
  108. package/dist/{chunk-fwnf3jc6.js → chunk-gyc91g26.js} +2 -2
  109. package/dist/{chunk-fwnf3jc6.js.map → chunk-gyc91g26.js.map} +1 -1
  110. package/dist/chunk-hq496pa4.js +5 -0
  111. package/dist/chunk-hq496pa4.js.map +10 -0
  112. package/dist/{chunk-4sv5zpb4.js → chunk-hrtkjv41.js} +2 -2
  113. package/dist/{chunk-4sv5zpb4.js.map → chunk-hrtkjv41.js.map} +1 -1
  114. package/dist/{chunk-dhe1hsyz.js → chunk-jkjt3e06.js} +2 -2
  115. package/dist/{chunk-dhe1hsyz.js.map → chunk-jkjt3e06.js.map} +1 -1
  116. package/dist/{chunk-5wzyx4ts.js → chunk-ks94h71z.js} +2 -2
  117. package/dist/{chunk-5wzyx4ts.js.map → chunk-ks94h71z.js.map} +1 -1
  118. package/dist/{chunk-rhr8qavq.js → chunk-m44ar4he.js} +2 -2
  119. package/dist/{chunk-rhr8qavq.js.map → chunk-m44ar4he.js.map} +1 -1
  120. package/dist/{chunk-mzpczes2.js → chunk-nxg51m0q.js} +2 -2
  121. package/dist/{chunk-mzpczes2.js.map → chunk-nxg51m0q.js.map} +1 -1
  122. package/dist/{chunk-qrfp7pg2.js → chunk-nxh5a3eb.js} +3 -3
  123. package/dist/{chunk-qrfp7pg2.js.map → chunk-nxh5a3eb.js.map} +1 -1
  124. package/dist/{chunk-qcbtr7hm.js → chunk-p0m3qgs5.js} +2 -2
  125. package/dist/{chunk-qcbtr7hm.js.map → chunk-p0m3qgs5.js.map} +1 -1
  126. package/dist/{chunk-jk8mn861.js → chunk-p5m0da00.js} +2 -2
  127. package/dist/{chunk-jk8mn861.js.map → chunk-p5m0da00.js.map} +1 -1
  128. package/dist/{chunk-fv223805.js → chunk-pb0m0ryf.js} +3 -3
  129. package/dist/{chunk-fv223805.js.map → chunk-pb0m0ryf.js.map} +1 -1
  130. package/dist/{chunk-7hbhbht2.js → chunk-pcxxnnad.js} +3 -3
  131. package/dist/{chunk-7hbhbht2.js.map → chunk-pcxxnnad.js.map} +1 -1
  132. package/dist/{chunk-2d92pev2.js → chunk-pxc51549.js} +2 -2
  133. package/dist/{chunk-2d92pev2.js.map → chunk-pxc51549.js.map} +1 -1
  134. package/dist/{chunk-454c7vn3.js → chunk-q1nq7n6y.js} +2 -2
  135. package/dist/{chunk-454c7vn3.js.map → chunk-q1nq7n6y.js.map} +1 -1
  136. package/dist/{chunk-48qybp63.js → chunk-qqchc40s.js} +2 -2
  137. package/dist/{chunk-48qybp63.js.map → chunk-qqchc40s.js.map} +1 -1
  138. package/dist/{chunk-3tmw1gy2.js → chunk-qttk7k60.js} +2 -2
  139. package/dist/{chunk-3tmw1gy2.js.map → chunk-qttk7k60.js.map} +1 -1
  140. package/dist/{chunk-feyr4851.js → chunk-r069158p.js} +2 -2
  141. package/dist/{chunk-feyr4851.js.map → chunk-r069158p.js.map} +1 -1
  142. package/dist/{chunk-ptjexzn1.js → chunk-r6v21jn6.js} +2 -2
  143. package/dist/{chunk-q4wdg0y3.js.map → chunk-r6v21jn6.js.map} +1 -1
  144. package/dist/{chunk-6j129573.js → chunk-r77f1482.js} +2 -2
  145. package/dist/{chunk-6j129573.js.map → chunk-r77f1482.js.map} +1 -1
  146. package/dist/{chunk-jmbdr550.js → chunk-rnjbja88.js} +2 -2
  147. package/dist/{chunk-jmbdr550.js.map → chunk-rnjbja88.js.map} +1 -1
  148. package/dist/{chunk-q8msf1gf.js → chunk-rq2k9frr.js} +2 -2
  149. package/dist/{chunk-q8msf1gf.js.map → chunk-rq2k9frr.js.map} +1 -1
  150. package/dist/{chunk-2nqxhy1f.js → chunk-se5ekvgb.js} +4 -4
  151. package/dist/{chunk-2nqxhy1f.js.map → chunk-se5ekvgb.js.map} +3 -3
  152. package/dist/{chunk-v6v03hy7.js → chunk-sqc6fkqt.js} +2 -2
  153. package/dist/{chunk-v6v03hy7.js.map → chunk-sqc6fkqt.js.map} +1 -1
  154. package/dist/{chunk-78cvy4je.js → chunk-tn71d46d.js} +2 -2
  155. package/dist/{chunk-78cvy4je.js.map → chunk-tn71d46d.js.map} +1 -1
  156. package/dist/{chunk-hkhxkeeb.js → chunk-v6q4990x.js} +3 -3
  157. package/dist/{chunk-hkhxkeeb.js.map → chunk-v6q4990x.js.map} +1 -1
  158. package/dist/{chunk-e41vdprh.js → chunk-w34j3cd3.js} +3 -3
  159. package/dist/{chunk-e41vdprh.js.map → chunk-w34j3cd3.js.map} +1 -1
  160. package/dist/{chunk-w8ncmp2z.js → chunk-w6fnt1xv.js} +2 -2
  161. package/dist/{chunk-w8ncmp2z.js.map → chunk-w6fnt1xv.js.map} +2 -2
  162. package/dist/{chunk-35fbxgjh.js → chunk-wzqxtrpt.js} +2 -2
  163. package/dist/{chunk-35fbxgjh.js.map → chunk-wzqxtrpt.js.map} +1 -1
  164. package/dist/{chunk-z2fnf49p.js → chunk-xzexftx1.js} +1 -1
  165. package/dist/{chunk-dfv5eqma.js → chunk-z4k18gnp.js} +2 -2
  166. package/dist/{chunk-dfv5eqma.js.map → chunk-z4k18gnp.js.map} +1 -1
  167. package/dist/{chunk-b6948dnh.js → chunk-z6gzasra.js} +2 -2
  168. package/dist/{chunk-b6948dnh.js.map → chunk-z6gzasra.js.map} +1 -1
  169. package/dist/{chunk-p57x55qd.js → chunk-zqpskwk9.js} +2 -2
  170. package/dist/{chunk-p57x55qd.js.map → chunk-zqpskwk9.js.map} +1 -1
  171. package/dist/chunks/ThemeProvider-Bz-y1g2i.js.map +1 -1
  172. package/dist/client/ClientRouter.d.ts.map +1 -1
  173. package/dist/client/ProgressManager.d.ts +1 -1
  174. package/dist/client/index.d.ts +1 -1
  175. package/dist/client/index.d.ts.map +1 -1
  176. package/dist/client/index.js +1 -1
  177. package/dist/client/index.js.map +1 -1
  178. package/dist/client/types.d.ts +72 -2
  179. package/dist/client/types.d.ts.map +1 -1
  180. package/dist/client/useNavigate.d.ts +29 -6
  181. package/dist/client/useNavigate.d.ts.map +1 -1
  182. package/dist/client/usePrefetch.d.ts +13 -3
  183. package/dist/client/usePrefetch.d.ts.map +1 -1
  184. package/dist/config/index.js +1 -1
  185. package/dist/console/run.js +2 -2
  186. package/dist/console/run.js.map +1 -1
  187. package/dist/container/index.js +2 -2
  188. package/dist/container/index.js.map +1 -1
  189. package/dist/database/Connection.d.ts.map +1 -1
  190. package/dist/database/index.d.ts +1 -0
  191. package/dist/database/index.d.ts.map +1 -1
  192. package/dist/database/index.js +2 -2
  193. package/dist/database/index.js.map +1 -1
  194. package/dist/database/sqlitePath.d.ts +46 -0
  195. package/dist/database/sqlitePath.d.ts.map +1 -0
  196. package/dist/email/index.js +2 -2
  197. package/dist/email/index.js.map +1 -1
  198. package/dist/facades/index.js +2 -2
  199. package/dist/facades/index.js.map +1 -1
  200. package/dist/foundation/index.js +2 -2
  201. package/dist/foundation/index.js.map +1 -1
  202. package/dist/http/ApiRouter.d.ts +1 -1
  203. package/dist/http/ApiRouter.d.ts.map +1 -1
  204. package/dist/http/index.js +2 -2
  205. package/dist/http/index.js.map +1 -1
  206. package/dist/i18n/dictionaryRuntime.js +2 -2
  207. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  208. package/dist/i18n/index.js +2 -2
  209. package/dist/i18n/index.js.map +1 -1
  210. package/dist/kernel/index.js +2 -2
  211. package/dist/kernel/index.js.map +1 -1
  212. package/dist/orm/index.js +2 -2
  213. package/dist/orm/index.js.map +1 -1
  214. package/dist/server/index.js +2 -2
  215. package/dist/server/index.js.map +1 -1
  216. package/dist/services/index.js +2 -2
  217. package/dist/services/index.js.map +1 -1
  218. package/dist/services/queue/work.js +2 -2
  219. package/dist/services/queue/work.js.map +1 -1
  220. package/dist/support/index.js +2 -2
  221. package/dist/support/index.js.map +1 -1
  222. package/package.json +1 -1
  223. package/dist/ai/Agent.test-d.d.ts +0 -2
  224. package/dist/ai/Agent.test-d.d.ts.map +0 -1
  225. package/dist/ai/Schema.test-d.d.ts +0 -2
  226. package/dist/ai/Schema.test-d.d.ts.map +0 -1
  227. package/dist/ai/client/reducer.test-d.d.ts +0 -2
  228. package/dist/ai/client/reducer.test-d.d.ts.map +0 -1
  229. package/dist/ai/example.d.ts +0 -129
  230. package/dist/ai/example.d.ts.map +0 -1
  231. package/dist/chunk-4728yrmt.js +0 -5
  232. package/dist/chunk-4728yrmt.js.map +0 -10
  233. package/dist/chunk-dq2hgzje.js +0 -5
  234. package/dist/chunk-f9ccncar.js +0 -5
  235. package/dist/chunk-f9ccncar.js.map +0 -13
  236. package/dist/client/useDictionary.test-d.d.ts +0 -2
  237. package/dist/client/useDictionary.test-d.d.ts.map +0 -1
  238. package/dist/console/builder.test-d.d.ts +0 -2
  239. package/dist/console/builder.test-d.d.ts.map +0 -1
  240. package/dist/http/ApiRouter.test-d.d.ts +0 -2
  241. package/dist/http/ApiRouter.test-d.d.ts.map +0 -1
  242. package/dist/http/McpRouter.test-d.d.ts +0 -2
  243. package/dist/http/McpRouter.test-d.d.ts.map +0 -1
  244. package/dist/services/events/FakeEventManager.test-d.d.ts +0 -2
  245. package/dist/services/events/FakeEventManager.test-d.d.ts.map +0 -1
  246. package/dist/services/events/Listener.test-d.d.ts +0 -2
  247. package/dist/services/events/Listener.test-d.d.ts.map +0 -1
  248. /package/dist/{chunk-rj3fnc4h.js.map → chunk-2ghpxrw1.js.map} +0 -0
  249. /package/dist/{chunk-pbx9p6g0.js.map → chunk-6waph5k8.js.map} +0 -0
  250. /package/dist/{chunk-z2fnf49p.js.map → chunk-xzexftx1.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_ as re}from"./chunk-dhe1hsyz.js";import{sg as _,vg as a}from"./chunk-ptjexzn1.js";var I=_((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.getHomeDir=void 0;var W=a("os"),V=a("path"),x={},G=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},U=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:o=`C:${V.sep}`}=process.env;if(e)return e;if(t)return t;if(r)return`${o}${r}`;let i=G();if(!x[i])x[i]=(0,W.homedir)();return x[i]};b.getHomeDir=U});var P=_((j)=>{Object.defineProperty(j,"__esModule",{value:!0});j.getSSOTokenFilepath=void 0;var X=a("crypto"),B=a("path"),J=I(),z=(e)=>{let r=(0,X.createHash)("sha1").update(e).digest("hex");return(0,B.join)((0,J.getHomeDir)(),".aws","sso","cache",`${r}.json`)};j.getSSOTokenFilepath=z});var R=_((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.getSSOTokenFromFile=C.tokenIntercept=void 0;var Q=a("fs/promises"),Y=P();C.tokenIntercept={};var Z=async(e)=>{if(C.tokenIntercept[e])return C.tokenIntercept[e];let t=(0,Y.getSSOTokenFilepath)(e),r=await(0,Q.readFile)(t,"utf8");return JSON.parse(r)};C.getSSOTokenFromFile=Z});var k=_((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.readFile=L.fileIntercept=L.filePromises=void 0;var ee=a("fs/promises");L.filePromises={};L.fileIntercept={};var te=(e,t)=>{if(L.fileIntercept[e]!==void 0)return L.fileIntercept[e];if(!L.filePromises[e]||t?.ignoreCache)L.filePromises[e]=(0,ee.readFile)(e,"utf8");return L.filePromises[e]};L.readFile=te});var ye=_((c)=>{var l=I(),O=P(),y=R(),g=a("path"),S=re(),f=k(),q="AWS_PROFILE",$="default",oe=(e)=>e.profile||process.env[q]||$,p=".",ie=(e)=>Object.entries(e).filter(([t])=>{let r=t.indexOf(p);if(r===-1)return!1;return Object.values(S.IniSectionType).includes(t.substring(0,r))}).reduce((t,[r,o])=>{let i=r.indexOf(p),n=r.substring(0,i)===S.IniSectionType.PROFILE?r.substring(i+1):r;return t[n]=o,t},{...e.default&&{default:e.default}}),ne="AWS_CONFIG_FILE",M=()=>process.env[ne]||g.join(l.getHomeDir(),".aws","config"),se="AWS_SHARED_CREDENTIALS_FILE",ce=()=>process.env[se]||g.join(l.getHomeDir(),".aws","credentials"),ae=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,le=["__proto__","profile __proto__"],T=(e)=>{let t={},r,o;for(let i of e.split(/\r?\n/)){let n=i.split(/(^|\s)[;#]/)[0].trim();if(n[0]==="["&&n[n.length-1]==="]"){r=void 0,o=void 0;let s=n.substring(1,n.length-1),u=ae.exec(s);if(u){let[,d,,m]=u;if(Object.values(S.IniSectionType).includes(d))r=[d,m].join(p)}else r=s;if(le.includes(s))throw Error(`Found invalid profile name "${s}"`)}else if(r){let s=n.indexOf("=");if(![0,-1].includes(s)){let[u,d]=[n.substring(0,s).trim(),n.substring(s+1).trim()];if(d==="")o=u;else{if(o&&i.trimStart()===i)o=void 0;t[r]=t[r]||{};let m=o?[o,u].join(p):u;t[r][m]=d}}}}return t},A=()=>({}),K=async(e={})=>{let{filepath:t=ce(),configFilepath:r=M()}=e,o=l.getHomeDir(),i="~/",n=t;if(t.startsWith("~/"))n=g.join(o,t.slice(2));let h=r;if(r.startsWith("~/"))h=g.join(o,r.slice(2));let s=await Promise.all([f.readFile(h,{ignoreCache:e.ignoreCache}).then(T).then(ie).catch(A),f.readFile(n,{ignoreCache:e.ignoreCache}).then(T).catch(A)]);return{configFile:s[0],credentialsFile:s[1]}},pe=(e)=>Object.entries(e).filter(([t])=>t.startsWith(S.IniSectionType.SSO_SESSION+p)).reduce((t,[r,o])=>({...t,[r.substring(r.indexOf(p)+1)]:o}),{}),ue=()=>({}),fe=async(e={})=>f.readFile(e.configFilepath??M()).then(T).then(pe).catch(ue),de=(...e)=>{let t={};for(let r of e)for(let[o,i]of Object.entries(r))if(t[o]!==void 0)Object.assign(t[o],i);else t[o]=i;return t},_e=async(e)=>{let t=await K(e);return de(t.configFile,t.credentialsFile)},Fe={getFileRecord(){return f.fileIntercept},interceptFile(e,t){f.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return y.tokenIntercept},interceptToken(e,t){y.tokenIntercept[e]=t}};c.getSSOTokenFromFile=y.getSSOTokenFromFile;c.readFile=f.readFile;c.CONFIG_PREFIX_SEPARATOR=p;c.DEFAULT_PROFILE=$;c.ENV_PROFILE=q;c.externalDataInterceptor=Fe;c.getProfileName=oe;c.loadSharedConfigFiles=K;c.loadSsoSessionData=fe;c.parseKnownFiles=_e;Object.prototype.hasOwnProperty.call(l,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:l.__proto__});Object.keys(l).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=l[e]});Object.prototype.hasOwnProperty.call(O,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:O.__proto__});Object.keys(O).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=O[e]})});
2
+ import{_ as re}from"./chunk-jkjt3e06.js";import{ug as _,xg as a}from"./chunk-r6v21jn6.js";var I=_((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.getHomeDir=void 0;var W=a("os"),V=a("path"),x={},G=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},U=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:o=`C:${V.sep}`}=process.env;if(e)return e;if(t)return t;if(r)return`${o}${r}`;let i=G();if(!x[i])x[i]=(0,W.homedir)();return x[i]};b.getHomeDir=U});var P=_((j)=>{Object.defineProperty(j,"__esModule",{value:!0});j.getSSOTokenFilepath=void 0;var X=a("crypto"),B=a("path"),J=I(),z=(e)=>{let r=(0,X.createHash)("sha1").update(e).digest("hex");return(0,B.join)((0,J.getHomeDir)(),".aws","sso","cache",`${r}.json`)};j.getSSOTokenFilepath=z});var R=_((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.getSSOTokenFromFile=C.tokenIntercept=void 0;var Q=a("fs/promises"),Y=P();C.tokenIntercept={};var Z=async(e)=>{if(C.tokenIntercept[e])return C.tokenIntercept[e];let t=(0,Y.getSSOTokenFilepath)(e),r=await(0,Q.readFile)(t,"utf8");return JSON.parse(r)};C.getSSOTokenFromFile=Z});var k=_((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.readFile=L.fileIntercept=L.filePromises=void 0;var ee=a("fs/promises");L.filePromises={};L.fileIntercept={};var te=(e,t)=>{if(L.fileIntercept[e]!==void 0)return L.fileIntercept[e];if(!L.filePromises[e]||t?.ignoreCache)L.filePromises[e]=(0,ee.readFile)(e,"utf8");return L.filePromises[e]};L.readFile=te});var ye=_((c)=>{var l=I(),O=P(),y=R(),g=a("path"),S=re(),f=k(),q="AWS_PROFILE",$="default",oe=(e)=>e.profile||process.env[q]||$,p=".",ie=(e)=>Object.entries(e).filter(([t])=>{let r=t.indexOf(p);if(r===-1)return!1;return Object.values(S.IniSectionType).includes(t.substring(0,r))}).reduce((t,[r,o])=>{let i=r.indexOf(p),n=r.substring(0,i)===S.IniSectionType.PROFILE?r.substring(i+1):r;return t[n]=o,t},{...e.default&&{default:e.default}}),ne="AWS_CONFIG_FILE",M=()=>process.env[ne]||g.join(l.getHomeDir(),".aws","config"),se="AWS_SHARED_CREDENTIALS_FILE",ce=()=>process.env[se]||g.join(l.getHomeDir(),".aws","credentials"),ae=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,le=["__proto__","profile __proto__"],T=(e)=>{let t={},r,o;for(let i of e.split(/\r?\n/)){let n=i.split(/(^|\s)[;#]/)[0].trim();if(n[0]==="["&&n[n.length-1]==="]"){r=void 0,o=void 0;let s=n.substring(1,n.length-1),u=ae.exec(s);if(u){let[,d,,m]=u;if(Object.values(S.IniSectionType).includes(d))r=[d,m].join(p)}else r=s;if(le.includes(s))throw Error(`Found invalid profile name "${s}"`)}else if(r){let s=n.indexOf("=");if(![0,-1].includes(s)){let[u,d]=[n.substring(0,s).trim(),n.substring(s+1).trim()];if(d==="")o=u;else{if(o&&i.trimStart()===i)o=void 0;t[r]=t[r]||{};let m=o?[o,u].join(p):u;t[r][m]=d}}}}return t},A=()=>({}),K=async(e={})=>{let{filepath:t=ce(),configFilepath:r=M()}=e,o=l.getHomeDir(),i="~/",n=t;if(t.startsWith("~/"))n=g.join(o,t.slice(2));let h=r;if(r.startsWith("~/"))h=g.join(o,r.slice(2));let s=await Promise.all([f.readFile(h,{ignoreCache:e.ignoreCache}).then(T).then(ie).catch(A),f.readFile(n,{ignoreCache:e.ignoreCache}).then(T).catch(A)]);return{configFile:s[0],credentialsFile:s[1]}},pe=(e)=>Object.entries(e).filter(([t])=>t.startsWith(S.IniSectionType.SSO_SESSION+p)).reduce((t,[r,o])=>({...t,[r.substring(r.indexOf(p)+1)]:o}),{}),ue=()=>({}),fe=async(e={})=>f.readFile(e.configFilepath??M()).then(T).then(pe).catch(ue),de=(...e)=>{let t={};for(let r of e)for(let[o,i]of Object.entries(r))if(t[o]!==void 0)Object.assign(t[o],i);else t[o]=i;return t},_e=async(e)=>{let t=await K(e);return de(t.configFile,t.credentialsFile)},Fe={getFileRecord(){return f.fileIntercept},interceptFile(e,t){f.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return y.tokenIntercept},interceptToken(e,t){y.tokenIntercept[e]=t}};c.getSSOTokenFromFile=y.getSSOTokenFromFile;c.readFile=f.readFile;c.CONFIG_PREFIX_SEPARATOR=p;c.DEFAULT_PROFILE=$;c.ENV_PROFILE=q;c.externalDataInterceptor=Fe;c.getProfileName=oe;c.loadSharedConfigFiles=K;c.loadSsoSessionData=fe;c.parseKnownFiles=_e;Object.prototype.hasOwnProperty.call(l,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:l.__proto__});Object.keys(l).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=l[e]});Object.prototype.hasOwnProperty.call(O,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:O.__proto__});Object.keys(O).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=O[e]})});
3
3
  export{ye as H};
4
4
 
5
- //# debugId=DD6CF3130741E7E764756E2164756E21
5
+ //# debugId=085FD690F8D0E28264756E2164756E21
@@ -9,6 +9,6 @@
9
9
  "'use strict';\n\nvar getHomeDir = require('./getHomeDir');\nvar getSSOTokenFilepath = require('./getSSOTokenFilepath');\nvar getSSOTokenFromFile = require('./getSSOTokenFromFile');\nvar path = require('path');\nvar types = require('@smithy/types');\nvar readFile = require('./readFile');\n\nconst ENV_PROFILE = \"AWS_PROFILE\";\nconst DEFAULT_PROFILE = \"default\";\nconst getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n\nconst CONFIG_PREFIX_SEPARATOR = \".\";\n\nconst getConfigData = (data) => Object.entries(data)\n .filter(([key]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n if (indexOfSeparator === -1) {\n return false;\n }\n return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator));\n})\n .reduce((acc, [key, value]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n acc[updatedKey] = value;\n return acc;\n}, {\n ...(data.default && { default: data.default }),\n});\n\nconst ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\nconst getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"config\");\n\nconst ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\nconst getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"credentials\");\n\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\nconst parseIni = (iniData) => {\n const map = {};\n let currentSection;\n let currentSubSection;\n for (const iniLine of iniData.split(/\\r?\\n/)) {\n const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim();\n const isSection = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n if (isSection) {\n currentSection = undefined;\n currentSubSection = undefined;\n const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n const matches = prefixKeyRegex.exec(sectionName);\n if (matches) {\n const [, prefix, , name] = matches;\n if (Object.values(types.IniSectionType).includes(prefix)) {\n currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n }\n }\n else {\n currentSection = sectionName;\n }\n if (profileNameBlockList.includes(sectionName)) {\n throw new Error(`Found invalid profile name \"${sectionName}\"`);\n }\n }\n else if (currentSection) {\n const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n if (![0, -1].includes(indexOfEqualsSign)) {\n const [name, value] = [\n trimmedLine.substring(0, indexOfEqualsSign).trim(),\n trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n ];\n if (value === \"\") {\n currentSubSection = name;\n }\n else {\n if (currentSubSection && iniLine.trimStart() === iniLine) {\n currentSubSection = undefined;\n }\n map[currentSection] = map[currentSection] || {};\n const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n map[currentSection][key] = value;\n }\n }\n }\n }\n return map;\n};\n\nconst swallowError$1 = () => ({});\nconst loadSharedConfigFiles = async (init = {}) => {\n const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n const homeDir = getHomeDir.getHomeDir();\n const relativeHomeDirPrefix = \"~/\";\n let resolvedFilepath = filepath;\n if (filepath.startsWith(relativeHomeDirPrefix)) {\n resolvedFilepath = path.join(homeDir, filepath.slice(2));\n }\n let resolvedConfigFilepath = configFilepath;\n if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2));\n }\n const parsedFiles = await Promise.all([\n readFile.readFile(resolvedConfigFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .then(getConfigData)\n .catch(swallowError$1),\n readFile.readFile(resolvedFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .catch(swallowError$1),\n ]);\n return {\n configFile: parsedFiles[0],\n credentialsFile: parsedFiles[1],\n };\n};\n\nconst getSsoSessionData = (data) => Object.entries(data)\n .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n\nconst swallowError = () => ({});\nconst loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath())\n .then(parseIni)\n .then(getSsoSessionData)\n .catch(swallowError);\n\nconst mergeConfigFiles = (...files) => {\n const merged = {};\n for (const file of files) {\n for (const [key, values] of Object.entries(file)) {\n if (merged[key] !== undefined) {\n Object.assign(merged[key], values);\n }\n else {\n merged[key] = values;\n }\n }\n }\n return merged;\n};\n\nconst parseKnownFiles = async (init) => {\n const parsedFiles = await loadSharedConfigFiles(init);\n return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n\nconst externalDataInterceptor = {\n getFileRecord() {\n return readFile.fileIntercept;\n },\n interceptFile(path, contents) {\n readFile.fileIntercept[path] = Promise.resolve(contents);\n },\n getTokenRecord() {\n return getSSOTokenFromFile.tokenIntercept;\n },\n interceptToken(id, contents) {\n getSSOTokenFromFile.tokenIntercept[id] = contents;\n },\n};\n\nexports.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile;\nexports.readFile = readFile.readFile;\nexports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;\nexports.DEFAULT_PROFILE = DEFAULT_PROFILE;\nexports.ENV_PROFILE = ENV_PROFILE;\nexports.externalDataInterceptor = externalDataInterceptor;\nexports.getProfileName = getProfileName;\nexports.loadSharedConfigFiles = loadSharedConfigFiles;\nexports.loadSsoSessionData = loadSsoSessionData;\nexports.parseKnownFiles = parseKnownFiles;\nObject.prototype.hasOwnProperty.call(getHomeDir, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getHomeDir['__proto__']\n });\n\nObject.keys(getHomeDir).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getHomeDir[k];\n});\nObject.prototype.hasOwnProperty.call(getSSOTokenFilepath, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getSSOTokenFilepath['__proto__']\n });\n\nObject.keys(getSSOTokenFilepath).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getSSOTokenFilepath[k];\n});\n"
10
10
  ],
11
11
  "mappings": ";8GACA,CAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,aAAkB,OAC1B,IAAM,UACA,YACA,EAAe,CAAC,EAChB,EAAqB,IAAM,CAC7B,GAAI,SAAW,QAAQ,QACnB,MAAO,GAAG,QAAQ,QAAQ,IAE9B,MAAO,WAEL,EAAa,IAAM,CACrB,IAAQ,OAAM,cAAa,WAAU,YAAY,KAAK,EAAO,OAAU,QAAQ,IAC/E,GAAI,EACA,OAAO,EACX,GAAI,EACA,OAAO,EACX,GAAI,EACA,MAAO,GAAG,IAAY,IAC1B,IAAM,EAAkB,EAAmB,EAC3C,GAAI,CAAC,EAAa,GACd,EAAa,IAAoB,EAAG,EAAK,SAAS,EACtD,OAAO,EAAa,IAEhB,aAAa,kBCxBrB,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,sBAA2B,OACnC,IAAM,cACA,YACA,MACA,EAAsB,CAAC,IAAO,CAEhC,IAAM,GADU,EAAG,EAAS,YAAY,MAAM,EACrB,OAAO,CAAE,EAAE,OAAO,KAAK,EAChD,OAAQ,EA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AE,QAAQ,QAAS,CAAC,EAAG,CAClD,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAoB,GAC9G",
12
- "debugId": "DD6CF3130741E7E764756E2164756E21",
12
+ "debugId": "085FD690F8D0E28264756E2164756E21",
13
13
  "names": []
14
14
  }
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{ic as G}from"./chunk-dfv5eqma.js";import{ye as F}from"./chunk-6j129573.js";import{hf as B}from"./chunk-0qchadp1.js";import{Gf as z,If as E}from"./chunk-f9ccncar.js";class J extends G{register(){this.app.singleton(z,()=>{let j=new z(B(E(),this.app.config.get("database",{})));return K(j),j})}}function K(j){if(Bun.env.NODE_ENV!=="development")return;for(let x of j.connectionNames){let A=j.connection(x);if(F(A.dialect))continue;let H=x===j.name?"DATABASE_URL":`The "${x}" database connection`;console.warn(`[gemi] ${H} points at ${A.dialect}, which the gemi ORM `+"does not implement \u2014 only sqlite and postgres are. The connection "+`works, so raw SQL through DB.query / DB.sql and transactions are fine, but every model operation will raise UnsupportedDialectError.
2
+ import{jc as G}from"./chunk-z4k18gnp.js";import{ze as F}from"./chunk-r77f1482.js";import{if as B}from"./chunk-87c0cy5v.js";import{If as z,Kf as E}from"./chunk-7xc64j6p.js";class J extends G{register(){this.app.singleton(z,()=>{let j=new z(B(E(),this.app.config.get("database",{})));return K(j),j})}}function K(j){if(Bun.env.NODE_ENV!=="development")return;for(let x of j.connectionNames){let A=j.connection(x);if(F(A.dialect))continue;let H=x===j.name?"DATABASE_URL":`The "${x}" database connection`;console.warn(`[gemi] ${H} points at ${A.dialect}, which the gemi ORM `+"does not implement \u2014 only sqlite and postgres are. The connection "+`works, so raw SQL through DB.query / DB.sql and transactions are fine, but every model operation will raise UnsupportedDialectError.
3
3
  (development only)`)}}
4
4
  export{J as ya};
5
5
 
6
- //# debugId=4F49991EF49AE73D64756E2164756E21
6
+ //# debugId=6CEDFFBDF896115C64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import { ormSupports } from \"../orm/dialect\";\nimport { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { databaseConfigDefaults, type DatabaseConfig } from \"./config\";\nimport { DatabaseManager } from \"./DatabaseManager\";\n\nexport class DatabaseServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n DatabaseManager,\n () => {\n const database = new DatabaseManager(\n withDefaults(\n databaseConfigDefaults(),\n this.app.config.get<DatabaseConfig>(\"database\", {}),\n ),\n );\n\n warnIfOrmUnavailable(database);\n return database;\n },\n );\n }\n}\n\n/**\n * Say it at boot, not on the first model query.\n *\n * `DatabaseManager` connects to MySQL and MariaDB without complaint — Bun's\n * client speaks them — and the ORM's compiler has no dialect for either. So a\n * deploy pointed at one starts, passes a health check, serves whatever does not\n * touch a model, and raises `UnsupportedDialectError` on the first `findMany`.\n * That is the latest and most expensive moment to learn it.\n *\n * A **warning rather than a throw**, deliberately: raw SQL through `DB.query`\n * and `DB.sql` genuinely works on those dialects, and so do transactions.\n * Refusing to construct the manager would break code that is correct today to\n * pre-empt an error the ORM already raises clearly. The supported set is a\n * property of the query compiler, not of the connection.\n *\n * Development only, for the same reason the slow-transaction warning is: it is\n * a diagnostic aimed at whoever is choosing the database, and it should not\n * add noise to a production log every time the container starts.\n */\nfunction warnIfOrmUnavailable(database: DatabaseManager): void {\n if (process.env.NODE_ENV !== \"development\") return;\n\n // Every connection, not only the default one. A named connection is a whole\n // pool an application will run model queries on — `Model.on(\"analytics\")` —\n // so it can be pointed at MySQL exactly as the default can, and warning about\n // only one of them would make the check pass while the query that raises is\n // on the other.\n for (const name of database.connectionNames) {\n const connection = database.connection(name);\n if (ormSupports(connection.dialect)) continue;\n\n const source =\n name === database.name\n ? \"DATABASE_URL\"\n : `The \"${name}\" database connection`;\n\n console.warn(\n `[gemi] ${source} points at ${connection.dialect}, which the gemi ORM ` +\n `does not implement — only sqlite and postgres are. The connection ` +\n `works, so raw SQL through DB.query / DB.sql and transactions are ` +\n `fine, but every model operation will raise ` +\n `UnsupportedDialectError.\\n(development only)`,\n );\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";8LAMO,AAAM,IAAgC,LAAgB,CAC3D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IAAM,CACJ,IAAM,EAAW,IAAI,EACnB,EACE,EAAuB,EACvB,KAAK,IAAI,OAAO,IAAoB,WAAY,CAAC,CAAC,CACpD,CACF,EAGA,OADA,EAAqB,CAAQ,EACtB,EAEX,EAEJ,CAqBA,SAAS,CAAoB,CAAC,EAAiC,CAC7D,GAAI,mBAAyB,cAAe,OAO5C,QAAW,KAAQ,EAAS,gBAAiB,CAC3C,IAAM,EAAa,EAAS,WAAW,CAAI,EAC3C,GAAI,EAAY,EAAW,OAAO,EAAG,SAErC,IAAM,EACJ,IAAS,EAAS,KACd,eACA,QAAQ,yBAEd,QAAQ,KACN,UAAU,eAAoB,EAAW,+BACvC,0EACA;AAAA,mBAGJ",
8
- "debugId": "4F49991EF49AE73D64756E2164756E21",
8
+ "debugId": "6CEDFFBDF896115C64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{k as _t}from"./chunk-q4wdg0y3.js";import{A as eo,B as ro,C as to,D as oo,E as Lt,F as yo,l as er,n as M,o as vo,p as Eo,q as So,s as Gr,t as zr,u as kt,v as Io,w as cr,x as Po,y as xo,z as ar}from"./chunk-e41vdprh.js";import{G as gt}from"./chunk-q8msf1gf.js";import"./chunk-dqbm9vd0.js";import{I as hr,J as mt,L as Qt,P as Ue,T as f}from"./chunk-qrfp7pg2.js";import{U as Oo}from"./chunk-jmse5hec.js";import"./chunk-8wpccvbt.js";import{Y as zt}from"./chunk-62xjrz5e.js";import{Z as Ht}from"./chunk-773qa4av.js";import"./chunk-dhe1hsyz.js";import"./chunk-81yzec62.js";import{ha as Zt}from"./chunk-jmbdr550.js";import{sg as S}from"./chunk-ptjexzn1.js";var A=S((oe)=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.resolveHttpAuthSchemeConfig=oe.defaultSSOOIDCHttpAuthSchemeProvider=oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=void 0;var Rr=M(),w=hr(),fr=async(e,r,i)=>{return{operation:(0,w.getSmithyContext)(r).operation,region:await(0,w.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=fr;function Fr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(r,i)=>({signingProperties:{config:r,context:i}})}}function Ur(e){return{schemeId:"smithy.api#noAuth"}}var $r=(e)=>{let r=[];switch(e.operation){case"CreateToken":{r.push(Ur(e));break}default:r.push(Fr(e))}return r};oe.defaultSSOOIDCHttpAuthSchemeProvider=$r;var jr=(e)=>{let r=(0,Rr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,w.normalizeProvider)(e.authSchemePreference??[])})};oe.resolveHttpAuthSchemeConfig=jr});var De=S((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.ruleSet=void 0;var Ee="required",p="fn",d="argv",q="ref",se=!0,ne="isSet",N="booleanEquals",D="error",b="endpoint",I="tree",G="PartitionResult",z="getAttr",pe={[Ee]:!1,type:"string"},de={[Ee]:!0,default:!1,type:"boolean"},ce={[q]:"Endpoint"},Se={[p]:N,[d]:[{[q]:"UseFIPS"},!0]},Ie={[p]:N,[d]:[{[q]:"UseDualStack"},!0]},n={},ae={[p]:z,[d]:[{[q]:G},"supportsFIPS"]},Pe={[q]:G},le={[p]:N,[d]:[!0,{[p]:z,[d]:[Pe,"supportsDualStack"]}]},ue=[Se],Oe=[Ie],ve=[{[q]:"Region"}],Ar={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[p]:ne,[d]:[ce]}],rules:[{conditions:ue,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:D},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:D},{endpoint:{url:ce,properties:n,headers:n},type:b}],type:I},{conditions:[{[p]:ne,[d]:ve}],rules:[{conditions:[{[p]:"aws.partition",[d]:ve,assign:G}],rules:[{conditions:[Se,Ie],rules:[{conditions:[{[p]:N,[d]:[se,ae]},le],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:D}],type:I},{conditions:ue,rules:[{conditions:[{[p]:N,[d]:[ae,se]}],rules:[{conditions:[{[p]:"stringEquals",[d]:[{[p]:z,[d]:[Pe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:b},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS is enabled but this partition does not support FIPS",type:D}],type:I},{conditions:Oe,rules:[{conditions:[le],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"DualStack is enabled but this partition does not support DualStack",type:D}],type:I},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I}],type:I},{error:"Invalid Configuration: Missing Region",type:D}]};xe.ruleSet=Ar});var Ne=S((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.defaultEndpointResolver=void 0;var mr=zr(),m=Gr(),Hr=De(),Lr=new m.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Tr=(e,r={})=>{return Lr.get(e,()=>(0,m.resolveEndpoint)(Hr.ruleSet,{endpointParams:e,logger:r.logger}))};be.defaultEndpointResolver=Tr;m.customEndpointFunctions.aws=mr.awsEndpointFunctions});var F=S((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.SSOOIDCServiceException=L.__ServiceException=void 0;var he=f();Object.defineProperty(L,"__ServiceException",{enumerable:!0,get:function(){return he.ServiceException}});class H extends he.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,H.prototype)}}L.SSOOIDCServiceException=H});var k=S((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.UnsupportedGrantTypeException=fe.UnauthorizedClientException=fe.SlowDownException=fe.InvalidScopeException=fe.InvalidRequestException=fe.InvalidGrantException=fe.InvalidClientException=fe.InternalServerException=fe.ExpiredTokenException=fe.AuthorizationPendingException=fe.AccessDeniedException=void 0;var l=F();class T extends l.SSOOIDCServiceException{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.AccessDeniedException=T;class B extends l.SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}fe.AuthorizationPendingException=B;class V extends l.SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}fe.ExpiredTokenException=V;class W extends l.SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InternalServerException=W;class Y extends l.SSOOIDCServiceException{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidClientException=Y;class J extends l.SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidGrantException=J;class K extends l.SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.InvalidRequestException=K;class X extends l.SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidScopeException=X;class C extends l.SSOOIDCServiceException{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}fe.SlowDownException=C;class Q extends l.SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnauthorizedClientException=Q;class Z extends l.SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnsupportedGrantTypeException=Z});var g=S((ze)=>{Object.defineProperty(ze,"__esModule",{value:!0});ze.CreateToken$=ze.CreateTokenResponse$=ze.CreateTokenRequest$=ze.errorTypeRegistries=ze.UnsupportedGrantTypeException$=ze.UnauthorizedClientException$=ze.SlowDownException$=ze.InvalidScopeException$=ze.InvalidRequestException$=ze.InvalidGrantException$=ze.InvalidClientException$=ze.InternalServerException$=ze.ExpiredTokenException$=ze.AuthorizationPendingException$=ze.AccessDeniedException$=ze.SSOOIDCServiceException$=void 0;var kr="AccessDeniedException",gr="AuthorizationPendingException",_r="AccessToken",et="ClientSecret",rt="CreateToken",tt="CreateTokenRequest",ot="CreateTokenResponse",it="CodeVerifier",st="ExpiredTokenException",nt="InvalidClientException",pt="InvalidGrantException",dt="InvalidRequestException",ct="InternalServerException",at="InvalidScopeException",lt="IdToken",ut="RefreshToken",Ot="SlowDownException",vt="UnauthorizedClientException",Et="UnsupportedGrantTypeException",St="accessToken",E="client",It="clientId",Pt="clientSecret",xt="codeVerifier",yt="code",Dt="deviceCode",t="error",bt="expiresIn",u="error_description",qt="grantType",Nt="http",O="httpError",ht="idToken",$e="reason",je="refreshToken",Rt="redirectUri",we="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",ft="scope",Ft="server",Ut="tokenType",o="com.amazonaws.ssooidc",Me=Ue(),v=k(),$t=F(),Ae=Me.TypeRegistry.for(we);ze.SSOOIDCServiceException$=[-3,we,"SSOOIDCServiceException",0,[],[]];Ae.registerError(ze.SSOOIDCServiceException$,$t.SSOOIDCServiceException);var c=Me.TypeRegistry.for(o);ze.AccessDeniedException$=[-3,o,kr,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.AccessDeniedException$,v.AccessDeniedException);ze.AuthorizationPendingException$=[-3,o,gr,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.AuthorizationPendingException$,v.AuthorizationPendingException);ze.ExpiredTokenException$=[-3,o,st,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.ExpiredTokenException$,v.ExpiredTokenException);ze.InternalServerException$=[-3,o,ct,{[t]:Ft,[O]:500},[t,u],[0,0]];c.registerError(ze.InternalServerException$,v.InternalServerException);ze.InvalidClientException$=[-3,o,nt,{[t]:E,[O]:401},[t,u],[0,0]];c.registerError(ze.InvalidClientException$,v.InvalidClientException);ze.InvalidGrantException$=[-3,o,pt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidGrantException$,v.InvalidGrantException);ze.InvalidRequestException$=[-3,o,dt,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.InvalidRequestException$,v.InvalidRequestException);ze.InvalidScopeException$=[-3,o,at,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidScopeException$,v.InvalidScopeException);ze.SlowDownException$=[-3,o,Ot,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.SlowDownException$,v.SlowDownException);ze.UnauthorizedClientException$=[-3,o,vt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnauthorizedClientException$,v.UnauthorizedClientException);ze.UnsupportedGrantTypeException$=[-3,o,Et,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnsupportedGrantTypeException$,v.UnsupportedGrantTypeException);ze.errorTypeRegistries=[Ae,c];var jt=[0,o,_r,8,0],wt=[0,o,et,8,0],Mt=[0,o,it,8,0],At=[0,o,lt,8,0],Ge=[0,o,ut,8,0];ze.CreateTokenRequest$=[3,o,tt,0,[It,Pt,qt,Dt,yt,je,ft,Rt,xt],[0,[()=>wt,0],0,0,0,[()=>Ge,0],64,0,[()=>Mt,0]],3];ze.CreateTokenResponse$=[3,o,ot,0,[St,Ut,bt,je,ht],[[()=>jt,0],0,1,[()=>Ge,0],[()=>At,0]]];ze.CreateToken$=[9,o,rt,{[Nt]:["POST","/token",200]},()=>ze.CreateTokenRequest$,()=>ze.CreateTokenResponse$]});var or=S((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var Tt=M(),Bt=Lt(),Vt=er(),Wt=f(),Yt=Ht(),ge=mt(),_e=zt(),Jt=A(),Kt=Ne(),Xt=g(),Ct=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ge.fromBase64,base64Encoder:e?.base64Encoder??ge.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Kt.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Jt.defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Tt.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Vt.NoAuthSigner}],logger:e?.logger??new Wt.NoOpLogger,protocol:e?.protocol??Bt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Xt.errorTypeRegistries,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Yt.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=Ct});var Or=S((lr)=>{Object.defineProperty(lr,"__esModule",{value:!0});lr.getRuntimeConfig=void 0;var io=Zt(),so=io.__importDefault(_t()),ir=M(),sr=eo(),U=cr(),no=ro(),nr=ar(),x=gt(),pr=Qt(),dr=f(),po=to(),co=oo(),ao=kt(),lo=or(),uo=(e)=>{(0,dr.emitWarningIfUnsupportedVersion)(process.version);let r=(0,co.resolveDefaultsModeConfig)(e),i=()=>r().then(dr.loadConfigsForDefaultMode),a=(0,lo.getRuntimeConfig)(e);(0,ir.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,x.loadConfig)(ir.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??po.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,sr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:so.default.version}),maxAttempts:e?.maxAttempts??(0,x.loadConfig)(nr.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,x.loadConfig)(U.NODE_REGION_CONFIG_OPTIONS,{...U.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:pr.NodeHttpHandler.create(e?.requestHandler??i),retryMode:e?.retryMode??(0,x.loadConfig)({...nr.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await i()).retryMode||ao.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??no.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??pr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,x.loadConfig)(U.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,x.loadConfig)(U.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,x.loadConfig)(sr.NODE_APP_ID_CONFIG_OPTIONS,s)}};lr.getRuntimeConfig=uo});var Yo=S((P)=>{var vr=vo(),Do=Eo(),bo=So(),Er=Io(),qo=cr(),_=er(),No=Ue(),ho=Po(),yr=xo(),Sr=ar(),y=f(),Ir=A(),Ro=Or(),Pr=yo(),xr=Oo(),h=g(),$=k(),fo=F(),Fo=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"})},Uo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$o=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:i,credentials:a}=e;return{setHttpAuthScheme(s){let R=r.findIndex((j)=>j.schemeId===s.schemeId);if(R===-1)r.push(s);else r.splice(R,1,s)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(s){i=s},httpAuthSchemeProvider(){return i},setCredentials(s){a=s},credentials(){return a}}},jo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},wo=(e,r)=>{let i=Object.assign(Pr.getAwsRegionExtensionConfiguration(e),y.getDefaultExtensionConfiguration(e),xr.getHttpHandlerExtensionConfiguration(e),$o(e));return r.forEach((a)=>a.configure(i)),Object.assign(e,Pr.resolveAwsRegionExtensionConfiguration(i),y.resolveDefaultRuntimeConfig(i),xr.resolveHttpHandlerRuntimeConfig(i),jo(i))};class ee extends y.Client{config;constructor(...[e]){let r=Ro.getRuntimeConfig(e||{});super(r);this.initConfig=r;let i=Fo(r),a=Er.resolveUserAgentConfig(i),s=Sr.resolveRetryConfig(a),R=qo.resolveRegionConfig(s),j=vr.resolveHostHeaderConfig(R),Dr=yr.resolveEndpointConfig(j),br=Ir.resolveHttpAuthSchemeConfig(Dr),qr=wo(br,e?.extensions||[]);this.config=qr,this.middlewareStack.use(No.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(Er.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(ho.getContentLengthPlugin(this.config)),this.middlewareStack.use(vr.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Do.getLoggerPlugin(this.config)),this.middlewareStack.use(bo.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ir.defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Nr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends y.Command.classBuilder().ep(Uo).m(function(e,r,i,a){return[yr.getEndpointPlugin(i,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(h.CreateToken$).build(){}var Mo={CreateTokenCommand:re};class te extends ee{}y.createAggregatedClient(Mo,te);var Ao={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Go={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};P.$Command=y.Command;P.__Client=y.Client;P.SSOOIDCServiceException=fo.SSOOIDCServiceException;P.AccessDeniedExceptionReason=Ao;P.CreateTokenCommand=re;P.InvalidRequestExceptionReason=Go;P.SSOOIDC=te;P.SSOOIDCClient=ee;Object.prototype.hasOwnProperty.call(h,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:h.__proto__});Object.keys(h).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=h[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=$[e]})});export default Yo();
2
+ import{k as _t}from"./chunk-e0v4byjp.js";import{A as eo,B as ro,C as to,D as oo,E as Lt,F as yo,l as er,n as M,o as vo,p as Eo,q as So,s as Gr,t as zr,u as kt,v as Io,w as cr,x as Po,y as xo,z as ar}from"./chunk-w34j3cd3.js";import{G as gt}from"./chunk-rq2k9frr.js";import"./chunk-3mp9p38x.js";import{I as hr,J as mt,L as Qt,P as Ue,T as f}from"./chunk-nxh5a3eb.js";import{U as Oo}from"./chunk-7zg1mt1g.js";import"./chunk-e1fkxt82.js";import{Y as zt}from"./chunk-9zmcz7yq.js";import{Z as Ht}from"./chunk-8bjxk57p.js";import"./chunk-jkjt3e06.js";import"./chunk-8jpvj3cj.js";import{ha as Zt}from"./chunk-rnjbja88.js";import{ug as S}from"./chunk-r6v21jn6.js";var A=S((oe)=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.resolveHttpAuthSchemeConfig=oe.defaultSSOOIDCHttpAuthSchemeProvider=oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=void 0;var Rr=M(),w=hr(),fr=async(e,r,i)=>{return{operation:(0,w.getSmithyContext)(r).operation,region:await(0,w.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=fr;function Fr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(r,i)=>({signingProperties:{config:r,context:i}})}}function Ur(e){return{schemeId:"smithy.api#noAuth"}}var $r=(e)=>{let r=[];switch(e.operation){case"CreateToken":{r.push(Ur(e));break}default:r.push(Fr(e))}return r};oe.defaultSSOOIDCHttpAuthSchemeProvider=$r;var jr=(e)=>{let r=(0,Rr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,w.normalizeProvider)(e.authSchemePreference??[])})};oe.resolveHttpAuthSchemeConfig=jr});var De=S((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.ruleSet=void 0;var Ee="required",p="fn",d="argv",q="ref",se=!0,ne="isSet",N="booleanEquals",D="error",b="endpoint",I="tree",G="PartitionResult",z="getAttr",pe={[Ee]:!1,type:"string"},de={[Ee]:!0,default:!1,type:"boolean"},ce={[q]:"Endpoint"},Se={[p]:N,[d]:[{[q]:"UseFIPS"},!0]},Ie={[p]:N,[d]:[{[q]:"UseDualStack"},!0]},n={},ae={[p]:z,[d]:[{[q]:G},"supportsFIPS"]},Pe={[q]:G},le={[p]:N,[d]:[!0,{[p]:z,[d]:[Pe,"supportsDualStack"]}]},ue=[Se],Oe=[Ie],ve=[{[q]:"Region"}],Ar={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[p]:ne,[d]:[ce]}],rules:[{conditions:ue,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:D},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:D},{endpoint:{url:ce,properties:n,headers:n},type:b}],type:I},{conditions:[{[p]:ne,[d]:ve}],rules:[{conditions:[{[p]:"aws.partition",[d]:ve,assign:G}],rules:[{conditions:[Se,Ie],rules:[{conditions:[{[p]:N,[d]:[se,ae]},le],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:D}],type:I},{conditions:ue,rules:[{conditions:[{[p]:N,[d]:[ae,se]}],rules:[{conditions:[{[p]:"stringEquals",[d]:[{[p]:z,[d]:[Pe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:b},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS is enabled but this partition does not support FIPS",type:D}],type:I},{conditions:Oe,rules:[{conditions:[le],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"DualStack is enabled but this partition does not support DualStack",type:D}],type:I},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I}],type:I},{error:"Invalid Configuration: Missing Region",type:D}]};xe.ruleSet=Ar});var Ne=S((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.defaultEndpointResolver=void 0;var mr=zr(),m=Gr(),Hr=De(),Lr=new m.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Tr=(e,r={})=>{return Lr.get(e,()=>(0,m.resolveEndpoint)(Hr.ruleSet,{endpointParams:e,logger:r.logger}))};be.defaultEndpointResolver=Tr;m.customEndpointFunctions.aws=mr.awsEndpointFunctions});var F=S((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.SSOOIDCServiceException=L.__ServiceException=void 0;var he=f();Object.defineProperty(L,"__ServiceException",{enumerable:!0,get:function(){return he.ServiceException}});class H extends he.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,H.prototype)}}L.SSOOIDCServiceException=H});var k=S((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.UnsupportedGrantTypeException=fe.UnauthorizedClientException=fe.SlowDownException=fe.InvalidScopeException=fe.InvalidRequestException=fe.InvalidGrantException=fe.InvalidClientException=fe.InternalServerException=fe.ExpiredTokenException=fe.AuthorizationPendingException=fe.AccessDeniedException=void 0;var l=F();class T extends l.SSOOIDCServiceException{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.AccessDeniedException=T;class B extends l.SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}fe.AuthorizationPendingException=B;class V extends l.SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}fe.ExpiredTokenException=V;class W extends l.SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InternalServerException=W;class Y extends l.SSOOIDCServiceException{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidClientException=Y;class J extends l.SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidGrantException=J;class K extends l.SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.InvalidRequestException=K;class X extends l.SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidScopeException=X;class C extends l.SSOOIDCServiceException{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}fe.SlowDownException=C;class Q extends l.SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnauthorizedClientException=Q;class Z extends l.SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnsupportedGrantTypeException=Z});var g=S((ze)=>{Object.defineProperty(ze,"__esModule",{value:!0});ze.CreateToken$=ze.CreateTokenResponse$=ze.CreateTokenRequest$=ze.errorTypeRegistries=ze.UnsupportedGrantTypeException$=ze.UnauthorizedClientException$=ze.SlowDownException$=ze.InvalidScopeException$=ze.InvalidRequestException$=ze.InvalidGrantException$=ze.InvalidClientException$=ze.InternalServerException$=ze.ExpiredTokenException$=ze.AuthorizationPendingException$=ze.AccessDeniedException$=ze.SSOOIDCServiceException$=void 0;var kr="AccessDeniedException",gr="AuthorizationPendingException",_r="AccessToken",et="ClientSecret",rt="CreateToken",tt="CreateTokenRequest",ot="CreateTokenResponse",it="CodeVerifier",st="ExpiredTokenException",nt="InvalidClientException",pt="InvalidGrantException",dt="InvalidRequestException",ct="InternalServerException",at="InvalidScopeException",lt="IdToken",ut="RefreshToken",Ot="SlowDownException",vt="UnauthorizedClientException",Et="UnsupportedGrantTypeException",St="accessToken",E="client",It="clientId",Pt="clientSecret",xt="codeVerifier",yt="code",Dt="deviceCode",t="error",bt="expiresIn",u="error_description",qt="grantType",Nt="http",O="httpError",ht="idToken",$e="reason",je="refreshToken",Rt="redirectUri",we="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",ft="scope",Ft="server",Ut="tokenType",o="com.amazonaws.ssooidc",Me=Ue(),v=k(),$t=F(),Ae=Me.TypeRegistry.for(we);ze.SSOOIDCServiceException$=[-3,we,"SSOOIDCServiceException",0,[],[]];Ae.registerError(ze.SSOOIDCServiceException$,$t.SSOOIDCServiceException);var c=Me.TypeRegistry.for(o);ze.AccessDeniedException$=[-3,o,kr,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.AccessDeniedException$,v.AccessDeniedException);ze.AuthorizationPendingException$=[-3,o,gr,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.AuthorizationPendingException$,v.AuthorizationPendingException);ze.ExpiredTokenException$=[-3,o,st,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.ExpiredTokenException$,v.ExpiredTokenException);ze.InternalServerException$=[-3,o,ct,{[t]:Ft,[O]:500},[t,u],[0,0]];c.registerError(ze.InternalServerException$,v.InternalServerException);ze.InvalidClientException$=[-3,o,nt,{[t]:E,[O]:401},[t,u],[0,0]];c.registerError(ze.InvalidClientException$,v.InvalidClientException);ze.InvalidGrantException$=[-3,o,pt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidGrantException$,v.InvalidGrantException);ze.InvalidRequestException$=[-3,o,dt,{[t]:E,[O]:400},[t,$e,u],[0,0,0]];c.registerError(ze.InvalidRequestException$,v.InvalidRequestException);ze.InvalidScopeException$=[-3,o,at,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.InvalidScopeException$,v.InvalidScopeException);ze.SlowDownException$=[-3,o,Ot,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.SlowDownException$,v.SlowDownException);ze.UnauthorizedClientException$=[-3,o,vt,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnauthorizedClientException$,v.UnauthorizedClientException);ze.UnsupportedGrantTypeException$=[-3,o,Et,{[t]:E,[O]:400},[t,u],[0,0]];c.registerError(ze.UnsupportedGrantTypeException$,v.UnsupportedGrantTypeException);ze.errorTypeRegistries=[Ae,c];var jt=[0,o,_r,8,0],wt=[0,o,et,8,0],Mt=[0,o,it,8,0],At=[0,o,lt,8,0],Ge=[0,o,ut,8,0];ze.CreateTokenRequest$=[3,o,tt,0,[It,Pt,qt,Dt,yt,je,ft,Rt,xt],[0,[()=>wt,0],0,0,0,[()=>Ge,0],64,0,[()=>Mt,0]],3];ze.CreateTokenResponse$=[3,o,ot,0,[St,Ut,bt,je,ht],[[()=>jt,0],0,1,[()=>Ge,0],[()=>At,0]]];ze.CreateToken$=[9,o,rt,{[Nt]:["POST","/token",200]},()=>ze.CreateTokenRequest$,()=>ze.CreateTokenResponse$]});var or=S((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var Tt=M(),Bt=Lt(),Vt=er(),Wt=f(),Yt=Ht(),ge=mt(),_e=zt(),Jt=A(),Kt=Ne(),Xt=g(),Ct=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ge.fromBase64,base64Encoder:e?.base64Encoder??ge.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Kt.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Jt.defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Tt.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Vt.NoAuthSigner}],logger:e?.logger??new Wt.NoOpLogger,protocol:e?.protocol??Bt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Xt.errorTypeRegistries,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Yt.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=Ct});var Or=S((lr)=>{Object.defineProperty(lr,"__esModule",{value:!0});lr.getRuntimeConfig=void 0;var io=Zt(),so=io.__importDefault(_t()),ir=M(),sr=eo(),U=cr(),no=ro(),nr=ar(),x=gt(),pr=Qt(),dr=f(),po=to(),co=oo(),ao=kt(),lo=or(),uo=(e)=>{(0,dr.emitWarningIfUnsupportedVersion)(process.version);let r=(0,co.resolveDefaultsModeConfig)(e),i=()=>r().then(dr.loadConfigsForDefaultMode),a=(0,lo.getRuntimeConfig)(e);(0,ir.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,x.loadConfig)(ir.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??po.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,sr.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:so.default.version}),maxAttempts:e?.maxAttempts??(0,x.loadConfig)(nr.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,x.loadConfig)(U.NODE_REGION_CONFIG_OPTIONS,{...U.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:pr.NodeHttpHandler.create(e?.requestHandler??i),retryMode:e?.retryMode??(0,x.loadConfig)({...nr.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await i()).retryMode||ao.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??no.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??pr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,x.loadConfig)(U.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,x.loadConfig)(U.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,x.loadConfig)(sr.NODE_APP_ID_CONFIG_OPTIONS,s)}};lr.getRuntimeConfig=uo});var Yo=S((P)=>{var vr=vo(),Do=Eo(),bo=So(),Er=Io(),qo=cr(),_=er(),No=Ue(),ho=Po(),yr=xo(),Sr=ar(),y=f(),Ir=A(),Ro=Or(),Pr=yo(),xr=Oo(),h=g(),$=k(),fo=F(),Fo=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"})},Uo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$o=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:i,credentials:a}=e;return{setHttpAuthScheme(s){let R=r.findIndex((j)=>j.schemeId===s.schemeId);if(R===-1)r.push(s);else r.splice(R,1,s)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(s){i=s},httpAuthSchemeProvider(){return i},setCredentials(s){a=s},credentials(){return a}}},jo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},wo=(e,r)=>{let i=Object.assign(Pr.getAwsRegionExtensionConfiguration(e),y.getDefaultExtensionConfiguration(e),xr.getHttpHandlerExtensionConfiguration(e),$o(e));return r.forEach((a)=>a.configure(i)),Object.assign(e,Pr.resolveAwsRegionExtensionConfiguration(i),y.resolveDefaultRuntimeConfig(i),xr.resolveHttpHandlerRuntimeConfig(i),jo(i))};class ee extends y.Client{config;constructor(...[e]){let r=Ro.getRuntimeConfig(e||{});super(r);this.initConfig=r;let i=Fo(r),a=Er.resolveUserAgentConfig(i),s=Sr.resolveRetryConfig(a),R=qo.resolveRegionConfig(s),j=vr.resolveHostHeaderConfig(R),Dr=yr.resolveEndpointConfig(j),br=Ir.resolveHttpAuthSchemeConfig(Dr),qr=wo(br,e?.extensions||[]);this.config=qr,this.middlewareStack.use(No.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(Er.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(ho.getContentLengthPlugin(this.config)),this.middlewareStack.use(vr.getHostHeaderPlugin(this.config)),this.middlewareStack.use(Do.getLoggerPlugin(this.config)),this.middlewareStack.use(bo.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ir.defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(Nr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends y.Command.classBuilder().ep(Uo).m(function(e,r,i,a){return[yr.getEndpointPlugin(i,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(h.CreateToken$).build(){}var Mo={CreateTokenCommand:re};class te extends ee{}y.createAggregatedClient(Mo,te);var Ao={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Go={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};P.$Command=y.Command;P.__Client=y.Client;P.SSOOIDCServiceException=fo.SSOOIDCServiceException;P.AccessDeniedExceptionReason=Ao;P.CreateTokenCommand=re;P.InvalidRequestExceptionReason=Go;P.SSOOIDC=te;P.SSOOIDCClient=ee;Object.prototype.hasOwnProperty.call(h,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:h.__proto__});Object.keys(h).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=h[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=$[e]})});export default Yo();
3
3
 
4
- //# debugId=7AF89D4DEDAA6C9364756E2164756E21
4
+ //# debugId=51A94C53592EF57564756E2164756E21
@@ -13,6 +13,6 @@
13
13
  "'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\nvar schemas_0 = require('./schemas/schemas_0');\nvar errors = require('./models/errors');\nvar SSOOIDCServiceException = require('./models/SSOOIDCServiceException');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"sso-oauth\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SSOOIDCClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOOIDCHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nclass CreateTokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"AWSSSOOIDCService\", \"CreateToken\", {})\n .n(\"SSOOIDCClient\", \"CreateTokenCommand\")\n .sc(schemas_0.CreateToken$)\n .build() {\n}\n\nconst commands = {\n CreateTokenCommand,\n};\nclass SSOOIDC extends SSOOIDCClient {\n}\nsmithyClient.createAggregatedClient(commands, SSOOIDC);\n\nconst AccessDeniedExceptionReason = {\n KMS_ACCESS_DENIED: \"KMS_AccessDeniedException\",\n};\nconst InvalidRequestExceptionReason = {\n KMS_DISABLED_KEY: \"KMS_DisabledException\",\n KMS_INVALID_KEY_USAGE: \"KMS_InvalidKeyUsageException\",\n KMS_INVALID_STATE: \"KMS_InvalidStateException\",\n KMS_KEY_NOT_FOUND: \"KMS_NotFoundException\",\n};\n\nexports.$Command = smithyClient.Command;\nexports.__Client = smithyClient.Client;\nexports.SSOOIDCServiceException = SSOOIDCServiceException.SSOOIDCServiceException;\nexports.AccessDeniedExceptionReason = AccessDeniedExceptionReason;\nexports.CreateTokenCommand = CreateTokenCommand;\nexports.InvalidRequestExceptionReason = InvalidRequestExceptionReason;\nexports.SSOOIDC = SSOOIDC;\nexports.SSOOIDCClient = SSOOIDCClient;\nObject.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: schemas_0['__proto__']\n });\n\nObject.keys(schemas_0).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];\n});\nObject.prototype.hasOwnProperty.call(errors, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: errors['__proto__']\n });\n\nObject.keys(errors).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];\n});\n"
14
14
  ],
15
15
  "mappings": ";uuBACA,CAAO,SAAe,HAAS,OAAc,LAAE,AAAO,JAAK,LAAC,JACpD,yBAAsC,kCAA+C,4CAAsD,OACnJ,IAAM,OACA,OACA,GAAiD,MAAO,EAAQ,EAAS,IAAU,CACrF,MAAO,CACH,WAAY,EAAG,EAAkB,kBAAkB,CAAO,EAAE,UAC5D,OAAS,MAAO,EAAG,EAAkB,mBAAmB,EAAO,MAAM,EAAE,IAClE,IAAM,CACH,MAAU,MAAM,yDAAyD,IAC1E,CACX,GAEI,kDAAiD,GACzD,SAAS,EAAgC,CAAC,EAAgB,CACtD,MAAO,CACH,SAAU,iBACV,kBAAmB,CACf,KAAM,YACN,OAAQ,EAAe,MAC3B,EACA,oBAAqB,CAAC,EAAQ,KAAa,CACvC,kBAAmB,CACf,SACA,SACJ,CACJ,EACJ,EAEJ,SAAS,EAAmC,CAAC,EAAgB,CACzD,MAAO,CACH,SAAU,mBACd,EAEJ,IAAM,GAAuC,CAAC,IAAmB,CAC7D,IAAM,EAAU,CAAC,EACjB,OAAQ,EAAe,eACd,cAAe,CAChB,EAAQ,KAAK,GAAoC,CAAc,CAAC,EAChE,KACJ,SAEI,EAAQ,KAAK,GAAiC,CAAc,CAAC,EAGrE,OAAO,GAEH,wCAAuC,GAC/C,IAAM,GAA8B,CAAC,IAAW,CAC5C,IAAM,GAAY,EAAG,GAAO,0BAA0B,CAAM,EAC5D,OAAO,OAAO,OAAO,EAAU,CAC3B,sBAAuB,EAAG,EAAkB,mBAAmB,EAAO,sBAAwB,CAAC,CAAC,CACpG,CAAC,GAEG,+BAA8B,qBCtDtC,OAAO,eAAe,GAAS,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21",
16
+ "debugId": "51A94C53592EF57564756E2164756E21",
17
17
  "names": []
18
18
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  class A extends Error{constructor(p,q){super(`Target [${p}] is not bound in the container.`+(q.length>0?` Bound tokens: ${q.join(", ")}.`:" No tokens are bound \u2014 was the application booted?"));this.name="BindingResolutionError"}}class C{bindings=new Map;instances=new Map;bind(p,q){this.bindings.set(p.token,{factory:q,shared:!1}),this.instances.delete(p.token)}singleton(p,q){this.bindings.set(p.token,{factory:q,shared:!0}),this.instances.delete(p.token)}instance(p,q){return this.instances.set(p.token,q),q}bound(p){return this.bindings.has(p.token)||this.instances.has(p.token)}resolved(p){return this.instances.has(p.token)}make(p){let q=p.token;if(this.instances.has(q))return this.instances.get(q);let v=this.bindings.get(q);if(!v)throw new A(q,this.keys());let x=v.factory(this);if(v.shared)this.instances.set(q,x);return x}forget(p){this.instances.delete(p.token)}keys(){return[...new Set([...this.bindings.keys(),...this.instances.keys()])]}flush(){this.bindings.clear(),this.instances.clear()}}
3
- export{A as dg,C as eg};
3
+ export{A as fg,C as gg};
4
4
 
5
- //# debugId=1956E0CAD630460964756E2164756E21
5
+ //# debugId=ABE74F199E20FE1E64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "/**\n * Tokens are the service classes themselves, so `make(MailManager)` is typed\n * `MailManager` without a cast. The container keys its bindings off the class's\n * `static token` string rather than the constructor object: the built binary\n * (`dist/bin/gemi.js`) bundles its own copy of gemi while the app resolves\n * `gemi/*` to source, so the same service is two distinct class objects across\n * that boundary. A string survives it. Laravel binds both `'mail'` and\n * `MailManager::class` for the same reason.\n */\nexport type ServiceToken<T> = (abstract new (...args: any[]) => T) & {\n token: string;\n};\n\nexport type Factory<T> = (app: Container) => T;\n\ninterface Binding {\n factory: Factory<any>;\n shared: boolean;\n}\n\nexport class BindingResolutionError extends Error {\n constructor(token: string, known: string[]) {\n super(\n `Target [${token}] is not bound in the container.` +\n (known.length > 0\n ? ` Bound tokens: ${known.join(\", \")}.`\n : \" No tokens are bound — was the application booted?\"),\n );\n this.name = \"BindingResolutionError\";\n }\n}\n\nexport class Container {\n private bindings = new Map<string, Binding>();\n private instances = new Map<string, any>();\n\n bind<T>(token: ServiceToken<T>, factory: Factory<T>) {\n this.bindings.set(token.token, { factory, shared: false });\n this.instances.delete(token.token);\n }\n\n /**\n * Lazy by design — `factory` is not called until the first `make()`.\n */\n singleton<T>(token: ServiceToken<T>, factory: Factory<T>) {\n this.bindings.set(token.token, { factory, shared: true });\n this.instances.delete(token.token);\n }\n\n instance<T>(token: ServiceToken<T>, object: T): T {\n this.instances.set(token.token, object);\n return object;\n }\n\n bound<T>(token: ServiceToken<T>): boolean {\n return (\n this.bindings.has(token.token) || this.instances.has(token.token)\n );\n }\n\n resolved<T>(token: ServiceToken<T>): boolean {\n return this.instances.has(token.token);\n }\n\n make<T>(token: ServiceToken<T>): T {\n const key = token.token;\n\n if (this.instances.has(key)) {\n return this.instances.get(key) as T;\n }\n\n const binding = this.bindings.get(key);\n if (!binding) {\n throw new BindingResolutionError(key, this.keys());\n }\n\n const object = binding.factory(this) as T;\n if (binding.shared) {\n this.instances.set(key, object);\n }\n return object;\n }\n\n forget<T>(token: ServiceToken<T>) {\n this.instances.delete(token.token);\n }\n\n keys(): string[] {\n return [\n ...new Set([...this.bindings.keys(), ...this.instances.keys()]),\n ];\n }\n\n flush() {\n this.bindings.clear();\n this.instances.clear();\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";AAoBO,MAAM,UAA+B,KAAM,CAChD,WAAW,CAAC,EAAe,EAAiB,CAC1C,MACE,WAAW,qCACR,EAAM,OAAS,EACZ,kBAAkB,EAAM,KAAK,IAAI,KACjC,0DACR,EACA,KAAK,KAAO,yBAEhB,CAEO,MAAM,CAAU,CACb,SAAW,IAAI,IACf,UAAY,IAAI,IAExB,IAAO,CAAC,EAAwB,EAAqB,CACnD,KAAK,SAAS,IAAI,EAAM,MAAO,CAAE,UAAS,OAAQ,EAAM,CAAC,EACzD,KAAK,UAAU,OAAO,EAAM,KAAK,EAMnC,SAAY,CAAC,EAAwB,EAAqB,CACxD,KAAK,SAAS,IAAI,EAAM,MAAO,CAAE,UAAS,OAAQ,EAAK,CAAC,EACxD,KAAK,UAAU,OAAO,EAAM,KAAK,EAGnC,QAAW,CAAC,EAAwB,EAAc,CAEhD,OADA,KAAK,UAAU,IAAI,EAAM,MAAO,CAAM,EAC/B,EAGT,KAAQ,CAAC,EAAiC,CACxC,OACE,KAAK,SAAS,IAAI,EAAM,KAAK,GAAK,KAAK,UAAU,IAAI,EAAM,KAAK,EAIpE,QAAW,CAAC,EAAiC,CAC3C,OAAO,KAAK,UAAU,IAAI,EAAM,KAAK,EAGvC,IAAO,CAAC,EAA2B,CACjC,IAAM,EAAM,EAAM,MAElB,GAAI,KAAK,UAAU,IAAI,CAAG,EACxB,OAAO,KAAK,UAAU,IAAI,CAAG,EAG/B,IAAM,EAAU,KAAK,SAAS,IAAI,CAAG,EACrC,GAAI,CAAC,EACH,MAAM,IAAI,EAAuB,EAAK,KAAK,KAAK,CAAC,EAGnD,IAAM,EAAS,EAAQ,QAAQ,IAAI,EACnC,GAAI,EAAQ,OACV,KAAK,UAAU,IAAI,EAAK,CAAM,EAEhC,OAAO,EAGT,MAAS,CAAC,EAAwB,CAChC,KAAK,UAAU,OAAO,EAAM,KAAK,EAGnC,IAAI,EAAa,CACf,MAAO,CACL,GAAG,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,KAAK,EAAG,GAAG,KAAK,UAAU,KAAK,CAAC,CAAC,CAChE,EAGF,KAAK,EAAG,CACN,KAAK,SAAS,MAAM,EACpB,KAAK,UAAU,MAAM,EAEzB",
8
- "debugId": "1956E0CAD630460964756E2164756E21",
8
+ "debugId": "ABE74F199E20FE1E64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{G as r}from"./chunk-q8msf1gf.js";import"./chunk-dqbm9vd0.js";import{Z as mc}from"./chunk-773qa4av.js";import"./chunk-dhe1hsyz.js";import{$ as _}from"./chunk-81yzec62.js";import{rg as u,ug as O}from"./chunk-ptjexzn1.js";import{Buffer as hc}from"buffer";import{request as Yc}from"http";function E(c){return new Promise((I,x)=>{let N=Yc({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});N.on("error",(T)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),T)),N.destroy()}),N.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),N.destroy()}),N.on("response",(T)=>{let{statusCode:y=400}=T;if(y<200||300<=y)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:y})),N.destroy();let $=[];T.on("data",(w)=>{$.push(w)}),T.on("end",()=>{I(hc.concat($)),N.destroy()})}),N.end()})}var K;var D=O(()=>{K=u(_(),1)});var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",L=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var W=()=>{};var Hc=1000,qc=0,Q=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var X=()=>{};var v=(c,I)=>{let x=c();for(let N=0;N<I;N++)x=x.catch(c);return x};var b=()=>{};import{parse as Sc}from"url";var z,H="AWS_CONTAINER_CREDENTIALS_FULL_URI",q="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",M="AWS_CONTAINER_AUTHORIZATION_TOKEN",kc=(c={})=>{let{timeout:I,maxRetries:x}=Q(c);return()=>v(async()=>{let N=await jc({logger:c.logger}),T=JSON.parse(await fc(I,N));if(!G(T))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return L(T)},x)},fc=async(c,I)=>{if(process.env[M])I.headers={...I.headers,Authorization:process.env[M]};return(await E({...I,timeout:c})).toString()},uc="169.254.170.2",Ec,$c,jc=async({logger:c})=>{if(process.env[q])return{hostname:uc,path:process.env[q]};if(process.env[H]){let I=Sc(process.env[H]);if(!I.hostname||!(I.hostname in Ec))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in $c))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${q} or ${H} environment variable is set`,{tryNextLink:!1,logger:c})};var p=O(()=>{D();W();X();b();z=u(_(),1),Ec={localhost:!0,"127.0.0.1":!0},$c={"http:":!0,"https:":!0}});var C,Z;var a=O(()=>{C=u(_(),1);Z=class Z extends C.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(c,I=!0){super(c,I);this.tryNextLink=I,Object.setPrototypeOf(this,Z.prototype)}}});var J;var B=O(()=>{(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}))});var n;var o=O(()=>{n={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0}});var f;var t=O(()=>{(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}))});var Ac="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Jc="ec2_metadata_service_endpoint_mode",s;var g=O(()=>{t();s={environmentVariableSelector:(c)=>c[Ac],configFileSelector:(c)=>c[Jc],default:f.IPv4}});var U,l,F=async()=>l.parseUrl(await vc()||await zc()),vc=async()=>U.loadConfig(n)(),zc=async()=>{let c=await U.loadConfig(s)();switch(c){case f.IPv4:return J.IPv4;case f.IPv6:return J.IPv6;default:throw Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(f)}`)}};var P=O(()=>{B();o();t();g();U=u(r(),1),l=u(mc(),1)});var V=(c,I)=>{let x=300+Math.floor(Math.random()*300),N=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(N)}.
2
+ import{G as r}from"./chunk-rq2k9frr.js";import"./chunk-3mp9p38x.js";import{Z as mc}from"./chunk-8bjxk57p.js";import"./chunk-jkjt3e06.js";import{$ as _}from"./chunk-8jpvj3cj.js";import{tg as u,wg as O}from"./chunk-r6v21jn6.js";import{Buffer as hc}from"buffer";import{request as Yc}from"http";function E(c){return new Promise((I,x)=>{let N=Yc({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});N.on("error",(T)=>{x(Object.assign(new K.ProviderError("Unable to connect to instance metadata service"),T)),N.destroy()}),N.on("timeout",()=>{x(new K.ProviderError("TimeoutError from instance metadata service")),N.destroy()}),N.on("response",(T)=>{let{statusCode:y=400}=T;if(y<200||300<=y)x(Object.assign(new K.ProviderError("Error response received from instance metadata service"),{statusCode:y})),N.destroy();let $=[];T.on("data",(w)=>{$.push(w)}),T.on("end",()=>{I(hc.concat($)),N.destroy()})}),N.end()})}var K;var D=O(()=>{K=u(_(),1)});var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",L=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var W=()=>{};var Hc=1000,qc=0,Q=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var X=()=>{};var v=(c,I)=>{let x=c();for(let N=0;N<I;N++)x=x.catch(c);return x};var b=()=>{};import{parse as Sc}from"url";var z,H="AWS_CONTAINER_CREDENTIALS_FULL_URI",q="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",M="AWS_CONTAINER_AUTHORIZATION_TOKEN",kc=(c={})=>{let{timeout:I,maxRetries:x}=Q(c);return()=>v(async()=>{let N=await jc({logger:c.logger}),T=JSON.parse(await fc(I,N));if(!G(T))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return L(T)},x)},fc=async(c,I)=>{if(process.env[M])I.headers={...I.headers,Authorization:process.env[M]};return(await E({...I,timeout:c})).toString()},uc="169.254.170.2",Ec,$c,jc=async({logger:c})=>{if(process.env[q])return{hostname:uc,path:process.env[q]};if(process.env[H]){let I=Sc(process.env[H]);if(!I.hostname||!(I.hostname in Ec))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in $c))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${q} or ${H} environment variable is set`,{tryNextLink:!1,logger:c})};var p=O(()=>{D();W();X();b();z=u(_(),1),Ec={localhost:!0,"127.0.0.1":!0},$c={"http:":!0,"https:":!0}});var C,Z;var a=O(()=>{C=u(_(),1);Z=class Z extends C.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(c,I=!0){super(c,I);this.tryNextLink=I,Object.setPrototypeOf(this,Z.prototype)}}});var J;var B=O(()=>{(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(J||(J={}))});var n;var o=O(()=>{n={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0}});var f;var t=O(()=>{(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}))});var Ac="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",Jc="ec2_metadata_service_endpoint_mode",s;var g=O(()=>{t();s={environmentVariableSelector:(c)=>c[Ac],configFileSelector:(c)=>c[Jc],default:f.IPv4}});var U,l,F=async()=>l.parseUrl(await vc()||await zc()),vc=async()=>U.loadConfig(n)(),zc=async()=>{let c=await U.loadConfig(s)();switch(c){case f.IPv4:return J.IPv4;case f.IPv6:return J.IPv6;default:throw Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(f)}`)}};var P=O(()=>{B();o();t();g();U=u(r(),1),l=u(mc(),1)});var V=(c,I)=>{let x=300+Math.floor(Math.random()*300),N=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(N)}.
3
3
  For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let T=c.originalExpiration??c.expiration;return{...c,...T?{originalExpiration:T}:{},expiration:N}};var d=()=>{};var e=(c,I={})=>{let x=I?.logger||console,N;return async()=>{let T;try{if(T=await c(),T.expiration&&T.expiration.getTime()<Date.now())T=V(T,x)}catch(y){if(N)x.warn("Credential renew failed: ",y),T=V(N,x);else throw y}return N=T,T}};var i=O(()=>{d()});var Nc,k,Tc="/latest/meta-data/iam/security-credentials/",Kc="/latest/api/token",R="AWS_EC2_METADATA_V1_DISABLED",cc="ec2_metadata_v1_disabled",Ic="x-aws-ec2-metadata-token",YI=(c={})=>e(_c(c),{logger:c.logger}),_c=(c={})=>{let I=!1,{logger:x,profile:N}=c,{timeout:T,maxRetries:y}=Q(c),$=async(w,j)=>{if(I||j.headers?.[Ic]==null){let h=!1,Y=!1,wc=await Nc.loadConfig({environmentVariableSelector:(S)=>{let A=S[R];if(Y=!!A&&A!=="false",A===void 0)throw new k.CredentialsProviderError(`${R} not set in env, checking config file next.`,{logger:c.logger});return Y},configFileSelector:(S)=>{let A=S[cc];return h=!!A&&A!=="false",h},default:!1},{profile:N})();if(c.ec2MetadataV1Disabled||wc){let S=[];if(c.ec2MetadataV1Disabled)S.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(h)S.push(`config file profile (${cc})`);if(Y)S.push(`process environment variable (${R})`);throw new Z(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${S.join(", ")}].`)}}let yc=(await v(async()=>{let h;try{h=await Gc(j)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)).trim();return v(async()=>{let h;try{h=await Lc(yc,j,c)}catch(Y){if(Y.statusCode===401)I=!1;throw Y}return h},w)};return async()=>{let w=await F();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(y,{...w,timeout:T});else{let j;try{j=(await Dc({...w,timeout:T})).toString()}catch(m){if(m?.statusCode===400)throw Object.assign(m,{message:"EC2 Metadata token request returned error"});else if(m.message==="TimeoutError"||[403,404,405].includes(m.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(y,{...w,timeout:T})}return $(y,{...w,headers:{[Ic]:j},timeout:T})}}},Dc=async(c)=>E({...c,path:Kc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Gc=async(c)=>(await E({...c,path:Tc})).toString(),Lc=async(c,I,x)=>{let N=JSON.parse((await E({...I,path:Tc+c})).toString());if(!G(N))throw new k.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return L(N)};var xc=O(()=>{a();D();W();X();b();P();i();Nc=u(r(),1),k=u(_(),1)});var Oc=()=>{};var Qc=O(()=>{D();P();B();p();xc();X();Oc()});Qc();export{Q as providerConfigFromInit,E as httpRequest,F as getInstanceMetadataEndpoint,YI as fromInstanceMetadata,kc as fromContainerMetadata,J as Endpoint,q as ENV_CMDS_RELATIVE_URI,H as ENV_CMDS_FULL_URI,M as ENV_CMDS_AUTH_TOKEN,Hc as DEFAULT_TIMEOUT,qc as DEFAULT_MAX_RETRIES};
4
4
 
5
- //# debugId=670884F3653AEAAE64756E2164756E21
5
+ //# debugId=005045D50087E54664756E2164756E21
@@ -19,6 +19,6 @@
19
19
  "export * from \"./fromContainerMetadata\";\nexport * from \"./fromInstanceMetadata\";\nexport * from \"./remoteProvider/RemoteProviderInit\";\nexport * from \"./types\";\nexport { httpRequest } from \"./remoteProvider/httpRequest\";\nexport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\nexport { Endpoint } from \"./config/Endpoint\";\n"
20
20
  ],
21
21
  "mappings": ";gQACA,WAAS,UACT,YAAS,QACF,GAAS,CAAW,CAAC,EAAS,CACjC,OAAO,IAAI,QAAQ,CAAC,EAAS,IAAW,CACpC,IAAM,EAAM,GAAQ,CAChB,OAAQ,SACL,EACH,SAAU,EAAQ,UAAU,QAAQ,aAAc,IAAI,CAC1D,CAAC,EACD,EAAI,GAAG,QAAS,CAAC,IAAQ,CACrB,EAAO,OAAO,OAAO,IAAI,gBAAc,gDAAgD,EAAG,CAAG,CAAC,EAC9F,EAAI,QAAQ,EACf,EACD,EAAI,GAAG,UAAW,IAAM,CACpB,EAAO,IAAI,gBAAc,6CAA6C,CAAC,EACvE,EAAI,QAAQ,EACf,EACD,EAAI,GAAG,WAAY,CAAC,IAAQ,CACxB,IAAQ,aAAa,KAAQ,EAC7B,GAAI,EAAa,KAAO,KAAO,EAC3B,EAAO,OAAO,OAAO,IAAI,gBAAc,wDAAwD,EAAG,CAAE,YAAW,CAAC,CAAC,EACjH,EAAI,QAAQ,EAEhB,IAAM,EAAS,CAAC,EAChB,EAAI,GAAG,OAAQ,CAAC,IAAU,CACtB,EAAO,KAAK,CAAK,EACpB,EACD,EAAI,GAAG,MAAO,IAAM,CAChB,EAAQ,GAAO,OAAO,CAAM,CAAC,EAC7B,EAAI,QAAQ,EACf,EACJ,EACD,EAAI,IAAI,EACX,MAlCL,gCCAa,EAAoB,CAAC,IAAQ,QAAQ,CAAG,GACjD,OAAO,IAAQ,UACf,OAAO,EAAI,cAAgB,UAC3B,OAAO,EAAI,kBAAoB,UAC/B,OAAO,EAAI,QAAU,UACrB,OAAO,EAAI,aAAe,SACjB,EAAsB,CAAC,KAAW,CAC3C,YAAa,EAAM,YACnB,gBAAiB,EA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MAAM,GAAiB,IAAK,EAAU,SAAQ,CAAC,GAAG,SAAS,EAExE,MAAO,EAAO,CACV,GAAI,GAAO,aAAe,IACtB,MAAM,OAAO,OAAO,EAAO,CACvB,QAAS,2CACb,CAAC,EAEA,QAAI,EAAM,UAAY,gBAAkB,CAAC,IAAK,IAAK,GAAG,EAAE,SAAS,EAAM,UAAU,EAClF,EAAoB,GAGxB,OADA,GAAQ,MAAM,4BAA6B,6BAA6B,EACjE,EAAe,EAAY,IAAK,EAAU,SAAQ,CAAC,EAE9D,OAAO,EAAe,EAAY,IAC3B,EACH,QAAS,EACJ,IAA2B,CAChC,EACA,SACJ,CAAC,KAIP,GAAmB,MAAO,IAAY,EAAY,IACjD,EACH,KAAM,GACN,OAAQ,MACR,QAAS,CACL,uCAAwC,OAC5C,CACJ,CAAC,EACK,GAAa,MAAO,KAAa,MAAM,EAAY,IAAK,EAAS,KAAM,EAAU,CAAC,GAAG,SAAS,EAC9F,GAA4B,MAAO,EAAS,EAAS,IAAS,CAChE,IAAM,EAAsB,KAAK,OAAO,MAAM,EAAY,IACnD,EACH,KAAM,GAAY,CACtB,CAAC,GAAG,SAAS,CAAC,EACd,GAAI,CAAC,EAAkB,CAAmB,EACtC,MAAM,IAAI,2BAAyB,4DAA6D,CAC5F,OAAQ,EAAK,MACjB,CAAC,EAEL,OAAO,EAAoB,CAAmB,iBAlIlD,IACA,IACA,IACA,IACA,IACA,IACA,IARA,YACA,yCCGA,IACA,IACA,IANA,IACA,KACA,IACA",
22
- "debugId": "670884F3653AEAAE64756E2164756E21",
22
+ "debugId": "005045D50087E54664756E2164756E21",
23
23
  "names": []
24
24
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ptjexzn1.js";function R(f,D){let P=new Map;for(let p of[...D.tables].sort())P.set(p,{name:p,columns:[],primaryKey:[],relations:[]});for(let{table:p,...s}of D.columns)P.get(p)?.columns.push(s);for(let{table:p,column:s}of D.primaryKeys)P.get(p)?.primaryKey.push(s);let d=new Map;for(let p of D.foreignKeys){let s=P.get(p.table);if(!s)continue;let M=`${p.table}\x00${p.key}`,q=d.get(M);if(!q)q={name:p.name,columns:[],referencedTable:p.referencedTable,referencedColumns:[],onDelete:p.onDelete,onUpdate:p.onUpdate},d.set(M,q),s.relations.push(q);q.columns.push(p.column),q.referencedColumns.push(p.referencedColumn)}return{dialect:f,tables:[...P.values()]}}async function h(f,D){let P=await f.unsafe(`
2
+ import"./chunk-r6v21jn6.js";function R(f,D){let P=new Map;for(let p of[...D.tables].sort())P.set(p,{name:p,columns:[],primaryKey:[],relations:[]});for(let{table:p,...s}of D.columns)P.get(p)?.columns.push(s);for(let{table:p,column:s}of D.primaryKeys)P.get(p)?.primaryKey.push(s);let d=new Map;for(let p of D.foreignKeys){let s=P.get(p.table);if(!s)continue;let M=`${p.table}\x00${p.key}`,q=d.get(M);if(!q)q={name:p.name,columns:[],referencedTable:p.referencedTable,referencedColumns:[],onDelete:p.onDelete,onUpdate:p.onUpdate},d.set(M,q),s.relations.push(q);q.columns.push(p.column),q.referencedColumns.push(p.referencedColumn)}return{dialect:f,tables:[...P.values()]}}async function h(f,D){let P=await f.unsafe(`
3
3
  select TABLE_NAME as name
4
4
  from information_schema.TABLES
5
5
  where TABLE_SCHEMA = database() and TABLE_TYPE = 'BASE TABLE'
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  var j=globalThis.__GEMI_DICTIONARY_REGISTRY__??={registry:new Map,resolved:new Map,inFlight:new Map,renderThenables:new Map,order:[],warmed:new Map,activeLocale:null},{registry:W,resolved:Z,inFlight:V,renderThenables:I,order:E,warmed:X}=j;function N(q,x){return`${q}\x00${x}`}function D(q){if(W.has(q.id))return;W.set(q.id,q),E.push(q.id)}function H(){return E.length}function P(q,x){return Z.get(q)?.get(x)}function $(q,x,A){let z=Z.get(q);if(!z)z=new Map,Z.set(q,z);z.set(x,A)}function U(q,x){let A=P(q,x);if(A)return A;let z=N(q,x),C=V.get(z);if(C)return C;let B=W.get(q);if(!B)throw Error(`Unknown dictionary "${q}". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`);let J=B.load(x);if(!(J instanceof Promise))return $(q,x,J),J;let O=J.then((Q)=>{return $(q,x,Q),V.delete(z),Q},(Q)=>{throw V.delete(z),Q});return V.set(z,O),O}function K(q,x){let A=N(q,x),z=P(q,x),C=I.get(A);if(C&&!(C.degraded&&z))return C;if(z)return G(A,M(z,!C));let B=U(q,x);if(!(B instanceof Promise))return G(A,M(B,!0));let J=B.then((O)=>O,(O)=>{return console.error(`Failed to load dictionary ${q} for locale ${x}; rendering keys instead.`,O),J.degraded=!0,Y});return G(A,J)}function G(q,x){return I.set(q,x),x}function M(q,x){return Object.assign(Promise.resolve(q),{status:"fulfilled",value:q,inHand:x?q:void 0})}var Y={};async function S(q,x){let A=x??X.get(q)??0,z=E.slice(A);if(z.length===0)return;let C=await Promise.all(z.map(async(B)=>{try{return await U(B,_(B,q)),!0}catch{return!1}}));if(x===void 0){let B=C.indexOf(!1),J=B===-1?z.length:B;X.set(q,Math.max(X.get(q)??0,A+J))}}function _(q,x){if(x)return x;return W.get(q)?.locales[0]??x}function L(q,x){if(!q)return;for(let[A,z]of Object.entries(q))$(A,x,z)}function R(q){if(q)j.activeLocale=q}function w(){return j.activeLocale}if(typeof window<"u"){let q=window,x=([z,C,B])=>{$(z,C,B)},A=Array.isArray(q.__GEMI_DICT__)?q.__GEMI_DICT__:[];q.__GEMI_DICT__={push:x};for(let z of A)x(z)}function F(){W.clear(),Z.clear(),V.clear(),I.clear(),X.clear(),E.length=0,j.activeLocale=null}function f(){let q=new Set,x=[],A=[];return{use(z,C,B){let J=`${z} ${C}`;if(q.has(J))return;q.add(J);let O={id:z,locale:C,strings:B};if(x.length===0){A.push(O);return}for(let Q of x)Q(O)},onUse(z){x.push(z);while(A.length>0)z(A.shift())}}}
3
- export{D as Kf,H as Lf,U as Mf,K as Nf,S as Of,L as Pf,R as Qf,w as Rf,F as Sf,f as Tf};
3
+ export{D as Mf,H as Nf,U as Of,K as Pf,S as Qf,L as Rf,R as Sf,w as Tf,F as Uf,f as Vf};
4
4
 
5
- //# debugId=2C4C5FB864B6626F64756E2164756E21
5
+ //# debugId=FB34D6006D1F1C0864756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import type { LocaleStrings } from \"./dictionaryShape\";\n\n/**\n * Collects the dictionaries one SSR render actually read.\n *\n * Scoped per request by living in React context rather than in module state: a\n * streaming server has several renders in flight at once, so a module-level\n * collector would mix one page's dictionaries into another's payload. Context\n * is per render tree, which is exactly the boundary wanted, and it needs no\n * async-local storage to survive React's internal scheduling.\n *\n * Why stream these rather than put them in `__GEMI_DATA__`: that snapshot is\n * serialized before `renderToReadableStream` is even called, and which\n * dictionaries a page reads is only known once it has rendered. A suspended\n * segment reveals later still, long after the shell has flushed.\n *\n * The sink deliberately emits data, not markup — `streamQueryInjection` owns\n * script formatting and the `</script>`-safe encoding that goes with it.\n */\nexport interface DictionaryUse {\n id: string;\n locale: string;\n strings: LocaleStrings;\n}\n\nexport interface DictionarySink {\n /** Called during render, the first time a dictionary is read. */\n use(id: string, locale: string, strings: LocaleStrings): void;\n /** The response injector subscribes to receive uses as they happen. */\n onUse(cb: (use: DictionaryUse) => void): void;\n}\n\nexport function createDictionarySink(): DictionarySink {\n const seen = new Set<string>();\n const listeners: Array<(use: DictionaryUse) => void> = [];\n // Uses recorded before the injector subscribed — the render begins before the\n // response stream is wrapped.\n const pending: DictionaryUse[] = [];\n\n return {\n use(id, locale, strings) {\n const key = `${id} ${locale}`;\n if (seen.has(key)) return;\n seen.add(key);\n const entry: DictionaryUse = { id, locale, strings };\n if (listeners.length === 0) {\n pending.push(entry);\n return;\n }\n for (const listener of listeners) listener(entry);\n },\n onUse(cb) {\n listeners.push(cb);\n while (pending.length > 0) {\n cb(pending.shift()!);\n }\n },\n };\n}\n"
7
7
  ],
8
8
  "mappings": ";AA6FA,IAAM,EAAyB,WAFZ,+BAE+C,CAChE,SAAU,IAAI,IACd,SAAU,I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AAC,EAAI,CACR,EAAU,KAAK,CAAE,EACjB,MAAO,EAAQ,OAAS,EACtB,EAAG,EAAQ,MAAM,CAAE,EAGzB",
9
- "debugId": "2C4C5FB864B6626F64756E2164756E21",
9
+ "debugId": "FB34D6006D1F1C0864756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  import{constants as X}from"os";var U=Symbol.for("gemi.server.shutdown");function P(){let j=globalThis;return j[U]??={shuttingDown:!1,drained:!1},j[U]}function Y(){return P().shuttingDown}function Z(){P().shuttingDown=!0}function $(){P().drained=!0}function y(j=process.env){let z={timeoutMs:Q(j.GEMI_SHUTDOWN_TIMEOUT,20),delayMs:Q(j.GEMI_SHUTDOWN_DELAY,0),providerTimeoutMs:Q(j.GEMI_SHUTDOWN_PROVIDER_TIMEOUT,5)};if(z.delayMs>0&&z.delayMs>=z.timeoutMs)console.warn(`[gemi] GEMI_SHUTDOWN_DELAY (${z.delayMs/1000}s) leaves no time to drain within GEMI_SHUTDOWN_TIMEOUT (${z.timeoutMs/1000}s); in-flight requests will be abandoned on every shutdown. Raise the timeout.`);return z}function Q(j,z){let B=j===void 0||j.trim()===""?NaN:Number(j);if(Number.isFinite(B)&&B>=0)return B*1000;if(j!==void 0)console.warn(`[gemi] Ignoring shutdown setting "${j}": expected a number of seconds.`);return z*1000}async function G(j){let{server:z,settings:B}=j,H=Date.now()+B.timeoutMs;Z(),console.log(`[gemi] Shutting down: draining in-flight requests (up to ${B.timeoutMs/1000}s).`);let F=!0;if(z){if(B.delayMs>0)await M(Math.min(B.delayMs,H-Date.now()));let O=z.stop(),R=H-Date.now();if(F=R>0?await C(O,R):z.pendingRequests===0,!F)console.error(`[gemi] Shutdown grace period elapsed with ${z.pendingRequests} request(s) still in flight; abandoning them.`),z.stop(!0).catch(()=>{})}$();let K=await j.shutdownProviders({timeoutMs:B.providerTimeoutMs}),J=F&&K.failed.length===0&&K.timedOut.length===0;return console.log(`[gemi] Shutdown ${J?"complete":"finished with errors"}.`),J?0:1}async function C(j,z){if(z<=0)return!1;let B,H=await Promise.race([j.then(()=>!0,()=>!0),new Promise((F)=>{B=setTimeout(()=>F(!1),z)})]);return clearTimeout(B),H}function M(j){return new Promise((z)=>setTimeout(z,Math.max(0,j)))}function f(j){if(!Y())return j;try{return j.headers.set("Connection","close"),j}catch{let z=new Response(j.body,j);return z.headers.set("Connection","close"),z}}function _(j){return async(z,B)=>{if(P().drained)return new Response("Service Unavailable",{status:503,headers:{Connection:"close"}});return f(await j(z,B))}}var V=Symbol.for("gemi.server.signalsInstalled"),q=1000;function w(j,z={}){let B=globalThis;if(B[V])return;B[V]=!0;let H=z.repeatWindowMs??q,F,K=(J)=>{if(F!==void 0){if(Date.now()-F<H)return;console.error(`[gemi] ${J} received again; exiting without waiting for the drain.`),process.exit(128+X.signals[J])}F=Date.now(),console.log(`[gemi] ${J} received.`),j().then((O)=>process.exit(O),(O)=>{console.error("[gemi] Shutdown failed:",O),process.exit(1)})};process.on("SIGTERM",K),process.on("SIGINT",K)}
3
- export{Y as fg,Z as gg,y as hg,G as ig,_ as jg,w as kg};
3
+ export{Y as hg,Z as ig,y as jg,G as kg,_ as lg,w as mg};
4
4
 
5
- //# debugId=9470A2E0C1892F6364756E2164756E21
5
+ //# debugId=C843CB0E911DF94C64756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import { constants } from \"node:os\";\nimport type { ShutdownReport } from \"../foundation/Application\";\nimport type { Instrumentation } from \"./types\";\n\n// On `globalThis` under a registry symbol rather than in a module variable, so\n// the flag an app's health route reads is the one the server set even when two\n// copies of this module are loaded — the built CLI bundles its own gemi (see\n// `app/App.ts`), and `bun --hot` re-evaluates every module on a reload.\nconst STATE = Symbol.for(\"gemi.server.shutdown\");\n\ntype ShutdownState = { shuttingDown: boolean; drained: boolean };\n\nfunction state(): ShutdownState {\n const global = globalThis as { [STATE]?: ShutdownState };\n global[STATE] ??= { shuttingDown: false, drained: false };\n return global[STATE];\n}\n\n/**\n * True from the moment this server process has been told to stop — before it\n * stops accepting connections — until it exits.\n *\n * gemi has no health endpoint of its own, so taking an instance out of a load\n * balancer is the app's health route's job: answer it with a `503` while this\n * is true, and the platform's probe pulls the instance while the in-flight\n * requests are still draining. Every response sent in that window also carries\n * `Connection: close`, so a client that honours it opens its next request on a\n * new connection — one the load balancer can route elsewhere — instead of\n * reusing this one.\n */\nexport function isShuttingDown(): boolean {\n return state().shuttingDown;\n}\n\nexport function markShuttingDown() {\n state().shuttingDown = true;\n}\n\n/**\n * The request drain is over and the providers' `shutdown()` may be running:\n * from here on a request must not reach the app. See `serveForShutdown`.\n */\nexport function markDrained() {\n state().drained = true;\n}\n\n/** Test seam: a fresh process starts false, and so should each test. */\nexport function resetShuttingDown() {\n state().shuttingDown = false;\n state().drained = false;\n}\n\nexport type ShutdownSettings = {\n /**\n * From the signal to the end of the request drain, in milliseconds — the\n * delay below included. Requests still in flight when it runs out are\n * abandoned. `GEMI_SHUTDOWN_TIMEOUT`, in seconds; default 20. `0` means\n * \"close the listener and do not wait\": a shutdown with nothing in flight is\n * still a clean one.\n */\n timeoutMs: number;\n /**\n * How long to keep accepting new requests after `isShuttingDown()` turns\n * true, in milliseconds, so a health probe can see the `503` and the load\n * balancer stop routing here before the listener closes.\n * `GEMI_SHUTDOWN_DELAY`, in seconds; default 0.\n */\n delayMs: number;\n /**\n * The shared deadline for every provider's `shutdown()`, in milliseconds,\n * after the drain. `GEMI_SHUTDOWN_PROVIDER_TIMEOUT`, in seconds; default 5.\n * `0` skips the hooks — deliberately, so it is not reported as a failure.\n */\n providerTimeoutMs: number;\n};\n\n/**\n * 20s to drain plus 5s for providers is 25s: under the 30s that Kubernetes,\n * Azure Container Apps and ECS give by default between `SIGTERM` and `SIGKILL`,\n * with 5s left for the `gemi start` relay, the process exit and clock skew\n * between the platform's timer and ours. A platform with a shorter window\n * (Cloud Run's 10s, Fly's 5s) needs these lowered, not the other way round —\n * a drain that outlives the grace period ends in the same `SIGKILL` as no drain.\n *\n * The delay defaults to 0 because it only helps where a probe is watching, and\n * otherwise every shutdown would pay it for nothing.\n */\nexport function shutdownSettings(\n env: Record<string, string | undefined> = process.env,\n): ShutdownSettings {\n const settings = {\n timeoutMs: seconds(env.GEMI_SHUTDOWN_TIMEOUT, 20),\n delayMs: seconds(env.GEMI_SHUTDOWN_DELAY, 0),\n providerTimeoutMs: seconds(env.GEMI_SHUTDOWN_PROVIDER_TIMEOUT, 5),\n };\n // Warned, not clamped: the delay is sized to a probe, the timeout to the\n // platform's grace period, and which one is wrong only the operator knows.\n // Left alone, every shutdown spends the whole timeout in the delay and then\n // abandons whatever is in flight without draining it.\n if (settings.delayMs > 0 && settings.delayMs >= settings.timeoutMs) {\n console.warn(\n `[gemi] GEMI_SHUTDOWN_DELAY (${settings.delayMs / 1000}s) leaves no time to drain within GEMI_SHUTDOWN_TIMEOUT (${settings.timeoutMs / 1000}s); in-flight requests will be abandoned on every shutdown. Raise the timeout.`,\n );\n }\n return settings;\n}\n\nfunction seconds(value: string | undefined, fallback: number): number {\n const parsed = value === undefined || value.trim() === \"\" ? NaN : Number(value);\n if (Number.isFinite(parsed) && parsed >= 0) return parsed * 1000;\n if (value !== undefined) {\n console.warn(`[gemi] Ignoring shutdown setting \"${value}\": expected a number of seconds.`);\n }\n return fallback * 1000;\n}\n\n/** The part of `Bun.Server` a drain needs. */\nexport type Stoppable = {\n stop(closeActiveConnections?: boolean): Promise<void>;\n readonly pendingRequests: number;\n};\n\n/**\n * The shutdown sequence, in its order:\n *\n * 1. `isShuttingDown()` turns true — first, so the health route answers `503`\n * and responses carry `Connection: close` while the listener is still open.\n * 2. After `delayMs`, the listener closes (`server.stop()` without force):\n * new connections are refused, while every request in flight — a streamed\n * response included, to its last chunk — runs to completion.\n * 3. That completion is awaited until `timeoutMs` from the start.\n * 4. From here a request is refused with a `503` before it reaches the app\n * (`serveForShutdown`), and every provider's `shutdown()` runs, reverse\n * order, `providerTimeoutMs`.\n *\n * Resolves with the exit code: 0 when every step finished in time, 1 when the\n * drain was cut short or a provider failed or overran.\n *\n * Two things `stop()` does not do, both measured on Bun 1.3.14, and both why\n * the process exit that follows is what actually ends the server:\n *\n * - It does not close a kept-alive connection. One that is idle when the\n * listener closes stays open, and a request sent down it afterwards is\n * served. That is what the `Connection: close` on every response in the\n * window is for: a client (or a proxy in front) that honours it opens its\n * next request on a new connection, which the closed listener refuses. A\n * client that does not honour it is what step 4's `503` is for — Bun does\n * not close the socket after a `Connection: close` response either (#566).\n * - `stop(true)` issued after a graceful `stop()` does not cut the remaining\n * requests off; it waits for the same ones. It is still called when the\n * drain times out, for a Bun that does, but nothing here depends on it. Nor\n * does it close an idle kept-alive connection. Only a `stop(true)` issued\n * *first* does that, and it cuts off the requests in flight with it, which\n * is the drain given up — so the idle ones are refused, not closed.\n */\nexport async function drain(params: {\n server: Stoppable | undefined;\n shutdownProviders: (options: { timeoutMs: number }) => Promise<ShutdownReport>;\n settings: ShutdownSettings;\n}): Promise<number> {\n const { server, settings } = params;\n const deadline = Date.now() + settings.timeoutMs;\n\n markShuttingDown();\n console.log(\n `[gemi] Shutting down: draining in-flight requests (up to ${settings.timeoutMs / 1000}s).`,\n );\n\n let drained = true;\n if (server) {\n if (settings.delayMs > 0) {\n await sleep(Math.min(settings.delayMs, deadline - Date.now()));\n }\n const stopped = server.stop();\n // No time left to wait — a `GEMI_SHUTDOWN_TIMEOUT` of 0, or a delay that\n // spent all of it — is \"do not wait for what is in flight\", and that is\n // only a failure when something *is* in flight. Reading it as one made\n // every clean shutdown log an abandonment and exit 1 for the operator who\n // zeroed the budget to fit a 5s grace period, with nothing to abandon.\n const remaining = deadline - Date.now();\n drained =\n remaining > 0 ? await settlesWithin(stopped, remaining) : server.pendingRequests === 0;\n if (!drained) {\n console.error(\n `[gemi] Shutdown grace period elapsed with ${server.pendingRequests} request(s) still in flight; abandoning them.`,\n );\n void server.stop(true).catch(() => {});\n }\n }\n\n // Whether or not the drain finished: a request that arrives now, down a\n // kept-alive connection the listener's close left open, would run against\n // providers that are being shut down underneath it.\n markDrained();\n const report = await params.shutdownProviders({ timeoutMs: settings.providerTimeoutMs });\n const clean = drained && report.failed.length === 0 && report.timedOut.length === 0;\n console.log(`[gemi] Shutdown ${clean ? \"complete\" : \"finished with errors\"}.`);\n return clean ? 0 : 1;\n}\n\nasync function settlesWithin(promise: Promise<unknown>, ms: number): Promise<boolean> {\n // `drain` decides for itself what a budget that is already spent means, so\n // this is only a guard: a race against `setTimeout(0)` is a coin toss, and\n // \"did not settle within no time at all\" is the honest answer to it.\n if (ms <= 0) return false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const result = await Promise.race([\n promise.then(\n () => true,\n () => true,\n ),\n new Promise<false>((resolve) => {\n timer = setTimeout(() => resolve(false), ms);\n }),\n ]);\n clearTimeout(timer);\n return result;\n}\n\nfunction sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));\n}\n\n/**\n * `Connection: close` on a response sent while shutting down, so the client's\n * next request opens a connection — which the load balancer can send elsewhere\n * — instead of reusing this one.\n *\n * The spec makes some responses' headers immutable (a `Response.redirect`, a\n * proxied `fetch`), and setting one throws. Bun 1.3.14 lets both be set, so\n * the copy is for a Bun that follows the spec — a throw here would turn every\n * such response in the drain window into a 500.\n */\nexport function closeConnectionWhileShuttingDown(res: Response): Response {\n if (!isShuttingDown()) return res;\n try {\n res.headers.set(\"Connection\", \"close\");\n return res;\n } catch {\n const copy = new Response(res.body, res);\n copy.headers.set(\"Connection\", \"close\");\n return copy;\n }\n}\n\n/**\n * What every response goes through while this process serves: the app's\n * instrumentation, with the two changes a shutdown makes to it.\n *\n * - While the requests in flight drain, a response carries `Connection: close`\n * (`closeConnectionWhileShuttingDown`).\n * - Once they have drained, a request is answered `503` with\n * `Connection: close` and reaches neither the app nor its instrumentation.\n * The listener is closed by then, so only a kept-alive connection can still\n * deliver one, and `server.stop()` leaves those open. Serving it would run a\n * handler against providers whose `shutdown()` is closing the pool, the\n * queue or the cache it uses — until the process exits. The instrumentation\n * is skipped too because it is app code, and a tracer or error reporter is\n * exactly what a provider flushes and closes at this point.\n */\nexport function serveForShutdown(instrumentation: Instrumentation): Instrumentation {\n return async (req, next) => {\n if (state().drained) {\n return new Response(\"Service Unavailable\", {\n status: 503,\n headers: { Connection: \"close\" },\n });\n }\n return closeConnectionWhileShuttingDown(await instrumentation(req, next));\n };\n}\n\n// Installed once per process, not once per `Server`: a listener per instance\n// would each start a shutdown of its own, and read the other's signal as the\n// second one.\nconst SIGNALS_INSTALLED = Symbol.for(\"gemi.server.signalsInstalled\");\n\n/**\n * A repeat of the first signal inside this window is the same shutdown\n * delivered twice, not an operator asking to skip the drain. One shutdown\n * routinely arrives more than once, milliseconds apart: Ctrl+C on\n * `bun run start` reaches the server directly (the whole foreground group is\n * signalled), and again through `gemi start`'s relay — twice over, since\n * `bun run` forwards it to `gemi start` too. systemd's default\n * `KillMode=control-group` and `tini -g` do the same to every process in the\n * group. A person pressing Ctrl+C again is well outside a second.\n */\nconst REPEAT_WINDOW_MS = 1000;\n\n/**\n * `SIGTERM` or `SIGINT` runs `stop` and exits with the code it resolves with.\n * Another signal of either kind, more than `repeatWindowMs` after the first,\n * exits at once with `128 + n` — an operator pressing Ctrl+C again does not\n * want to wait out the grace period. Without a listener the first signal would\n * do that too: the default action for both is to terminate the process on the\n * spot.\n */\nexport function installShutdownSignals(\n stop: () => Promise<number>,\n options: { repeatWindowMs?: number } = {},\n) {\n const global = globalThis as { [SIGNALS_INSTALLED]?: boolean };\n if (global[SIGNALS_INSTALLED]) return;\n global[SIGNALS_INSTALLED] = true;\n\n const repeatWindowMs = options.repeatWindowMs ?? REPEAT_WINDOW_MS;\n let receivedAt: number | undefined;\n const onSignal = (signal: \"SIGTERM\" | \"SIGINT\") => {\n if (receivedAt !== undefined) {\n if (Date.now() - receivedAt < repeatWindowMs) return;\n console.error(`[gemi] ${signal} received again; exiting without waiting for the drain.`);\n process.exit(128 + constants.signals[signal]);\n }\n receivedAt = Date.now();\n console.log(`[gemi] ${signal} received.`);\n stop().then(\n (code) => process.exit(code),\n (error) => {\n console.error(\"[gemi] Shutdown failed:\", error);\n process.exit(1);\n },\n );\n };\n process.on(\"SIGTERM\", onSignal);\n process.on(\"SIGINT\", onSignal);\n}\n"
6
6
  ],
7
7
  "mappings": ";AAAA,oBAAS,WAQT,IAAM,EAAQ,OAAO,IAAI,sBAAsB,EAI/C,SAAS,CAAK,EAAkB,CAC9B,IAAM,EAAS,WAEf,OADA,EAAO,KAAW,CAAE,aAAc,GAAO,QAAS,EAAM,EACjD,EAAO,GAeT,SAAS,CAAc,EAAY,CACxC,OAAO,EAAM,EAAE,aAGV,SAAS,CAAgB,EAAG,CACjC,EAAM,EAAE,aAAe,GAOlB,SAAS,CAAW,EAAG,CAC5B,EAAM,EAAE,QAAU,GA4Cb,SAAS,CAAgB,CAC9B,EAA0C,QAAQ,IAChC,CAClB,IAAM,EAAW,CACf,UAAW,EAAQ,EAAI,sBAAuB,EAAE,EAChD,QAAS,EAAQ,EAAI,oBAAqB,CAAC,EAC3C,kBAAmB,EAAQ,EAAI,+BAAgC,CAAC,CAClE,EAKA,GAAI,EAAS,QAAU,GAAK,EAAS,SAAW,EAAS,UACvD,QAAQ,KACN,+BAA+B,EAAS,QAAU,gEAAgE,EAAS,UAAY,oFACzI,EAEF,OAAO,EAGT,SAAS,CAAO,CAAC,EAA2B,EAA0B,CACpE,IAAM,EAAS,IAAU,QAAa,EAAM,KAAK,IAAM,GAAK,IAAM,OAAO,CAAK,EAC9E,GAAI,OAAO,SAAS,CAAM,GAAK,GAAU,EAAG,OAAO,EAAS,KAC5D,GAAI,IAAU,OACZ,QAAQ,KAAK,qCAAqC,mCAAuC,EAE3F,OAAO,EAAW,KA0CpB,eAAsB,CAAK,CAAC,EAIR,CAClB,IAAQ,SAAQ,YAAa,EACvB,EAAW,KAAK,IAAI,EAAI,EAAS,UAEvC,EAAiB,EACjB,QAAQ,IACN,4DAA4D,EAAS,UAAY,SACnF,EAEA,IAAI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AC,EAAmD,CAClF,MAAO,OAAO,EAAK,IAAS,CAC1B,GAAI,EAAM,EAAE,QACV,OAAO,IAAI,SAAS,sBAAuB,CACzC,OAAQ,IACR,QAAS,CAAE,WAAY,OAAQ,CACjC,CAAC,EAEH,OAAO,EAAiC,MAAM,EAAgB,EAAK,CAAI,CAAC,GAO5E,IAAM,EAAoB,OAAO,IAAI,8BAA8B,EAY7D,EAAmB,KAUlB,SAAS,CAAsB,CACpC,EACA,EAAuC,CAAC,EACxC,CACA,IAAM,EAAS,WACf,GAAI,EAAO,GAAoB,OAC/B,EAAO,GAAqB,GAE5B,IAAM,EAAiB,EAAQ,gBAAkB,EAC7C,EACE,EAAW,CAAC,IAAiC,CACjD,GAAI,IAAe,OAAW,CAC5B,GAAI,KAAK,IAAI,EAAI,EAAa,EAAgB,OAC9C,QAAQ,MAAM,UAAU,0DAA+D,EACvF,QAAQ,KAAK,IAAM,EAAU,QAAQ,EAAO,EAE9C,EAAa,KAAK,IAAI,EACtB,QAAQ,IAAI,UAAU,aAAkB,EACxC,EAAK,EAAE,KACL,CAAC,IAAS,QAAQ,KAAK,CAAI,EAC3B,CAAC,IAAU,CACT,QAAQ,MAAM,0BAA2B,CAAK,EAC9C,QAAQ,KAAK,CAAC,EAElB,GAEF,QAAQ,GAAG,UAAW,CAAQ,EAC9B,QAAQ,GAAG,SAAU,CAAQ",
8
- "debugId": "9470A2E0C1892F6364756E2164756E21",
8
+ "debugId": "C843CB0E911DF94C64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Md as O,Nd as Z,fe as _,ie as R,je as W,ke as F,le as C,me as G,ne as Y,oe as N,pe as S,ve as K}from"./chunk-6j129573.js";import{tg as P}from"./chunk-ptjexzn1.js";var E={};P(E,{registeredNames:()=>b,register:()=>T,has:()=>y,get:()=>A,clearRegistry:()=>x});var J=new Map;function T(q,z){J.set(q,z)}function y(q){return J.has(q)}function A(q){let z=J.get(q);if(z===void 0)throw new _(q,[...J.keys()]);return z}function b(){return[...J.keys()]}function x(){J.clear()}var w=/^\s*::\s*(?:text\s*::\s*)?(jsonb|json)\b(?!\s*\[)/i,h=/^\s*as\s+(jsonb|json)\s*\)/i,c=/\bcast\s*\(\s*$/i,f=new Set;function U(q,z){if(!z.typesParametersFromStatement)return{fragment:q,jsonParameters:f};let B=C(q),D=new Set,H;for(let X=0;X<B.length-1;X++){let $=B[X+1],Q=w.exec($);if(Q){H??=[...B],H[X+1]=`::text::${Q[1]}${$.slice(Q[0].length)}`,D.add(X);continue}let V=h.exec($);if(V&&c.test((H??B)[X]))H??=[...B],H[X+1]=` as text)::${V[1]}${$.slice(V[0].length)}`,D.add(X)}if(!H)return{fragment:q,jsonParameters:D};return{fragment:G(H,q.binders),jsonParameters:D}}function M(q,z){if(q===null||q===void 0)return null;let B=K(q);if(B==="db")return null;if(B==="json")return"null";if(B==="any")throw new Z(z,"DB",z,"Prisma.AnyNull is a filter operand \u2014 it asks for a SQL NULL *or* a JSON "+"null \u2014 so it has no single value to bind. Write the one you mean: "+"Prisma.DbNull for the column being NULL, Prisma.JsonNull for the JSON value.");if(typeof q==="string")return q;let D;try{D=JSON.stringify(q)}catch(H){throw new Z(z,"DB",z,`A parameter cast to json could not be serialised: ${H instanceof Error?H.message:String(H)}. `+"Bind text you have serialised yourself if the value is not JSON \u2014 a "+"bigint has no JSON form, and neither does a cycle.")}if(D===void 0)throw new Z(z,"DB",z,`A ${typeof q} was bound to a parameter cast to json, and has no JSON form. Bind the value it stands for.`);return D}var I=new WeakSet;function L(q){return I.add(q),q}function k(q){return typeof q==="object"&&q!==null&&I.has(q)}function t(q,...z){if(!Array.isArray(q)||!("raw"in q))throw new O("sql","DB","sql","'sql' is a tagged template \u2014 write sql`select 1`, not sql(\"select 1\"). "+"To put text that is not a value into a statement, use 'unsafeSql', and read what it says first.");let B=[];for(let D=0;D<q.length;D++)if(B.push(W(q[D])),D<z.length)B.push(j(z[D]));return L(Y(...B))}function r(q,z=", "){if(!Array.isArray(q))throw new Z("join","DB","sql",`Expected an array of fragments or values, got ${typeof q}.`);if(q.length===0)return p;let B=q.map(j);if(k(z)){let D=[];for(let H=0;H<B.length;H++){if(H>0)D.push(z);D.push(B[H])}return L(Y(...D))}return v(z),L(N(B,z))}var g=/^[\s,]*$|^\s*(?:and|or)\s*$/i;function v(q){if(typeof q==="string"&&g.test(q))return;throw new Z("join","DB","sql",typeof q==="string"?`A separator is written into the SQL text, so it may only be glue: whitespace, commas, or 'and' / 'or'. Got ${JSON.stringify(q)}. If that is deliberate, say so with `+"unsafeSql(...) \u2014 and never build one from anything that came from "+"outside the program.":`Expected a separator string or a fragment, got ${q===null?"null":typeof q}.`)}var p=L(Object.freeze({text:"",binders:Object.freeze([])}));function a(q){if(typeof q!=="string")throw new Z("unsafeSql","DB","sql",`Expected a string literal, got ${Array.isArray(q)?"an array":typeof q}. 'unsafeSql' is a plain call, not a tagged template \u2014 a template would `+"interpolate values into the SQL text, which is the one thing it must never do.");return L(W(q))}function e(q,z,B="query"){if(!k(q))throw new Z(B,"DB",B,`Expected a fragment built with 'sql', got ${q===null?"null":typeof q}. A plain string is not accepted here on purpose \u2014 it would be the one `+"path into the SQL text that nobody had to think about.");let D=U(q,z),H=S(D.fragment,z,{model:"DB",operation:B});return{text:H.text,values:R(H.binders)(void 0).map((X,$)=>D.jsonParameters.has($)?M(X,B):X===null||X===void 0?X??null:z.encodeUntyped(X))}}function j(q){if(k(q))return q;return F(()=>q)}
3
- export{T as Cd,y as Dd,A as Ed,b as Fd,E as Gd,t as Hd,r as Id,p as Jd,a as Kd,e as Ld};
2
+ import{Nd as O,Od as Z,ge as _,je as R,ke as W,le as F,me as C,ne as G,oe as Y,pe as N,qe as S,we as K}from"./chunk-r77f1482.js";import{vg as P}from"./chunk-r6v21jn6.js";var E={};P(E,{registeredNames:()=>b,register:()=>T,has:()=>y,get:()=>A,clearRegistry:()=>x});var J=new Map;function T(q,z){J.set(q,z)}function y(q){return J.has(q)}function A(q){let z=J.get(q);if(z===void 0)throw new _(q,[...J.keys()]);return z}function b(){return[...J.keys()]}function x(){J.clear()}var w=/^\s*::\s*(?:text\s*::\s*)?(jsonb|json)\b(?!\s*\[)/i,h=/^\s*as\s+(jsonb|json)\s*\)/i,c=/\bcast\s*\(\s*$/i,f=new Set;function U(q,z){if(!z.typesParametersFromStatement)return{fragment:q,jsonParameters:f};let B=C(q),D=new Set,H;for(let X=0;X<B.length-1;X++){let $=B[X+1],Q=w.exec($);if(Q){H??=[...B],H[X+1]=`::text::${Q[1]}${$.slice(Q[0].length)}`,D.add(X);continue}let V=h.exec($);if(V&&c.test((H??B)[X]))H??=[...B],H[X+1]=` as text)::${V[1]}${$.slice(V[0].length)}`,D.add(X)}if(!H)return{fragment:q,jsonParameters:D};return{fragment:G(H,q.binders),jsonParameters:D}}function M(q,z){if(q===null||q===void 0)return null;let B=K(q);if(B==="db")return null;if(B==="json")return"null";if(B==="any")throw new Z(z,"DB",z,"Prisma.AnyNull is a filter operand \u2014 it asks for a SQL NULL *or* a JSON "+"null \u2014 so it has no single value to bind. Write the one you mean: "+"Prisma.DbNull for the column being NULL, Prisma.JsonNull for the JSON value.");if(typeof q==="string")return q;let D;try{D=JSON.stringify(q)}catch(H){throw new Z(z,"DB",z,`A parameter cast to json could not be serialised: ${H instanceof Error?H.message:String(H)}. `+"Bind text you have serialised yourself if the value is not JSON \u2014 a "+"bigint has no JSON form, and neither does a cycle.")}if(D===void 0)throw new Z(z,"DB",z,`A ${typeof q} was bound to a parameter cast to json, and has no JSON form. Bind the value it stands for.`);return D}var I=new WeakSet;function L(q){return I.add(q),q}function k(q){return typeof q==="object"&&q!==null&&I.has(q)}function t(q,...z){if(!Array.isArray(q)||!("raw"in q))throw new O("sql","DB","sql","'sql' is a tagged template \u2014 write sql`select 1`, not sql(\"select 1\"). "+"To put text that is not a value into a statement, use 'unsafeSql', and read what it says first.");let B=[];for(let D=0;D<q.length;D++)if(B.push(W(q[D])),D<z.length)B.push(j(z[D]));return L(Y(...B))}function r(q,z=", "){if(!Array.isArray(q))throw new Z("join","DB","sql",`Expected an array of fragments or values, got ${typeof q}.`);if(q.length===0)return p;let B=q.map(j);if(k(z)){let D=[];for(let H=0;H<B.length;H++){if(H>0)D.push(z);D.push(B[H])}return L(Y(...D))}return v(z),L(N(B,z))}var g=/^[\s,]*$|^\s*(?:and|or)\s*$/i;function v(q){if(typeof q==="string"&&g.test(q))return;throw new Z("join","DB","sql",typeof q==="string"?`A separator is written into the SQL text, so it may only be glue: whitespace, commas, or 'and' / 'or'. Got ${JSON.stringify(q)}. If that is deliberate, say so with `+"unsafeSql(...) \u2014 and never build one from anything that came from "+"outside the program.":`Expected a separator string or a fragment, got ${q===null?"null":typeof q}.`)}var p=L(Object.freeze({text:"",binders:Object.freeze([])}));function a(q){if(typeof q!=="string")throw new Z("unsafeSql","DB","sql",`Expected a string literal, got ${Array.isArray(q)?"an array":typeof q}. 'unsafeSql' is a plain call, not a tagged template \u2014 a template would `+"interpolate values into the SQL text, which is the one thing it must never do.");return L(W(q))}function e(q,z,B="query"){if(!k(q))throw new Z(B,"DB",B,`Expected a fragment built with 'sql', got ${q===null?"null":typeof q}. A plain string is not accepted here on purpose \u2014 it would be the one `+"path into the SQL text that nobody had to think about.");let D=U(q,z),H=S(D.fragment,z,{model:"DB",operation:B});return{text:H.text,values:R(H.binders)(void 0).map((X,$)=>D.jsonParameters.has($)?M(X,B):X===null||X===void 0?X??null:z.encodeUntyped(X))}}function j(q){if(k(q))return q;return F(()=>q)}
3
+ export{T as Dd,y as Ed,A as Fd,b as Gd,E as Hd,t as Id,r as Jd,p as Kd,a as Ld,e as Md};
4
4
 
5
- //# debugId=B33C883D7DE34A5264756E2164756E21
5
+ //# debugId=76F6B53744070ED764756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import type { SqlDialect } from \"./dialect\";\nimport {\n InvalidArgumentError,\n UnsupportedQueryError,\n} from \"./errors\";\nimport {\n type Fragment,\n bindValues,\n concat,\n joinFragments,\n param,\n render,\n sql as text,\n} from \"./compile/fragment\";\nimport { jsonTextParameter, retypeJsonParameters } from \"./json-param\";\n\n/**\n * SQL fragments as first-class values: `sql`, `join`, `empty`, and one door out.\n *\n * The ORM deliberately does not implement every SQL shape — `distinct`, cursor\n * pagination, window functions, recursive CTEs. That is the right call, but it\n * is only half a decision: the shapes it declines have to have somewhere to go,\n * and \"drop to raw SQL\" is not an answer if raw SQL cannot be *composed*.\n *\n * `DB.sql` — Bun's tagged template — covers a single self-contained statement,\n * and that is genuinely all it covers. The shape it cannot express is the common\n * one: a predicate list built conditionally, passed around as a value, and\n * interpolated into a larger statement.\n *\n * ```ts\n * const filters = []\n * if (q) filters.push(sql`name ilike ${`%${q}%`}`)\n * if (organizationId) filters.push(sql`\"organizationId\" = ${organizationId}`)\n *\n * const where = filters.length ? sql`where ${join(filters, \" and \")}` : empty\n * const rows = await DB.query(sql`select * from \"Product\" ${where} limit ${20}`)\n * ```\n *\n * ## This is the compiler's own `Fragment`, made public\n *\n * Not a parallel mechanism. `compile/fragment.ts` has held exactly this shape\n * since iteration 1 — text plus positional binders, composable, never\n * concatenating a value into the text — because that is what invariant 2 needs\n * internally. Reusing it means a public fragment binds by the same rule the\n * compiler's own SQL does, and it means the parameter ceiling, the placeholder\n * numbering and the dialect split are all already handled rather than\n * reimplemented one door down.\n *\n * **Placeholders are assigned at assembly, not at authoring.** SQLite writes\n * `?` and Postgres writes `$1`, `$2`, and a fragment does not know where in the\n * final statement it will land — so `sql` records a *position* and `render`\n * turns it into a placeholder once the whole statement exists. That is what lets\n * the same fragment be nested, reused twice in one statement, or built before\n * the dialect is even known.\n */\n\n/**\n * A composable piece of SQL. Its values are bound parameters, never text.\n *\n * Opaque on purpose: an application builds one with `sql`, combines it with\n * `join`, and hands it to `DB.query` / `DB.execute`. Reading `.text` off it is\n * not part of the contract — it holds parameter *markers* rather than the\n * dialect's placeholders, so it is not the statement that runs.\n */\nexport type SqlFragment = Fragment;\n\n/**\n * Every fragment this module has produced.\n *\n * **Identity, not shape, and the difference is a SQL injection.** `interpolate`\n * splices a fragment as text and binds everything else, so \"is this a fragment\"\n * decides whether a value reaches the statement or a parameter. Asking the\n * *shape* — a `text` string and a `binders` array — makes that decision\n * answerable by anything that can name two properties, and `{\"text\": \"…\",\n * \"binders\": []}` is two lines of JSON:\n *\n * ```ts\n * const body = await request.json()\n * await DB.query(sql`select \"email\" from \"User\" where \"email\" = ${body.email}`)\n * // body.email = { text: `'' union select \"password\" from \"User\"`, binders: [] }\n * // -> select \"email\" from \"User\" where \"email\" = '' union select \"password\" from \"User\"\n * ```\n *\n * That is the intended call site with the intended safe value, and it returned\n * the password column out of a statement selecting only `email`. The internal\n * `Fragment` never had the problem because nothing outside `compile/` could\n * construct one; making the type public is what turned \"text plus binders\" from\n * an implementation detail into a shape an attacker can name. `unsafeSql` is\n * built so that reaching for the escape hatch is a decision — a structural check\n * is a second, unmarked door beside it.\n *\n * A `WeakSet` the module owns cannot be forged: membership is granted only by\n * the constructors below. It registers the *returned* object rather than\n * stamping a property, because `concat` and `joinFragments` return fresh objects\n * — a marker property on the inputs would not survive them, and the version that\n * cannot drift is the one that brands what actually comes out.\n */\nconst FRAGMENTS = new WeakSet<object>();\n\nfunction brand(fragment: Fragment): SqlFragment {\n FRAGMENTS.add(fragment);\n return fragment;\n}\n\n/** Whether a value is a fragment *this module made*, so it splices rather than binds. */\nfunction isFragment(value: unknown): value is Fragment {\n return typeof value === \"object\" && value !== null && FRAGMENTS.has(value);\n}\n\n/**\n * A SQL fragment. Every `${value}` is bound as a parameter; a `${fragment}` is\n * spliced in, carrying its own parameters with it.\n *\n * ```ts\n * sql`where \"id\" = ${id}` // \"id\" = $1, with id bound\n * sql`where ${sql`\"a\" = ${1}`} and ${sql`\"b\" = ${2}`}` // nests to any depth\n * ```\n *\n * An interpolated **array** is bound as one value, not expanded — that is what\n * Postgres's `= any($1)` wants, and it is the only reading that does not depend\n * on the dialect. For a comma-separated list of placeholders, say so with\n * `join`.\n *\n * A value at a `::jsonb` cast the caller wrote is the one parameter with a type\n * behind it, and it is bound as **JSON text** so that the statement means what\n * the same statement meant under Prisma's `$executeRaw`:\n *\n * ```ts\n * sql`… set payload = payload || ${JSON.stringify(patch)}::jsonb` // merges\n * ```\n *\n * Without that the driver would JSON-encode the string and the column would\n * hold the document as a jsonb *string* — which `||` appends as an array\n * element rather than merging. `json-param.ts` has the measurements.\n */\nexport function sql(\n strings: TemplateStringsArray,\n ...values: unknown[]\n): SqlFragment {\n // A defensive check rather than a type error, because the interesting misuse\n // is `sql(userInput)` — a plain call with a string, which would otherwise\n // reach `strings.raw` as `undefined` and produce a fragment of `undefined`\n // text rather than an error. It is also the shape somebody reaches for when\n // they want the escape hatch and have not found `unsafeSql`.\n if (!Array.isArray(strings) || !(\"raw\" in (strings as object))) {\n throw new UnsupportedQueryError(\n \"sql\",\n \"DB\",\n \"sql\",\n `'sql' is a tagged template — write sql\\`select 1\\`, not sql(\"select 1\"). ` +\n `To put text that is not a value into a statement, use 'unsafeSql', ` +\n `and read what it says first.`,\n );\n }\n\n const parts: Fragment[] = [];\n\n for (let i = 0; i < strings.length; i++) {\n parts.push(text(strings[i]));\n if (i < values.length) parts.push(interpolate(values[i]));\n }\n\n return brand(concat(...parts));\n}\n\n/**\n * Fragments — or values — joined by a separator, the way `Array.join` reads.\n *\n * ```ts\n * join(filters, \" and \") // a and b and c\n * join([sql`\"a\" asc`, sql`\"b\" desc`]) // \"a\" asc, \"b\" desc\n * join(ids) // $1, $2, $3 — each bound\n * ```\n *\n * An **empty list produces `empty`**, not a separator and not a syntax error, so\n * `join` composes with a list that turned out to have nothing in it. That is the\n * case a caller forgets, and it is the one that would otherwise emit `where ` and\n * fail at the database rather than here.\n *\n * ## The separator is text, so it is not a free string\n *\n * It goes between the fragments *in the statement*, which makes it the one other\n * place a string could reach the SQL — and this module's whole claim is that\n * `unsafeSql` is **the** door. So a plain-string separator has to be glue and\n * nothing else: whitespace, commas, or a boolean connective. Anything more\n * expressive is legitimate and has to say so:\n *\n * ```ts\n * join(filters, \" and \") // fine\n * join(parts, unsafeSql(\") and (\")) // fine, and visibly a decision\n * join(ids, request.query.sep) // refused\n * ```\n *\n * A **blocklist would not do**, which is why this is an allowlist. The obvious\n * one — reject quotes, semicolons and comment markers — lets this through:\n *\n * join([1, 2], \") or 1=1 union select password from Users where 1=(1\")\n *\n * No quote, no `--`, still an injection. There is no sound way to say \"this\n * arbitrary text is safe glue\", so the rule is that glue is a small closed set\n * and everything else is a fragment somebody built on purpose.\n */\nexport function join(\n values: readonly unknown[],\n separator: string | SqlFragment = \", \",\n): SqlFragment {\n if (!Array.isArray(values)) {\n throw new InvalidArgumentError(\n \"join\",\n \"DB\",\n \"sql\",\n `Expected an array of fragments or values, got ${typeof values}.`,\n );\n }\n if (values.length === 0) return empty;\n\n const parts = values.map(interpolate);\n\n if (isFragment(separator)) {\n const woven: Fragment[] = [];\n for (let i = 0; i < parts.length; i++) {\n if (i > 0) woven.push(separator);\n woven.push(parts[i]);\n }\n return brand(concat(...woven));\n }\n\n assertGlue(separator);\n return brand(joinFragments(parts, separator));\n}\n\n/**\n * Whitespace and commas, or a boolean connective surrounded by whitespace.\n *\n * Deliberately small. Every separator a composed statement actually needs is in\n * here — `\", \"`, `\" and \"`, `\" or \"`, `\" \"` — and everything outside it is\n * expressive enough to change what the statement *does*, which is the property\n * that makes it a `unsafeSql` decision rather than a string argument.\n */\nconst GLUE = /^[\\s,]*$|^\\s*(?:and|or)\\s*$/i;\n\nfunction assertGlue(separator: unknown): void {\n if (typeof separator === \"string\" && GLUE.test(separator)) return;\n\n throw new InvalidArgumentError(\n \"join\",\n \"DB\",\n \"sql\",\n typeof separator === \"string\"\n ? `A separator is written into the SQL text, so it may only be glue: ` +\n `whitespace, commas, or 'and' / 'or'. Got ` +\n `${JSON.stringify(separator)}. If that is deliberate, say so with ` +\n `unsafeSql(...) — and never build one from anything that came from ` +\n `outside the program.`\n : `Expected a separator string or a fragment, got ${\n separator === null ? \"null\" : typeof separator\n }.`,\n );\n}\n\n/**\n * The fragment that contributes nothing.\n *\n * The point of it is that `where ${empty}` and `where ${filter}` are the same\n * expression — a conditional predicate is a value, not a branch around the\n * statement. Frozen, because it is shared by every caller and a fragment is read\n * as immutable everywhere else.\n */\nexport const empty: SqlFragment = brand(\n Object.freeze({ text: \"\", binders: Object.freeze([]) as [] }),\n);\n\n/**\n * **Text straight into the SQL, with no parameter around it.** The one door in\n * this ORM through which a value reaches the statement text.\n *\n * Everything else in the compiler exists to make this impossible — identifiers\n * come from the generated schema, values are bound — so reaching for it should\n * feel like reaching for it. **Never give it a value that came from a request, a\n * form, a URL, a header, a queue payload or a database row.** There is no\n * escaping here and there will not be: escaping that is \"usually right\" is worse\n * than none, because it survives review.\n *\n * ## Why it exists at all, since that is the fair question\n *\n * Plan quality can depend on *not* parameterising. A partial index declared as\n *\n * ```sql\n * create index … on \"Job\" (…) where \"name\" is distinct from 'reaper'\n * ```\n *\n * is only usable if the planner can prove the query's predicate matches the\n * index's. A bound parameter is opaque at plan time, so `where \"name\" is\n * distinct from $1` does not match — and the query falls back to a sequential\n * scan over the whole table. The constant has to be *in the text*:\n *\n * ```ts\n * const REAPER = unsafeSql(`'reaper'`) // a literal in this file, never input\n * await DB.query(sql`\n * select … from \"Job\" where \"name\" is distinct from ${REAPER} …\n * `)\n * ```\n *\n * A builder with no escape hatch cannot express that at any price, and the\n * workaround — hand-writing the whole statement — loses composition for every\n * other part of it.\n *\n * The same applies to the other things that cannot be parameters in SQL:\n * identifiers, a sort direction, a table name chosen from a fixed set in code.\n * All of them share the rule above — the value is written in the source file, or\n * chosen from a set written in the source file, never passed in.\n */\nexport function unsafeSql(literal: string): SqlFragment {\n if (typeof literal !== \"string\") {\n throw new InvalidArgumentError(\n \"unsafeSql\",\n \"DB\",\n \"sql\",\n `Expected a string literal, got ${\n Array.isArray(literal) ? \"an array\" : typeof literal\n }. 'unsafeSql' is a plain call, not a tagged template — a template would ` +\n `interpolate values into the SQL text, which is the one thing it must ` +\n `never do.`,\n );\n }\n return brand(text(literal));\n}\n\n/**\n * A fragment as the statement a driver can run: the dialect's placeholders in\n * the text, and the values in the order they appear.\n *\n * Separate from the executing, and exported, because it is the half that is a\n * pure function of `(fragment, dialect)` — so a test can assert what a\n * composition emits on both dialects without a database anywhere near it, which\n * is exactly how the rest of the compiler is tested.\n *\n * `render` also applies the parameter ceiling here, which matters more for a\n * hand-built fragment than for a compiled plan: `join(ids)` over a\n * request-derived list is one placeholder per element on SQLite, and 40 000 of\n * them is a driver error rather than a clear one.\n */\nexport function renderFragment(\n fragment: SqlFragment,\n dialect: SqlDialect,\n operation = \"query\",\n): { text: string; values: unknown[] } {\n if (!isFragment(fragment)) {\n throw new InvalidArgumentError(\n operation,\n \"DB\",\n operation,\n `Expected a fragment built with 'sql', got ${\n fragment === null ? \"null\" : typeof fragment\n }. A plain string is not accepted here on purpose — it would be the one ` +\n `path into the SQL text that nobody had to think about.`,\n );\n }\n\n // The one thing a raw parameter can be *told* about its type: a `::jsonb` the\n // caller wrote onto their own placeholder. Where there is one, the parameter\n // is retyped through `text` and its value serialised, because Bun otherwise\n // JSON-encodes a string bound to a `jsonb` parameter and stores the document\n // as a jsonb *string* where Prisma stored the object. See `json-param.ts` —\n // the mechanism, the measurements, and why a string is not serialised here\n // while `fieldParam` serialises one.\n //\n // The dialect is passed because this is not universal, and the reason is\n // narrower than it looks: `::` is Postgres-only syntax, but `cast(? as json)`\n // *parses and runs* on SQLite, where it means NUMERIC affinity — so retyping\n // it would rewrite a working statement into `cast(? as text)::json`, which\n // SQLite cannot parse. `typesParametersFromStatement` is false there.\n const json = retypeJsonParameters(fragment, dialect);\n\n const rendered = render(json.fragment, dialect, { model: \"DB\", operation });\n return {\n text: rendered.text,\n // `encodeUntyped` and not `encode`: there is no field here to ask, which is\n // the whole difference between a fragment's parameters and a compiled\n // plan's. It normalises the two JavaScript types whose SQL form the ORM has\n // already decided — a `Date` and a boolean — so a raw statement compares\n // against ORM-written rows on both dialects rather than only on Postgres.\n values: bindValues(rendered.binders)(undefined).map((value, index) =>\n json.jsonParameters.has(index)\n ? jsonTextParameter(value, operation)\n : value === null || value === undefined\n ? (value ?? null)\n : dialect.encodeUntyped(value),\n ),\n };\n}\n\n/**\n * One interpolated slot: a fragment splices, anything else binds.\n *\n * The binder ignores both its arguments. A compiled plan's binders read the\n * *call's* argument tree, because one plan serves many calls; a fragment is\n * built per call and closes over the value it was given, which is the whole\n * difference between the compiler's fragments and these.\n */\nfunction interpolate(value: unknown): Fragment {\n if (isFragment(value)) return value;\n return param(() => value);\n}\n"
8
8
  ],
9
9
  "mappings": ";6QAeA,FAAM,EAAS,IAAI,IAEZ,SAAS,CAAQ,CAAC,EAAc,EAAsB,CAC3D,EAAO,IAAI,EAAM,CAAK,EAGjB,SAAS,CAAG,CAAC,EAAuB,CACzC,OAAO,EAAO,IAAI,CAAI,EAGjB,SAAS,CAAgB,CAAC,EAAiB,CAChD,IAAM,EAAQ,EAAO,IAAI,CAAI,EAC7B,GAAI,IAAU,OACZ,MAAM,IAAI,EAAwB,EAAM,CAAC,GAAG,EAAO,KAAK,CAAC,CAAC,EAE5D,OAAO,EAGF,SAAS,CAAe,EAAa,CAC1C,MAAO,CAAC,GAAG,EAAO,KAAK,CAAC,EAGnB,SAAS,CAAa,EAAS,CACpC,EAAO,MAAM,ECoGf,IAAM,EAAgB,qDAehB,EAAgB,8BAQhB,EAAY,mBAGZ,EAA6B,IAAI,IAYhC,SAAS,CAAoB,CAClC,EACA,EAIA,CACA,GAAI,CAAC,EAAQ,6BACX,MAAO,CAAE,WAAU,eAAgB,CAAM,EAG3C,IAAM,EAAW,EAAc,CAAQ,EACjC,EAAiB,IAAI,IACvB,EAKJ,QAAS,EAAQ,EAAG,EAAQ,EAAS,OAAS,EAAG,IAAS,CACxD,IAAM,EAAQ,EAAS,EAAQ,GAEzB,EAAW,EAAc,KAAK,CAAK,EACzC,GAAI,EAAU,CACZ,IAAc,CAAC,GAAG,CAAQ,EAC1B,EA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