@perses-dev/splunk-plugin 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +60 -0
- package/__mf/css/async/7.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/Splunk.d622dd09.js +7 -0
- package/__mf/js/async/121.444e1abe.js +2 -0
- package/__mf/js/async/121.444e1abe.js.LICENSE.txt +9 -0
- package/__mf/js/async/177.cfdf2ea5.js +1 -0
- package/__mf/js/async/181.fee3676d.js +2 -0
- package/__mf/js/async/181.fee3676d.js.LICENSE.txt +9 -0
- package/__mf/js/async/278.171d6548.js +24 -0
- package/__mf/js/async/278.171d6548.js.LICENSE.txt +44 -0
- package/__mf/js/async/386.9514a8a7.js +2 -0
- package/__mf/js/async/386.9514a8a7.js.LICENSE.txt +9 -0
- package/__mf/js/async/413.0cd939f5.js +1 -0
- package/__mf/js/async/470.3f481d24.js +2 -0
- package/__mf/js/async/470.3f481d24.js.LICENSE.txt +19 -0
- package/__mf/js/async/667.bb282078.js +1 -0
- package/__mf/js/async/7.ed3f1592.js +7 -0
- package/__mf/js/async/7.ed3f1592.js.LICENSE.txt +64 -0
- package/__mf/js/async/732.69245394.js +139 -0
- package/__mf/js/async/732.69245394.js.LICENSE.txt +46 -0
- package/__mf/js/async/941.8fe72889.js +2 -0
- package/__mf/js/async/941.8fe72889.js.LICENSE.txt +9 -0
- package/__mf/js/async/963.f1d8b579.js +1 -0
- package/__mf/js/async/982.8a88a864.js +10 -0
- package/__mf/js/async/982.8a88a864.js.LICENSE.txt +26 -0
- package/__mf/js/async/__federation_expose_SplunkDatasource.f30e66ce.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkDatasource.f30e66ce.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_SplunkLogQuery.df0414d6.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkLogQuery.df0414d6.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_SplunkTimeSeriesQuery.fa50234a.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkTimeSeriesQuery.fa50234a.js.LICENSE.txt +9 -0
- package/__mf/js/async/lib-router.1acd2c34.js +2 -0
- package/__mf/js/async/lib-router.1acd2c34.js.LICENSE.txt +32 -0
- package/__mf/js/main.39e2a771.js +7 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +20 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +27 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/datasources/splunk-datasource/SplunkDatasource.js +69 -0
- package/lib/cjs/datasources/splunk-datasource/SplunkDatasourceEditor.js +71 -0
- package/lib/cjs/datasources/splunk-datasource/index.js +32 -0
- package/lib/cjs/datasources/splunk-datasource/splunk-datasource-types.js +16 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +39 -0
- package/lib/cjs/model/index.js +31 -0
- package/lib/cjs/model/splunk-client-types.js +16 -0
- package/lib/cjs/model/splunk-client.js +151 -0
- package/lib/cjs/queries/constants.js +25 -0
- package/lib/cjs/queries/index.js +31 -0
- package/lib/cjs/queries/splunk-log-query/SplunkLogQuery.js +43 -0
- package/lib/cjs/queries/splunk-log-query/SplunkLogQueryEditor.js +95 -0
- package/lib/cjs/queries/splunk-log-query/get-splunk-log-data.js +127 -0
- package/lib/cjs/queries/splunk-log-query/index.js +33 -0
- package/lib/cjs/queries/splunk-log-query/log-query-plugin-interface.js +16 -0
- package/lib/cjs/queries/splunk-log-query/splunk-log-query-types.js +16 -0
- package/lib/cjs/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js +43 -0
- package/lib/cjs/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js +95 -0
- package/lib/cjs/queries/splunk-time-series-query/get-splunk-time-series-data.js +106 -0
- package/lib/cjs/queries/splunk-time-series-query/index.js +33 -0
- package/lib/cjs/queries/splunk-time-series-query/splunk-time-series-query-types.js +16 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/datasources/index.d.ts +2 -0
- package/lib/datasources/index.d.ts.map +1 -0
- package/lib/datasources/index.js +15 -0
- package/lib/datasources/index.js.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.d.ts +5 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.js +61 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.js.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.test.d.ts +2 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.test.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.d.ts +9 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.js +63 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.js.map +1 -0
- package/lib/datasources/splunk-datasource/index.d.ts +4 -0
- package/lib/datasources/splunk-datasource/index.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/index.js +17 -0
- package/lib/datasources/splunk-datasource/index.js.map +1 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.d.ts +6 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.js +15 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +28 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/index.d.ts +3 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +16 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/splunk-client-types.d.ts +50 -0
- package/lib/model/splunk-client-types.d.ts.map +1 -0
- package/lib/model/splunk-client-types.js +15 -0
- package/lib/model/splunk-client-types.js.map +1 -0
- package/lib/model/splunk-client.d.ts +40 -0
- package/lib/model/splunk-client.d.ts.map +1 -0
- package/lib/model/splunk-client.js +126 -0
- package/lib/model/splunk-client.js.map +1 -0
- package/lib/queries/constants.d.ts +4 -0
- package/lib/queries/constants.d.ts.map +1 -0
- package/lib/queries/constants.js +17 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +16 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.d.ts +4 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.js +35 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.js.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.test.d.ts +2 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.test.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.d.ts +7 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.js +87 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.js.map +1 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.d.ts +4 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.js +119 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.js.map +1 -0
- package/lib/queries/splunk-log-query/index.d.ts +5 -0
- package/lib/queries/splunk-log-query/index.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/index.js +18 -0
- package/lib/queries/splunk-log-query/index.js.map +1 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.d.ts +23 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.js +15 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.d.ts +11 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.js +15 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.js.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.d.ts +4 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js +35 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.test.d.ts +2 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.test.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.d.ts +7 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js +87 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js.map +1 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.d.ts +4 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.js +98 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.js.map +1 -0
- package/lib/queries/splunk-time-series-query/index.d.ts +5 -0
- package/lib/queries/splunk-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/index.js +18 -0
- package/lib/queries/splunk-time-series-query/index.js.map +1 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.d.ts +10 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.js +15 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +198 -0
- package/mf-stats.json +220 -0
- package/package.json +74 -0
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
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, "SplunkTimeSeriesQuery", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SplunkTimeSeriesQuery;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _getsplunktimeseriesdata = require("./get-splunk-time-series-data");
|
|
25
|
+
const _SplunkTimeSeriesQueryEditor = require("./SplunkTimeSeriesQueryEditor");
|
|
26
|
+
const SplunkTimeSeriesQuery = {
|
|
27
|
+
getTimeSeriesData: _getsplunktimeseriesdata.getSplunkTimeSeriesData,
|
|
28
|
+
OptionsEditorComponent: _SplunkTimeSeriesQueryEditor.SplunkTimeSeriesQueryEditor,
|
|
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
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
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, "SplunkTimeSeriesQueryEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SplunkTimeSeriesQueryEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _immer = require("immer");
|
|
27
|
+
const DATASOURCE_KIND = 'SplunkDatasource';
|
|
28
|
+
const DEFAULT_DATASOURCE = {
|
|
29
|
+
kind: DATASOURCE_KIND
|
|
30
|
+
};
|
|
31
|
+
function SplunkTimeSeriesQueryEditor(props) {
|
|
32
|
+
const { onChange, value } = props;
|
|
33
|
+
const { datasource, query } = value;
|
|
34
|
+
const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;
|
|
35
|
+
const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, DATASOURCE_KIND);
|
|
36
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
37
|
+
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
|
|
38
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
39
|
+
draft.datasource = newDatasourceSelection;
|
|
40
|
+
}));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw new Error('Got unexpected non SplunkQuery datasource selection');
|
|
44
|
+
};
|
|
45
|
+
const handleQueryChange = (newQuery)=>{
|
|
46
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
47
|
+
draft.query = newQuery;
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
51
|
+
spacing: 1.5,
|
|
52
|
+
paddingBottom: 1,
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
57
|
+
sx: {
|
|
58
|
+
display: 'block',
|
|
59
|
+
marginBottom: '4px',
|
|
60
|
+
fontWeight: 500
|
|
61
|
+
},
|
|
62
|
+
children: "Datasource"
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
65
|
+
datasourcePluginKind: DATASOURCE_KIND,
|
|
66
|
+
value: selectedDatasource,
|
|
67
|
+
onChange: handleDatasourceChange,
|
|
68
|
+
label: "Splunk Datasource",
|
|
69
|
+
notched: true
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
76
|
+
sx: {
|
|
77
|
+
display: 'block',
|
|
78
|
+
marginBottom: '4px',
|
|
79
|
+
fontWeight: 500
|
|
80
|
+
},
|
|
81
|
+
children: "SPL Query"
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
multiline: true,
|
|
86
|
+
rows: 4,
|
|
87
|
+
value: query,
|
|
88
|
+
onChange: (e)=>handleQueryChange(e.target.value),
|
|
89
|
+
placeholder: "search index=main | timechart count"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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, "getSplunkTimeSeriesData", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getSplunkTimeSeriesData;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _constants = require("../constants");
|
|
25
|
+
function convertResultsToTimeSeries(results) {
|
|
26
|
+
const resultsArray = Array.isArray(results) ? results : [
|
|
27
|
+
results
|
|
28
|
+
];
|
|
29
|
+
if (resultsArray.length === 0) return [];
|
|
30
|
+
const firstResult = resultsArray[0];
|
|
31
|
+
if (!firstResult) return [];
|
|
32
|
+
const metricKeys = Object.keys(firstResult).filter((key)=>key !== '_time');
|
|
33
|
+
return metricKeys.map((metricKey)=>({
|
|
34
|
+
name: metricKey,
|
|
35
|
+
values: resultsArray.map((result)=>{
|
|
36
|
+
const timestamp = new Date(result._time).getTime() / 1000;
|
|
37
|
+
const value = Number(result[metricKey]) || 0;
|
|
38
|
+
return [
|
|
39
|
+
timestamp,
|
|
40
|
+
value
|
|
41
|
+
];
|
|
42
|
+
}),
|
|
43
|
+
labels: {
|
|
44
|
+
metric: metricKey
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
const getSplunkTimeSeriesData = async (spec, context)=>{
|
|
49
|
+
if (!spec.query) {
|
|
50
|
+
return {
|
|
51
|
+
series: [],
|
|
52
|
+
timeRange: {
|
|
53
|
+
start: context.timeRange.start,
|
|
54
|
+
end: context.timeRange.end
|
|
55
|
+
},
|
|
56
|
+
stepMs: 60000
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
|
|
60
|
+
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
61
|
+
const datasourceSpec = await context.datasourceStore.getDatasource(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
62
|
+
const allowedEndpoints = datasourceSpec.plugin.spec?.proxy?.spec?.allowedEndpoints || [];
|
|
63
|
+
const hasExportEndpoint = allowedEndpoints.some((ep)=>ep.endpointPattern?.includes('/export'));
|
|
64
|
+
const { start, end } = context.timeRange;
|
|
65
|
+
const earliest_time = Math.floor(start.getTime() / 1000).toString();
|
|
66
|
+
const latest_time = Math.floor(end.getTime() / 1000).toString();
|
|
67
|
+
let resultsResponse;
|
|
68
|
+
if (hasExportEndpoint) {
|
|
69
|
+
resultsResponse = await client.exportSearch({
|
|
70
|
+
search: query,
|
|
71
|
+
earliest_time: spec.earliest || earliest_time,
|
|
72
|
+
latest_time: spec.latest || latest_time
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
const jobResponse = await client.createJob({
|
|
76
|
+
search: query,
|
|
77
|
+
earliest_time: spec.earliest || earliest_time,
|
|
78
|
+
latest_time: spec.latest || latest_time
|
|
79
|
+
});
|
|
80
|
+
const jobId = jobResponse.sid;
|
|
81
|
+
let jobStatus;
|
|
82
|
+
do {
|
|
83
|
+
await new Promise((resolve)=>setTimeout(resolve, 500)); // Wait 500ms between polls
|
|
84
|
+
jobStatus = await client.getJobStatus(jobId);
|
|
85
|
+
if (!jobStatus || !jobStatus.entry?.[0]?.content) {
|
|
86
|
+
console.warn('Failed to get job status or job status response is malformed', {
|
|
87
|
+
jobStatus
|
|
88
|
+
});
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}while (!jobStatus.entry?.[0]?.content?.isDone)
|
|
92
|
+
resultsResponse = await client.getJobResults(jobId);
|
|
93
|
+
}
|
|
94
|
+
const convertedSeries = convertResultsToTimeSeries(resultsResponse.results);
|
|
95
|
+
return {
|
|
96
|
+
series: convertedSeries,
|
|
97
|
+
timeRange: {
|
|
98
|
+
start,
|
|
99
|
+
end
|
|
100
|
+
},
|
|
101
|
+
stepMs: context.suggestedStepMs || 60000,
|
|
102
|
+
metadata: {
|
|
103
|
+
executedQueryString: query
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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("./get-splunk-time-series-data"), exports);
|
|
18
|
+
_export_star(require("./SplunkTimeSeriesQuery"), exports);
|
|
19
|
+
_export_star(require("./SplunkTimeSeriesQueryEditor"), exports);
|
|
20
|
+
_export_star(require("./splunk-time-series-query-types"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
require("@testing-library/jest-dom");
|
|
18
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
19
|
+
jest.mock('echarts/core');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/datasources/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './splunk-datasource';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 './splunk-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,sBAAsB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DatasourcePlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import { SplunkClient } from '../../model/splunk-client';
|
|
3
|
+
import { SplunkDatasourceSpec } from './splunk-datasource-types';
|
|
4
|
+
export declare const SplunkDatasource: DatasourcePlugin<SplunkDatasourceSpec, SplunkClient>;
|
|
5
|
+
//# sourceMappingURL=SplunkDatasource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplunkDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/splunk-datasource/SplunkDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,YAAY,EAOb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA6BjE,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,oBAAoB,EAAE,YAAY,CAIjF,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { createJob, getJobStatus, getJobResults, getJobEvents, exportSearch, getIndexes } from '../../model/splunk-client';
|
|
14
|
+
import { SplunkDatasourceEditor } from './SplunkDatasourceEditor';
|
|
15
|
+
const createClient = (spec, options)=>{
|
|
16
|
+
const { directUrl, proxy } = spec;
|
|
17
|
+
const { proxyUrl } = options;
|
|
18
|
+
const datasourceUrl = directUrl ?? proxyUrl;
|
|
19
|
+
if (datasourceUrl === undefined) {
|
|
20
|
+
throw new Error('No URL specified for Splunk client. You can use directUrl in the spec to configure it.');
|
|
21
|
+
}
|
|
22
|
+
const specHeaders = proxy?.spec.headers;
|
|
23
|
+
return {
|
|
24
|
+
options: {
|
|
25
|
+
datasourceUrl
|
|
26
|
+
},
|
|
27
|
+
createJob: (params, headers)=>createJob(params, {
|
|
28
|
+
datasourceUrl,
|
|
29
|
+
headers: headers ?? specHeaders
|
|
30
|
+
}),
|
|
31
|
+
getJobStatus: (jobId, headers)=>getJobStatus(jobId, {
|
|
32
|
+
datasourceUrl,
|
|
33
|
+
headers: headers ?? specHeaders
|
|
34
|
+
}),
|
|
35
|
+
getJobResults: (jobId, params, headers)=>getJobResults(jobId, params, {
|
|
36
|
+
datasourceUrl,
|
|
37
|
+
headers: headers ?? specHeaders
|
|
38
|
+
}),
|
|
39
|
+
getJobEvents: (jobId, params, headers)=>getJobEvents(jobId, params, {
|
|
40
|
+
datasourceUrl,
|
|
41
|
+
headers: headers ?? specHeaders
|
|
42
|
+
}),
|
|
43
|
+
exportSearch: (params, headers)=>exportSearch(params, {
|
|
44
|
+
datasourceUrl,
|
|
45
|
+
headers: headers ?? specHeaders
|
|
46
|
+
}),
|
|
47
|
+
getIndexes: (headers)=>getIndexes({
|
|
48
|
+
datasourceUrl,
|
|
49
|
+
headers: headers ?? specHeaders
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export const SplunkDatasource = {
|
|
54
|
+
createClient,
|
|
55
|
+
OptionsEditorComponent: SplunkDatasourceEditor,
|
|
56
|
+
createInitialOptions: ()=>({
|
|
57
|
+
directUrl: ''
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=SplunkDatasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/splunk-datasource/SplunkDatasource.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 {\n SplunkClient,\n createJob,\n getJobStatus,\n getJobResults,\n getJobEvents,\n exportSearch,\n getIndexes,\n} from '../../model/splunk-client';\nimport { SplunkDatasourceSpec } from './splunk-datasource-types';\nimport { SplunkDatasourceEditor } from './SplunkDatasourceEditor';\n\nconst createClient: DatasourcePlugin<SplunkDatasourceSpec, SplunkClient>['createClient'] = (spec, options) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Splunk client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n createJob: (params, headers) => createJob(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getJobStatus: (jobId, headers) => getJobStatus(jobId, { datasourceUrl, headers: headers ?? specHeaders }),\n getJobResults: (jobId, params, headers) =>\n getJobResults(jobId, params, { datasourceUrl, headers: headers ?? specHeaders }),\n getJobEvents: (jobId, params, headers) =>\n getJobEvents(jobId, params, { datasourceUrl, headers: headers ?? specHeaders }),\n exportSearch: (params, headers) => exportSearch(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getIndexes: (headers) => getIndexes({ datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const SplunkDatasource: DatasourcePlugin<SplunkDatasourceSpec, SplunkClient> = {\n createClient,\n OptionsEditorComponent: SplunkDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["createJob","getJobStatus","getJobResults","getJobEvents","exportSearch","getIndexes","SplunkDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","jobId","SplunkDatasource","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,SAEEA,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,QACL,4BAA4B;AAEnC,SAASC,sBAAsB,QAAQ,2BAA2B;AAElE,MAAMC,eAAqF,CAACC,MAAMC;IAChG,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,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAb,WAAW,CAACkB,QAAQD,UAAYjB,UAAUkB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACnGf,cAAc,CAACkB,OAAOF,UAAYhB,aAAakB,OAAO;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QACvGd,eAAe,CAACiB,OAAOD,QAAQD,UAC7Bf,cAAciB,OAAOD,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAChFb,cAAc,CAACgB,OAAOD,QAAQD,UAC5Bd,aAAagB,OAAOD,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QAC/EZ,cAAc,CAACc,QAAQD,UAAYb,aAAac,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACzGX,YAAY,CAACY,UAAYZ,WAAW;gBAAEQ;gBAAeI,SAASA,WAAWD;YAAY;IACvF;AACF;AAEA,OAAO,MAAMI,mBAAyE;IACpFb;IACAc,wBAAwBf;IACxBgB,sBAAsB,IAAO,CAAA;YAAEZ,WAAW;QAAG,CAAA;AAC/C,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplunkDatasource.test.d.ts","sourceRoot":"","sources":["../../../../src/datasources/splunk-datasource/SplunkDatasource.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SplunkDatasourceSpec } from './splunk-datasource-types';
|
|
3
|
+
export interface SplunkDatasourceEditorProps {
|
|
4
|
+
value: SplunkDatasourceSpec;
|
|
5
|
+
onChange: (next: SplunkDatasourceSpec) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SplunkDatasourceEditor(props: SplunkDatasourceEditorProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=SplunkDatasourceEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplunkDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../../src/datasources/splunk-datasource/SplunkDatasourceEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,YAAY,CAmDvF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
|
|
15
|
+
export function SplunkDatasourceEditor(props) {
|
|
16
|
+
const { value, onChange, isReadonly } = props;
|
|
17
|
+
const initialSpecDirect = {
|
|
18
|
+
directUrl: ''
|
|
19
|
+
};
|
|
20
|
+
const initialSpecProxy = {
|
|
21
|
+
proxy: {
|
|
22
|
+
kind: 'HTTPProxy',
|
|
23
|
+
spec: {
|
|
24
|
+
allowedEndpoints: [
|
|
25
|
+
{
|
|
26
|
+
endpointPattern: '/services/search/v2/jobs',
|
|
27
|
+
method: 'POST'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)',
|
|
31
|
+
method: 'GET'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)/results',
|
|
35
|
+
method: 'GET'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)/events',
|
|
39
|
+
method: 'GET'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
endpointPattern: '/services/search/v2/jobs/export',
|
|
43
|
+
method: 'POST'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
endpointPattern: '/services/data/indexes',
|
|
47
|
+
method: 'GET'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
url: ''
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/ _jsx(HTTPSettingsEditor, {
|
|
55
|
+
value: value,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
isReadonly: isReadonly,
|
|
58
|
+
initialSpecDirect: initialSpecDirect,
|
|
59
|
+
initialSpecProxy: initialSpecProxy
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=SplunkDatasourceEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/splunk-datasource/SplunkDatasourceEditor.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 { SplunkDatasourceSpec } from './splunk-datasource-types';\n\nexport interface SplunkDatasourceEditorProps {\n value: SplunkDatasourceSpec;\n onChange: (next: SplunkDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function SplunkDatasourceEditor(props: SplunkDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: SplunkDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: SplunkDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/services/search/v2/jobs',\n method: 'POST',\n },\n {\n endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)',\n method: 'GET',\n },\n {\n endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)/results',\n method: 'GET',\n },\n {\n endpointPattern: '/services/search/v2/jobs/([a-zA-Z0-9_.-]+)/events',\n method: 'GET',\n },\n {\n endpointPattern: '/services/search/v2/jobs/export',\n method: 'POST',\n },\n {\n endpointPattern: '/services/data/indexes',\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","SplunkDatasourceEditor","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,uBAAuBC,KAAkC;IACvE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAA0C;QAC9CC,WAAW;IACb;IAEA,MAAMC,mBAAyC;QAC7CC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/datasources/splunk-datasource/index.ts"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './SplunkDatasource';
|
|
14
|
+
export * from './SplunkDatasourceEditor';
|
|
15
|
+
export * from './splunk-datasource-types';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/splunk-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 './SplunkDatasource';\nexport * from './SplunkDatasourceEditor';\nexport * from './splunk-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,qBAAqB;AACnC,cAAc,2BAA2B;AACzC,cAAc,4BAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splunk-datasource-types.d.ts","sourceRoot":"","sources":["../../../../src/datasources/splunk-datasource/splunk-datasource-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export { };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=splunk-datasource-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/splunk-datasource/splunk-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 } from '@perses-dev/spec';\n\nexport interface SplunkDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\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"}
|
package/lib/env.d.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
/// <reference types="vite/client" />
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=env.d.js.map
|
package/lib/env.d.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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=\"vite/client\" />\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,qCAAqC"}
|