@perses-dev/clickhouse-plugin 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/ClickHouse.dccd3adc.js +6 -0
- package/__mf/js/async/1616.d273c2a4.js +1 -0
- package/__mf/js/async/1728.c2466af2.js +1 -0
- package/__mf/js/async/1811.e34f9555.js +101 -0
- package/__mf/js/async/1825.3b06cbc6.js +1 -0
- package/__mf/js/async/1969.41d665ea.js +1 -0
- package/__mf/js/async/2043.827fc525.js +2 -0
- package/__mf/js/async/2386.9589aa86.js +2 -0
- package/__mf/js/async/3059.33197202.js +1 -0
- package/__mf/js/async/3181.b9a8c5ee.js +2 -0
- package/__mf/js/async/392.a87802dc.js +2 -0
- package/__mf/js/async/{1964.dccce52b.js → 4121.437b34db.js} +2 -2
- package/__mf/js/async/{2651.3bdd6b21.js → 5002.5959f718.js} +1 -1
- package/__mf/js/async/5071.c665fc3d.js +1 -0
- package/__mf/js/async/54.0abd57b9.js +22 -0
- package/__mf/js/async/5440.79b13afe.js +2 -0
- package/__mf/js/async/{6377.6c8c4e15.js.LICENSE.txt → 5440.79b13afe.js.LICENSE.txt} +3 -3
- package/__mf/js/async/{5214.d1943ccc.js → 5587.caa53d74.js} +1 -1
- package/__mf/js/async/6045.424732f1.js +1 -0
- package/__mf/js/async/6274.0299ceca.js +2 -0
- package/__mf/js/async/6283.18a07ff0.js +2 -0
- package/__mf/js/async/6796.c1c2e96e.js +7 -0
- package/__mf/js/async/{8488.16a69ea5.js → 7177.661c72fd.js} +1 -1
- package/__mf/js/async/7192.738bb7d0.js +1 -0
- package/__mf/js/async/7370.aa412eb8.js +2 -0
- package/__mf/js/async/7576.d8b258ff.js +2 -0
- package/__mf/js/async/7968.d7870d30.js +1 -0
- package/__mf/js/async/7978.a9ba54ff.js +1 -0
- package/__mf/js/async/8356.1990f800.js +1 -0
- package/__mf/js/async/8470.12101f38.js +2 -0
- package/__mf/js/async/8482.f99a0f22.js +1 -0
- package/__mf/js/async/873.0b522a3c.js +1 -0
- package/__mf/js/async/9010.7167d3a9.js +2 -0
- package/__mf/js/async/9071.8c641d07.js +2 -0
- package/__mf/js/async/9235.239f5888.js +1 -0
- package/__mf/js/async/9249.f40b0225.js +1 -0
- package/__mf/js/async/941.62a2fd61.js +2 -0
- package/__mf/js/async/9588.643512c3.js +1 -0
- package/__mf/js/async/9754.9efd83f1.js +10 -0
- package/__mf/js/async/9836.4cd749fe.js +1 -0
- package/__mf/js/async/9877.c85206cb.js +38 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.0bdc8df0.js +2 -0
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.1e3e609a.js +20 -0
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.e60dd445.js +20 -0
- package/__mf/js/main.eadf8672.js +6 -0
- package/lib/bootstrap.js +2 -2
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/bootstrap.js +1 -1
- package/lib/cjs/components/ClickQLEditor.js +1 -1
- package/lib/cjs/components/constants.js +1 -1
- package/lib/cjs/components/index.js +1 -1
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasource.js +2 -2
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +1 -1
- package/lib/cjs/datasources/click-house-datasource/click-house-datasource-types.js +1 -1
- package/lib/cjs/datasources/click-house-datasource/index.js +1 -1
- package/lib/cjs/datasources/index.js +1 -1
- package/lib/cjs/env.d.js +1 -1
- package/lib/cjs/getPluginModule.js +1 -1
- package/lib/cjs/index-federation.js +12 -12
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/model/click-house-client.js +1 -1
- package/lib/cjs/model/click-house-data-types.js +1 -1
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQuery.js +1 -1
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +1 -1
- package/lib/cjs/queries/click-house-log-query/click-house-log-query-types.js +1 -1
- package/lib/cjs/queries/click-house-log-query/get-click-house-log-data.js +4 -4
- package/lib/cjs/queries/click-house-log-query/index.js +1 -1
- package/lib/cjs/queries/click-house-log-query/log-query-plugin-interface.js +12 -0
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQuery.js +1 -1
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +1 -1
- package/lib/cjs/queries/click-house-time-series-query/click-house-query-types.js +1 -1
- package/lib/cjs/queries/click-house-time-series-query/get-click-house-data.js +4 -3
- package/lib/cjs/queries/click-house-time-series-query/index.js +1 -1
- package/lib/cjs/queries/constants.js +4 -4
- package/lib/cjs/queries/index.js +1 -1
- package/lib/cjs/queries/query-editor-model.js +1 -1
- package/lib/cjs/setup-tests.js +1 -1
- package/lib/components/ClickQLEditor.js +2 -2
- package/lib/components/ClickQLEditor.js.map +1 -1
- package/lib/components/constants.js +1 -1
- package/lib/components/constants.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js +2 -2
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +2 -2
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js.map +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -1
- package/lib/datasources/click-house-datasource/index.js +1 -1
- package/lib/datasources/click-house-datasource/index.js.map +1 -1
- package/lib/datasources/index.js +1 -1
- package/lib/datasources/index.js.map +1 -1
- package/lib/env.d.js +1 -1
- package/lib/env.d.js.map +1 -1
- package/lib/getPluginModule.js +1 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index-federation.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/model/click-house-client.d.ts +1 -1
- package/lib/model/click-house-client.d.ts.map +1 -1
- package/lib/model/click-house-client.js +1 -1
- package/lib/model/click-house-client.js.map +1 -1
- package/lib/model/click-house-data-types.d.ts.map +1 -1
- package/lib/model/click-house-data-types.js +1 -1
- package/lib/model/click-house-data-types.js.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +2 -2
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -1
- package/lib/queries/click-house-log-query/click-house-log-query-types.js +1 -1
- package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -1
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/get-click-house-log-data.js +4 -4
- package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -1
- package/lib/queries/click-house-log-query/index.js +1 -1
- package/lib/queries/click-house-log-query/index.js.map +1 -1
- package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js +12 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +2 -2
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.js +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -1
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/get-click-house-data.js +4 -3
- package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -1
- package/lib/queries/click-house-time-series-query/index.js +1 -1
- package/lib/queries/click-house-time-series-query/index.js.map +1 -1
- package/lib/queries/constants.js +1 -1
- package/lib/queries/constants.js.map +1 -1
- package/lib/queries/index.js +1 -1
- package/lib/queries/index.js.map +1 -1
- package/lib/queries/query-editor-model.d.ts.map +1 -1
- package/lib/queries/query-editor-model.js +1 -1
- package/lib/queries/query-editor-model.js.map +1 -1
- package/lib/setup-tests.js +1 -1
- package/lib/setup-tests.js.map +1 -1
- package/mf-manifest.json +86 -86
- package/mf-stats.json +86 -86
- package/package.json +7 -6
- package/__mf/js/ClickHouse.fef0738b.js +0 -5
- package/__mf/js/async/1360.33f7e672.js +0 -10
- package/__mf/js/async/1398.f2193c83.js +0 -2
- package/__mf/js/async/1580.5bd6ed40.js +0 -2
- package/__mf/js/async/2114.27f707a0.js +0 -1
- package/__mf/js/async/2226.1d4436dc.js +0 -1
- package/__mf/js/async/2292.248bd1ea.js +0 -2
- package/__mf/js/async/2652.fd27ec3f.js +0 -101
- package/__mf/js/async/282.76b8b044.js +0 -1
- package/__mf/js/async/3224.5735a223.js +0 -1
- package/__mf/js/async/3431.54fb88df.js +0 -1
- package/__mf/js/async/3863.70d46fa8.js +0 -2
- package/__mf/js/async/3960.e0eb27f3.js +0 -2
- package/__mf/js/async/3980.2a6bea70.js +0 -2
- package/__mf/js/async/4075.b85e5581.js +0 -1
- package/__mf/js/async/4238.a8170f41.js +0 -1
- package/__mf/js/async/4269.a389e8c6.js +0 -2
- package/__mf/js/async/4421.d9d48d4f.js +0 -1
- package/__mf/js/async/4557.aa037aea.js +0 -2
- package/__mf/js/async/4676.cae72135.js +0 -22
- package/__mf/js/async/5409.c4876520.js +0 -1
- package/__mf/js/async/58.c1431e49.js +0 -2
- package/__mf/js/async/5981.f3abf3c8.js +0 -2
- package/__mf/js/async/6134.a0f2d3c5.js +0 -38
- package/__mf/js/async/6292.4311054b.js +0 -1
- package/__mf/js/async/6333.dfeaf029.js +0 -2
- package/__mf/js/async/6377.6c8c4e15.js +0 -2
- package/__mf/js/async/6770.e50c0d08.js +0 -1
- package/__mf/js/async/694.c93f9cdf.js +0 -1
- package/__mf/js/async/7376.c01a7f82.js +0 -1
- package/__mf/js/async/738.0cdf47b4.js +0 -1
- package/__mf/js/async/7740.b3df297f.js +0 -1
- package/__mf/js/async/7797.36d938e5.js +0 -1
- package/__mf/js/async/7991.11320a4d.js +0 -7
- package/__mf/js/async/8216.44c6334e.js +0 -1
- package/__mf/js/async/9173.90ba4f20.js +0 -2
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.b909c7ef.js +0 -2
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.8e9aa83b.js +0 -20
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.b3723b8b.js +0 -20
- package/__mf/js/main.56f92cce.js +0 -5
- /package/__mf/css/async/{1580.d3010b86.css → 3061.d3010b86.css} +0 -0
- /package/__mf/css/async/{2341.d3010b86.css → 7370.d3010b86.css} +0 -0
- /package/__mf/js/async/{2292.248bd1ea.js.LICENSE.txt → 2043.827fc525.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1398.f2193c83.js.LICENSE.txt → 2386.9589aa86.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1580.5bd6ed40.js.LICENSE.txt → 3181.b9a8c5ee.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5981.f3abf3c8.js.LICENSE.txt → 392.a87802dc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1964.dccce52b.js.LICENSE.txt → 4121.437b34db.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4676.cae72135.js.LICENSE.txt → 54.0abd57b9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3960.e0eb27f3.js.LICENSE.txt → 6274.0299ceca.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3980.2a6bea70.js.LICENSE.txt → 6283.18a07ff0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7991.11320a4d.js.LICENSE.txt → 6796.c1c2e96e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3863.70d46fa8.js.LICENSE.txt → 7370.aa412eb8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{58.c1431e49.js.LICENSE.txt → 7576.d8b258ff.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9173.90ba4f20.js.LICENSE.txt → 8470.12101f38.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4557.aa037aea.js.LICENSE.txt → 9010.7167d3a9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4269.a389e8c6.js.LICENSE.txt → 9071.8c641d07.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6333.dfeaf029.js.LICENSE.txt → 941.62a2fd61.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1360.33f7e672.js.LICENSE.txt → 9754.9efd83f1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ClickHouseDatasource.b909c7ef.js.LICENSE.txt → __federation_expose_ClickHouseDatasource.0bdc8df0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ClickHouseLogQuery.8e9aa83b.js.LICENSE.txt → __federation_expose_ClickHouseLogQuery.1e3e609a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ClickHouseTimeSeriesQuery.b3723b8b.js.LICENSE.txt → __federation_expose_ClickHouseTimeSeriesQuery.e60dd445.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
4
5
|
// You may obtain a copy of the License at
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import CodeMirror from '@uiw/react-codemirror';
|
|
15
15
|
import { EditorView } from '@codemirror/view';
|
|
16
16
|
import { useTheme, InputLabel, Stack } from '@mui/material';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ClickQLEditor.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ClickQLEditor.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 CodeMirror, { ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport { EditorView } from '@codemirror/view';\nimport { useTheme, InputLabel, Stack } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport type ClickQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;\n\nexport function ClickQLEditor(props: ClickQLEditorProps): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <Stack position=\"relative\">\n <InputLabel\n sx={{\n fontWeight: 500,\n marginBottom: '4px',\n color: theme.palette.text.primary,\n }}\n >\n ClickHouse Query\n </InputLabel>\n <CodeMirror\n {...props}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n syntaxHighlighting: true,\n }}\n extensions={[\n EditorView.lineWrapping,\n EditorView.theme({\n '.cm-content': {\n paddingTop: '8px',\n paddingBottom: '8px',\n paddingRight: '40px',\n },\n }),\n ]}\n placeholder=\"Write ClickHouse Query Here...\"\n />\n </Stack>\n );\n}\n"],"names":["CodeMirror","EditorView","useTheme","InputLabel","Stack","ClickQLEditor","props","theme","isDarkMode","palette","mode","position","sx","fontWeight","marginBottom","color","text","primary","style","border","divider","basicSetup","highlightActiveLine","highlightActiveLineGutter","foldGutter","syntaxHighlighting","extensions","lineWrapping","paddingTop","paddingBottom","paddingRight","placeholder"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,gBAA0C,wBAAwB;AACzE,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAK5D,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAMC,QAAQL;IACd,MAAMM,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,qBACE,MAACN;QAAMO,UAAS;;0BACd,KAACR;gBACCS,IAAI;oBACFC,YAAY;oBACZC,cAAc;oBACdC,OAAOR,MAAME,OAAO,CAACO,IAAI,CAACC,OAAO;gBACnC;0BACD;;0BAGD,KAACjB;gBACE,GAAGM,KAAK;gBACTY,OAAO;oBAAEC,QAAQ,CAAC,UAAU,EAAEZ,MAAME,OAAO,CAACW,OAAO,EAAE;gBAAC;gBACtDb,OAAOC,aAAa,SAAS;gBAC7Ba,YAAY;oBACVC,qBAAqB;oBACrBC,2BAA2B;oBAC3BC,YAAY;oBACZC,oBAAoB;gBACtB;gBACAC,YAAY;oBACVzB,WAAW0B,YAAY;oBACvB1B,WAAWM,KAAK,CAAC;wBACf,eAAe;4BACbqB,YAAY;4BACZC,eAAe;4BACfC,cAAc;wBAChB;oBACF;iBACD;gBACDC,aAAY;;;;AAIpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/constants.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/constants.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 const queryExample = `-- Time Series Query\nSELECT \n toStartOfMinute(timestamp) as time,\n avg(cpu_usage) as avg_cpu,\n max(memory_usage) as max_memory\nFROM system_metrics \nWHERE timestamp BETWEEN '{start}' AND '{end}'\nGROUP BY time ORDER BY time\n-- Logs Query \nSELECT \n Timestamp as log_time,\n Body,\n ServiceName,\n ResourceAttributes,\n SeverityNumber,\n SeverityText\nFROM application_logs \nWHERE timestamp >= '{start}' \nORDER BY time DESC LIMIT 1000`;\n"],"names":["queryExample"],"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,OAAO,MAAMA,eAAe,CAAC;;;;;;;;;;;;;;;;;;6BAkBA,CAAC,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/components/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 './ClickQLEditor';\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,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickHouseDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ClickHouseDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AA2BtG,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,wBAAwB,EAAE,0BAA0B,CAIvG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { ClickHouseDatasourceEditor } from './ClickHouseDatasourceEditor';
|
|
14
13
|
import { query } from '../../model/click-house-client';
|
|
14
|
+
import { ClickHouseDatasourceEditor } from './ClickHouseDatasourceEditor';
|
|
15
15
|
const createClient = (spec, options)=>{
|
|
16
16
|
const { directUrl, proxy } = spec;
|
|
17
17
|
const { proxyUrl } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.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 { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { query } from '../../model/click-house-client';\nimport { ClickHouseDatasourceSpec, ClickHouseDatasourceClient } from './click-house-datasource-types';\nimport { ClickHouseDatasourceEditor } from './ClickHouseDatasourceEditor';\n\nconst createClient: DatasourcePlugin<ClickHouseDatasourceSpec, ClickHouseDatasourceClient>['createClient'] = (\n spec,\n options\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error(\n 'No URL specified for ClickHouseDatasource client. You can use directUrl in the spec to configure it.'\n );\n }\n\n const specHeaders = proxy?.spec.headers || {};\n\n return {\n options: {\n datasourceUrl,\n },\n query: (params, headers) => query(params, { datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const ClickHouseDatasource: DatasourcePlugin<ClickHouseDatasourceSpec, ClickHouseDatasourceClient> = {\n createClient,\n OptionsEditorComponent: ClickHouseDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["query","ClickHouseDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","ClickHouseDatasource","OptionsEditorComponent","createInitialOptions"],"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,KAAK,QAAQ,iCAAiC;AAEvD,SAASC,0BAA0B,QAAQ,+BAA+B;AAE1E,MAAMC,eAAuG,CAC3GC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MACR;IAEJ;IAEA,MAAMC,cAAcL,OAAOH,KAAKS,WAAW,CAAC;IAE5C,OAAO;QACLR,SAAS;YACPI;QACF;QACAR,OAAO,CAACa,QAAQD,UAAYZ,MAAMa,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;IAC7F;AACF;AAEA,OAAO,MAAMG,uBAA+F;IAC1GZ;IACAa,wBAAwBd;IACxBe,sBAAsB,IAAO,CAAA;YAAEX,WAAW;QAAG,CAAA;AAC/C,EAAE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
4
5
|
// You may obtain a copy of the License at
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
|
|
15
15
|
export function ClickHouseDatasourceEditor(props) {
|
|
16
16
|
const { value, onChange, isReadonly } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasourceEditor.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasourceEditor.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 { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { ClickHouseDatasourceSpec } from './click-house-datasource-types';\n\nexport interface ClickHouseDatasourceEditorProps {\n value: ClickHouseDatasourceSpec;\n onChange: (next: ClickHouseDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function ClickHouseDatasourceEditor(props: ClickHouseDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: ClickHouseDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: ClickHouseDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/',\n method: 'GET',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","ClickHouseDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"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,kBAAkB,QAAQ,4BAA4B;AAU/D,OAAO,SAASC,2BAA2BC,KAAsC;IAC/E,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAA8C;QAClDC,WAAW;IACb;IAEA,MAAMC,mBAA6C;QACjDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
|
|
@@ -16,7 +16,7 @@ interface ClickHouseDatasourceClientOptions {
|
|
|
16
16
|
export interface ClickHouseDatasourceResponse {
|
|
17
17
|
status: string;
|
|
18
18
|
warnings?: string[];
|
|
19
|
-
data:
|
|
19
|
+
data: unknown;
|
|
20
20
|
}
|
|
21
21
|
export interface ClickHouseDatasourceClient extends DatasourceClient {
|
|
22
22
|
options: ClickHouseDatasourceClientOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-house-datasource-types.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,UAAU,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,iCAAiC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"click-house-datasource-types.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,UAAU,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,iCAAiC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IAClE,OAAO,EAAE,iCAAiC,CAAC;IAC3C,KAAK,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-types.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-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 { HTTPProxy, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\n\nexport interface ClickHouseDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n\ninterface QueryRequestParameters extends Record<string, string> {\n query: string;\n start: string;\n end: string;\n}\n\ninterface ClickHouseDatasourceClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface ClickHouseDatasourceResponse {\n status: string;\n warnings?: string[];\n // TODO: adjust this type to match your datasource response shape\n data: unknown;\n}\n\nexport interface ClickHouseDatasourceClient extends DatasourceClient {\n options: ClickHouseDatasourceClientOptions;\n query(params: QueryRequestParameters, headers?: RequestHeaders): Promise<ClickHouseDatasourceResponse>;\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;AA4BjC,WAGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/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 './ClickHouseDatasource';\nexport * from './ClickHouseDatasourceEditor';\nexport * from './click-house-datasource-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,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,iCAAiC"}
|
package/lib/datasources/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/datasources/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../src/datasources/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 './click-house-datasource';\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,2BAA2B"}
|
package/lib/env.d.js
CHANGED
package/lib/env.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.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\n/// <reference types=\"@rsbuild/core/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,6CAA6C"}
|
package/lib/getPluginModule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright
|
|
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"}
|
package/lib/index-federation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.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('./bootstrap');\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,MAAM,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright
|
|
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 +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,kBAAkB,CAAC;AAElD,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,
|
|
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,kBAAkB,CAAC;AAElD,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/click-house-client.ts"],"sourcesContent":["// Copyright
|
|
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/core';\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-house-data-types.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-data-types.ts"],"names":[],"mappings":"AAaA,OAAO,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/click-house-data-types.ts"],"sourcesContent":["// Copyright
|
|
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/core';\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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQuery.tsx"],"sourcesContent":["// Copyright
|
|
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 } 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';\nimport { LogQueryPlugin } from './log-query-plugin-interface';\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};\n"],"names":["parseVariables","getClickHouseLogData","ClickHouseLogQueryEditor","ClickHouseLogQuery","getLogData","OptionsEditorComponent","createInitialOptions","query","dependsOn","spec","queryVariables","allVariables","Set","variables"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,wBAAwB,QAAQ,6BAA6B;AAItE,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;AACF,EAAE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
4
5
|
// You may obtain a copy of the License at
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { DatasourceSelect, isVariableDatasource } from '@perses-dev/plugin-system';
|
|
15
15
|
import { useCallback } from 'react';
|
|
16
16
|
import { produce } from 'immer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/click-house-log-query/ClickHouseLogQueryEditor.tsx"],"sourcesContent":["// Copyright
|
|
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 { 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) => {\n onChange(\n produce(value, (draft) => {\n draft.query = query;\n })\n );\n };\n\n const handleClickHouseQueryChange = useCallback(\n (e: string) => {\n handleQueryChange(e);\n },\n [handleQueryChange]\n );\n\n const examplesStyle: React.CSSProperties = {\n fontSize: '11px',\n color: '#777',\n backgroundColor: '#f5f5f5',\n padding: '8px',\n borderRadius: '4px',\n fontFamily: 'Monaco, Menlo, \"Ubuntu Mono\", monospace',\n whiteSpace: 'pre-wrap',\n lineHeight: '1.3',\n };\n\n return (\n <Stack spacing={1.5}>\n <DatasourceSelect\n datasourcePluginKind={DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n label=\"ClickHouse Datasource\"\n notched\n />\n <ClickQLEditor\n value={query}\n onChange={handleClickHouseQueryChange}\n onBlur={handleQueryBlur}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n handleQueryExecute(query);\n }\n }}\n placeholder=\"Enter ClickHouse SQL query\"\n />\n\n <details>\n <summary style={{ cursor: 'pointer', fontSize: '12px', color: '#666', marginBottom: '8px' }}>\n Query Examples\n </summary>\n <div style={examplesStyle}>{queryExample}</div>\n </details>\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","isVariableDatasource","useCallback","produce","Stack","DATASOURCE_KIND","DEFAULT_DATASOURCE","ClickQLEditor","queryExample","useQueryState","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","event","key","ctrlKey","metaKey","preventDefault","placeholder","details","summary","style","cursor","marginBottom","div"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,gBAAgB,EAEhBC,oBAAoB,QAEf,4BAA4B;AACnC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AACnE,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,wBAAwB;AAKtD,OAAO,SAASC,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,CAACnB,qBAAqBmB,2BAA2BA,uBAAuBC,IAAI,KAAKhB,iBAAiB;YACpGO,SACET,QAAQU,OAAO,CAACS;gBACdA,MAAMR,UAAU,GAAGM;YACrB;YAEF;QACF;QACA,MAAM,IAAIG,MAAM;IAClB;IAEA,6CAA6C;IAC7C,MAAMC,qBAAqB,CAACR;QAC1BJ,SACET,QAAQU,OAAO,CAACS;YACdA,MAAMN,KAAK,GAAGA;QAChB;IAEJ;IAEA,MAAMS,8BAA8BvB,YAClC,CAACwB;QACCT,kBAAkBS;IACpB,GACA;QAACT;KAAkB;IAGrB,MAAMU,gBAAqC;QACzCC,UAAU;QACVC,OAAO;QACPC,iBAAiB;QACjBC,SAAS;QACTC,cAAc;QACdC,YAAY;QACZC,YAAY;QACZC,YAAY;IACd;IAEA,qBACE,MAAC/B;QAAMgC,SAAS;;0BACd,KAACpC;gBACCqC,sBAAsBhC;gBACtBQ,OAAOE;gBACPH,UAAUO;gBACVmB,OAAM;gBACNC,OAAO;;0BAET,KAAChC;gBACCM,OAAOG;gBACPJ,UAAUa;gBACVe,QAAQtB;gBACRuB,WAAW,CAACC;oBACV,IAAIA,MAAMC,GAAG,KAAK,WAAYD,CAAAA,MAAME,OAAO,IAAIF,MAAMG,OAAO,AAAD,GAAI;wBAC7DH,MAAMI,cAAc;wBACpBtB,mBAAmBR;oBACrB;gBACF;gBACA+B,aAAY;;0BAGd,MAACC;;kCACC,KAACC;wBAAQC,OAAO;4BAAEC,QAAQ;4BAAWvB,UAAU;4BAAQC,OAAO;4BAAQuB,cAAc;wBAAM;kCAAG;;kCAG7F,KAACC;wBAAIH,OAAOvB;kCAAgBnB;;;;;;AAIpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/click-house-log-query/click-house-log-query-types.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/click-house-log-query/click-house-log-query-types.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceSelector } from '@perses-dev/core';\n\nexport interface ClickHouseLogQuerySpec {\n query: string;\n datasource?: DatasourceSelector;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
|
|
@@ -1 +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":"
|
|
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":"AAiBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAoD9D,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC,YAAY,CA6BrF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -26,8 +26,8 @@ function flattenObject(obj, parentKey = '', result = {}) {
|
|
|
26
26
|
function convertStreamsToLogs(streams) {
|
|
27
27
|
const entries = streams.map((entry)=>{
|
|
28
28
|
const flattened = flattenObject(entry);
|
|
29
|
-
if (!flattened
|
|
30
|
-
flattened
|
|
29
|
+
if (!flattened['Timestamp'] && flattened['log_time']) {
|
|
30
|
+
flattened['Timestamp'] = flattened['log_time'];
|
|
31
31
|
}
|
|
32
32
|
const sortedEntry = {};
|
|
33
33
|
Object.keys(flattened).sort((a, b)=>a.localeCompare(b)).forEach((key)=>{
|
|
@@ -35,7 +35,7 @@ function convertStreamsToLogs(streams) {
|
|
|
35
35
|
});
|
|
36
36
|
const line = Object.entries(sortedEntry).filter(([key])=>key !== 'Timestamp').map(([key, value])=>`<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`).join(' ');
|
|
37
37
|
return {
|
|
38
|
-
timestamp: sortedEntry?.Timestamp,
|
|
38
|
+
timestamp: sortedEntry?.['Timestamp'],
|
|
39
39
|
labels: sortedEntry,
|
|
40
40
|
line
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../../../src/queries/click-house-log-query/get-click-house-log-data.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { replaceVariables } from '@perses-dev/plugin-system';\nimport { LogEntry, LogData } from '@perses-dev/core';\nimport { ClickHouseClient, ClickHouseQueryResponse } from '../../model/click-house-client';\nimport { DEFAULT_DATASOURCE } from '../constants';\nimport { ClickHouseLogQuerySpec } from './click-house-log-query-types';\nimport { LogQueryPlugin } from './log-query-plugin-interface';\n\nfunction flattenObject(\n obj: Record<string, unknown>,\n parentKey = '',\n result: Record<string, unknown> = {}\n): Record<string, unknown> {\n for (const [key, value] of Object.entries(obj)) {\n const newKey = parentKey ? `${parentKey}.${key}` : key;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n flattenObject(value as Record<string, unknown>, newKey, result);\n } else {\n result[newKey] = value;\n }\n }\n\n return result;\n}\n\nfunction convertStreamsToLogs(streams: LogEntry[]): LogData {\n const entries: LogEntry[] = streams.map((entry) => {\n const flattened = flattenObject(entry as unknown as Record<string, unknown>);\n\n if (!flattened['Timestamp'] && flattened['log_time']) {\n flattened['Timestamp'] = flattened['log_time'];\n }\n\n const sortedEntry: Record<string, unknown> = {};\n Object.keys(flattened)\n .sort((a, b) => a.localeCompare(b))\n .forEach((key) => {\n sortedEntry[key] = flattened[key];\n });\n\n const line = Object.entries(sortedEntry)\n .filter(([key]) => key !== 'Timestamp')\n .map(([key, value]) => `<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`)\n .join(' ');\n\n return {\n timestamp: sortedEntry?.['Timestamp'] as unknown as number,\n labels: sortedEntry as Record<string, string>,\n line,\n } as LogEntry;\n });\n\n return {\n entries,\n totalCount: entries.length,\n };\n}\n\nexport const getClickHouseLogData: LogQueryPlugin<ClickHouseLogQuerySpec>['getLogData'] = async (spec, context) => {\n if (spec.query === undefined || spec.query === null || spec.query === '') {\n return {\n logs: { entries: [], totalCount: 0 },\n timeRange: { start: context.timeRange.start, end: context.timeRange.end },\n };\n }\n\n const query = replaceVariables(spec.query, context.variableState);\n\n const client = (await context.datasourceStore.getDatasourceClient(\n spec.datasource ?? DEFAULT_DATASOURCE\n )) as ClickHouseClient;\n\n const { start, end } = context.timeRange;\n\n const response: ClickHouseQueryResponse = await client.query({\n start: start.getTime().toString(),\n end: end.getTime().toString(),\n query,\n });\n\n return {\n timeRange: { start, end },\n logs: convertStreamsToLogs(response.data as LogEntry[]),\n metadata: {\n executedQueryString: query,\n },\n };\n};\n"],"names":["replaceVariables","DEFAULT_DATASOURCE","flattenObject","obj","parentKey","result","key","value","Object","entries","newKey","Array","isArray","convertStreamsToLogs","streams","map","entry","flattened","sortedEntry","keys","sort","a","b","localeCompare","forEach","line","filter","undefined","join","timestamp","labels","totalCount","length","getClickHouseLogData","spec","context","query","logs","timeRange","start","end","variableState","client","datasourceStore","getDatasourceClient","datasource","response","getTime","toString","data","metadata","executedQueryString"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,gBAAgB,QAAQ,4BAA4B;AAG7D,SAASC,kBAAkB,QAAQ,eAAe;AAIlD,SAASC,cACPC,GAA4B,EAC5BC,YAAY,EAAE,EACdC,SAAkC,CAAC,CAAC;IAEpC,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACN,KAAM;QAC9C,MAAMO,SAASN,YAAY,GAAGA,UAAU,CAAC,EAAEE,KAAK,GAAGA;QACnD,IAAIC,SAAS,OAAOA,UAAU,YAAY,CAACI,MAAMC,OAAO,CAACL,QAAQ;YAC/DL,cAAcK,OAAkCG,QAAQL;QAC1D,OAAO;YACLA,MAAM,CAACK,OAAO,GAAGH;QACnB;IACF;IAEA,OAAOF;AACT;AAEA,SAASQ,qBAAqBC,OAAmB;IAC/C,MAAML,UAAsBK,QAAQC,GAAG,CAAC,CAACC;QACvC,MAAMC,YAAYf,cAAcc;QAEhC,IAAI,CAACC,SAAS,CAAC,YAAY,IAAIA,SAAS,CAAC,WAAW,EAAE;YACpDA,SAAS,CAAC,YAAY,GAAGA,SAAS,CAAC,WAAW;QAChD;QAEA,MAAMC,cAAuC,CAAC;QAC9CV,OAAOW,IAAI,CAACF,WACTG,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAC/BE,OAAO,CAAC,CAAClB;YACRY,WAAW,CAACZ,IAAI,GAAGW,SAAS,CAACX,IAAI;QACnC;QAEF,MAAMmB,OAAOjB,OAAOC,OAAO,CAACS,aACzBQ,MAAM,CAAC,CAAC,CAACpB,IAAI,GAAKA,QAAQ,aAC1BS,GAAG,CAAC,CAAC,CAACT,KAAKC,MAAM,GAAK,CAAC,CAAC,EAAED,IAAI,EAAE,EAAEC,UAAU,MAAMA,UAAU,QAAQA,UAAUoB,YAAY,OAAOpB,OAAO,EACxGqB,IAAI,CAAC;QAER,OAAO;YACLC,WAAWX,aAAa,CAAC,YAAY;YACrCY,QAAQZ;YACRO;QACF;IACF;IAEA,OAAO;QACLhB;QACAsB,YAAYtB,QAAQuB,MAAM;IAC5B;AACF;AAEA,OAAO,MAAMC,uBAA6E,OAAOC,MAAMC;IACrG,IAAID,KAAKE,KAAK,KAAKT,aAAaO,KAAKE,KAAK,KAAK,QAAQF,KAAKE,KAAK,KAAK,IAAI;QACxE,OAAO;YACLC,MAAM;gBAAE5B,SAAS,EAAE;gBAAEsB,YAAY;YAAE;YACnCO,WAAW;gBAAEC,OAAOJ,QAAQG,SAAS,CAACC,KAAK;gBAAEC,KAAKL,QAAQG,SAAS,CAACE,GAAG;YAAC;QAC1E;IACF;IAEA,MAAMJ,QAAQpC,iBAAiBkC,KAAKE,KAAK,EAAED,QAAQM,aAAa;IAEhE,MAAMC,SAAU,MAAMP,QAAQQ,eAAe,CAACC,mBAAmB,CAC/DV,KAAKW,UAAU,IAAI5C;IAGrB,MAAM,EAAEsC,KAAK,EAAEC,GAAG,EAAE,GAAGL,QAAQG,SAAS;IAExC,MAAMQ,WAAoC,MAAMJ,OAAON,KAAK,CAAC;QAC3DG,OAAOA,MAAMQ,OAAO,GAAGC,QAAQ;QAC/BR,KAAKA,IAAIO,OAAO,GAAGC,QAAQ;QAC3BZ;IACF;IAEA,OAAO;QACLE,WAAW;YAAEC;YAAOC;QAAI;QACxBH,MAAMxB,qBAAqBiC,SAASG,IAAI;QACxCC,UAAU;YACRC,qBAAqBf;QACvB;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queries/click-house-log-query/index.ts"],"sourcesContent":["// Copyright
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-query-plugin-interface.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-query-plugin-interface.d.ts","sourceRoot":"","sources":["../../../../src/queries/click-house-log-query/log-query-plugin-interface.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEtF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACjF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,0BAA0B,CAAC;CACrF"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the \"License\");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an \"AS IS\" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
export { };
|
|
2
14
|
|
|
3
15
|
//# sourceMappingURL=log-query-plugin-interface.js.map
|