@lunora/studio 1.0.0-alpha.59 → 1.0.0-alpha.60

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 (381) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -43
  3. package/dist/mount.js +1 -27
  4. package/dist/packem_chunks/ApiTab.js +1 -251
  5. package/dist/packem_chunks/AuditPanel.js +1 -200
  6. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -664
  7. package/dist/packem_chunks/ExportImportPanel.js +3 -198
  8. package/dist/packem_chunks/FileBrowser.js +4 -2955
  9. package/dist/packem_chunks/FunctionRunner.js +1 -326
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -377
  11. package/dist/packem_chunks/HealthPanel.js +1 -648
  12. package/dist/packem_chunks/InsightsPanel.js +1 -462
  13. package/dist/packem_chunks/LogsPanel.js +1 -1303
  14. package/dist/packem_chunks/MailPanel.js +2 -353
  15. package/dist/packem_chunks/MetricsPanel.js +1 -1960
  16. package/dist/packem_chunks/MigrationsPanel.js +1 -239
  17. package/dist/packem_chunks/NotificationsPanel.js +1 -306
  18. package/dist/packem_chunks/PitrPanel.js +1 -252
  19. package/dist/packem_chunks/SchemaViewer.js +1 -2512
  20. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -95
  21. package/dist/packem_chunks/SettingsPanel.js +1 -391
  22. package/dist/packem_chunks/SqlEditorPanel.js +4 -2340
  23. package/dist/packem_chunks/TableEditor.js +1 -290
  24. package/dist/packem_chunks/agents-panel.js +1 -326
  25. package/dist/packem_chunks/analytics-panel.js +1 -261
  26. package/dist/packem_chunks/auth-audit-panel.js +1 -247
  27. package/dist/packem_chunks/auth-config-panel.js +1 -365
  28. package/dist/packem_chunks/auth-sessions-panel.js +1 -175
  29. package/dist/packem_chunks/containers-panel.js +1 -261
  30. package/dist/packem_chunks/dashboards-panel.js +1 -781
  31. package/dist/packem_chunks/fanout-panel.js +1 -482
  32. package/dist/packem_chunks/flags-panel.js +1 -176
  33. package/dist/packem_chunks/issues-panel.js +1 -427
  34. package/dist/packem_chunks/kv-browser.js +1 -1896
  35. package/dist/packem_chunks/log-drains-panel.js +4 -273
  36. package/dist/packem_chunks/organizations-panel.js +1 -3209
  37. package/dist/packem_chunks/payments-panel.js +1 -213
  38. package/dist/packem_chunks/permissions-panel.js +1 -805
  39. package/dist/packem_chunks/queues-panel.js +1 -1075
  40. package/dist/packem_chunks/rls-panel.js +1 -315
  41. package/dist/packem_chunks/schedule-panel.js +1 -831
  42. package/dist/packem_chunks/sparkline.js +1 -79
  43. package/dist/packem_chunks/storage-rules-panel.js +1 -140
  44. package/dist/packem_chunks/subscriptions-panel.js +1 -238
  45. package/dist/packem_chunks/sync-client-panel.js +1 -0
  46. package/dist/packem_chunks/traces-panel.js +1 -747
  47. package/dist/packem_chunks/users-panel.js +1 -1731
  48. package/dist/packem_chunks/vector-browser.js +1 -281
  49. package/dist/packem_chunks/workflows-panel.js +1 -562
  50. package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
  51. package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
  52. package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
  53. package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
  54. package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
  55. package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
  56. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
  57. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
  58. package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
  59. package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
  60. package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
  61. package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
  62. package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
  63. package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
  64. package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
  65. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  66. package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
  67. package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
  68. package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
  69. package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
  70. package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
  71. package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
  72. package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
  73. package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
  74. package/dist/packem_shared/badge-BbuuAio7.js +1 -0
  75. package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
  76. package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
  77. package/dist/packem_shared/button-BkCrNcAs.js +1 -0
  78. package/dist/packem_shared/card-CIDGUN6K.js +1 -0
  79. package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
  80. package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
  81. package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
  82. package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
  83. package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
  84. package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
  85. package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
  86. package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
  87. package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
  88. package/dist/packem_shared/input-JHu63lTv.js +1 -0
  89. package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
  90. package/dist/packem_shared/label-6uP1obNF.js +1 -0
  91. package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
  92. package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
  93. package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
  94. package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
  95. package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
  96. package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
  97. package/dist/packem_shared/select-Bul-DeII.js +2 -0
  98. package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
  99. package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
  100. package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
  101. package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
  102. package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
  103. package/dist/packem_shared/table-DdJBrClo.js +2 -0
  104. package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
  105. package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
  106. package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
  107. package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
  108. package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
  109. package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
  110. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  111. package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
  112. package/dist/standalone/chunk-23HKRH5H.js +13 -0
  113. package/dist/standalone/chunk-2A4RKII2.js +1 -0
  114. package/dist/standalone/chunk-3DTM4GI5.js +1 -0
  115. package/dist/standalone/chunk-3MHKT76P.js +1 -0
  116. package/dist/standalone/chunk-46IB4C4Q.js +1 -0
  117. package/dist/standalone/chunk-4AYEV5UN.js +1 -0
  118. package/dist/standalone/chunk-4FNHHFWR.js +1 -0
  119. package/dist/standalone/chunk-6CLVIOCB.js +1 -0
  120. package/dist/standalone/chunk-6I62RSI5.js +1 -0
  121. package/dist/standalone/chunk-6OKDCV7J.js +1 -0
  122. package/dist/standalone/chunk-6P7HIPUE.js +1 -0
  123. package/dist/standalone/chunk-6UYILUSX.js +1 -0
  124. package/dist/standalone/chunk-725RLB7D.js +1 -0
  125. package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
  126. package/dist/standalone/chunk-7CRLAMGB.js +1 -0
  127. package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
  128. package/dist/standalone/chunk-AGVJJQFL.js +1 -0
  129. package/dist/standalone/chunk-AKTGRZXN.js +1 -0
  130. package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
  131. package/dist/standalone/chunk-BHWSIIDT.js +1 -0
  132. package/dist/standalone/{chunk-L7SK4ZZD.js → chunk-C4O5UR4Y.js} +1 -1
  133. package/dist/standalone/chunk-C4VURT57.js +1 -0
  134. package/dist/standalone/chunk-CKO3F55C.js +4 -0
  135. package/dist/standalone/chunk-CVMRZUF5.js +4 -0
  136. package/dist/standalone/chunk-CWWGDW4V.js +1 -0
  137. package/dist/standalone/chunk-CYET4BRZ.js +1 -0
  138. package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
  139. package/dist/standalone/chunk-FXFK4M4E.js +1 -0
  140. package/dist/standalone/chunk-FYAJPWE7.js +1 -0
  141. package/dist/standalone/chunk-GS7OBQO5.js +1 -0
  142. package/dist/standalone/chunk-GTXVH7I5.js +1 -0
  143. package/dist/standalone/chunk-H6SIM4BT.js +1 -0
  144. package/dist/standalone/chunk-H6WOFY6A.js +8 -0
  145. package/dist/standalone/chunk-HA34GYEX.js +1 -0
  146. package/dist/standalone/chunk-HMIOF5GV.js +1 -0
  147. package/dist/standalone/chunk-HY46NTNW.js +6 -0
  148. package/dist/standalone/chunk-IBCKC2BO.js +1 -0
  149. package/dist/standalone/chunk-ICKBVXPP.js +1 -0
  150. package/dist/standalone/chunk-IE4ROTQD.js +1 -0
  151. package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
  152. package/dist/standalone/chunk-J2LMP2A7.js +1 -0
  153. package/dist/standalone/chunk-JC6WYIHM.js +1 -0
  154. package/dist/standalone/chunk-JKPK25JO.js +1 -0
  155. package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
  156. package/dist/standalone/chunk-JRWBGR5B.js +1 -0
  157. package/dist/standalone/chunk-K5PFWU5J.js +1 -0
  158. package/dist/standalone/chunk-KJTLW5W2.js +11 -0
  159. package/dist/standalone/{chunk-HBGS4SEX.js → chunk-KLLYGWNF.js} +9 -9
  160. package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
  161. package/dist/standalone/{chunk-4QHKBC77.js → chunk-KOC5KV3E.js} +1 -1
  162. package/dist/standalone/chunk-KSRXMTBV.js +1 -0
  163. package/dist/standalone/chunk-KYCAYNXM.js +1 -0
  164. package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
  165. package/dist/standalone/chunk-LKHUVEHX.js +1 -0
  166. package/dist/standalone/chunk-LPOKAJT4.js +4 -0
  167. package/dist/standalone/chunk-MZEK4SGD.js +1 -0
  168. package/dist/standalone/chunk-NCCUM26H.js +1 -0
  169. package/dist/standalone/chunk-O62HJZV3.js +1 -0
  170. package/dist/standalone/chunk-OTJOI23O.js +62 -0
  171. package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
  172. package/dist/standalone/chunk-P4J6XNG3.js +1 -0
  173. package/dist/standalone/chunk-PGDWFWH5.js +1 -0
  174. package/dist/standalone/chunk-PR2SE2MD.js +1 -0
  175. package/dist/standalone/chunk-PTTDIYGP.js +1 -0
  176. package/dist/standalone/chunk-PWDMXMRD.js +1 -0
  177. package/dist/standalone/chunk-Q34MSC2F.js +1 -0
  178. package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
  179. package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
  180. package/dist/standalone/chunk-QJKRHZYV.js +1 -0
  181. package/dist/standalone/chunk-R43KHQDA.js +1 -0
  182. package/dist/standalone/chunk-RC2K5RBE.js +1 -0
  183. package/dist/standalone/chunk-RE6UWCMG.js +1 -0
  184. package/dist/standalone/chunk-RUP3M2GF.js +3 -0
  185. package/dist/standalone/chunk-SA6MBPBL.js +1 -0
  186. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SEDZDNQF.js} +1 -1
  187. package/dist/standalone/chunk-SKHEGARW.js +1 -0
  188. package/dist/standalone/chunk-SKJZDOHG.js +1 -0
  189. package/dist/standalone/chunk-SNDYNCAA.js +1 -0
  190. package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
  191. package/dist/standalone/chunk-TAE2H7PU.js +1 -0
  192. package/dist/standalone/chunk-TEIBKU46.js +1 -0
  193. package/dist/standalone/chunk-TO6NLVFD.js +1 -0
  194. package/dist/standalone/chunk-TYTJDFX2.js +1 -0
  195. package/dist/standalone/{chunk-LXULVPEM.js → chunk-UDZY7MKE.js} +3 -3
  196. package/dist/standalone/chunk-UHHTEBC3.js +1 -0
  197. package/dist/standalone/chunk-UNDFOYRI.js +1 -0
  198. package/dist/standalone/chunk-UNN4CESU.js +1 -0
  199. package/dist/standalone/chunk-UNXX5GQH.js +1 -0
  200. package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-UREY4GLG.js} +1 -1
  201. package/dist/standalone/chunk-UWF5DOGV.js +1 -0
  202. package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
  203. package/dist/standalone/{chunk-VLXV72QE.js → chunk-UZYGEOWY.js} +1 -1
  204. package/dist/standalone/chunk-V66TSUKV.js +1 -0
  205. package/dist/standalone/chunk-VEFNSN7P.js +1 -0
  206. package/dist/standalone/chunk-VUJGR4PB.js +1 -0
  207. package/dist/standalone/chunk-VUXJER3D.js +1 -0
  208. package/dist/standalone/chunk-W572365D.js +1 -0
  209. package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
  210. package/dist/standalone/chunk-XDKFPBIL.js +1 -0
  211. package/dist/standalone/chunk-XRKCGQM2.js +1 -0
  212. package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
  213. package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
  214. package/dist/standalone/chunk-YT7VXQVX.js +1 -0
  215. package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
  216. package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
  217. package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
  218. package/dist/standalone/studio.js +9 -214
  219. package/package.json +4 -4
  220. package/dist/packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js +0 -62
  221. package/dist/packem_shared/ApiDocsPanel-DNDpeR5O.js +0 -842
  222. package/dist/packem_shared/ApiReferencePanel-ChlRsAXU.js +0 -230
  223. package/dist/packem_shared/CommandPalette-BpkopP5f.js +0 -373
  224. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  225. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  226. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  227. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  228. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  229. package/dist/packem_shared/DataBrowser-obTn4sKX.js +0 -4493
  230. package/dist/packem_shared/DataFilters-B1Q7mrt7.js +0 -253
  231. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  232. package/dist/packem_shared/GlobalDataBrowser-BCaohHZ5.js +0 -293
  233. package/dist/packem_shared/HomePanel-DCRj3hGB.js +0 -14
  234. package/dist/packem_shared/OpenRpcReferencePanel-CIeQE1aE.js +0 -192
  235. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  236. package/dist/packem_shared/ScheduledJobs-BQzQo84k.js +0 -262
  237. package/dist/packem_shared/ShardInput-CZnpHILL.js +0 -107
  238. package/dist/packem_shared/Studio-DnlPCbID.js +0 -16
  239. package/dist/packem_shared/StudioApp-CzqlB4zO.js +0 -708
  240. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  241. package/dist/packem_shared/advisor-view-D95sN-wO.js +0 -159
  242. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  243. package/dist/packem_shared/alert-CdAET2K_.js +0 -68
  244. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  245. package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
  246. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +0 -105
  247. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  248. package/dist/packem_shared/card-F2vH_aj2.js +0 -175
  249. package/dist/packem_shared/cf-links-SIbyi4Y1.js +0 -8
  250. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  251. package/dist/packem_shared/data-grid-BywzWfek.js +0 -183
  252. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  253. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  254. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  255. package/dist/packem_shared/error-alert-D9uIFJUS.js +0 -114
  256. package/dist/packem_shared/grid-features-ZOLhHKrR.js +0 -809
  257. package/dist/packem_shared/home-panel-BRAA2UlM.js +0 -1889
  258. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  259. package/dist/packem_shared/internal-DzHCc2Rq.js +0 -131
  260. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  261. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  262. package/dist/packem_shared/log-fields-jEH83H2G.js +0 -18
  263. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  264. package/dist/packem_shared/reference-view-DfXN7oWP.js +0 -2127
  265. package/dist/packem_shared/result-chart-Bf9mbCIo.js +0 -119
  266. package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
  267. package/dist/packem_shared/select-D9OwHEch.js +0 -273
  268. package/dist/packem_shared/shard-history-AxiJ1WPP.js +0 -16
  269. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  270. package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
  271. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  272. package/dist/packem_shared/studio-8QSXbZ98.js +0 -4192
  273. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  274. package/dist/packem_shared/table-list-sidebar-gCE17v9B.js +0 -842
  275. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  276. package/dist/packem_shared/trace-handoff-CGolF3KS.js +0 -38
  277. package/dist/packem_shared/use-admin-query-C7JNuQp-.js +0 -106
  278. package/dist/packem_shared/use-async-submit-rnSk_jXl.js +0 -91
  279. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  280. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  281. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  282. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  283. package/dist/standalone/chunk-2MLA6WFH.js +0 -1
  284. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  285. package/dist/standalone/chunk-2TJVFKD2.js +0 -1
  286. package/dist/standalone/chunk-2YTF6LJ6.js +0 -1
  287. package/dist/standalone/chunk-3GXGLNKW.js +0 -1
  288. package/dist/standalone/chunk-3HGNPZBN.js +0 -1
  289. package/dist/standalone/chunk-3LJEGSMK.js +0 -11
  290. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  291. package/dist/standalone/chunk-4PC7IXNY.js +0 -1
  292. package/dist/standalone/chunk-56XQYNUJ.js +0 -1
  293. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  294. package/dist/standalone/chunk-5QT5JRXD.js +0 -3
  295. package/dist/standalone/chunk-6RLPR7PL.js +0 -1
  296. package/dist/standalone/chunk-6V74EUPK.js +0 -1
  297. package/dist/standalone/chunk-7EE33WLB.js +0 -1
  298. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  299. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  300. package/dist/standalone/chunk-AN4RKMKW.js +0 -1
  301. package/dist/standalone/chunk-APSSZB6Z.js +0 -1
  302. package/dist/standalone/chunk-AXNGWSBM.js +0 -1
  303. package/dist/standalone/chunk-AXZILWRM.js +0 -1
  304. package/dist/standalone/chunk-C7RHEBOH.js +0 -1
  305. package/dist/standalone/chunk-CKSHCYGC.js +0 -2
  306. package/dist/standalone/chunk-CSWIYOB3.js +0 -1
  307. package/dist/standalone/chunk-D3VAON25.js +0 -1
  308. package/dist/standalone/chunk-DDLQN67F.js +0 -1
  309. package/dist/standalone/chunk-DGHW5JG5.js +0 -1
  310. package/dist/standalone/chunk-DMCSOTAE.js +0 -3
  311. package/dist/standalone/chunk-E3BKETAS.js +0 -1
  312. package/dist/standalone/chunk-E3OXNN6O.js +0 -1
  313. package/dist/standalone/chunk-E6BOGDIS.js +0 -1
  314. package/dist/standalone/chunk-F2YMCQ6B.js +0 -1
  315. package/dist/standalone/chunk-F7GE4X2U.js +0 -1
  316. package/dist/standalone/chunk-FAVUOGJR.js +0 -1
  317. package/dist/standalone/chunk-FXP6256Q.js +0 -1
  318. package/dist/standalone/chunk-G6CTAYHJ.js +0 -1
  319. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  320. package/dist/standalone/chunk-H42W62SE.js +0 -1
  321. package/dist/standalone/chunk-HTF5ZX4I.js +0 -8
  322. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  323. package/dist/standalone/chunk-I2PS4L74.js +0 -1
  324. package/dist/standalone/chunk-IYHPYY4A.js +0 -1
  325. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  326. package/dist/standalone/chunk-J7OGP4NN.js +0 -1
  327. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  328. package/dist/standalone/chunk-JZLGLG4T.js +0 -1
  329. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  330. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  331. package/dist/standalone/chunk-L2LN3MK4.js +0 -4
  332. package/dist/standalone/chunk-LT3FH6MW.js +0 -1
  333. package/dist/standalone/chunk-LZUWZBPE.js +0 -1
  334. package/dist/standalone/chunk-M4JM3TOY.js +0 -1
  335. package/dist/standalone/chunk-MLA5ZAEB.js +0 -1
  336. package/dist/standalone/chunk-MRBI5HNQ.js +0 -1
  337. package/dist/standalone/chunk-N5XX4HOL.js +0 -6
  338. package/dist/standalone/chunk-N7SVJOHN.js +0 -1
  339. package/dist/standalone/chunk-NKFXMDOD.js +0 -1
  340. package/dist/standalone/chunk-NPSNKFHE.js +0 -1
  341. package/dist/standalone/chunk-O3NAGRTR.js +0 -1
  342. package/dist/standalone/chunk-O7FVPUCO.js +0 -1
  343. package/dist/standalone/chunk-OKQXTLFX.js +0 -1
  344. package/dist/standalone/chunk-OXHHSUXO.js +0 -1
  345. package/dist/standalone/chunk-QAFAJBAW.js +0 -1
  346. package/dist/standalone/chunk-QAIM6KWT.js +0 -1
  347. package/dist/standalone/chunk-QCPMTB6W.js +0 -1
  348. package/dist/standalone/chunk-QQ2LOSZL.js +0 -1
  349. package/dist/standalone/chunk-QVIPA6UJ.js +0 -1
  350. package/dist/standalone/chunk-QVUQXJCT.js +0 -4
  351. package/dist/standalone/chunk-R2GMHLJY.js +0 -1
  352. package/dist/standalone/chunk-RD5UG2YL.js +0 -1
  353. package/dist/standalone/chunk-RJTIP3WF.js +0 -1
  354. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  355. package/dist/standalone/chunk-SHERR7ZP.js +0 -1
  356. package/dist/standalone/chunk-SOC5CY3F.js +0 -1
  357. package/dist/standalone/chunk-SS7JLF2I.js +0 -4
  358. package/dist/standalone/chunk-SWWYUGPL.js +0 -2
  359. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  360. package/dist/standalone/chunk-TTXRHJUP.js +0 -4
  361. package/dist/standalone/chunk-UK64ZSUW.js +0 -1
  362. package/dist/standalone/chunk-UKDHGVOC.js +0 -1
  363. package/dist/standalone/chunk-UPNTMJFF.js +0 -1
  364. package/dist/standalone/chunk-V43BLH4J.js +0 -1
  365. package/dist/standalone/chunk-VL23Y44O.js +0 -4
  366. package/dist/standalone/chunk-VXM5H542.js +0 -4
  367. package/dist/standalone/chunk-WMDH2CIZ.js +0 -1
  368. package/dist/standalone/chunk-WVTPZ6CM.js +0 -1
  369. package/dist/standalone/chunk-XN6QYJQ6.js +0 -13
  370. package/dist/standalone/chunk-XNJNSCLM.js +0 -1
  371. package/dist/standalone/chunk-Y4U6CC22.js +0 -1
  372. package/dist/standalone/chunk-Y572GMZE.js +0 -1
  373. package/dist/standalone/chunk-Y7PD5KP4.js +0 -76
  374. package/dist/standalone/chunk-YFIPHCEC.js +0 -1
  375. package/dist/standalone/chunk-YJXOWLFJ.js +0 -1
  376. package/dist/standalone/chunk-YNN6NFRZ.js +0 -1
  377. package/dist/standalone/chunk-YUGHRVPD.js +0 -1
  378. package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
  379. package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
  380. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  381. /package/dist/standalone/{chunk-TEWVD66F.js → chunk-GXZAXNZI.js} +0 -0
@@ -1,2127 +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, j as dispatchByKind, c as callOptions, a as adminRef } from './internal-DzHCc2Rq.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-CZnpHILL.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
- value = await dispatchByKind(client, operation.kind, adminRef(operation.functionPath), parsedArgs, callOptions(shardKey));
870
- }
871
- setResponse(value);
872
- setDurationMs(Math.round(performance.now() - startedAt));
873
- setStatus("success");
874
- } catch (runError) {
875
- setResponse(void 0);
876
- setDurationMs(Math.round(performance.now() - startedAt));
877
- setError(errorMessage(runError));
878
- setStatus("error");
879
- }
880
- };
881
- const onSend = () => {
882
- fireAndForget(send());
883
- };
884
- const value_0 = {
885
- argsText,
886
- durationMs,
887
- error,
888
- operation,
889
- response,
890
- send: onSend,
891
- setArgsText,
892
- setShardKey,
893
- shardKey,
894
- status
895
- };
896
- return /* @__PURE__ */ jsxDEV(OperationRunContext, {
897
- value: value_0,
898
- children
899
- }, void 0, false);
900
- };
901
-
902
- const TryIt = () => {
903
- const $ = c(48);
904
- const t = useT();
905
- const {
906
- argsText,
907
- operation,
908
- send,
909
- setArgsText,
910
- setShardKey,
911
- shardKey,
912
- status
913
- } = useOperationRun();
914
- let t0;
915
- if ($[0] !== setArgsText) {
916
- t0 = (event) => {
917
- setArgsText(event.target.value);
918
- };
919
- $[0] = setArgsText;
920
- $[1] = t0;
921
- } else {
922
- t0 = $[1];
923
- }
924
- const onArgsChange = t0;
925
- let t1;
926
- if ($[2] !== send) {
927
- t1 = (event_0) => {
928
- if (event_0.key === "Enter" && (event_0.metaKey || event_0.ctrlKey)) {
929
- event_0.preventDefault();
930
- send();
931
- }
932
- };
933
- $[2] = send;
934
- $[3] = t1;
935
- } else {
936
- t1 = $[3];
937
- }
938
- const onArgsKeyDown = t1;
939
- const running = status === "running";
940
- let t2;
941
- if ($[4] !== operation.kind || $[5] !== operation.method) {
942
- t2 = /* @__PURE__ */ jsxDEV(MethodBadge, {
943
- kind: operation.kind,
944
- method: operation.method,
945
- testId: "api-try-method"
946
- }, void 0, false);
947
- $[4] = operation.kind;
948
- $[5] = operation.method;
949
- $[6] = t2;
950
- } else {
951
- t2 = $[6];
952
- }
953
- const t3 = operation.functionPath ?? operation.httpPath;
954
- let t4;
955
- if ($[7] !== t3) {
956
- t4 = /* @__PURE__ */ jsxDEV("code", {
957
- className: "min-w-0 flex-1 truncate font-mono text-xs text-foreground",
958
- children: t3
959
- }, void 0, false);
960
- $[7] = t3;
961
- $[8] = t4;
962
- } else {
963
- t4 = $[8];
964
- }
965
- const t5 = running ? "animate-pulse" : void 0;
966
- let t6;
967
- if ($[9] !== t5) {
968
- t6 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
969
- className: t5,
970
- icon: SentIcon,
971
- strokeWidth: 2
972
- }, void 0, false);
973
- $[9] = t5;
974
- $[10] = t6;
975
- } else {
976
- t6 = $[10];
977
- }
978
- let t7;
979
- if ($[11] !== running || $[12] !== t) {
980
- t7 = running ? t("Sending…") : t("Send");
981
- $[11] = running;
982
- $[12] = t;
983
- $[13] = t7;
984
- } else {
985
- t7 = $[13];
986
- }
987
- let t8;
988
- if ($[14] !== running || $[15] !== send || $[16] !== t6 || $[17] !== t7) {
989
- t8 = /* @__PURE__ */ jsxDEV(Button, {
990
- "data-testid": "api-try-send",
991
- disabled: running,
992
- onClick: send,
993
- size: "sm",
994
- type: "button",
995
- children: [t6, t7]
996
- }, void 0, true);
997
- $[14] = running;
998
- $[15] = send;
999
- $[16] = t6;
1000
- $[17] = t7;
1001
- $[18] = t8;
1002
- } else {
1003
- t8 = $[18];
1004
- }
1005
- let t9;
1006
- if ($[19] !== t2 || $[20] !== t4 || $[21] !== t8) {
1007
- t9 = /* @__PURE__ */ jsxDEV("div", {
1008
- className: "flex items-center gap-2 border-b border-border bg-muted px-3 py-2",
1009
- children: [t2, t4, t8]
1010
- }, void 0, true);
1011
- $[19] = t2;
1012
- $[20] = t4;
1013
- $[21] = t8;
1014
- $[22] = t9;
1015
- } else {
1016
- t9 = $[22];
1017
- }
1018
- let t10;
1019
- if ($[23] !== t) {
1020
- t10 = t("Arguments (JSON)");
1021
- $[23] = t;
1022
- $[24] = t10;
1023
- } else {
1024
- t10 = $[24];
1025
- }
1026
- let t11;
1027
- if ($[25] !== t10) {
1028
- t11 = /* @__PURE__ */ jsxDEV(Label, {
1029
- htmlFor: "api-try-args",
1030
- children: t10
1031
- }, void 0, false);
1032
- $[25] = t10;
1033
- $[26] = t11;
1034
- } else {
1035
- t11 = $[26];
1036
- }
1037
- let t12;
1038
- if ($[27] !== argsText) {
1039
- t12 = argsText.split("\n");
1040
- $[27] = argsText;
1041
- $[28] = t12;
1042
- } else {
1043
- t12 = $[28];
1044
- }
1045
- const t13 = Math.min(12, Math.max(3, t12.length));
1046
- let t14;
1047
- if ($[29] !== argsText || $[30] !== onArgsChange || $[31] !== onArgsKeyDown || $[32] !== t13) {
1048
- t14 = /* @__PURE__ */ jsxDEV(Textarea, {
1049
- className: "font-mono text-xs",
1050
- "data-testid": "api-try-args",
1051
- id: "api-try-args",
1052
- onChange: onArgsChange,
1053
- onKeyDown: onArgsKeyDown,
1054
- rows: t13,
1055
- spellCheck: false,
1056
- value: argsText
1057
- }, void 0, false);
1058
- $[29] = argsText;
1059
- $[30] = onArgsChange;
1060
- $[31] = onArgsKeyDown;
1061
- $[32] = t13;
1062
- $[33] = t14;
1063
- } else {
1064
- t14 = $[33];
1065
- }
1066
- let t15;
1067
- if ($[34] !== t11 || $[35] !== t14) {
1068
- t15 = /* @__PURE__ */ jsxDEV("div", {
1069
- className: "flex flex-col gap-1.5",
1070
- children: [t11, t14]
1071
- }, void 0, true);
1072
- $[34] = t11;
1073
- $[35] = t14;
1074
- $[36] = t15;
1075
- } else {
1076
- t15 = $[36];
1077
- }
1078
- let t16;
1079
- if ($[37] !== operation.functionPath || $[38] !== setShardKey || $[39] !== shardKey || $[40] !== t) {
1080
- t16 = operation.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("div", {
1081
- className: "flex flex-col gap-1.5",
1082
- children: [/* @__PURE__ */ jsxDEV(Label, {
1083
- htmlFor: "shard-input",
1084
- children: t("Shard key (optional)")
1085
- }, void 0, false), /* @__PURE__ */ jsxDEV(ShardInput, {
1086
- id: "shard-input",
1087
- onChange: setShardKey,
1088
- testId: "shard-input",
1089
- value: shardKey
1090
- }, void 0, false)]
1091
- }, void 0, true);
1092
- $[37] = operation.functionPath;
1093
- $[38] = setShardKey;
1094
- $[39] = shardKey;
1095
- $[40] = t;
1096
- $[41] = t16;
1097
- } else {
1098
- t16 = $[41];
1099
- }
1100
- let t17;
1101
- if ($[42] !== t15 || $[43] !== t16) {
1102
- t17 = /* @__PURE__ */ jsxDEV("div", {
1103
- className: "flex flex-col gap-3 p-3",
1104
- children: [t15, t16]
1105
- }, void 0, true);
1106
- $[42] = t15;
1107
- $[43] = t16;
1108
- $[44] = t17;
1109
- } else {
1110
- t17 = $[44];
1111
- }
1112
- let t18;
1113
- if ($[45] !== t17 || $[46] !== t9) {
1114
- t18 = /* @__PURE__ */ jsxDEV("div", {
1115
- className: "overflow-hidden rounded-xl border border-border bg-card",
1116
- "data-testid": "api-try-it",
1117
- children: [t9, t17]
1118
- }, void 0, true);
1119
- $[45] = t17;
1120
- $[46] = t9;
1121
- $[47] = t18;
1122
- } else {
1123
- t18 = $[47];
1124
- }
1125
- return t18;
1126
- };
1127
-
1128
- const OperationView = (t0) => {
1129
- const $ = c(51);
1130
- const {
1131
- operation
1132
- } = t0;
1133
- const t = useT();
1134
- const t1 = `api-operation-${operation.operationId}`;
1135
- const t2 = operation.key;
1136
- let t3;
1137
- if ($[0] !== operation.kind || $[1] !== operation.method) {
1138
- t3 = /* @__PURE__ */ jsxDEV(MethodBadge, {
1139
- kind: operation.kind,
1140
- method: operation.method,
1141
- testId: "api-operation-method"
1142
- }, void 0, false);
1143
- $[0] = operation.kind;
1144
- $[1] = operation.method;
1145
- $[2] = t3;
1146
- } else {
1147
- t3 = $[2];
1148
- }
1149
- const t4 = operation.functionPath ?? operation.httpPath;
1150
- let t5;
1151
- if ($[3] !== t4) {
1152
- t5 = /* @__PURE__ */ jsxDEV("code", {
1153
- className: "truncate font-mono text-xs text-muted-foreground",
1154
- children: t4
1155
- }, void 0, false);
1156
- $[3] = t4;
1157
- $[4] = t5;
1158
- } else {
1159
- t5 = $[4];
1160
- }
1161
- let t6;
1162
- if ($[5] !== t3 || $[6] !== t5) {
1163
- t6 = /* @__PURE__ */ jsxDEV("div", {
1164
- className: "flex items-center gap-2",
1165
- children: [t3, t5]
1166
- }, void 0, true);
1167
- $[5] = t3;
1168
- $[6] = t5;
1169
- $[7] = t6;
1170
- } else {
1171
- t6 = $[7];
1172
- }
1173
- let t7;
1174
- if ($[8] !== operation.title) {
1175
- t7 = /* @__PURE__ */ jsxDEV("h1", {
1176
- className: "text-lg font-semibold text-foreground",
1177
- "data-testid": "api-operation-title",
1178
- children: operation.title
1179
- }, void 0, false);
1180
- $[8] = operation.title;
1181
- $[9] = t7;
1182
- } else {
1183
- t7 = $[9];
1184
- }
1185
- let t8;
1186
- if ($[10] !== operation.description) {
1187
- t8 = operation.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1188
- className: "text-sm text-muted-foreground",
1189
- children: operation.description
1190
- }, void 0, false);
1191
- $[10] = operation.description;
1192
- $[11] = t8;
1193
- } else {
1194
- t8 = $[11];
1195
- }
1196
- let t9;
1197
- if ($[12] !== t6 || $[13] !== t7 || $[14] !== t8) {
1198
- t9 = /* @__PURE__ */ jsxDEV("header", {
1199
- 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",
1200
- children: [t6, t7, t8]
1201
- }, void 0, true);
1202
- $[12] = t6;
1203
- $[13] = t7;
1204
- $[14] = t8;
1205
- $[15] = t9;
1206
- } else {
1207
- t9 = $[15];
1208
- }
1209
- let t10;
1210
- if ($[16] !== t) {
1211
- t10 = t("Try it");
1212
- $[16] = t;
1213
- $[17] = t10;
1214
- } else {
1215
- t10 = $[17];
1216
- }
1217
- let t11;
1218
- if ($[18] !== t10) {
1219
- t11 = /* @__PURE__ */ jsxDEV("h2", {
1220
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1221
- children: t10
1222
- }, void 0, false);
1223
- $[18] = t10;
1224
- $[19] = t11;
1225
- } else {
1226
- t11 = $[19];
1227
- }
1228
- let t12;
1229
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1230
- t12 = /* @__PURE__ */ jsxDEV(TryIt, {}, void 0, false);
1231
- $[20] = t12;
1232
- } else {
1233
- t12 = $[20];
1234
- }
1235
- let t13;
1236
- if ($[21] !== t11) {
1237
- t13 = /* @__PURE__ */ jsxDEV("section", {
1238
- className: "flex flex-col gap-2",
1239
- children: [t11, t12]
1240
- }, void 0, true);
1241
- $[21] = t11;
1242
- $[22] = t13;
1243
- } else {
1244
- t13 = $[22];
1245
- }
1246
- let t14;
1247
- if ($[23] !== t) {
1248
- t14 = t("Request arguments");
1249
- $[23] = t;
1250
- $[24] = t14;
1251
- } else {
1252
- t14 = $[24];
1253
- }
1254
- let t15;
1255
- if ($[25] !== t14) {
1256
- t15 = /* @__PURE__ */ jsxDEV("h2", {
1257
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1258
- children: t14
1259
- }, void 0, false);
1260
- $[25] = t14;
1261
- $[26] = t15;
1262
- } else {
1263
- t15 = $[26];
1264
- }
1265
- let t16;
1266
- if ($[27] !== operation.argsSchema) {
1267
- t16 = /* @__PURE__ */ jsxDEV(SchemaTable, {
1268
- schema: operation.argsSchema,
1269
- testId: "api-operation-args"
1270
- }, void 0, false);
1271
- $[27] = operation.argsSchema;
1272
- $[28] = t16;
1273
- } else {
1274
- t16 = $[28];
1275
- }
1276
- let t17;
1277
- if ($[29] !== t15 || $[30] !== t16) {
1278
- t17 = /* @__PURE__ */ jsxDEV("section", {
1279
- className: "flex flex-col gap-2",
1280
- children: [t15, t16]
1281
- }, void 0, true);
1282
- $[29] = t15;
1283
- $[30] = t16;
1284
- $[31] = t17;
1285
- } else {
1286
- t17 = $[31];
1287
- }
1288
- let t18;
1289
- if ($[32] !== t) {
1290
- t18 = t("Response body");
1291
- $[32] = t;
1292
- $[33] = t18;
1293
- } else {
1294
- t18 = $[33];
1295
- }
1296
- let t19;
1297
- if ($[34] !== t18) {
1298
- t19 = /* @__PURE__ */ jsxDEV("h2", {
1299
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1300
- children: t18
1301
- }, void 0, false);
1302
- $[34] = t18;
1303
- $[35] = t19;
1304
- } else {
1305
- t19 = $[35];
1306
- }
1307
- let t20;
1308
- if ($[36] !== operation.responses || $[37] !== t) {
1309
- let t212;
1310
- if ($[39] !== t) {
1311
- t212 = (response) => /* @__PURE__ */ jsxDEV("div", {
1312
- className: "flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",
1313
- children: [/* @__PURE__ */ jsxDEV("div", {
1314
- className: "flex items-center justify-between gap-2",
1315
- children: [/* @__PURE__ */ jsxDEV("span", {
1316
- className: `inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${statusToneClass(response.status)}`,
1317
- children: [/* @__PURE__ */ jsxDEV("span", {
1318
- className: `size-1.5 rounded-full ${statusDotClass(response.status)}`
1319
- }, void 0, false), response.status]
1320
- }, void 0, true), response.schema !== void 0 && /* @__PURE__ */ jsxDEV("span", {
1321
- className: "rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",
1322
- children: t("application/json")
1323
- }, void 0, false)]
1324
- }, void 0, true), response.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1325
- className: "text-xs text-muted-foreground",
1326
- children: response.description
1327
- }, void 0, false), response.schema !== void 0 && /* @__PURE__ */ jsxDEV(SchemaTable, {
1328
- schema: response.schema,
1329
- testId: `api-response-${response.status}`
1330
- }, void 0, false)]
1331
- }, response.status, true);
1332
- $[39] = t;
1333
- $[40] = t212;
1334
- } else {
1335
- t212 = $[40];
1336
- }
1337
- t20 = operation.responses.map(t212);
1338
- $[36] = operation.responses;
1339
- $[37] = t;
1340
- $[38] = t20;
1341
- } else {
1342
- t20 = $[38];
1343
- }
1344
- let t21;
1345
- if ($[41] !== t19 || $[42] !== t20) {
1346
- t21 = /* @__PURE__ */ jsxDEV("section", {
1347
- className: "flex flex-col gap-3",
1348
- children: [t19, t20]
1349
- }, void 0, true);
1350
- $[41] = t19;
1351
- $[42] = t20;
1352
- $[43] = t21;
1353
- } else {
1354
- t21 = $[43];
1355
- }
1356
- let t22;
1357
- if ($[44] !== operation.key || $[45] !== t1 || $[46] !== t13 || $[47] !== t17 || $[48] !== t21 || $[49] !== t9) {
1358
- t22 = /* @__PURE__ */ jsxDEV("div", {
1359
- className: "flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1",
1360
- "data-testid": t1,
1361
- children: [t9, t13, t17, t21]
1362
- }, t2, true);
1363
- $[44] = operation.key;
1364
- $[45] = t1;
1365
- $[46] = t13;
1366
- $[47] = t17;
1367
- $[48] = t21;
1368
- $[49] = t9;
1369
- $[50] = t22;
1370
- } else {
1371
- t22 = $[50];
1372
- }
1373
- return t22;
1374
- };
1375
-
1376
- const KIND_CLASS = {
1377
- boolean: "text-royal-amethyst",
1378
- key: "text-sky-sapphire",
1379
- number: "text-warning",
1380
- plain: "",
1381
- string: "text-success"
1382
- };
1383
- const TOKEN = /"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g;
1384
- const COLON_AHEAD = /^\s*:/;
1385
- const classify = (code, end, text) => {
1386
- if (text.startsWith('"')) {
1387
- return COLON_AHEAD.test(code.slice(end)) ? "key" : "string";
1388
- }
1389
- if (text === "true" || text === "false" || text === "null") {
1390
- return "boolean";
1391
- }
1392
- return "number";
1393
- };
1394
- const tokenize = (code) => {
1395
- const tokens = [];
1396
- let lastIndex = 0;
1397
- for (const match of code.matchAll(TOKEN)) {
1398
- const {
1399
- index
1400
- } = match;
1401
- const text = match[0];
1402
- const end = index + text.length;
1403
- if (index > lastIndex) {
1404
- tokens.push({
1405
- kind: "plain",
1406
- start: lastIndex,
1407
- text: code.slice(lastIndex, index)
1408
- });
1409
- }
1410
- tokens.push({
1411
- kind: classify(code, end, text),
1412
- start: index,
1413
- text
1414
- });
1415
- lastIndex = end;
1416
- }
1417
- if (lastIndex < code.length) {
1418
- tokens.push({
1419
- kind: "plain",
1420
- start: lastIndex,
1421
- text: code.slice(lastIndex)
1422
- });
1423
- }
1424
- return tokens;
1425
- };
1426
- const JsonHighlight = (t0) => {
1427
- const $ = c(4);
1428
- const {
1429
- code
1430
- } = t0;
1431
- let t1;
1432
- if ($[0] !== code) {
1433
- const tokens = tokenize(code);
1434
- t1 = tokens.map(_temp$1);
1435
- $[0] = code;
1436
- $[1] = t1;
1437
- } else {
1438
- t1 = $[1];
1439
- }
1440
- let t2;
1441
- if ($[2] !== t1) {
1442
- t2 = /* @__PURE__ */ jsxDEV(Fragment, {
1443
- children: t1
1444
- }, void 0, false);
1445
- $[2] = t1;
1446
- $[3] = t2;
1447
- } else {
1448
- t2 = $[3];
1449
- }
1450
- return t2;
1451
- };
1452
- function _temp$1(token) {
1453
- return /* @__PURE__ */ jsxDEV("span", {
1454
- className: KIND_CLASS[token.kind],
1455
- children: token.text
1456
- }, token.start, false);
1457
- }
1458
-
1459
- const LIVE_TAB = "__live__";
1460
- const exampleBody = (response) => response.schema === void 0 ? "" : JSON.stringify(exampleForSchema(response.schema), void 0, 2);
1461
- const liveBody = (error, response, failed) => {
1462
- if (failed) {
1463
- return error ?? "";
1464
- }
1465
- return response === void 0 ? "" : JSON.stringify(response, void 0, 2);
1466
- };
1467
- const ResponseBody = (t0) => {
1468
- const $ = c(18);
1469
- const {
1470
- active,
1471
- running,
1472
- showError
1473
- } = t0;
1474
- const t = useT();
1475
- if (running) {
1476
- let t12;
1477
- if ($[0] !== t) {
1478
- t12 = t("Sending…");
1479
- $[0] = t;
1480
- $[1] = t12;
1481
- } else {
1482
- t12 = $[1];
1483
- }
1484
- let t22;
1485
- if ($[2] !== t12) {
1486
- t22 = /* @__PURE__ */ jsxDEV("p", {
1487
- className: "px-3 py-3 text-xs text-muted-foreground",
1488
- "data-testid": "api-response-running",
1489
- children: t12
1490
- }, void 0, false);
1491
- $[2] = t12;
1492
- $[3] = t22;
1493
- } else {
1494
- t22 = $[3];
1495
- }
1496
- return t22;
1497
- }
1498
- if (active === void 0 || active.body === "") {
1499
- let t12;
1500
- if ($[4] !== active?.live || $[5] !== t) {
1501
- t12 = active?.live === true ? t("Send a request to see the response.") : t("No example for this response.");
1502
- $[4] = active?.live;
1503
- $[5] = t;
1504
- $[6] = t12;
1505
- } else {
1506
- t12 = $[6];
1507
- }
1508
- let t22;
1509
- if ($[7] !== t12) {
1510
- t22 = /* @__PURE__ */ jsxDEV("p", {
1511
- className: "px-3 py-3 text-xs text-muted-foreground",
1512
- "data-testid": "api-response-idle",
1513
- children: t12
1514
- }, void 0, false);
1515
- $[7] = t12;
1516
- $[8] = t22;
1517
- } else {
1518
- t22 = $[8];
1519
- }
1520
- return t22;
1521
- }
1522
- const t1 = showError && "text-destructive";
1523
- let t2;
1524
- if ($[9] !== t1) {
1525
- t2 = cn("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs", t1);
1526
- $[9] = t1;
1527
- $[10] = t2;
1528
- } else {
1529
- t2 = $[10];
1530
- }
1531
- const t3 = showError ? "api-response-error" : "api-response-body";
1532
- let t4;
1533
- if ($[11] !== active.body || $[12] !== showError) {
1534
- t4 = showError ? active.body : /* @__PURE__ */ jsxDEV(JsonHighlight, {
1535
- code: active.body
1536
- }, void 0, false);
1537
- $[11] = active.body;
1538
- $[12] = showError;
1539
- $[13] = t4;
1540
- } else {
1541
- t4 = $[13];
1542
- }
1543
- let t5;
1544
- if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
1545
- t5 = /* @__PURE__ */ jsxDEV("pre", {
1546
- className: t2,
1547
- "data-testid": t3,
1548
- children: t4
1549
- }, void 0, false);
1550
- $[14] = t2;
1551
- $[15] = t3;
1552
- $[16] = t4;
1553
- $[17] = t5;
1554
- } else {
1555
- t5 = $[17];
1556
- }
1557
- return t5;
1558
- };
1559
- const ResponsePanel = () => {
1560
- const $ = c(67);
1561
- const t = useT();
1562
- const {
1563
- durationMs,
1564
- error,
1565
- operation,
1566
- response,
1567
- status
1568
- } = useOperationRun();
1569
- const running = status === "running";
1570
- const failed = status === "error";
1571
- const ran = status === "success" || failed;
1572
- let t0;
1573
- if ($[0] !== durationMs || $[1] !== error || $[2] !== failed || $[3] !== operation.responses || $[4] !== ran || $[5] !== response || $[6] !== t) {
1574
- bb0: {
1575
- const documented = operation.responses.map(_temp);
1576
- if (!ran) {
1577
- t0 = documented;
1578
- break bb0;
1579
- }
1580
- let t14;
1581
- if ($[8] !== error || $[9] !== failed || $[10] !== response) {
1582
- t14 = liveBody(error, response, failed);
1583
- $[8] = error;
1584
- $[9] = failed;
1585
- $[10] = response;
1586
- $[11] = t14;
1587
- } else {
1588
- t14 = $[11];
1589
- }
1590
- let t22;
1591
- if ($[12] !== t) {
1592
- t22 = t("Live");
1593
- $[12] = t;
1594
- $[13] = t22;
1595
- } else {
1596
- t22 = $[13];
1597
- }
1598
- const t32 = failed ? "error" : "200";
1599
- let t42;
1600
- if ($[14] !== durationMs || $[15] !== t14 || $[16] !== t22 || $[17] !== t32) {
1601
- t42 = {
1602
- body: t14,
1603
- durationMs,
1604
- id: LIVE_TAB,
1605
- label: t22,
1606
- live: true,
1607
- status: t32
1608
- };
1609
- $[14] = durationMs;
1610
- $[15] = t14;
1611
- $[16] = t22;
1612
- $[17] = t32;
1613
- $[18] = t42;
1614
- } else {
1615
- t42 = $[18];
1616
- }
1617
- const live = t42;
1618
- t0 = [live, ...documented];
1619
- }
1620
- $[0] = durationMs;
1621
- $[1] = error;
1622
- $[2] = failed;
1623
- $[3] = operation.responses;
1624
- $[4] = ran;
1625
- $[5] = response;
1626
- $[6] = t;
1627
- $[7] = t0;
1628
- } else {
1629
- t0 = $[7];
1630
- }
1631
- const tabs = t0;
1632
- let t1;
1633
- if ($[19] !== ran || $[20] !== tabs) {
1634
- t1 = ran ? LIVE_TAB : tabs.find(_temp2)?.id ?? tabs[0]?.id ?? "";
1635
- $[19] = ran;
1636
- $[20] = tabs;
1637
- $[21] = t1;
1638
- } else {
1639
- t1 = $[21];
1640
- }
1641
- const defaultId = t1;
1642
- const [picked, setPicked] = useState(null);
1643
- let active;
1644
- let onCopy;
1645
- let onSelect;
1646
- let showError;
1647
- let t2;
1648
- let t3;
1649
- let t4;
1650
- let t5;
1651
- let t6;
1652
- let t7;
1653
- if ($[22] !== defaultId || $[23] !== picked || $[24] !== t || $[25] !== tabs) {
1654
- active = tabs.find((tab_0) => tab_0.id === (picked ?? defaultId)) ?? tabs[0];
1655
- let t82;
1656
- if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1657
- t82 = (event) => {
1658
- const {
1659
- id
1660
- } = event.currentTarget.dataset;
1661
- if (id !== void 0) {
1662
- setPicked(id);
1663
- }
1664
- };
1665
- $[36] = t82;
1666
- } else {
1667
- t82 = $[36];
1668
- }
1669
- onSelect = t82;
1670
- onCopy = () => {
1671
- if (active !== void 0) {
1672
- copyToClipboard(active.body);
1673
- }
1674
- };
1675
- const liveDurationMs = active?.live === true ? active.durationMs : null;
1676
- showError = active?.live === true && active.status === "error";
1677
- t6 = "flex min-h-0 flex-col rounded-xl border border-border bg-card";
1678
- t7 = "api-response-panel";
1679
- t4 = "flex items-center justify-between gap-2 border-b border-border px-3 py-2";
1680
- let t92;
1681
- if ($[37] !== t) {
1682
- t92 = t("Response");
1683
- $[37] = t;
1684
- $[38] = t92;
1685
- } else {
1686
- t92 = $[38];
1687
- }
1688
- if ($[39] !== t92) {
1689
- t5 = /* @__PURE__ */ jsxDEV("span", {
1690
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1691
- children: t92
1692
- }, void 0, false);
1693
- $[39] = t92;
1694
- $[40] = t5;
1695
- } else {
1696
- t5 = $[40];
1697
- }
1698
- t2 = "flex items-center gap-2";
1699
- t3 = liveDurationMs !== null && /* @__PURE__ */ jsxDEV("span", {
1700
- className: "font-mono text-[10px] text-muted-foreground",
1701
- children: t("{ms} ms", {
1702
- ms: liveDurationMs
1703
- })
1704
- }, void 0, false);
1705
- $[22] = defaultId;
1706
- $[23] = picked;
1707
- $[24] = t;
1708
- $[25] = tabs;
1709
- $[26] = active;
1710
- $[27] = onCopy;
1711
- $[28] = onSelect;
1712
- $[29] = showError;
1713
- $[30] = t2;
1714
- $[31] = t3;
1715
- $[32] = t4;
1716
- $[33] = t5;
1717
- $[34] = t6;
1718
- $[35] = t7;
1719
- } else {
1720
- active = $[26];
1721
- onCopy = $[27];
1722
- onSelect = $[28];
1723
- showError = $[29];
1724
- t2 = $[30];
1725
- t3 = $[31];
1726
- t4 = $[32];
1727
- t5 = $[33];
1728
- t6 = $[34];
1729
- t7 = $[35];
1730
- }
1731
- let t8;
1732
- if ($[41] !== active || $[42] !== onCopy || $[43] !== t) {
1733
- t8 = active !== void 0 && active.body !== "" && /* @__PURE__ */ jsxDEV(Button, {
1734
- "aria-label": t("Copy"),
1735
- "data-testid": "api-response-copy",
1736
- onClick: onCopy,
1737
- size: "icon-xs",
1738
- type: "button",
1739
- variant: "ghost",
1740
- children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1741
- icon: Copy01Icon,
1742
- strokeWidth: 2
1743
- }, void 0, false)
1744
- }, void 0, false);
1745
- $[41] = active;
1746
- $[42] = onCopy;
1747
- $[43] = t;
1748
- $[44] = t8;
1749
- } else {
1750
- t8 = $[44];
1751
- }
1752
- let t9;
1753
- if ($[45] !== t2 || $[46] !== t3 || $[47] !== t8) {
1754
- t9 = /* @__PURE__ */ jsxDEV("div", {
1755
- className: t2,
1756
- children: [t3, t8]
1757
- }, void 0, true);
1758
- $[45] = t2;
1759
- $[46] = t3;
1760
- $[47] = t8;
1761
- $[48] = t9;
1762
- } else {
1763
- t9 = $[48];
1764
- }
1765
- let t10;
1766
- if ($[49] !== t4 || $[50] !== t5 || $[51] !== t9) {
1767
- t10 = /* @__PURE__ */ jsxDEV("div", {
1768
- className: t4,
1769
- children: [t5, t9]
1770
- }, void 0, true);
1771
- $[49] = t4;
1772
- $[50] = t5;
1773
- $[51] = t9;
1774
- $[52] = t10;
1775
- } else {
1776
- t10 = $[52];
1777
- }
1778
- let t11;
1779
- if ($[53] !== active?.id || $[54] !== onSelect || $[55] !== tabs) {
1780
- t11 = tabs.length > 0 && /* @__PURE__ */ jsxDEV("div", {
1781
- className: "flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",
1782
- role: "tablist",
1783
- children: tabs.map((tab_1) => {
1784
- const selected = tab_1.id === active?.id;
1785
- return /* @__PURE__ */ jsxDEV("button", {
1786
- "aria-selected": selected,
1787
- 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"),
1788
- "data-id": tab_1.id,
1789
- "data-testid": tab_1.live ? "api-response-tab-live" : `api-response-tab-${tab_1.status}`,
1790
- onClick: onSelect,
1791
- role: "tab",
1792
- type: "button",
1793
- children: [/* @__PURE__ */ jsxDEV("span", {
1794
- className: `size-1.5 rounded-full ${statusDotClass(tab_1.status)}`
1795
- }, void 0, false), tab_1.label]
1796
- }, tab_1.id, true);
1797
- })
1798
- }, void 0, false);
1799
- $[53] = active?.id;
1800
- $[54] = onSelect;
1801
- $[55] = tabs;
1802
- $[56] = t11;
1803
- } else {
1804
- t11 = $[56];
1805
- }
1806
- let t12;
1807
- if ($[57] !== active || $[58] !== running || $[59] !== showError) {
1808
- t12 = /* @__PURE__ */ jsxDEV(ResponseBody, {
1809
- active,
1810
- running,
1811
- showError
1812
- }, void 0, false);
1813
- $[57] = active;
1814
- $[58] = running;
1815
- $[59] = showError;
1816
- $[60] = t12;
1817
- } else {
1818
- t12 = $[60];
1819
- }
1820
- let t13;
1821
- if ($[61] !== t10 || $[62] !== t11 || $[63] !== t12 || $[64] !== t6 || $[65] !== t7) {
1822
- t13 = /* @__PURE__ */ jsxDEV("div", {
1823
- className: t6,
1824
- "data-testid": t7,
1825
- children: [t10, t11, t12]
1826
- }, void 0, true);
1827
- $[61] = t10;
1828
- $[62] = t11;
1829
- $[63] = t12;
1830
- $[64] = t6;
1831
- $[65] = t7;
1832
- $[66] = t13;
1833
- } else {
1834
- t13 = $[66];
1835
- }
1836
- return t13;
1837
- };
1838
- function _temp(entry) {
1839
- return {
1840
- body: exampleBody(entry),
1841
- durationMs: null,
1842
- id: entry.status,
1843
- label: entry.status,
1844
- live: false,
1845
- status: entry.status
1846
- };
1847
- }
1848
- function _temp2(tab) {
1849
- return tab.status.startsWith("2");
1850
- }
1851
-
1852
- const filterGroups = (groups, query) => {
1853
- const needle = query.trim().toLowerCase();
1854
- if (needle === "") {
1855
- return groups;
1856
- }
1857
- return groups.map((group) => {
1858
- return {
1859
- ...group,
1860
- operations: group.operations.filter((operation) => `${operation.summary} ${operation.operationId}`.toLowerCase().includes(needle))
1861
- };
1862
- }).filter((group) => group.operations.length > 0);
1863
- };
1864
- const ReferenceView = (t0) => {
1865
- const $ = c(53);
1866
- const {
1867
- model
1868
- } = t0;
1869
- const t = useT();
1870
- const firstKey = model.groups[0]?.operations[0]?.key ?? "";
1871
- const [selectedKey, setSelectedKey] = useState(firstKey);
1872
- const [filter, setFilter] = useState("");
1873
- let t1;
1874
- if ($[0] !== firstKey || $[1] !== model.operationByKey || $[2] !== selectedKey) {
1875
- t1 = model.operationByKey.get(selectedKey) ?? model.operationByKey.get(firstKey);
1876
- $[0] = firstKey;
1877
- $[1] = model.operationByKey;
1878
- $[2] = selectedKey;
1879
- $[3] = t1;
1880
- } else {
1881
- t1 = $[3];
1882
- }
1883
- const selected = t1;
1884
- let groups;
1885
- let server;
1886
- let t2;
1887
- let t3;
1888
- let t4;
1889
- let t5;
1890
- let t6;
1891
- let t7;
1892
- let t8;
1893
- let t9;
1894
- if ($[4] !== filter || $[5] !== model.groups || $[6] !== model.server || $[7] !== selected?.key || $[8] !== t) {
1895
- groups = filterGroups(model.groups, filter);
1896
- let t102;
1897
- if ($[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1898
- t102 = (event) => {
1899
- const {
1900
- key
1901
- } = event.currentTarget.dataset;
1902
- if (key !== void 0) {
1903
- setSelectedKey(key);
1904
- }
1905
- };
1906
- $[19] = t102;
1907
- } else {
1908
- t102 = $[19];
1909
- }
1910
- const onSelect = t102;
1911
- let t112;
1912
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1913
- t112 = (event_0) => {
1914
- setFilter(event_0.target.value);
1915
- };
1916
- $[20] = t112;
1917
- } else {
1918
- t112 = $[20];
1919
- }
1920
- const onFilterChange = t112;
1921
- server = model.server ?? "";
1922
- t8 = "grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]";
1923
- t9 = "api-reference";
1924
- if ($[21] !== t) {
1925
- t4 = t("API operations");
1926
- $[21] = t;
1927
- $[22] = t4;
1928
- } else {
1929
- t4 = $[22];
1930
- }
1931
- t5 = "flex min-h-0 flex-col overflow-y-auto border-r border-border";
1932
- t6 = "api-reference-nav";
1933
- let t122;
1934
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1935
- t122 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1936
- className: "pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",
1937
- icon: Search01Icon,
1938
- strokeWidth: 2
1939
- }, void 0, false);
1940
- $[23] = t122;
1941
- } else {
1942
- t122 = $[23];
1943
- }
1944
- let t132;
1945
- if ($[24] !== t) {
1946
- t132 = t("Filter operations");
1947
- $[24] = t;
1948
- $[25] = t132;
1949
- } else {
1950
- t132 = $[25];
1951
- }
1952
- if ($[26] !== filter || $[27] !== t132) {
1953
- t7 = /* @__PURE__ */ jsxDEV("div", {
1954
- className: "sticky top-0 z-10 border-b border-border bg-sidebar p-2",
1955
- children: /* @__PURE__ */ jsxDEV("div", {
1956
- className: "relative",
1957
- children: [t122, /* @__PURE__ */ jsxDEV(Input, {
1958
- className: "h-7 pl-7",
1959
- "data-testid": "api-filter",
1960
- onChange: onFilterChange,
1961
- placeholder: t132,
1962
- value: filter
1963
- }, void 0, false)]
1964
- }, void 0, true)
1965
- }, void 0, false);
1966
- $[26] = filter;
1967
- $[27] = t132;
1968
- $[28] = t7;
1969
- } else {
1970
- t7 = $[28];
1971
- }
1972
- t2 = "flex flex-col gap-4 p-2";
1973
- let t142;
1974
- if ($[29] !== selected?.key || $[30] !== t) {
1975
- t142 = (group) => /* @__PURE__ */ jsxDEV("div", {
1976
- className: "flex flex-col gap-1",
1977
- children: [/* @__PURE__ */ jsxDEV("div", {
1978
- className: "flex items-center justify-between px-2",
1979
- children: [/* @__PURE__ */ jsxDEV("span", {
1980
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1981
- children: group.name || t("(root)")
1982
- }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1983
- className: "font-mono text-[10px] text-muted-foreground/70",
1984
- children: group.operations.length
1985
- }, void 0, false)]
1986
- }, void 0, true), group.operations.map((operation) => {
1987
- const active = operation.key === selected?.key;
1988
- return /* @__PURE__ */ jsxDEV("button", {
1989
- "aria-current": active ? "page" : void 0,
1990
- 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",
1991
- "data-key": operation.key,
1992
- "data-testid": `api-nav-${operation.operationId}`,
1993
- onClick: onSelect,
1994
- type: "button",
1995
- children: [/* @__PURE__ */ jsxDEV("span", {
1996
- className: "truncate",
1997
- children: operation.summary
1998
- }, void 0, false), /* @__PURE__ */ jsxDEV(MethodBadge, {
1999
- kind: operation.kind,
2000
- method: operation.method
2001
- }, void 0, false)]
2002
- }, operation.key, true);
2003
- })]
2004
- }, group.name, true);
2005
- $[29] = selected?.key;
2006
- $[30] = t;
2007
- $[31] = t142;
2008
- } else {
2009
- t142 = $[31];
2010
- }
2011
- t3 = groups.map(t142);
2012
- $[4] = filter;
2013
- $[5] = model.groups;
2014
- $[6] = model.server;
2015
- $[7] = selected?.key;
2016
- $[8] = t;
2017
- $[9] = groups;
2018
- $[10] = server;
2019
- $[11] = t2;
2020
- $[12] = t3;
2021
- $[13] = t4;
2022
- $[14] = t5;
2023
- $[15] = t6;
2024
- $[16] = t7;
2025
- $[17] = t8;
2026
- $[18] = t9;
2027
- } else {
2028
- groups = $[9];
2029
- server = $[10];
2030
- t2 = $[11];
2031
- t3 = $[12];
2032
- t4 = $[13];
2033
- t5 = $[14];
2034
- t6 = $[15];
2035
- t7 = $[16];
2036
- t8 = $[17];
2037
- t9 = $[18];
2038
- }
2039
- let t10;
2040
- if ($[32] !== groups.length || $[33] !== t) {
2041
- t10 = groups.length === 0 && /* @__PURE__ */ jsxDEV("p", {
2042
- className: "px-2 py-1 text-xs text-muted-foreground",
2043
- "data-testid": "api-nav-empty",
2044
- children: t("No operations match your filter.")
2045
- }, void 0, false);
2046
- $[32] = groups.length;
2047
- $[33] = t;
2048
- $[34] = t10;
2049
- } else {
2050
- t10 = $[34];
2051
- }
2052
- let t11;
2053
- if ($[35] !== t10 || $[36] !== t2 || $[37] !== t3) {
2054
- t11 = /* @__PURE__ */ jsxDEV("div", {
2055
- className: t2,
2056
- children: [t3, t10]
2057
- }, void 0, true);
2058
- $[35] = t10;
2059
- $[36] = t2;
2060
- $[37] = t3;
2061
- $[38] = t11;
2062
- } else {
2063
- t11 = $[38];
2064
- }
2065
- let t12;
2066
- if ($[39] !== t11 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7) {
2067
- t12 = /* @__PURE__ */ jsxDEV("nav", {
2068
- "aria-label": t4,
2069
- className: t5,
2070
- "data-testid": t6,
2071
- children: [t7, t11]
2072
- }, void 0, true);
2073
- $[39] = t11;
2074
- $[40] = t4;
2075
- $[41] = t5;
2076
- $[42] = t6;
2077
- $[43] = t7;
2078
- $[44] = t12;
2079
- } else {
2080
- t12 = $[44];
2081
- }
2082
- let t13;
2083
- if ($[45] !== selected || $[46] !== server) {
2084
- t13 = selected === void 0 ? /* @__PURE__ */ jsxDEV("div", {
2085
- className: "lg:col-span-2"
2086
- }, void 0, false) : /* @__PURE__ */ jsxDEV(OperationRunProvider, {
2087
- operation: selected,
2088
- children: [/* @__PURE__ */ jsxDEV("div", {
2089
- className: "min-w-0 overflow-y-auto p-6",
2090
- "data-testid": "api-reference-main",
2091
- children: /* @__PURE__ */ jsxDEV(OperationView, {
2092
- operation: selected
2093
- }, void 0, false)
2094
- }, void 0, false), /* @__PURE__ */ jsxDEV("aside", {
2095
- className: "flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l",
2096
- "data-testid": "api-reference-aside",
2097
- children: [/* @__PURE__ */ jsxDEV(CodeSamples, {
2098
- operation: selected,
2099
- server
2100
- }, void 0, false), /* @__PURE__ */ jsxDEV(ResponsePanel, {}, void 0, false)]
2101
- }, void 0, true)]
2102
- }, selected.key, true);
2103
- $[45] = selected;
2104
- $[46] = server;
2105
- $[47] = t13;
2106
- } else {
2107
- t13 = $[47];
2108
- }
2109
- let t14;
2110
- if ($[48] !== t12 || $[49] !== t13 || $[50] !== t8 || $[51] !== t9) {
2111
- t14 = /* @__PURE__ */ jsxDEV("div", {
2112
- className: t8,
2113
- "data-testid": t9,
2114
- children: [t12, t13]
2115
- }, void 0, true);
2116
- $[48] = t12;
2117
- $[49] = t13;
2118
- $[50] = t8;
2119
- $[51] = t9;
2120
- $[52] = t14;
2121
- } else {
2122
- t14 = $[52];
2123
- }
2124
- return t14;
2125
- };
2126
-
2127
- export { ReferenceView as R, useAdminSpec as u };