@perses-dev/greptimedb-plugin 0.1.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 (331) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/8077.85c2cbf6.css +1 -0
  4. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  5. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  6. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  8. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  10. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  11. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  12. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  13. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  14. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  17. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  18. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  26. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  27. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  28. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  29. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  30. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  31. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  32. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  33. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  34. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  35. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  36. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  37. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  38. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  39. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  40. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  42. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  43. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  44. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  45. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  47. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  49. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  50. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  51. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  52. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  53. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  54. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  55. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  56. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  57. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  58. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  59. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  60. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  61. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  62. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  63. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  64. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  66. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  67. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  68. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  69. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  70. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  71. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  72. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  73. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  74. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  75. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  77. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  79. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  80. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  82. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  83. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  84. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  85. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  86. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  87. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  88. package/__mf/js/GreptimeDB.7a063e9e.js +7 -0
  89. package/__mf/js/async/1616.20d43f7e.js +1 -0
  90. package/__mf/js/async/2043.97b1f27f.js +2 -0
  91. package/__mf/js/async/2043.97b1f27f.js.LICENSE.txt +24 -0
  92. package/__mf/js/async/2269.f1322789.js +3 -0
  93. package/__mf/js/async/2386.b7243314.js +2 -0
  94. package/__mf/js/async/2386.b7243314.js.LICENSE.txt +9 -0
  95. package/__mf/js/async/3181.7ac30201.js +2 -0
  96. package/__mf/js/async/3181.7ac30201.js.LICENSE.txt +9 -0
  97. package/__mf/js/async/3247.65183b95.js +2 -0
  98. package/__mf/js/async/3247.65183b95.js.LICENSE.txt +37 -0
  99. package/__mf/js/async/392.91ae0e19.js +2 -0
  100. package/__mf/js/async/392.91ae0e19.js.LICENSE.txt +8 -0
  101. package/__mf/js/async/3944.12d0f358.js +10 -0
  102. package/__mf/js/async/3944.12d0f358.js.LICENSE.txt +17 -0
  103. package/__mf/js/async/4121.06b9cab6.js +2 -0
  104. package/__mf/js/async/4121.06b9cab6.js.LICENSE.txt +9 -0
  105. package/__mf/js/async/5002.0a422150.js +1 -0
  106. package/__mf/js/async/5071.e5cc2bd7.js +1 -0
  107. package/__mf/js/async/5402.eda0fb07.js +101 -0
  108. package/__mf/js/async/5440.7abefadb.js +2 -0
  109. package/__mf/js/async/5440.7abefadb.js.LICENSE.txt +32 -0
  110. package/__mf/js/async/5562.a39a5d1e.js +2 -0
  111. package/__mf/js/async/5562.a39a5d1e.js.LICENSE.txt +9 -0
  112. package/__mf/js/async/5587.a3fb718a.js +1 -0
  113. package/__mf/js/async/6045.10e9fa5a.js +1 -0
  114. package/__mf/js/async/6274.6f0093e7.js +2 -0
  115. package/__mf/js/async/6274.6f0093e7.js.LICENSE.txt +8 -0
  116. package/__mf/js/async/6753.1e42e819.js +1 -0
  117. package/__mf/js/async/7177.78bced1c.js +1 -0
  118. package/__mf/js/async/7192.e0362dae.js +1 -0
  119. package/__mf/js/async/7862.8048abcc.js +2 -0
  120. package/__mf/js/async/7862.8048abcc.js.LICENSE.txt +9 -0
  121. package/__mf/js/async/7968.7b2e2836.js +1 -0
  122. package/__mf/js/async/7978.8cd67008.js +1 -0
  123. package/__mf/js/async/8077.fe9828a3.js +7 -0
  124. package/__mf/js/async/8077.fe9828a3.js.LICENSE.txt +39 -0
  125. package/__mf/js/async/8356.ac21fc24.js +1 -0
  126. package/__mf/js/async/8470.a2e67e3a.js +2 -0
  127. package/__mf/js/async/8470.a2e67e3a.js.LICENSE.txt +19 -0
  128. package/__mf/js/async/873.863f53e4.js +1 -0
  129. package/__mf/js/async/9235.7651eaca.js +1 -0
  130. package/__mf/js/async/941.4155d3cc.js +2 -0
  131. package/__mf/js/async/941.4155d3cc.js.LICENSE.txt +9 -0
  132. package/__mf/js/async/9558.215ad80c.js +1 -0
  133. package/__mf/js/async/9588.2f544a41.js +1 -0
  134. package/__mf/js/async/9877.8766524e.js +38 -0
  135. package/__mf/js/async/9916.2a1eb7a0.js +22 -0
  136. package/__mf/js/async/9916.2a1eb7a0.js.LICENSE.txt +19 -0
  137. package/__mf/js/async/__federation_expose_GreptimeDBDatasource.bf1dec3c.js +2 -0
  138. package/__mf/js/async/__federation_expose_GreptimeDBDatasource.bf1dec3c.js.LICENSE.txt +9 -0
  139. package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.d80b2965.js +21 -0
  140. package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.d80b2965.js.LICENSE.txt +9 -0
  141. package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.59cda507.js +21 -0
  142. package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.59cda507.js.LICENSE.txt +9 -0
  143. package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.00464f43.js +21 -0
  144. package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.00464f43.js.LICENSE.txt +9 -0
  145. package/__mf/js/main.a4e4afce.js +7 -0
  146. package/lib/bootstrap.d.ts +2 -0
  147. package/lib/bootstrap.d.ts.map +1 -0
  148. package/lib/bootstrap.js +19 -0
  149. package/lib/bootstrap.js.map +1 -0
  150. package/lib/cjs/bootstrap.js +26 -0
  151. package/lib/cjs/components/GreptimeDBQLEditor.js +72 -0
  152. package/lib/cjs/components/constants.js +42 -0
  153. package/lib/cjs/components/index.js +31 -0
  154. package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasource.js +53 -0
  155. package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +51 -0
  156. package/lib/cjs/datasources/greptimedb-datasource/greptimedb-datasource-types.js +16 -0
  157. package/lib/cjs/datasources/greptimedb-datasource/index.js +32 -0
  158. package/lib/cjs/datasources/index.js +30 -0
  159. package/lib/cjs/env.d.js +14 -0
  160. package/lib/cjs/getPluginModule.js +39 -0
  161. package/lib/cjs/index-federation.js +55 -0
  162. package/lib/cjs/index.js +38 -0
  163. package/lib/cjs/model/greptimedb-client.js +76 -0
  164. package/lib/cjs/model/greptimedb-data-types.js +16 -0
  165. package/lib/cjs/queries/constants.js +34 -0
  166. package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQuery.js +43 -0
  167. package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +108 -0
  168. package/lib/cjs/queries/greptimedb-log-query/get-greptimedb-log-data.js +103 -0
  169. package/lib/cjs/queries/greptimedb-log-query/greptimedb-log-query-types.js +16 -0
  170. package/lib/cjs/queries/greptimedb-log-query/index.js +33 -0
  171. package/lib/cjs/queries/greptimedb-log-query/log-query-plugin-interface.js +16 -0
  172. package/lib/cjs/queries/greptimedb-query-data-model.js +152 -0
  173. package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQuery.js +43 -0
  174. package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +107 -0
  175. package/lib/cjs/queries/greptimedb-time-series-query/get-greptimedb-data.js +184 -0
  176. package/lib/cjs/queries/greptimedb-time-series-query/greptimedb-query-types.js +16 -0
  177. package/lib/cjs/queries/greptimedb-time-series-query/index.js +33 -0
  178. package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +40 -0
  179. package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +79 -0
  180. package/lib/cjs/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +518 -0
  181. package/lib/cjs/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +16 -0
  182. package/lib/cjs/queries/greptimedb-trace-query/index.js +33 -0
  183. package/lib/cjs/queries/greptimedb-trace-query/trace-query-sql.js +25 -0
  184. package/lib/cjs/queries/index.js +32 -0
  185. package/lib/cjs/queries/query-editor-model.js +47 -0
  186. package/lib/cjs/setup-tests.js +19 -0
  187. package/lib/components/GreptimeDBQLEditor.d.ts +4 -0
  188. package/lib/components/GreptimeDBQLEditor.d.ts.map +1 -0
  189. package/lib/components/GreptimeDBQLEditor.js +59 -0
  190. package/lib/components/GreptimeDBQLEditor.js.map +1 -0
  191. package/lib/components/constants.d.ts +2 -0
  192. package/lib/components/constants.d.ts.map +1 -0
  193. package/lib/components/constants.js +34 -0
  194. package/lib/components/constants.js.map +1 -0
  195. package/lib/components/index.d.ts +3 -0
  196. package/lib/components/index.d.ts.map +1 -0
  197. package/lib/components/index.js +16 -0
  198. package/lib/components/index.js.map +1 -0
  199. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts +4 -0
  200. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts.map +1 -0
  201. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js +45 -0
  202. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js.map +1 -0
  203. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts +9 -0
  204. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts.map +1 -0
  205. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +43 -0
  206. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js.map +1 -0
  207. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts +29 -0
  208. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts.map +1 -0
  209. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js +15 -0
  210. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js.map +1 -0
  211. package/lib/datasources/greptimedb-datasource/index.d.ts +4 -0
  212. package/lib/datasources/greptimedb-datasource/index.d.ts.map +1 -0
  213. package/lib/datasources/greptimedb-datasource/index.js +17 -0
  214. package/lib/datasources/greptimedb-datasource/index.js.map +1 -0
  215. package/lib/datasources/index.d.ts +2 -0
  216. package/lib/datasources/index.d.ts.map +1 -0
  217. package/lib/datasources/index.js +15 -0
  218. package/lib/datasources/index.js.map +1 -0
  219. package/lib/env.d.js +15 -0
  220. package/lib/env.d.js.map +1 -0
  221. package/lib/getPluginModule.d.ts +6 -0
  222. package/lib/getPluginModule.d.ts.map +1 -0
  223. package/lib/getPluginModule.js +28 -0
  224. package/lib/getPluginModule.js.map +1 -0
  225. package/lib/index-federation.d.ts +1 -0
  226. package/lib/index-federation.d.ts.map +1 -0
  227. package/lib/index-federation.js +15 -0
  228. package/lib/index-federation.js.map +1 -0
  229. package/lib/index.d.ts +4 -0
  230. package/lib/index.d.ts.map +1 -0
  231. package/lib/index.js +17 -0
  232. package/lib/index.js.map +1 -0
  233. package/lib/model/greptimedb-client.d.ts +17 -0
  234. package/lib/model/greptimedb-client.d.ts.map +1 -0
  235. package/lib/model/greptimedb-client.js +68 -0
  236. package/lib/model/greptimedb-client.js.map +1 -0
  237. package/lib/model/greptimedb-data-types.d.ts +21 -0
  238. package/lib/model/greptimedb-data-types.d.ts.map +1 -0
  239. package/lib/model/greptimedb-data-types.js +15 -0
  240. package/lib/model/greptimedb-data-types.js.map +1 -0
  241. package/lib/queries/constants.d.ts +5 -0
  242. package/lib/queries/constants.d.ts.map +1 -0
  243. package/lib/queries/constants.js +18 -0
  244. package/lib/queries/constants.js.map +1 -0
  245. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts +4 -0
  246. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts.map +1 -0
  247. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js +35 -0
  248. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js.map +1 -0
  249. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts +7 -0
  250. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts.map +1 -0
  251. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +100 -0
  252. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js.map +1 -0
  253. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts +4 -0
  254. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts.map +1 -0
  255. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js +95 -0
  256. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js.map +1 -0
  257. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts +6 -0
  258. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts.map +1 -0
  259. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js +15 -0
  260. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js.map +1 -0
  261. package/lib/queries/greptimedb-log-query/index.d.ts +5 -0
  262. package/lib/queries/greptimedb-log-query/index.d.ts.map +1 -0
  263. package/lib/queries/greptimedb-log-query/index.js +18 -0
  264. package/lib/queries/greptimedb-log-query/index.js.map +1 -0
  265. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts +23 -0
  266. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts.map +1 -0
  267. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js +15 -0
  268. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js.map +1 -0
  269. package/lib/queries/greptimedb-query-data-model.d.ts +18 -0
  270. package/lib/queries/greptimedb-query-data-model.d.ts.map +1 -0
  271. package/lib/queries/greptimedb-query-data-model.js +138 -0
  272. package/lib/queries/greptimedb-query-data-model.js.map +1 -0
  273. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts +4 -0
  274. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts.map +1 -0
  275. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js +35 -0
  276. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js.map +1 -0
  277. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts +7 -0
  278. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts.map +1 -0
  279. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +99 -0
  280. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js.map +1 -0
  281. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts +4 -0
  282. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts.map +1 -0
  283. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js +176 -0
  284. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js.map +1 -0
  285. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts +7 -0
  286. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts.map +1 -0
  287. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js +15 -0
  288. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js.map +1 -0
  289. package/lib/queries/greptimedb-time-series-query/index.d.ts +5 -0
  290. package/lib/queries/greptimedb-time-series-query/index.d.ts.map +1 -0
  291. package/lib/queries/greptimedb-time-series-query/index.js +18 -0
  292. package/lib/queries/greptimedb-time-series-query/index.js.map +1 -0
  293. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts +4 -0
  294. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts.map +1 -0
  295. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +32 -0
  296. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js.map +1 -0
  297. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts +7 -0
  298. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts.map +1 -0
  299. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +71 -0
  300. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js.map +1 -0
  301. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts +11 -0
  302. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts.map +1 -0
  303. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +466 -0
  304. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js.map +1 -0
  305. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts +6 -0
  306. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts.map +1 -0
  307. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +15 -0
  308. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js.map +1 -0
  309. package/lib/queries/greptimedb-trace-query/index.d.ts +5 -0
  310. package/lib/queries/greptimedb-trace-query/index.d.ts.map +1 -0
  311. package/lib/queries/greptimedb-trace-query/index.js +18 -0
  312. package/lib/queries/greptimedb-trace-query/index.js.map +1 -0
  313. package/lib/queries/greptimedb-trace-query/trace-query-sql.d.ts +2 -0
  314. package/lib/queries/greptimedb-trace-query/trace-query-sql.d.ts.map +1 -0
  315. package/lib/queries/greptimedb-trace-query/trace-query-sql.js +17 -0
  316. package/lib/queries/greptimedb-trace-query/trace-query-sql.js.map +1 -0
  317. package/lib/queries/index.d.ts +4 -0
  318. package/lib/queries/index.d.ts.map +1 -0
  319. package/lib/queries/index.js +17 -0
  320. package/lib/queries/index.js.map +1 -0
  321. package/lib/queries/query-editor-model.d.ts +19 -0
  322. package/lib/queries/query-editor-model.d.ts.map +1 -0
  323. package/lib/queries/query-editor-model.js +44 -0
  324. package/lib/queries/query-editor-model.js.map +1 -0
  325. package/lib/setup-tests.d.ts +2 -0
  326. package/lib/setup-tests.d.ts.map +1 -0
  327. package/lib/setup-tests.js +17 -0
  328. package/lib/setup-tests.js.map +1 -0
  329. package/mf-manifest.json +462 -0
  330. package/mf-stats.json +530 -0
  331. package/package.json +86 -0
@@ -0,0 +1,138 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { replaceVariables } from '@perses-dev/plugin-system';
14
+ /**
15
+ * Supplement a variableState map with Perses builtin time-range variables
16
+ * (__from, __to, __range, __range_s, __range_ms).
17
+ *
18
+ * Background: the LogQuery runtime passes context.variableState via
19
+ * useVariableValues() which does NOT include builtin variables, unlike
20
+ * TimeSeriesQuery which uses useAllVariableValues(). This helper bridges
21
+ * that gap so both query types can rely on replaceVariables() uniformly.
22
+ */ export function replaceQueryVariables(query, variableState, timeRange) {
23
+ const { start, end } = timeRange;
24
+ const rangeMs = end.valueOf() - start.valueOf();
25
+ const builtinState = {
26
+ __from: {
27
+ value: start.valueOf().toString(),
28
+ loading: false
29
+ },
30
+ __to: {
31
+ value: end.valueOf().toString(),
32
+ loading: false
33
+ },
34
+ __range_ms: {
35
+ value: rangeMs.toString(),
36
+ loading: false
37
+ },
38
+ __range_s: {
39
+ value: Math.floor(rangeMs / 1000).toString(),
40
+ loading: false
41
+ },
42
+ __range: {
43
+ value: formatDuration(rangeMs),
44
+ loading: false
45
+ }
46
+ };
47
+ // User-defined variables take precedence over builtins (matching framework behaviour).
48
+ return replaceVariables(query, {
49
+ ...builtinState,
50
+ ...variableState
51
+ });
52
+ }
53
+ /** Format a millisecond duration as a human-readable Prometheus-style string, e.g. "1h5m30s". */ function formatDuration(ms) {
54
+ const totalSeconds = Math.floor(ms / 1000);
55
+ const hours = Math.floor(totalSeconds / 3600);
56
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
57
+ const seconds = totalSeconds % 60;
58
+ let result = '';
59
+ if (hours > 0) result += `${hours}h`;
60
+ if (minutes > 0) result += `${minutes}m`;
61
+ if (seconds > 0 || result === '') result += `${seconds}s`;
62
+ return result;
63
+ }
64
+ function normalizeTimestampType(dataType) {
65
+ if (!dataType) {
66
+ return null;
67
+ }
68
+ return dataType.toLowerCase();
69
+ }
70
+ export function toTimestampMs(value, dataType) {
71
+ if (value === null || value === undefined) {
72
+ return null;
73
+ }
74
+ const normalizedType = normalizeTimestampType(dataType);
75
+ if (typeof value === 'number') {
76
+ if (normalizedType) {
77
+ if (normalizedType.includes('nanosecond')) {
78
+ return Math.floor(value / 1_000_000);
79
+ }
80
+ if (normalizedType.includes('microsecond')) {
81
+ return Math.floor(value / 1_000);
82
+ }
83
+ if (normalizedType.includes('millisecond')) {
84
+ return value;
85
+ }
86
+ if (normalizedType.includes('second')) {
87
+ return value * 1000;
88
+ }
89
+ }
90
+ if (value > 1_000_000_000_000_000) {
91
+ return Math.floor(value / 1_000_000);
92
+ }
93
+ if (value > 1_000_000_000_000) {
94
+ return value;
95
+ }
96
+ if (value > 1_000_000_000) {
97
+ return value * 1000;
98
+ }
99
+ return value;
100
+ }
101
+ if (typeof value === 'string') {
102
+ const asNumber = Number(value);
103
+ if (!Number.isNaN(asNumber)) {
104
+ return toTimestampMs(asNumber, dataType);
105
+ }
106
+ }
107
+ const asDate = new Date(value);
108
+ const ts = asDate.getTime();
109
+ return Number.isNaN(ts) ? null : ts;
110
+ }
111
+ export function normalizeRecords(payload) {
112
+ if (!payload || typeof payload !== 'object') return undefined;
113
+ return payload.output?.[0]?.records;
114
+ }
115
+ export function findTimeColumnIndex(columnSchemas) {
116
+ let timeIndex = -1;
117
+ const timestampColumns = columnSchemas.filter((col)=>{
118
+ const normalizedType = normalizeTimestampType(col.data_type);
119
+ return normalizedType !== null && normalizedType.startsWith('timestamp');
120
+ });
121
+ if (timestampColumns.length > 0) {
122
+ const semanticTimestamp = timestampColumns.find((col)=>col.semantic_type?.toLowerCase() === 'timestamp');
123
+ const selectedColumn = semanticTimestamp ?? timestampColumns[0];
124
+ timeIndex = columnSchemas.findIndex((col)=>col.name === selectedColumn.name);
125
+ }
126
+ if (timeIndex === -1) {
127
+ const fallbackColumns = [
128
+ 'greptime_timestamp',
129
+ 'timestamp',
130
+ 'ts',
131
+ 'time'
132
+ ];
133
+ timeIndex = columnSchemas.findIndex((col)=>fallbackColumns.includes(col.name.toLowerCase()));
134
+ }
135
+ return timeIndex;
136
+ }
137
+
138
+ //# sourceMappingURL=greptimedb-query-data-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/queries/greptimedb-query-data-model.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, VariableStateMap } from '@perses-dev/plugin-system';\nimport { AbsoluteTimeRange } from '@perses-dev/spec';\nimport { GreptimeDBColumnSchema, GreptimeDBRecords, GreptimeDBResponseData } from '../model/greptimedb-data-types';\n\nexport type { GreptimeDBColumnSchema, GreptimeDBRecords, GreptimeDBResponseData };\n\n/**\n * Supplement a variableState map with Perses builtin time-range variables\n * (__from, __to, __range, __range_s, __range_ms).\n *\n * Background: the LogQuery runtime passes context.variableState via\n * useVariableValues() which does NOT include builtin variables, unlike\n * TimeSeriesQuery which uses useAllVariableValues(). This helper bridges\n * that gap so both query types can rely on replaceVariables() uniformly.\n */\nexport function replaceQueryVariables(\n query: string,\n variableState: VariableStateMap,\n timeRange: AbsoluteTimeRange\n): string {\n const { start, end } = timeRange;\n const rangeMs = end.valueOf() - start.valueOf();\n const builtinState: VariableStateMap = {\n __from: { value: start.valueOf().toString(), loading: false },\n __to: { value: end.valueOf().toString(), loading: false },\n __range_ms: { value: rangeMs.toString(), loading: false },\n __range_s: { value: Math.floor(rangeMs / 1000).toString(), loading: false },\n __range: { value: formatDuration(rangeMs), loading: false },\n };\n // User-defined variables take precedence over builtins (matching framework behaviour).\n return replaceVariables(query, { ...builtinState, ...variableState });\n}\n\n/** Format a millisecond duration as a human-readable Prometheus-style string, e.g. \"1h5m30s\". */\nfunction formatDuration(ms: number): string {\n const totalSeconds = Math.floor(ms / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n let result = '';\n if (hours > 0) result += `${hours}h`;\n if (minutes > 0) result += `${minutes}m`;\n if (seconds > 0 || result === '') result += `${seconds}s`;\n return result;\n}\n\nfunction normalizeTimestampType(dataType: string | undefined): string | null {\n if (!dataType) {\n return null;\n }\n return dataType.toLowerCase();\n}\n\nexport function toTimestampMs(value: unknown, dataType: string | undefined): number | null {\n if (value === null || value === undefined) {\n return null;\n }\n\n const normalizedType = normalizeTimestampType(dataType);\n\n if (typeof value === 'number') {\n if (normalizedType) {\n if (normalizedType.includes('nanosecond')) {\n return Math.floor(value / 1_000_000);\n }\n if (normalizedType.includes('microsecond')) {\n return Math.floor(value / 1_000);\n }\n if (normalizedType.includes('millisecond')) {\n return value;\n }\n if (normalizedType.includes('second')) {\n return value * 1000;\n }\n }\n if (value > 1_000_000_000_000_000) {\n return Math.floor(value / 1_000_000);\n }\n if (value > 1_000_000_000_000) {\n return value;\n }\n if (value > 1_000_000_000) {\n return value * 1000;\n }\n return value;\n }\n\n if (typeof value === 'string') {\n const asNumber = Number(value);\n if (!Number.isNaN(asNumber)) {\n return toTimestampMs(asNumber, dataType);\n }\n }\n\n const asDate = new Date(value as string);\n const ts = asDate.getTime();\n return Number.isNaN(ts) ? null : ts;\n}\n\nexport function normalizeRecords(payload: GreptimeDBResponseData): GreptimeDBRecords | undefined {\n if (!payload || typeof payload !== 'object') return undefined;\n\n return payload.output?.[0]?.records;\n}\n\nexport function findTimeColumnIndex(columnSchemas: GreptimeDBColumnSchema[]): number {\n let timeIndex = -1;\n const timestampColumns = columnSchemas.filter((col) => {\n const normalizedType = normalizeTimestampType(col.data_type);\n return normalizedType !== null && normalizedType.startsWith('timestamp');\n });\n if (timestampColumns.length > 0) {\n const semanticTimestamp = timestampColumns.find((col) => col.semantic_type?.toLowerCase() === 'timestamp');\n const selectedColumn = semanticTimestamp ?? timestampColumns[0]!;\n timeIndex = columnSchemas.findIndex((col) => col.name === selectedColumn.name);\n }\n\n if (timeIndex === -1) {\n const fallbackColumns = ['greptime_timestamp', 'timestamp', 'ts', 'time'];\n timeIndex = columnSchemas.findIndex((col) => fallbackColumns.includes(col.name.toLowerCase()));\n }\n\n return timeIndex;\n}\n"],"names":["replaceVariables","replaceQueryVariables","query","variableState","timeRange","start","end","rangeMs","valueOf","builtinState","__from","value","toString","loading","__to","__range_ms","__range_s","Math","floor","__range","formatDuration","ms","totalSeconds","hours","minutes","seconds","result","normalizeTimestampType","dataType","toLowerCase","toTimestampMs","undefined","normalizedType","includes","asNumber","Number","isNaN","asDate","Date","ts","getTime","normalizeRecords","payload","output","records","findTimeColumnIndex","columnSchemas","timeIndex","timestampColumns","filter","col","data_type","startsWith","length","semanticTimestamp","find","semantic_type","selectedColumn","findIndex","name","fallbackColumns"],"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,QAA0B,4BAA4B;AAM/E;;;;;;;;CAQC,GACD,OAAO,SAASC,sBACdC,KAAa,EACbC,aAA+B,EAC/BC,SAA4B;IAE5B,MAAM,EAAEC,KAAK,EAAEC,GAAG,EAAE,GAAGF;IACvB,MAAMG,UAAUD,IAAIE,OAAO,KAAKH,MAAMG,OAAO;IAC7C,MAAMC,eAAiC;QACrCC,QAAQ;YAAEC,OAAON,MAAMG,OAAO,GAAGI,QAAQ;YAAIC,SAAS;QAAM;QAC5DC,MAAM;YAAEH,OAAOL,IAAIE,OAAO,GAAGI,QAAQ;YAAIC,SAAS;QAAM;QACxDE,YAAY;YAAEJ,OAAOJ,QAAQK,QAAQ;YAAIC,SAAS;QAAM;QACxDG,WAA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M;SAAO;QACzEb,YAAYD,cAAcY,SAAS,CAAC,CAACR,MAAQU,gBAAgB3B,QAAQ,CAACiB,IAAIS,IAAI,CAAC9B,WAAW;IAC5F;IAEA,OAAOkB;AACT"}
@@ -0,0 +1,4 @@
1
+ import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';
3
+ export declare const GreptimeDBTimeSeriesQuery: TimeSeriesQueryPlugin<GreptimeDBTimeSeriesQuerySpec>;
4
+ //# sourceMappingURL=GreptimeDBQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GreptimeDBQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-time-series-query/GreptimeDBQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAIzE,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,CAAC,6BAA6B,CAa1F,CAAC"}
@@ -0,0 +1,35 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { parseVariables } from '@perses-dev/plugin-system';
14
+ import { getTimeSeriesData } from './get-greptimedb-data';
15
+ import { GreptimeDBTimeSeriesQueryEditor } from './GreptimeDBQueryEditor';
16
+ export const GreptimeDBTimeSeriesQuery = {
17
+ getTimeSeriesData,
18
+ OptionsEditorComponent: GreptimeDBTimeSeriesQueryEditor,
19
+ createInitialOptions: ()=>({
20
+ query: ''
21
+ }),
22
+ dependsOn: (spec)=>{
23
+ const queryVariables = parseVariables(spec.query);
24
+ const allVariables = [
25
+ ...new Set([
26
+ ...queryVariables
27
+ ])
28
+ ];
29
+ return {
30
+ variables: allVariables
31
+ };
32
+ }
33
+ };
34
+
35
+ //# sourceMappingURL=GreptimeDBQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/greptimedb-time-series-query/GreptimeDBQuery.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 { parseVariables, TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';\nimport { getTimeSeriesData } from './get-greptimedb-data';\nimport { GreptimeDBTimeSeriesQueryEditor } from './GreptimeDBQueryEditor';\n\nexport const GreptimeDBTimeSeriesQuery: TimeSeriesQueryPlugin<GreptimeDBTimeSeriesQuerySpec> = {\n getTimeSeriesData,\n OptionsEditorComponent: GreptimeDBTimeSeriesQueryEditor,\n createInitialOptions: () => ({\n query: '',\n }),\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","getTimeSeriesData","GreptimeDBTimeSeriesQueryEditor","GreptimeDBTimeSeriesQuery","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,SAASA,cAAc,QAA+B,4BAA4B;AAElF,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,+BAA+B,QAAQ,0BAA0B;AAE1E,OAAO,MAAMC,4BAAkF;IAC7FF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAAO,CAAA;YAC3BC,OAAO;QACT,CAAA;IACAC,WAAW,CAACC;QACV,MAAMC,iBAAiBT,eAAeQ,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAI;mBAAIF;aAAe;SAAE;QACtD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
@@ -0,0 +1,7 @@
1
+ import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import { ReactElement } from 'react';
3
+ import { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';
4
+ type GreptimeDBTimeSeriesQueryEditorProps = OptionsEditorProps<GreptimeDBTimeSeriesQuerySpec>;
5
+ export declare function GreptimeDBTimeSeriesQueryEditor(props: GreptimeDBTimeSeriesQueryEditorProps): ReactElement;
6
+ export {};
7
+ //# sourceMappingURL=GreptimeDBQueryEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GreptimeDBQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.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,0BAA0B,CAAC;AAEzE,KAAK,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAE9F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,oCAAoC,GAAG,YAAY,CAiFzG"}
@@ -0,0 +1,99 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';
15
+ import { useCallback } from 'react';
16
+ import { produce } from 'immer';
17
+ import { Stack } from '@mui/material';
18
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
19
+ import { GreptimeDBQLEditor } from '../../components';
20
+ import { queryExample } from '../../components/constants';
21
+ import { useQueryState } from '../query-editor-model';
22
+ export function GreptimeDBTimeSeriesQueryEditor(props) {
23
+ const { onChange, value } = props;
24
+ const { datasource } = value;
25
+ const selectedDatasource = datasource ?? DEFAULT_DATASOURCE;
26
+ const { query, handleQueryChange, handleQueryBlur } = useQueryState(props);
27
+ const handleDatasourceChange = (newDatasourceSelection)=>{
28
+ if (!isVariableDatasource(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
29
+ onChange(produce(value, (draft)=>{
30
+ draft.datasource = newDatasourceSelection;
31
+ }));
32
+ return;
33
+ }
34
+ throw new Error('Got unexpected non GreptimeDB datasource selection');
35
+ };
36
+ const handleQueryExecute = (queryValue)=>{
37
+ onChange(produce(value, (draft)=>{
38
+ draft.query = queryValue;
39
+ }));
40
+ };
41
+ const handleGreptimeDBQueryChange = useCallback((e)=>{
42
+ handleQueryChange(e);
43
+ }, [
44
+ handleQueryChange
45
+ ]);
46
+ const examplesStyle = {
47
+ fontSize: '11px',
48
+ color: '#777',
49
+ backgroundColor: '#f5f5f5',
50
+ padding: '8px',
51
+ borderRadius: '4px',
52
+ fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
53
+ whiteSpace: 'pre-wrap',
54
+ lineHeight: '1.3'
55
+ };
56
+ return /*#__PURE__*/ _jsxs(Stack, {
57
+ spacing: 1.5,
58
+ children: [
59
+ /*#__PURE__*/ _jsx(DatasourceSelect, {
60
+ datasourcePluginKind: DATASOURCE_KIND,
61
+ value: selectedDatasource,
62
+ onChange: handleDatasourceChange,
63
+ label: "GreptimeDB Datasource",
64
+ notched: true
65
+ }),
66
+ /*#__PURE__*/ _jsx(GreptimeDBQLEditor, {
67
+ value: query,
68
+ onChange: handleGreptimeDBQueryChange,
69
+ onBlur: handleQueryBlur,
70
+ onKeyDown: (event)=>{
71
+ if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
72
+ event.preventDefault();
73
+ handleQueryExecute(query);
74
+ }
75
+ },
76
+ placeholder: "Enter GreptimeDB SQL query"
77
+ }),
78
+ /*#__PURE__*/ _jsxs("details", {
79
+ children: [
80
+ /*#__PURE__*/ _jsx("summary", {
81
+ style: {
82
+ cursor: 'pointer',
83
+ fontSize: '12px',
84
+ color: '#666',
85
+ marginBottom: '8px'
86
+ },
87
+ children: "Query Examples"
88
+ }),
89
+ /*#__PURE__*/ _jsx("div", {
90
+ style: examplesStyle,
91
+ children: queryExample
92
+ })
93
+ ]
94
+ })
95
+ ]
96
+ });
97
+ }
98
+
99
+ //# sourceMappingURL=GreptimeDBQueryEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.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 { GreptimeDBQLEditor } from '../../components';\nimport { queryExample } from '../../components/constants';\nimport { useQueryState } from '../query-editor-model';\nimport { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';\n\ntype GreptimeDBTimeSeriesQueryEditorProps = OptionsEditorProps<GreptimeDBTimeSeriesQuerySpec>;\n\nexport function GreptimeDBTimeSeriesQueryEditor(props: GreptimeDBTimeSeriesQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n\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 GreptimeDB datasource selection');\n };\n\n const handleQueryExecute = (queryValue: string): void => {\n onChange(\n produce(value, (draft) => {\n draft.query = queryValue;\n })\n );\n };\n\n const handleGreptimeDBQueryChange = useCallback(\n (e: string) => {\n handleQueryChange(e);\n },\n [handleQueryChange]\n );\n\n const examplesStyle = {\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' as const,\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=\"GreptimeDB Datasource\"\n notched\n />\n <GreptimeDBQLEditor\n value={query}\n onChange={handleGreptimeDBQueryChange}\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 GreptimeDB SQL query\"\n />\n <details>\n <summary\n style={{\n cursor: 'pointer',\n fontSize: '12px',\n color: '#666',\n marginBottom: '8px',\n }}\n >\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","GreptimeDBQLEditor","queryExample","useQueryState","GreptimeDBTimeSeriesQueryEditor","props","onChange","value","datasource","selectedDatasource","query","handleQueryChange","handleQueryBlur","handleDatasourceChange","newDatasourceSelection","kind","draft","Error","handleQueryExecute","queryValue","handleGreptimeDBQueryChange","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,kBAAkB,QAAQ,mBAAmB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C,QAAQ;4BACRvB,UAAU;4BACVC,OAAO;4BACPuB,cAAc;wBAChB;kCACD;;kCAGD,KAACC;wBAAIH,OAAOvB;kCAAgBpB;;;;;;AAIpC"}
@@ -0,0 +1,4 @@
1
+ import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';
3
+ export declare const getTimeSeriesData: TimeSeriesQueryPlugin<GreptimeDBTimeSeriesQuerySpec>['getTimeSeriesData'];
4
+ //# sourceMappingURL=get-greptimedb-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-greptimedb-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-time-series-query/get-greptimedb-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAUlE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AA+IzE,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,mBAAmB,CA+CvG,CAAC"}
@@ -0,0 +1,176 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { DEFAULT_DATASOURCE } from '../constants';
14
+ import { findTimeColumnIndex, normalizeRecords, replaceQueryVariables, toTimestampMs } from '../greptimedb-query-data-model';
15
+ function isLikelyNumericType(dataType) {
16
+ if (!dataType) return false;
17
+ const t = dataType.toLowerCase();
18
+ return t.includes('int') || t.includes('float') || t.includes('double') || t.includes('decimal') || t.includes('number');
19
+ }
20
+ function buildSeriesName(valueColumnName, labels) {
21
+ const entries = Object.entries(labels);
22
+ if (entries.length === 0) {
23
+ return valueColumnName;
24
+ }
25
+ return entries.map(([k, v])=>`${k}=${v}`).join(',');
26
+ }
27
+ function buildTimeSeries(records, fallbackTimestampMs) {
28
+ const columnSchemas = records?.schema?.column_schemas ?? [];
29
+ const rows = records?.rows ?? [];
30
+ if (!columnSchemas.length || !rows.length) {
31
+ return [];
32
+ }
33
+ const timeIndex = findTimeColumnIndex(columnSchemas);
34
+ if (timeIndex === -1) {
35
+ // Stat-style queries (e.g. `select count(*)`) may return a single numeric column with no timestamp.
36
+ // In this case, emit a synthetic single-point series to keep numeric panels working.
37
+ const scalarValueIndex = columnSchemas.findIndex((c)=>isLikelyNumericType(c.data_type));
38
+ if (scalarValueIndex === -1) {
39
+ return [];
40
+ }
41
+ const scalarColumnName = columnSchemas[scalarValueIndex]?.name ?? 'value';
42
+ const scalarValues = [];
43
+ rows.forEach((row, rowIndex)=>{
44
+ const raw = row?.[scalarValueIndex];
45
+ const value = typeof raw === 'number' ? raw : Number(raw);
46
+ if (!Number.isFinite(value)) {
47
+ return;
48
+ }
49
+ // Spread multiple rows by 1ms so ordering is stable.
50
+ scalarValues.push([
51
+ fallbackTimestampMs + rowIndex,
52
+ value
53
+ ]);
54
+ });
55
+ if (scalarValues.length === 0) {
56
+ return [];
57
+ }
58
+ return [
59
+ {
60
+ name: scalarColumnName,
61
+ labels: {},
62
+ values: scalarValues
63
+ }
64
+ ];
65
+ }
66
+ // Choose a "value" column. Prefer greptime conventions, then fall back to the first numeric column.
67
+ let valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && c.name.toLowerCase() === 'greptime_value');
68
+ if (valueIndex === -1) {
69
+ valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && c.name.toLowerCase() === 'value');
70
+ }
71
+ if (valueIndex === -1) {
72
+ valueIndex = columnSchemas.findIndex((c, idx)=>idx !== timeIndex && isLikelyNumericType(c.data_type));
73
+ }
74
+ if (valueIndex === -1) {
75
+ // Last resort: treat the first non-time column as value.
76
+ valueIndex = columnSchemas.findIndex((_, idx)=>idx !== timeIndex);
77
+ }
78
+ const valueColumnName = columnSchemas[valueIndex]?.name ?? 'value';
79
+ // Chart-safe default: group rows into standard timeseries (multiple points per series).
80
+ const seriesMap = new Map();
81
+ for (const row of rows){
82
+ const tsMs = toTimestampMs(row?.[timeIndex], columnSchemas[timeIndex]?.data_type);
83
+ if (tsMs === null) {
84
+ continue;
85
+ }
86
+ const raw = row?.[valueIndex];
87
+ const value = typeof raw === 'number' ? raw : Number(raw);
88
+ if (!Number.isFinite(value)) {
89
+ continue;
90
+ }
91
+ const labels = {};
92
+ columnSchemas.forEach((col, idx)=>{
93
+ if (idx === timeIndex || idx === valueIndex) return;
94
+ const v = row?.[idx];
95
+ labels[col.name] = v === null || v === undefined ? '' : String(v);
96
+ });
97
+ // Stable series key by label set.
98
+ const labelsKey = columnSchemas.filter((_, idx)=>idx !== timeIndex && idx !== valueIndex).map((c)=>`${c.name}=${labels[c.name] ?? ''}`).join('|');
99
+ const key = `${valueColumnName}|${labelsKey}`;
100
+ const existing = seriesMap.get(key);
101
+ if (existing) {
102
+ existing.values.push([
103
+ tsMs,
104
+ value
105
+ ]);
106
+ } else {
107
+ seriesMap.set(key, {
108
+ name: buildSeriesName(valueColumnName, labels),
109
+ labels,
110
+ values: [
111
+ [
112
+ tsMs,
113
+ value
114
+ ]
115
+ ]
116
+ });
117
+ }
118
+ }
119
+ return Array.from(seriesMap.values()).filter((s)=>s.values.length > 0);
120
+ }
121
+ function inferStepMsFromSeries(series, fallbackStepMs) {
122
+ let minDeltaMs = Number.POSITIVE_INFINITY;
123
+ for (const s of series){
124
+ const sortedTimestamps = [
125
+ ...s.values.map(([ts])=>ts)
126
+ ].sort((a, b)=>a - b);
127
+ for(let i = 1; i < sortedTimestamps.length; i++){
128
+ const delta = sortedTimestamps[i] - sortedTimestamps[i - 1];
129
+ if (delta > 0 && delta < minDeltaMs) {
130
+ minDeltaMs = delta;
131
+ }
132
+ }
133
+ }
134
+ return Number.isFinite(minDeltaMs) ? minDeltaMs : fallbackStepMs;
135
+ }
136
+ export const getTimeSeriesData = async (spec, context)=>{
137
+ if (!spec.query) {
138
+ return {
139
+ series: []
140
+ };
141
+ }
142
+ const { start, end } = context.timeRange;
143
+ const query = replaceQueryVariables(spec.query, context.variableState, context.timeRange);
144
+ const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? DEFAULT_DATASOURCE);
145
+ const response = await client.query({
146
+ start: start.getTime().toString(),
147
+ end: end.getTime().toString(),
148
+ query
149
+ });
150
+ if (response.status === 'error') {
151
+ throw new Error(response.error ?? 'GreptimeDB query failed');
152
+ }
153
+ const records = normalizeRecords(response.data);
154
+ const tableColumns = records?.schema?.column_schemas ?? [];
155
+ const tableRows = records?.rows ?? [];
156
+ const series = buildTimeSeries(records, end.getTime());
157
+ const stepMs = inferStepMsFromSeries(series, context.suggestedStepMs || 30 * 1000);
158
+ return {
159
+ series,
160
+ timeRange: {
161
+ start,
162
+ end
163
+ },
164
+ stepMs,
165
+ metadata: {
166
+ executedQueryString: query,
167
+ records,
168
+ table: {
169
+ columns: tableColumns,
170
+ rows: tableRows
171
+ }
172
+ }
173
+ };
174
+ };
175
+
176
+ //# sourceMappingURL=get-greptimedb-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/greptimedb-time-series-query/get-greptimedb-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 } from '@perses-dev/plugin-system';\nimport { GreptimeDBClient, GreptimeDBQueryResponse } from '../../model/greptimedb-client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport {\n findTimeColumnIndex,\n GreptimeDBRecords,\n normalizeRecords,\n replaceQueryVariables,\n toTimestampMs,\n} from '../greptimedb-query-data-model';\nimport { GreptimeDBTimeSeriesQuerySpec } from './greptimedb-query-types';\n\nfunction isLikelyNumericType(dataType: string | undefined): boolean {\n if (!dataType) return false;\n const t = dataType.toLowerCase();\n return (\n t.includes('int') || t.includes('float') || t.includes('double') || t.includes('decimal') || t.includes('number')\n );\n}\n\nfunction buildSeriesName(valueColumnName: string, labels: Record<string, string>): string {\n const entries = Object.entries(labels);\n if (entries.length === 0) {\n return valueColumnName;\n }\n\n return entries.map(([k, v]) => `${k}=${v}`).join(',');\n}\n\nfunction buildTimeSeries(\n records: GreptimeDBRecords | undefined,\n fallbackTimestampMs: number\n): Array<{ name: string; labels: Record<string, string>; values: Array<[number, number]> }> {\n const columnSchemas = records?.schema?.column_schemas ?? [];\n const rows = records?.rows ?? [];\n\n if (!columnSchemas.length || !rows.length) {\n return [];\n }\n\n const timeIndex = findTimeColumnIndex(columnSchemas);\n\n if (timeIndex === -1) {\n // Stat-style queries (e.g. `select count(*)`) may return a single numeric column with no timestamp.\n // In this case, emit a synthetic single-point series to keep numeric panels working.\n const scalarValueIndex = columnSchemas.findIndex((c) => isLikelyNumericType(c.data_type));\n if (scalarValueIndex === -1) {\n return [];\n }\n\n const scalarColumnName = columnSchemas[scalarValueIndex]?.name ?? 'value';\n const scalarValues: Array<[number, number]> = [];\n\n rows.forEach((row, rowIndex) => {\n const raw = row?.[scalarValueIndex];\n const value = typeof raw === 'number' ? raw : Number(raw);\n if (!Number.isFinite(value)) {\n return;\n }\n // Spread multiple rows by 1ms so ordering is stable.\n scalarValues.push([fallbackTimestampMs + rowIndex, value]);\n });\n\n if (scalarValues.length === 0) {\n return [];\n }\n\n return [\n {\n name: scalarColumnName,\n labels: {},\n values: scalarValues,\n },\n ];\n }\n\n // Choose a \"value\" column. Prefer greptime conventions, then fall back to the first numeric column.\n let valueIndex = columnSchemas.findIndex((c, idx) => idx !== timeIndex && c.name.toLowerCase() === 'greptime_value');\n if (valueIndex === -1) {\n valueIndex = columnSchemas.findIndex((c, idx) => idx !== timeIndex && c.name.toLowerCase() === 'value');\n }\n if (valueIndex === -1) {\n valueIndex = columnSchemas.findIndex((c, idx) => idx !== timeIndex && isLikelyNumericType(c.data_type));\n }\n if (valueIndex === -1) {\n // Last resort: treat the first non-time column as value.\n valueIndex = columnSchemas.findIndex((_, idx) => idx !== timeIndex);\n }\n\n const valueColumnName = columnSchemas[valueIndex]?.name ?? 'value';\n\n // Chart-safe default: group rows into standard timeseries (multiple points per series).\n const seriesMap = new Map<\n string,\n { name: string; labels: Record<string, string>; values: Array<[number, number]> }\n >();\n\n for (const row of rows) {\n const tsMs = toTimestampMs(row?.[timeIndex], columnSchemas[timeIndex]?.data_type);\n if (tsMs === null) {\n continue;\n }\n\n const raw = row?.[valueIndex];\n const value = typeof raw === 'number' ? raw : Number(raw);\n if (!Number.isFinite(value)) {\n continue;\n }\n\n const labels: Record<string, string> = {};\n columnSchemas.forEach((col, idx) => {\n if (idx === timeIndex || idx === valueIndex) return;\n const v = row?.[idx];\n labels[col.name] = v === null || v === undefined ? '' : String(v);\n });\n\n // Stable series key by label set.\n const labelsKey = columnSchemas\n .filter((_, idx) => idx !== timeIndex && idx !== valueIndex)\n .map((c) => `${c.name}=${labels[c.name] ?? ''}`)\n .join('|');\n const key = `${valueColumnName}|${labelsKey}`;\n\n const existing = seriesMap.get(key);\n if (existing) {\n existing.values.push([tsMs, value]);\n } else {\n seriesMap.set(key, { name: buildSeriesName(valueColumnName, labels), labels, values: [[tsMs, value]] });\n }\n }\n\n return Array.from(seriesMap.values()).filter((s) => s.values.length > 0);\n}\n\nfunction inferStepMsFromSeries(\n series: Array<{ name: string; labels: Record<string, string>; values: Array<[number, number]> }>,\n fallbackStepMs: number\n): number {\n let minDeltaMs = Number.POSITIVE_INFINITY;\n\n for (const s of series) {\n const sortedTimestamps = [...s.values.map(([ts]) => ts)].sort((a, b) => a - b);\n for (let i = 1; i < sortedTimestamps.length; i++) {\n const delta = sortedTimestamps[i]! - sortedTimestamps[i - 1]!;\n if (delta > 0 && delta < minDeltaMs) {\n minDeltaMs = delta;\n }\n }\n }\n\n return Number.isFinite(minDeltaMs) ? minDeltaMs : fallbackStepMs;\n}\n\nexport const getTimeSeriesData: TimeSeriesQueryPlugin<GreptimeDBTimeSeriesQuerySpec>['getTimeSeriesData'] = async (\n spec,\n context\n) => {\n if (!spec.query) {\n return {\n series: [],\n };\n }\n\n const { start, end } = context.timeRange;\n const query = replaceQueryVariables(spec.query, context.variableState, context.timeRange);\n\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as GreptimeDBClient;\n\n const response: GreptimeDBQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n if (response.status === 'error') {\n throw new Error(response.error ?? 'GreptimeDB query failed');\n }\n\n const records = normalizeRecords(response.data);\n const tableColumns = records?.schema?.column_schemas ?? [];\n const tableRows = records?.rows ?? [];\n\n const series = buildTimeSeries(records, end.getTime());\n const stepMs = inferStepMsFromSeries(series, context.suggestedStepMs || 30 * 1000);\n\n return {\n series,\n timeRange: { start, end },\n stepMs,\n metadata: {\n executedQueryString: query,\n records,\n table: {\n columns: tableColumns,\n rows: tableRows,\n },\n },\n };\n};\n"],"names":["DEFAULT_DATASOURCE","findTimeColumnIndex","normalizeRecords","replaceQueryVariables","toTimestampMs","isLikelyNumericType","dataType","t","toLowerCase","includes","buildSeriesName","valueColumnName","labels","entries","Object","length","map","k","v","join","buildTimeSeries","records","fallbackTimestampMs","columnSchemas","schema","column_schemas","rows","timeIndex","scalarValueIndex","findIndex","c","data_type","scalarColumnName","name","scalarValues","forEach","row","rowIndex","raw","value","Number","isFinite","push","values","valueIndex","idx","_","seriesMap","Map","tsMs","col","undefined","String","labelsKey","filter","key","existing","get","set","Array","from","s","inferStepMsFromSeries","series","fallbackStepMs","minDeltaMs","POSITIVE_INFINITY","sortedTimestamps","ts","sort","a","b","i","delta","getTimeSeriesData","spec","context","query","start","end","timeRange","variableState","client","datasourceStore","getDatasourceClient","datasource","response","getTime","toString","status","Error","error","data","tableColumns","tableRows","stepMs","suggestedStepMs","metadata","executedQueryString","table","columns"],"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,SAASA,kBAAkB,QAAQ,eAAe;AAClD,SACEC,mBAAmB,EAEnBC,gBAAgB,EAChBC,qBAAqB,EACrBC,aAAa,QACR,iCAAiC;AAGxC,SAASC,oBAAoBC,QAA4B;IACvD,IAAI,CAACA,UAAU,OAAO;IACtB,MAAMC,IAAID,SAASE,WAAW;IAC9B,OACED,EAAEE,QAAQ,CAAC,UAAUF,EAAEE,QAAQ,CAAC,YAAYF,EAAEE,QAAQ,CAAC,aAAaF,EAAEE,QAAQ,CAAC,cAAcF,EAAEE,QAAQ,CAAC;AAE5G;AAEA,SAASC,gBAAgBC,eAAuB,EAAEC,MAA8B;IAC9E,MAAMC,UAAUC,OAAOD,OAAO,CAACD;IAC/B,IAAIC,QAAQE,MAAM,KAAK,GAAG;QACxB,OAAOJ;IACT;IAEA,OAAOE,QAAQG,GAAG,CAAC,CAAC,CAACC,GAAGC,EAAE,GAAK,GAAGD,EAAE,CAAC,EAAEC,GAAG,EAAEC,IAAI,CAAC;AACnD;AAEA,SAASC,gBACPC,OAAsC,EACtCC,mBAA2B;IAE3B,MAAMC,gBAAgBF,SAASG,QAAQC,kBAAkB,EAAE;IAC3D,MAAMC,OAAOL,SAASK,QAAQ,EAAE;IAEhC,IAAI,CAACH,cAAc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X;IACF;IAEA,IAAIS,SAASG,MAAM,KAAK,SAAS;QAC/B,MAAM,IAAIC,MAAMJ,SAASK,KAAK,IAAI;IACpC;IAEA,MAAMtE,UAAUnB,iBAAiBoF,SAASM,IAAI;IAC9C,MAAMC,eAAexE,SAASG,QAAQC,kBAAkB,EAAE;IAC1D,MAAMqE,YAAYzE,SAASK,QAAQ,EAAE;IAErC,MAAMqC,SAAS3C,gBAAgBC,SAAS0D,IAAIQ,OAAO;IACnD,MAAMQ,SAASjC,sBAAsBC,QAAQa,QAAQoB,eAAe,IAAI,KAAK;IAE7E,OAAO;QACLjC;QACAiB,WAAW;YAAEF;YAAOC;QAAI;QACxBgB;QACAE,UAAU;YACRC,qBAAqBrB;YACrBxD;YACA8E,OAAO;gBACLC,SAASP;gBACTnE,MAAMoE;YACR;QACF;IACF;AACF,EAAE"}
@@ -0,0 +1,7 @@
1
+ import { DatasourceSelector } from '@perses-dev/spec';
2
+ export interface GreptimeDBTimeSeriesQuerySpec {
3
+ query: string;
4
+ datasource?: DatasourceSelector;
5
+ timeColumn?: string;
6
+ }
7
+ //# sourceMappingURL=greptimedb-query-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greptimedb-query-types.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-time-series-query/greptimedb-query-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAEhC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { };
14
+
15
+ //# sourceMappingURL=greptimedb-query-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/greptimedb-time-series-query/greptimedb-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 GreptimeDBTimeSeriesQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n // Legacy field kept for dashboard compatibility. Not used by query execution.\n timeColumn?: 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,WAKC"}
@@ -0,0 +1,5 @@
1
+ export * from './get-greptimedb-data';
2
+ export * from './GreptimeDBQuery';
3
+ export * from './GreptimeDBQueryEditor';
4
+ export * from './greptimedb-query-types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/queries/greptimedb-time-series-query/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,18 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './get-greptimedb-data';
14
+ export * from './GreptimeDBQuery';
15
+ export * from './GreptimeDBQueryEditor';
16
+ export * from './greptimedb-query-types';
17
+
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/queries/greptimedb-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 './get-greptimedb-data';\nexport * from './GreptimeDBQuery';\nexport * from './GreptimeDBQueryEditor';\nexport * from './greptimedb-query-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,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,2BAA2B"}
@@ -0,0 +1,4 @@
1
+ import { TraceQueryPlugin } from '@perses-dev/plugin-system';
2
+ import { GreptimeDBTraceQuerySpec } from './greptimedb-trace-query-types';
3
+ export declare const GreptimeDBTraceQuery: TraceQueryPlugin<GreptimeDBTraceQuerySpec>;
4
+ //# sourceMappingURL=GreptimeDBTraceQuery.d.ts.map