@perses-dev/victorialogs-plugin 0.4.0 → 0.5.0-beta.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 (267) hide show
  1. package/__mf/js/{VictoriaLogs.db5cc46b.js → VictoriaLogs.72a4d689.js} +3 -3
  2. package/__mf/js/async/1522.e41aa623.js +22 -0
  3. package/__mf/js/async/1616.f91f6c7b.js +1 -0
  4. package/__mf/js/async/198.4b388f96.js +2 -0
  5. package/__mf/js/async/2377.1627ef61.js +1 -0
  6. package/__mf/js/async/2786.4ba35a40.js +2 -0
  7. package/__mf/js/async/2901.21debf59.js +1 -0
  8. package/__mf/js/async/3865.3eba8e7a.js +1 -0
  9. package/__mf/js/async/392.8532b8b9.js +2 -0
  10. package/__mf/js/async/4121.43679b06.js +2 -0
  11. package/__mf/js/async/4248.f3720fee.js +1 -0
  12. package/__mf/js/async/4960.813e0b59.js +2 -0
  13. package/__mf/js/async/5019.a912bf58.js +1 -0
  14. package/__mf/js/async/5440.e2ea1262.js +2 -0
  15. package/__mf/js/async/5587.144f3899.js +1 -0
  16. package/__mf/js/async/560.ebacb2ba.js +37 -0
  17. package/__mf/js/async/5623.6fc3cf67.js +1 -0
  18. package/__mf/js/async/5706.38c46b8c.js +1 -0
  19. package/__mf/js/async/6274.efc9c64a.js +2 -0
  20. package/__mf/js/async/663.cccc183b.js +1 -0
  21. package/__mf/js/async/7155.68cbed18.js +7 -0
  22. package/__mf/js/async/7155.68cbed18.js.LICENSE.txt +102 -0
  23. package/__mf/js/async/7192.9670a853.js +1 -0
  24. package/__mf/js/async/7740.c8cb2613.js +101 -0
  25. package/__mf/js/async/7817.620f3116.js +2 -0
  26. package/__mf/js/async/7862.e6de7017.js +2 -0
  27. package/__mf/js/async/7873.4d25d71e.js +2 -0
  28. package/__mf/js/async/7968.69cffbaf.js +1 -0
  29. package/__mf/js/async/8356.d0bcc56a.js +1 -0
  30. package/__mf/js/async/8470.6cf8f7b1.js +2 -0
  31. package/__mf/js/async/9235.bfe14cc5.js +1 -0
  32. package/__mf/js/async/941.73cfe62f.js +2 -0
  33. package/__mf/js/async/9440.37da95ff.js +10 -0
  34. package/__mf/js/async/9700.72a5372d.js +3 -0
  35. package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.db12b897.js +2 -0
  36. package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.59ed2274.js +2 -0
  37. package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.fcbe16ef.js +2 -0
  38. package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.803dba77.js +1 -0
  39. package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.6d5fdbb1.js +1 -0
  40. package/__mf/js/{main.0d99a16b.js → main.00381beb.js} +2 -2
  41. package/lib/bootstrap.js +2 -2
  42. package/lib/components/index.js +1 -1
  43. package/lib/components/index.js.map +1 -1
  44. package/lib/components/logsql-editor.d.ts +2 -2
  45. package/lib/components/logsql-editor.d.ts.map +1 -1
  46. package/lib/components/logsql-editor.js +4 -4
  47. package/lib/components/logsql-editor.js.map +1 -1
  48. package/lib/components/logsql-extension.d.ts +1 -1
  49. package/lib/components/logsql-extension.d.ts.map +1 -1
  50. package/lib/components/logsql-extension.js +3 -3
  51. package/lib/components/logsql-extension.js.map +1 -1
  52. package/lib/components/logsql-highlight.js +1 -1
  53. package/lib/datasources/index.js +1 -1
  54. package/lib/datasources/index.js.map +1 -1
  55. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts +3 -3
  56. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts.map +1 -1
  57. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +2 -2
  58. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js.map +1 -1
  59. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts +2 -2
  60. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts.map +1 -1
  61. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +1 -1
  62. package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js.map +1 -1
  63. package/lib/datasources/victorialogs-datasource/index.js +3 -3
  64. package/lib/datasources/victorialogs-datasource/index.js.map +1 -1
  65. package/lib/datasources/victorialogs-datasource/types.d.ts +1 -1
  66. package/lib/datasources/victorialogs-datasource/types.d.ts.map +1 -1
  67. package/lib/datasources/victorialogs-datasource/types.js.map +1 -1
  68. package/lib/getPluginModule.d.ts +1 -1
  69. package/lib/getPluginModule.d.ts.map +1 -1
  70. package/lib/getPluginModule.js +3 -1
  71. package/lib/getPluginModule.js.map +1 -1
  72. package/lib/index-federation.js +1 -1
  73. package/lib/index.js +4 -4
  74. package/lib/index.js.map +1 -1
  75. package/lib/model/client.d.ts +1 -1
  76. package/lib/model/client.d.ts.map +1 -1
  77. package/lib/model/client.js.map +1 -1
  78. package/lib/model/index.js +3 -3
  79. package/lib/model/index.js.map +1 -1
  80. package/lib/model/selectors.d.ts +2 -2
  81. package/lib/model/selectors.d.ts.map +1 -1
  82. package/lib/model/selectors.js +1 -1
  83. package/lib/model/selectors.js.map +1 -1
  84. package/lib/queries/index.js +2 -2
  85. package/lib/queries/index.js.map +1 -1
  86. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts +2 -2
  87. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts.map +1 -1
  88. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +4 -6
  89. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js.map +1 -1
  90. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts +3 -3
  91. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts.map +1 -1
  92. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +7 -7
  93. package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js.map +1 -1
  94. package/lib/queries/victorialogs-log-query/index.js +4 -4
  95. package/lib/queries/victorialogs-log-query/index.js.map +1 -1
  96. package/lib/queries/victorialogs-log-query/query.d.ts +2 -2
  97. package/lib/queries/victorialogs-log-query/query.d.ts.map +1 -1
  98. package/lib/queries/victorialogs-log-query/query.js +2 -2
  99. package/lib/queries/victorialogs-log-query/query.js.map +1 -1
  100. package/lib/queries/victorialogs-log-query/types.d.ts +1 -1
  101. package/lib/queries/victorialogs-log-query/types.d.ts.map +1 -1
  102. package/lib/queries/victorialogs-log-query/types.js.map +1 -1
  103. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts +2 -2
  104. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts.map +1 -1
  105. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +4 -6
  106. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js.map +1 -1
  107. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts +3 -3
  108. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map +1 -1
  109. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +7 -7
  110. package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js.map +1 -1
  111. package/lib/queries/victorialogs-time-series-query/index.js +4 -4
  112. package/lib/queries/victorialogs-time-series-query/index.js.map +1 -1
  113. package/lib/queries/victorialogs-time-series-query/query.d.ts +2 -2
  114. package/lib/queries/victorialogs-time-series-query/query.d.ts.map +1 -1
  115. package/lib/queries/victorialogs-time-series-query/query.js +4 -4
  116. package/lib/queries/victorialogs-time-series-query/query.js.map +1 -1
  117. package/lib/queries/victorialogs-time-series-query/types.d.ts +1 -1
  118. package/lib/queries/victorialogs-time-series-query/types.d.ts.map +1 -1
  119. package/lib/queries/victorialogs-time-series-query/types.js.map +1 -1
  120. package/lib/setup-tests.d.ts +1 -1
  121. package/lib/setup-tests.d.ts.map +1 -1
  122. package/lib/setup-tests.js +2 -2
  123. package/lib/setup-tests.js.map +1 -1
  124. package/lib/variables/index.js +2 -2
  125. package/lib/variables/index.js.map +1 -1
  126. package/lib/variables/types.d.ts +2 -2
  127. package/lib/variables/types.d.ts.map +1 -1
  128. package/lib/variables/types.js.map +1 -1
  129. package/lib/variables/utils.d.ts +5 -5
  130. package/lib/variables/utils.d.ts.map +1 -1
  131. package/lib/variables/utils.js +2 -2
  132. package/lib/variables/utils.js.map +1 -1
  133. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts +2 -2
  134. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts.map +1 -1
  135. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +4 -4
  136. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js.map +1 -1
  137. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts +3 -3
  138. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts.map +1 -1
  139. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +5 -5
  140. package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js.map +1 -1
  141. package/lib/variables/victorialogs-field-names/index.js +1 -1
  142. package/lib/variables/victorialogs-field-names/index.js.map +1 -1
  143. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts +2 -2
  144. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts.map +1 -1
  145. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +4 -4
  146. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js.map +1 -1
  147. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts +3 -3
  148. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts.map +1 -1
  149. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +6 -6
  150. package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js.map +1 -1
  151. package/lib/variables/victorialogs-field-values/index.js +1 -1
  152. package/lib/variables/victorialogs-field-values/index.js.map +1 -1
  153. package/mf-manifest.json +117 -230
  154. package/mf-stats.json +117 -242
  155. package/package.json +20 -12
  156. package/__mf/js/async/1170.532d9fb3.js +0 -101
  157. package/__mf/js/async/1616.5a6b8ab3.js +0 -1
  158. package/__mf/js/async/1728.b01c38aa.js +0 -1
  159. package/__mf/js/async/1969.fc35e1b4.js +0 -1
  160. package/__mf/js/async/198.fbb67f8a.js +0 -2
  161. package/__mf/js/async/2043.b149adfd.js +0 -2
  162. package/__mf/js/async/2043.b149adfd.js.LICENSE.txt +0 -24
  163. package/__mf/js/async/2377.9265b0a7.js +0 -1
  164. package/__mf/js/async/2728.fd6779e6.js +0 -1
  165. package/__mf/js/async/2749.71c38fe0.js +0 -2
  166. package/__mf/js/async/2842.3740ca9b.js +0 -1
  167. package/__mf/js/async/3059.fe1cdfc3.js +0 -1
  168. package/__mf/js/async/392.c6e57bd8.js +0 -2
  169. package/__mf/js/async/3981.02c66856.js +0 -3
  170. package/__mf/js/async/3998.e9a3cf1a.js +0 -2
  171. package/__mf/js/async/4121.5468ac01.js +0 -2
  172. package/__mf/js/async/4225.744952e9.js +0 -10
  173. package/__mf/js/async/4248.9b99209c.js +0 -1
  174. package/__mf/js/async/5019.51d94aab.js +0 -1
  175. package/__mf/js/async/5071.6ac86637.js +0 -1
  176. package/__mf/js/async/5405.004a286a.js +0 -2
  177. package/__mf/js/async/5405.004a286a.js.LICENSE.txt +0 -37
  178. package/__mf/js/async/5440.7765ad14.js +0 -2
  179. package/__mf/js/async/5481.b7b48b8f.js +0 -2
  180. package/__mf/js/async/5587.12959dbf.js +0 -1
  181. package/__mf/js/async/5706.55b9ef2f.js +0 -1
  182. package/__mf/js/async/6274.0634d636.js +0 -2
  183. package/__mf/js/async/6408.2bc7e8f4.js +0 -7
  184. package/__mf/js/async/6408.2bc7e8f4.js.LICENSE.txt +0 -39
  185. package/__mf/js/async/6410.63a88be6.js +0 -1
  186. package/__mf/js/async/6592.24e266ac.js +0 -1
  187. package/__mf/js/async/6854.21ddded3.js +0 -1
  188. package/__mf/js/async/6864.66bc6315.js +0 -2
  189. package/__mf/js/async/7177.dfbac40a.js +0 -1
  190. package/__mf/js/async/7192.339adba2.js +0 -1
  191. package/__mf/js/async/7793.43841fdc.js +0 -1
  192. package/__mf/js/async/7817.5e96b0dd.js +0 -2
  193. package/__mf/js/async/7968.d586d9f8.js +0 -1
  194. package/__mf/js/async/7978.895bbb5f.js +0 -1
  195. package/__mf/js/async/7984.194982d6.js +0 -22
  196. package/__mf/js/async/8356.053c21d0.js +0 -1
  197. package/__mf/js/async/8470.cb89de3b.js +0 -2
  198. package/__mf/js/async/873.4df0ea19.js +0 -1
  199. package/__mf/js/async/8787.c3298397.js +0 -2
  200. package/__mf/js/async/9235.3e1de7b9.js +0 -1
  201. package/__mf/js/async/941.a44f722e.js +0 -2
  202. package/__mf/js/async/9588.c379dd44.js +0 -1
  203. package/__mf/js/async/9836.fd9de3af.js +0 -1
  204. package/__mf/js/async/9877.8b83de3c.js +0 -38
  205. package/__mf/js/async/9944.4d41cb7b.js +0 -1
  206. package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.807ae747.js +0 -2
  207. package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.ccafeb36.js +0 -1
  208. package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.5e29c327.js +0 -1
  209. package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.6e607640.js +0 -1
  210. package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.91a8ad9d.js +0 -1
  211. package/lib/cjs/bootstrap.js +0 -26
  212. package/lib/cjs/components/index.js +0 -23
  213. package/lib/cjs/components/logsql-editor.js +0 -110
  214. package/lib/cjs/components/logsql-extension.js +0 -55
  215. package/lib/cjs/components/logsql-highlight.js +0 -40
  216. package/lib/cjs/datasources/index.js +0 -30
  217. package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +0 -61
  218. package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +0 -95
  219. package/lib/cjs/datasources/victorialogs-datasource/index.js +0 -32
  220. package/lib/cjs/datasources/victorialogs-datasource/types.js +0 -16
  221. package/lib/cjs/env.d.js +0 -14
  222. package/lib/cjs/getPluginModule.js +0 -39
  223. package/lib/cjs/index-federation.js +0 -55
  224. package/lib/cjs/index.js +0 -39
  225. package/lib/cjs/model/client.js +0 -156
  226. package/lib/cjs/model/index.js +0 -32
  227. package/lib/cjs/model/selectors.js +0 -47
  228. package/lib/cjs/model/types.js +0 -16
  229. package/lib/cjs/queries/constants.js +0 -34
  230. package/lib/cjs/queries/index.js +0 -31
  231. package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +0 -63
  232. package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +0 -114
  233. package/lib/cjs/queries/victorialogs-log-query/index.js +0 -33
  234. package/lib/cjs/queries/victorialogs-log-query/query.js +0 -73
  235. package/lib/cjs/queries/victorialogs-log-query/types.js +0 -16
  236. package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +0 -43
  237. package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +0 -112
  238. package/lib/cjs/queries/victorialogs-time-series-query/index.js +0 -33
  239. package/lib/cjs/queries/victorialogs-time-series-query/query.js +0 -126
  240. package/lib/cjs/queries/victorialogs-time-series-query/types.js +0 -16
  241. package/lib/cjs/setup-tests.js +0 -19
  242. package/lib/cjs/variables/index.js +0 -31
  243. package/lib/cjs/variables/types.js +0 -16
  244. package/lib/cjs/variables/utils.js +0 -97
  245. package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +0 -57
  246. package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +0 -80
  247. package/lib/cjs/variables/victorialogs-field-names/index.js +0 -30
  248. package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +0 -61
  249. package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +0 -113
  250. package/lib/cjs/variables/victorialogs-field-values/index.js +0 -30
  251. /package/__mf/css/async/{6408.85c2cbf6.css → 7155.85c2cbf6.css} +0 -0
  252. /package/__mf/js/async/{7984.194982d6.js.LICENSE.txt → 1522.e41aa623.js.LICENSE.txt} +0 -0
  253. /package/__mf/js/async/{198.fbb67f8a.js.LICENSE.txt → 198.4b388f96.js.LICENSE.txt} +0 -0
  254. /package/__mf/js/async/{2749.71c38fe0.js.LICENSE.txt → 2786.4ba35a40.js.LICENSE.txt} +0 -0
  255. /package/__mf/js/async/{392.c6e57bd8.js.LICENSE.txt → 392.8532b8b9.js.LICENSE.txt} +0 -0
  256. /package/__mf/js/async/{4121.5468ac01.js.LICENSE.txt → 4121.43679b06.js.LICENSE.txt} +0 -0
  257. /package/__mf/js/async/{3998.e9a3cf1a.js.LICENSE.txt → 4960.813e0b59.js.LICENSE.txt} +0 -0
  258. /package/__mf/js/async/{5440.7765ad14.js.LICENSE.txt → 5440.e2ea1262.js.LICENSE.txt} +0 -0
  259. /package/__mf/js/async/{6274.0634d636.js.LICENSE.txt → 6274.efc9c64a.js.LICENSE.txt} +0 -0
  260. /package/__mf/js/async/{6864.66bc6315.js.LICENSE.txt → 7817.620f3116.js.LICENSE.txt} +0 -0
  261. /package/__mf/js/async/{5481.b7b48b8f.js.LICENSE.txt → 7862.e6de7017.js.LICENSE.txt} +0 -0
  262. /package/__mf/js/async/{8470.cb89de3b.js.LICENSE.txt → 8470.6cf8f7b1.js.LICENSE.txt} +0 -0
  263. /package/__mf/js/async/{7817.5e96b0dd.js.LICENSE.txt → 941.73cfe62f.js.LICENSE.txt} +0 -0
  264. /package/__mf/js/async/{4225.744952e9.js.LICENSE.txt → 9440.37da95ff.js.LICENSE.txt} +0 -0
  265. /package/__mf/js/async/{8787.c3298397.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.db12b897.js.LICENSE.txt} +0 -0
  266. /package/__mf/js/async/{941.a44f722e.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.59ed2274.js.LICENSE.txt} +0 -0
  267. /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.807ae747.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.fcbe16ef.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQuery.tsx"],"sourcesContent":["// Copyright 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 { QueryDefinition } from '@perses-dev/spec';\nimport { LogQueryPlugin, LogQueryContext, calculateVolumeInterval, parseVariables } from '@perses-dev/plugin-system';\nimport { getVictoriaLogsLogData } from './query';\nimport { VictoriaLogsLogQueryEditor } from './VictoriaLogsLogQueryEditor';\nimport { VictoriaLogsLogQuerySpec } from './types';\n\nexport const VictoriaLogsLogQuery: LogQueryPlugin<VictoriaLogsLogQuerySpec> = {\n getLogData: getVictoriaLogsLogData,\n OptionsEditorComponent: VictoriaLogsLogQueryEditor,\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 createVolumeQuery: (spec: VictoriaLogsLogQuerySpec, ctx: LogQueryContext): QueryDefinition | null => {\n if (!spec.query || !spec.query.trim()) {\n return null;\n }\n\n const interval = calculateVolumeInterval(ctx.timeRange.end.getTime() - ctx.timeRange.start.getTime());\n const volumeQuery = `${spec.query} | stats by (_time:${interval}, _stream) count() as volume`;\n\n return {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'VictoriaLogsTimeSeriesQuery',\n spec: {\n query: volumeQuery,\n datasource: spec.datasource,\n step: interval,\n },\n },\n },\n };\n },\n};\n"],"names":["calculateVolumeInterval","parseVariables","getVictoriaLogsLogData","VictoriaLogsLogQueryEditor","VictoriaLogsLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables","createVolumeQuery","ctx","trim","interval","timeRange","end","getTime","start","volumeQuery","kind","plugin","datasource","step"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAA0CA,uBAAuB,EAAEC,cAAc,QAAQ,4BAA4B;AACrH,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,0BAA0B,QAAQ,+BAA+B;AAG1E,OAAO,MAAMC,uBAAiE;IAC5EC,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;IACAG,mBAAmB,CAACL,MAAgCM;QAClD,IAAI,CAACN,KAAKF,KAAK,IAAI,CAACE,KAAKF,KAAK,CAACS,IAAI,IAAI;YACrC,OAAO;QACT;QAEA,MAAMC,WAAWlB,wBAAwBgB,IAAIG,SAAS,CAACC,GAAG,CAACC,OAAO,KAAKL,IAAIG,SAAS,CAACG,KAAK,CAACD,OAAO;QAClG,MAAME,cAAc,GAAGb,KAAKF,KAAK,CAAC,mBAAmB,EAAEU,SAAS,4BAA4B,CAAC;QAE7F,OAAO;YACLM,MAAM;YACNd,MAAM;gBACJe,QAAQ;oBACND,MAAM;oBACNd,MAAM;wBACJF,OAAOe;wBACPG,YAAYhB,KAAKgB,UAAU;wBAC3BC,MAAMT;oBACR;gBACF;YACF;QACF;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQuery.tsx"],"sourcesContent":["// Copyright 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 type { LogQueryPlugin, LogQueryContext } from '@perses-dev/plugin-system';\nimport { calculateVolumeInterval, parseVariables } from '@perses-dev/plugin-system';\nimport type { QueryDefinition } from '@perses-dev/spec';\n\nimport { getVictoriaLogsLogData } from './query';\nimport type { VictoriaLogsLogQuerySpec } from './types';\nimport { VictoriaLogsLogQueryEditor } from './VictoriaLogsLogQueryEditor';\n\nexport const VictoriaLogsLogQuery: LogQueryPlugin<VictoriaLogsLogQuerySpec> = {\n getLogData: getVictoriaLogsLogData,\n OptionsEditorComponent: VictoriaLogsLogQueryEditor,\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 createVolumeQuery: (spec: VictoriaLogsLogQuerySpec, ctx: LogQueryContext): QueryDefinition | null => {\n if (!spec.query || !spec.query.trim()) {\n return null;\n }\n\n const interval = calculateVolumeInterval(ctx.timeRange.end.getTime() - ctx.timeRange.start.getTime());\n const volumeQuery = `${spec.query} | stats by (_time:${interval}, _stream) count() as volume`;\n\n return {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'VictoriaLogsTimeSeriesQuery',\n spec: {\n query: volumeQuery,\n datasource: spec.datasource,\n step: interval,\n },\n },\n },\n };\n },\n};\n"],"names":["calculateVolumeInterval","parseVariables","getVictoriaLogsLogData","VictoriaLogsLogQueryEditor","VictoriaLogsLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables","createVolumeQuery","ctx","trim","interval","timeRange","end","getTime","start","volumeQuery","kind","plugin","datasource","step"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,uBAAuB,EAAEC,cAAc,QAAQ,4BAA4B;AAGpF,SAASC,sBAAsB,QAAQ,aAAU;AAEjD,SAASC,0BAA0B,QAAQ,kCAA+B;AAE1E,OAAO,MAAMC,uBAAiE;IAC5EC,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,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;IACAG,mBAAmB,CAACL,MAAgCM;QAClD,IAAI,CAACN,KAAKF,KAAK,IAAI,CAACE,KAAKF,KAAK,CAACS,IAAI,IAAI;YACrC,OAAO;QACT;QAEA,MAAMC,WAAWlB,wBAAwBgB,IAAIG,SAAS,CAACC,GAAG,CAACC,OAAO,KAAKL,IAAIG,SAAS,CAACG,KAAK,CAACD,OAAO;QAClG,MAAME,cAAc,GAAGb,KAAKF,KAAK,CAAC,mBAAmB,EAAEU,SAAS,4BAA4B,CAAC;QAE7F,OAAO;YACLM,MAAM;YACNd,MAAM;gBACJe,QAAQ;oBACND,MAAM;oBACNd,MAAM;wBACJF,OAAOe;wBACPG,YAAYhB,KAAKgB,UAAU;wBAC3BC,MAAMT;oBACR;gBACF;YACF;QACF;IACF;AACF,EAAE"}
@@ -1,6 +1,6 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { VictoriaLogsLogQuerySpec } from './types';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { VictoriaLogsLogQuerySpec } from './types';
4
4
  type VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;
5
5
  export declare function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAoC,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAoF5F"}
1
+ {"version":3,"file":"VictoriaLogsLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAEjF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAoF5F"}
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';
15
- import { InputLabel, Stack } from '@mui/material';
16
- import { useCallback, useState, useEffect } from 'react';
17
- import { createModEnterHandler } from '@perses-dev/dashboards';
18
- import { LogsQLEditor } from '../../components/logsql-editor';
19
- import { VICTORIALOGS_DATASOURCE_KIND } from '../../model';
20
- import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
14
+ import { InputLabel, Stack } from "@mui/material";
15
+ import { createModEnterHandler } from "@perses-dev/dashboards";
16
+ import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
17
+ import { useCallback, useState, useEffect } from "react";
18
+ import { LogsQLEditor } from "../../components/logsql-editor.js";
19
+ import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
20
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
21
21
  export function VictoriaLogsLogQueryEditor(props) {
22
22
  const { onChange, value } = props;
23
23
  const { datasource } = value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright 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 } from '@mui/material';\nimport { ReactElement, useCallback, useState, useEffect } from 'react';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport { VICTORIALOGS_DATASOURCE_KIND, VictoriaLogsDatasourceSelector } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { VictoriaLogsLogQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;\n\nexport function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND\n ) as VictoriaLogsDatasourceSelector;\n\n // const { data: client } = useDatasourceClient<VictoriaLogsClient>(selectedDatasource);\n // const victorialogsURL = 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 VictoriaLogsQuery 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 // 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=\"VictoriaLogs 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 LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","InputLabel","Stack","useCallback","useState","useEffect","createModEnterHandler","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B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AAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACZ;QAAM0B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAC7B;wBACC8B,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACpC;wBACCqC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAC7B;wBACC8B,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWjC,sBAAsB,IAAMqB,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.tsx"],"sourcesContent":["// Copyright 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 { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState, useEffect } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsLogQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsLogQuerySpec>;\n\nexport function VictoriaLogsLogQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\n\n // const { data: client } = useDatasourceClient<VictoriaLogsClient>(selectedDatasource);\n // const victorialogsURL = 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 VictoriaLogsQuery 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 // 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=\"VictoriaLogs 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 LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsLogQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,kCAAkC,QAAQ,4BAA4B;AAEvH,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AAEzD,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AAKnE,OAAO,SAASC,2BAA2BC,KAAmC;IAC5E,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EA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CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './query';
14
- export * from './VictoriaLogsLogQuery';
15
- export * from './VictoriaLogsLogQueryEditor';
16
- export * from './types';
13
+ export * from "./query.js";
14
+ export * from "./VictoriaLogsLogQuery.js";
15
+ export * from "./VictoriaLogsLogQueryEditor.js";
16
+ export * from "./types.js";
17
17
 
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/index.ts"],"sourcesContent":["// Copyright 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 './query';\nexport * from './VictoriaLogsLogQuery';\nexport * from './VictoriaLogsLogQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,UAAU"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/index.ts"],"sourcesContent":["// Copyright 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 './query';\nexport * from './VictoriaLogsLogQuery';\nexport * from './VictoriaLogsLogQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAU;AACxB,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,aAAU"}
@@ -1,4 +1,4 @@
1
- import { LogQueryPlugin } from '@perses-dev/plugin-system';
2
- import { VictoriaLogsLogQuerySpec } from './types';
1
+ import type { LogQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { VictoriaLogsLogQuerySpec } from './types';
3
3
  export declare const getVictoriaLogsLogData: LogQueryPlugin<VictoriaLogsLogQuerySpec>['getLogData'];
4
4
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAoB,cAAc,EAAmB,MAAM,2BAA2B,CAAC;AAK9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAqBnD,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC,YAAY,CAiCzF,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,2BAA2B,CAAC;AAOjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAqBxD,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC,YAAY,CAiCzF,CAAC"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { replaceVariables } from '@perses-dev/plugin-system';
14
- import { DEFAULT_DATASOURCE } from '../constants';
13
+ import { replaceVariables } from "@perses-dev/plugin-system";
14
+ import { DEFAULT_DATASOURCE } from "../constants.js";
15
15
  function convertStreamToLogs(data, defaultTime) {
16
16
  const entries = [];
17
17
  data.forEach((entry)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"sourcesContent":["// Copyright 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 { replaceVariables, LogQueryPlugin, LogQueryContext } from '@perses-dev/plugin-system';\nimport { LogData, LogEntry } from '@perses-dev/spec';\nimport { VictoriaLogsStreamQueryRangeResponse } from '../../model/types';\nimport { VictoriaLogsClient } from '../../model/client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { VictoriaLogsLogQuerySpec } from './types';\n\nfunction convertStreamToLogs(data: VictoriaLogsStreamQueryRangeResponse, defaultTime: string): LogData {\n const entries: LogEntry[] = [];\n\n data.forEach((entry) => {\n const { _msg, _time, ...labels } = entry;\n const time = !_time && !_msg ? defaultTime : Date.parse(_time);\n entries.push({\n timestamp: Number(time) / 1000,\n line: _msg || '',\n labels: labels,\n });\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getVictoriaLogsLogData: LogQueryPlugin<VictoriaLogsLogQuerySpec>['getLogData'] = async (\n spec: VictoriaLogsLogQuerySpec,\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<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const response: VictoriaLogsStreamQueryRangeResponse = await client.streamQueryRange({\n query,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n const logs = convertStreamToLogs(response, end.getTime().toString());\n\n return {\n logs,\n timeRange: { start, end },\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","convertStreamToLogs","data","defaultTime","entries","forEach","entry","_msg","_time","labels","time","Date","parse","push","timestamp","Number","line","totalCount","length","getVictoriaLogsLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","streamQueryRange","toISOString","getTime","toString","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,gBAAgB,QAAyC,4BAA4B;AAI9F,SAASC,kBAAkB,QAAQ,eAAe;AAGlD,SAASC,oBAAoBC,IAA0C,EAAEC,WAAmB;IAC1F,MAAMC,UAAsB,EAAE;IAE9BF,KAAKG,OAAO,CAAC,CAACC;QACZ,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,GAAGH;QACnC,MAAMI,OAAO,CAACF,SAAS,CAACD,OAAOJ,cAAcQ,KAAKC,KAAK,CAACJ;QACxDJ,QAAQS,IAAI,CAAC;YACXC,WAAWC,OAAOL,QAAQ;YAC1BM,MAAMT,QAAQ;YACdE,QAAQA;QACV;IACF;IAEA,OAAO;QACLL;QACAa,YAAYb,QAAQc,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,yBAAiF,OAC5FC,MACAC;IAEA,IAAI,CAACD,KAAKE,KAAK,EAAE;QACf,OAAO;YACLC,MAAM;gBAAEnB,SAAS,EAAE;gBAAEa,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQvB,iBAAiBqB,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAChE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI/B;IAGrB,MAAM,EAAEyB,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAiD,MAAMJ,OAAOK,gBAAgB,CAAC;QACnFX;QACAG,OAAOA,MAAMS,WAAW;QACxBR,KAAKA,IAAIQ,WAAW;IACtB;IAEA,MAAMX,OAAOtB,oBAAoB+B,UAAUN,IAAIS,OAAO,GAAGC,QAAQ;IAEjE,OAAO;QACLb;QACAC,WAAW;YAAEC;YAAOC;QAAI;QACxBW,UAAU;YACRC,qBAAqBhB;QACvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/query.ts"],"sourcesContent":["// Copyright 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 type { LogQueryPlugin, LogQueryContext } from '@perses-dev/plugin-system';\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport type { LogData, LogEntry } from '@perses-dev/spec';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport type { VictoriaLogsStreamQueryRangeResponse } from '../../model/types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsLogQuerySpec } from './types';\n\nfunction convertStreamToLogs(data: VictoriaLogsStreamQueryRangeResponse, defaultTime: string): LogData {\n const entries: LogEntry[] = [];\n\n data.forEach((entry) => {\n const { _msg, _time, ...labels } = entry;\n const time = !_time && !_msg ? defaultTime : Date.parse(_time);\n entries.push({\n timestamp: Number(time) / 1000,\n line: _msg || '',\n labels: labels,\n });\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getVictoriaLogsLogData: LogQueryPlugin<VictoriaLogsLogQuerySpec>['getLogData'] = async (\n spec: VictoriaLogsLogQuerySpec,\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<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE,\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const response: VictoriaLogsStreamQueryRangeResponse = await client.streamQueryRange({\n query,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n const logs = convertStreamToLogs(response, end.getTime().toString());\n\n return {\n logs,\n timeRange: { start, end },\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","convertStreamToLogs","data","defaultTime","entries","forEach","entry","_msg","_time","labels","time","Date","parse","push","timestamp","Number","line","totalCount","length","getVictoriaLogsLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","streamQueryRange","toISO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AAMS,WAAW;QACxBR,KAAKA,IAAIQ,WAAW;IACtB;IAEA,MAAMX,OAAOtB,oBAAoB+B,UAAUN,IAAIS,OAAO,GAAGC,QAAQ;IAEjE,OAAO;QACLb;QACAC,WAAW;YAAEC;YAAOC;QAAI;QACxBW,UAAU;YACRC,qBAAqBhB;QACvB;IACF;AACF,EAAE"}
@@ -1,4 +1,4 @@
1
- import { DatasourceSelector } from '@perses-dev/spec';
1
+ import type { DatasourceSelector } from '@perses-dev/spec';
2
2
  export interface VictoriaLogsLogQuerySpec {
3
3
  query: string;
4
4
  datasource?: DatasourceSelector;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"sourcesContent":["// Copyright 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 { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-log-query/types.ts"],"sourcesContent":["// Copyright 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 type { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
@@ -1,4 +1,4 @@
1
- import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
- import { VictoriaLogsTimeSeriesQuerySpec } from './types';
1
+ import type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
3
3
  export declare const VictoriaLogsTimeSeriesQuery: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec>;
4
4
  //# sourceMappingURL=VictoriaLogsTimeSeriesQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VictoriaLogsTimeSeriesQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAkB,MAAM,2BAA2B,CAAC;AAGlF,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,eAAO,MAAM,2BAA2B,EAAE,qBAAqB,CAAC,+BAA+B,CAW9F,CAAC"}
1
+ {"version":3,"file":"VictoriaLogsTimeSeriesQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAG/D,eAAO,MAAM,2BAA2B,EAAE,qBAAqB,CAAC,+BAA+B,CAW9F,CAAC"}
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { parseVariables } from '@perses-dev/plugin-system';
14
- import { getVictoriaLogsTimeSeriesData } from './query';
15
- import { VictoriaLogsQueryEditor } from './VictoriaLogsTimeSeriesQueryEditor';
13
+ import { parseVariables } from "@perses-dev/plugin-system";
14
+ import { getVictoriaLogsTimeSeriesData } from "./query.js";
15
+ import { VictoriaLogsQueryEditor } from "./VictoriaLogsTimeSeriesQueryEditor.js";
16
16
  export const VictoriaLogsTimeSeriesQuery = {
17
17
  getTimeSeriesData: getVictoriaLogsTimeSeriesData,
18
18
  OptionsEditorComponent: VictoriaLogsQueryEditor,
@@ -22,9 +22,7 @@ export const VictoriaLogsTimeSeriesQuery = {
22
22
  dependsOn: (spec)=>{
23
23
  const queryVariables = parseVariables(spec.query);
24
24
  const allVariables = [
25
- ...new Set([
26
- ...queryVariables
27
- ])
25
+ ...new Set(queryVariables)
28
26
  ];
29
27
  return {
30
28
  variables: allVariables
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"sourcesContent":["// Copyright 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 { getVictoriaLogsTimeSeriesData } from './query';\nimport { VictoriaLogsQueryEditor } from './VictoriaLogsTimeSeriesQueryEditor';\nimport { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\nexport const VictoriaLogsTimeSeriesQuery: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec> = {\n getTimeSeriesData: getVictoriaLogsTimeSeriesData,\n OptionsEditorComponent: VictoriaLogsQueryEditor,\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","getVictoriaLogsTimeSeriesData","VictoriaLogsQueryEditor","VictoriaLogsTimeSeriesQuery","getTimeSeriesData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,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,6BAA6B,QAAQ,UAAU;AACxD,SAASC,uBAAuB,QAAQ,sCAAsC;AAG9E,OAAO,MAAMC,8BAAsF;IACjGC,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"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.tsx"],"sourcesContent":["// Copyright 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 type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { parseVariables } from '@perses-dev/plugin-system';\n\nimport { getVictoriaLogsTimeSeriesData } from './query';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\nimport { VictoriaLogsQueryEditor } from './VictoriaLogsTimeSeriesQueryEditor';\n\nexport const VictoriaLogsTimeSeriesQuery: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec> = {\n getTimeSeriesData: getVictoriaLogsTimeSeriesData,\n OptionsEditorComponent: VictoriaLogsQueryEditor,\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","getVictoriaLogsTimeSeriesData","VictoriaLogsQueryEditor","VictoriaLogsTimeSeriesQuery","getTimeSeriesData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,cAAc,QAAQ,4BAA4B;AAE3D,SAASC,6BAA6B,QAAQ,aAAU;AAExD,SAASC,uBAAuB,QAAQ,yCAAsC;AAE9E,OAAO,MAAMC,8BAAsF;IACjGC,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,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
@@ -1,6 +1,6 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { VictoriaLogsTimeSeriesQuerySpec } from './types';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
4
4
  type VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;
5
5
  export declare function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAoC,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;AAExF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAiFzF"}
1
+ {"version":3,"file":"VictoriaLogsTimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,KAAK,4BAA4B,GAAG,kBAAkB,CAAC,+BAA+B,CAAC,CAAC;AAExF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAiFzF"}
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';
15
- import { InputLabel, Stack } from '@mui/material';
16
- import { useCallback, useState, useEffect } from 'react';
17
- import { createModEnterHandler } from '@perses-dev/dashboards';
18
- import { LogsQLEditor } from '../../components/logsql-editor';
19
- import { VICTORIALOGS_DATASOURCE_KIND } from '../../model';
20
- import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
14
+ import { InputLabel, Stack } from "@mui/material";
15
+ import { createModEnterHandler } from "@perses-dev/dashboards";
16
+ import { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from "@perses-dev/plugin-system";
17
+ import { useCallback, useState, useEffect } from "react";
18
+ import { LogsQLEditor } from "../../components/logsql-editor.js";
19
+ import { VICTORIALOGS_DATASOURCE_KIND } from "../../model/index.js";
20
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
21
21
  export function VictoriaLogsQueryEditor(props) {
22
22
  const { onChange, value } = props;
23
23
  const { datasource } = value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 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 } from '@mui/material';\nimport { ReactElement, useCallback, useState, useEffect } from 'react';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport { VICTORIALOGS_DATASOURCE_KIND, VictoriaLogsDatasourceSelector } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;\n\nexport function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND\n ) as VictoriaLogsDatasourceSelector;\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 VictoriaLogsQuery 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 // 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=\"VictoriaLogs 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 LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","InputLabel","Stack","useCallback","useState","useEffect","createModEnterHandler","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,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,QAAQ,gBAAgB;AAClD,SAAuBC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AACvE,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,4BAA4B,QAAwC,cAAc;AAC3F,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AAKnE,OAAO,SAASC,wBAAwBC,KAAmC;IACzE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,wBAAwBD,cAAcL;IAC5C,MAAMO,qBAAqBjB,mCACzBgB,uBACAR;IAGF,+EAA+E;IAC/E,MAAM,CAACU,YAAYC,cAAc,GAAGf,SAASU,MAAMM,KAAK;IAExD,uCAAuC;IACvCf,UAAU;QACRc,cAAcL,MAAMM,KAAK;IAC3B,GAAG;QAACN,MAAMM,KAAK;KAAC;IAEhB,MAAMC,yBAA4D,CAACC;QACjE,IAAI,CAACvB,qBAAqBuB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGI,SAAS;gBAAE,GAAGC,KAAK;gBAAEC,YAAYO;YAAuB;YACxD;QACF;QAEA,MAAM,IAAIE,MAAM;IAClB;IAEA,wEAAwE;IACxE,MAAMC,oBAAoBtB,YAAY,CAACuB;QACrCP,cAAcO;IAChB,GAAG,EAAE;IAEL,6CAA6C;IAC7C,MAAMC,qBAAqBxB,YACzB,CAACiB;QACCP,SAAS;YAAE,GAAGC,KAAK;YAAEM;QAAM;IAC7B,GACA;QAACP;QAAUC;KAAM;IAGnB,qBACE,MAACZ;QAAM0B,SAAS;QAAKC,eAAe;;0BAClC,MAACC;;kCACC,KAAC7B;wBACC8B,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAACpC;wBACCqC,sBAAsB1B;wBACtBK,OAAOG;wBACPJ,UAAUQ;wBACVe,OAAM;wBACNC,OAAO;;;;0BAIX,MAACP;;kCACC,KAAC7B;wBACC8B,IAAI;4BACFC,SAAS;4BACTC,cAAc;4BACdC,YAAY;wBACd;kCACD;;kCAGD,KAAC3B;wBACCO,OAAOI;wBACPL,UAAUY;wBACVa,QAAQ,IAAMX,mBAAmBT;wBACjCqB,WAAWjC,sBAAsB,IAAMqB,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 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 { InputLabel, Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\nimport { useCallback, useState, useEffect } from 'react';\n\nimport { LogsQLEditor } from '../../components/logsql-editor';\nimport type { VictoriaLogsDatasourceSelector } from '../../model';\nimport { VICTORIALOGS_DATASOURCE_KIND } from '../../model';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\ntype VictoriaLogsQueryEditorProps = OptionsEditorProps<VictoriaLogsTimeSeriesQuerySpec>;\n\nexport function VictoriaLogsQueryEditor(props: VictoriaLogsQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n VICTORIALOGS_DATASOURCE_KIND,\n ) as VictoriaLogsDatasourceSelector;\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 VictoriaLogsQuery 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 // 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=\"VictoriaLogs 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 LogsQL Query\n </InputLabel>\n <LogsQLEditor\n value={localQuery}\n onChange={handleQueryChange}\n onBlur={() => handleQueryExecute(localQuery)}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(localQuery))}\n placeholder='Enter LogsQL query (e.g. {job=\"mysql\"} |= \"error\")'\n // height=\"120px\"\n />\n </div>\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","useDatasourceSelectValueToSelector","useCallback","useState","useEffect","LogsQLEditor","VICTORIALOGS_DATASOURCE_KIND","DATASOURCE_KIND","DEFAULT_DATASOURCE","VictoriaLogsQueryEditor","props","onChange","value","datasource","datasourceSelectValue","selectedDatasource","localQuery","setLocalQuery","query","handleDatasourceChange","newDatasourceSelection","kind","Error","handleQueryChange","newQuery","handleQueryExecute","spacing","paddingBottom","div","sx","display","marginBottom","fontWeight","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAClD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,kCAAkC,QAAQ,4BAA4B;AAEvH,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,QAAQ;AAEzD,SAASC,YAAY,QAAQ,oCAAiC;AAE9D,SAASC,4BAA4B,QAAQ,uBAAc;AAC3D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jCqB,WAAWvC,sBAAsB,IAAM2B,mBAAmBT;wBAC1DsB,aAAY;;;;;;AAMtB"}
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './query';
14
- export * from './VictoriaLogsTimeSeriesQuery';
15
- export * from './VictoriaLogsTimeSeriesQueryEditor';
16
- export * from './types';
13
+ export * from "./query.js";
14
+ export * from "./VictoriaLogsTimeSeriesQuery.js";
15
+ export * from "./VictoriaLogsTimeSeriesQueryEditor.js";
16
+ export * from "./types.js";
17
17
 
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/index.ts"],"sourcesContent":["// Copyright 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 './query';\nexport * from './VictoriaLogsTimeSeriesQuery';\nexport * from './VictoriaLogsTimeSeriesQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,gCAAgC;AAC9C,cAAc,sCAAsC;AACpD,cAAc,UAAU"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/index.ts"],"sourcesContent":["// Copyright 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 './query';\nexport * from './VictoriaLogsTimeSeriesQuery';\nexport * from './VictoriaLogsTimeSeriesQueryEditor';\nexport * from './types';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAU;AACxB,cAAc,mCAAgC;AAC9C,cAAc,yCAAsC;AACpD,cAAc,aAAU"}
@@ -1,5 +1,5 @@
1
- import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
- import { VictoriaLogsTimeSeriesQuerySpec } from './types';
1
+ import type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { VictoriaLogsTimeSeriesQuerySpec } from './types';
3
3
  export type VictoriaLogsMatrixResult = {
4
4
  metric: Record<string, string>;
5
5
  values: Array<[number, string]>;
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,2BAA2B,CAAC;AAMpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,QAAQ,CAAC;IACrB,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC,CAAC;AA+EF,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,CAAC,+BAA+B,CAAC,CAAC,mBAAmB,CAkDnH,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AASvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,QAAQ,CAAC;IACrB,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACpC,CAAC;AA+EF,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,CAAC,+BAA+B,CAAC,CAAC,mBAAmB,CAkDnH,CAAC"}
@@ -10,10 +10,10 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { replaceVariables } from '@perses-dev/plugin-system';
14
- import { milliseconds } from 'date-fns';
15
- import { parseDurationString } from '@perses-dev/spec';
16
- import { DEFAULT_DATASOURCE } from '../constants';
13
+ import { replaceVariables } from "@perses-dev/plugin-system";
14
+ import { parseDurationString } from "@perses-dev/spec";
15
+ import { milliseconds } from "date-fns";
16
+ import { DEFAULT_DATASOURCE } from "../constants.js";
17
17
  // Constants for VictoriaLogs step calculation
18
18
  const MAX_VICTORIALOGS_DATA_POINTS = 10000; // Similar to Prometheus
19
19
  const DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"sourcesContent":["// Copyright 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, replaceVariables } from '@perses-dev/plugin-system';\nimport { milliseconds } from 'date-fns';\nimport { DurationString, parseDurationString, TimeSeries } from '@perses-dev/spec';\nimport { VictoriaLogsClient } from '../../model/client';\nimport { VictoriaLogsStatsQueryRangeResponse } from '../../model/types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\nexport type VictoriaLogsMatrixResult = {\n metric: Record<string, string>;\n values: Array<[number, string]>;\n};\n\nexport type VictoriaLogsMatrixResponse = {\n resultType: 'matrix';\n result: VictoriaLogsMatrixResult[];\n};\n\n// Constants for VictoriaLogs step calculation\nconst MAX_VICTORIALOGS_DATA_POINTS = 10000; // Similar to Prometheus\nconst DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum\n\n/**\n * Converts a duration string (like \"15s\", \"1m\") to seconds\n */\nfunction getDurationStringSeconds(durationString?: DurationString): number | undefined {\n if (!durationString) return undefined;\n\n const duration = parseDurationString(durationString);\n const ms = milliseconds(duration);\n return Math.floor(ms / 1000);\n}\n\n/**\n * Calculates appropriate step for VictoriaLogs range queries\n */\nfunction getVictoriaLogsRangeStep(\n startMs: number,\n endMs: number,\n minStepSeconds = DEFAULT_MIN_STEP_SECONDS,\n suggestedStepMs = 0\n): number {\n const suggestedStepSeconds = suggestedStepMs / 1000;\n const querySeconds = (endMs - startMs) / 1000;\n\n let safeStep = querySeconds / MAX_VICTORIALOGS_DATA_POINTS;\n if (safeStep > 1) {\n safeStep = Math.ceil(safeStep);\n }\n\n return Math.max(suggestedStepSeconds, minStepSeconds, safeStep);\n}\n\n/**\n * Formats step in seconds as a duration string for VictoriaLogs API\n */\nfunction formatStepForVictoriaLogs(stepSeconds: number): string {\n if (stepSeconds < 60) {\n return `${Math.round(stepSeconds)}s`;\n } else if (stepSeconds < 3600) {\n return `${Math.round(stepSeconds / 60)}m`;\n } else {\n return `${Math.round(stepSeconds / 3600)}h`;\n }\n}\n\nfunction convertMatrixToTimeSeries(matrix: VictoriaLogsMatrixResult[]): TimeSeries[] {\n return matrix.map((series) => {\n const labels = { ...series.metric };\n delete labels._stream;\n delete labels.__name__;\n\n if (series.metric._stream) {\n const match = series.metric._stream.match(/{([^}]+)}/);\n if (match && match[1]) {\n match[1].split(',').forEach((labelPair) => {\n const [key, val] = labelPair.split('=').map((s) => s.trim().replace(/^\"|\"$/g, ''));\n if (key && val) labels[key] = val;\n });\n }\n }\n const name = Object.entries(labels)\n .map(([k, v]) => `${k}=${v}`)\n .join(', ');\n return {\n name: name,\n values: series.values.map(([timestamp, value]) => [\n Number(timestamp) * 1000, // Convert seconds to milliseconds\n Number(value),\n ]),\n labels,\n };\n });\n}\n\nexport const getVictoriaLogsTimeSeriesData: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec>['getTimeSeriesData'] =\n async (spec, context) => {\n if (!spec.query) {\n return {\n series: [],\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n stepMs: DEFAULT_MIN_STEP_SECONDS * 1000,\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n const client = (await context.datasourceStore.getDatasourceClient<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const minStepSeconds = spec.step\n ? (getDurationStringSeconds(spec.step as DurationString) ?? DEFAULT_MIN_STEP_SECONDS)\n : DEFAULT_MIN_STEP_SECONDS;\n const stepSeconds = getVictoriaLogsRangeStep(\n start.getTime(),\n end.getTime(),\n minStepSeconds,\n context.suggestedStepMs\n );\n const stepString = formatStepForVictoriaLogs(stepSeconds);\n const stepMs = stepSeconds * 1000;\n\n const response: VictoriaLogsStatsQueryRangeResponse = await client.statsQueryRange({\n query,\n step: stepString,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n if (response.status === 'error') {\n throw new Error(response.error);\n }\n\n const series = convertMatrixToTimeSeries(response.data.result as VictoriaLogsMatrixResult[]);\n\n return {\n series: series,\n timeRange: { start, end },\n stepMs,\n metadata: {\n executedQueryString: query,\n },\n };\n };\n"],"names":["replaceVariables","milliseconds","parseDurationString","DEFAULT_DATASOURCE","MAX_VICTORIALOGS_DATA_POINTS","DEFAULT_MIN_STEP_SECONDS","getDurationStringSeconds","durationString","undefined","duration","ms","Math","floor","getVictoriaLogsRangeStep","startMs","endMs","minStepSeconds","suggestedStepMs","suggestedStepSeconds","querySeconds","safeStep","ceil","max","formatStepForVictoriaLogs","stepSeconds","round","convertMatrixToTimeSeries","matrix","map","series","labels","metric","_stream","__name__","match","split","forEach","labelPair","key","val","s","trim","replace","name","Object","entries","k","v","join","values","timestamp","value","Number","getVictoriaLogsTimeSeriesData","spec","context","query","timeRange","start","end","stepMs","variableState","client","datasourceStore","getDatasourceClient","datasource","step","getTime","stepString","response","statsQueryRange","toISOString","status","Error","error","data","result","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAgCA,gBAAgB,QAAQ,4BAA4B;AACpF,SAASC,YAAY,QAAQ,WAAW;AACxC,SAAyBC,mBAAmB,QAAoB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AAO,IACbR,IAAIQ,OAAO,IACXnD,gBACAuC,QAAQtC,eAAe;IAEzB,MAAMmD,aAAa7C,0BAA0BC;IAC7C,MAAMoC,SAASpC,cAAc;IAE7B,MAAM6C,WAAgD,MAAMP,OAAOQ,eAAe,CAAC;QACjFd;QACAU,MAAME;QACNV,OAAOA,MAAMa,WAAW;QACxBZ,KAAKA,IAAIY,WAAW;IACtB;IAEA,IAAIF,SAASG,MAAM,KAAK,SAAS;QAC/B,MAAM,IAAIC,MAAMJ,SAASK,KAAK;IAChC;IAEA,MAAM7C,SAASH,0BAA0B2C,SAASM,IAAI,CAACC,MAAM;IAE7D,OAAO;QACL/C,QAAQA;QACR4B,WAAW;YAAEC;YAAOC;QAAI;QACxBC;QACAiB,UAAU;YACRC,qBAAqBtB;QACvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/query.ts"],"sourcesContent":["// Copyright 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 type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport type { DurationString, TimeSeries } from '@perses-dev/spec';\nimport { parseDurationString } from '@perses-dev/spec';\nimport { milliseconds } from 'date-fns';\n\nimport type { VictoriaLogsClient } from '../../model/client';\nimport type { VictoriaLogsStatsQueryRangeResponse } from '../../model/types';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport type { VictoriaLogsTimeSeriesQuerySpec } from './types';\n\nexport type VictoriaLogsMatrixResult = {\n metric: Record<string, string>;\n values: Array<[number, string]>;\n};\n\nexport type VictoriaLogsMatrixResponse = {\n resultType: 'matrix';\n result: VictoriaLogsMatrixResult[];\n};\n\n// Constants for VictoriaLogs step calculation\nconst MAX_VICTORIALOGS_DATA_POINTS = 10000; // Similar to Prometheus\nconst DEFAULT_MIN_STEP_SECONDS = 15; // 15 seconds default minimum\n\n/**\n * Converts a duration string (like \"15s\", \"1m\") to seconds\n */\nfunction getDurationStringSeconds(durationString?: DurationString): number | undefined {\n if (!durationString) return undefined;\n\n const duration = parseDurationString(durationString);\n const ms = milliseconds(duration);\n return Math.floor(ms / 1000);\n}\n\n/**\n * Calculates appropriate step for VictoriaLogs range queries\n */\nfunction getVictoriaLogsRangeStep(\n startMs: number,\n endMs: number,\n minStepSeconds = DEFAULT_MIN_STEP_SECONDS,\n suggestedStepMs = 0,\n): number {\n const suggestedStepSeconds = suggestedStepMs / 1000;\n const querySeconds = (endMs - startMs) / 1000;\n\n let safeStep = querySeconds / MAX_VICTORIALOGS_DATA_POINTS;\n if (safeStep > 1) {\n safeStep = Math.ceil(safeStep);\n }\n\n return Math.max(suggestedStepSeconds, minStepSeconds, safeStep);\n}\n\n/**\n * Formats step in seconds as a duration string for VictoriaLogs API\n */\nfunction formatStepForVictoriaLogs(stepSeconds: number): string {\n if (stepSeconds < 60) {\n return `${Math.round(stepSeconds)}s`;\n } else if (stepSeconds < 3600) {\n return `${Math.round(stepSeconds / 60)}m`;\n } else {\n return `${Math.round(stepSeconds / 3600)}h`;\n }\n}\n\nfunction convertMatrixToTimeSeries(matrix: VictoriaLogsMatrixResult[]): TimeSeries[] {\n return matrix.map((series) => {\n const labels = { ...series.metric };\n delete labels._stream;\n delete labels.__name__;\n\n if (series.metric._stream) {\n const match = series.metric._stream.match(/{([^}]+)}/);\n if (match && match[1]) {\n match[1].split(',').forEach((labelPair) => {\n const [key, val] = labelPair.split('=').map((s) => s.trim().replace(/^\"|\"$/g, ''));\n if (key && val) labels[key] = val;\n });\n }\n }\n const name = Object.entries(labels)\n .map(([k, v]) => `${k}=${v}`)\n .join(', ');\n return {\n name: name,\n values: series.values.map(([timestamp, value]) => [\n Number(timestamp) * 1000, // Convert seconds to milliseconds\n Number(value),\n ]),\n labels,\n };\n });\n}\n\nexport const getVictoriaLogsTimeSeriesData: TimeSeriesQueryPlugin<VictoriaLogsTimeSeriesQuerySpec>['getTimeSeriesData'] =\n async (spec, context) => {\n if (!spec.query) {\n return {\n series: [],\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n stepMs: DEFAULT_MIN_STEP_SECONDS * 1000,\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n const client = (await context.datasourceStore.getDatasourceClient<VictoriaLogsClient>(\n spec.datasource ?? DEFAULT_DATASOURCE,\n )) as VictoriaLogsClient;\n\n const { start, end } = context.timeRange;\n\n const minStepSeconds = spec.step\n ? (getDurationStringSeconds(spec.step as DurationString) ?? DEFAULT_MIN_STEP_SECONDS)\n : DEFAULT_MIN_STEP_SECONDS;\n const stepSeconds = getVictoriaLogsRangeStep(\n start.getTime(),\n end.getTime(),\n minStepSeconds,\n context.suggestedStepMs,\n );\n const stepString = formatStepForVictoriaLogs(stepSeconds);\n const stepMs = stepSeconds * 1000;\n\n const response: VictoriaLogsStatsQueryRangeResponse = await client.statsQueryRange({\n query,\n step: stepString,\n start: start.toISOString(),\n end: end.toISOString(),\n });\n\n if (response.status === 'error') {\n throw new Error(response.error);\n }\n\n const series = convertMatrixToTimeSeries(response.data.result as VictoriaLogsMatrixResult[]);\n\n return {\n series: series,\n timeRange: { start, end },\n stepMs,\n metadata: {\n executedQueryString: query,\n },\n };\n };\n"],"names":["replaceVariables","parseDurationString","milliseconds","DEFAULT_DATASOURCE","MAX_VICTORIALOGS_DATA_POINTS","DEFAULT_MIN_STEP_SECONDS","getDurationStringSeconds","durationString","undefined","duration","ms","Math","floor","getVictoriaLogsRangeStep","startMs","endMs","minStepSeconds","suggestedStepMs","suggestedStepSeconds","querySeconds","safeStep","ceil","max","formatStepForVictoriaLogs","stepSeconds","round","convertMatrixToTimeSeries","matrix","map","series","labels","metric","_stream","__name__","match","split","forEach","labelPair","key","val","s","trim","replace","name","Object","entries","k","v","join","values","timestamp","value","Number","getVictoriaLogsTimeSeriesData","spec","context","query","timeRange","start","end","stepMs","variableState","client","datasourceStore","getDatasourceClient","datasource","step","getTime","stepString","response","statsQueryRange","toISOString","status","Error","error","data","result","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,YAAY,QAAQ,WAAW;AAIxC,SAASC,kBAAkB,QAAQ,kBAAe;AAalD,8CAA8C;AAC9C,MAAMC,+BAA+B,OAAO,wBAAwB;AACpE,MAAMC,2BAA2B,IAAI,6BAA6B;AAElE;;CAEC,GACD,SAASC,yBAAyBC,cAA+B;IAC/D,IAAI,CAACA,gBAAgB,OAAOC;IAE5B,MAAMC,WAAWR,oBAAoBM;IACrC,MAAMG,KAAKR,aAAaO;IACxB,OAAOE,KAAKC,KAAK,CAACF,KAAK;AACzB;AAEA;;CAEC,GACD,SAASG,yBACPC,OAAe,EACfC,KAAa,EACbC,iBAAiBX,wBAAwB,EACzCY,kBAAkB,CAAC;IAEnB,MAAMC,uBAAuBD,kBAAkB;IAC/C,MAAME,eAAe,AAACJ,CAAAA,QAAQD,OAAM,IAAK;IAEzC,IAAIM,WAAWD,eAAef;IAC9B,IAAIgB,WAAW,GAAG;QAChBA,WAAWT,KAAKU,IAAI,CAACD;IACvB;IAEA,OAAOT,KAAKW,GAAG,CAACJ,sBAAsBF,gBAAgBI;AACxD;AAEA;;CAEC,GACD,SAASG,0BAA0BC,WAAmB;IACpD,IAAIA,cAAc,IAAI;QACpB,OAAO,GAAGb,K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Q,EAAE;YACV4B,WAAW;gBAAEC,OAAOH,QAAQE,SAAS,CAACC,KAAK;gBAAEC,KAAKJ,QAAQE,SAAS,CAACE,GAAG;YAAC;YACxEC,QAAQvD,2BAA2B;QACrC;IACF;IAEA,MAAMmD,QAAQxD,iBAAiBsD,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAChE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI9D;IAGrB,MAAM,EAAEuD,KAAK,EAAEC,GAAG,EAAE,GAAGJ,QAAQE,SAAS;IAExC,MAAMzC,iBAAiBsC,KAAKY,IAAI,GAC3B5D,yBAAyBgD,KAAKY,IAAI,KAAuB7D,2BAC1DA;IACJ,MAAMmB,cAAcX,yBAClB6C,MAAMS,OAAO,IACbR,IAAIQ,OAAO,IACXnD,gBACAuC,QAAQtC,eAAe;IAEzB,MAAMmD,aAAa7C,0BAA0BC;IAC7C,MAAMoC,SAASpC,cAAc;IAE7B,MAAM6C,WAAgD,MAAMP,OAAOQ,eAAe,CAAC;QACjFd;QACAU,MAAME;QACNV,OAAOA,MAAMa,WAAW;QACxBZ,KAAKA,IAAIY,WAAW;IACtB;IAEA,IAAIF,SAASG,MAAM,KAAK,SAAS;QAC/B,MAAM,IAAIC,MAAMJ,SAASK,KAAK;IAChC;IAEA,MAAM7C,SAASH,0BAA0B2C,SAASM,IAAI,CAACC,MAAM;IAE7D,OAAO;QACL/C,QAAQA;QACR4B,WAAW;YAAEC;YAAOC;QAAI;QACxBC;QACAiB,UAAU;YACRC,qBAAqBtB;QACvB;IACF;AACF,EAAE"}
@@ -1,4 +1,4 @@
1
- import { DatasourceSelector } from '@perses-dev/spec';
1
+ import type { DatasourceSelector } from '@perses-dev/spec';
2
2
  export interface VictoriaLogsTimeSeriesQuerySpec {
3
3
  query: string;
4
4
  datasource?: DatasourceSelector;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"sourcesContent":["// Copyright 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 { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n step?: string;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAIC"}
1
+ {"version":3,"sources":["../../../../src/queries/victorialogs-time-series-query/types.ts"],"sourcesContent":["// Copyright 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 type { DatasourceSelector } from '@perses-dev/spec';\n\nexport interface VictoriaLogsTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n step?: string;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAIC"}
@@ -1,2 +1,2 @@
1
- import '@testing-library/jest-dom';
1
+ import '@testing-library/jest-dom/vitest';
2
2
  //# sourceMappingURL=setup-tests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC"}
1
+ {"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,kCAAkC,CAAC"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import '@testing-library/jest-dom';
13
+ import "@testing-library/jest-dom/vitest";
14
14
  // Always mock e-charts during tests since we don't have a proper canvas in jsdom
15
- jest.mock('echarts/core');
15
+ vi.mock('echarts/core');
16
16
 
17
17
  //# sourceMappingURL=setup-tests.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 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 '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
1
+ {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright 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 '@testing-library/jest-dom/vitest';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\nvi.mock('echarts/core');\n"],"names":["vi","mock"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,mCAAmC;AAE1C,iFAAiF;AACjFA,GAAGC,IAAI,CAAC"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './victorialogs-field-names';
14
- export * from './victorialogs-field-values';
13
+ export * from "./victorialogs-field-names/index.js";
14
+ export * from "./victorialogs-field-values/index.js";
15
15
 
16
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/variables/index.ts"],"sourcesContent":["// Copyright 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 './victorialogs-field-names';\nexport * from './victorialogs-field-values';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,6BAA6B;AAC3C,cAAc,8BAA8B"}
1
+ {"version":3,"sources":["../../../src/variables/index.ts"],"sourcesContent":["// Copyright 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 './victorialogs-field-names';\nexport * from './victorialogs-field-values';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sCAA6B;AAC3C,cAAc,uCAA8B"}
@@ -1,5 +1,5 @@
1
- import { DatasourceSelectValue } from '@perses-dev/plugin-system';
2
- import { VictoriaLogsDatasourceSelector } from '../model';
1
+ import type { DatasourceSelectValue } from '@perses-dev/plugin-system';
2
+ import type { VictoriaLogsDatasourceSelector } from '../model';
3
3
  export interface VictoriaLogsVariableOptionsBase {
4
4
  datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/variables/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,+BAA+B;IAC9C,UAAU,CAAC,EAAE,qBAAqB,CAAC,8BAA8B,CAAC,CAAC;CACpE;AAED,MAAM,MAAM,qCAAqC,GAAG,+BAA+B,GAAG;IACpF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,+BAA+B,GAAG;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/variables/types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,+BAA+B;IAC9C,UAAU,CAAC,EAAE,qBAAqB,CAAC,8BAA8B,CAAC,CAAC;CACpE;AAED,MAAM,MAAM,qCAAqC,GAAG,+BAA+B,GAAG;IACpF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,+BAA+B,GAAG;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/variables/types.ts"],"sourcesContent":["// Copyright 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 { DatasourceSelectValue } from '@perses-dev/plugin-system';\nimport { VictoriaLogsDatasourceSelector } from '../model';\n\nexport interface VictoriaLogsVariableOptionsBase {\n datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;\n}\n\nexport type VictoriaLogsFieldNamesVariableOptions = VictoriaLogsVariableOptionsBase & {\n query: string;\n};\n\nexport type VictoriaLogsFieldValuesVariableOptions = VictoriaLogsVariableOptionsBase & {\n field: string;\n query: string;\n};\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAajC,WAGE"}
1
+ {"version":3,"sources":["../../../src/variables/types.ts"],"sourcesContent":["// Copyright 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 type { DatasourceSelectValue } from '@perses-dev/plugin-system';\n\nimport type { VictoriaLogsDatasourceSelector } from '../model';\n\nexport interface VictoriaLogsVariableOptionsBase {\n datasource?: DatasourceSelectValue<VictoriaLogsDatasourceSelector>;\n}\n\nexport type VictoriaLogsFieldNamesVariableOptions = VictoriaLogsVariableOptionsBase & {\n query: string;\n};\n\nexport type VictoriaLogsFieldValuesVariableOptions = VictoriaLogsVariableOptionsBase & {\n field: string;\n query: string;\n};\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAcjC,WAGE"}
@@ -1,8 +1,8 @@
1
- import { VariableOption } from '@perses-dev/plugin-system';
2
- import { UseQueryResult } from '@tanstack/react-query';
3
- import { AbsoluteTimeRange, DatasourceSelector } from '@perses-dev/spec';
4
- import { StatusError } from '@perses-dev/client';
5
- import { VictoriaLogsFieldItem, VictoriaLogsFieldNamesResponse, VictoriaLogsFieldValuesResponse } from '../model';
1
+ import type { StatusError } from '@perses-dev/client';
2
+ import type { VariableOption } from '@perses-dev/plugin-system';
3
+ import type { AbsoluteTimeRange, DatasourceSelector } from '@perses-dev/spec';
4
+ import type { UseQueryResult } from '@tanstack/react-query';
5
+ import type { VictoriaLogsFieldItem, VictoriaLogsFieldNamesResponse, VictoriaLogsFieldValuesResponse } from '../model';
6
6
  export declare const fieldItemsToVariableOptions: (values?: VictoriaLogsFieldItem[]) => VariableOption[];
7
7
  export declare function getVictoriaLogsTimeRange(timeRange: AbsoluteTimeRange): {
8
8
  start: string;