@lunora/studio 1.0.0-alpha.33 → 1.0.0-alpha.330

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 (472) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1581 -0
  4. package/dist/index.d.ts +974 -806
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
  31. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  32. package/dist/packem_chunks/architecture-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  34. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  35. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  36. package/dist/packem_chunks/containers-panel.mjs +1 -0
  37. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  38. package/dist/packem_chunks/evals-panel.mjs +1 -0
  39. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  40. package/dist/packem_chunks/flags-panel.mjs +1 -0
  41. package/dist/packem_chunks/issues-panel.mjs +1 -0
  42. package/dist/packem_chunks/kv-browser.mjs +1 -0
  43. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  44. package/dist/packem_chunks/migrations-route.mjs +1 -0
  45. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  46. package/dist/packem_chunks/payments-panel.mjs +1 -0
  47. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  48. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
  49. package/dist/packem_chunks/queues-panel.mjs +1 -0
  50. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  51. package/dist/packem_chunks/rls-panel.mjs +1 -0
  52. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  53. package/dist/packem_chunks/sparkline.mjs +1 -0
  54. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  55. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  56. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  57. package/dist/packem_chunks/traces-panel.mjs +1 -0
  58. package/dist/packem_chunks/users-panel.mjs +1 -0
  59. package/dist/packem_chunks/vector-browser.mjs +1 -0
  60. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  61. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  62. package/dist/packem_shared/ApiDocsPanel-6yZaaxch.mjs +2 -0
  63. package/dist/packem_shared/ApiReferencePanel-mwEK_vL7.mjs +1 -0
  64. package/dist/packem_shared/CommandPalette-CcTVGQvw.mjs +1 -0
  65. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  66. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  68. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  69. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  70. package/dist/packem_shared/DataBrowser-B6xr6S3s.mjs +4 -0
  71. package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
  72. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  73. package/dist/packem_shared/GlobalDataBrowser-DlBYI85g.mjs +1 -0
  74. package/dist/packem_shared/HomePanel-DBUgY2yE.mjs +1 -0
  75. package/dist/packem_shared/MigrationsPanel-_H327LDl.mjs +1 -0
  76. package/dist/packem_shared/OpenRpcReferencePanel-DJg4AbuZ.mjs +1 -0
  77. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  78. package/dist/packem_shared/ScheduledJobs-CscRWLW-.mjs +1 -0
  79. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  80. package/dist/packem_shared/Studio-s4EbmwaL.mjs +1 -0
  81. package/dist/packem_shared/StudioApp-D1e2uc7_.mjs +1 -0
  82. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  83. package/dist/packem_shared/advisor-view-kg9uZT7H.mjs +1 -0
  84. package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
  85. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  86. package/dist/packem_shared/app.d-D45VvUTx.d.mts +351 -0
  87. package/dist/packem_shared/app.d-D45VvUTx.d.ts +351 -0
  88. package/dist/packem_shared/auth-pager-DiDnXsfe.mjs +1 -0
  89. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  90. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  91. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  92. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  93. package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
  94. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  95. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  96. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  97. package/dist/packem_shared/data-grid-XIuWrWDy.mjs +1 -0
  98. package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
  99. package/dist/packem_shared/diagram-export-panel-DrYRni_b.mjs +2 -0
  100. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  101. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  102. package/dist/packem_shared/error-alert-Dr4RMEID.mjs +1 -0
  103. package/dist/packem_shared/grid-features-6mTvrzgT.mjs +6 -0
  104. package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
  105. package/dist/packem_shared/home-panel-CKbpgpz9.mjs +3 -0
  106. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  107. package/dist/packem_shared/internal-S7SDbbPa.mjs +2 -0
  108. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  109. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  110. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
  111. package/dist/packem_shared/log-line-DP0b3YT5.mjs +1 -0
  112. package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
  113. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  114. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  115. package/dist/packem_shared/recording-client-BbX9ql7w.mjs +1 -0
  116. package/dist/packem_shared/reference-view-DNdYDPow.mjs +13 -0
  117. package/dist/packem_shared/schema-diagram-DKBYRWsL.mjs +2 -0
  118. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  119. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  120. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  121. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  122. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  123. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  124. package/dist/packem_shared/sql-result-table-B7g48CHO.mjs +1 -0
  125. package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
  126. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  127. package/dist/packem_shared/studio-BTM7dITm.mjs +2 -0
  128. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  129. package/dist/packem_shared/table-list-sidebar-DcvrtBkE.mjs +1 -0
  130. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  131. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  132. package/dist/packem_shared/use-admin-query-B2jU5P5u.mjs +1 -0
  133. package/dist/packem_shared/use-admin-spec-CISwmdXM.mjs +1 -0
  134. package/dist/packem_shared/use-async-submit-CgvRHgaD.mjs +1 -0
  135. package/dist/packem_shared/use-auth-config-B9w5-1-p.mjs +1 -0
  136. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  137. package/dist/packem_shared/use-open-trace-CUyoDXjN.mjs +1 -0
  138. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  139. package/dist/packem_shared/use-sql-assistant-CK6G1ycr.mjs +1 -0
  140. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  141. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  142. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  143. package/dist/standalone/chunk-253UHWDX.js +1 -0
  144. package/dist/standalone/chunk-2EYOYWS2.js +1 -0
  145. package/dist/standalone/chunk-2G3B5PAO.js +1 -0
  146. package/dist/standalone/chunk-2I4NHEKA.js +1 -0
  147. package/dist/standalone/chunk-2IKDEUCX.js +1 -0
  148. package/dist/standalone/chunk-2PNG3QHQ.js +1 -0
  149. package/dist/standalone/chunk-2QXJTBVX.js +1 -0
  150. package/dist/standalone/chunk-2W67FQCF.js +1 -0
  151. package/dist/standalone/chunk-37WYCOQ2.js +1 -0
  152. package/dist/standalone/chunk-3ADTLIRI.js +1 -0
  153. package/dist/standalone/chunk-3CBQDJ4S.js +1 -0
  154. package/dist/standalone/chunk-3RSD3XAG.js +1 -0
  155. package/dist/standalone/chunk-3YXASVTP.js +1 -0
  156. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  157. package/dist/standalone/chunk-55UGUCQ6.js +1 -0
  158. package/dist/standalone/chunk-5B2RTXBS.js +1 -0
  159. package/dist/standalone/chunk-5LEVE36K.js +1 -0
  160. package/dist/standalone/chunk-5OMZCVRF.js +19 -0
  161. package/dist/standalone/chunk-5QR2SQIS.js +1 -0
  162. package/dist/standalone/chunk-6B7YJY6X.js +1 -0
  163. package/dist/standalone/chunk-6XIDYONR.js +1 -0
  164. package/dist/standalone/chunk-74WMPCOL.js +1 -0
  165. package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
  166. package/dist/standalone/chunk-7RKB5KS7.js +1 -0
  167. package/dist/standalone/chunk-7XYNQ3JS.js +1 -0
  168. package/dist/standalone/chunk-7Y3SY37W.js +1 -0
  169. package/dist/standalone/chunk-A4R7GZQS.js +4 -0
  170. package/dist/standalone/chunk-AFX6YYGP.js +1 -0
  171. package/dist/standalone/chunk-AJSSEAMP.js +1 -0
  172. package/dist/standalone/chunk-AQFI2GWT.js +1 -0
  173. package/dist/standalone/chunk-AUAECCXB.js +1 -0
  174. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-AUGKHAMQ.js} +1 -1
  175. package/dist/standalone/chunk-BOMPSVRC.js +1 -0
  176. package/dist/standalone/chunk-BPBEVNUM.js +3 -0
  177. package/dist/standalone/chunk-C5KBRXQG.js +1 -0
  178. package/dist/standalone/chunk-CCDX5RYT.js +1 -0
  179. package/dist/standalone/chunk-CGQMJYCW.js +1 -0
  180. package/dist/standalone/chunk-CVPVFONU.js +1 -0
  181. package/dist/standalone/chunk-CVXNHIQW.js +1 -0
  182. package/dist/standalone/chunk-CYWRJGWD.js +1 -0
  183. package/dist/standalone/chunk-D3HPOVEQ.js +1 -0
  184. package/dist/standalone/chunk-D6ZXOSCM.js +1 -0
  185. package/dist/standalone/chunk-D746I7ZX.js +1 -0
  186. package/dist/standalone/chunk-DQSV2OFA.js +1 -0
  187. package/dist/standalone/chunk-DS2DTZFS.js +14 -0
  188. package/dist/standalone/chunk-DSXEICMD.js +1 -0
  189. package/dist/standalone/chunk-DVX5J34S.js +59 -0
  190. package/dist/standalone/chunk-DXYCOA4Y.js +1 -0
  191. package/dist/standalone/chunk-E4PXACVL.js +3 -0
  192. package/dist/standalone/chunk-ECY2JC5F.js +1 -0
  193. package/dist/standalone/chunk-FBGCQYRO.js +8 -0
  194. package/dist/standalone/chunk-FCVKROK5.js +4 -0
  195. package/dist/standalone/chunk-FGVGIVB6.js +1 -0
  196. package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
  197. package/dist/standalone/chunk-FUYEZFBP.js +1 -0
  198. package/dist/standalone/chunk-G3NIGELJ.js +1 -0
  199. package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
  200. package/dist/standalone/chunk-GPNP4QSZ.js +1 -0
  201. package/dist/standalone/chunk-GV2QZP42.js +2 -0
  202. package/dist/standalone/chunk-GV6O3NPO.js +1 -0
  203. package/dist/standalone/chunk-GXYXVKOM.js +1 -0
  204. package/dist/standalone/chunk-HCTJKP5J.js +1 -0
  205. package/dist/standalone/chunk-HHT7X6VO.js +1 -0
  206. package/dist/standalone/chunk-HKQSHNFB.js +1 -0
  207. package/dist/standalone/chunk-HYKN42SO.js +1 -0
  208. package/dist/standalone/chunk-I23ULEUU.js +1 -0
  209. package/dist/standalone/chunk-I26MS5PJ.js +1 -0
  210. package/dist/standalone/chunk-I5RZUA4J.js +1 -0
  211. package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
  212. package/dist/standalone/chunk-J5NS6XO4.js +1 -0
  213. package/dist/standalone/chunk-JQXA2OYK.js +1 -0
  214. package/dist/standalone/chunk-K7OJ77CA.js +1 -0
  215. package/dist/standalone/chunk-KRVD6WPH.js +1 -0
  216. package/dist/standalone/chunk-KXYSX2SV.js +1 -0
  217. package/dist/standalone/chunk-LSEISHAB.js +1 -0
  218. package/dist/standalone/chunk-LXBSXLLK.js +1 -0
  219. package/dist/standalone/chunk-MCHTZFX6.js +1 -0
  220. package/dist/standalone/chunk-MRFJSQBZ.js +1 -0
  221. package/dist/standalone/chunk-MVWZMWPD.js +1 -0
  222. package/dist/standalone/chunk-NA7GP6EE.js +1 -0
  223. package/dist/standalone/chunk-NCPW7WHO.js +1 -0
  224. package/dist/standalone/chunk-NGVP66OH.js +1 -0
  225. package/dist/standalone/chunk-NQZALRU3.js +1 -0
  226. package/dist/standalone/chunk-NRP22GKC.js +1 -0
  227. package/dist/standalone/chunk-NXQW5E6W.js +1 -0
  228. package/dist/standalone/chunk-NXVOCK3P.js +5 -0
  229. package/dist/standalone/chunk-OMN44W6V.js +1 -0
  230. package/dist/standalone/chunk-OPM7ESDV.js +1 -0
  231. package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
  232. package/dist/standalone/chunk-OU56VN3R.js +1 -0
  233. package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
  234. package/dist/standalone/chunk-P6UD4I65.js +1 -0
  235. package/dist/standalone/chunk-PAAYRW3Q.js +9 -0
  236. package/dist/standalone/chunk-PDF22AMX.js +1 -0
  237. package/dist/standalone/chunk-PH4VNMUO.js +1 -0
  238. package/dist/standalone/chunk-PLVFYL6L.js +1 -0
  239. package/dist/standalone/chunk-Q6ED4KUL.js +1 -0
  240. package/dist/standalone/chunk-Q6IT6ZD7.js +1 -0
  241. package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-QAQDMS6R.js} +1 -1
  242. package/dist/standalone/chunk-QBTZMN5E.js +1 -0
  243. package/dist/standalone/chunk-QJACMRR5.js +1 -0
  244. package/dist/standalone/chunk-QJLHH3ET.js +1 -0
  245. package/dist/standalone/chunk-R6U22RSY.js +1 -0
  246. package/dist/standalone/chunk-RGMVGZV4.js +1 -0
  247. package/dist/standalone/chunk-RWVIV3U7.js +1 -0
  248. package/dist/standalone/chunk-S4Z7K55A.js +1 -0
  249. package/dist/standalone/chunk-S63L3TCR.js +1 -0
  250. package/dist/standalone/chunk-SA2OGF3F.js +1 -0
  251. package/dist/standalone/chunk-SJQERRSZ.js +1 -0
  252. package/dist/standalone/chunk-SZIEPXZM.js +1 -0
  253. package/dist/standalone/chunk-TM5C7YPO.js +1 -0
  254. package/dist/standalone/chunk-TSNDFT5D.js +1 -0
  255. package/dist/standalone/chunk-UC7MNI2F.js +1 -0
  256. package/dist/standalone/chunk-ULW7I6FO.js +1 -0
  257. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  258. package/dist/standalone/chunk-V3RAWH63.js +1 -0
  259. package/dist/standalone/chunk-VASJTDMU.js +1 -0
  260. package/dist/standalone/chunk-VCFEO3RI.js +1 -0
  261. package/dist/standalone/chunk-VESGIGMQ.js +1 -0
  262. package/dist/standalone/chunk-WJRYEML4.js +1 -0
  263. package/dist/standalone/chunk-WMPXMPVF.js +1 -0
  264. package/dist/standalone/chunk-WS7WNXF3.js +15 -0
  265. package/dist/standalone/chunk-X2YHVCMH.js +1 -0
  266. package/dist/standalone/chunk-X472RKFD.js +6 -0
  267. package/dist/standalone/chunk-XGCIDUJF.js +1 -0
  268. package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
  269. package/dist/standalone/chunk-Y57U7WES.js +1 -0
  270. package/dist/standalone/chunk-YGNPACVK.js +1 -0
  271. package/dist/standalone/chunk-YPY2NU35.js +3 -0
  272. package/dist/standalone/chunk-YQQTRX55.js +1 -0
  273. package/dist/standalone/chunk-ZBRLJQ46.js +15 -0
  274. package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
  275. package/dist/standalone/chunk-ZQ4C2DMJ.js +1 -0
  276. package/dist/standalone/studio.js +9 -214
  277. package/dist/styles.css +2 -2
  278. package/package.json +26 -22
  279. package/dist/index.js +0 -41
  280. package/dist/mount.js +0 -27
  281. package/dist/packem_chunks/ApiTab.js +0 -251
  282. package/dist/packem_chunks/AuditPanel.js +0 -200
  283. package/dist/packem_chunks/ExportImportPanel.js +0 -198
  284. package/dist/packem_chunks/FileBrowser.js +0 -2932
  285. package/dist/packem_chunks/FunctionRunner.js +0 -343
  286. package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
  287. package/dist/packem_chunks/HealthPanel.js +0 -648
  288. package/dist/packem_chunks/InsightsPanel.js +0 -462
  289. package/dist/packem_chunks/LogsPanel.js +0 -827
  290. package/dist/packem_chunks/MailPanel.js +0 -441
  291. package/dist/packem_chunks/MetricsPanel.js +0 -1344
  292. package/dist/packem_chunks/MigrationsPanel.js +0 -239
  293. package/dist/packem_chunks/PitrPanel.js +0 -252
  294. package/dist/packem_chunks/SchemaViewer.js +0 -2513
  295. package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
  296. package/dist/packem_chunks/SettingsPanel.js +0 -391
  297. package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
  298. package/dist/packem_chunks/TableEditor.js +0 -313
  299. package/dist/packem_chunks/analytics-panel.js +0 -261
  300. package/dist/packem_chunks/auth-config-panel.js +0 -179
  301. package/dist/packem_chunks/auth-sessions-panel.js +0 -175
  302. package/dist/packem_chunks/containers-panel.js +0 -247
  303. package/dist/packem_chunks/dashboards-panel.js +0 -780
  304. package/dist/packem_chunks/fanout-panel.js +0 -482
  305. package/dist/packem_chunks/flags-panel.js +0 -176
  306. package/dist/packem_chunks/kv-browser.js +0 -1896
  307. package/dist/packem_chunks/log-drains-panel.js +0 -273
  308. package/dist/packem_chunks/organizations-panel.js +0 -670
  309. package/dist/packem_chunks/payments-panel.js +0 -186
  310. package/dist/packem_chunks/permissions-panel.js +0 -805
  311. package/dist/packem_chunks/queues-panel.js +0 -148
  312. package/dist/packem_chunks/rls-panel.js +0 -315
  313. package/dist/packem_chunks/schedule-panel.js +0 -831
  314. package/dist/packem_chunks/sparkline.js +0 -79
  315. package/dist/packem_chunks/storage-rules-panel.js +0 -140
  316. package/dist/packem_chunks/subscriptions-panel.js +0 -238
  317. package/dist/packem_chunks/users-panel.js +0 -1265
  318. package/dist/packem_chunks/vector-browser.js +0 -281
  319. package/dist/packem_chunks/workflows-panel.js +0 -562
  320. package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
  321. package/dist/packem_shared/ApiDocsPanel-Cu6mD4u7.js +0 -842
  322. package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
  323. package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
  324. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  325. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  326. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  327. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  328. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  329. package/dist/packem_shared/DataBrowser-DSNK1tPg.js +0 -4493
  330. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  331. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  332. package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
  333. package/dist/packem_shared/HomePanel-DQk3P8xX.js +0 -14
  334. package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
  335. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  336. package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
  337. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  338. package/dist/packem_shared/Studio-CFTYGEUt.js +0 -16
  339. package/dist/packem_shared/StudioApp-Cy9vUwVl.js +0 -657
  340. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  341. package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
  342. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  343. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  344. package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
  345. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  346. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  347. package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
  348. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  349. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  350. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  351. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  352. package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
  353. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  354. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  355. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  356. package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
  357. package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
  358. package/dist/packem_shared/home-panel-Bo-Mgrkn.js +0 -1639
  359. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  360. package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
  361. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  362. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  363. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  364. package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
  365. package/dist/packem_shared/select-UkNYCT3s.js +0 -273
  366. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  367. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  368. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  369. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  370. package/dist/packem_shared/studio-Dg2e-dsR.js +0 -4014
  371. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  372. package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
  373. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  374. package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
  375. package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
  376. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  377. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  378. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  379. package/dist/standalone/chunk-25VHPD2I.js +0 -1
  380. package/dist/standalone/chunk-2GGMGPEP.js +0 -1
  381. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  382. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  383. package/dist/standalone/chunk-3CJW6NWG.js +0 -4
  384. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  385. package/dist/standalone/chunk-4H2OJBXO.js +0 -1
  386. package/dist/standalone/chunk-4LDOOKES.js +0 -1
  387. package/dist/standalone/chunk-4MLAVZP4.js +0 -1
  388. package/dist/standalone/chunk-4QHKBC77.js +0 -1
  389. package/dist/standalone/chunk-55YA7ZZI.js +0 -76
  390. package/dist/standalone/chunk-5OH3VPZF.js +0 -1
  391. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  392. package/dist/standalone/chunk-5PQMXK24.js +0 -1
  393. package/dist/standalone/chunk-66DNF4AJ.js +0 -1
  394. package/dist/standalone/chunk-6GFEVKJP.js +0 -1
  395. package/dist/standalone/chunk-764T6X6X.js +0 -1
  396. package/dist/standalone/chunk-7M3F6U4L.js +0 -1
  397. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  398. package/dist/standalone/chunk-7VF3IAAW.js +0 -2
  399. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  400. package/dist/standalone/chunk-AJIUI7DD.js +0 -1
  401. package/dist/standalone/chunk-AQGOX5DK.js +0 -1
  402. package/dist/standalone/chunk-BACPICH6.js +0 -1
  403. package/dist/standalone/chunk-BET2625I.js +0 -1
  404. package/dist/standalone/chunk-BQUQS7QN.js +0 -1
  405. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  406. package/dist/standalone/chunk-DCECRP45.js +0 -1
  407. package/dist/standalone/chunk-DFP2DADO.js +0 -1
  408. package/dist/standalone/chunk-DORBUITF.js +0 -1
  409. package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
  410. package/dist/standalone/chunk-DWDILV2E.js +0 -1
  411. package/dist/standalone/chunk-E6WUCLSI.js +0 -1
  412. package/dist/standalone/chunk-E7WLF6IU.js +0 -1
  413. package/dist/standalone/chunk-EVPLBWUT.js +0 -8
  414. package/dist/standalone/chunk-FCSPAJW4.js +0 -1
  415. package/dist/standalone/chunk-FKO3HO6I.js +0 -4
  416. package/dist/standalone/chunk-G2ICR3DL.js +0 -1
  417. package/dist/standalone/chunk-GJ6PGSES.js +0 -13
  418. package/dist/standalone/chunk-GMSGZDDH.js +0 -13
  419. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  420. package/dist/standalone/chunk-GVRM4U6W.js +0 -2
  421. package/dist/standalone/chunk-GZDWDDXN.js +0 -1
  422. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  423. package/dist/standalone/chunk-ISJAJWYI.js +0 -1
  424. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  425. package/dist/standalone/chunk-JIDZFLTB.js +0 -4
  426. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  427. package/dist/standalone/chunk-K3GNLVYK.js +0 -1
  428. package/dist/standalone/chunk-K4ZDRTQM.js +0 -1
  429. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  430. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  431. package/dist/standalone/chunk-LI43EKM6.js +0 -1
  432. package/dist/standalone/chunk-MFPTVCJ6.js +0 -1
  433. package/dist/standalone/chunk-MPYFGAOW.js +0 -1
  434. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  435. package/dist/standalone/chunk-O77VNUFD.js +0 -1
  436. package/dist/standalone/chunk-PA3LN4XJ.js +0 -1
  437. package/dist/standalone/chunk-PN5NCZDX.js +0 -1
  438. package/dist/standalone/chunk-PVZI3CXP.js +0 -19
  439. package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
  440. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  441. package/dist/standalone/chunk-QBAT52GB.js +0 -1
  442. package/dist/standalone/chunk-QHIIRFG7.js +0 -1
  443. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  444. package/dist/standalone/chunk-RSEEHNFI.js +0 -1
  445. package/dist/standalone/chunk-SEU5V7I6.js +0 -1
  446. package/dist/standalone/chunk-SGDQIWAR.js +0 -4
  447. package/dist/standalone/chunk-SVR644RF.js +0 -1
  448. package/dist/standalone/chunk-SYEIXTEU.js +0 -1
  449. package/dist/standalone/chunk-T5HRXUSY.js +0 -1
  450. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  451. package/dist/standalone/chunk-TBMYIZIO.js +0 -1
  452. package/dist/standalone/chunk-TDL7NEWA.js +0 -1
  453. package/dist/standalone/chunk-TM7CMA7X.js +0 -1
  454. package/dist/standalone/chunk-TQ36RWOP.js +0 -1
  455. package/dist/standalone/chunk-U4OAQPBT.js +0 -1
  456. package/dist/standalone/chunk-UDSVXA42.js +0 -1
  457. package/dist/standalone/chunk-UII66UVF.js +0 -1
  458. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  459. package/dist/standalone/chunk-VEZO7G5Q.js +0 -3
  460. package/dist/standalone/chunk-VLXV72QE.js +0 -1
  461. package/dist/standalone/chunk-VSHUSN6T.js +0 -1
  462. package/dist/standalone/chunk-VYMCCC6O.js +0 -1
  463. package/dist/standalone/chunk-WXPWVBIY.js +0 -1
  464. package/dist/standalone/chunk-X72PYOEW.js +0 -1
  465. package/dist/standalone/chunk-X7MMBSNW.js +0 -1
  466. package/dist/standalone/chunk-XIGIWZLO.js +0 -4
  467. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  468. package/dist/standalone/chunk-XUGSA2NG.js +0 -1
  469. package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
  470. package/dist/standalone/chunk-YM6BBZDN.js +0 -1
  471. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  472. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
@@ -1,2141 +0,0 @@
1
- import { c } from 'react/compiler-runtime';
2
- import { useState, useEffect, createContext, use } from 'react';
3
- import { e as errorMessage, g as copyToClipboard, f as fireAndForget, c as callOptions, a as adminRef } from './internal-DTsYVn-g.js';
4
- import { SentIcon, Copy01Icon, Search01Icon } from '@hugeicons/core-free-icons';
5
- import { HugeiconsIcon } from '@hugeicons/react';
6
- import { I as Input } from './input-XH4r1Pt1.js';
7
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
8
- import { B as Button } from './button-BhsN2uZH.js';
9
- import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
10
- import { B as Badge$1 } from './badge-B2PKA1-5.js';
11
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
12
- import { L as Label } from './label-D8ykjn5J.js';
13
- import { T as Textarea } from './textarea-D3gaCU_-.js';
14
- import { LunoraError } from '@lunora/errors';
15
- import { useLunora } from '@lunora/react';
16
- import { c as cn } from './utils-B05Dmz_H.js';
17
-
18
- const useAdminSpec = function(inlineSpec, fetcher, classify) {
19
- const $ = c(10);
20
- let t0;
21
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
22
- t0 = {
23
- kind: "loading"
24
- };
25
- $[0] = t0;
26
- } else {
27
- t0 = $[0];
28
- }
29
- const [fetched, setFetched] = useState(t0);
30
- let t1;
31
- let t2;
32
- if ($[1] !== classify || $[2] !== fetcher || $[3] !== inlineSpec) {
33
- t1 = () => {
34
- if (inlineSpec !== void 0) {
35
- return;
36
- }
37
- let cancelled = false;
38
- fetcher().then((spec) => {
39
- if (!cancelled) {
40
- setFetched(classify(spec));
41
- }
42
- return spec;
43
- }).catch((error) => {
44
- if (!cancelled) {
45
- setFetched({
46
- kind: "error",
47
- message: errorMessage(error)
48
- });
49
- }
50
- });
51
- return () => {
52
- cancelled = true;
53
- };
54
- };
55
- t2 = [classify, fetcher, inlineSpec];
56
- $[1] = classify;
57
- $[2] = fetcher;
58
- $[3] = inlineSpec;
59
- $[4] = t1;
60
- $[5] = t2;
61
- } else {
62
- t1 = $[4];
63
- t2 = $[5];
64
- }
65
- useEffect(t1, t2);
66
- let t3;
67
- if ($[6] !== classify || $[7] !== fetched || $[8] !== inlineSpec) {
68
- t3 = inlineSpec === void 0 ? fetched : classify(inlineSpec);
69
- $[6] = classify;
70
- $[7] = fetched;
71
- $[8] = inlineSpec;
72
- $[9] = t3;
73
- } else {
74
- t3 = $[9];
75
- }
76
- return t3;
77
- };
78
-
79
- const scalarOf = (value) => {
80
- if (typeof value === "number") {
81
- return "number";
82
- }
83
- if (typeof value === "boolean") {
84
- return "boolean";
85
- }
86
- return "string";
87
- };
88
- const enumValues = (schema) => {
89
- if (schema.enum !== void 0 && schema.enum.length > 0) {
90
- return schema.enum;
91
- }
92
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0 && schema.anyOf.every((member) => member.const !== void 0)) {
93
- return schema.anyOf.map((member) => member.const);
94
- }
95
- return void 0;
96
- };
97
- const typeLabel = (schema) => {
98
- if (schema === void 0) {
99
- return "any";
100
- }
101
- if (schema.const !== void 0) {
102
- return JSON.stringify(schema.const);
103
- }
104
- if (schema.enum !== void 0 && schema.enum.length > 0) {
105
- return schema.enum.map((value) => JSON.stringify(value)).join(" | ");
106
- }
107
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0) {
108
- return schema.anyOf.map((member) => typeLabel(member)).join(" | ");
109
- }
110
- if (schema.type === "array") {
111
- return `array<${typeLabel(schema.items)}>`;
112
- }
113
- return schema.type ?? "any";
114
- };
115
- const fieldTypeLabel = (schema) => {
116
- const values = enumValues(schema);
117
- if (values !== void 0) {
118
- return schema.type ?? scalarOf(values[0]);
119
- }
120
- return typeLabel(schema);
121
- };
122
- const valueInText = (schema) => {
123
- const values = enumValues(schema);
124
- return values === void 0 ? void 0 : values.map((value) => JSON.stringify(value)).join(" | ");
125
- };
126
- const rangeText = (schema) => {
127
- const parts = [];
128
- if (schema.minimum !== void 0) {
129
- parts.push(`${String(schema.minimum)} ≤`);
130
- } else if (schema.exclusiveMinimum !== void 0) {
131
- parts.push(`${String(schema.exclusiveMinimum)} <`);
132
- }
133
- const hasLower = parts.length > 0;
134
- parts.push("value");
135
- if (schema.maximum !== void 0) {
136
- parts.push(`≤ ${String(schema.maximum)}`);
137
- } else if (schema.exclusiveMaximum !== void 0) {
138
- parts.push(`< ${String(schema.exclusiveMaximum)}`);
139
- }
140
- const hasUpper = parts.length > (hasLower ? 2 : 1);
141
- return hasLower || hasUpper ? parts.join(" ") : void 0;
142
- };
143
- const childObject = (schema) => {
144
- if (schema.type === "object" && schema.properties !== void 0) {
145
- return schema;
146
- }
147
- if (schema.type === "array" && schema.items?.type === "object" && schema.items.properties !== void 0) {
148
- return schema.items;
149
- }
150
- return void 0;
151
- };
152
- const exampleForSchema = (schema) => {
153
- if (schema === void 0) {
154
- return null;
155
- }
156
- if (schema.const !== void 0) {
157
- return schema.const;
158
- }
159
- if (schema.enum !== void 0 && schema.enum.length > 0) {
160
- return schema.enum[0];
161
- }
162
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0) {
163
- return exampleForSchema(schema.anyOf[0]);
164
- }
165
- switch (schema.type) {
166
- case "array": {
167
- return [];
168
- }
169
- case "boolean": {
170
- return false;
171
- }
172
- case "number": {
173
- return 0;
174
- }
175
- case "object": {
176
- const out = {};
177
- for (const [key, child] of Object.entries(schema.properties ?? {})) {
178
- out[key] = exampleForSchema(child);
179
- }
180
- return out;
181
- }
182
- case "string": {
183
- return "";
184
- }
185
- default: {
186
- return null;
187
- }
188
- }
189
- };
190
- const Badge = (t0) => {
191
- const $ = c(7);
192
- const {
193
- label,
194
- value
195
- } = t0;
196
- let t1;
197
- if ($[0] !== label) {
198
- t1 = /* @__PURE__ */ jsxDEV("span", {
199
- className: "text-muted-foreground",
200
- children: label
201
- }, void 0, false);
202
- $[0] = label;
203
- $[1] = t1;
204
- } else {
205
- t1 = $[1];
206
- }
207
- let t2;
208
- if ($[2] !== value) {
209
- t2 = /* @__PURE__ */ jsxDEV("span", {
210
- className: "text-foreground",
211
- children: value
212
- }, void 0, false);
213
- $[2] = value;
214
- $[3] = t2;
215
- } else {
216
- t2 = $[3];
217
- }
218
- let t3;
219
- if ($[4] !== t1 || $[5] !== t2) {
220
- t3 = /* @__PURE__ */ jsxDEV("span", {
221
- className: "inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",
222
- children: [t1, t2]
223
- }, void 0, true);
224
- $[4] = t1;
225
- $[5] = t2;
226
- $[6] = t3;
227
- } else {
228
- t3 = $[6];
229
- }
230
- return t3;
231
- };
232
- const FieldRow = (t0) => {
233
- const $ = c(40);
234
- const {
235
- name,
236
- required,
237
- schema
238
- } = t0;
239
- const t = useT();
240
- let t1;
241
- if ($[0] !== schema) {
242
- t1 = rangeText(schema);
243
- $[0] = schema;
244
- $[1] = t1;
245
- } else {
246
- t1 = $[1];
247
- }
248
- const range = t1;
249
- let t2;
250
- if ($[2] !== schema) {
251
- t2 = valueInText(schema);
252
- $[2] = schema;
253
- $[3] = t2;
254
- } else {
255
- t2 = $[3];
256
- }
257
- const values = t2;
258
- const relation = schema["x-lunora-table"];
259
- const hasBadges = schema.format !== void 0 || range !== void 0 || values !== void 0 || relation !== void 0;
260
- let t3;
261
- if ($[4] !== schema) {
262
- t3 = childObject(schema);
263
- $[4] = schema;
264
- $[5] = t3;
265
- } else {
266
- t3 = $[5];
267
- }
268
- const nested = t3;
269
- const t4 = required ? "*" : "?";
270
- let t5;
271
- if ($[6] !== t4) {
272
- t5 = /* @__PURE__ */ jsxDEV("span", {
273
- className: "text-muted-foreground",
274
- children: t4
275
- }, void 0, false);
276
- $[6] = t4;
277
- $[7] = t5;
278
- } else {
279
- t5 = $[7];
280
- }
281
- let t6;
282
- if ($[8] !== name || $[9] !== t5) {
283
- t6 = /* @__PURE__ */ jsxDEV("span", {
284
- className: "font-mono text-foreground",
285
- children: [name, t5]
286
- }, void 0, true);
287
- $[8] = name;
288
- $[9] = t5;
289
- $[10] = t6;
290
- } else {
291
- t6 = $[10];
292
- }
293
- let t7;
294
- if ($[11] !== schema) {
295
- t7 = fieldTypeLabel(schema);
296
- $[11] = schema;
297
- $[12] = t7;
298
- } else {
299
- t7 = $[12];
300
- }
301
- let t8;
302
- if ($[13] !== t7) {
303
- t8 = /* @__PURE__ */ jsxDEV("span", {
304
- className: "font-mono text-muted-foreground",
305
- children: t7
306
- }, void 0, false);
307
- $[13] = t7;
308
- $[14] = t8;
309
- } else {
310
- t8 = $[14];
311
- }
312
- let t9;
313
- if ($[15] !== t6 || $[16] !== t8) {
314
- t9 = /* @__PURE__ */ jsxDEV("div", {
315
- className: "flex items-baseline gap-2",
316
- children: [t6, t8]
317
- }, void 0, true);
318
- $[15] = t6;
319
- $[16] = t8;
320
- $[17] = t9;
321
- } else {
322
- t9 = $[17];
323
- }
324
- let t10;
325
- if ($[18] !== schema.description) {
326
- t10 = schema.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
327
- className: "max-w-prose text-muted-foreground",
328
- children: schema.description
329
- }, void 0, false);
330
- $[18] = schema.description;
331
- $[19] = t10;
332
- } else {
333
- t10 = $[19];
334
- }
335
- let t11;
336
- if ($[20] !== hasBadges || $[21] !== range || $[22] !== relation || $[23] !== schema.format || $[24] !== t || $[25] !== values) {
337
- t11 = hasBadges && /* @__PURE__ */ jsxDEV("div", {
338
- className: "flex flex-wrap gap-1",
339
- children: [schema.format !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
340
- label: t("Format"),
341
- value: schema.format
342
- }, void 0, false), range !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
343
- label: t("Range"),
344
- value: range
345
- }, void 0, false), values !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
346
- label: t("Value in"),
347
- value: values
348
- }, void 0, false), relation !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
349
- label: t("relation"),
350
- value: relation
351
- }, void 0, false)]
352
- }, void 0, true);
353
- $[20] = hasBadges;
354
- $[21] = range;
355
- $[22] = relation;
356
- $[23] = schema.format;
357
- $[24] = t;
358
- $[25] = values;
359
- $[26] = t11;
360
- } else {
361
- t11 = $[26];
362
- }
363
- let t12;
364
- if ($[27] !== t10 || $[28] !== t11 || $[29] !== t9) {
365
- t12 = /* @__PURE__ */ jsxDEV("div", {
366
- className: "flex flex-col gap-1 py-2",
367
- children: [t9, t10, t11]
368
- }, void 0, true);
369
- $[27] = t10;
370
- $[28] = t11;
371
- $[29] = t9;
372
- $[30] = t12;
373
- } else {
374
- t12 = $[30];
375
- }
376
- const header = t12;
377
- if (nested === void 0) {
378
- let t132;
379
- if ($[31] !== header) {
380
- t132 = /* @__PURE__ */ jsxDEV("div", {
381
- className: "border-b border-border/50 last:border-b-0",
382
- children: header
383
- }, void 0, false);
384
- $[31] = header;
385
- $[32] = t132;
386
- } else {
387
- t132 = $[32];
388
- }
389
- return t132;
390
- }
391
- let t13;
392
- if ($[33] !== header) {
393
- t13 = /* @__PURE__ */ jsxDEV("summary", {
394
- className: "cursor-pointer marker:text-muted-foreground",
395
- children: header
396
- }, void 0, false);
397
- $[33] = header;
398
- $[34] = t13;
399
- } else {
400
- t13 = $[34];
401
- }
402
- let t14;
403
- if ($[35] !== nested) {
404
- t14 = /* @__PURE__ */ jsxDEV("div", {
405
- className: "mb-2 ml-2 border-l border-border pl-3",
406
- children: /* @__PURE__ */ jsxDEV(SchemaFields, {
407
- schema: nested
408
- }, void 0, false)
409
- }, void 0, false);
410
- $[35] = nested;
411
- $[36] = t14;
412
- } else {
413
- t14 = $[36];
414
- }
415
- let t15;
416
- if ($[37] !== t13 || $[38] !== t14) {
417
- t15 = /* @__PURE__ */ jsxDEV("details", {
418
- className: "border-b border-border/50 last:border-b-0",
419
- children: [t13, t14]
420
- }, void 0, true);
421
- $[37] = t13;
422
- $[38] = t14;
423
- $[39] = t15;
424
- } else {
425
- t15 = $[39];
426
- }
427
- return t15;
428
- };
429
- const SchemaFields = (t0) => {
430
- const $ = c(7);
431
- const {
432
- schema
433
- } = t0;
434
- let t1;
435
- if ($[0] !== schema.required) {
436
- t1 = new Set(schema.required);
437
- $[0] = schema.required;
438
- $[1] = t1;
439
- } else {
440
- t1 = $[1];
441
- }
442
- const required = t1;
443
- let t2;
444
- if ($[2] !== schema.properties) {
445
- t2 = Object.entries(schema.properties ?? {});
446
- $[2] = schema.properties;
447
- $[3] = t2;
448
- } else {
449
- t2 = $[3];
450
- }
451
- const rows = t2;
452
- let t3;
453
- if ($[4] !== required || $[5] !== rows) {
454
- t3 = /* @__PURE__ */ jsxDEV("div", {
455
- className: "flex flex-col",
456
- children: rows.map((t4) => {
457
- const [name, child] = t4;
458
- return /* @__PURE__ */ jsxDEV(FieldRow, {
459
- name,
460
- required: required.has(name),
461
- schema: child
462
- }, name, false);
463
- })
464
- }, void 0, false);
465
- $[4] = required;
466
- $[5] = rows;
467
- $[6] = t3;
468
- } else {
469
- t3 = $[6];
470
- }
471
- return t3;
472
- };
473
- const SchemaTable = (t0) => {
474
- const $ = c(10);
475
- const {
476
- schema,
477
- testId
478
- } = t0;
479
- if (schema?.type !== "object" || Object.keys(schema.properties ?? {}).length === 0) {
480
- let t12;
481
- if ($[0] !== schema) {
482
- t12 = typeLabel(schema);
483
- $[0] = schema;
484
- $[1] = t12;
485
- } else {
486
- t12 = $[1];
487
- }
488
- let t22;
489
- if ($[2] !== t12 || $[3] !== testId) {
490
- t22 = /* @__PURE__ */ jsxDEV("p", {
491
- className: "font-mono text-xs text-muted-foreground",
492
- "data-testid": testId,
493
- children: t12
494
- }, void 0, false);
495
- $[2] = t12;
496
- $[3] = testId;
497
- $[4] = t22;
498
- } else {
499
- t22 = $[4];
500
- }
501
- return t22;
502
- }
503
- let t1;
504
- if ($[5] !== schema) {
505
- t1 = /* @__PURE__ */ jsxDEV(SchemaFields, {
506
- schema
507
- }, void 0, false);
508
- $[5] = schema;
509
- $[6] = t1;
510
- } else {
511
- t1 = $[6];
512
- }
513
- let t2;
514
- if ($[7] !== t1 || $[8] !== testId) {
515
- t2 = /* @__PURE__ */ jsxDEV("div", {
516
- className: "text-xs",
517
- "data-testid": testId,
518
- children: t1
519
- }, void 0, false);
520
- $[7] = t1;
521
- $[8] = testId;
522
- $[9] = t2;
523
- } else {
524
- t2 = $[9];
525
- }
526
- return t2;
527
- };
528
-
529
- const SAMPLE_ORDER = ["curl", "javascript", "lunora"];
530
- const SAMPLE_LABEL = {
531
- lunora: "Lunora",
532
- curl: "cURL",
533
- javascript: "JavaScript"
534
- };
535
- const apiReferenceOf = (functionPath) => `api.${functionPath.replaceAll(/[/:]/g, ".")}`;
536
- const requestBody = (operation) => {
537
- const args = exampleForSchema(operation.argsSchema) ?? {};
538
- return operation.functionPath === void 0 ? args : {
539
- args,
540
- functionPath: operation.functionPath
541
- };
542
- };
543
- const sampleSource = (sample, operation, server) => {
544
- const url = `${server}${operation.httpPath}`;
545
- const body = JSON.stringify(requestBody(operation), void 0, 2);
546
- const args = JSON.stringify(exampleForSchema(operation.argsSchema) ?? {}, void 0, 2);
547
- switch (sample) {
548
- case "curl": {
549
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
550
- const lines = [`curl -X ${operation.method} ${JSON.stringify(url)}`];
551
- if (hasBody) {
552
- lines.push(` -H "Content-Type: application/json"`, ` -d '${body}'`);
553
- }
554
- return lines.join(" \\\n");
555
- }
556
- case "lunora": {
557
- if (operation.functionPath === void 0) {
558
- return `await fetch(${JSON.stringify(operation.httpPath)}, { method: ${JSON.stringify(operation.method)} });`;
559
- }
560
- const method = operation.kind ?? "query";
561
- return `import { useLunora } from "@lunora/react";
562
- import { api } from "./_generated/api";
563
-
564
- const client = useLunora();
565
- await client.${method}(${apiReferenceOf(operation.functionPath)}, ${args});`;
566
- }
567
- default: {
568
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
569
- const init = hasBody ? `{
570
- method: ${JSON.stringify(operation.method)},
571
- headers: { "Content-Type": "application/json" },
572
- body: JSON.stringify(${body}),
573
- }` : `{ method: ${JSON.stringify(operation.method)} }`;
574
- return `const response = await fetch(${JSON.stringify(url)}, ${init});
575
- const data = await response.json();`;
576
- }
577
- }
578
- };
579
- const CodeSamples = (t0) => {
580
- const $ = c(24);
581
- const {
582
- operation,
583
- server
584
- } = t0;
585
- const t = useT();
586
- const [sample, setSample] = useState("curl");
587
- let t1;
588
- if ($[0] !== operation || $[1] !== sample || $[2] !== server) {
589
- t1 = sampleSource(sample, operation, server);
590
- $[0] = operation;
591
- $[1] = sample;
592
- $[2] = server;
593
- $[3] = t1;
594
- } else {
595
- t1 = $[3];
596
- }
597
- const source = t1;
598
- let t2;
599
- if ($[4] !== source) {
600
- t2 = () => {
601
- copyToClipboard(source);
602
- };
603
- $[4] = source;
604
- $[5] = t2;
605
- } else {
606
- t2 = $[5];
607
- }
608
- const onCopy = t2;
609
- let t3;
610
- if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
611
- t3 = (event) => {
612
- setSample(event.currentTarget.dataset.sample);
613
- };
614
- $[6] = t3;
615
- } else {
616
- t3 = $[6];
617
- }
618
- const onSelect = t3;
619
- let t4;
620
- if ($[7] !== sample) {
621
- t4 = SAMPLE_ORDER.map((key) => /* @__PURE__ */ jsxDEV("button", {
622
- "aria-selected": sample === key,
623
- className: "rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground",
624
- "data-sample": key,
625
- "data-testid": `api-sample-${key}`,
626
- onClick: onSelect,
627
- role: "tab",
628
- type: "button",
629
- children: SAMPLE_LABEL[key]
630
- }, key, false));
631
- $[7] = sample;
632
- $[8] = t4;
633
- } else {
634
- t4 = $[8];
635
- }
636
- let t5;
637
- if ($[9] !== t4) {
638
- t5 = /* @__PURE__ */ jsxDEV("div", {
639
- className: "flex gap-1",
640
- role: "tablist",
641
- children: t4
642
- }, void 0, false);
643
- $[9] = t4;
644
- $[10] = t5;
645
- } else {
646
- t5 = $[10];
647
- }
648
- let t6;
649
- if ($[11] !== t) {
650
- t6 = t("Copy");
651
- $[11] = t;
652
- $[12] = t6;
653
- } else {
654
- t6 = $[12];
655
- }
656
- let t7;
657
- if ($[13] !== onCopy || $[14] !== t6) {
658
- t7 = /* @__PURE__ */ jsxDEV(Button, {
659
- "data-testid": "api-sample-copy",
660
- onClick: onCopy,
661
- size: "xs",
662
- type: "button",
663
- variant: "ghost",
664
- children: t6
665
- }, void 0, false);
666
- $[13] = onCopy;
667
- $[14] = t6;
668
- $[15] = t7;
669
- } else {
670
- t7 = $[15];
671
- }
672
- let t8;
673
- if ($[16] !== t5 || $[17] !== t7) {
674
- t8 = /* @__PURE__ */ jsxDEV("div", {
675
- className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2",
676
- children: [t5, t7]
677
- }, void 0, true);
678
- $[16] = t5;
679
- $[17] = t7;
680
- $[18] = t8;
681
- } else {
682
- t8 = $[18];
683
- }
684
- let t9;
685
- if ($[19] !== source) {
686
- t9 = /* @__PURE__ */ jsxDEV("pre", {
687
- className: "overflow-auto px-3 pb-3 font-mono text-xs",
688
- "data-testid": "api-sample-source",
689
- children: source
690
- }, void 0, false);
691
- $[19] = source;
692
- $[20] = t9;
693
- } else {
694
- t9 = $[20];
695
- }
696
- let t10;
697
- if ($[21] !== t8 || $[22] !== t9) {
698
- t10 = /* @__PURE__ */ jsxDEV("div", {
699
- className: "flex flex-col gap-2 rounded-xl border border-border bg-card",
700
- "data-testid": "api-code-samples",
701
- children: [t8, t9]
702
- }, void 0, true);
703
- $[21] = t8;
704
- $[22] = t9;
705
- $[23] = t10;
706
- } else {
707
- t10 = $[23];
708
- }
709
- return t10;
710
- };
711
-
712
- const TONE_CLASS = {
713
- blue: "text-info",
714
- emerald: "text-success",
715
- neutral: "text-muted-foreground",
716
- orange: "text-warning",
717
- red: "text-destructive",
718
- violet: "text-royal-amethyst"
719
- };
720
- const methodTone = (method) => {
721
- switch (method.toUpperCase()) {
722
- case "DELETE": {
723
- return "red";
724
- }
725
- case "GET": {
726
- return "emerald";
727
- }
728
- case "PATCH": {
729
- return "orange";
730
- }
731
- case "POST": {
732
- return "blue";
733
- }
734
- case "PUT": {
735
- return "orange";
736
- }
737
- default: {
738
- return "neutral";
739
- }
740
- }
741
- };
742
- const kindTone = (kind) => {
743
- switch (kind) {
744
- case "action": {
745
- return "violet";
746
- }
747
- case "mutation": {
748
- return "orange";
749
- }
750
- case "query": {
751
- return "emerald";
752
- }
753
- default: {
754
- return "neutral";
755
- }
756
- }
757
- };
758
- const MethodBadge = (t0) => {
759
- const $ = c(7);
760
- const {
761
- kind,
762
- method,
763
- testId
764
- } = t0;
765
- let t1;
766
- if ($[0] !== kind || $[1] !== method) {
767
- t1 = kind ?? method.toUpperCase();
768
- $[0] = kind;
769
- $[1] = method;
770
- $[2] = t1;
771
- } else {
772
- t1 = $[2];
773
- }
774
- const label = t1;
775
- const tone = kind === void 0 ? methodTone(method) : kindTone(kind);
776
- const t2 = `${TONE_CLASS[tone]} font-mono text-[10px] tracking-wide uppercase`;
777
- let t3;
778
- if ($[3] !== label || $[4] !== t2 || $[5] !== testId) {
779
- t3 = /* @__PURE__ */ jsxDEV(Badge$1, {
780
- className: t2,
781
- "data-testid": testId,
782
- variant: "ghost",
783
- children: label
784
- }, void 0, false);
785
- $[3] = label;
786
- $[4] = t2;
787
- $[5] = testId;
788
- $[6] = t3;
789
- } else {
790
- t3 = $[6];
791
- }
792
- return t3;
793
- };
794
-
795
- const statusToneClass = (status) => {
796
- if (status.startsWith("2")) {
797
- return "text-emerald-600 dark:text-emerald-400";
798
- }
799
- if (status === "default" || status.startsWith("4") || status.startsWith("5")) {
800
- return "text-red-600 dark:text-red-400";
801
- }
802
- return "text-muted-foreground";
803
- };
804
- const statusDotClass = (status) => {
805
- if (status.startsWith("2")) {
806
- return "bg-emerald-500";
807
- }
808
- if (status === "default" || status.startsWith("4") || status.startsWith("5")) {
809
- return "bg-red-500";
810
- }
811
- return "bg-muted-foreground";
812
- };
813
-
814
- const seedArgs = (operation) => JSON.stringify(exampleForSchema(operation.argsSchema) ?? {}, void 0, 2);
815
- const OperationRunContext = /* @__PURE__ */ createContext(null);
816
- const useOperationRun = () => {
817
- const value = use(OperationRunContext);
818
- if (value === null) {
819
- throw new LunoraError("INTERNAL", "useOperationRun must be used within an OperationRunProvider");
820
- }
821
- return value;
822
- };
823
- const OperationRunProvider = ({
824
- children,
825
- operation
826
- }) => {
827
- const t = useT();
828
- const client = useLunora();
829
- const [argsText, setArgsText] = useState(() => seedArgs(operation));
830
- const [shardKey, setShardKey] = useState("");
831
- const [status, setStatus] = useState("idle");
832
- const [response, setResponse] = useState(void 0);
833
- const [error, setError] = useState(null);
834
- const [durationMs, setDurationMs] = useState(null);
835
- const send = async () => {
836
- let parsedArgs;
837
- try {
838
- parsedArgs = argsText.trim() === "" ? {} : JSON.parse(argsText);
839
- } catch (parseError) {
840
- setStatus("error");
841
- setResponse(void 0);
842
- setDurationMs(null);
843
- setError(t("Invalid JSON args: {message}", {
844
- message: errorMessage(parseError)
845
- }));
846
- return;
847
- }
848
- setStatus("running");
849
- setError(null);
850
- const startedAt = performance.now();
851
- try {
852
- let value;
853
- if (operation.functionPath === void 0) {
854
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
855
- const fetchResponse = await fetch(operation.httpPath, {
856
- body: hasBody ? JSON.stringify(parsedArgs) : void 0,
857
- headers: hasBody ? {
858
- "content-type": "application/json"
859
- } : void 0,
860
- method: operation.method
861
- });
862
- const text = await fetchResponse.text();
863
- try {
864
- value = JSON.parse(text);
865
- } catch {
866
- value = text;
867
- }
868
- } else {
869
- const reference = adminRef(operation.functionPath);
870
- const options = callOptions(shardKey);
871
- switch (operation.kind) {
872
- case "action": {
873
- value = await client.action(reference, parsedArgs, options);
874
- break;
875
- }
876
- case "mutation": {
877
- value = await client.mutation(reference, parsedArgs, options);
878
- break;
879
- }
880
- default: {
881
- value = await client.query(reference, parsedArgs, options);
882
- }
883
- }
884
- }
885
- setResponse(value);
886
- setDurationMs(Math.round(performance.now() - startedAt));
887
- setStatus("success");
888
- } catch (runError) {
889
- setResponse(void 0);
890
- setDurationMs(Math.round(performance.now() - startedAt));
891
- setError(errorMessage(runError));
892
- setStatus("error");
893
- }
894
- };
895
- const onSend = () => {
896
- fireAndForget(send());
897
- };
898
- const value_0 = {
899
- argsText,
900
- durationMs,
901
- error,
902
- operation,
903
- response,
904
- send: onSend,
905
- setArgsText,
906
- setShardKey,
907
- shardKey,
908
- status
909
- };
910
- return /* @__PURE__ */ jsxDEV(OperationRunContext, {
911
- value: value_0,
912
- children
913
- }, void 0, false);
914
- };
915
-
916
- const TryIt = () => {
917
- const $ = c(48);
918
- const t = useT();
919
- const {
920
- argsText,
921
- operation,
922
- send,
923
- setArgsText,
924
- setShardKey,
925
- shardKey,
926
- status
927
- } = useOperationRun();
928
- let t0;
929
- if ($[0] !== setArgsText) {
930
- t0 = (event) => {
931
- setArgsText(event.target.value);
932
- };
933
- $[0] = setArgsText;
934
- $[1] = t0;
935
- } else {
936
- t0 = $[1];
937
- }
938
- const onArgsChange = t0;
939
- let t1;
940
- if ($[2] !== send) {
941
- t1 = (event_0) => {
942
- if (event_0.key === "Enter" && (event_0.metaKey || event_0.ctrlKey)) {
943
- event_0.preventDefault();
944
- send();
945
- }
946
- };
947
- $[2] = send;
948
- $[3] = t1;
949
- } else {
950
- t1 = $[3];
951
- }
952
- const onArgsKeyDown = t1;
953
- const running = status === "running";
954
- let t2;
955
- if ($[4] !== operation.kind || $[5] !== operation.method) {
956
- t2 = /* @__PURE__ */ jsxDEV(MethodBadge, {
957
- kind: operation.kind,
958
- method: operation.method,
959
- testId: "api-try-method"
960
- }, void 0, false);
961
- $[4] = operation.kind;
962
- $[5] = operation.method;
963
- $[6] = t2;
964
- } else {
965
- t2 = $[6];
966
- }
967
- const t3 = operation.functionPath ?? operation.httpPath;
968
- let t4;
969
- if ($[7] !== t3) {
970
- t4 = /* @__PURE__ */ jsxDEV("code", {
971
- className: "min-w-0 flex-1 truncate font-mono text-xs text-foreground",
972
- children: t3
973
- }, void 0, false);
974
- $[7] = t3;
975
- $[8] = t4;
976
- } else {
977
- t4 = $[8];
978
- }
979
- const t5 = running ? "animate-pulse" : void 0;
980
- let t6;
981
- if ($[9] !== t5) {
982
- t6 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
983
- className: t5,
984
- icon: SentIcon,
985
- strokeWidth: 2
986
- }, void 0, false);
987
- $[9] = t5;
988
- $[10] = t6;
989
- } else {
990
- t6 = $[10];
991
- }
992
- let t7;
993
- if ($[11] !== running || $[12] !== t) {
994
- t7 = running ? t("Sending…") : t("Send");
995
- $[11] = running;
996
- $[12] = t;
997
- $[13] = t7;
998
- } else {
999
- t7 = $[13];
1000
- }
1001
- let t8;
1002
- if ($[14] !== running || $[15] !== send || $[16] !== t6 || $[17] !== t7) {
1003
- t8 = /* @__PURE__ */ jsxDEV(Button, {
1004
- "data-testid": "api-try-send",
1005
- disabled: running,
1006
- onClick: send,
1007
- size: "sm",
1008
- type: "button",
1009
- children: [t6, t7]
1010
- }, void 0, true);
1011
- $[14] = running;
1012
- $[15] = send;
1013
- $[16] = t6;
1014
- $[17] = t7;
1015
- $[18] = t8;
1016
- } else {
1017
- t8 = $[18];
1018
- }
1019
- let t9;
1020
- if ($[19] !== t2 || $[20] !== t4 || $[21] !== t8) {
1021
- t9 = /* @__PURE__ */ jsxDEV("div", {
1022
- className: "flex items-center gap-2 border-b border-border bg-muted px-3 py-2",
1023
- children: [t2, t4, t8]
1024
- }, void 0, true);
1025
- $[19] = t2;
1026
- $[20] = t4;
1027
- $[21] = t8;
1028
- $[22] = t9;
1029
- } else {
1030
- t9 = $[22];
1031
- }
1032
- let t10;
1033
- if ($[23] !== t) {
1034
- t10 = t("Arguments (JSON)");
1035
- $[23] = t;
1036
- $[24] = t10;
1037
- } else {
1038
- t10 = $[24];
1039
- }
1040
- let t11;
1041
- if ($[25] !== t10) {
1042
- t11 = /* @__PURE__ */ jsxDEV(Label, {
1043
- htmlFor: "api-try-args",
1044
- children: t10
1045
- }, void 0, false);
1046
- $[25] = t10;
1047
- $[26] = t11;
1048
- } else {
1049
- t11 = $[26];
1050
- }
1051
- let t12;
1052
- if ($[27] !== argsText) {
1053
- t12 = argsText.split("\n");
1054
- $[27] = argsText;
1055
- $[28] = t12;
1056
- } else {
1057
- t12 = $[28];
1058
- }
1059
- const t13 = Math.min(12, Math.max(3, t12.length));
1060
- let t14;
1061
- if ($[29] !== argsText || $[30] !== onArgsChange || $[31] !== onArgsKeyDown || $[32] !== t13) {
1062
- t14 = /* @__PURE__ */ jsxDEV(Textarea, {
1063
- className: "font-mono text-xs",
1064
- "data-testid": "api-try-args",
1065
- id: "api-try-args",
1066
- onChange: onArgsChange,
1067
- onKeyDown: onArgsKeyDown,
1068
- rows: t13,
1069
- spellCheck: false,
1070
- value: argsText
1071
- }, void 0, false);
1072
- $[29] = argsText;
1073
- $[30] = onArgsChange;
1074
- $[31] = onArgsKeyDown;
1075
- $[32] = t13;
1076
- $[33] = t14;
1077
- } else {
1078
- t14 = $[33];
1079
- }
1080
- let t15;
1081
- if ($[34] !== t11 || $[35] !== t14) {
1082
- t15 = /* @__PURE__ */ jsxDEV("div", {
1083
- className: "flex flex-col gap-1.5",
1084
- children: [t11, t14]
1085
- }, void 0, true);
1086
- $[34] = t11;
1087
- $[35] = t14;
1088
- $[36] = t15;
1089
- } else {
1090
- t15 = $[36];
1091
- }
1092
- let t16;
1093
- if ($[37] !== operation.functionPath || $[38] !== setShardKey || $[39] !== shardKey || $[40] !== t) {
1094
- t16 = operation.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("div", {
1095
- className: "flex flex-col gap-1.5",
1096
- children: [/* @__PURE__ */ jsxDEV(Label, {
1097
- htmlFor: "shard-input",
1098
- children: t("Shard key (optional)")
1099
- }, void 0, false), /* @__PURE__ */ jsxDEV(ShardInput, {
1100
- id: "shard-input",
1101
- onChange: setShardKey,
1102
- testId: "shard-input",
1103
- value: shardKey
1104
- }, void 0, false)]
1105
- }, void 0, true);
1106
- $[37] = operation.functionPath;
1107
- $[38] = setShardKey;
1108
- $[39] = shardKey;
1109
- $[40] = t;
1110
- $[41] = t16;
1111
- } else {
1112
- t16 = $[41];
1113
- }
1114
- let t17;
1115
- if ($[42] !== t15 || $[43] !== t16) {
1116
- t17 = /* @__PURE__ */ jsxDEV("div", {
1117
- className: "flex flex-col gap-3 p-3",
1118
- children: [t15, t16]
1119
- }, void 0, true);
1120
- $[42] = t15;
1121
- $[43] = t16;
1122
- $[44] = t17;
1123
- } else {
1124
- t17 = $[44];
1125
- }
1126
- let t18;
1127
- if ($[45] !== t17 || $[46] !== t9) {
1128
- t18 = /* @__PURE__ */ jsxDEV("div", {
1129
- className: "overflow-hidden rounded-xl border border-border bg-card",
1130
- "data-testid": "api-try-it",
1131
- children: [t9, t17]
1132
- }, void 0, true);
1133
- $[45] = t17;
1134
- $[46] = t9;
1135
- $[47] = t18;
1136
- } else {
1137
- t18 = $[47];
1138
- }
1139
- return t18;
1140
- };
1141
-
1142
- const OperationView = (t0) => {
1143
- const $ = c(51);
1144
- const {
1145
- operation
1146
- } = t0;
1147
- const t = useT();
1148
- const t1 = `api-operation-${operation.operationId}`;
1149
- const t2 = operation.key;
1150
- let t3;
1151
- if ($[0] !== operation.kind || $[1] !== operation.method) {
1152
- t3 = /* @__PURE__ */ jsxDEV(MethodBadge, {
1153
- kind: operation.kind,
1154
- method: operation.method,
1155
- testId: "api-operation-method"
1156
- }, void 0, false);
1157
- $[0] = operation.kind;
1158
- $[1] = operation.method;
1159
- $[2] = t3;
1160
- } else {
1161
- t3 = $[2];
1162
- }
1163
- const t4 = operation.functionPath ?? operation.httpPath;
1164
- let t5;
1165
- if ($[3] !== t4) {
1166
- t5 = /* @__PURE__ */ jsxDEV("code", {
1167
- className: "truncate font-mono text-xs text-muted-foreground",
1168
- children: t4
1169
- }, void 0, false);
1170
- $[3] = t4;
1171
- $[4] = t5;
1172
- } else {
1173
- t5 = $[4];
1174
- }
1175
- let t6;
1176
- if ($[5] !== t3 || $[6] !== t5) {
1177
- t6 = /* @__PURE__ */ jsxDEV("div", {
1178
- className: "flex items-center gap-2",
1179
- children: [t3, t5]
1180
- }, void 0, true);
1181
- $[5] = t3;
1182
- $[6] = t5;
1183
- $[7] = t6;
1184
- } else {
1185
- t6 = $[7];
1186
- }
1187
- let t7;
1188
- if ($[8] !== operation.title) {
1189
- t7 = /* @__PURE__ */ jsxDEV("h1", {
1190
- className: "text-lg font-semibold text-foreground",
1191
- "data-testid": "api-operation-title",
1192
- children: operation.title
1193
- }, void 0, false);
1194
- $[8] = operation.title;
1195
- $[9] = t7;
1196
- } else {
1197
- t7 = $[9];
1198
- }
1199
- let t8;
1200
- if ($[10] !== operation.description) {
1201
- t8 = operation.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1202
- className: "text-sm text-muted-foreground",
1203
- children: operation.description
1204
- }, void 0, false);
1205
- $[10] = operation.description;
1206
- $[11] = t8;
1207
- } else {
1208
- t8 = $[11];
1209
- }
1210
- let t9;
1211
- if ($[12] !== t6 || $[13] !== t7 || $[14] !== t8) {
1212
- t9 = /* @__PURE__ */ jsxDEV("header", {
1213
- className: "sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",
1214
- children: [t6, t7, t8]
1215
- }, void 0, true);
1216
- $[12] = t6;
1217
- $[13] = t7;
1218
- $[14] = t8;
1219
- $[15] = t9;
1220
- } else {
1221
- t9 = $[15];
1222
- }
1223
- let t10;
1224
- if ($[16] !== t) {
1225
- t10 = t("Try it");
1226
- $[16] = t;
1227
- $[17] = t10;
1228
- } else {
1229
- t10 = $[17];
1230
- }
1231
- let t11;
1232
- if ($[18] !== t10) {
1233
- t11 = /* @__PURE__ */ jsxDEV("h2", {
1234
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1235
- children: t10
1236
- }, void 0, false);
1237
- $[18] = t10;
1238
- $[19] = t11;
1239
- } else {
1240
- t11 = $[19];
1241
- }
1242
- let t12;
1243
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1244
- t12 = /* @__PURE__ */ jsxDEV(TryIt, {}, void 0, false);
1245
- $[20] = t12;
1246
- } else {
1247
- t12 = $[20];
1248
- }
1249
- let t13;
1250
- if ($[21] !== t11) {
1251
- t13 = /* @__PURE__ */ jsxDEV("section", {
1252
- className: "flex flex-col gap-2",
1253
- children: [t11, t12]
1254
- }, void 0, true);
1255
- $[21] = t11;
1256
- $[22] = t13;
1257
- } else {
1258
- t13 = $[22];
1259
- }
1260
- let t14;
1261
- if ($[23] !== t) {
1262
- t14 = t("Request arguments");
1263
- $[23] = t;
1264
- $[24] = t14;
1265
- } else {
1266
- t14 = $[24];
1267
- }
1268
- let t15;
1269
- if ($[25] !== t14) {
1270
- t15 = /* @__PURE__ */ jsxDEV("h2", {
1271
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1272
- children: t14
1273
- }, void 0, false);
1274
- $[25] = t14;
1275
- $[26] = t15;
1276
- } else {
1277
- t15 = $[26];
1278
- }
1279
- let t16;
1280
- if ($[27] !== operation.argsSchema) {
1281
- t16 = /* @__PURE__ */ jsxDEV(SchemaTable, {
1282
- schema: operation.argsSchema,
1283
- testId: "api-operation-args"
1284
- }, void 0, false);
1285
- $[27] = operation.argsSchema;
1286
- $[28] = t16;
1287
- } else {
1288
- t16 = $[28];
1289
- }
1290
- let t17;
1291
- if ($[29] !== t15 || $[30] !== t16) {
1292
- t17 = /* @__PURE__ */ jsxDEV("section", {
1293
- className: "flex flex-col gap-2",
1294
- children: [t15, t16]
1295
- }, void 0, true);
1296
- $[29] = t15;
1297
- $[30] = t16;
1298
- $[31] = t17;
1299
- } else {
1300
- t17 = $[31];
1301
- }
1302
- let t18;
1303
- if ($[32] !== t) {
1304
- t18 = t("Response body");
1305
- $[32] = t;
1306
- $[33] = t18;
1307
- } else {
1308
- t18 = $[33];
1309
- }
1310
- let t19;
1311
- if ($[34] !== t18) {
1312
- t19 = /* @__PURE__ */ jsxDEV("h2", {
1313
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1314
- children: t18
1315
- }, void 0, false);
1316
- $[34] = t18;
1317
- $[35] = t19;
1318
- } else {
1319
- t19 = $[35];
1320
- }
1321
- let t20;
1322
- if ($[36] !== operation.responses || $[37] !== t) {
1323
- let t212;
1324
- if ($[39] !== t) {
1325
- t212 = (response) => /* @__PURE__ */ jsxDEV("div", {
1326
- className: "flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",
1327
- children: [/* @__PURE__ */ jsxDEV("div", {
1328
- className: "flex items-center justify-between gap-2",
1329
- children: [/* @__PURE__ */ jsxDEV("span", {
1330
- className: `inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${statusToneClass(response.status)}`,
1331
- children: [/* @__PURE__ */ jsxDEV("span", {
1332
- className: `size-1.5 rounded-full ${statusDotClass(response.status)}`
1333
- }, void 0, false), response.status]
1334
- }, void 0, true), response.schema !== void 0 && /* @__PURE__ */ jsxDEV("span", {
1335
- className: "rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",
1336
- children: t("application/json")
1337
- }, void 0, false)]
1338
- }, void 0, true), response.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1339
- className: "text-xs text-muted-foreground",
1340
- children: response.description
1341
- }, void 0, false), response.schema !== void 0 && /* @__PURE__ */ jsxDEV(SchemaTable, {
1342
- schema: response.schema,
1343
- testId: `api-response-${response.status}`
1344
- }, void 0, false)]
1345
- }, response.status, true);
1346
- $[39] = t;
1347
- $[40] = t212;
1348
- } else {
1349
- t212 = $[40];
1350
- }
1351
- t20 = operation.responses.map(t212);
1352
- $[36] = operation.responses;
1353
- $[37] = t;
1354
- $[38] = t20;
1355
- } else {
1356
- t20 = $[38];
1357
- }
1358
- let t21;
1359
- if ($[41] !== t19 || $[42] !== t20) {
1360
- t21 = /* @__PURE__ */ jsxDEV("section", {
1361
- className: "flex flex-col gap-3",
1362
- children: [t19, t20]
1363
- }, void 0, true);
1364
- $[41] = t19;
1365
- $[42] = t20;
1366
- $[43] = t21;
1367
- } else {
1368
- t21 = $[43];
1369
- }
1370
- let t22;
1371
- if ($[44] !== operation.key || $[45] !== t1 || $[46] !== t13 || $[47] !== t17 || $[48] !== t21 || $[49] !== t9) {
1372
- t22 = /* @__PURE__ */ jsxDEV("div", {
1373
- className: "flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1",
1374
- "data-testid": t1,
1375
- children: [t9, t13, t17, t21]
1376
- }, t2, true);
1377
- $[44] = operation.key;
1378
- $[45] = t1;
1379
- $[46] = t13;
1380
- $[47] = t17;
1381
- $[48] = t21;
1382
- $[49] = t9;
1383
- $[50] = t22;
1384
- } else {
1385
- t22 = $[50];
1386
- }
1387
- return t22;
1388
- };
1389
-
1390
- const KIND_CLASS = {
1391
- boolean: "text-royal-amethyst",
1392
- key: "text-sky-sapphire",
1393
- number: "text-warning",
1394
- plain: "",
1395
- string: "text-success"
1396
- };
1397
- const TOKEN = /"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g;
1398
- const COLON_AHEAD = /^\s*:/;
1399
- const classify = (code, end, text) => {
1400
- if (text.startsWith('"')) {
1401
- return COLON_AHEAD.test(code.slice(end)) ? "key" : "string";
1402
- }
1403
- if (text === "true" || text === "false" || text === "null") {
1404
- return "boolean";
1405
- }
1406
- return "number";
1407
- };
1408
- const tokenize = (code) => {
1409
- const tokens = [];
1410
- let lastIndex = 0;
1411
- for (const match of code.matchAll(TOKEN)) {
1412
- const {
1413
- index
1414
- } = match;
1415
- const text = match[0];
1416
- const end = index + text.length;
1417
- if (index > lastIndex) {
1418
- tokens.push({
1419
- kind: "plain",
1420
- start: lastIndex,
1421
- text: code.slice(lastIndex, index)
1422
- });
1423
- }
1424
- tokens.push({
1425
- kind: classify(code, end, text),
1426
- start: index,
1427
- text
1428
- });
1429
- lastIndex = end;
1430
- }
1431
- if (lastIndex < code.length) {
1432
- tokens.push({
1433
- kind: "plain",
1434
- start: lastIndex,
1435
- text: code.slice(lastIndex)
1436
- });
1437
- }
1438
- return tokens;
1439
- };
1440
- const JsonHighlight = (t0) => {
1441
- const $ = c(4);
1442
- const {
1443
- code
1444
- } = t0;
1445
- let t1;
1446
- if ($[0] !== code) {
1447
- const tokens = tokenize(code);
1448
- t1 = tokens.map(_temp$1);
1449
- $[0] = code;
1450
- $[1] = t1;
1451
- } else {
1452
- t1 = $[1];
1453
- }
1454
- let t2;
1455
- if ($[2] !== t1) {
1456
- t2 = /* @__PURE__ */ jsxDEV(Fragment, {
1457
- children: t1
1458
- }, void 0, false);
1459
- $[2] = t1;
1460
- $[3] = t2;
1461
- } else {
1462
- t2 = $[3];
1463
- }
1464
- return t2;
1465
- };
1466
- function _temp$1(token) {
1467
- return /* @__PURE__ */ jsxDEV("span", {
1468
- className: KIND_CLASS[token.kind],
1469
- children: token.text
1470
- }, token.start, false);
1471
- }
1472
-
1473
- const LIVE_TAB = "__live__";
1474
- const exampleBody = (response) => response.schema === void 0 ? "" : JSON.stringify(exampleForSchema(response.schema), void 0, 2);
1475
- const liveBody = (error, response, failed) => {
1476
- if (failed) {
1477
- return error ?? "";
1478
- }
1479
- return response === void 0 ? "" : JSON.stringify(response, void 0, 2);
1480
- };
1481
- const ResponseBody = (t0) => {
1482
- const $ = c(18);
1483
- const {
1484
- active,
1485
- running,
1486
- showError
1487
- } = t0;
1488
- const t = useT();
1489
- if (running) {
1490
- let t12;
1491
- if ($[0] !== t) {
1492
- t12 = t("Sending…");
1493
- $[0] = t;
1494
- $[1] = t12;
1495
- } else {
1496
- t12 = $[1];
1497
- }
1498
- let t22;
1499
- if ($[2] !== t12) {
1500
- t22 = /* @__PURE__ */ jsxDEV("p", {
1501
- className: "px-3 py-3 text-xs text-muted-foreground",
1502
- "data-testid": "api-response-running",
1503
- children: t12
1504
- }, void 0, false);
1505
- $[2] = t12;
1506
- $[3] = t22;
1507
- } else {
1508
- t22 = $[3];
1509
- }
1510
- return t22;
1511
- }
1512
- if (active === void 0 || active.body === "") {
1513
- let t12;
1514
- if ($[4] !== active?.live || $[5] !== t) {
1515
- t12 = active?.live === true ? t("Send a request to see the response.") : t("No example for this response.");
1516
- $[4] = active?.live;
1517
- $[5] = t;
1518
- $[6] = t12;
1519
- } else {
1520
- t12 = $[6];
1521
- }
1522
- let t22;
1523
- if ($[7] !== t12) {
1524
- t22 = /* @__PURE__ */ jsxDEV("p", {
1525
- className: "px-3 py-3 text-xs text-muted-foreground",
1526
- "data-testid": "api-response-idle",
1527
- children: t12
1528
- }, void 0, false);
1529
- $[7] = t12;
1530
- $[8] = t22;
1531
- } else {
1532
- t22 = $[8];
1533
- }
1534
- return t22;
1535
- }
1536
- const t1 = showError && "text-destructive";
1537
- let t2;
1538
- if ($[9] !== t1) {
1539
- t2 = cn("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs", t1);
1540
- $[9] = t1;
1541
- $[10] = t2;
1542
- } else {
1543
- t2 = $[10];
1544
- }
1545
- const t3 = showError ? "api-response-error" : "api-response-body";
1546
- let t4;
1547
- if ($[11] !== active.body || $[12] !== showError) {
1548
- t4 = showError ? active.body : /* @__PURE__ */ jsxDEV(JsonHighlight, {
1549
- code: active.body
1550
- }, void 0, false);
1551
- $[11] = active.body;
1552
- $[12] = showError;
1553
- $[13] = t4;
1554
- } else {
1555
- t4 = $[13];
1556
- }
1557
- let t5;
1558
- if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
1559
- t5 = /* @__PURE__ */ jsxDEV("pre", {
1560
- className: t2,
1561
- "data-testid": t3,
1562
- children: t4
1563
- }, void 0, false);
1564
- $[14] = t2;
1565
- $[15] = t3;
1566
- $[16] = t4;
1567
- $[17] = t5;
1568
- } else {
1569
- t5 = $[17];
1570
- }
1571
- return t5;
1572
- };
1573
- const ResponsePanel = () => {
1574
- const $ = c(67);
1575
- const t = useT();
1576
- const {
1577
- durationMs,
1578
- error,
1579
- operation,
1580
- response,
1581
- status
1582
- } = useOperationRun();
1583
- const running = status === "running";
1584
- const failed = status === "error";
1585
- const ran = status === "success" || failed;
1586
- let t0;
1587
- if ($[0] !== durationMs || $[1] !== error || $[2] !== failed || $[3] !== operation.responses || $[4] !== ran || $[5] !== response || $[6] !== t) {
1588
- bb0: {
1589
- const documented = operation.responses.map(_temp);
1590
- if (!ran) {
1591
- t0 = documented;
1592
- break bb0;
1593
- }
1594
- let t14;
1595
- if ($[8] !== error || $[9] !== failed || $[10] !== response) {
1596
- t14 = liveBody(error, response, failed);
1597
- $[8] = error;
1598
- $[9] = failed;
1599
- $[10] = response;
1600
- $[11] = t14;
1601
- } else {
1602
- t14 = $[11];
1603
- }
1604
- let t22;
1605
- if ($[12] !== t) {
1606
- t22 = t("Live");
1607
- $[12] = t;
1608
- $[13] = t22;
1609
- } else {
1610
- t22 = $[13];
1611
- }
1612
- const t32 = failed ? "error" : "200";
1613
- let t42;
1614
- if ($[14] !== durationMs || $[15] !== t14 || $[16] !== t22 || $[17] !== t32) {
1615
- t42 = {
1616
- body: t14,
1617
- durationMs,
1618
- id: LIVE_TAB,
1619
- label: t22,
1620
- live: true,
1621
- status: t32
1622
- };
1623
- $[14] = durationMs;
1624
- $[15] = t14;
1625
- $[16] = t22;
1626
- $[17] = t32;
1627
- $[18] = t42;
1628
- } else {
1629
- t42 = $[18];
1630
- }
1631
- const live = t42;
1632
- t0 = [live, ...documented];
1633
- }
1634
- $[0] = durationMs;
1635
- $[1] = error;
1636
- $[2] = failed;
1637
- $[3] = operation.responses;
1638
- $[4] = ran;
1639
- $[5] = response;
1640
- $[6] = t;
1641
- $[7] = t0;
1642
- } else {
1643
- t0 = $[7];
1644
- }
1645
- const tabs = t0;
1646
- let t1;
1647
- if ($[19] !== ran || $[20] !== tabs) {
1648
- t1 = ran ? LIVE_TAB : tabs.find(_temp2)?.id ?? tabs[0]?.id ?? "";
1649
- $[19] = ran;
1650
- $[20] = tabs;
1651
- $[21] = t1;
1652
- } else {
1653
- t1 = $[21];
1654
- }
1655
- const defaultId = t1;
1656
- const [picked, setPicked] = useState(null);
1657
- let active;
1658
- let onCopy;
1659
- let onSelect;
1660
- let showError;
1661
- let t2;
1662
- let t3;
1663
- let t4;
1664
- let t5;
1665
- let t6;
1666
- let t7;
1667
- if ($[22] !== defaultId || $[23] !== picked || $[24] !== t || $[25] !== tabs) {
1668
- active = tabs.find((tab_0) => tab_0.id === (picked ?? defaultId)) ?? tabs[0];
1669
- let t82;
1670
- if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1671
- t82 = (event) => {
1672
- const {
1673
- id
1674
- } = event.currentTarget.dataset;
1675
- if (id !== void 0) {
1676
- setPicked(id);
1677
- }
1678
- };
1679
- $[36] = t82;
1680
- } else {
1681
- t82 = $[36];
1682
- }
1683
- onSelect = t82;
1684
- onCopy = () => {
1685
- if (active !== void 0) {
1686
- copyToClipboard(active.body);
1687
- }
1688
- };
1689
- const liveDurationMs = active?.live === true ? active.durationMs : null;
1690
- showError = active?.live === true && active.status === "error";
1691
- t6 = "flex min-h-0 flex-col rounded-xl border border-border bg-card";
1692
- t7 = "api-response-panel";
1693
- t4 = "flex items-center justify-between gap-2 border-b border-border px-3 py-2";
1694
- let t92;
1695
- if ($[37] !== t) {
1696
- t92 = t("Response");
1697
- $[37] = t;
1698
- $[38] = t92;
1699
- } else {
1700
- t92 = $[38];
1701
- }
1702
- if ($[39] !== t92) {
1703
- t5 = /* @__PURE__ */ jsxDEV("span", {
1704
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1705
- children: t92
1706
- }, void 0, false);
1707
- $[39] = t92;
1708
- $[40] = t5;
1709
- } else {
1710
- t5 = $[40];
1711
- }
1712
- t2 = "flex items-center gap-2";
1713
- t3 = liveDurationMs !== null && /* @__PURE__ */ jsxDEV("span", {
1714
- className: "font-mono text-[10px] text-muted-foreground",
1715
- children: t("{ms} ms", {
1716
- ms: liveDurationMs
1717
- })
1718
- }, void 0, false);
1719
- $[22] = defaultId;
1720
- $[23] = picked;
1721
- $[24] = t;
1722
- $[25] = tabs;
1723
- $[26] = active;
1724
- $[27] = onCopy;
1725
- $[28] = onSelect;
1726
- $[29] = showError;
1727
- $[30] = t2;
1728
- $[31] = t3;
1729
- $[32] = t4;
1730
- $[33] = t5;
1731
- $[34] = t6;
1732
- $[35] = t7;
1733
- } else {
1734
- active = $[26];
1735
- onCopy = $[27];
1736
- onSelect = $[28];
1737
- showError = $[29];
1738
- t2 = $[30];
1739
- t3 = $[31];
1740
- t4 = $[32];
1741
- t5 = $[33];
1742
- t6 = $[34];
1743
- t7 = $[35];
1744
- }
1745
- let t8;
1746
- if ($[41] !== active || $[42] !== onCopy || $[43] !== t) {
1747
- t8 = active !== void 0 && active.body !== "" && /* @__PURE__ */ jsxDEV(Button, {
1748
- "aria-label": t("Copy"),
1749
- "data-testid": "api-response-copy",
1750
- onClick: onCopy,
1751
- size: "icon-xs",
1752
- type: "button",
1753
- variant: "ghost",
1754
- children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1755
- icon: Copy01Icon,
1756
- strokeWidth: 2
1757
- }, void 0, false)
1758
- }, void 0, false);
1759
- $[41] = active;
1760
- $[42] = onCopy;
1761
- $[43] = t;
1762
- $[44] = t8;
1763
- } else {
1764
- t8 = $[44];
1765
- }
1766
- let t9;
1767
- if ($[45] !== t2 || $[46] !== t3 || $[47] !== t8) {
1768
- t9 = /* @__PURE__ */ jsxDEV("div", {
1769
- className: t2,
1770
- children: [t3, t8]
1771
- }, void 0, true);
1772
- $[45] = t2;
1773
- $[46] = t3;
1774
- $[47] = t8;
1775
- $[48] = t9;
1776
- } else {
1777
- t9 = $[48];
1778
- }
1779
- let t10;
1780
- if ($[49] !== t4 || $[50] !== t5 || $[51] !== t9) {
1781
- t10 = /* @__PURE__ */ jsxDEV("div", {
1782
- className: t4,
1783
- children: [t5, t9]
1784
- }, void 0, true);
1785
- $[49] = t4;
1786
- $[50] = t5;
1787
- $[51] = t9;
1788
- $[52] = t10;
1789
- } else {
1790
- t10 = $[52];
1791
- }
1792
- let t11;
1793
- if ($[53] !== active?.id || $[54] !== onSelect || $[55] !== tabs) {
1794
- t11 = tabs.length > 0 && /* @__PURE__ */ jsxDEV("div", {
1795
- className: "flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",
1796
- role: "tablist",
1797
- children: tabs.map((tab_1) => {
1798
- const selected = tab_1.id === active?.id;
1799
- return /* @__PURE__ */ jsxDEV("button", {
1800
- "aria-selected": selected,
1801
- className: cn("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium", selected ? statusToneClass(tab_1.status) : "text-muted-foreground"),
1802
- "data-id": tab_1.id,
1803
- "data-testid": tab_1.live ? "api-response-tab-live" : `api-response-tab-${tab_1.status}`,
1804
- onClick: onSelect,
1805
- role: "tab",
1806
- type: "button",
1807
- children: [/* @__PURE__ */ jsxDEV("span", {
1808
- className: `size-1.5 rounded-full ${statusDotClass(tab_1.status)}`
1809
- }, void 0, false), tab_1.label]
1810
- }, tab_1.id, true);
1811
- })
1812
- }, void 0, false);
1813
- $[53] = active?.id;
1814
- $[54] = onSelect;
1815
- $[55] = tabs;
1816
- $[56] = t11;
1817
- } else {
1818
- t11 = $[56];
1819
- }
1820
- let t12;
1821
- if ($[57] !== active || $[58] !== running || $[59] !== showError) {
1822
- t12 = /* @__PURE__ */ jsxDEV(ResponseBody, {
1823
- active,
1824
- running,
1825
- showError
1826
- }, void 0, false);
1827
- $[57] = active;
1828
- $[58] = running;
1829
- $[59] = showError;
1830
- $[60] = t12;
1831
- } else {
1832
- t12 = $[60];
1833
- }
1834
- let t13;
1835
- if ($[61] !== t10 || $[62] !== t11 || $[63] !== t12 || $[64] !== t6 || $[65] !== t7) {
1836
- t13 = /* @__PURE__ */ jsxDEV("div", {
1837
- className: t6,
1838
- "data-testid": t7,
1839
- children: [t10, t11, t12]
1840
- }, void 0, true);
1841
- $[61] = t10;
1842
- $[62] = t11;
1843
- $[63] = t12;
1844
- $[64] = t6;
1845
- $[65] = t7;
1846
- $[66] = t13;
1847
- } else {
1848
- t13 = $[66];
1849
- }
1850
- return t13;
1851
- };
1852
- function _temp(entry) {
1853
- return {
1854
- body: exampleBody(entry),
1855
- durationMs: null,
1856
- id: entry.status,
1857
- label: entry.status,
1858
- live: false,
1859
- status: entry.status
1860
- };
1861
- }
1862
- function _temp2(tab) {
1863
- return tab.status.startsWith("2");
1864
- }
1865
-
1866
- const filterGroups = (groups, query) => {
1867
- const needle = query.trim().toLowerCase();
1868
- if (needle === "") {
1869
- return groups;
1870
- }
1871
- return groups.map((group) => {
1872
- return {
1873
- ...group,
1874
- operations: group.operations.filter((operation) => `${operation.summary} ${operation.operationId}`.toLowerCase().includes(needle))
1875
- };
1876
- }).filter((group) => group.operations.length > 0);
1877
- };
1878
- const ReferenceView = (t0) => {
1879
- const $ = c(53);
1880
- const {
1881
- model
1882
- } = t0;
1883
- const t = useT();
1884
- const firstKey = model.groups[0]?.operations[0]?.key ?? "";
1885
- const [selectedKey, setSelectedKey] = useState(firstKey);
1886
- const [filter, setFilter] = useState("");
1887
- let t1;
1888
- if ($[0] !== firstKey || $[1] !== model.operationByKey || $[2] !== selectedKey) {
1889
- t1 = model.operationByKey.get(selectedKey) ?? model.operationByKey.get(firstKey);
1890
- $[0] = firstKey;
1891
- $[1] = model.operationByKey;
1892
- $[2] = selectedKey;
1893
- $[3] = t1;
1894
- } else {
1895
- t1 = $[3];
1896
- }
1897
- const selected = t1;
1898
- let groups;
1899
- let server;
1900
- let t2;
1901
- let t3;
1902
- let t4;
1903
- let t5;
1904
- let t6;
1905
- let t7;
1906
- let t8;
1907
- let t9;
1908
- if ($[4] !== filter || $[5] !== model.groups || $[6] !== model.server || $[7] !== selected?.key || $[8] !== t) {
1909
- groups = filterGroups(model.groups, filter);
1910
- let t102;
1911
- if ($[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1912
- t102 = (event) => {
1913
- const {
1914
- key
1915
- } = event.currentTarget.dataset;
1916
- if (key !== void 0) {
1917
- setSelectedKey(key);
1918
- }
1919
- };
1920
- $[19] = t102;
1921
- } else {
1922
- t102 = $[19];
1923
- }
1924
- const onSelect = t102;
1925
- let t112;
1926
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1927
- t112 = (event_0) => {
1928
- setFilter(event_0.target.value);
1929
- };
1930
- $[20] = t112;
1931
- } else {
1932
- t112 = $[20];
1933
- }
1934
- const onFilterChange = t112;
1935
- server = model.server ?? "";
1936
- t8 = "grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]";
1937
- t9 = "api-reference";
1938
- if ($[21] !== t) {
1939
- t4 = t("API operations");
1940
- $[21] = t;
1941
- $[22] = t4;
1942
- } else {
1943
- t4 = $[22];
1944
- }
1945
- t5 = "flex min-h-0 flex-col overflow-y-auto border-r border-border";
1946
- t6 = "api-reference-nav";
1947
- let t122;
1948
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1949
- t122 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1950
- className: "pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",
1951
- icon: Search01Icon,
1952
- strokeWidth: 2
1953
- }, void 0, false);
1954
- $[23] = t122;
1955
- } else {
1956
- t122 = $[23];
1957
- }
1958
- let t132;
1959
- if ($[24] !== t) {
1960
- t132 = t("Filter operations");
1961
- $[24] = t;
1962
- $[25] = t132;
1963
- } else {
1964
- t132 = $[25];
1965
- }
1966
- if ($[26] !== filter || $[27] !== t132) {
1967
- t7 = /* @__PURE__ */ jsxDEV("div", {
1968
- className: "sticky top-0 z-10 border-b border-border bg-sidebar p-2",
1969
- children: /* @__PURE__ */ jsxDEV("div", {
1970
- className: "relative",
1971
- children: [t122, /* @__PURE__ */ jsxDEV(Input, {
1972
- className: "h-7 pl-7",
1973
- "data-testid": "api-filter",
1974
- onChange: onFilterChange,
1975
- placeholder: t132,
1976
- value: filter
1977
- }, void 0, false)]
1978
- }, void 0, true)
1979
- }, void 0, false);
1980
- $[26] = filter;
1981
- $[27] = t132;
1982
- $[28] = t7;
1983
- } else {
1984
- t7 = $[28];
1985
- }
1986
- t2 = "flex flex-col gap-4 p-2";
1987
- let t142;
1988
- if ($[29] !== selected?.key || $[30] !== t) {
1989
- t142 = (group) => /* @__PURE__ */ jsxDEV("div", {
1990
- className: "flex flex-col gap-1",
1991
- children: [/* @__PURE__ */ jsxDEV("div", {
1992
- className: "flex items-center justify-between px-2",
1993
- children: [/* @__PURE__ */ jsxDEV("span", {
1994
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1995
- children: group.name || t("(root)")
1996
- }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1997
- className: "font-mono text-[10px] text-muted-foreground/70",
1998
- children: group.operations.length
1999
- }, void 0, false)]
2000
- }, void 0, true), group.operations.map((operation) => {
2001
- const active = operation.key === selected?.key;
2002
- return /* @__PURE__ */ jsxDEV("button", {
2003
- "aria-current": active ? "page" : void 0,
2004
- className: "flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground",
2005
- "data-key": operation.key,
2006
- "data-testid": `api-nav-${operation.operationId}`,
2007
- onClick: onSelect,
2008
- type: "button",
2009
- children: [/* @__PURE__ */ jsxDEV("span", {
2010
- className: "truncate",
2011
- children: operation.summary
2012
- }, void 0, false), /* @__PURE__ */ jsxDEV(MethodBadge, {
2013
- kind: operation.kind,
2014
- method: operation.method
2015
- }, void 0, false)]
2016
- }, operation.key, true);
2017
- })]
2018
- }, group.name, true);
2019
- $[29] = selected?.key;
2020
- $[30] = t;
2021
- $[31] = t142;
2022
- } else {
2023
- t142 = $[31];
2024
- }
2025
- t3 = groups.map(t142);
2026
- $[4] = filter;
2027
- $[5] = model.groups;
2028
- $[6] = model.server;
2029
- $[7] = selected?.key;
2030
- $[8] = t;
2031
- $[9] = groups;
2032
- $[10] = server;
2033
- $[11] = t2;
2034
- $[12] = t3;
2035
- $[13] = t4;
2036
- $[14] = t5;
2037
- $[15] = t6;
2038
- $[16] = t7;
2039
- $[17] = t8;
2040
- $[18] = t9;
2041
- } else {
2042
- groups = $[9];
2043
- server = $[10];
2044
- t2 = $[11];
2045
- t3 = $[12];
2046
- t4 = $[13];
2047
- t5 = $[14];
2048
- t6 = $[15];
2049
- t7 = $[16];
2050
- t8 = $[17];
2051
- t9 = $[18];
2052
- }
2053
- let t10;
2054
- if ($[32] !== groups.length || $[33] !== t) {
2055
- t10 = groups.length === 0 && /* @__PURE__ */ jsxDEV("p", {
2056
- className: "px-2 py-1 text-xs text-muted-foreground",
2057
- "data-testid": "api-nav-empty",
2058
- children: t("No operations match your filter.")
2059
- }, void 0, false);
2060
- $[32] = groups.length;
2061
- $[33] = t;
2062
- $[34] = t10;
2063
- } else {
2064
- t10 = $[34];
2065
- }
2066
- let t11;
2067
- if ($[35] !== t10 || $[36] !== t2 || $[37] !== t3) {
2068
- t11 = /* @__PURE__ */ jsxDEV("div", {
2069
- className: t2,
2070
- children: [t3, t10]
2071
- }, void 0, true);
2072
- $[35] = t10;
2073
- $[36] = t2;
2074
- $[37] = t3;
2075
- $[38] = t11;
2076
- } else {
2077
- t11 = $[38];
2078
- }
2079
- let t12;
2080
- if ($[39] !== t11 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7) {
2081
- t12 = /* @__PURE__ */ jsxDEV("nav", {
2082
- "aria-label": t4,
2083
- className: t5,
2084
- "data-testid": t6,
2085
- children: [t7, t11]
2086
- }, void 0, true);
2087
- $[39] = t11;
2088
- $[40] = t4;
2089
- $[41] = t5;
2090
- $[42] = t6;
2091
- $[43] = t7;
2092
- $[44] = t12;
2093
- } else {
2094
- t12 = $[44];
2095
- }
2096
- let t13;
2097
- if ($[45] !== selected || $[46] !== server) {
2098
- t13 = selected === void 0 ? /* @__PURE__ */ jsxDEV("div", {
2099
- className: "lg:col-span-2"
2100
- }, void 0, false) : /* @__PURE__ */ jsxDEV(OperationRunProvider, {
2101
- operation: selected,
2102
- children: [/* @__PURE__ */ jsxDEV("div", {
2103
- className: "min-w-0 overflow-y-auto p-6",
2104
- "data-testid": "api-reference-main",
2105
- children: /* @__PURE__ */ jsxDEV(OperationView, {
2106
- operation: selected
2107
- }, void 0, false)
2108
- }, void 0, false), /* @__PURE__ */ jsxDEV("aside", {
2109
- className: "flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l",
2110
- "data-testid": "api-reference-aside",
2111
- children: [/* @__PURE__ */ jsxDEV(CodeSamples, {
2112
- operation: selected,
2113
- server
2114
- }, void 0, false), /* @__PURE__ */ jsxDEV(ResponsePanel, {}, void 0, false)]
2115
- }, void 0, true)]
2116
- }, selected.key, true);
2117
- $[45] = selected;
2118
- $[46] = server;
2119
- $[47] = t13;
2120
- } else {
2121
- t13 = $[47];
2122
- }
2123
- let t14;
2124
- if ($[48] !== t12 || $[49] !== t13 || $[50] !== t8 || $[51] !== t9) {
2125
- t14 = /* @__PURE__ */ jsxDEV("div", {
2126
- className: t8,
2127
- "data-testid": t9,
2128
- children: [t12, t13]
2129
- }, void 0, true);
2130
- $[48] = t12;
2131
- $[49] = t13;
2132
- $[50] = t8;
2133
- $[51] = t9;
2134
- $[52] = t14;
2135
- } else {
2136
- t14 = $[52];
2137
- }
2138
- return t14;
2139
- };
2140
-
2141
- export { ReferenceView as R, useAdminSpec as u };