@perses-dev/greptimedb-plugin 0.1.0 → 0.2.0-beta.2

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 (230) hide show
  1. package/__mf/js/{GreptimeDB.d666b53a.js → GreptimeDB.f1e3a072.js} +4 -4
  2. package/__mf/js/async/121.caec175a.js +2 -0
  3. package/__mf/js/async/181.d4d87a1f.js +2 -0
  4. package/__mf/js/async/186.c1dea752.js +102 -0
  5. package/__mf/js/async/192.b9279059.js +1 -0
  6. package/__mf/js/async/2.dbc0a9c4.js +1 -0
  7. package/__mf/js/async/235.7a774edc.js +1 -0
  8. package/__mf/js/async/274.d5a294d9.js +2 -0
  9. package/__mf/js/async/356.21b667a3.js +1 -0
  10. package/__mf/js/async/392.201e515e.js +2 -0
  11. package/__mf/js/async/43.ebbb8652.js +2 -0
  12. package/__mf/js/async/440.f6c55d74.js +2 -0
  13. package/__mf/js/async/45.04388bc3.js +1 -0
  14. package/__mf/js/async/470.f896cf06.js +2 -0
  15. package/__mf/js/async/496.91780bef.js +1 -0
  16. package/__mf/js/async/529.6c76a9cd.js +43 -0
  17. package/__mf/js/async/{1589.a4d4fad9.js.LICENSE.txt → 529.6c76a9cd.js.LICENSE.txt} +41 -1
  18. package/__mf/js/async/562.15460f81.js +2 -0
  19. package/__mf/js/async/587.445bbdb5.js +1 -0
  20. package/__mf/js/async/588.2c301420.js +1 -0
  21. package/__mf/js/async/616.ef1089bf.js +1 -0
  22. package/__mf/js/async/628.6ea4a812.js +3 -0
  23. package/__mf/js/async/71.9f52cdd7.js +1 -0
  24. package/__mf/js/async/77.51ac6fa8.js +1 -0
  25. package/__mf/js/async/862.d29af04f.js +2 -0
  26. package/__mf/js/async/873.d5028ea7.js +1 -0
  27. package/__mf/js/async/941.6221d54d.js +2 -0
  28. package/__mf/js/async/944.89173f4a.js +10 -0
  29. package/__mf/js/async/968.6f0ebddf.js +1 -0
  30. package/__mf/js/async/978.4589faec.js +1 -0
  31. package/__mf/js/async/__federation_expose_GreptimeDBDatasource.ec9b176f.js +2 -0
  32. package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.96bef921.js +21 -0
  33. package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.f4171877.js +21 -0
  34. package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.e0ffd686.js +21 -0
  35. package/__mf/js/{main.7dfdd439.js → main.993845fa.js} +3 -3
  36. package/lib/bootstrap.js +2 -2
  37. package/lib/components/GreptimeDBQLEditor.d.ts +2 -2
  38. package/lib/components/GreptimeDBQLEditor.d.ts.map +1 -1
  39. package/lib/components/GreptimeDBQLEditor.js +3 -3
  40. package/lib/components/GreptimeDBQLEditor.js.map +1 -1
  41. package/lib/components/index.js +2 -2
  42. package/lib/components/index.js.map +1 -1
  43. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts +2 -2
  44. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.d.ts.map +1 -1
  45. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js +4 -4
  46. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasource.js.map +1 -1
  47. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts +2 -2
  48. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.d.ts.map +1 -1
  49. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +1 -1
  50. package/lib/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js.map +1 -1
  51. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts +4 -4
  52. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.d.ts.map +1 -1
  53. package/lib/datasources/greptimedb-datasource/greptimedb-datasource-types.js.map +1 -1
  54. package/lib/datasources/greptimedb-datasource/index.js +3 -3
  55. package/lib/datasources/greptimedb-datasource/index.js.map +1 -1
  56. package/lib/datasources/index.js +1 -1
  57. package/lib/datasources/index.js.map +1 -1
  58. package/lib/getPluginModule.d.ts +1 -1
  59. package/lib/getPluginModule.d.ts.map +1 -1
  60. package/lib/getPluginModule.js +3 -1
  61. package/lib/getPluginModule.js.map +1 -1
  62. package/lib/index-federation.js +1 -1
  63. package/lib/index.js +3 -3
  64. package/lib/index.js.map +1 -1
  65. package/lib/model/greptimedb-client.d.ts +3 -3
  66. package/lib/model/greptimedb-client.d.ts.map +1 -1
  67. package/lib/model/greptimedb-client.js +4 -2
  68. package/lib/model/greptimedb-client.js.map +1 -1
  69. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts +2 -2
  70. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.d.ts.map +1 -1
  71. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js +4 -6
  72. package/lib/queries/greptimedb-log-query/GreptimeDBLogQuery.js.map +1 -1
  73. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts +3 -3
  74. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.d.ts.map +1 -1
  75. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +8 -8
  76. package/lib/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js.map +1 -1
  77. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts +2 -2
  78. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.d.ts.map +1 -1
  79. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js +2 -2
  80. package/lib/queries/greptimedb-log-query/get-greptimedb-log-data.js.map +1 -1
  81. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts +1 -1
  82. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.d.ts.map +1 -1
  83. package/lib/queries/greptimedb-log-query/greptimedb-log-query-types.js.map +1 -1
  84. package/lib/queries/greptimedb-log-query/index.js +4 -4
  85. package/lib/queries/greptimedb-log-query/index.js.map +1 -1
  86. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts +2 -2
  87. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.d.ts.map +1 -1
  88. package/lib/queries/greptimedb-log-query/log-query-plugin-interface.js.map +1 -1
  89. package/lib/queries/greptimedb-query-data-model.d.ts +3 -3
  90. package/lib/queries/greptimedb-query-data-model.d.ts.map +1 -1
  91. package/lib/queries/greptimedb-query-data-model.js +4 -4
  92. package/lib/queries/greptimedb-query-data-model.js.map +1 -1
  93. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts +2 -2
  94. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.d.ts.map +1 -1
  95. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js +4 -6
  96. package/lib/queries/greptimedb-time-series-query/GreptimeDBQuery.js.map +1 -1
  97. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts +3 -3
  98. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.d.ts.map +1 -1
  99. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +8 -8
  100. package/lib/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js.map +1 -1
  101. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts +2 -2
  102. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.d.ts.map +1 -1
  103. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js +3 -5
  104. package/lib/queries/greptimedb-time-series-query/get-greptimedb-data.js.map +1 -1
  105. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts +1 -1
  106. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.d.ts.map +1 -1
  107. package/lib/queries/greptimedb-time-series-query/greptimedb-query-types.js.map +1 -1
  108. package/lib/queries/greptimedb-time-series-query/index.js +4 -4
  109. package/lib/queries/greptimedb-time-series-query/index.js.map +1 -1
  110. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts +2 -2
  111. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.d.ts.map +1 -1
  112. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +3 -3
  113. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js.map +1 -1
  114. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts +3 -3
  115. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.d.ts.map +1 -1
  116. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +7 -7
  117. package/lib/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js.map +1 -1
  118. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts +2 -2
  119. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.d.ts.map +1 -1
  120. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +6 -6
  121. package/lib/queries/greptimedb-trace-query/get-greptimedb-trace-data.js.map +1 -1
  122. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts +1 -1
  123. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.d.ts.map +1 -1
  124. package/lib/queries/greptimedb-trace-query/greptimedb-trace-query-types.js.map +1 -1
  125. package/lib/queries/greptimedb-trace-query/index.js +4 -4
  126. package/lib/queries/greptimedb-trace-query/index.js.map +1 -1
  127. package/lib/queries/index.js +3 -3
  128. package/lib/queries/index.js.map +1 -1
  129. package/lib/queries/query-editor-model.js +2 -2
  130. package/lib/queries/query-editor-model.js.map +1 -1
  131. package/lib/setup-tests.d.ts +1 -1
  132. package/lib/setup-tests.d.ts.map +1 -1
  133. package/lib/setup-tests.js +2 -2
  134. package/lib/setup-tests.js.map +1 -1
  135. package/mf-manifest.json +68 -100
  136. package/mf-stats.json +68 -104
  137. package/package.json +20 -12
  138. package/__mf/js/async/1589.a4d4fad9.js +0 -2
  139. package/__mf/js/async/1616.d071703e.js +0 -1
  140. package/__mf/js/async/2043.e37a8242.js +0 -2
  141. package/__mf/js/async/2386.84002e8c.js +0 -2
  142. package/__mf/js/async/3181.9e8e9ef5.js +0 -2
  143. package/__mf/js/async/392.614cab68.js +0 -2
  144. package/__mf/js/async/3944.f35af5a7.js +0 -10
  145. package/__mf/js/async/3981.66746f5c.js +0 -3
  146. package/__mf/js/async/4121.f8820bd7.js +0 -2
  147. package/__mf/js/async/4233.a3ff3ed2.js +0 -7
  148. package/__mf/js/async/4233.a3ff3ed2.js.LICENSE.txt +0 -39
  149. package/__mf/js/async/4475.52c68e1f.js +0 -101
  150. package/__mf/js/async/5002.ff5efed5.js +0 -1
  151. package/__mf/js/async/5071.72c3afda.js +0 -1
  152. package/__mf/js/async/5440.f8cb71c0.js +0 -2
  153. package/__mf/js/async/5481.0c2e941f.js +0 -2
  154. package/__mf/js/async/5562.fc9fccc9.js +0 -2
  155. package/__mf/js/async/5587.82a12128.js +0 -1
  156. package/__mf/js/async/6045.2b2dd0f6.js +0 -1
  157. package/__mf/js/async/6274.b682460a.js +0 -2
  158. package/__mf/js/async/629.e085c447.js +0 -1
  159. package/__mf/js/async/7177.746de250.js +0 -1
  160. package/__mf/js/async/7192.8effb0f3.js +0 -1
  161. package/__mf/js/async/7968.d3024d8d.js +0 -1
  162. package/__mf/js/async/7978.f72fcb59.js +0 -1
  163. package/__mf/js/async/7984.802dfa3c.js +0 -22
  164. package/__mf/js/async/7984.802dfa3c.js.LICENSE.txt +0 -19
  165. package/__mf/js/async/8356.42f66891.js +0 -1
  166. package/__mf/js/async/8470.8d2d3f35.js +0 -2
  167. package/__mf/js/async/873.9041549c.js +0 -1
  168. package/__mf/js/async/9235.8d75321e.js +0 -1
  169. package/__mf/js/async/941.6703c1a7.js +0 -2
  170. package/__mf/js/async/9558.97ad4633.js +0 -1
  171. package/__mf/js/async/9588.925f1ab4.js +0 -1
  172. package/__mf/js/async/9877.a7b7fb44.js +0 -38
  173. package/__mf/js/async/__federation_expose_GreptimeDBDatasource.7d12e7b8.js +0 -2
  174. package/__mf/js/async/__federation_expose_GreptimeDBLogQuery.f7fa9b26.js +0 -21
  175. package/__mf/js/async/__federation_expose_GreptimeDBTimeSeriesQuery.867c743e.js +0 -21
  176. package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.a1f7328d.js +0 -21
  177. package/__mf/js/async/__federation_expose_GreptimeDBTraceQuery.a1f7328d.js.LICENSE.txt +0 -9
  178. package/lib/cjs/bootstrap.js +0 -26
  179. package/lib/cjs/components/GreptimeDBQLEditor.js +0 -72
  180. package/lib/cjs/components/constants.js +0 -42
  181. package/lib/cjs/components/index.js +0 -31
  182. package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasource.js +0 -53
  183. package/lib/cjs/datasources/greptimedb-datasource/GreptimeDBDatasourceEditor.js +0 -51
  184. package/lib/cjs/datasources/greptimedb-datasource/greptimedb-datasource-types.js +0 -16
  185. package/lib/cjs/datasources/greptimedb-datasource/index.js +0 -32
  186. package/lib/cjs/datasources/index.js +0 -30
  187. package/lib/cjs/env.d.js +0 -14
  188. package/lib/cjs/getPluginModule.js +0 -39
  189. package/lib/cjs/index-federation.js +0 -55
  190. package/lib/cjs/index.js +0 -38
  191. package/lib/cjs/model/greptimedb-client.js +0 -76
  192. package/lib/cjs/model/greptimedb-data-types.js +0 -16
  193. package/lib/cjs/queries/constants.js +0 -34
  194. package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQuery.js +0 -43
  195. package/lib/cjs/queries/greptimedb-log-query/GreptimeDBLogQueryEditor.js +0 -108
  196. package/lib/cjs/queries/greptimedb-log-query/get-greptimedb-log-data.js +0 -103
  197. package/lib/cjs/queries/greptimedb-log-query/greptimedb-log-query-types.js +0 -16
  198. package/lib/cjs/queries/greptimedb-log-query/index.js +0 -33
  199. package/lib/cjs/queries/greptimedb-log-query/log-query-plugin-interface.js +0 -16
  200. package/lib/cjs/queries/greptimedb-query-data-model.js +0 -152
  201. package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQuery.js +0 -43
  202. package/lib/cjs/queries/greptimedb-time-series-query/GreptimeDBQueryEditor.js +0 -107
  203. package/lib/cjs/queries/greptimedb-time-series-query/get-greptimedb-data.js +0 -184
  204. package/lib/cjs/queries/greptimedb-time-series-query/greptimedb-query-types.js +0 -16
  205. package/lib/cjs/queries/greptimedb-time-series-query/index.js +0 -33
  206. package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQuery.js +0 -40
  207. package/lib/cjs/queries/greptimedb-trace-query/GreptimeDBTraceQueryEditor.js +0 -79
  208. package/lib/cjs/queries/greptimedb-trace-query/get-greptimedb-trace-data.js +0 -518
  209. package/lib/cjs/queries/greptimedb-trace-query/greptimedb-trace-query-types.js +0 -16
  210. package/lib/cjs/queries/greptimedb-trace-query/index.js +0 -33
  211. package/lib/cjs/queries/greptimedb-trace-query/trace-query-sql.js +0 -25
  212. package/lib/cjs/queries/index.js +0 -32
  213. package/lib/cjs/queries/query-editor-model.js +0 -47
  214. package/lib/cjs/setup-tests.js +0 -19
  215. /package/__mf/css/async/{4233.85c2cbf6.css → 529.85c2cbf6.css} +0 -0
  216. /package/__mf/js/async/{4121.f8820bd7.js.LICENSE.txt → 121.caec175a.js.LICENSE.txt} +0 -0
  217. /package/__mf/js/async/{2386.84002e8c.js.LICENSE.txt → 181.d4d87a1f.js.LICENSE.txt} +0 -0
  218. /package/__mf/js/async/{6274.b682460a.js.LICENSE.txt → 274.d5a294d9.js.LICENSE.txt} +0 -0
  219. /package/__mf/js/async/{392.614cab68.js.LICENSE.txt → 392.201e515e.js.LICENSE.txt} +0 -0
  220. /package/__mf/js/async/{2043.e37a8242.js.LICENSE.txt → 43.ebbb8652.js.LICENSE.txt} +0 -0
  221. /package/__mf/js/async/{5440.f8cb71c0.js.LICENSE.txt → 440.f6c55d74.js.LICENSE.txt} +0 -0
  222. /package/__mf/js/async/{8470.8d2d3f35.js.LICENSE.txt → 470.f896cf06.js.LICENSE.txt} +0 -0
  223. /package/__mf/js/async/{3181.9e8e9ef5.js.LICENSE.txt → 562.15460f81.js.LICENSE.txt} +0 -0
  224. /package/__mf/js/async/{5481.0c2e941f.js.LICENSE.txt → 862.d29af04f.js.LICENSE.txt} +0 -0
  225. /package/__mf/js/async/{5562.fc9fccc9.js.LICENSE.txt → 941.6221d54d.js.LICENSE.txt} +0 -0
  226. /package/__mf/js/async/{3944.f35af5a7.js.LICENSE.txt → 944.89173f4a.js.LICENSE.txt} +0 -0
  227. /package/__mf/js/async/{941.6703c1a7.js.LICENSE.txt → __federation_expose_GreptimeDBDatasource.ec9b176f.js.LICENSE.txt} +0 -0
  228. /package/__mf/js/async/{__federation_expose_GreptimeDBDatasource.7d12e7b8.js.LICENSE.txt → __federation_expose_GreptimeDBLogQuery.96bef921.js.LICENSE.txt} +0 -0
  229. /package/__mf/js/async/{__federation_expose_GreptimeDBLogQuery.f7fa9b26.js.LICENSE.txt → __federation_expose_GreptimeDBTimeSeriesQuery.f4171877.js.LICENSE.txt} +0 -0
  230. /package/__mf/js/async/{__federation_expose_GreptimeDBTimeSeriesQuery.867c743e.js.LICENSE.txt → __federation_expose_GreptimeDBTraceQuery.e0ffd686.js.LICENSE.txt} +0 -0
@@ -1,51 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "GreptimeDBDatasourceEditor", {
18
- enumerable: true,
19
- get: function() {
20
- return GreptimeDBDatasourceEditor;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _pluginsystem = require("@perses-dev/plugin-system");
25
- function GreptimeDBDatasourceEditor(props) {
26
- const { value, onChange, isReadonly } = props;
27
- const initialSpecDirect = {
28
- directUrl: ''
29
- };
30
- const initialSpecProxy = {
31
- proxy: {
32
- kind: 'HTTPProxy',
33
- spec: {
34
- allowedEndpoints: [
35
- {
36
- endpointPattern: '/v1/sql',
37
- method: 'POST'
38
- }
39
- ],
40
- url: ''
41
- }
42
- }
43
- };
44
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
45
- value: value,
46
- onChange: onChange,
47
- isReadonly: isReadonly,
48
- initialSpecDirect: initialSpecDirect,
49
- initialSpecProxy: initialSpecProxy
50
- });
51
- }
@@ -1,16 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
@@ -1,32 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./GreptimeDBDatasource"), exports);
18
- _export_star(require("./GreptimeDBDatasourceEditor"), exports);
19
- _export_star(require("./greptimedb-datasource-types"), exports);
20
- function _export_star(from, to) {
21
- Object.keys(from).forEach(function(k) {
22
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
23
- Object.defineProperty(to, k, {
24
- enumerable: true,
25
- get: function() {
26
- return from[k];
27
- }
28
- });
29
- }
30
- });
31
- return from;
32
- }
@@ -1,30 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./greptimedb-datasource"), exports);
18
- function _export_star(from, to) {
19
- Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
- Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
27
- }
28
- });
29
- return from;
30
- }
package/lib/cjs/env.d.js DELETED
@@ -1,14 +0,0 @@
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
- /// <reference types="@rsbuild/core/types" />
14
- "use strict";
@@ -1,39 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "getPluginModule", {
18
- enumerable: true,
19
- get: function() {
20
- return getPluginModule;
21
- }
22
- });
23
- const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
24
- function _interop_require_default(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
- function getPluginModule() {
30
- const { name, version, perses } = _packagejson.default;
31
- return {
32
- kind: 'PluginModule',
33
- metadata: {
34
- name,
35
- version
36
- },
37
- spec: perses
38
- };
39
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- function _getRequireWildcardCache(nodeInterop) {
3
- if (typeof WeakMap !== "function") return null;
4
- var cacheBabelInterop = new WeakMap();
5
- var cacheNodeInterop = new WeakMap();
6
- return (_getRequireWildcardCache = function(nodeInterop) {
7
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
8
- })(nodeInterop);
9
- }
10
- function _interop_require_wildcard(obj, nodeInterop) {
11
- if (!nodeInterop && obj && obj.__esModule) {
12
- return obj;
13
- }
14
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
15
- return {
16
- default: obj
17
- };
18
- }
19
- var cache = _getRequireWildcardCache(nodeInterop);
20
- if (cache && cache.has(obj)) {
21
- return cache.get(obj);
22
- }
23
- var newObj = {
24
- __proto__: null
25
- };
26
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
27
- for(var key in obj){
28
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
29
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
30
- if (desc && (desc.get || desc.set)) {
31
- Object.defineProperty(newObj, key, desc);
32
- } else {
33
- newObj[key] = obj[key];
34
- }
35
- }
36
- }
37
- newObj.default = obj;
38
- if (cache) {
39
- cache.set(obj, newObj);
40
- }
41
- return newObj;
42
- }
43
- // Copyright The Perses Authors
44
- // Licensed under the Apache License, Version 2.0 (the "License");
45
- // you may not use this file except in compliance with the License.
46
- // You may obtain a copy of the License at
47
- //
48
- // http://www.apache.org/licenses/LICENSE-2.0
49
- //
50
- // Unless required by applicable law or agreed to in writing, software
51
- // distributed under the License is distributed on an "AS IS" BASIS,
52
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
- // See the License for the specific language governing permissions and
54
- // limitations under the License.
55
- Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
package/lib/cjs/index.js DELETED
@@ -1,38 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "getPluginModule", {
18
- enumerable: true,
19
- get: function() {
20
- return _getPluginModule.getPluginModule;
21
- }
22
- });
23
- const _getPluginModule = require("./getPluginModule");
24
- _export_star(require("./queries"), exports);
25
- _export_star(require("./datasources"), exports);
26
- function _export_star(from, to) {
27
- Object.keys(from).forEach(function(k) {
28
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
29
- Object.defineProperty(to, k, {
30
- enumerable: true,
31
- get: function() {
32
- return from[k];
33
- }
34
- });
35
- }
36
- });
37
- return from;
38
- }
@@ -1,76 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "greptimedbQuery", {
18
- enumerable: true,
19
- get: function() {
20
- return greptimedbQuery;
21
- }
22
- });
23
- async function readErrorResponse(response) {
24
- const contentType = response.headers?.get('content-type');
25
- if (contentType && contentType.includes('application/json')) {
26
- const errorJson = await response.json();
27
- return `GreptimeDB error: ${response.status} ${response.statusText} - ${JSON.stringify(errorJson)}`;
28
- }
29
- const errorText = await response.text();
30
- return `GreptimeDB error: ${response.status} ${response.statusText} - ${errorText}`;
31
- }
32
- async function greptimedbQuery(params, queryOptions) {
33
- const { datasourceUrl, headers } = queryOptions;
34
- const url = buildSqlUrl(datasourceUrl);
35
- if (!params.query) {
36
- throw new Error('No query provided in params');
37
- }
38
- const init = {
39
- method: 'POST',
40
- headers: {
41
- 'Content-Type': 'application/x-www-form-urlencoded',
42
- ...headers ?? {}
43
- },
44
- body: new URLSearchParams({
45
- sql: params.query
46
- }).toString()
47
- };
48
- try {
49
- const response = await fetch(url.toString(), init);
50
- if (!response.ok) {
51
- const errorMessage = await readErrorResponse(response);
52
- console.error('GreptimeDB error response:', errorMessage);
53
- return {
54
- status: 'error',
55
- data: {
56
- output: []
57
- },
58
- error: errorMessage
59
- };
60
- }
61
- const body = await response.json();
62
- return {
63
- status: body?.status ?? 'success',
64
- data: body
65
- };
66
- } catch (e) {
67
- throw new Error(`GreptimeDB query failed: ${e}`);
68
- }
69
- }
70
- function buildSqlUrl(datasourceUrl) {
71
- const base = datasourceUrl.endsWith('/') ? `${datasourceUrl}v1/sql` : `${datasourceUrl}/v1/sql`;
72
- if (base.startsWith('http://') || base.startsWith('https://')) {
73
- return new URL(base);
74
- }
75
- return new URL(base, window.location.origin);
76
- }
@@ -1,16 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
@@ -1,34 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: Object.getOwnPropertyDescriptor(all, name).get
21
- });
22
- }
23
- _export(exports, {
24
- get DATASOURCE_KIND () {
25
- return DATASOURCE_KIND;
26
- },
27
- get DEFAULT_DATASOURCE () {
28
- return DEFAULT_DATASOURCE;
29
- }
30
- });
31
- const DATASOURCE_KIND = 'GreptimeDBDatasource';
32
- const DEFAULT_DATASOURCE = {
33
- kind: DATASOURCE_KIND
34
- };
@@ -1,43 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "GreptimeDBLogQuery", {
18
- enumerable: true,
19
- get: function() {
20
- return GreptimeDBLogQuery;
21
- }
22
- });
23
- const _pluginsystem = require("@perses-dev/plugin-system");
24
- const _getgreptimedblogdata = require("./get-greptimedb-log-data");
25
- const _GreptimeDBLogQueryEditor = require("./GreptimeDBLogQueryEditor");
26
- const GreptimeDBLogQuery = {
27
- getLogData: _getgreptimedblogdata.getGreptimeDBLogData,
28
- OptionsEditorComponent: _GreptimeDBLogQueryEditor.GreptimeDBLogQueryEditor,
29
- createInitialOptions: ()=>({
30
- query: ''
31
- }),
32
- dependsOn: (spec)=>{
33
- const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
34
- const allVariables = [
35
- ...new Set([
36
- ...queryVariables
37
- ])
38
- ];
39
- return {
40
- variables: allVariables
41
- };
42
- }
43
- };
@@ -1,108 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "GreptimeDBLogQueryEditor", {
18
- enumerable: true,
19
- get: function() {
20
- return GreptimeDBLogQueryEditor;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _pluginsystem = require("@perses-dev/plugin-system");
25
- const _react = require("react");
26
- const _immer = require("immer");
27
- const _material = require("@mui/material");
28
- const _constants = require("../constants");
29
- const _components = require("../../components");
30
- const _constants1 = require("../../components/constants");
31
- const _queryeditormodel = require("../query-editor-model");
32
- function GreptimeDBLogQueryEditor(props) {
33
- const theme = (0, _material.useTheme)();
34
- const { onChange, value } = props;
35
- const { datasource } = value;
36
- const selectedDatasource = datasource ?? _constants.DEFAULT_DATASOURCE;
37
- const { query, handleQueryChange, handleQueryBlur } = (0, _queryeditormodel.useQueryState)(props);
38
- const handleDatasourceChange = (newDatasourceSelection)=>{
39
- if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
40
- onChange((0, _immer.produce)(value, (draft)=>{
41
- draft.datasource = newDatasourceSelection;
42
- }));
43
- return;
44
- }
45
- throw new Error('Got unexpected non GreptimeDB datasource selection');
46
- };
47
- const handleQueryExecute = (queryValue)=>{
48
- onChange((0, _immer.produce)(value, (draft)=>{
49
- draft.query = queryValue;
50
- }));
51
- };
52
- const handleGreptimeDBQueryChange = (0, _react.useCallback)((e)=>{
53
- handleQueryChange(e);
54
- }, [
55
- handleQueryChange
56
- ]);
57
- const examplesStyle = {
58
- fontSize: '11px',
59
- color: theme.palette.text.secondary,
60
- backgroundColor: theme.palette.background.code,
61
- padding: '8px',
62
- borderRadius: '4px',
63
- fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
64
- whiteSpace: 'pre-wrap',
65
- lineHeight: '1.3'
66
- };
67
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
68
- spacing: 1.5,
69
- children: [
70
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
71
- datasourcePluginKind: _constants.DATASOURCE_KIND,
72
- value: selectedDatasource,
73
- onChange: handleDatasourceChange,
74
- label: "GreptimeDB Datasource",
75
- notched: true
76
- }),
77
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.GreptimeDBQLEditor, {
78
- value: query,
79
- onChange: handleGreptimeDBQueryChange,
80
- onBlur: handleQueryBlur,
81
- onKeyDown: (event)=>{
82
- if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
83
- event.preventDefault();
84
- handleQueryExecute(query);
85
- }
86
- },
87
- placeholder: "Enter GreptimeDB SQL query"
88
- }),
89
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("details", {
90
- children: [
91
- /*#__PURE__*/ (0, _jsxruntime.jsx)("summary", {
92
- style: {
93
- cursor: 'pointer',
94
- fontSize: '12px',
95
- color: theme.palette.text.secondary,
96
- marginBottom: '8px'
97
- },
98
- children: "Query Examples"
99
- }),
100
- /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
101
- style: examplesStyle,
102
- children: _constants1.queryExample
103
- })
104
- ]
105
- })
106
- ]
107
- });
108
- }
@@ -1,103 +0,0 @@
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
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "getGreptimeDBLogData", {
18
- enumerable: true,
19
- get: function() {
20
- return getGreptimeDBLogData;
21
- }
22
- });
23
- const _constants = require("../constants");
24
- const _greptimedbquerydatamodel = require("../greptimedb-query-data-model");
25
- function buildLogs(records) {
26
- const columnSchemas = records?.schema?.column_schemas ?? [];
27
- const rows = records?.rows ?? [];
28
- if (!columnSchemas.length || !rows.length) {
29
- return {
30
- entries: [],
31
- totalCount: 0
32
- };
33
- }
34
- const timeIndex = (0, _greptimedbquerydatamodel.findTimeColumnIndex)(columnSchemas);
35
- if (timeIndex === -1) {
36
- return {
37
- entries: [],
38
- totalCount: 0
39
- };
40
- }
41
- const entries = rows.map((row)=>{
42
- const tsMs = (0, _greptimedbquerydatamodel.toTimestampMs)(row?.[timeIndex], columnSchemas[timeIndex]?.data_type);
43
- if (tsMs === null) {
44
- return null;
45
- }
46
- const labels = {};
47
- const lineParts = [];
48
- columnSchemas.forEach((col, index)=>{
49
- if (index === timeIndex) {
50
- return;
51
- }
52
- const value = row?.[index];
53
- const stringValue = value === null || value === undefined ? '' : String(value);
54
- labels[col.name] = stringValue;
55
- lineParts.push(`${col.name}=${stringValue === '' ? '--' : stringValue}`);
56
- });
57
- return {
58
- timestamp: Math.floor(tsMs / 1000),
59
- labels,
60
- line: lineParts.join(' ')
61
- };
62
- }).filter((entry)=>entry !== null);
63
- return {
64
- entries,
65
- totalCount: entries.length
66
- };
67
- }
68
- const getGreptimeDBLogData = async (spec, context)=>{
69
- if (!spec.query) {
70
- return {
71
- logs: {
72
- entries: [],
73
- totalCount: 0
74
- },
75
- timeRange: {
76
- start: context.timeRange.start,
77
- end: context.timeRange.end
78
- }
79
- };
80
- }
81
- const { start, end } = context.timeRange;
82
- const query = (0, _greptimedbquerydatamodel.replaceQueryVariables)(spec.query, context.variableState, context.timeRange);
83
- const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
84
- const response = await client.query({
85
- start: start.getTime().toString(),
86
- end: end.getTime().toString(),
87
- query
88
- });
89
- if (response.status === 'error') {
90
- throw new Error(response.error ?? 'GreptimeDB query failed');
91
- }
92
- const records = (0, _greptimedbquerydatamodel.normalizeRecords)(response.data);
93
- return {
94
- timeRange: {
95
- start,
96
- end
97
- },
98
- logs: buildLogs(records),
99
- metadata: {
100
- executedQueryString: query
101
- }
102
- };
103
- };