@perses-dev/clickhouse-plugin 0.6.0-rc.1 → 0.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/__mf/js/ClickHouse.76a0fbf4.js +7 -0
  2. package/__mf/js/async/1.1e91dea7.js +102 -0
  3. package/__mf/js/async/121.1f2608b3.js +2 -0
  4. package/__mf/js/async/181.e0b3926b.js +2 -0
  5. package/__mf/js/async/192.406c1c63.js +1 -0
  6. package/__mf/js/async/2.05cb4775.js +1 -0
  7. package/__mf/js/async/235.83f7cd2f.js +1 -0
  8. package/__mf/js/async/274.b8ce8e1b.js +2 -0
  9. package/__mf/js/async/356.f08f6910.js +1 -0
  10. package/__mf/js/async/392.d89cad59.js +2 -0
  11. package/__mf/js/async/440.62bb6f89.js +2 -0
  12. package/__mf/js/async/45.37b51769.js +1 -0
  13. package/__mf/js/async/470.3fc1ceb1.js +2 -0
  14. package/__mf/js/async/482.e59722dd.js +7 -0
  15. package/__mf/js/async/482.e59722dd.js.LICENSE.txt +102 -0
  16. package/__mf/js/async/522.69c8ed0a.js +22 -0
  17. package/__mf/js/async/560.0b052d6c.js +37 -0
  18. package/__mf/js/async/562.bc9f9e5a.js +2 -0
  19. package/__mf/js/async/587.8361f462.js +1 -0
  20. package/__mf/js/async/616.2f7b03f4.js +1 -0
  21. package/__mf/js/async/663.40f2ec68.js +1 -0
  22. package/__mf/js/async/700.5b2b12f4.js +3 -0
  23. package/__mf/js/async/862.e7bf5c84.js +2 -0
  24. package/__mf/js/async/865.39675206.js +1 -0
  25. package/__mf/js/async/901.d4978bec.js +1 -0
  26. package/__mf/js/async/941.4bc59208.js +2 -0
  27. package/__mf/js/async/943.62d64363.js +2 -0
  28. package/__mf/js/async/944.f146f769.js +10 -0
  29. package/__mf/js/async/968.4ac56699.js +1 -0
  30. package/__mf/js/async/__federation_expose_ClickHouseDatasource.442c0903.js +2 -0
  31. package/__mf/js/async/__federation_expose_ClickHouseLogQuery.13604af9.js +20 -0
  32. package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.c9cd60a0.js +20 -0
  33. package/__mf/js/main.1efc6679.js +7 -0
  34. package/lib/bootstrap.js +2 -2
  35. package/lib/components/ClickQLEditor.d.ts +2 -2
  36. package/lib/components/ClickQLEditor.d.ts.map +1 -1
  37. package/lib/components/ClickQLEditor.js +3 -3
  38. package/lib/components/ClickQLEditor.js.map +1 -1
  39. package/lib/components/index.js +1 -1
  40. package/lib/components/index.js.map +1 -1
  41. package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts +2 -2
  42. package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts.map +1 -1
  43. package/lib/datasources/click-house-datasource/ClickHouseDatasource.js +2 -2
  44. package/lib/datasources/click-house-datasource/ClickHouseDatasource.js.map +1 -1
  45. package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts +2 -2
  46. package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts.map +1 -1
  47. package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +1 -1
  48. package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js.map +1 -1
  49. package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +3 -3
  50. package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -1
  51. package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -1
  52. package/lib/datasources/click-house-datasource/index.js +3 -3
  53. package/lib/datasources/click-house-datasource/index.js.map +1 -1
  54. package/lib/datasources/index.js +1 -1
  55. package/lib/datasources/index.js.map +1 -1
  56. package/lib/getPluginModule.d.ts +1 -1
  57. package/lib/getPluginModule.d.ts.map +1 -1
  58. package/lib/getPluginModule.js +3 -1
  59. package/lib/getPluginModule.js.map +1 -1
  60. package/lib/index-federation.js +1 -1
  61. package/lib/index.js +3 -3
  62. package/lib/index.js.map +1 -1
  63. package/lib/model/click-house-client.d.ts +5 -1
  64. package/lib/model/click-house-client.d.ts.map +1 -1
  65. package/lib/model/click-house-client.js +10 -2
  66. package/lib/model/click-house-client.js.map +1 -1
  67. package/lib/model/click-house-data-types.d.ts +2 -2
  68. package/lib/model/click-house-data-types.d.ts.map +1 -1
  69. package/lib/model/click-house-data-types.js.map +1 -1
  70. package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts +2 -2
  71. package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts.map +1 -1
  72. package/lib/queries/click-house-log-query/ClickHouseLogQuery.js +4 -6
  73. package/lib/queries/click-house-log-query/ClickHouseLogQuery.js.map +1 -1
  74. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts +3 -3
  75. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts.map +1 -1
  76. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +9 -9
  77. package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -1
  78. package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts +1 -1
  79. package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts.map +1 -1
  80. package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -1
  81. package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts +2 -2
  82. package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts.map +1 -1
  83. package/lib/queries/click-house-log-query/get-click-house-log-data.js +11 -7
  84. package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -1
  85. package/lib/queries/click-house-log-query/index.js +4 -4
  86. package/lib/queries/click-house-log-query/index.js.map +1 -1
  87. package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts +2 -2
  88. package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts.map +1 -1
  89. package/lib/queries/click-house-time-series-query/ClickHouseQuery.js +4 -6
  90. package/lib/queries/click-house-time-series-query/ClickHouseQuery.js.map +1 -1
  91. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts +3 -3
  92. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts.map +1 -1
  93. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +9 -9
  94. package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -1
  95. package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +1 -1
  96. package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts.map +1 -1
  97. package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -1
  98. package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts +2 -2
  99. package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -1
  100. package/lib/queries/click-house-time-series-query/get-click-house-data.js +65 -19
  101. package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -1
  102. package/lib/queries/click-house-time-series-query/index.js +4 -4
  103. package/lib/queries/click-house-time-series-query/index.js.map +1 -1
  104. package/lib/queries/index.js +2 -2
  105. package/lib/queries/index.js.map +1 -1
  106. package/lib/queries/query-editor-model.d.ts +1 -1
  107. package/lib/queries/query-editor-model.d.ts.map +1 -1
  108. package/lib/queries/query-editor-model.js +2 -2
  109. package/lib/queries/query-editor-model.js.map +1 -1
  110. package/lib/setup-tests.d.ts +1 -1
  111. package/lib/setup-tests.d.ts.map +1 -1
  112. package/lib/setup-tests.js +2 -2
  113. package/lib/setup-tests.js.map +1 -1
  114. package/mf-manifest.json +55 -136
  115. package/mf-stats.json +55 -148
  116. package/package.json +21 -13
  117. package/__mf/js/ClickHouse.56ee1464.js +0 -7
  118. package/__mf/js/async/1616.c86fdd40.js +0 -1
  119. package/__mf/js/async/1728.645b0066.js +0 -1
  120. package/__mf/js/async/1811.29b51780.js +0 -101
  121. package/__mf/js/async/1825.299edaf9.js +0 -1
  122. package/__mf/js/async/1969.ea0bd5b9.js +0 -1
  123. package/__mf/js/async/2043.13379b9d.js +0 -2
  124. package/__mf/js/async/2043.13379b9d.js.LICENSE.txt +0 -24
  125. package/__mf/js/async/2386.56de292b.js +0 -2
  126. package/__mf/js/async/3059.3d9dad23.js +0 -1
  127. package/__mf/js/async/3181.f3124eab.js +0 -2
  128. package/__mf/js/async/392.c8af2244.js +0 -2
  129. package/__mf/js/async/3981.fe98c70e.js +0 -3
  130. package/__mf/js/async/4121.b6afa425.js +0 -2
  131. package/__mf/js/async/4233.abbba3f6.js +0 -7
  132. package/__mf/js/async/4233.abbba3f6.js.LICENSE.txt +0 -39
  133. package/__mf/js/async/5002.9167d87e.js +0 -1
  134. package/__mf/js/async/5071.a039a221.js +0 -1
  135. package/__mf/js/async/5440.898ddc2f.js +0 -2
  136. package/__mf/js/async/5481.223427f5.js +0 -2
  137. package/__mf/js/async/5562.d4359565.js +0 -2
  138. package/__mf/js/async/5587.72383e00.js +0 -1
  139. package/__mf/js/async/599.37f9fe2f.js +0 -1
  140. package/__mf/js/async/6045.9b807b97.js +0 -1
  141. package/__mf/js/async/6155.1398a410.js +0 -2
  142. package/__mf/js/async/6155.1398a410.js.LICENSE.txt +0 -37
  143. package/__mf/js/async/6274.22bd6f34.js +0 -2
  144. package/__mf/js/async/6688.abdc25f6.js +0 -2
  145. package/__mf/js/async/7177.96ff5c4d.js +0 -1
  146. package/__mf/js/async/7192.c1f998d2.js +0 -1
  147. package/__mf/js/async/7968.ae66f60b.js +0 -1
  148. package/__mf/js/async/7978.a58ed5ff.js +0 -1
  149. package/__mf/js/async/7984.824ae5e8.js +0 -22
  150. package/__mf/js/async/8356.eda63865.js +0 -1
  151. package/__mf/js/async/8470.3ae4fba1.js +0 -2
  152. package/__mf/js/async/873.e4ddcabf.js +0 -1
  153. package/__mf/js/async/9235.aeb9d818.js +0 -1
  154. package/__mf/js/async/941.11ea3ddf.js +0 -2
  155. package/__mf/js/async/9588.d09a1141.js +0 -1
  156. package/__mf/js/async/9754.9ea7778b.js +0 -10
  157. package/__mf/js/async/9836.75f99110.js +0 -1
  158. package/__mf/js/async/9877.8f08e12a.js +0 -38
  159. package/__mf/js/async/__federation_expose_ClickHouseDatasource.68393632.js +0 -2
  160. package/__mf/js/async/__federation_expose_ClickHouseLogQuery.b776db9c.js +0 -20
  161. package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.12f07a4f.js +0 -20
  162. package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.12f07a4f.js.LICENSE.txt +0 -9
  163. package/__mf/js/main.1360e83a.js +0 -7
  164. package/lib/cjs/bootstrap.js +0 -26
  165. package/lib/cjs/components/ClickQLEditor.js +0 -72
  166. package/lib/cjs/components/constants.js +0 -41
  167. package/lib/cjs/components/index.js +0 -30
  168. package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasource.js +0 -49
  169. package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +0 -51
  170. package/lib/cjs/datasources/click-house-datasource/click-house-datasource-types.js +0 -16
  171. package/lib/cjs/datasources/click-house-datasource/index.js +0 -32
  172. package/lib/cjs/datasources/index.js +0 -30
  173. package/lib/cjs/env.d.js +0 -14
  174. package/lib/cjs/getPluginModule.js +0 -39
  175. package/lib/cjs/index-federation.js +0 -55
  176. package/lib/cjs/index.js +0 -38
  177. package/lib/cjs/model/click-house-client.js +0 -66
  178. package/lib/cjs/model/click-house-data-types.js +0 -16
  179. package/lib/cjs/queries/click-house-log-query/ClickHouseLogQuery.js +0 -45
  180. package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +0 -104
  181. package/lib/cjs/queries/click-house-log-query/click-house-log-query-types.js +0 -16
  182. package/lib/cjs/queries/click-house-log-query/get-click-house-log-data.js +0 -89
  183. package/lib/cjs/queries/click-house-log-query/index.js +0 -33
  184. package/lib/cjs/queries/click-house-time-series-query/ClickHouseQuery.js +0 -43
  185. package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +0 -104
  186. package/lib/cjs/queries/click-house-time-series-query/click-house-query-types.js +0 -16
  187. package/lib/cjs/queries/click-house-time-series-query/get-click-house-data.js +0 -70
  188. package/lib/cjs/queries/click-house-time-series-query/index.js +0 -33
  189. package/lib/cjs/queries/constants.js +0 -34
  190. package/lib/cjs/queries/index.js +0 -31
  191. package/lib/cjs/queries/query-editor-model.js +0 -53
  192. package/lib/cjs/setup-tests.js +0 -19
  193. /package/__mf/css/async/{4233.85c2cbf6.css → 482.85c2cbf6.css} +0 -0
  194. /package/__mf/js/async/{4121.b6afa425.js.LICENSE.txt → 121.1f2608b3.js.LICENSE.txt} +0 -0
  195. /package/__mf/js/async/{2386.56de292b.js.LICENSE.txt → 181.e0b3926b.js.LICENSE.txt} +0 -0
  196. /package/__mf/js/async/{6274.22bd6f34.js.LICENSE.txt → 274.b8ce8e1b.js.LICENSE.txt} +0 -0
  197. /package/__mf/js/async/{392.c8af2244.js.LICENSE.txt → 392.d89cad59.js.LICENSE.txt} +0 -0
  198. /package/__mf/js/async/{5440.898ddc2f.js.LICENSE.txt → 440.62bb6f89.js.LICENSE.txt} +0 -0
  199. /package/__mf/js/async/{8470.3ae4fba1.js.LICENSE.txt → 470.3fc1ceb1.js.LICENSE.txt} +0 -0
  200. /package/__mf/js/async/{7984.824ae5e8.js.LICENSE.txt → 522.69c8ed0a.js.LICENSE.txt} +0 -0
  201. /package/__mf/js/async/{3181.f3124eab.js.LICENSE.txt → 562.bc9f9e5a.js.LICENSE.txt} +0 -0
  202. /package/__mf/js/async/{5481.223427f5.js.LICENSE.txt → 862.e7bf5c84.js.LICENSE.txt} +0 -0
  203. /package/__mf/js/async/{5562.d4359565.js.LICENSE.txt → 941.4bc59208.js.LICENSE.txt} +0 -0
  204. /package/__mf/js/async/{6688.abdc25f6.js.LICENSE.txt → 943.62d64363.js.LICENSE.txt} +0 -0
  205. /package/__mf/js/async/{9754.9ea7778b.js.LICENSE.txt → 944.f146f769.js.LICENSE.txt} +0 -0
  206. /package/__mf/js/async/{941.11ea3ddf.js.LICENSE.txt → __federation_expose_ClickHouseDatasource.442c0903.js.LICENSE.txt} +0 -0
  207. /package/__mf/js/async/{__federation_expose_ClickHouseDatasource.68393632.js.LICENSE.txt → __federation_expose_ClickHouseLogQuery.13604af9.js.LICENSE.txt} +0 -0
  208. /package/__mf/js/async/{__federation_expose_ClickHouseLogQuery.b776db9c.js.LICENSE.txt → __federation_expose_ClickHouseTimeSeriesQuery.c9cd60a0.js.LICENSE.txt} +0 -0
@@ -10,7 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import packageJson from '../package.json';
13
+ import packageJson from "../package.json" with {
14
+ type: 'json'
15
+ };
14
16
  /**
15
17
  * Returns the plugin module information from package.json
16
18
  */ export function getPluginModule() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getPluginModule.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 { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"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,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
1
+ {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\n\nimport packageJson from '../package.json' with { type: 'json' };\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","type","getPluginModule","name","version","perses","kind","metadata","spec"],"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,OAAOA,iBAAiB,uBAAuB;IAAEC,MAAM;AAAO,EAAE;AAEhE;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGL;IAClC,OAAO;QACLM,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
@@ -10,6 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import('./bootstrap');
13
+ import("./bootstrap.js");
14
14
 
15
15
  //# sourceMappingURL=index-federation.js.map
package/lib/index.js CHANGED
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { getPluginModule } from './getPluginModule';
14
- export * from './queries';
15
- export * from './datasources';
13
+ export { getPluginModule } from "./getPluginModule.js";
14
+ export * from "./queries/index.js";
15
+ export * from "./datasources/index.js";
16
16
 
17
17
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/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 { getPluginModule } from './getPluginModule';\nexport * from './queries';\nexport * from './datasources';\n"],"names":["getPluginModule"],"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,eAAe,QAAQ,oBAAoB;AACpD,cAAc,YAAY;AAC1B,cAAc,gBAAgB"}
1
+ {"version":3,"sources":["../../src/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 { getPluginModule } from './getPluginModule';\nexport * from './queries';\nexport * from './datasources';\n"],"names":["getPluginModule"],"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,eAAe,QAAQ,uBAAoB;AACpD,cAAc,qBAAY;AAC1B,cAAc,yBAAgB"}
@@ -1,6 +1,8 @@
1
- import { RequestHeaders } from '@perses-dev/client';
1
+ import type { RequestHeaders } from '@perses-dev/client';
2
2
  export interface ClickHouseQueryParams {
3
3
  query: string;
4
+ start?: string;
5
+ end?: string;
4
6
  database?: string;
5
7
  }
6
8
  export interface ClickHouseQueryOptions {
@@ -18,5 +20,7 @@ export interface ClickHouseClient {
18
20
  query: string;
19
21
  }) => Promise<ClickHouseQueryResponse>;
20
22
  }
23
+ export declare function replaceTimeRangePlaceholders(query: string, start?: string, end?: string): string;
24
+ export declare function formatClickHouseDateTime(date: Date): string;
21
25
  export declare function query(params: ClickHouseQueryParams, queryOptions: ClickHouseQueryOptions): Promise<ClickHouseQueryResponse>;
22
26
  //# sourceMappingURL=click-house-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-house-client.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACpG;AAED,wBAAsB,KAAK,CACzB,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,sBAAsB,GACnC,OAAO,CAAC,uBAAuB,CAAC,CA4ClC"}
1
+ {"version":3,"file":"click-house-client.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-client.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACpG;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhG;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAK3D;AAED,wBAAsB,KAAK,CACzB,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,sBAAsB,GACnC,OAAO,CAAC,uBAAuB,CAAC,CA4ClC"}
@@ -10,13 +10,19 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
+ export function replaceTimeRangePlaceholders(query, start, end) {
14
+ return query.replaceAll('{start}', start ?? '{start}').replaceAll('{end}', end ?? '{end}');
15
+ }
16
+ export function formatClickHouseDateTime(date) {
17
+ return date.toISOString().replace('T', ' ').replace(/\.\d{3}Z$/, '');
18
+ }
13
19
  export async function query(params, queryOptions) {
14
20
  const { datasourceUrl, headers } = queryOptions;
15
21
  const url = urlBuilder(datasourceUrl);
16
22
  if (!params.query) {
17
23
  throw new Error('No query provided in params');
18
24
  }
19
- let finalQuery = params.query.trim();
25
+ let finalQuery = replaceTimeRangePlaceholders(params.query.trim(), params.start, params.end);
20
26
  if (!finalQuery.toUpperCase().includes('FORMAT')) {
21
27
  finalQuery += ' FORMAT JSON';
22
28
  }
@@ -44,7 +50,9 @@ export async function query(params, queryOptions) {
44
50
  data: body.data || body
45
51
  };
46
52
  } catch (e) {
47
- throw new Error(`ClickHouse query failed: ${e}`);
53
+ throw new Error(`ClickHouse query failed: ${e}`, {
54
+ cause: e
55
+ });
48
56
  }
49
57
  }
50
58
  function urlBuilder(datasourceUrl) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/click-house-client.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 { RequestHeaders } from '@perses-dev/client';\n\nexport interface ClickHouseQueryParams {\n query: string;\n database?: string;\n}\n\nexport interface ClickHouseQueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface ClickHouseQueryResponse {\n status: 'success' | 'error';\n data: unknown;\n}\n\nexport interface ClickHouseClient {\n query: (params: { start: string; end: string; query: string }) => Promise<ClickHouseQueryResponse>;\n}\n\nexport async function query(\n params: ClickHouseQueryParams,\n queryOptions: ClickHouseQueryOptions\n): Promise<ClickHouseQueryResponse> {\n const { datasourceUrl, headers } = queryOptions;\n\n const url = urlBuilder(datasourceUrl);\n if (!params.query) {\n throw new Error('No query provided in params');\n }\n\n let finalQuery = params.query.trim();\n if (!finalQuery.toUpperCase().includes('FORMAT')) {\n finalQuery += ' FORMAT JSON';\n }\n\n url.searchParams.set('query', finalQuery);\n url.searchParams.set('database', params.database || 'default');\n\n const init = {\n method: 'GET',\n headers: {\n ...headers,\n },\n };\n\n try {\n const response = await fetch(url.toString(), init);\n\n if (!response.ok) {\n const errorText = await response.text();\n console.error('ClickHouse error response:', errorText);\n return {\n status: 'error',\n data: [],\n };\n }\n\n const body = await response.json();\n\n return {\n status: 'success',\n data: body.data || body,\n };\n } catch (e) {\n throw new Error(`ClickHouse query failed: ${e}`);\n }\n}\n\nfunction urlBuilder(datasourceUrl: string): URL {\n if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {\n return new URL(datasourceUrl);\n }\n // if relative path (e.g. proxy url), resolve against window.location.origin\n return new URL(datasourceUrl, window.location.origin);\n}\n"],"names":["query","params","queryOptions","datasourceUrl","headers","url","urlBuilder","Error","finalQuery","trim","toUpperCase","includes","searchParams","set","database","init","method","response","fetch","toString","ok","errorText","text","console","error","status","data","body","json","e","startsWith","URL","window","location","origin"],"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;AAuBjC,OAAO,eAAeA,MACpBC,MAA6B,EAC7BC,YAAoC;IAEpC,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE,GAAGF;IAEnC,MAAMG,MAAMC,WAAWH;IACvB,IAAI,CAACF,OAAOD,KAAK,EAAE;QACjB,MAAM,IAAIO,MAAM;IAClB;IAEA,IAAIC,aAAaP,OAAOD,KAAK,CAACS,IAAI;IAClC,IAAI,CAACD,WAAWE,WAAW,GAAGC,QAAQ,CAAC,WAAW;QAChDH,cAAc;IAChB;IAEAH,IAAIO,YAAY,CAACC,GAAG,CAAC,SAASL;IAC9BH,IAAIO,YAAY,CAACC,GAAG,CAAC,YAAYZ,OAAOa,QAAQ,IAAI;IAEpD,MAAMC,OAAO;QACXC,QAAQ;QACRZ,SAAS;YACP,GAAGA,OAAO;QACZ;IACF;IAEA,IAAI;QACF,MAAMa,WAAW,MAAMC,MAAMb,IAAIc,QAAQ,IAAIJ;QAE7C,IAAI,CAACE,SAASG,EAAE,EAAE;YAChB,MAAMC,YAAY,MAAMJ,SAASK,IAAI;YACrCC,QAAQC,KAAK,CAAC,8BAA8BH;YAC5C,OAAO;gBACLI,QAAQ;gBACRC,MAAM,EAAE;YACV;QACF;QAEA,MAAMC,OAAO,MAAMV,SAASW,IAAI;QAEhC,OAAO;YACLH,QAAQ;YACRC,MAAMC,KAAKD,IAAI,IAAIC;QACrB;IACF,EAAE,OAAOE,GAAG;QACV,MAAM,IAAItB,MAAM,CAAC,yBAAyB,EAAEsB,GAAG;IACjD;AACF;AAEA,SAASvB,WAAWH,aAAqB;IACvC,IAAIA,cAAc2B,UAAU,CAAC,cAAc3B,cAAc2B,UAAU,CAAC,aAAa;QAC/E,OAAO,IAAIC,IAAI5B;IACjB;IACA,4EAA4E;IAC5E,OAAO,IAAI4B,IAAI5B,eAAe6B,OAAOC,QAAQ,CAACC,MAAM;AACtD"}
1
+ {"version":3,"sources":["../../../src/model/click-house-client.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { RequestHeaders } from '@perses-dev/client';\n\nexport interface ClickHouseQueryParams {\n query: string;\n start?: string;\n end?: string;\n database?: string;\n}\n\nexport interface ClickHouseQueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface ClickHouseQueryResponse {\n status: 'success' | 'error';\n data: unknown;\n}\n\nexport interface ClickHouseClient {\n query: (params: { start: string; end: string; query: string }) => Promise<ClickHouseQueryResponse>;\n}\n\nexport function replaceTimeRangePlaceholders(query: string, start?: string, end?: string): string {\n return query.replaceAll('{start}', start ?? '{start}').replaceAll('{end}', end ?? '{end}');\n}\n\nexport function formatClickHouseDateTime(date: Date): string {\n return date\n .toISOString()\n .replace('T', ' ')\n .replace(/\\.\\d{3}Z$/, '');\n}\n\nexport async function query(\n params: ClickHouseQueryParams,\n queryOptions: ClickHouseQueryOptions,\n): Promise<ClickHouseQueryResponse> {\n const { datasourceUrl, headers } = queryOptions;\n\n const url = urlBuilder(datasourceUrl);\n if (!params.query) {\n throw new Error('No query provided in params');\n }\n\n let finalQuery = replaceTimeRangePlaceholders(params.query.trim(), params.start, params.end);\n if (!finalQuery.toUpperCase().includes('FORMAT')) {\n finalQuery += ' FORMAT JSON';\n }\n\n url.searchParams.set('query', finalQuery);\n url.searchParams.set('database', params.database || 'default');\n\n const init = {\n method: 'GET',\n headers: {\n ...headers,\n },\n };\n\n try {\n const response = await fetch(url.toString(), init);\n\n if (!response.ok) {\n const errorText = await response.text();\n console.error('ClickHouse error response:', errorText);\n return {\n status: 'error',\n data: [],\n };\n }\n\n const body = await response.json();\n\n return {\n status: 'success',\n data: body.data || body,\n };\n } catch (e) {\n throw new Error(`ClickHouse query failed: ${e}`, { cause: e });\n }\n}\n\nfunction urlBuilder(datasourceUrl: string): URL {\n if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {\n return new URL(datasourceUrl);\n }\n // if relative path (e.g. proxy url), resolve against window.location.origin\n return new URL(datasourceUrl, window.location.origin);\n}\n"],"names":["replaceTimeRangePlaceholders","query","start","end","replaceAll","formatClickHouseDateTime","date","toISOString","replace","params","queryOptions","datasourceUrl","headers","url","urlBuilder","Error","finalQuery","trim","toUpperCase","includes","searchParams","set","database","init","method","response","fetch","toString","ok","errorText","text","console","error","status","data","body","json","e","cause","startsWith","URL","window","location","origin"],"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;AAyBjC,OAAO,SAASA,6BAA6BC,KAAa,EAAEC,KAAc,EAAEC,GAAY;IACtF,OAAOF,MAAMG,UAAU,CAAC,WAAWF,SAAS,WAAWE,UAAU,CAAC,SAASD,OAAO;AACpF;AAEA,OAAO,SAASE,yBAAyBC,IAAU;IACjD,OAAOA,KACJC,WAAW,GACXC,OAAO,CAAC,KAAK,KACbA,OAAO,CAAC,aAAa;AAC1B;AAEA,OAAO,eAAeP,MACpBQ,MAA6B,EAC7BC,YAAoC;IAEpC,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE,GAAGF;IAEnC,MAAMG,MAAMC,WAAWH;IACvB,IAAI,CAACF,OAAOR,KAAK,EAAE;QACjB,MAAM,IAAIc,MAAM;IAClB;IAEA,IAAIC,aAAahB,6BAA6BS,OAAOR,KAAK,CAACgB,IAAI,IAAIR,OAAOP,KAAK,EAAEO,OAAON,GAAG;IAC3F,IAAI,CAACa,WAAWE,WAAW,GAAGC,QAAQ,CAAC,WAAW;QAChDH,cAAc;IAChB;IAEAH,IAAIO,YAAY,CAACC,GAAG,CAAC,SAASL;IAC9BH,IAAIO,YAAY,CAACC,GAAG,CAAC,YAAYZ,OAAOa,QAAQ,IAAI;IAEpD,MAAMC,OAAO;QACXC,QAAQ;QACRZ,SAAS;YACP,GAAGA,OAAO;QACZ;IACF;IAEA,IAAI;QACF,MAAMa,WAAW,MAAMC,MAAMb,IAAIc,QAAQ,IAAIJ;QAE7C,IAAI,CAACE,SAASG,EAAE,EAAE;YAChB,MAAMC,YAAY,MAAMJ,SAASK,IAAI;YACrCC,QAAQC,KAAK,CAAC,8BAA8BH;YAC5C,OAAO;gBACLI,QAAQ;gBACRC,MAAM,EAAE;YACV;QACF;QAEA,MAAMC,OAAO,MAAMV,SAASW,IAAI;QAEhC,OAAO;YACLH,QAAQ;YACRC,MAAMC,KAAKD,IAAI,IAAIC;QACrB;IACF,EAAE,OAAOE,GAAG;QACV,MAAM,IAAItB,MAAM,CAAC,yBAAyB,EAAEsB,GAAG,EAAE;YAAEC,OAAOD;QAAE;IAC9D;AACF;AAEA,SAASvB,WAAWH,aAAqB;IACvC,IAAIA,cAAc4B,UAAU,CAAC,cAAc5B,cAAc4B,UAAU,CAAC,aAAa;QAC/E,OAAO,IAAIC,IAAI7B;IACjB;IACA,4EAA4E;IAC5E,OAAO,IAAI6B,IAAI7B,eAAe8B,OAAOC,QAAQ,CAACC,MAAM;AACtD"}
@@ -1,9 +1,9 @@
1
- import { LogData, TimeSeriesData } from '@perses-dev/spec';
1
+ import type { LogData, TimeSeriesData } from '@perses-dev/spec';
2
2
  export interface ClickHouseTimeSeriesData extends TimeSeriesData {
3
3
  logs?: LogData;
4
4
  }
5
5
  export interface TimeSeriesEntry {
6
6
  time: string;
7
- log_count: number | string;
7
+ [key: string]: number | string | null | undefined;
8
8
  }
9
9
  //# sourceMappingURL=click-house-data-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-house-data-types.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-data-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"click-house-data-types.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-data-types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/click-house-data-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 { LogData, TimeSeriesData } from '@perses-dev/spec';\n\nexport interface ClickHouseTimeSeriesData extends TimeSeriesData {\n logs?: LogData;\n}\n\nexport interface TimeSeriesEntry {\n time: string;\n log_count: number | 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;AAQjC,WAGC"}
1
+ {"version":3,"sources":["../../../src/model/click-house-data-types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { LogData, TimeSeriesData } from '@perses-dev/spec';\n\nexport interface ClickHouseTimeSeriesData extends TimeSeriesData {\n logs?: LogData;\n}\n\nexport interface TimeSeriesEntry {\n time: string;\n [key: string]: number | string | null | undefined;\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;AAQjC,WAGC"}
@@ -1,4 +1,4 @@
1
- import { LogQueryPlugin } from '@perses-dev/plugin-system';
2
- import { ClickHouseLogQuerySpec } from './click-house-log-query-types';
1
+ import type { LogQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { ClickHouseLogQuerySpec } from './click-house-log-query-types';
3
3
  export declare const ClickHouseLogQuery: LogQueryPlugin<ClickHouseLogQuerySpec>;
4
4
  //# sourceMappingURL=ClickHouseLogQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClickHouseLogQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,sBAAsB,CAarE,CAAC"}
1
+ {"version":3,"file":"ClickHouseLogQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAI5E,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,sBAAsB,CAarE,CAAC"}
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { parseVariables } from '@perses-dev/plugin-system';
14
- import { getClickHouseLogData } from './get-click-house-log-data';
15
- import { ClickHouseLogQueryEditor } from './ClickHouseLogQueryEditor';
13
+ import { parseVariables } from "@perses-dev/plugin-system";
14
+ import { ClickHouseLogQueryEditor } from "./ClickHouseLogQueryEditor.js";
15
+ import { getClickHouseLogData } from "./get-click-house-log-data.js";
16
16
  export const ClickHouseLogQuery = {
17
17
  getLogData: getClickHouseLogData,
18
18
  OptionsEditorComponent: ClickHouseLogQueryEditor,
@@ -22,9 +22,7 @@ export const ClickHouseLogQuery = {
22
22
  dependsOn: (spec)=>{
23
23
  const queryVariables = parseVariables(spec.query);
24
24
  const allVariables = [
25
- ...new Set([
26
- ...queryVariables
27
- ])
25
+ ...new Set(queryVariables)
28
26
  ];
29
27
  return {
30
28
  variables: allVariables
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQuery.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, LogQueryPlugin } from '@perses-dev/plugin-system';\nimport { getClickHouseLogData } from './get-click-house-log-data';\nimport { ClickHouseLogQueryEditor } from './ClickHouseLogQueryEditor';\nimport { ClickHouseLogQuerySpec } from './click-house-log-query-types';\n\nexport const ClickHouseLogQuery: LogQueryPlugin<ClickHouseLogQuerySpec> = {\n getLogData: getClickHouseLogData,\n OptionsEditorComponent: ClickHouseLogQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set([...queryVariables])];\n return {\n variables: allVariables,\n };\n },\n // TODO: Implement proper SQL parsing for volume queries\n createVolumeQuery: () => null,\n};\n"],"names":["parseVariables","getClickHouseLogData","ClickHouseLogQueryEditor","ClickHouseLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables","createVolumeQuery"],"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,QAAwB,4BAA4B;AAC3E,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,wBAAwB,QAAQ,6BAA6B;AAGtE,OAAO,MAAMC,qBAA6D;IACxEC,YAAYH;IACZI,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAI;mBAAIF;aAAe;SAAE;QACtD,OAAO;YACLG,WAAWF;QACb;IACF;IACA,wDAAwD;IACxDG,mBAAmB,IAAM;AAC3B,EAAE"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { LogQueryPlugin } from '@perses-dev/plugin-system';\nimport { parseVariables } from '@perses-dev/plugin-system';\n\nimport type { ClickHouseLogQuerySpec } from './click-house-log-query-types';\nimport { ClickHouseLogQueryEditor } from './ClickHouseLogQueryEditor';\nimport { getClickHouseLogData } from './get-click-house-log-data';\n\nexport const ClickHouseLogQuery: LogQueryPlugin<ClickHouseLogQuerySpec> = {\n getLogData: getClickHouseLogData,\n OptionsEditorComponent: ClickHouseLogQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set(queryVariables)];\n return {\n variables: allVariables,\n };\n },\n // TODO: Implement proper SQL parsing for volume queries\n createVolumeQuery: () => null,\n};\n"],"names":["parseVariables","ClickHouseLogQueryEditor","getClickHouseLogData","ClickHouseLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables","createVolumeQuery"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,cAAc,QAAQ,4BAA4B;AAG3D,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SAASC,oBAAoB,QAAQ,gCAA6B;AAElE,OAAO,MAAMC,qBAA6D;IACxEC,YAAYF;IACZG,wBAAwBJ;IACxBK,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBV,eAAeS,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;IACA,wDAAwD;IACxDG,mBAAmB,IAAM;AAC3B,EAAE"}
@@ -1,6 +1,6 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { ClickHouseLogQuerySpec } from './click-house-log-query-types';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { ClickHouseLogQuerySpec } from './click-house-log-query-types';
4
4
  type ClickHouseQueryEditorProps = OptionsEditorProps<ClickHouseLogQuerySpec>;
5
5
  export declare function ClickHouseLogQueryEditor(props: ClickHouseQueryEditorProps): ReactElement;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ClickHouseLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAIL,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,KAAK,0BAA0B,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AAE7E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,0BAA0B,GAAG,YAAY,CAsExF"}
1
+ {"version":3,"file":"ClickHouseLogQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,KAAK,0BAA0B,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AAE7E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,0BAA0B,GAAG,YAAY,CAsExF"}
@@ -11,15 +11,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';
15
- import { useCallback } from 'react';
16
- import { produce } from 'immer';
17
- import { Stack } from '@mui/material';
18
- import { createModEnterHandler } from '@perses-dev/dashboards';
19
- import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
20
- import { ClickQLEditor } from '../../components';
21
- import { queryExample } from '../../components/constants';
22
- import { useQueryState } from '../query-editor-model';
14
+ import { Stack } from "@mui/material";
15
+ import { createModEnterHandler } from "@perses-dev/dashboards";
16
+ import { DatasourceSelect, isVariableDatasource } from "@perses-dev/plugin-system";
17
+ import { produce } from "immer";
18
+ import { useCallback } from "react";
19
+ import { ClickQLEditor } from "../../components/index.js";
20
+ import { queryExample } from "../../components/constants.js";
21
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
22
+ import { useQueryState } from "../query-editor-model.js";
23
23
  export function ClickHouseLogQueryEditor(props) {
24
24
  const { onChange, value } = props;
25
25
  const { datasource } = value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQueryEditor.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 { ClickHouseLogQuerySpec } from './click-house-log-query-types';\n\ntype ClickHouseQueryEditorProps = OptionsEditorProps<ClickHouseLogQuerySpec>;\n\nexport function ClickHouseLogQueryEditor(props: ClickHouseQueryEditorProps): 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","ClickHouseLogQueryEditor","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,yBAAyBC,KAAiC;IACxE,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
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQueryEditor.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 { Stack } from '@mui/material';\nimport { createModEnterHandler } from '@perses-dev/dashboards';\nimport type { DatasourceSelectProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\n\nimport { ClickQLEditor } from '../../components';\nimport { queryExample } from '../../components/constants';\nimport { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';\nimport { useQueryState } from '../query-editor-model';\nimport type { ClickHouseLogQuerySpec } from './click-house-log-query-types';\n\ntype ClickHouseQueryEditorProps = OptionsEditorProps<ClickHouseLogQuerySpec>;\n\nexport function ClickHouseLogQueryEditor(props: ClickHouseQueryEditorProps): 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":["Stack","createModEnterHandler","DatasourceSelect","isVariableDatasource","produce","useCallback","ClickQLEditor","queryExample","DATASOURCE_KIND","DEFAULT_DATASOURCE","useQueryState","ClickHouseLogQueryEditor","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,SAASA,KAAK,QAAQ,gBAAgB;AACtC,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,SAASC,gBAAgB,EAAEC,oBAAoB,QAAQ,4BAA4B;AACnF,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,WAAW,QAAQ,QAAQ;AAEpC,SAASC,aAAa,QAAQ,4BAAmB;AACjD,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,kBAAe;AACnE,SAASC,aAAa,QAAQ,2BAAwB;AAKtD,OAAO,SAASC,yBAAyBC,KAAiC;IACxE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcN;IACzC,MAAM,EAAEQ,KAAK,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGT,cAAcE;IAEpE,MAAMQ,yBAA4D,CAACC;QACjE,IAAI,CAAClB,qBAAqBkB,2BAA2BA,uBAAuBC,IAAI,KAAKd,iBAAiB;YACpGK,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,8BAA8BrB,YAClC,CAACsB;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,MAACpC;QAAMqC,SAAS;;0BACd,KAACnC;gBACCoC,sBAAsB9B;gBACtBM,OAAOE;gBACPH,UAAUO;gBACVmB,OAAM;gBACNC,OAAO;;0BAET,KAAClC;gBACCQ,OAAOG;gBACPJ,UAAUa;gBACVe,QAAQtB;gBACRuB,WAAWzC,sBAAsB,IAAMwB,mBAAmBR;gBAC1D0B,aAAY;;0BAGd,MAACC;;kCACC,KAACC;wBAAQC,OAAO;4BAAEC,QAAQ;4BAAWlB,UAAU;4BAAQC,OAAO;4BAAQkB,cAAc;wBAAM;kCAAG;;kCAG7F,KAACC;wBAAIH,OAAOlB;kCAAgBrB;;;;;;AAIpC"}
@@ -1,4 +1,4 @@
1
- import { DatasourceSelector } from '@perses-dev/spec';
1
+ import type { DatasourceSelector } from '@perses-dev/spec';
2
2
  export interface ClickHouseLogQuerySpec {
3
3
  query: string;
4
4
  datasource?: DatasourceSelector;
@@ -1 +1 @@
1
- {"version":3,"file":"click-house-log-query-types.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/click-house-log-query-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC"}
1
+ {"version":3,"file":"click-house-log-query-types.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/click-house-log-query-types.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC"}
@@ -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/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
+ {"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 type { 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,4 +1,4 @@
1
- import { LogQueryPlugin } from '@perses-dev/plugin-system';
2
- import { ClickHouseLogQuerySpec } from './click-house-log-query-types';
1
+ import type { LogQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { ClickHouseLogQuerySpec } from './click-house-log-query-types';
3
3
  export declare const getClickHouseLogData: LogQueryPlugin<ClickHouseLogQuerySpec>['getLogData'];
4
4
  //# sourceMappingURL=get-click-house-log-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-click-house-log-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAoB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAoDvE,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC,YAAY,CA6BrF,CAAC"}
1
+ {"version":3,"file":"get-click-house-log-data.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOhE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAoD5E,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC,YAAY,CAgCrF,CAAC"}
@@ -10,8 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { replaceVariables } from '@perses-dev/plugin-system';
14
- import { DEFAULT_DATASOURCE } from '../constants';
13
+ import { replaceVariables } from "@perses-dev/plugin-system";
14
+ import { formatClickHouseDateTime, replaceTimeRangePlaceholders } from "../../model/click-house-client.js";
15
+ import { DEFAULT_DATASOURCE } from "../constants.js";
15
16
  function flattenObject(obj, parentKey = '', result = {}) {
16
17
  for (const [key, value] of Object.entries(obj)){
17
18
  const newKey = parentKey ? `${parentKey}.${key}` : key;
@@ -30,7 +31,7 @@ function convertStreamsToLogs(streams) {
30
31
  flattened['Timestamp'] = flattened['log_time'];
31
32
  }
32
33
  const sortedEntry = {};
33
- Object.keys(flattened).sort((a, b)=>a.localeCompare(b)).forEach((key)=>{
34
+ Object.keys(flattened).toSorted((a, b)=>a.localeCompare(b)).forEach((key)=>{
34
35
  sortedEntry[key] = flattened[key];
35
36
  });
36
37
  const line = Object.entries(sortedEntry).filter(([key])=>key !== 'Timestamp').map(([key, value])=>`<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`).join(' ');
@@ -61,10 +62,13 @@ export const getClickHouseLogData = async (spec, context)=>{
61
62
  const query = replaceVariables(spec.query, context.variableState);
62
63
  const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? DEFAULT_DATASOURCE);
63
64
  const { start, end } = context.timeRange;
65
+ const startTime = formatClickHouseDateTime(start);
66
+ const endTime = formatClickHouseDateTime(end);
67
+ const executedQueryString = replaceTimeRangePlaceholders(query, startTime, endTime);
64
68
  const response = await client.query({
65
- start: start.getTime().toString(),
66
- end: end.getTime().toString(),
67
- query
69
+ start: startTime,
70
+ end: endTime,
71
+ query: executedQueryString
68
72
  });
69
73
  return {
70
74
  timeRange: {
@@ -73,7 +77,7 @@ export const getClickHouseLogData = async (spec, context)=>{
73
77
  },
74
78
  logs: convertStreamsToLogs(response.data),
75
79
  metadata: {
76
- executedQueryString: query
80
+ executedQueryString
77
81
  }
78
82
  };
79
83
  };
@@ -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, LogQueryPlugin } 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';\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,QAAwB,4BAA4B;AAG7E,SAASC,kBAAkB,QAAQ,eAAe;AAGlD,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 type { LogQueryPlugin } from '@perses-dev/plugin-system';\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport type { LogData, LogEntry } from '@perses-dev/spec';\n\nimport type { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { formatClickHouseDateTime, replaceTimeRangePlaceholders } from '../../model/click-house-client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport type { ClickHouseLogQuerySpec } from './click-house-log-query-types';\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 .toSorted((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 const startTime = formatClickHouseDateTime(start);\n const endTime = formatClickHouseDateTime(end);\n const executedQueryString = replaceTimeRangePlaceholders(query, startTime, endTime);\n\n const response: ClickHouseQueryResponse = await client.query({\n start: startTime,\n end: endTime,\n query: executedQueryString,\n });\n\n return {\n timeRange: { start, end },\n logs: convertStreamsToLogs(response.data as LogEntry[]),\n metadata: {\n executedQueryString,\n },\n };\n};\n"],"names":["replaceVariables","formatClickHouseDateTime","replaceTimeRangePlaceholders","DEFAULT_DATASOURCE","flattenObject","obj","parentKey","result","key","value","Object","entries","newKey","Array","isArray","convertStreamsToLogs","streams","map","entry","flattened","sortedEntry","keys","toSorted","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","startTime","endTime","executedQueryString","response","data","metadata"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,QAAQ,4BAA4B;AAI7D,SAASC,wBAAwB,EAAEC,4BAA4B,QAAQ,oCAAiC;AACxG,SAASC,kBAAkB,QAAQ,kBAAe;AAGlD,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,QAAQ,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IACnCE,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,QAAQtC,iBAAiBoC,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;IACxC,MAAMQ,YAAY/C,yBAAyBwC;IAC3C,MAAMQ,UAAUhD,yBAAyByC;IACzC,MAAMQ,sBAAsBhD,6BAA6BoC,OAAOU,WAAWC;IAE3E,MAAME,WAAoC,MAAMP,OAAON,KAAK,CAAC;QAC3DG,OAAOO;QACPN,KAAKO;QACLX,OAAOY;IACT;IAEA,OAAO;QACLV,WAAW;YAAEC;YAAOC;QAAI;QACxBH,MAAMxB,qBAAqBoC,SAASC,IAAI;QACxCC,UAAU;YACRH;QACF;IACF;AACF,EAAE"}
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './ClickHouseLogQuery';
14
- export * from './ClickHouseLogQueryEditor';
15
- export * from './get-click-house-log-data';
16
- export * from './click-house-log-query-types';
13
+ export * from "./ClickHouseLogQuery.js";
14
+ export * from "./ClickHouseLogQueryEditor.js";
15
+ export * from "./get-click-house-log-data.js";
16
+ export * from "./click-house-log-query-types.js";
17
17
 
18
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-log-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ClickHouseLogQuery';\nexport * from './ClickHouseLogQueryEditor';\nexport * from './get-click-house-log-data';\nexport * from './click-house-log-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,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,gCAAgC"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-log-query/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ClickHouseLogQuery';\nexport * from './ClickHouseLogQueryEditor';\nexport * from './get-click-house-log-data';\nexport * from './click-house-log-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,0BAAuB;AACrC,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,mCAAgC"}
@@ -1,4 +1,4 @@
1
- import { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
- import { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';
1
+ import type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';
2
+ import type { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';
3
3
  export declare const ClickHouseTimeSeriesQuery: TimeSeriesQueryPlugin<ClickHouseTimeSeriesQuerySpec>;
4
4
  //# sourceMappingURL=ClickHouseQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClickHouseQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAkB,MAAM,2BAA2B,CAAC;AAGlF,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,CAAC,6BAA6B,CAW1F,CAAC"}
1
+ {"version":3,"file":"ClickHouseQuery.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQuery.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAI/E,eAAO,MAAM,yBAAyB,EAAE,qBAAqB,CAAC,6BAA6B,CAW1F,CAAC"}
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { parseVariables } from '@perses-dev/plugin-system';
14
- import { getTimeSeriesData } from './get-click-house-data';
15
- import { ClickHouseTimeSeriesQueryEditor } from './ClickHouseQueryEditor';
13
+ import { parseVariables } from "@perses-dev/plugin-system";
14
+ import { ClickHouseTimeSeriesQueryEditor } from "./ClickHouseQueryEditor.js";
15
+ import { getTimeSeriesData } from "./get-click-house-data.js";
16
16
  export const ClickHouseTimeSeriesQuery = {
17
17
  getTimeSeriesData,
18
18
  OptionsEditorComponent: ClickHouseTimeSeriesQueryEditor,
@@ -22,9 +22,7 @@ export const ClickHouseTimeSeriesQuery = {
22
22
  dependsOn: (spec)=>{
23
23
  const queryVariables = parseVariables(spec.query);
24
24
  const allVariables = [
25
- ...new Set([
26
- ...queryVariables
27
- ])
25
+ ...new Set(queryVariables)
28
26
  ];
29
27
  return {
30
28
  variables: allVariables
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeriesQueryPlugin, parseVariables } from '@perses-dev/plugin-system';\nimport { getTimeSeriesData } from './get-click-house-data';\nimport { ClickHouseTimeSeriesQueryEditor } from './ClickHouseQueryEditor';\nimport { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';\n\nexport const ClickHouseTimeSeriesQuery: TimeSeriesQueryPlugin<ClickHouseTimeSeriesQuerySpec> = {\n getTimeSeriesData,\n OptionsEditorComponent: ClickHouseTimeSeriesQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set([...queryVariables])];\n return {\n variables: allVariables,\n };\n },\n};\n"],"names":["parseVariables","getTimeSeriesData","ClickHouseTimeSeriesQueryEditor","ClickHouseTimeSeriesQuery","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAgCA,cAAc,QAAQ,4BAA4B;AAClF,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,+BAA+B,QAAQ,0BAA0B;AAG1E,OAAO,MAAMC,4BAAkF;IAC7FF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,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"}
1
+ {"version":3,"sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQuery.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TimeSeriesQueryPlugin } from '@perses-dev/plugin-system';\nimport { parseVariables } from '@perses-dev/plugin-system';\n\nimport type { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';\nimport { ClickHouseTimeSeriesQueryEditor } from './ClickHouseQueryEditor';\nimport { getTimeSeriesData } from './get-click-house-data';\n\nexport const ClickHouseTimeSeriesQuery: TimeSeriesQueryPlugin<ClickHouseTimeSeriesQuerySpec> = {\n getTimeSeriesData,\n OptionsEditorComponent: ClickHouseTimeSeriesQueryEditor,\n createInitialOptions: () => ({ query: '' }),\n dependsOn: (spec) => {\n const queryVariables = parseVariables(spec.query);\n const allVariables = [...new Set(queryVariables)];\n return {\n variables: allVariables,\n };\n },\n};\n"],"names":["parseVariables","ClickHouseTimeSeriesQueryEditor","getTimeSeriesData","ClickHouseTimeSeriesQuery","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,cAAc,QAAQ,4BAA4B;AAG3D,SAASC,+BAA+B,QAAQ,6BAA0B;AAC1E,SAASC,iBAAiB,QAAQ,4BAAyB;AAE3D,OAAO,MAAMC,4BAAkF;IAC7FD;IACAE,wBAAwBH;IACxBI,sBAAsB,IAAO,CAAA;YAAEC,OAAO;QAAG,CAAA;IACzCC,WAAW,CAACC;QACV,MAAMC,iBAAiBT,eAAeQ,KAAKF,KAAK;QAChD,MAAMI,eAAe;eAAI,IAAIC,IAAIF;SAAgB;QACjD,OAAO;YACLG,WAAWF;QACb;IACF;AACF,EAAE"}
@@ -1,6 +1,6 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { ClickHouseTimeSeriesQuerySpec } from './click-house-query-types';
4
4
  type ClickHouseTimeSeriesQueryEditorProps = OptionsEditorProps<ClickHouseTimeSeriesQuerySpec>;
5
5
  export declare function ClickHouseTimeSeriesQueryEditor(props: ClickHouseTimeSeriesQueryEditorProps): ReactElement;
6
6
  export {};
@@ -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;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"}
1
+ {"version":3,"file":"ClickHouseQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-time-series-query/ClickHouseQueryEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE/E,KAAK,oCAAoC,GAAG,kBAAkB,CAAC,6BAA6B,CAAC,CAAC;AAE9F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,oCAAoC,GAAG,YAAY,CAsEzG"}
@@ -11,15 +11,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';
15
- import { useCallback } from 'react';
16
- import { produce } from 'immer';
17
- import { Stack } from '@mui/material';
18
- import { createModEnterHandler } from '@perses-dev/dashboards';
19
- import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from '../constants';
20
- import { ClickQLEditor } from '../../components';
21
- import { queryExample } from '../../components/constants';
22
- import { useQueryState } from '../query-editor-model';
14
+ import { Stack } from "@mui/material";
15
+ import { createModEnterHandler } from "@perses-dev/dashboards";
16
+ import { DatasourceSelect, isVariableDatasource } from "@perses-dev/plugin-system";
17
+ import { produce } from "immer";
18
+ import { useCallback } from "react";
19
+ import { ClickQLEditor } from "../../components/index.js";
20
+ import { queryExample } from "../../components/constants.js";
21
+ import { DATASOURCE_KIND, DEFAULT_DATASOURCE } from "../constants.js";
22
+ import { useQueryState } from "../query-editor-model.js";
23
23
  export function ClickHouseTimeSeriesQueryEditor(props) {
24
24
  const { onChange, value } = props;
25
25
  const { datasource } = value;