@perses-dev/clickhouse-plugin 0.5.0 → 0.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/__mf/css/async/8077.85c2cbf6.css +1 -0
  2. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  3. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  4. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  5. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  6. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  8. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  10. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  11. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  12. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  13. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  14. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  17. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  18. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  26. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  27. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  28. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  29. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  30. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  31. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  32. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  33. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  34. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  35. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  36. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  37. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  38. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  39. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  40. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  42. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  43. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  44. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  45. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  47. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  49. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  50. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  51. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  52. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  53. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  54. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  55. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  56. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  57. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  58. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  59. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  60. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  61. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  62. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  63. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  64. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  66. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  67. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  68. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  69. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  70. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  71. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  72. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  73. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  74. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  75. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  77. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  79. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  80. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  82. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  83. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  84. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  85. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  86. package/__mf/js/ClickHouse.e02198ac.js +7 -0
  87. package/__mf/js/async/1616.d2406cd2.js +1 -0
  88. package/__mf/js/async/1728.925968b2.js +1 -0
  89. package/__mf/js/async/1796.e8bca7b4.js +1 -0
  90. package/__mf/js/async/1811.9fc88faa.js +101 -0
  91. package/__mf/js/async/1825.b1d0dd76.js +1 -0
  92. package/__mf/js/async/1969.d99a7b8c.js +1 -0
  93. package/__mf/js/async/2043.f7781783.js +2 -0
  94. package/__mf/js/async/2269.170d44e7.js +3 -0
  95. package/__mf/js/async/2386.6d501064.js +2 -0
  96. package/__mf/js/async/3059.8d79582c.js +1 -0
  97. package/__mf/js/async/3181.29a7e75b.js +2 -0
  98. package/__mf/js/async/392.b6671ed1.js +2 -0
  99. package/__mf/js/async/4121.68c107c8.js +2 -0
  100. package/__mf/js/async/5002.5d804ce2.js +1 -0
  101. package/__mf/js/async/5071.c958e086.js +1 -0
  102. package/__mf/js/async/5440.630b124b.js +2 -0
  103. package/__mf/js/async/5562.380860b8.js +2 -0
  104. package/__mf/js/async/5587.bb88c705.js +1 -0
  105. package/__mf/js/async/6045.5ea49f8f.js +1 -0
  106. package/__mf/js/async/6274.5cecc2ef.js +2 -0
  107. package/__mf/js/async/6688.03158755.js +2 -0
  108. package/__mf/js/async/6941.b7160fbe.js +2 -0
  109. package/__mf/js/async/{7576.d8b258ff.js.LICENSE.txt → 6941.b7160fbe.js.LICENSE.txt} +17 -1
  110. package/__mf/js/async/7177.c2d2166c.js +1 -0
  111. package/__mf/js/async/7192.bf5a35bc.js +1 -0
  112. package/__mf/js/async/7862.125918d1.js +2 -0
  113. package/__mf/js/async/7968.dc823504.js +1 -0
  114. package/__mf/js/async/7978.f12bd1b9.js +1 -0
  115. package/__mf/js/async/8077.f8d93598.js +7 -0
  116. package/__mf/js/async/{6796.c1c2e96e.js.LICENSE.txt → 8077.f8d93598.js.LICENSE.txt} +19 -1
  117. package/__mf/js/async/8356.6313274b.js +1 -0
  118. package/__mf/js/async/8470.d4576e96.js +2 -0
  119. package/__mf/js/async/873.c63e150d.js +1 -0
  120. package/__mf/js/async/9235.87432302.js +1 -0
  121. package/__mf/js/async/941.2c020364.js +2 -0
  122. package/__mf/js/async/9588.be095c6b.js +1 -0
  123. package/__mf/js/async/9754.1b4ed216.js +10 -0
  124. package/__mf/js/async/{9754.9efd83f1.js.LICENSE.txt → 9754.1b4ed216.js.LICENSE.txt} +1 -1
  125. package/__mf/js/async/9836.575b7a61.js +1 -0
  126. package/__mf/js/async/9877.d6e28e30.js +38 -0
  127. package/__mf/js/async/9916.8593c7bc.js +22 -0
  128. package/__mf/js/async/__federation_expose_ClickHouseDatasource.72080bee.js +2 -0
  129. package/__mf/js/async/__federation_expose_ClickHouseLogQuery.70ef81c7.js +20 -0
  130. package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.0ae14286.js +20 -0
  131. package/__mf/js/main.eb9b4b69.js +7 -0
  132. package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +2 -6
  133. package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +2 -6
  134. package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +2 -1
  135. package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -1
  136. package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -1
  137. package/lib/model/click-house-client.d.ts +1 -1
  138. package/lib/model/click-house-client.d.ts.map +1 -1
  139. package/lib/model/click-house-client.js.map +1 -1
  140. package/lib/model/click-house-data-types.d.ts +1 -1
  141. package/lib/model/click-house-data-types.js.map +1 -1
  142. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts.map +1 -1
  143. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +2 -6
  144. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -1
  145. package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts +1 -1
  146. package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -1
  147. package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -1
  148. package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts +1 -1
  149. package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts.map +1 -1
  150. package/lib/queries/click-house-log-query/log-query-plugin-interface.js.map +1 -1
  151. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts.map +1 -1
  152. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +2 -6
  153. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -1
  154. package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +1 -1
  155. package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -1
  156. package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -1
  157. package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -1
  158. package/mf-manifest.json +122 -108
  159. package/mf-stats.json +138 -108
  160. package/package.json +7 -6
  161. package/__mf/css/async/3061.d3010b86.css +0 -1
  162. package/__mf/css/async/7370.d3010b86.css +0 -1
  163. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  164. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  165. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  166. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  167. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  168. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  169. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  170. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  171. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  172. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  173. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  174. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  175. package/__mf/js/ClickHouse.dccd3adc.js +0 -6
  176. package/__mf/js/async/1616.d273c2a4.js +0 -1
  177. package/__mf/js/async/1728.c2466af2.js +0 -1
  178. package/__mf/js/async/1811.e34f9555.js +0 -101
  179. package/__mf/js/async/1825.3b06cbc6.js +0 -1
  180. package/__mf/js/async/1969.41d665ea.js +0 -1
  181. package/__mf/js/async/2043.827fc525.js +0 -2
  182. package/__mf/js/async/2386.9589aa86.js +0 -2
  183. package/__mf/js/async/3059.33197202.js +0 -1
  184. package/__mf/js/async/3181.b9a8c5ee.js +0 -2
  185. package/__mf/js/async/392.a87802dc.js +0 -2
  186. package/__mf/js/async/4121.437b34db.js +0 -2
  187. package/__mf/js/async/5002.5959f718.js +0 -1
  188. package/__mf/js/async/5071.c665fc3d.js +0 -1
  189. package/__mf/js/async/54.0abd57b9.js +0 -22
  190. package/__mf/js/async/5440.79b13afe.js +0 -2
  191. package/__mf/js/async/5587.caa53d74.js +0 -1
  192. package/__mf/js/async/6045.424732f1.js +0 -1
  193. package/__mf/js/async/6274.0299ceca.js +0 -2
  194. package/__mf/js/async/6283.18a07ff0.js +0 -2
  195. package/__mf/js/async/6796.c1c2e96e.js +0 -7
  196. package/__mf/js/async/7177.661c72fd.js +0 -1
  197. package/__mf/js/async/7192.738bb7d0.js +0 -1
  198. package/__mf/js/async/7370.aa412eb8.js +0 -2
  199. package/__mf/js/async/7576.d8b258ff.js +0 -2
  200. package/__mf/js/async/7968.d7870d30.js +0 -1
  201. package/__mf/js/async/7978.a9ba54ff.js +0 -1
  202. package/__mf/js/async/8356.1990f800.js +0 -1
  203. package/__mf/js/async/8470.12101f38.js +0 -2
  204. package/__mf/js/async/8482.f99a0f22.js +0 -1
  205. package/__mf/js/async/873.0b522a3c.js +0 -1
  206. package/__mf/js/async/9010.7167d3a9.js +0 -2
  207. package/__mf/js/async/9010.7167d3a9.js.LICENSE.txt +0 -15
  208. package/__mf/js/async/9071.8c641d07.js +0 -2
  209. package/__mf/js/async/9235.239f5888.js +0 -1
  210. package/__mf/js/async/9249.f40b0225.js +0 -1
  211. package/__mf/js/async/941.62a2fd61.js +0 -2
  212. package/__mf/js/async/9588.643512c3.js +0 -1
  213. package/__mf/js/async/9754.9efd83f1.js +0 -10
  214. package/__mf/js/async/9836.4cd749fe.js +0 -1
  215. package/__mf/js/async/9877.c85206cb.js +0 -38
  216. package/__mf/js/async/__federation_expose_ClickHouseDatasource.0bdc8df0.js +0 -2
  217. package/__mf/js/async/__federation_expose_ClickHouseLogQuery.1e3e609a.js +0 -20
  218. package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.e60dd445.js +0 -20
  219. package/__mf/js/main.eadf8672.js +0 -6
  220. /package/__mf/js/async/{2043.827fc525.js.LICENSE.txt → 2043.f7781783.js.LICENSE.txt} +0 -0
  221. /package/__mf/js/async/{2386.9589aa86.js.LICENSE.txt → 2386.6d501064.js.LICENSE.txt} +0 -0
  222. /package/__mf/js/async/{3181.b9a8c5ee.js.LICENSE.txt → 3181.29a7e75b.js.LICENSE.txt} +0 -0
  223. /package/__mf/js/async/{392.a87802dc.js.LICENSE.txt → 392.b6671ed1.js.LICENSE.txt} +0 -0
  224. /package/__mf/js/async/{4121.437b34db.js.LICENSE.txt → 4121.68c107c8.js.LICENSE.txt} +0 -0
  225. /package/__mf/js/async/{5440.79b13afe.js.LICENSE.txt → 5440.630b124b.js.LICENSE.txt} +0 -0
  226. /package/__mf/js/async/{7370.aa412eb8.js.LICENSE.txt → 5562.380860b8.js.LICENSE.txt} +0 -0
  227. /package/__mf/js/async/{6274.0299ceca.js.LICENSE.txt → 6274.5cecc2ef.js.LICENSE.txt} +0 -0
  228. /package/__mf/js/async/{9071.8c641d07.js.LICENSE.txt → 6688.03158755.js.LICENSE.txt} +0 -0
  229. /package/__mf/js/async/{6283.18a07ff0.js.LICENSE.txt → 7862.125918d1.js.LICENSE.txt} +0 -0
  230. /package/__mf/js/async/{8470.12101f38.js.LICENSE.txt → 8470.d4576e96.js.LICENSE.txt} +0 -0
  231. /package/__mf/js/async/{941.62a2fd61.js.LICENSE.txt → 941.2c020364.js.LICENSE.txt} +0 -0
  232. /package/__mf/js/async/{54.0abd57b9.js.LICENSE.txt → 9916.8593c7bc.js.LICENSE.txt} +0 -0
  233. /package/__mf/js/async/{__federation_expose_ClickHouseDatasource.0bdc8df0.js.LICENSE.txt → __federation_expose_ClickHouseDatasource.72080bee.js.LICENSE.txt} +0 -0
  234. /package/__mf/js/async/{__federation_expose_ClickHouseLogQuery.1e3e609a.js.LICENSE.txt → __federation_expose_ClickHouseLogQuery.70ef81c7.js.LICENSE.txt} +0 -0
  235. /package/__mf/js/async/{__federation_expose_ClickHouseTimeSeriesQuery.e60dd445.js.LICENSE.txt → __federation_expose_ClickHouseTimeSeriesQuery.0ae14286.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/click-house-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/core';\n\nexport interface ClickHouseLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\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,WAGC"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/click-house-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 ClickHouseLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\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,WAGC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.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 } from '@perses-dev/plugin-system';\nimport { LogEntry, LogData } from '@perses-dev/core';\nimport { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { ClickHouseLogQuerySpec } from './click-house-log-query-types';\nimport { LogQueryPlugin } from './log-query-plugin-interface';\n\nfunction flattenObject(\n obj: Record<string, unknown>,\n parentKey = '',\n result: Record<string, unknown> = {}\n): Record<string, unknown> {\n for (const [key, value] of Object.entries(obj)) {\n const newKey = parentKey ? `${parentKey}.${key}` : key;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n flattenObject(value as Record<string, unknown>, newKey, result);\n } else {\n result[newKey] = value;\n }\n }\n\n return result;\n}\n\nfunction convertStreamsToLogs(streams: LogEntry[]): LogData {\n const entries: LogEntry[] = streams.map((entry) => {\n const flattened = flattenObject(entry as unknown as Record<string, unknown>);\n\n if (!flattened['Timestamp'] && flattened['log_time']) {\n flattened['Timestamp'] = flattened['log_time'];\n }\n\n const sortedEntry: Record<string, unknown> = {};\n Object.keys(flattened)\n .sort((a, b) => a.localeCompare(b))\n .forEach((key) => {\n sortedEntry[key] = flattened[key];\n });\n\n const line = Object.entries(sortedEntry)\n .filter(([key]) => key !== 'Timestamp')\n .map(([key, value]) => `<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`)\n .join(' ');\n\n return {\n timestamp: sortedEntry?.['Timestamp'] as unknown as number,\n labels: sortedEntry as Record<string, string>,\n line,\n } as LogEntry;\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getClickHouseLogData: LogQueryPlugin<ClickHouseLogQuerySpec>['getLogData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || 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\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as ClickHouseClient;\n\n const { start, end } = context.timeRange;\n\n const response: ClickHouseQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n return {\n timeRange: { start, end },\n logs: convertStreamsToLogs(response.data as LogEntry[]),\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","flattenObject","obj","parentKey","result","key","value","Object","entries","newKey","Array","isArray","convertStreamsToLogs","streams","map","entry","flattened","sortedEntry","keys","sort","a","b","localeCompare","forEach","line","filter","undefined","join","timestamp","labels","totalCount","length","getClickHouseLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","getTime","toString","data","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,SAASA,gBAAgB,QAAQ,4BAA4B;AAG7D,SAASC,kBAAkB,QAAQ,eAAe;AAIlD,SAASC,cACPC,GAA4B,EAC5BC,YAAY,EAAE,EACdC,SAAkC,CAAC,CAAC;IAEpC,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACN,KAAM;QAC9C,MAAMO,SAASN,YAAY,GAAGA,UAAU,CAAC,EAAEE,KAAK,GAAGA;QACnD,IAAIC,SAAS,OAAOA,UAAU,YAAY,CAACI,MAAMC,OAAO,CAACL,QAAQ;YAC/DL,cAAcK,OAAkCG,QAAQL;QAC1D,OAAO;YACLA,MAAM,CAACK,OAAO,GAAGH;QACnB;IACF;IAEA,OAAOF;AACT;AAEA,SAASQ,qBAAqBC,OAAmB;IAC/C,MAAML,UAAsBK,QAAQC,GAAG,CAAC,CAACC;QACvC,MAAMC,YAAYf,cAAcc;QAEhC,IAAI,CAACC,SAAS,CAAC,YAAY,IAAIA,SAAS,CAAC,WAAW,EAAE;YACpDA,SAAS,CAAC,YAAY,GAAGA,SAAS,CAAC,WAAW;QAChD;QAEA,MAAMC,cAAuC,CAAC;QAC9CV,OAAOW,IAAI,CAACF,WACTG,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAC/BE,OAAO,CAAC,CAAClB;YACRY,WAAW,CAACZ,IAAI,GAAGW,SAAS,CAACX,IAAI;QACnC;QAEF,MAAMmB,OAAOjB,OAAOC,OAAO,CAACS,aACzBQ,MAAM,CAAC,CAAC,CAACpB,IAAI,GAAKA,QAAQ,aAC1BS,GAAG,CAAC,CAAC,CAACT,KAAKC,MAAM,GAAK,CAAC,CAAC,EAAED,IAAI,EAAE,EAAEC,UAAU,MAAMA,UAAU,QAAQA,UAAUoB,YAAY,OAAOpB,OAAO,EACxGqB,IAAI,CAAC;QAER,OAAO;YACLC,WAAWX,aAAa,CAAC,YAAY;YACrCY,QAAQZ;YACRO;QACF;IACF;IAEA,OAAO;QACLhB;QACAsB,YAAYtB,QAAQuB,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,uBAA6E,OAAOC,MAAMC;IACrG,IAAID,KAAKE,KAAK,KAAKT,aAAaO,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,OAAO;YACLC,MAAM;gBAAE5B,SAAS,EAAE;gBAAEsB,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQpC,iBAAiBkC,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAEhE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI5C;IAGrB,MAAM,EAAEsC,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAoC,MAAMJ,OAAON,KAAK,CAAC;QAC3DG,OAAOA,MAAMQ,OAAO,GAAGC,QAAQ;QAC/BR,KAAKA,IAAIO,OAAO,GAAGC,QAAQ;QAC3BZ;IACF;IAEA,OAAO;QACLE,WAAW;YAAEC;YAAOC;QAAI;QACxBH,MAAMxB,qBAAqBiC,SAASG,IAAI;QACxCC,UAAU;YACRC,qBAAqBf;QACvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.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 } from '@perses-dev/plugin-system';\nimport { LogData, LogEntry } from '@perses-dev/spec';\nimport { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { ClickHouseLogQuerySpec } from './click-house-log-query-types';\nimport { LogQueryPlugin } from './log-query-plugin-interface';\n\nfunction flattenObject(\n obj: Record<string, unknown>,\n parentKey = '',\n result: Record<string, unknown> = {}\n): Record<string, unknown> {\n for (const [key, value] of Object.entries(obj)) {\n const newKey = parentKey ? `${parentKey}.${key}` : key;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n flattenObject(value as Record<string, unknown>, newKey, result);\n } else {\n result[newKey] = value;\n }\n }\n\n return result;\n}\n\nfunction convertStreamsToLogs(streams: LogEntry[]): LogData {\n const entries: LogEntry[] = streams.map((entry) => {\n const flattened = flattenObject(entry as unknown as Record<string, unknown>);\n\n if (!flattened['Timestamp'] && flattened['log_time']) {\n flattened['Timestamp'] = flattened['log_time'];\n }\n\n const sortedEntry: Record<string, unknown> = {};\n Object.keys(flattened)\n .sort((a, b) => a.localeCompare(b))\n .forEach((key) => {\n sortedEntry[key] = flattened[key];\n });\n\n const line = Object.entries(sortedEntry)\n .filter(([key]) => key !== 'Timestamp')\n .map(([key, value]) => `<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`)\n .join(' ');\n\n return {\n timestamp: sortedEntry?.['Timestamp'] as unknown as number,\n labels: sortedEntry as Record<string, string>,\n line,\n } as LogEntry;\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getClickHouseLogData: LogQueryPlugin<ClickHouseLogQuerySpec>['getLogData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || 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\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as ClickHouseClient;\n\n const { start, end } = context.timeRange;\n\n const response: ClickHouseQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n return {\n timeRange: { start, end },\n logs: convertStreamsToLogs(response.data as LogEntry[]),\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","flattenObject","obj","parentKey","result","key","value","Object","entries","newKey","Array","isArray","convertStreamsToLogs","streams","map","entry","flattened","sortedEntry","keys","sort","a","b","localeCompare","forEach","line","filter","undefined","join","timestamp","labels","totalCount","length","getClickHouseLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","getTime","toString","data","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,SAASA,gBAAgB,QAAQ,4BAA4B;AAG7D,SAASC,kBAAkB,QAAQ,eAAe;AAIlD,SAASC,cACPC,GAA4B,EAC5BC,YAAY,EAAE,EACdC,SAAkC,CAAC,CAAC;IAEpC,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACN,KAAM;QAC9C,MAAMO,SAASN,YAAY,GAAGA,UAAU,CAAC,EAAEE,KAAK,GAAGA;QACnD,IAAIC,SAAS,OAAOA,UAAU,YAAY,CAACI,MAAMC,OAAO,CAACL,QAAQ;YAC/DL,cAAcK,OAAkCG,QAAQL;QAC1D,OAAO;YACLA,MAAM,CAACK,OAAO,GAAGH;QACnB;IACF;IAEA,OAAOF;AACT;AAEA,SAASQ,qBAAqBC,OAAmB;IAC/C,MAAML,UAAsBK,QAAQC,GAAG,CAAC,CAACC;QACvC,MAAMC,YAAYf,cAAcc;QAEhC,IAAI,CAACC,SAAS,CAAC,YAAY,IAAIA,SAAS,CAAC,WAAW,EAAE;YACpDA,SAAS,CAAC,YAAY,GAAGA,SAAS,CAAC,WAAW;QAChD;QAEA,MAAMC,cAAuC,CAAC;QAC9CV,OAAOW,IAAI,CAACF,WACTG,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAC/BE,OAAO,CAAC,CAAClB;YACRY,WAAW,CAACZ,IAAI,GAAGW,SAAS,CAACX,IAAI;QACnC;QAEF,MAAMmB,OAAOjB,OAAOC,OAAO,CAACS,aACzBQ,MAAM,CAAC,CAAC,CAACpB,IAAI,GAAKA,QAAQ,aAC1BS,GAAG,CAAC,CAAC,CAACT,KAAKC,MAAM,GAAK,CAAC,CAAC,EAAED,IAAI,EAAE,EAAEC,UAAU,MAAMA,UAAU,QAAQA,UAAUoB,YAAY,OAAOpB,OAAO,EACxGqB,IAAI,CAAC;QAER,OAAO;YACLC,WAAWX,aAAa,CAAC,YAAY;YACrCY,QAAQZ;YACRO;QACF;IACF;IAEA,OAAO;QACLhB;QACAsB,YAAYtB,QAAQuB,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,uBAA6E,OAAOC,MAAMC;IACrG,IAAID,KAAKE,KAAK,KAAKT,aAAaO,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,OAAO;YACLC,MAAM;gBAAE5B,SAAS,EAAE;gBAAEsB,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQpC,iBAAiBkC,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAEhE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI5C;IAGrB,MAAM,EAAEsC,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAoC,MAAMJ,OAAON,KAAK,CAAC;QAC3DG,OAAOA,MAAMQ,OAAO,GAAGC,QAAQ;QAC/BR,KAAKA,IAAIO,OAAO,GAAGC,QAAQ;QAC3BZ;IACF;IAEA,OAAO;QACLE,WAAW;YAAEC;YAAOC;QAAI;QACxBH,MAAMxB,qBAAqBiC,SAASG,IAAI;QACxCC,UAAU;YACRC,qBAAqBf;QACvB;IACF;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
- import { AbsoluteTimeRange, UnknownSpec, LogData } from '@perses-dev/core';
2
1
  import { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system';
2
+ import { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec';
3
3
  export interface LogQueryResult {
4
4
  logs: LogData;
5
5
  timeRange: AbsoluteTimeRange;
@@ -1 +1 @@
1
- {"version":3,"file":"log-query-plugin-interface.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEtF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACjF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,0BAA0B,CAAC;CACrF"}
1
+ {"version":3,"file":"log-query-plugin-interface.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACjF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,0BAA0B,CAAC;CACrF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.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 { AbsoluteTimeRange, UnknownSpec, LogData } from '@perses-dev/core';\nimport { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system';\n\nexport interface LogQueryResult {\n logs: LogData;\n timeRange: AbsoluteTimeRange;\n metadata?: {\n executedQueryString: string;\n };\n}\n\nexport interface ClickHouseQueryContext {\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\ntype LogQueryPluginDependencies = {\n variables?: string[];\n};\n\nexport interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getLogData: (spec: Spec, ctx: ClickHouseQueryContext) => Promise<LogQueryResult>;\n dependsOn?: (spec: Spec, ctx: ClickHouseQueryContext) => LogQueryPluginDependencies;\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;AAuBjC,WAGC"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.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 { DatasourceStore, Plugin, VariableStateMap } from '@perses-dev/plugin-system';\nimport { AbsoluteTimeRange, LogData, UnknownSpec } from '@perses-dev/spec';\n\nexport interface LogQueryResult {\n logs: LogData;\n timeRange: AbsoluteTimeRange;\n metadata?: {\n executedQueryString: string;\n };\n}\n\nexport interface ClickHouseQueryContext {\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\ntype LogQueryPluginDependencies = {\n variables?: string[];\n};\n\nexport interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getLogData: (spec: Spec, ctx: ClickHouseQueryContext) => Promise<LogQueryResult>;\n dependsOn?: (spec: Spec, ctx: ClickHouseQueryContext) => LogQueryPluginDependencies;\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;AAuBjC,WAGC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ClickHouseQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAOlD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,KAAK,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAE9F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,oCAAoC,GAAG,YAAY,CA2EzG"}
1
+ {"version":3,"file":"ClickHouseQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,KAAK,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAE9F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,oCAAoC,GAAG,YAAY,CAsEzG"}
@@ -15,6 +15,7 @@ import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-syste
15
15
  import { useCallback } from 'react';
16
16
  import { produce } from 'immer';
17
17
  import { Stack } from '@mui/material';
18
+ import { createModEnterHandler } from '@perses-dev/dashboards';
18
19
  import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
19
20
  import { ClickQLEditor } from '../../components';
20
21
  import { queryExample } from '../../components/constants';
@@ -68,12 +69,7 @@ export function ClickHouseTimeSeriesQueryEditor(props) {
68
69
  value: query,
69
70
  onChange: handleClickHouseQueryChange,
70
71
  onBlur: handleQueryBlur,
71
- onKeyDown: (event)=>{
72
- if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
73
- event.preventDefault();
74
- handleQueryExecute(query);
75
- }
76
- },
72
+ onKeyDown: createModEnterHandler(()=>handleQueryExecute(query)),
77
73
  placeholder: "Enter ClickHouse SQL query"
78
74
  }),
79
75
  /*#__PURE__*/ _jsxs("details", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQueryEditor.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} from '@perses-dev/plugin-system';\nimport { ReactElement, useCallback } from 'react';\nimport { produce } from 'immer';\nimport { Stack } from '@mui/material';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { ClickQLEditor } from '../../components';\nimport { queryExample } from '../../components/constants';\nimport { useQueryState } from '../query-editor-model';\nimport { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';\n\ntype ClickHouseTimeSeriesQueryEditorProps = OptionsEditorProps<ClickHouseTimeSeriesQuerySpec>;\n\nexport function ClickHouseTimeSeriesQueryEditor(props: ClickHouseTimeSeriesQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_DATASOURCE;\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange(\n produce(value, (draft) => {\n draft.datasource = newDatasourceSelection;\n })\n );\n return;\n }\n throw new Error('Got unexpected non ClickHouse datasource selection');\n };\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = (query: string) => {\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n const handleClickHouseQueryChange = useCallback(\n (e: string) => {\n handleQueryChange(e);\n },\n [handleQueryChange]\n );\n\n const examplesStyle: React.CSSProperties = {\n fontSize: '11px',\n color: '#777',\n backgroundColor: '#f5f5f5',\n padding: '8px',\n borderRadius: '4px',\n fontFamily: 'Monaco, Menlo, \"Ubuntu Mono\", monospace',\n whiteSpace: 'pre-wrap',\n lineHeight: '1.3',\n };\n\n return (\n <Stack spacing={1.5}>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"ClickHouse Datasource\"\n notched\n />\n <ClickQLEditor\n value={query}\n onChange={handleClickHouseQueryChange}\n onBlur={handleQueryBlur}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n handleQueryExecute(query);\n }\n }}\n placeholder=\"Enter ClickHouse SQL query\"\n />\n\n <details>\n <summary style={{ cursor: 'pointer', fontSize: '12px', color: '#666', marginBottom: '8px' }}>\n Query Examples\n </summary>\n <div style={examplesStyle}>{queryExample}</div>\n </details>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useCallback","produce","Stack","DATASOURCE_KIND","DEFAULT_DATASOURCE","ClickQLEditor","queryExample","useQueryState","ClickHouseTimeSeriesQueryEditor","props","onChange","value","datasource","selectedDatasource","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","newDatasourceSelection","kind","draft","Error","handleQueryExecute","handleClickHouseQueryChange","e","examplesStyle","fontSize","color","backgroundColor","padding","borderRadius","fontFamily","whiteSpace","lineHeight","spacing","datasourcePluginKind","label","notched","onBlur","onKeyDown","event","key","ctrlKey","metaKey","preventDefault","placeholder","details","summary","style","cursor","marginBottom","div"],"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,QAEf,4BAA4B;AACnC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AACnE,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,wBAAwB;AAKtD,OAAO,SAASC,gCAAgCC,KAA2C;IACzF,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcR;IACzC,MAAM,EAAEU,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGT,cAAcE;IAEpE,MAAMQ,yBAA4D,CAACC;QACjE,IAAI,CAACnB,qBAAqBmB,2BAA2BA,uBAAuBC,IAAI,KAAKhB,iBAAiB;YACpGO,SACET,QAAQU,OAAO,CAACS;gBACdA,MAAMR,UAAU,GAAGM;YACrB;YAEF;QACF;QACA,MAAM,IAAIG,MAAM;IAClB;IAEA,6CAA6C;IAC7C,MAAMC,qBAAqB,CAACR;QAC1BJ,SACET,QAAQU,OAAO,CAACS;YACdA,MAAMN,KAAK,GAAGA;QAChB;IAEJ;IAEA,MAAMS,8BAA8BvB,YAClC,CAACwB;QACCT,kBAAkBS;IACpB,GACA;QAACT;KAAkB;IAGrB,MAAMU,gBAAqC;QACzCC,UAAU;QACVC,OAAO;QACPC,iBAAiB;QACjBC,SAAS;QACTC,cAAc;QACdC,YAAY;QACZC,YAAY;QACZC,YAAY;IACd;IAEA,qBACE,MAAC/B;QAAMgC,SAAS;;0BACd,KAACpC;gBACCqC,sBAAsBhC;gBACtBQ,OAAOE;gBACPH,UAAUO;gBACVmB,OAAM;gBACNC,OAAO;;0BAET,KAAChC;gBACCM,OAAOG;gBACPJ,UAAUa;gBACVe,QAAQtB;gBACRuB,WAAW,CAACC;oBACV,IAAIA,MAAMC,GAAG,KAAK,WAAYD,CAAAA,MAAME,OAAO,IAAIF,MAAMG,OAAO,AAAD,GAAI;wBAC7DH,MAAMI,cAAc;wBACpBtB,mBAAmBR;oBACrB;gBACF;gBACA+B,aAAY;;0BAGd,MAACC;;kCACC,KAACC;wBAAQC,OAAO;4BAAEC,QAAQ;4BAAWvB,UAAU;4BAAQC,OAAO;4BAAQuB,cAAc;wBAAM;kCAAG;;kCAG7F,KAACC;wBAAIH,OAAOvB;kCAAgBnB;;;;;;AAIpC"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQueryEditor.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} from '@perses-dev/plugin-system';\nimport { ReactElement, useCallback } from 'react';\nimport { produce } from 'immer';\nimport { Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { ClickQLEditor } from '../../components';\nimport { queryExample } from '../../components/constants';\nimport { useQueryState } from '../query-editor-model';\nimport { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';\n\ntype ClickHouseTimeSeriesQueryEditorProps = OptionsEditorProps<ClickHouseTimeSeriesQuerySpec>;\n\nexport function ClickHouseTimeSeriesQueryEditor(props: ClickHouseTimeSeriesQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_DATASOURCE;\n const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (newDatasourceSelection) => {\n if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {\n onChange(\n produce(value, (draft) => {\n draft.datasource = newDatasourceSelection;\n })\n );\n return;\n }\n throw new Error('Got unexpected non ClickHouse datasource selection');\n };\n\n // Immediate query execution on Enter or blur\n const handleQueryExecute = (query: string): void => {\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n const handleClickHouseQueryChange = useCallback(\n (e: string) => {\n handleQueryChange(e);\n },\n [handleQueryChange]\n );\n\n const examplesStyle: React.CSSProperties = {\n fontSize: '11px',\n color: '#777',\n backgroundColor: '#f5f5f5',\n padding: '8px',\n borderRadius: '4px',\n fontFamily: 'Monaco, Menlo, \"Ubuntu Mono\", monospace',\n whiteSpace: 'pre-wrap',\n lineHeight: '1.3',\n };\n\n return (\n <Stack spacing={1.5}>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"ClickHouse Datasource\"\n notched\n />\n <ClickQLEditor\n value={query}\n onChange={handleClickHouseQueryChange}\n onBlur={handleQueryBlur}\n onKeyDown={createModEnterHandler(() => handleQueryExecute(query))}\n placeholder=\"Enter ClickHouse SQL query\"\n />\n\n <details>\n <summary style={{ cursor: 'pointer', fontSize: '12px', color: '#666', marginBottom: '8px' }}>\n Query Examples\n </summary>\n <div style={examplesStyle}>{queryExample}</div>\n </details>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useCallback","produce","Stack","createModEnterHandler","DATASOURCE_KIND","DEFAULT_DATASOURCE","ClickQLEditor","queryExample","useQueryState","ClickHouseTimeSeriesQueryEditor","props","onChange","value","datasource","selectedDatasource","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","newDatasourceSelection","kind","draft","Error","handleQueryExecute","handleClickHouseQueryChange","e","examplesStyle","fontSize","color","backgroundColor","padding","borderRadius","fontFamily","whiteSpace","lineHeight","spacing","datasourcePluginKind","label","notched","onBlur","onKeyDown","placeholder","details","summary","style","cursor","marginBottom","div"],"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,QAEf,4BAA4B;AACnC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AACnE,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,wBAAwB;AAKtD,OAAO,SAASC,gCAAgCC,KAA2C;IACzF,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcR;IACzC,MAAM,EAAEU,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGT,cAAcE;IAEpE,MAAMQ,yBAA4D,CAACC;QACjE,IAAI,CAACpB,qBAAqBoB,2BAA2BA,uBAAuBC,IAAI,KAAKhB,iBAAiB;YACpGO,SACEV,QAAQW,OAAO,CAACS;gBACdA,MAAMR,UAAU,GAAGM;YACrB;YAEF;QACF;QACA,MAAM,IAAIG,MAAM;IAClB;IAEA,6CAA6C;IAC7C,MAAMC,qBAAqB,CAACR;QAC1BJ,SACEV,QAAQW,OAAO,CAACS;YACdA,MAAMN,KAAK,GAAGA;QAChB;IAEJ;IAEA,MAAMS,8BAA8BxB,YAClC,CAACyB;QACCT,kBAAkBS;IACpB,GACA;QAACT;KAAkB;IAGrB,MAAMU,gBAAqC;QACzCC,UAAU;QACVC,OAAO;QACPC,iBAAiB;QACjBC,SAAS;QACTC,cAAc;QACdC,YAAY;QACZC,YAAY;QACZC,YAAY;IACd;IAEA,qBACE,MAAChC;QAAMiC,SAAS;;0BACd,KAACrC;gBACCsC,sBAAsBhC;gBACtBQ,OAAOE;gBACPH,UAAUO;gBACVmB,OAAM;gBACNC,OAAO;;0BAET,KAAChC;gBACCM,OAAOG;gBACPJ,UAAUa;gBACVe,QAAQtB;gBACRuB,WAAWrC,sBAAsB,IAAMoB,mBAAmBR;gBAC1D0B,aAAY;;0BAGd,MAACC;;kCACC,KAACC;wBAAQC,OAAO;4BAAEC,QAAQ;4BAAWlB,UAAU;4BAAQC,OAAO;4BAAQkB,cAAc;wBAAM;kCAAG;;kCAG7F,KAACC;wBAAIH,OAAOlB;kCAAgBnB;;;;;;AAIpC"}
@@ -1,4 +1,4 @@
1
- import { DatasourceSelector } from '@perses-dev/core';
1
+ import { DatasourceSelector } from '@perses-dev/spec';
2
2
  export interface ClickHouseTimeSeriesQuerySpec {
3
3
  query: string;
4
4
  datasource?: DatasourceSelector;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/click-house-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/core';\n\nexport interface ClickHouseTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n\n// TODO: import this type from your datasource or an existing datasource plugin\nexport type DatasourceQueryResponse = {\n status: string;\n data: unknown;\n warnings?: 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;AASjC,+EAA+E;AAC/E,WAIE"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/click-house-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 ClickHouseTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n\n// TODO: import this type from your datasource or an existing datasource plugin\nexport type DatasourceQueryResponse = {\n status: string;\n data: unknown;\n warnings?: 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;AASjC,+EAA+E;AAC/E,WAIE"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-click-house-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/get-click-house-data.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,2BAA2B,CAAC;AAIpF,OAAO,EAAE,6BAA6B,EAA2B,MAAM,2BAA2B,CAAC;AAsBnG,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,mBAAmB,CA8BvG,CAAC"}
1
+ {"version":3,"file":"get-click-house-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/get-click-house-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,2BAA2B,CAAC;AAKpF,OAAO,EAAE,6BAA6B,EAA2B,MAAM,2BAA2B,CAAC;AAsBnG,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,mBAAmB,CA8BvG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/get-click-house-data.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 { TimeSeries } from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin, replaceVariables } from '@perses-dev/plugin-system';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { TimeSeriesEntry } from '../../model/click-house-data-types';\nimport { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { ClickHouseTimeSeriesQuerySpec, DatasourceQueryResponse } from './click-house-query-types';\n\nfunction buildTimeSeries(response?: DatasourceQueryResponse): TimeSeries[] {\n const data = response?.data as TimeSeriesEntry[];\n if (!response || !data || data.length === 0) {\n return [];\n }\n\n const values: Array<[number, number]> = data.map((row: TimeSeriesEntry) => {\n const timestamp = new Date(row.time).getTime();\n const value = Number(row.log_count);\n return [timestamp, value];\n });\n\n return [\n {\n name: 'log_count',\n values,\n },\n ];\n}\n\nexport const getTimeSeriesData: TimeSeriesQueryPlugin<ClickHouseTimeSeriesQuerySpec>['getTimeSeriesData'] = async (\n spec,\n context\n) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n return { series: [] };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as ClickHouseClient;\n\n const { start, end } = context.timeRange;\n\n const response: ClickHouseQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n return {\n series: buildTimeSeries(response),\n timeRange: { start, end },\n stepMs: 30 * 1000,\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","buildTimeSeries","response","data","length","values","map","row","timestamp","Date","time","getTime","value","Number","log_count","name","getTimeSeriesData","spec","context","query","undefined","series","variableState","client","datasourceStore","getDatasourceClient","datasource","start","end","timeRange","toString","stepMs","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,SAAgCA,gBAAgB,QAAQ,4BAA4B;AACpF,SAASC,kBAAkB,QAAQ,eAAe;AAKlD,SAASC,gBAAgBC,QAAkC;IACzD,MAAMC,OAAOD,UAAUC;IACvB,IAAI,CAACD,YAAY,CAACC,QAAQA,KAAKC,MAAM,KAAK,GAAG;QAC3C,OAAO,EAAE;IACX;IAEA,MAAMC,SAAkCF,KAAKG,GAAG,CAAC,CAACC;QAChD,MAAMC,YAAY,IAAIC,KAAKF,IAAIG,IAAI,EAAEC,OAAO;QAC5C,MAAMC,QAAQC,OAAON,IAAIO,SAAS;QAClC,OAAO;YAACN;YAAWI;SAAM;IAC3B;IAEA,OAAO;QACL;YACEG,MAAM;YACNV;QACF;KACD;AACH;AAEA,OAAO,MAAMW,oBAA+F,OAC1GC,MACAC;IAEA,IAAID,KAAKE,KAAK,KAAKC,aAAaH,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,OAAO;YAAEE,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMF,QAAQpB,iBAAiBkB,KAAKE,KAAK,EAAED,QAAQI,aAAa;IAEhE,MAAMC,SAAU,MAAML,QAAQM,eAAe,CAACC,mBAAmB,CAC/DR,KAAKS,UAAU,IAAI1B;IAGrB,MAAM,EAAE2B,KAAK,EAAEC,GAAG,EAAE,GAAGV,QAAQW,SAAS;IAExC,MAAM3B,WAAoC,MAAMqB,OAAOJ,KAAK,CAAC;QAC3DQ,OAAOA,MAAMhB,OAAO,GAAGmB,QAAQ;QAC/BF,KAAKA,IAAIjB,OAAO,GAAGmB,QAAQ;QAC3BX;IACF;IAEA,OAAO;QACLE,QAAQpB,gBAAgBC;QACxB2B,WAAW;YAAEF;YAAOC;QAAI;QACxBG,QAAQ,KAAK;QACbC,UAAU;YACRC,qBAAqBd;QACvB;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/get-click-house-data.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 { TimeSeries } from '@perses-dev/spec';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { TimeSeriesEntry } from '../../model/click-house-data-types';\nimport { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { ClickHouseTimeSeriesQuerySpec, DatasourceQueryResponse } from './click-house-query-types';\n\nfunction buildTimeSeries(response?: DatasourceQueryResponse): TimeSeries[] {\n const data = response?.data as TimeSeriesEntry[];\n if (!response || !data || data.length === 0) {\n return [];\n }\n\n const values: Array<[number, number]> = data.map((row: TimeSeriesEntry) => {\n const timestamp = new Date(row.time).getTime();\n const value = Number(row.log_count);\n return [timestamp, value];\n });\n\n return [\n {\n name: 'log_count',\n values,\n },\n ];\n}\n\nexport const getTimeSeriesData: TimeSeriesQueryPlugin<ClickHouseTimeSeriesQuerySpec>['getTimeSeriesData'] = async (\n spec,\n context\n) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n return { series: [] };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as ClickHouseClient;\n\n const { start, end } = context.timeRange;\n\n const response: ClickHouseQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n return {\n series: buildTimeSeries(response),\n timeRange: { start, end },\n stepMs: 30 * 1000,\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","buildTimeSeries","response","data","length","values","map","row","timestamp","Date","time","getTime","value","Number","log_count","name","getTimeSeriesData","spec","context","query","undefined","series","variableState","client","datasourceStore","getDatasourceClient","datasource","start","end","timeRange","toString","stepMs","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;AAEpF,SAASC,kBAAkB,QAAQ,eAAe;AAKlD,SAASC,gBAAgBC,QAAkC;IACzD,MAAMC,OAAOD,UAAUC;IACvB,IAAI,CAACD,YAAY,CAACC,QAAQA,KAAKC,MAAM,KAAK,GAAG;QAC3C,OAAO,EAAE;IACX;IAEA,MAAMC,SAAkCF,KAAKG,GAAG,CAAC,CAACC;QAChD,MAAMC,YAAY,IAAIC,KAAKF,IAAIG,IAAI,EAAEC,OAAO;QAC5C,MAAMC,QAAQC,OAAON,IAAIO,SAAS;QAClC,OAAO;YAACN;YAAWI;SAAM;IAC3B;IAEA,OAAO;QACL;YACEG,MAAM;YACNV;QACF;KACD;AACH;AAEA,OAAO,MAAMW,oBAA+F,OAC1GC,MACAC;IAEA,IAAID,KAAKE,KAAK,KAAKC,aAAaH,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,OAAO;YAAEE,QAAQ,EAAE;QAAC;IACtB;IAEA,MAAMF,QAAQpB,iBAAiBkB,KAAKE,KAAK,EAAED,QAAQI,aAAa;IAEhE,MAAMC,SAAU,MAAML,QAAQM,eAAe,CAACC,mBAAmB,CAC/DR,KAAKS,UAAU,IAAI1B;IAGrB,MAAM,EAAE2B,KAAK,EAAEC,GAAG,EAAE,GAAGV,QAAQW,SAAS;IAExC,MAAM3B,WAAoC,MAAMqB,OAAOJ,KAAK,CAAC;QAC3DQ,OAAOA,MAAMhB,OAAO,GAAGmB,QAAQ;QAC/BF,KAAKA,IAAIjB,OAAO,GAAGmB,QAAQ;QAC3BX;IACF;IAEA,OAAO;QACLE,QAAQpB,gBAAgBC;QACxB2B,WAAW;YAAEF;YAAOC;QAAI;QACxBG,QAAQ,KAAK;QACbC,UAAU;YACRC,qBAAqBd;QACvB;IACF;AACF,EAAE"}