@perses-dev/loki-plugin 0.1.0 → 0.1.1

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 (346) hide show
  1. package/LICENSE +201 -0
  2. package/__mf/css/async/1320.7ad02b85.css +1 -0
  3. package/__mf/css/async/2341.7ad02b85.css +1 -0
  4. package/__mf/css/async/9479.7ad02b85.css +1 -0
  5. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  6. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  7. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  8. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  9. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  10. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  11. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  12. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  13. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  17. package/__mf/js/Loki.e3bb11f6.js +6 -0
  18. package/__mf/js/async/1320.ca6d65b6.js +2 -0
  19. package/__mf/js/async/1320.ca6d65b6.js.LICENSE.txt +9 -0
  20. package/__mf/js/async/1540.6b797827.js +74 -0
  21. package/__mf/js/async/1964.7b2e7223.js +2 -0
  22. package/__mf/js/async/1964.7b2e7223.js.LICENSE.txt +9 -0
  23. package/__mf/js/async/2292.35c2eeec.js +2 -0
  24. package/__mf/js/async/2292.35c2eeec.js.LICENSE.txt +24 -0
  25. package/__mf/js/async/2448.6a132c1c.js +10 -0
  26. package/__mf/js/async/2448.6a132c1c.js.LICENSE.txt +17 -0
  27. package/__mf/js/async/2470.32c642b9.js +7 -0
  28. package/__mf/js/async/2470.32c642b9.js.LICENSE.txt +21 -0
  29. package/__mf/js/async/2651.ef335482.js +1 -0
  30. package/__mf/js/async/282.3d82e785.js +1 -0
  31. package/__mf/js/async/3224.b1170acc.js +1 -0
  32. package/__mf/js/async/3246.240e9404.js +1 -0
  33. package/__mf/js/async/3413.6dd92cfd.js +1 -0
  34. package/__mf/js/async/3431.2270637c.js +1 -0
  35. package/__mf/js/async/3849.c4035be2.js +1 -0
  36. package/__mf/js/async/3863.16343b76.js +2 -0
  37. package/__mf/js/async/3863.16343b76.js.LICENSE.txt +9 -0
  38. package/__mf/js/async/3869.4e06bfcb.js +2 -0
  39. package/__mf/js/async/3869.4e06bfcb.js.LICENSE.txt +9 -0
  40. package/__mf/js/async/3960.6091bb00.js +2 -0
  41. package/__mf/js/async/3960.6091bb00.js.LICENSE.txt +8 -0
  42. package/__mf/js/async/3980.08ab4aef.js +2 -0
  43. package/__mf/js/async/3980.08ab4aef.js.LICENSE.txt +9 -0
  44. package/__mf/js/async/4075.ea5435c6.js +1 -0
  45. package/__mf/js/async/4168.645bbaa1.js +2 -0
  46. package/__mf/js/async/4238.ac5f0a30.js +1 -0
  47. package/__mf/js/async/4269.b4d0f49d.js +2 -0
  48. package/__mf/js/async/4269.b4d0f49d.js.LICENSE.txt +9 -0
  49. package/__mf/js/async/4368.438b431f.js +2 -0
  50. package/__mf/js/async/4368.438b431f.js.LICENSE.txt +15 -0
  51. package/__mf/js/async/4421.fef63995.js +1 -0
  52. package/__mf/js/async/4687.1af57d71.js +2 -0
  53. package/__mf/js/async/4687.1af57d71.js.LICENSE.txt +9 -0
  54. package/__mf/js/async/4693.ba67a5aa.js +1 -0
  55. package/__mf/js/async/5214.fee648bb.js +1 -0
  56. package/__mf/js/async/5409.ff95cf63.js +1 -0
  57. package/__mf/js/async/5780.d837c3cd.js +1 -0
  58. package/__mf/js/async/5876.5618763d.js +2 -0
  59. package/__mf/js/async/5876.5618763d.js.LICENSE.txt +21 -0
  60. package/__mf/js/async/592.269748ce.js +1 -0
  61. package/__mf/js/async/5981.a46c5157.js +2 -0
  62. package/__mf/js/async/5981.a46c5157.js.LICENSE.txt +8 -0
  63. package/__mf/js/async/6292.9997ca36.js +1 -0
  64. package/__mf/js/async/6333.01fb6457.js +2 -0
  65. package/__mf/js/async/6333.01fb6457.js.LICENSE.txt +9 -0
  66. package/__mf/js/async/6377.9f308c7f.js +2 -0
  67. package/__mf/js/async/6377.9f308c7f.js.LICENSE.txt +32 -0
  68. package/__mf/js/async/6569.f33ecbef.js +1 -0
  69. package/__mf/js/async/6664.078084ff.js +28 -0
  70. package/__mf/js/async/6770.ba5a38f3.js +1 -0
  71. package/__mf/js/async/694.c25a1f84.js +1 -0
  72. package/__mf/js/async/7152.e8100fb6.js +73 -0
  73. package/__mf/js/async/7152.e8100fb6.js.LICENSE.txt +19 -0
  74. package/__mf/js/async/7376.0459aaf7.js +1 -0
  75. package/__mf/js/async/738.a16c93b6.js +1 -0
  76. package/__mf/js/async/7740.6f193fac.js +1 -0
  77. package/__mf/js/async/8216.d9cc6234.js +1 -0
  78. package/__mf/js/async/8488.5b4b7170.js +1 -0
  79. package/__mf/js/async/8537.dc791586.js +1 -0
  80. package/__mf/js/async/9173.75bbe78a.js +2 -0
  81. package/__mf/js/async/9173.75bbe78a.js.LICENSE.txt +19 -0
  82. package/__mf/js/async/9479.f74b4605.js +1 -0
  83. package/__mf/js/async/9654.575f5449.js +37 -0
  84. package/__mf/js/async/__federation_expose_LogsTable.3952e904.js +2 -0
  85. package/__mf/js/async/__federation_expose_LogsTable.3952e904.js.LICENSE.txt +9 -0
  86. package/__mf/js/async/__federation_expose_LokiDatasource.5fbd8f68.js +2 -0
  87. package/__mf/js/async/__federation_expose_LokiDatasource.5fbd8f68.js.LICENSE.txt +9 -0
  88. package/__mf/js/async/__federation_expose_LokiLogQuery.0720038a.js +1 -0
  89. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.8c7f7602.js +1 -0
  90. package/__mf/js/main.a5b9ede8.js +6 -0
  91. package/lib/bootstrap.d.ts +2 -0
  92. package/lib/bootstrap.d.ts.map +1 -0
  93. package/lib/bootstrap.js +7 -0
  94. package/lib/bootstrap.js.map +1 -0
  95. package/lib/cjs/bootstrap.js +14 -0
  96. package/lib/cjs/components/index.js +23 -0
  97. package/lib/cjs/components/logql-editor.js +110 -0
  98. package/lib/cjs/components/logql-extension.js +55 -0
  99. package/lib/cjs/components/logql-highlight.js +40 -0
  100. package/lib/cjs/datasources/index.js +30 -0
  101. package/lib/cjs/datasources/loki-datasource/LokiDatasource.js +77 -0
  102. package/lib/cjs/datasources/loki-datasource/LokiDatasourceEditor.js +83 -0
  103. package/lib/cjs/datasources/loki-datasource/index.js +32 -0
  104. package/lib/cjs/datasources/loki-datasource/loki-datasource-types.js +16 -0
  105. package/lib/cjs/env.d.js +2 -0
  106. package/lib/cjs/getPluginModule.js +27 -0
  107. package/lib/cjs/index-federation.js +43 -0
  108. package/lib/cjs/index.js +28 -0
  109. package/lib/cjs/model/index.js +31 -0
  110. package/lib/cjs/model/loki-client-types.js +16 -0
  111. package/lib/cjs/model/loki-client.js +198 -0
  112. package/lib/cjs/model/loki-data-types.js +16 -0
  113. package/lib/cjs/model/loki-selectors.js +47 -0
  114. package/lib/cjs/panels/index.js +30 -0
  115. package/lib/cjs/panels/logstable/LogsTable.js +41 -0
  116. package/lib/cjs/panels/logstable/LogsTableComponent.js +43 -0
  117. package/lib/cjs/panels/logstable/LogsTableSettingsEditor.js +70 -0
  118. package/lib/cjs/panels/logstable/components/EmptyLogsState.js +49 -0
  119. package/lib/cjs/panels/logstable/components/LogRow/LogRow.js +158 -0
  120. package/lib/cjs/panels/logstable/components/LogRow/LogTimestamp.js +44 -0
  121. package/lib/cjs/panels/logstable/components/LogRow/LogsLabelsTable.js +74 -0
  122. package/lib/cjs/panels/logstable/components/LogRow/LogsStyles.js +77 -0
  123. package/lib/cjs/panels/logstable/components/LogRow/index.js +37 -0
  124. package/lib/cjs/panels/logstable/components/LogsList.js +44 -0
  125. package/lib/cjs/panels/logstable/components/VirtualizedLogsList.js +63 -0
  126. package/lib/cjs/panels/logstable/components/index.js +23 -0
  127. package/lib/cjs/panels/logstable/components/utils.js +39 -0
  128. package/lib/cjs/panels/logstable/hooks/useExpandedRows.js +45 -0
  129. package/lib/cjs/panels/logstable/hooks/useSeverity.js +43 -0
  130. package/lib/cjs/panels/logstable/index.js +33 -0
  131. package/lib/cjs/panels/logstable/logs-types.js +16 -0
  132. package/lib/cjs/queries/constants.js +22 -0
  133. package/lib/cjs/queries/index.js +31 -0
  134. package/lib/cjs/queries/loki-log-query/LokiLogQuery.js +31 -0
  135. package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +157 -0
  136. package/lib/cjs/queries/loki-log-query/get-loki-log-data.js +74 -0
  137. package/lib/cjs/queries/loki-log-query/index.js +21 -0
  138. package/lib/cjs/queries/loki-log-query/log-query-plugin-interface.js +4 -0
  139. package/lib/cjs/queries/loki-log-query/loki-log-query-types.js +4 -0
  140. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQuery.js +43 -0
  141. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +118 -0
  142. package/lib/cjs/queries/loki-time-series-query/get-loki-time-series-data.js +120 -0
  143. package/lib/cjs/queries/loki-time-series-query/index.js +33 -0
  144. package/lib/cjs/queries/loki-time-series-query/loki-time-series-query-types.js +16 -0
  145. package/lib/cjs/setup-tests.js +7 -0
  146. package/lib/components/index.d.ts +3 -0
  147. package/lib/components/index.d.ts.map +1 -0
  148. package/lib/components/index.js +15 -0
  149. package/lib/components/index.js.map +1 -0
  150. package/lib/components/logql-editor.d.ts +5 -0
  151. package/lib/components/logql-editor.d.ts.map +1 -0
  152. package/lib/components/logql-editor.js +61 -0
  153. package/lib/components/logql-editor.js.map +1 -0
  154. package/lib/components/logql-extension.d.ts +4 -0
  155. package/lib/components/logql-extension.d.ts.map +1 -0
  156. package/lib/components/logql-extension.js +47 -0
  157. package/lib/components/logql-extension.js.map +1 -0
  158. package/lib/components/logql-highlight.d.ts +2 -0
  159. package/lib/components/logql-highlight.d.ts.map +1 -0
  160. package/lib/components/logql-highlight.js +32 -0
  161. package/lib/components/logql-highlight.js.map +1 -0
  162. package/lib/datasources/index.d.ts +2 -0
  163. package/lib/datasources/index.d.ts.map +1 -0
  164. package/lib/datasources/index.js +15 -0
  165. package/lib/datasources/index.js.map +1 -0
  166. package/lib/datasources/loki-datasource/LokiDatasource.d.ts +5 -0
  167. package/lib/datasources/loki-datasource/LokiDatasource.d.ts.map +1 -0
  168. package/lib/datasources/loki-datasource/LokiDatasource.js +69 -0
  169. package/lib/datasources/loki-datasource/LokiDatasource.js.map +1 -0
  170. package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts +9 -0
  171. package/lib/datasources/loki-datasource/LokiDatasourceEditor.d.ts.map +1 -0
  172. package/lib/datasources/loki-datasource/LokiDatasourceEditor.js +75 -0
  173. package/lib/datasources/loki-datasource/LokiDatasourceEditor.js.map +1 -0
  174. package/lib/datasources/loki-datasource/index.d.ts +4 -0
  175. package/lib/datasources/loki-datasource/index.d.ts.map +1 -0
  176. package/lib/datasources/loki-datasource/index.js +17 -0
  177. package/lib/datasources/loki-datasource/index.js.map +1 -0
  178. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts +6 -0
  179. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts.map +1 -0
  180. package/lib/datasources/loki-datasource/loki-datasource-types.js +15 -0
  181. package/lib/datasources/loki-datasource/loki-datasource-types.js.map +1 -0
  182. package/lib/env.d.js +3 -0
  183. package/lib/env.d.js.map +1 -0
  184. package/lib/getPluginModule.d.ts +6 -0
  185. package/lib/getPluginModule.d.ts.map +1 -0
  186. package/lib/getPluginModule.js +16 -0
  187. package/lib/getPluginModule.js.map +1 -0
  188. package/lib/index-federation.d.ts +1 -0
  189. package/lib/index-federation.d.ts.map +1 -0
  190. package/lib/index-federation.js +3 -0
  191. package/lib/index-federation.js.map +1 -0
  192. package/lib/index.d.ts +6 -0
  193. package/lib/index.d.ts.map +1 -0
  194. package/lib/index.js +7 -0
  195. package/lib/index.js.map +1 -0
  196. package/lib/model/index.d.ts +3 -0
  197. package/lib/model/index.d.ts.map +1 -0
  198. package/lib/model/index.js +16 -0
  199. package/lib/model/index.js.map +1 -0
  200. package/lib/model/loki-client-types.d.ts +65 -0
  201. package/lib/model/loki-client-types.d.ts.map +1 -0
  202. package/lib/model/loki-client-types.js +15 -0
  203. package/lib/model/loki-client-types.js.map +1 -0
  204. package/lib/model/loki-client.d.ts +50 -0
  205. package/lib/model/loki-client.d.ts.map +1 -0
  206. package/lib/model/loki-client.js +161 -0
  207. package/lib/model/loki-client.js.map +1 -0
  208. package/lib/model/loki-data-types.d.ts +24 -0
  209. package/lib/model/loki-data-types.d.ts.map +1 -0
  210. package/lib/model/loki-data-types.js +15 -0
  211. package/lib/model/loki-data-types.js.map +1 -0
  212. package/lib/model/loki-selectors.d.ts +10 -0
  213. package/lib/model/loki-selectors.d.ts.map +1 -0
  214. package/lib/model/loki-selectors.js +25 -0
  215. package/lib/model/loki-selectors.js.map +1 -0
  216. package/lib/panels/index.d.ts +2 -0
  217. package/lib/panels/index.d.ts.map +1 -0
  218. package/lib/panels/index.js +15 -0
  219. package/lib/panels/index.js.map +1 -0
  220. package/lib/panels/logstable/LogsTable.d.ts +4 -0
  221. package/lib/panels/logstable/LogsTable.d.ts.map +1 -0
  222. package/lib/panels/logstable/LogsTable.js +33 -0
  223. package/lib/panels/logstable/LogsTable.js.map +1 -0
  224. package/lib/panels/logstable/LogsTableComponent.d.ts +4 -0
  225. package/lib/panels/logstable/LogsTableComponent.d.ts.map +1 -0
  226. package/lib/panels/logstable/LogsTableComponent.js +35 -0
  227. package/lib/panels/logstable/LogsTableComponent.js.map +1 -0
  228. package/lib/panels/logstable/LogsTableSettingsEditor.d.ts +7 -0
  229. package/lib/panels/logstable/LogsTableSettingsEditor.d.ts.map +1 -0
  230. package/lib/panels/logstable/LogsTableSettingsEditor.js +62 -0
  231. package/lib/panels/logstable/LogsTableSettingsEditor.js.map +1 -0
  232. package/lib/panels/logstable/components/EmptyLogsState.d.ts +7 -0
  233. package/lib/panels/logstable/components/EmptyLogsState.d.ts.map +1 -0
  234. package/lib/panels/logstable/components/EmptyLogsState.js +36 -0
  235. package/lib/panels/logstable/components/EmptyLogsState.js.map +1 -0
  236. package/lib/panels/logstable/components/LogRow/LogRow.d.ts +14 -0
  237. package/lib/panels/logstable/components/LogRow/LogRow.d.ts.map +1 -0
  238. package/lib/panels/logstable/components/LogRow/LogRow.js +104 -0
  239. package/lib/panels/logstable/components/LogRow/LogRow.js.map +1 -0
  240. package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts +7 -0
  241. package/lib/panels/logstable/components/LogRow/LogTimestamp.d.ts.map +1 -0
  242. package/lib/panels/logstable/components/LogRow/LogTimestamp.js +31 -0
  243. package/lib/panels/logstable/components/LogRow/LogTimestamp.js.map +1 -0
  244. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts +7 -0
  245. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.d.ts.map +1 -0
  246. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js +61 -0
  247. package/lib/panels/logstable/components/LogRow/LogsLabelsTable.js.map +1 -0
  248. package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts +22 -0
  249. package/lib/panels/logstable/components/LogRow/LogsStyles.d.ts.map +1 -0
  250. package/lib/panels/logstable/components/LogRow/LogsStyles.js +55 -0
  251. package/lib/panels/logstable/components/LogRow/LogsStyles.js.map +1 -0
  252. package/lib/panels/logstable/components/LogRow/index.d.ts +3 -0
  253. package/lib/panels/logstable/components/LogRow/index.d.ts.map +1 -0
  254. package/lib/panels/logstable/components/LogRow/index.js +16 -0
  255. package/lib/panels/logstable/components/LogRow/index.js.map +1 -0
  256. package/lib/panels/logstable/components/LogsList.d.ts +10 -0
  257. package/lib/panels/logstable/components/LogsList.d.ts.map +1 -0
  258. package/lib/panels/logstable/components/LogsList.js +31 -0
  259. package/lib/panels/logstable/components/LogsList.js.map +1 -0
  260. package/lib/panels/logstable/components/VirtualizedLogsList.d.ts +12 -0
  261. package/lib/panels/logstable/components/VirtualizedLogsList.d.ts.map +1 -0
  262. package/lib/panels/logstable/components/VirtualizedLogsList.js +50 -0
  263. package/lib/panels/logstable/components/VirtualizedLogsList.js.map +1 -0
  264. package/lib/panels/logstable/components/index.d.ts +2 -0
  265. package/lib/panels/logstable/components/index.d.ts.map +1 -0
  266. package/lib/panels/logstable/components/index.js +15 -0
  267. package/lib/panels/logstable/components/index.js.map +1 -0
  268. package/lib/panels/logstable/components/utils.d.ts +3 -0
  269. package/lib/panels/logstable/components/utils.d.ts.map +1 -0
  270. package/lib/panels/logstable/components/utils.js +31 -0
  271. package/lib/panels/logstable/components/utils.js.map +1 -0
  272. package/lib/panels/logstable/hooks/useExpandedRows.d.ts +6 -0
  273. package/lib/panels/logstable/hooks/useExpandedRows.d.ts.map +1 -0
  274. package/lib/panels/logstable/hooks/useExpandedRows.js +37 -0
  275. package/lib/panels/logstable/hooks/useExpandedRows.js.map +1 -0
  276. package/lib/panels/logstable/hooks/useSeverity.d.ts +3 -0
  277. package/lib/panels/logstable/hooks/useSeverity.d.ts.map +1 -0
  278. package/lib/panels/logstable/hooks/useSeverity.js +35 -0
  279. package/lib/panels/logstable/hooks/useSeverity.js.map +1 -0
  280. package/lib/panels/logstable/index.d.ts +5 -0
  281. package/lib/panels/logstable/index.d.ts.map +1 -0
  282. package/lib/panels/logstable/index.js +18 -0
  283. package/lib/panels/logstable/index.js.map +1 -0
  284. package/lib/panels/logstable/logs-types.d.ts +11 -0
  285. package/lib/panels/logstable/logs-types.d.ts.map +1 -0
  286. package/lib/panels/logstable/logs-types.js +15 -0
  287. package/lib/panels/logstable/logs-types.js.map +1 -0
  288. package/lib/queries/constants.d.ts +5 -0
  289. package/lib/queries/constants.d.ts.map +1 -0
  290. package/lib/queries/constants.js +6 -0
  291. package/lib/queries/constants.js.map +1 -0
  292. package/lib/queries/index.d.ts +3 -0
  293. package/lib/queries/index.d.ts.map +1 -0
  294. package/lib/queries/index.js +16 -0
  295. package/lib/queries/index.js.map +1 -0
  296. package/lib/queries/loki-log-query/LokiLogQuery.d.ts +4 -0
  297. package/lib/queries/loki-log-query/LokiLogQuery.d.ts.map +1 -0
  298. package/lib/queries/loki-log-query/LokiLogQuery.js +23 -0
  299. package/lib/queries/loki-log-query/LokiLogQuery.js.map +1 -0
  300. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts +7 -0
  301. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -0
  302. package/lib/queries/loki-log-query/LokiLogQueryEditor.js +149 -0
  303. package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -0
  304. package/lib/queries/loki-log-query/get-loki-log-data.d.ts +4 -0
  305. package/lib/queries/loki-log-query/get-loki-log-data.d.ts.map +1 -0
  306. package/lib/queries/loki-log-query/get-loki-log-data.js +66 -0
  307. package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -0
  308. package/lib/queries/loki-log-query/index.d.ts +5 -0
  309. package/lib/queries/loki-log-query/index.d.ts.map +1 -0
  310. package/lib/queries/loki-log-query/index.js +6 -0
  311. package/lib/queries/loki-log-query/index.js.map +1 -0
  312. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +25 -0
  313. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -0
  314. package/lib/queries/loki-log-query/log-query-plugin-interface.js +3 -0
  315. package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -0
  316. package/lib/queries/loki-log-query/loki-log-query-types.d.ts +9 -0
  317. package/lib/queries/loki-log-query/loki-log-query-types.d.ts.map +1 -0
  318. package/lib/queries/loki-log-query/loki-log-query-types.js +3 -0
  319. package/lib/queries/loki-log-query/loki-log-query-types.js.map +1 -0
  320. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts +4 -0
  321. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.d.ts.map +1 -0
  322. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js +35 -0
  323. package/lib/queries/loki-time-series-query/LokiTimeSeriesQuery.js.map +1 -0
  324. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts +7 -0
  325. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -0
  326. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +110 -0
  327. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -0
  328. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts +12 -0
  329. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts.map +1 -0
  330. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js +112 -0
  331. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js.map +1 -0
  332. package/lib/queries/loki-time-series-query/index.d.ts +5 -0
  333. package/lib/queries/loki-time-series-query/index.d.ts.map +1 -0
  334. package/lib/queries/loki-time-series-query/index.js +18 -0
  335. package/lib/queries/loki-time-series-query/index.js.map +1 -0
  336. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts +9 -0
  337. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts.map +1 -0
  338. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js +15 -0
  339. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js.map +1 -0
  340. package/lib/setup-tests.d.ts +2 -0
  341. package/lib/setup-tests.d.ts.map +1 -0
  342. package/lib/setup-tests.js +5 -0
  343. package/lib/setup-tests.js.map +1 -0
  344. package/mf-manifest.json +528 -0
  345. package/mf-stats.json +584 -0
  346. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { };
14
+
15
+ //# sourceMappingURL=logs-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/panels/logstable/logs-types.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { LokiTimeSeriesData } from '../../model/loki-data-types';\n\nexport type QueryData = LokiTimeSeriesData;\n\nexport type LogsProps = PanelProps<LogsOptions, QueryData>;\n\nexport interface LogsOptions {\n direction?: 'forward' | 'backward';\n wrap?: boolean;\n enableDetails?: boolean;\n time?: boolean;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AASjC,WAKC"}
@@ -0,0 +1,5 @@
1
+ export declare const DATASOURCE_KIND = "LokiDatasource";
2
+ export declare const DEFAULT_DATASOURCE: {
3
+ kind: string;
4
+ };
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/queries/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,kBAAkB;;CAA4B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export const DATASOURCE_KIND = 'LokiDatasource';
2
+ export const DEFAULT_DATASOURCE = {
3
+ kind: DATASOURCE_KIND
4
+ };
5
+
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/queries/constants.ts"],"sourcesContent":["export const DATASOURCE_KIND = 'LokiDatasource';\nexport const DEFAULT_DATASOURCE = { kind: DATASOURCE_KIND };\n"],"names":["DATASOURCE_KIND","DEFAULT_DATASOURCE","kind"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,iBAAiB;AAChD,OAAO,MAAMC,qBAAqB;IAAEC,MAAMF;AAAgB,EAAE"}
@@ -0,0 +1,3 @@
1
+ export * from './loki-time-series-query';
2
+ export * from './loki-log-query';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './loki-time-series-query';
14
+ export * from './loki-log-query';
15
+
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/queries/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './loki-time-series-query';\nexport * from './loki-log-query';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,2BAA2B;AACzC,cAAc,mBAAmB"}
@@ -0,0 +1,4 @@
1
+ import { LokiLogQuerySpec } from './loki-log-query-types';
2
+ import { LogQueryPlugin } from './log-query-plugin-interface';
3
+ export declare const LokiLogQuery: LogQueryPlugin<LokiLogQuerySpec>;
4
+ //# sourceMappingURL=LokiLogQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LokiLogQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/LokiLogQuery.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,gBAAgB,CAWzD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { parseVariables } from '@perses-dev/plugin-system';
2
+ import { getLokiLogData } from './get-loki-log-data';
3
+ import { LokiLogQueryEditor } from './LokiLogQueryEditor';
4
+ export const LokiLogQuery = {
5
+ getLogData: getLokiLogData,
6
+ OptionsEditorComponent: LokiLogQueryEditor,
7
+ createInitialOptions: ()=>({
8
+ query: ''
9
+ }),
10
+ dependsOn: (spec)=>{
11
+ const queryVariables = parseVariables(spec.query);
12
+ const allVariables = [
13
+ ...new Set([
14
+ ...queryVariables
15
+ ])
16
+ ];
17
+ return {
18
+ variables: allVariables
19
+ };
20
+ }
21
+ };
22
+
23
+ //# sourceMappingURL=LokiLogQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/LokiLogQuery.tsx"],"sourcesContent":["import { parseVariables } from '@perses-dev/plugin-system';\nimport { getLokiLogData } from './get-loki-log-data';\nimport { LokiLogQueryEditor } from './LokiLogQueryEditor';\nimport { LokiLogQuerySpec } from './loki-log-query-types';\nimport { LogQueryPlugin } from './log-query-plugin-interface';\n\nexport const LokiLogQuery: LogQueryPlugin<LokiLogQuerySpec> = {\n getLogData: getLokiLogData,\n OptionsEditorComponent: LokiLogQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set([...queryVariables])];\n return {\n variables: allVariables,\n };\n },\n};\n"],"names":["parseVariables","getLokiLogData","LokiLogQueryEditor","LokiLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,SAASA,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,kBAAkB,QAAQ,uBAAuB;AAI1D,OAAO,MAAMC,eAAiD;IAC5DC,YAAYH;IACZI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAI;mBAAIF;aAAe;SAAE;QACtD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
@@ -0,0 +1,7 @@
1
+ import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import { ReactElement } from 'react';
3
+ import { LokiLogQuerySpec } from './loki-log-query-types';
4
+ type LokiQueryEditorProps = OptionsEditorProps<LokiLogQuerySpec>;
5
+ export declare function LokiLogQueryEditor(props: LokiQueryEditorProps): ReactElement;
6
+ export {};
7
+ //# sourceMappingURL=LokiLogQueryEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LokiLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/LokiLogQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAoC,MAAM,OAAO,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAqH5E"}
@@ -0,0 +1,149 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';
15
+ import { InputLabel, Stack, ToggleButton, ToggleButtonGroup } from '@mui/material';
16
+ import { useCallback, useState, useEffect } from 'react';
17
+ import { produce } from 'immer';
18
+ import { OptionsEditorControl } from '@perses-dev/components';
19
+ import { LogQLEditor } from '../../components/logql-editor';
20
+ import { LOKI_DATASOURCE_KIND } from '../../model';
21
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
22
+ export function LokiLogQueryEditor(props) {
23
+ const { onChange, value } = props;
24
+ const { datasource } = value;
25
+ const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;
26
+ const selectedDatasource = useDatasourceSelectValueToSelector(datasourceSelectValue, LOKI_DATASOURCE_KIND);
27
+ // const { data: client } = useDatasourceClient<LokiClient>(selectedDatasource);
28
+ // const lokiURL = client?.options.datasourceUrl;
29
+ // Local state for editor value to prevent query_range calls on every keystroke
30
+ const [localQuery, setLocalQuery] = useState(value.query);
31
+ // Update local state when prop changes
32
+ useEffect(()=>{
33
+ setLocalQuery(value.query);
34
+ }, [
35
+ value.query
36
+ ]);
37
+ const handleDatasourceChange = (newDatasourceSelection)=>{
38
+ if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
39
+ onChange({
40
+ ...value,
41
+ datasource: newDatasourceSelection
42
+ });
43
+ return;
44
+ }
45
+ throw new Error('Got unexpected non LokiQuery datasource selection');
46
+ };
47
+ // Debounced query change handler to prevent excessive query_range calls
48
+ const handleQueryChange = useCallback((newQuery)=>{
49
+ setLocalQuery(newQuery);
50
+ }, []);
51
+ const handleLogsDirection = (_, v)=>onChange(produce(value, (draft)=>{
52
+ draft.direction = v;
53
+ }));
54
+ // Immediate query execution on Enter or blur
55
+ const handleQueryExecute = useCallback((query)=>{
56
+ onChange({
57
+ ...value,
58
+ query
59
+ });
60
+ }, [
61
+ onChange,
62
+ value
63
+ ]);
64
+ return /*#__PURE__*/ _jsxs(Stack, {
65
+ spacing: 1.5,
66
+ paddingBottom: 1,
67
+ children: [
68
+ /*#__PURE__*/ _jsxs("div", {
69
+ children: [
70
+ /*#__PURE__*/ _jsx(InputLabel, {
71
+ sx: {
72
+ display: 'block',
73
+ marginBottom: '4px',
74
+ fontWeight: 500
75
+ },
76
+ children: "Datasource"
77
+ }),
78
+ /*#__PURE__*/ _jsx(DatasourceSelect, {
79
+ datasourcePluginKind: DATASOURCE_KIND,
80
+ value: selectedDatasource,
81
+ onChange: handleDatasourceChange,
82
+ label: "Loki Datasource",
83
+ notched: true
84
+ })
85
+ ]
86
+ }),
87
+ /*#__PURE__*/ _jsxs("div", {
88
+ children: [
89
+ /*#__PURE__*/ _jsx(InputLabel, {
90
+ sx: {
91
+ display: 'block',
92
+ marginBottom: '4px',
93
+ fontWeight: 500
94
+ },
95
+ children: "LogQL Query"
96
+ }),
97
+ /*#__PURE__*/ _jsx(LogQLEditor, {
98
+ value: localQuery,
99
+ onChange: handleQueryChange,
100
+ onBlur: ()=>handleQueryExecute(localQuery),
101
+ onKeyDown: (event)=>{
102
+ if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
103
+ event.preventDefault();
104
+ handleQueryExecute(localQuery);
105
+ }
106
+ },
107
+ placeholder: 'Enter LogQL query (e.g. {job="mysql"} |= "error")'
108
+ })
109
+ ]
110
+ }),
111
+ /*#__PURE__*/ _jsx("div", {
112
+ children: /*#__PURE__*/ _jsx(OptionsEditorControl, {
113
+ label: "Order",
114
+ // description="Percentage means thresholds relative to min & max"
115
+ control: /*#__PURE__*/ _jsxs(ToggleButtonGroup, {
116
+ exclusive: true,
117
+ value: value?.direction ?? 'backward',
118
+ onChange: handleLogsDirection,
119
+ sx: {
120
+ height: '36px',
121
+ marginLeft: '10px',
122
+ width: 'max-content'
123
+ },
124
+ children: [
125
+ /*#__PURE__*/ _jsx(ToggleButton, {
126
+ "aria-label": "backward",
127
+ value: "backward",
128
+ sx: {
129
+ fontWeight: 500
130
+ },
131
+ children: "Newest first"
132
+ }),
133
+ /*#__PURE__*/ _jsx(ToggleButton, {
134
+ "aria-label": "forward",
135
+ value: "forward",
136
+ sx: {
137
+ fontWeight: 500
138
+ },
139
+ children: "Oldest first"
140
+ })
141
+ ]
142
+ })
143
+ })
144
+ })
145
+ ]
146
+ });
147
+ }
148
+
149
+ //# sourceMappingURL=LokiLogQueryEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/LokiLogQueryEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n isVariableDatasource,\n OptionsEditorProps,\n useDatasourceSelectValueToSelector,\n} from '@perses-dev/plugin-system';\nimport { InputLabel, Stack, ToggleButton, ToggleButtonGroup } from '@mui/material';\nimport { ReactElement, useCallback, useState, useEffect } from 'react';\nimport { produce } from 'immer';\nimport { OptionsEditorControl } from '@perses-dev/components';\nimport { LogQLEditor } from '../../components/logql-editor';\nimport { LOKI_DATASOURCE_KIND, LokiDatasourceSelector } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { LokiLogQuerySpec } from './loki-log-query-types';\n\ntype LokiQueryEditorProps = OptionsEditorProps<LokiLogQuerySpec>;\n\nexport function LokiLogQueryEditor(props: LokiQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n LOKI_DATASOURCE_KIND\n ) as LokiDatasourceSelector;\n\n // const { data: client } = useDatasourceClient<LokiClient>(selectedDatasource);\n // const lokiURL = client?.options.datasourceUrl;\n\n // Local state for editor value to prevent query_range calls on every keystroke\n const [localQuery, setLocalQuery] = useState(value.query);\n\n // Update local state when prop changes\n useEffect(() => {\n setLocalQuery(value.query);\n }, [value.query]);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange({ ...value, datasource: newDatasourceSelection });\n return;\n }\n\n throw new Error('Got unexpected non LokiQuery datasource selection');\n };\n\n // Debounced query change handler to prevent excessive query_range calls\n const handleQueryChange = useCallback((newQuery: string) => {\n setLocalQuery(newQuery);\n }, []);\n\n const handleLogsDirection = (_: React.MouseEvent, v: 'backward' | 'forward') =>\n onChange(\n produce(value, (draft: LokiLogQuerySpec) => {\n draft.direction = v;\n })\n );\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = useCallback(\n (query: string) => {\n onChange({ ...value, query });\n },\n [onChange, value]\n );\n\n return (\n <Stack spacing={1.5} paddingBottom={1}>\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"Loki Datasource\"\n notched\n />\n </div>\n\n <div>\n <InputLabel\n sx={{\n display: 'block',\n marginBottom: '4px',\n fontWeight: 500,\n }}\n >\n LogQL Query\n </InputLabel>\n <LogQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n handleQueryExecute(localQuery);\n }\n }}\n placeholder='Enter LogQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n <div>\n <OptionsEditorControl\n label=\"Order\"\n // description=\"Percentage means thresholds relative to min & max\"\n control={\n <ToggleButtonGroup\n exclusive\n value={value?.direction ?? 'backward'}\n onChange={handleLogsDirection}\n sx={{ height: '36px', marginLeft: '10px', width: 'max-content' }}\n >\n <ToggleButton aria-label=\"backward\" value=\"backward\" sx={{ fontWeight: 500 }}>\n Newest first\n </ToggleButton>\n <ToggleButton aria-label=\"forward\" value=\"forward\" sx={{ fontWeight: 500 }}>\n Oldest first\n </ToggleButton>\n </ToggleButtonGroup>\n }\n />\n </div>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","InputLabel","Stack","ToggleButton","ToggleButtonGroup","useCallback","useState","useEffect","produce","OptionsEditorControl","LogQLEditor","LOKI_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","LokiLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleLogsDirection","_","v","draft","direction","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","event","key","ctrlKey","metaKey","preventDefault","placeholder","control","exclusive","height","marginLeft","width","aria-label"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SACEA,gBAAgB,EAEhBC,oBAAoB,EAEpBC,kCAAkC,QAC7B,4BAA4B;AACnC,SAASC,UAAU,EAAEC,KAAK,EAAEC,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AACnF,SAAuBC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AACvE,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,oBAAoB,QAAgC,cAAc;AAC3E,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AAKnE,OAAO,SAASC,mBAAmBC,KAA2B;IAC5D,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBpB,mCACzBmB,uBACAR;IAGF,gFAAgF;IAChF,iDAAiD;IAEjD,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGhB,SAASW,MAAMM,KAAK;IAExD,uCAAuC;IACvChB,UAAU;QACRe,cAAcL,MAAMM,KAAK;IAC3B,GAAG;QAACN,MAAMM,KAAK;KAAC;IAEhB,MAAMC,yBAA4D,CAACC;QACjE,IAAI,CAAC1B,qBAAqB0B,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYO;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBvB,YAAY,CAACwB;QACrCP,cAAcO;IAChB,GAAG,EAAE;IAEL,MAAMC,sBAAsB,CAACC,GAAqBC,IAChDhB,SACER,QAAQS,OAAO,CAACgB;YACdA,MAAMC,SAAS,GAAGF;QACpB;IAGJ,6CAA6C;IAC7C,MAAMG,qBAAqB9B,YACzB,CAACkB;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACf;QAAMkC,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAACrC;wBACCsC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC5C;wBACC6C,sBAAsB/B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVoB,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAACrC;wBACCsC,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAChC;wBACCO,OAAOI;wBACPL,UAAUY;wBACVkB,QAAQ,IAAMX,mBAAmBd;wBACjC0B,WAAW,CAACC;4BACV,IAAIA,MAAMC,GAAG,KAAK,WAAYD,CAAAA,MAAME,OAAO,IAAIF,MAAMG,OAAO,AAAD,GAAI;gCAC7DH,MAAMI,cAAc;gCACpBjB,mBAAmBd;4BACrB;wBACF;wBACAgC,aAAY;;;;0BAIhB,KAACf;0BACC,cAAA,KAAC7B;oBACCmC,OAAM;oBACN,kEAAkE;oBAClEU,uBACE,MAAClD;wBACCmD,SAAS;wBACTtC,OAAOA,OAAOiB,aAAa;wBAC3BlB,UAAUc;wBACVS,IAAI;4BAAEiB,QAAQ;4BAAQC,YAAY;4BAAQC,OAAO;wBAAc;;0CAE/D,KAACvD;gCAAawD,cAAW;gCAAW1C,OAAM;gCAAWsB,IAAI;oCAAEG,YAAY;gCAAI;0CAAG;;0CAG9E,KAACvC;gCAAawD,cAAW;gCAAU1C,OAAM;gCAAUsB,IAAI;oCAAEG,YAAY;gCAAI;0CAAG;;;;;;;;AAS1F"}
@@ -0,0 +1,4 @@
1
+ import { LokiLogQuerySpec } from './loki-log-query-types';
2
+ import { LogQueryPlugin } from './log-query-plugin-interface';
3
+ export declare const getLokiLogData: LogQueryPlugin<LokiLogQuerySpec>['getLogData'];
4
+ //# sourceMappingURL=get-loki-log-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-loki-log-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/get-loki-log-data.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAmB,MAAM,8BAA8B,CAAC;AAqB/E,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAwCzE,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { replaceVariables } from '@perses-dev/plugin-system';
2
+ import { DEFAULT_DATASOURCE } from '../constants';
3
+ function convertStreamsToLogs(streams) {
4
+ const entries = [];
5
+ streams.forEach((stream)=>{
6
+ stream.values.forEach(([timestamp, logLine])=>{
7
+ entries.push({
8
+ timestamp: Number(timestamp) / 1000000000,
9
+ line: logLine,
10
+ labels: stream.stream
11
+ });
12
+ });
13
+ });
14
+ return {
15
+ entries,
16
+ totalCount: entries.length
17
+ };
18
+ }
19
+ export const getLokiLogData = async (spec, context)=>{
20
+ if (!spec.query) {
21
+ return {
22
+ logs: {
23
+ entries: [],
24
+ totalCount: 0
25
+ },
26
+ timeRange: {
27
+ start: context.timeRange.start,
28
+ end: context.timeRange.end
29
+ }
30
+ };
31
+ }
32
+ const query = replaceVariables(spec.query, context.variableState);
33
+ const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? DEFAULT_DATASOURCE);
34
+ const { start, end } = context.timeRange;
35
+ const response = await client.queryRange({
36
+ query,
37
+ start: start.getTime().toString(),
38
+ end: end.getTime().toString(),
39
+ direction: spec.direction
40
+ });
41
+ if (response.data.resultType === 'streams') {
42
+ const logs = convertStreamsToLogs(response.data.result);
43
+ return {
44
+ logs,
45
+ timeRange: {
46
+ start,
47
+ end
48
+ },
49
+ metadata: {
50
+ executedQueryString: query
51
+ }
52
+ };
53
+ }
54
+ return {
55
+ logs: {
56
+ entries: [],
57
+ totalCount: 0
58
+ },
59
+ timeRange: {
60
+ start,
61
+ end
62
+ }
63
+ };
64
+ };
65
+
66
+ //# sourceMappingURL=get-loki-log-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/get-loki-log-data.ts"],"sourcesContent":["import { replaceVariables } from '@perses-dev/plugin-system';\nimport { LokiStreamResult } from '../../model/loki-client-types';\nimport { LokiClient } from '../../model/loki-client';\nimport { LogEntry, LogsData } from '../../model/loki-data-types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { LokiLogQuerySpec, LokiLogQueryResponse } from './loki-log-query-types';\nimport { LogQueryPlugin, LogQueryContext } from './log-query-plugin-interface';\n\nfunction convertStreamsToLogs(streams: LokiStreamResult[]): LogsData {\n const entries: LogEntry[] = [];\n\n streams.forEach((stream) => {\n stream.values.forEach(([timestamp, logLine]: [string, string]) => {\n entries.push({\n timestamp: Number(timestamp) / 1000000000,\n line: logLine,\n labels: stream.stream,\n });\n });\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getLokiLogData: LogQueryPlugin<LokiLogQuerySpec>['getLogData'] = async (\n spec: LokiLogQuerySpec,\n context: LogQueryContext\n) => {\n if (!spec.query) {\n return {\n logs: { entries: [], totalCount: 0 },\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n const client = (await context.datasourceStore.getDatasourceClient<LokiClient>(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as LokiClient;\n\n const { start, end } = context.timeRange;\n\n const response: LokiLogQueryResponse = await client.queryRange({\n query,\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n direction: spec.direction,\n });\n\n if (response.data.resultType === 'streams') {\n const logs = convertStreamsToLogs(response.data.result);\n return {\n logs,\n timeRange: { start, end },\n metadata: {\n executedQueryString: query,\n },\n };\n }\n\n return {\n logs: { entries: [], totalCount: 0 },\n timeRange: { start, end },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","convertStreamsToLogs","streams","entries","forEach","stream","values","timestamp","logLine","push","Number","line","labels","totalCount","length","getLokiLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","queryRange","getTime","toString","direction","data","resultType","result","metadata","executedQueryString"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAI7D,SAASC,kBAAkB,QAAQ,eAAe;AAIlD,SAASC,qBAAqBC,OAA2B;IACvD,MAAMC,UAAsB,EAAE;IAE9BD,QAAQE,OAAO,CAAC,CAACC;QACfA,OAAOC,MAAM,CAACF,OAAO,CAAC,CAAC,CAACG,WAAWC,QAA0B;YAC3DL,QAAQM,IAAI,CAAC;gBACXF,WAAWG,OAAOH,aAAa;gBAC/BI,MAAMH;gBACNI,QAAQP,OAAOA,MAAM;YACvB;QACF;IACF;IAEA,OAAO;QACLF;QACAU,YAAYV,QAAQW,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,iBAAiE,OAC5EC,MACAC;IAEA,IAAI,CAACD,KAAKE,KAAK,EAAE;QACf,OAAO;YACLC,MAAM;gBAAEhB,SAAS,EAAE;gBAAEU,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQnB,iBAAiBiB,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAChE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI3B;IAGrB,MAAM,EAAEqB,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAiC,MAAMJ,OAAOK,UAAU,CAAC;QAC7DX;QACAG,OAAOA,MAAMS,OAAO,GAAGC,QAAQ;QAC/BT,KAAKA,IAAIQ,OAAO,GAAGC,QAAQ;QAC3BC,WAAWhB,KAAKgB,SAAS;IAC3B;IAEA,IAAIJ,SAASK,IAAI,CAACC,UAAU,KAAK,WAAW;QAC1C,MAAMf,OAAOlB,qBAAqB2B,SAASK,IAAI,CAACE,MAAM;QACtD,OAAO;YACLhB;YACAC,WAAW;gBAAEC;gBAAOC;YAAI;YACxBc,UAAU;gBACRC,qBAAqBnB;YACvB;QACF;IACF;IAEA,OAAO;QACLC,MAAM;YAAEhB,SAAS,EAAE;YAAEU,YAAY;QAAE;QACnCO,WAAW;YAAEC;YAAOC;QAAI;IAC1B;AACF,EAAE"}
@@ -0,0 +1,5 @@
1
+ export * from './get-loki-log-data';
2
+ export * from './LokiLogQuery';
3
+ export * from './LokiLogQueryEditor';
4
+ export * from './loki-log-query-types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './get-loki-log-data';
2
+ export * from './LokiLogQuery';
3
+ export * from './LokiLogQueryEditor';
4
+ export * from './loki-log-query-types';
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/index.ts"],"sourcesContent":["export * from './get-loki-log-data';\nexport * from './LokiLogQuery';\nexport * from './LokiLogQueryEditor';\nexport * from './loki-log-query-types';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB;AACrC,cAAc,yBAAyB"}
@@ -0,0 +1,25 @@
1
+ import { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core';
2
+ import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system';
3
+ import { LogsData } from '../../model/loki-data-types';
4
+ export interface LogQueryResult {
5
+ logs: LogsData;
6
+ timeRange: AbsoluteTimeRange;
7
+ metadata?: {
8
+ executedQueryString: string;
9
+ };
10
+ }
11
+ export interface LogQueryContext {
12
+ timeRange: AbsoluteTimeRange;
13
+ variableState: VariableStateMap;
14
+ datasourceStore: DatasourceStore;
15
+ refreshKey: string;
16
+ }
17
+ type LogQueryPluginDependencies = {
18
+ variables?: string[];
19
+ };
20
+ export interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {
21
+ getLogData: (spec: Spec, ctx: LogQueryContext) => Promise<LogQueryResult>;
22
+ dependsOn?: (spec: Spec, ctx: LogQueryContext) => LogQueryPluginDependencies;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=log-query-plugin-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-query-plugin-interface.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/log-query-plugin-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1E,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,0BAA0B,CAAC;CAC9E"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=log-query-plugin-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/log-query-plugin-interface.ts"],"sourcesContent":["import { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/core';\nimport { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system';\nimport { LogsData } from '../../model/loki-data-types';\n\nexport interface LogQueryResult {\n logs: LogsData;\n timeRange: AbsoluteTimeRange;\n metadata?: {\n executedQueryString: string;\n };\n}\n\nexport interface LogQueryContext {\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n refreshKey: string;\n}\n\ntype LogQueryPluginDependencies = {\n variables?: string[];\n};\n\nexport interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getLogData: (spec: Spec, ctx: LogQueryContext) => Promise<LogQueryResult>;\n dependsOn?: (spec: Spec, ctx: LogQueryContext) => LogQueryPluginDependencies;\n}\n"],"names":[],"mappings":"AAuBA,WAGC"}
@@ -0,0 +1,9 @@
1
+ import { DatasourceSelector } from '@perses-dev/core';
2
+ import { LokiQueryRangeStreamsResponse } from '../../model/loki-client-types';
3
+ export interface LokiLogQuerySpec {
4
+ query: string;
5
+ datasource?: DatasourceSelector;
6
+ direction?: 'backward' | 'forward';
7
+ }
8
+ export type LokiLogQueryResponse = LokiQueryRangeStreamsResponse;
9
+ //# sourceMappingURL=loki-log-query-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loki-log-query-types.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-log-query/loki-log-query-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=loki-log-query-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-log-query/loki-log-query-types.ts"],"sourcesContent":["import { DatasourceSelector } from '@perses-dev/core';\nimport { LokiQueryRangeStreamsResponse } from '../../model/loki-client-types';\n\nexport interface LokiLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n direction?: 'backward' | 'forward';\n}\n\nexport type LokiLogQueryResponse = LokiQueryRangeStreamsResponse;\n"],"names":[],"mappings":"AASA,WAAiE"}
@@ -0,0 +1,4 @@
1
+ import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { LokiTimeSeriesQuerySpec } from './loki-time-series-query-types';
3
+ export declare const LokiTimeSeriesQuery: TimeSeriesQueryPlugin<LokiTimeSeriesQuerySpec>;
4
+ //# sourceMappingURL=LokiTimeSeriesQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LokiTimeSeriesQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-time-series-query/LokiTimeSeriesQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAkB,MAAM,2BAA2B,CAAC;AAGlF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,eAAO,MAAM,mBAAmB,EAAE,qBAAqB,CAAC,uBAAuB,CAW9E,CAAC"}
@@ -0,0 +1,35 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { parseVariables } from '@perses-dev/plugin-system';
14
+ import { getLokiTimeSeriesData } from './get-loki-time-series-data';
15
+ import { LokiQueryEditor } from './LokiTimeSeriesQueryEditor';
16
+ export const LokiTimeSeriesQuery = {
17
+ getTimeSeriesData: getLokiTimeSeriesData,
18
+ OptionsEditorComponent: LokiQueryEditor,
19
+ createInitialOptions: ()=>({
20
+ query: ''
21
+ }),
22
+ dependsOn: (spec)=>{
23
+ const queryVariables = parseVariables(spec.query);
24
+ const allVariables = [
25
+ ...new Set([
26
+ ...queryVariables
27
+ ])
28
+ ];
29
+ return {
30
+ variables: allVariables
31
+ };
32
+ }
33
+ };
34
+
35
+ //# sourceMappingURL=LokiTimeSeriesQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/loki-time-series-query/LokiTimeSeriesQuery.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesQueryPlugin, parseVariables } from '@perses-dev/plugin-system';\nimport { getLokiTimeSeriesData } from './get-loki-time-series-data';\nimport { LokiQueryEditor } from './LokiTimeSeriesQueryEditor';\nimport { LokiTimeSeriesQuerySpec } from './loki-time-series-query-types';\n\nexport const LokiTimeSeriesQuery: TimeSeriesQueryPlugin<LokiTimeSeriesQuerySpec> = {\n getTimeSeriesData: getLokiTimeSeriesData,\n OptionsEditorComponent: LokiQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set([...queryVariables])];\n return {\n variables: allVariables,\n };\n },\n};\n"],"names":["parseVariables","getLokiTimeSeriesData","LokiQueryEditor","LokiTimeSeriesQuery","getTimeSeriesData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAgCA,cAAc,QAAQ,4BAA4B;AAClF,SAASC,qBAAqB,QAAQ,8BAA8B;AACpE,SAASC,eAAe,QAAQ,8BAA8B;AAG9D,OAAO,MAAMC,sBAAsE;IACjFC,mBAAmBH;IACnBI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAI;mBAAIF;aAAe;SAAE;QACtD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
@@ -0,0 +1,7 @@
1
+ import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import { ReactElement } from 'react';
3
+ import { LokiTimeSeriesQuerySpec } from './loki-time-series-query-types';
4
+ type LokiQueryEditorProps = OptionsEditorProps<LokiTimeSeriesQuerySpec>;
5
+ export declare function LokiQueryEditor(props: LokiQueryEditorProps): ReactElement;
6
+ export {};
7
+ //# sourceMappingURL=LokiTimeSeriesQueryEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LokiTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAoC,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;AAExE,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAyFzE"}