@cloudcare/codemirror-dql 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/build.sh +7 -0
- package/dist/cjs/client/dql.d.ts +23 -0
- package/dist/cjs/client/dql.js +156 -0
- package/dist/cjs/client/dql.js.map +1 -0
- package/dist/cjs/client/index.d.ts +1 -0
- package/dist/cjs/client/index.js +6 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/complete/dql.terms.d.ts +20 -0
- package/dist/cjs/complete/dql.terms.js +209 -0
- package/dist/cjs/complete/dql.terms.js.map +1 -0
- package/dist/cjs/complete/hybrid.d.ts +50 -0
- package/dist/cjs/complete/hybrid.js +832 -0
- package/dist/cjs/complete/hybrid.js.map +1 -0
- package/dist/cjs/complete/index.d.ts +7 -0
- package/dist/cjs/complete/index.js +33 -0
- package/dist/cjs/complete/index.js.map +1 -0
- package/dist/cjs/dql.d.ts +16 -0
- package/dist/cjs/dql.js +66 -0
- package/dist/cjs/dql.js.map +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/parser/index.d.ts +2 -0
- package/dist/cjs/parser/index.js +12 -0
- package/dist/cjs/parser/index.js.map +1 -0
- package/dist/cjs/parser/matcher.d.ts +7 -0
- package/dist/cjs/parser/matcher.js +104 -0
- package/dist/cjs/parser/matcher.js.map +1 -0
- package/dist/cjs/parser/path-finder.d.ts +5 -0
- package/dist/cjs/parser/path-finder.js +92 -0
- package/dist/cjs/parser/path-finder.js.map +1 -0
- package/dist/cjs/theme.d.ts +6 -0
- package/dist/cjs/theme.js +252 -0
- package/dist/cjs/theme.js.map +1 -0
- package/dist/cjs/types/function.d.ts +11 -0
- package/dist/cjs/types/function.js +16 -0
- package/dist/cjs/types/function.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/matcher.d.ts +7 -0
- package/dist/cjs/types/matcher.js +24 -0
- package/dist/cjs/types/matcher.js.map +1 -0
- package/dist/esm/client/dql.d.ts +23 -0
- package/dist/esm/client/dql.js +150 -0
- package/dist/esm/client/dql.js.map +1 -0
- package/dist/esm/client/index.d.ts +1 -0
- package/dist/esm/client/index.js +2 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/complete/dql.terms.d.ts +20 -0
- package/dist/esm/complete/dql.terms.js +206 -0
- package/dist/esm/complete/dql.terms.js.map +1 -0
- package/dist/esm/complete/hybrid.d.ts +50 -0
- package/dist/esm/complete/hybrid.js +772 -0
- package/dist/esm/complete/hybrid.js.map +1 -0
- package/dist/esm/complete/index.d.ts +7 -0
- package/dist/esm/complete/index.js +29 -0
- package/dist/esm/complete/index.js.map +1 -0
- package/dist/esm/dql.d.ts +16 -0
- package/dist/esm/dql.js +59 -0
- package/dist/esm/dql.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/parser/index.d.ts +2 -0
- package/dist/esm/parser/index.js +3 -0
- package/dist/esm/parser/index.js.map +1 -0
- package/dist/esm/parser/matcher.d.ts +7 -0
- package/dist/esm/parser/matcher.js +74 -0
- package/dist/esm/parser/matcher.js.map +1 -0
- package/dist/esm/parser/path-finder.d.ts +5 -0
- package/dist/esm/parser/path-finder.js +74 -0
- package/dist/esm/parser/path-finder.js.map +1 -0
- package/dist/esm/theme.d.ts +6 -0
- package/dist/esm/theme.js +249 -0
- package/dist/esm/theme.js.map +1 -0
- package/dist/esm/types/function.d.ts +11 -0
- package/dist/esm/types/function.js +13 -0
- package/dist/esm/types/function.js.map +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/matcher.d.ts +7 -0
- package/dist/esm/types/matcher.js +19 -0
- package/dist/esm/types/matcher.js.map +1 -0
- package/eslint.config.mjs +40 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CloudCare
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/build.sh
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Matcher } from '../types';
|
|
2
|
+
export interface NamespaceData {
|
|
3
|
+
name: string;
|
|
4
|
+
help: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ShowFuncData {
|
|
7
|
+
info: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FieldNameData {
|
|
11
|
+
info: string;
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class DQLClient {
|
|
16
|
+
constructor();
|
|
17
|
+
namespace(): Promise<NamespaceData[]>;
|
|
18
|
+
showFunctions(): Promise<ShowFuncData[]>;
|
|
19
|
+
indexValues(namespace: string): Promise<string[]>;
|
|
20
|
+
datasourceValues(namespace: string, indexs?: string[]): Promise<string[]>;
|
|
21
|
+
fieldValues(namespace: string, indexs?: string[], datasource?: string[], matcher?: Matcher): Promise<string[]>;
|
|
22
|
+
fieldNames(namespace: string, indexs?: string[], datasource?: string[]): Promise<FieldNameData[]>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DQLClient = void 0;
|
|
4
|
+
var data = {
|
|
5
|
+
namespaces: [
|
|
6
|
+
{
|
|
7
|
+
name: 'L',
|
|
8
|
+
help: '日志',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'M',
|
|
12
|
+
help: '指标',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'O',
|
|
16
|
+
help: '对象',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'T',
|
|
20
|
+
help: '链路',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'R',
|
|
24
|
+
help: 'RUM',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
showFuncs: [
|
|
28
|
+
{ info: '对象历史', name: '' },
|
|
29
|
+
{ info: '日志(logging)数据', name: '' },
|
|
30
|
+
{ info: 'show_logging_source', name: 'show_logging_source' },
|
|
31
|
+
{ info: 'show_logging_field', name: 'show_logging_field' },
|
|
32
|
+
{ info: '备份日志', name: '' },
|
|
33
|
+
{ info: '事件(keyevent)', name: '' },
|
|
34
|
+
{ info: 'show_event_source', name: 'show_event_source' },
|
|
35
|
+
{ info: 'show_event_field', name: 'show_event_field' },
|
|
36
|
+
{ info: 'APM(tracing)数据', name: '' },
|
|
37
|
+
{ info: 'show_tracing_source', name: 'show_tracing_source' },
|
|
38
|
+
{ info: 'show_tracing_service', name: 'show_tracing_service' },
|
|
39
|
+
{ info: 'show_tracing_field', name: 'show_tracing_field' },
|
|
40
|
+
{ info: 'profile 数据', name: '' },
|
|
41
|
+
{ info: 'show_profiling_source', name: 'show_profiling_source' },
|
|
42
|
+
{ info: 'show_profiling_field', name: 'show_profiling_field' },
|
|
43
|
+
{ info: 'RUM 数据', name: '' },
|
|
44
|
+
{ info: 'show_rum_source', name: 'show_rum_source' },
|
|
45
|
+
{ info: 'show_rum_type', name: 'show_rum_type' },
|
|
46
|
+
{ info: 'show_rum_field', name: 'show_rum_field' },
|
|
47
|
+
{ info: '用户资源目录(custom object)', name: '' },
|
|
48
|
+
{ info: 'show_cobject_source', name: 'show_cobject_source' },
|
|
49
|
+
{ info: 'show_custom_object_class', name: 'show_custom_object_class' },
|
|
50
|
+
{ info: 'show_custom_object_field', name: 'show_custom_object_field' },
|
|
51
|
+
{ info: '网络 eBPF(network)数据', name: '' },
|
|
52
|
+
{ info: 'show_network_source', name: 'show_network_source' },
|
|
53
|
+
{ info: 'show_network_field', name: 'show_network_field' },
|
|
54
|
+
{ info: '时序(metric)数据', name: '' },
|
|
55
|
+
{ info: 'show_measurement', name: 'show_measurement' },
|
|
56
|
+
{ info: 'show_tag_key', name: 'show_tag_key' },
|
|
57
|
+
{ info: 'show_tag_value', name: 'show_tag_value' },
|
|
58
|
+
{ info: 'show_field_key', name: 'show_field_key' },
|
|
59
|
+
{ info: '工作空间信息', name: '' },
|
|
60
|
+
{ info: 'show_workspaces', name: 'show_workspaces' },
|
|
61
|
+
// 第二张图部分
|
|
62
|
+
{ info: 'show_object_source', name: 'show_object_source' },
|
|
63
|
+
{ info: 'show_object_class', name: 'show_object_class' },
|
|
64
|
+
{ info: 'show_object_field', name: 'show_object_field' },
|
|
65
|
+
{ info: 'show_object_label', name: 'show_object_label' },
|
|
66
|
+
],
|
|
67
|
+
indexs: ['index1', 'default', 'abc', 'dbd'],
|
|
68
|
+
dataSource: ['source1', 'cpu', 'source2', 'ddsource'],
|
|
69
|
+
fieldNames: [
|
|
70
|
+
{
|
|
71
|
+
info: '主机名称',
|
|
72
|
+
type: 'string',
|
|
73
|
+
name: 'host',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
info: 'IP地址',
|
|
77
|
+
type: 'string',
|
|
78
|
+
name: 'ip',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
info: 'CPU使用率',
|
|
82
|
+
type: 'number',
|
|
83
|
+
name: 'cpu_usage',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
info: '内存使用率',
|
|
87
|
+
type: 'number',
|
|
88
|
+
name: 'mem_usage',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
info: '操作系统',
|
|
92
|
+
type: 'string',
|
|
93
|
+
name: 'os',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
info: '启动时间',
|
|
97
|
+
type: 'datetime',
|
|
98
|
+
name: 'boot_time',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
fieldValues: [
|
|
102
|
+
'alpha',
|
|
103
|
+
'bravo',
|
|
104
|
+
'charlie',
|
|
105
|
+
'delta',
|
|
106
|
+
'echo',
|
|
107
|
+
'foxtrot',
|
|
108
|
+
'golf',
|
|
109
|
+
'hotel',
|
|
110
|
+
'india',
|
|
111
|
+
'juliet',
|
|
112
|
+
'kilo',
|
|
113
|
+
'lima',
|
|
114
|
+
'mike',
|
|
115
|
+
'november',
|
|
116
|
+
'oscar',
|
|
117
|
+
'papa',
|
|
118
|
+
'quebec',
|
|
119
|
+
'romeo',
|
|
120
|
+
'sierra',
|
|
121
|
+
'tango',
|
|
122
|
+
'uniform',
|
|
123
|
+
'victor',
|
|
124
|
+
'whiskey',
|
|
125
|
+
'xray',
|
|
126
|
+
'yankee',
|
|
127
|
+
'zulu',
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
var DQLClient = /** @class */ (function () {
|
|
131
|
+
function DQLClient() {
|
|
132
|
+
}
|
|
133
|
+
DQLClient.prototype.namespace = function () {
|
|
134
|
+
console.log('===namespace', data.namespaces);
|
|
135
|
+
return Promise.resolve(data.namespaces);
|
|
136
|
+
};
|
|
137
|
+
DQLClient.prototype.showFunctions = function () {
|
|
138
|
+
return Promise.resolve(data.showFuncs);
|
|
139
|
+
};
|
|
140
|
+
DQLClient.prototype.indexValues = function (namespace) {
|
|
141
|
+
return Promise.resolve(data.indexs);
|
|
142
|
+
};
|
|
143
|
+
DQLClient.prototype.datasourceValues = function (namespace, indexs) {
|
|
144
|
+
return Promise.resolve(data.dataSource);
|
|
145
|
+
};
|
|
146
|
+
DQLClient.prototype.fieldValues = function (namespace, indexs, datasource, matcher) {
|
|
147
|
+
console.log('===matcher', matcher);
|
|
148
|
+
return Promise.resolve(data.fieldValues);
|
|
149
|
+
};
|
|
150
|
+
DQLClient.prototype.fieldNames = function (namespace, indexs, datasource) {
|
|
151
|
+
return Promise.resolve(data.fieldNames);
|
|
152
|
+
};
|
|
153
|
+
return DQLClient;
|
|
154
|
+
}());
|
|
155
|
+
exports.DQLClient = DQLClient;
|
|
156
|
+
//# sourceMappingURL=dql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dql.js","sourceRoot":"","sources":["../../../src/client/dql.ts"],"names":[],"mappings":";;;AAcA,IAAM,IAAI,GAAG;IACX,UAAU,EAAE;QACV;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,G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C,CAAC;IACD,+BAAW,GAAX,UAAY,SAAiB;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IACD,oCAAgB,GAAhB,UAAiB,SAAiB,EAAE,MAAiB;QACnD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,+BAAW,GAAX,UAAY,SAAiB,EAAE,MAAiB,EAAE,UAAqB,EAAE,OAAiB;QACxF,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,8BAAU,GAAV,UAAW,SAAiB,EAAE,MAAiB,EAAE,UAAqB;QACpE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IACH,gBAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,8BAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DQLClient, NamespaceData, ShowFuncData, FieldNameData } from './dql';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DQLClient = void 0;
|
|
4
|
+
var dql_1 = require("./dql");
|
|
5
|
+
Object.defineProperty(exports, "DQLClient", { enumerable: true, get: function () { return dql_1.DQLClient; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":";;;AAAA,6BAA8E;AAArE,gGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Completion } from '@codemirror/autocomplete';
|
|
2
|
+
export declare const durationTerms: {
|
|
3
|
+
label: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const matchOpTerms: {
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const binOpTerms: {
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const connectOpTerms: {
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const functionIdentifierTerms: {
|
|
15
|
+
label: string;
|
|
16
|
+
detail: string;
|
|
17
|
+
info: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const snippets: readonly Completion[];
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.snippets = exports.functionIdentifierTerms = exports.connectOpTerms = exports.binOpTerms = exports.matchOpTerms = exports.durationTerms = void 0;
|
|
4
|
+
var autocomplete_1 = require("@codemirror/autocomplete");
|
|
5
|
+
exports.durationTerms = [{ label: 'y' }, { label: 'w' }, { label: 'd' }, { label: 'h' }, { label: 'm' }, { label: 's' }, { label: 'ms' }];
|
|
6
|
+
exports.matchOpTerms = [{ label: '=' }, { label: '!=' }, { label: '=~' }, { label: '!~' }, { label: 'in' }, { label: 'not in' }];
|
|
7
|
+
exports.binOpTerms = [
|
|
8
|
+
{ label: '^' },
|
|
9
|
+
{ label: '*' },
|
|
10
|
+
{ label: '/' },
|
|
11
|
+
{ label: '%' },
|
|
12
|
+
{ label: '+' },
|
|
13
|
+
{ label: '-' },
|
|
14
|
+
{ label: '==' },
|
|
15
|
+
{ label: '>=' },
|
|
16
|
+
{ label: '>' },
|
|
17
|
+
{ label: '<' },
|
|
18
|
+
{ label: '<=' },
|
|
19
|
+
{ label: '!=' },
|
|
20
|
+
{ label: '&&' },
|
|
21
|
+
{ label: '||' },
|
|
22
|
+
];
|
|
23
|
+
exports.connectOpTerms = [{ label: 'and' }, { label: 'or' }];
|
|
24
|
+
// Abs,
|
|
25
|
+
// Ceil,
|
|
26
|
+
// CountDistinct,
|
|
27
|
+
// CountSeries,
|
|
28
|
+
// Derivative,
|
|
29
|
+
// Difference,
|
|
30
|
+
// Distinct,
|
|
31
|
+
// Floor,
|
|
32
|
+
// Rate,
|
|
33
|
+
// Irate,
|
|
34
|
+
// Deriv,
|
|
35
|
+
// Increase,
|
|
36
|
+
// Log,
|
|
37
|
+
// Log10,
|
|
38
|
+
// Log2,
|
|
39
|
+
// Max,
|
|
40
|
+
// Min,
|
|
41
|
+
// Mode,
|
|
42
|
+
// NonNegativeDerivative,
|
|
43
|
+
// NonNegativeDifference,
|
|
44
|
+
// Round,
|
|
45
|
+
// Spread,
|
|
46
|
+
// Stddev,
|
|
47
|
+
// Sum,
|
|
48
|
+
// Schema,
|
|
49
|
+
// DistinctByCollapse,
|
|
50
|
+
// Default,
|
|
51
|
+
// Fill,
|
|
52
|
+
// CountFilter,
|
|
53
|
+
// Count,
|
|
54
|
+
// First,
|
|
55
|
+
// Any,
|
|
56
|
+
// Last,
|
|
57
|
+
// LastRow,
|
|
58
|
+
// Bottom,
|
|
59
|
+
// Top,
|
|
60
|
+
// MovingAverage,
|
|
61
|
+
// Percentile,
|
|
62
|
+
// Median,
|
|
63
|
+
// Set,
|
|
64
|
+
// Int,
|
|
65
|
+
// Float,
|
|
66
|
+
// String,
|
|
67
|
+
// Md5,
|
|
68
|
+
// Histogram,
|
|
69
|
+
// Exists,
|
|
70
|
+
// Cidr,
|
|
71
|
+
// Match,
|
|
72
|
+
// Regex,
|
|
73
|
+
// Re,
|
|
74
|
+
// Regexp,
|
|
75
|
+
// RegexpExtract,
|
|
76
|
+
// RegexpExtractAll,
|
|
77
|
+
// Collect,
|
|
78
|
+
// Concat,
|
|
79
|
+
// Drain,
|
|
80
|
+
// Wildcard,
|
|
81
|
+
// QueryString,
|
|
82
|
+
// Querystring,
|
|
83
|
+
// WithLabels,
|
|
84
|
+
// WithoutLabels,
|
|
85
|
+
// Unwrap,
|
|
86
|
+
// Now,
|
|
87
|
+
// Cumsum,
|
|
88
|
+
// Window,
|
|
89
|
+
// Dbscan,
|
|
90
|
+
// Eval,
|
|
91
|
+
// Avg,
|
|
92
|
+
exports.functionIdentifierTerms = [
|
|
93
|
+
{
|
|
94
|
+
label: 'abs',
|
|
95
|
+
detail: 'function',
|
|
96
|
+
info: 'Return absolute values of input series',
|
|
97
|
+
type: 'function',
|
|
98
|
+
},
|
|
99
|
+
{ label: 'ceil', detail: 'function', info: 'Round up to the nearest integer', type: 'function' },
|
|
100
|
+
{ label: 'count', detail: 'function', info: 'Count the number of elements in a series', type: 'function' },
|
|
101
|
+
{ label: 'count_distinct', detail: 'function', info: 'Count the number of distinct elements in a series', type: 'function' },
|
|
102
|
+
{ label: 'count_series', detail: 'function', info: 'Count the number of series in a query', type: 'function' },
|
|
103
|
+
{ label: 'derivative', detail: 'function', info: 'Calculate the derivative of a series', type: 'function' },
|
|
104
|
+
{ label: 'difference', detail: 'function', info: 'Calculate the difference between consecutive values in a series', type: 'function' },
|
|
105
|
+
{ label: 'distinct', detail: 'function', info: 'Return distinct values from a series', type: 'function' },
|
|
106
|
+
{ label: 'floor', detail: 'function', info: 'Round down to the nearest integer', type: 'function' },
|
|
107
|
+
{ label: 'rate', detail: 'function', info: 'Calculate the per-second rate of increase of a time series', type: 'function' },
|
|
108
|
+
{ label: 'irate', detail: 'function', info: 'Calculate the per-second instant rate of increase of a time series', type: 'function' },
|
|
109
|
+
{
|
|
110
|
+
label: 'deriv',
|
|
111
|
+
detail: 'function',
|
|
112
|
+
info: 'Calculate the derivative of a series',
|
|
113
|
+
type: 'function',
|
|
114
|
+
},
|
|
115
|
+
{ label: 'increase', detail: 'function', info: 'Calculate the increase of a series over a specified time period', type: 'function' },
|
|
116
|
+
{ label: 'log', detail: 'function', info: 'Calculate the natural logarithm of a series', type: 'function' },
|
|
117
|
+
{ label: 'log10', detail: 'function', info: 'Calculate the base-10 logarithm of a series', type: 'function' },
|
|
118
|
+
{ label: 'log2', detail: 'function', info: 'Calculate the base-2 logarithm of a series', type: 'function' },
|
|
119
|
+
{ label: 'max', detail: 'function', info: 'Return the maximum value from a series', type: 'function' },
|
|
120
|
+
{ label: 'min', detail: 'function', info: 'Return the minimum value from a series', type: 'function' },
|
|
121
|
+
{ label: 'mode', detail: 'function', info: 'Return the mode (most frequent value) from a series', type: 'function' },
|
|
122
|
+
{ label: 'non_negative_derivative', detail: 'function', info: 'Calculate the non-negative derivative of a series', type: 'function' },
|
|
123
|
+
{
|
|
124
|
+
label: 'non_negative_difference',
|
|
125
|
+
detail: 'function',
|
|
126
|
+
info: 'Calculate the non-negative difference between consecutive values in a series',
|
|
127
|
+
type: 'function',
|
|
128
|
+
},
|
|
129
|
+
{ label: 'round', detail: 'function', info: 'Round values in a series to the nearest integer', type: 'function' },
|
|
130
|
+
{ label: 'spread', detail: 'function', info: 'Calculate the spread (difference between max and min) of a series', type: 'function' },
|
|
131
|
+
{ label: 'stddev', detail: 'function', info: 'Calculate the standard deviation of a series', type: 'function' },
|
|
132
|
+
{ label: 'sum', detail: 'function', info: 'Calculate the sum of values in a series', type: 'function' },
|
|
133
|
+
{ label: 'schema', detail: 'function', info: 'Return the schema of a series', type: 'function' },
|
|
134
|
+
{ label: 'distinct_by_collapse', detail: 'function', info: 'Collapse a series to distinct values', type: 'function' },
|
|
135
|
+
{ label: 'default', detail: 'function', info: 'Set a default value for a series', type: 'function' },
|
|
136
|
+
{
|
|
137
|
+
label: 'fill',
|
|
138
|
+
detail: 'function',
|
|
139
|
+
info: 'Fill missing values in a series with a specified value',
|
|
140
|
+
type: 'function',
|
|
141
|
+
},
|
|
142
|
+
{ label: 'count_filter', detail: 'function', info: 'Count the number of elements that match a filter in a series', type: 'function' },
|
|
143
|
+
{ label: 'first', detail: 'function', info: 'Return the first value from a series', type: 'function' },
|
|
144
|
+
{ label: 'any', detail: 'function', info: 'Return any value from a series', type: 'function' },
|
|
145
|
+
{ label: 'last', detail: 'function', info: 'Return the last value from a series', type: 'function' },
|
|
146
|
+
{ label: 'last_row', detail: 'function', info: 'Return the last row of a series', type: 'function' },
|
|
147
|
+
{ label: 'bottom', detail: 'function', info: 'Return the bottom N values from a series', type: 'function' },
|
|
148
|
+
{ label: 'top', detail: 'function', info: 'Return the top N values from a series', type: 'function' },
|
|
149
|
+
{ label: 'moving_average', detail: 'function', info: 'Calculate the moving average of a series', type: 'function' },
|
|
150
|
+
{ label: 'percentile', detail: 'function', info: 'Calculate the percentile of a series', type: 'function' },
|
|
151
|
+
{ label: 'median', detail: 'function', info: 'Calculate the median of a series', type: 'function' },
|
|
152
|
+
{ label: 'set', detail: 'function', info: 'Set values in a series based on conditions', type: 'function' },
|
|
153
|
+
{ label: 'int', detail: 'function', info: 'Convert values in a series to integers', type: 'function' },
|
|
154
|
+
{ label: 'float', detail: 'function', info: 'Convert values in a series to floats', type: 'function' },
|
|
155
|
+
{ label: 'string', detail: 'function', info: 'Convert values in a series to strings', type: 'function' },
|
|
156
|
+
{ label: 'md5', detail: 'function', info: 'Calculate the MD5 hash of values in a series', type: 'function' },
|
|
157
|
+
{ label: 'histogram', detail: 'function', info: 'Create a histogram from a series of values', type: 'function' },
|
|
158
|
+
{ label: 'exists', detail: 'function', info: 'Check if a value exists in a series', type: 'function' },
|
|
159
|
+
{ label: 'cidr', detail: ' function', info: ' Check if an IP address is within a CIDR range', type: ' function' },
|
|
160
|
+
{ label: 'match', detail: ' function', info: ' Match values against a pattern', type: ' function' },
|
|
161
|
+
{ label: 'regex', detail: ' function', info: ' Match values against a regular expression', type: ' function' },
|
|
162
|
+
{ label: 're', detail: ' function', info: ' Match values against a regular expression (alias for regex)', type: ' function' },
|
|
163
|
+
{ label: 'regexp_extract', detail: ' function', info: ' Extract substrings from values using regular expressions', type: ' function' },
|
|
164
|
+
{
|
|
165
|
+
label: 'regexp_extract_all',
|
|
166
|
+
detail: 'function',
|
|
167
|
+
info: 'Extract all matching substrings from values using regular expressions',
|
|
168
|
+
type: 'function',
|
|
169
|
+
},
|
|
170
|
+
{ label: 'collect', detail: ' function', info: ' Collect values into a list or array', type: ' function' },
|
|
171
|
+
{ label: 'concat', detail: ' function', info: ' Concatenate values in a series', type: ' function' },
|
|
172
|
+
{ label: 'drain', detail: ' function', info: ' Drain values from a series', type: ' function' },
|
|
173
|
+
{ label: 'wildcard', detail: ' function', info: ' Match values using wildcard patterns', type: ' function' },
|
|
174
|
+
{ label: 'query_string', detail: ' function', info: ' Parse and evaluate a query string', type: ' function' },
|
|
175
|
+
{ label: 'querystring', detail: ' function', info: ' Parse and evaluate a query string (alias for query_string)', type: ' function' },
|
|
176
|
+
{ label: 'with_labels', detail: ' function', info: ' Add labels to a series', type: ' function' },
|
|
177
|
+
{ label: 'without_labels', detail: ' function', info: ' Remove labels from a series', type: ' function' },
|
|
178
|
+
{ label: 'unwrap', detail: ' function', info: ' Unwrap values in a series', type: ' function' },
|
|
179
|
+
{ label: 'now', detail: ' function', info: ' Get the current time or timestamp', type: ' function' },
|
|
180
|
+
{ label: 'cumsum', detail: ' function', info: ' Calculate the cumulative sum of a series', type: ' function' },
|
|
181
|
+
{ label: 'window', detail: ' function', info: ' Create a sliding window over a series of values', type: 'function' },
|
|
182
|
+
{ label: 'dbscan', detail: 'function', info: 'Perform DBSCAN clustering on a series of values', type: 'function' },
|
|
183
|
+
{ label: 'eval', detail: 'function', info: 'Evaluate an expression in the context of a series', type: 'function' },
|
|
184
|
+
{ label: 'avg', detail: 'function', info: 'Calculate the average of a series', type: 'function' },
|
|
185
|
+
];
|
|
186
|
+
exports.snippets = [
|
|
187
|
+
{
|
|
188
|
+
label: "count_filter(__field__, ['__field_value__'])",
|
|
189
|
+
type: 'function',
|
|
190
|
+
detail: 'snippet',
|
|
191
|
+
info: 'Count the number of elements that match a filter in a series',
|
|
192
|
+
apply: (0, autocomplete_1.snippet)("count_filter(${__field__}, ['${__field_value__}'])"),
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
label: 'moving_average(`__field__`, __window_size__)',
|
|
196
|
+
type: 'function',
|
|
197
|
+
detail: 'snippet',
|
|
198
|
+
info: 'Calculate the moving average of a series',
|
|
199
|
+
apply: (0, autocomplete_1.snippet)('moving_average(`${__field__}`, ${__window_size__})'),
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
label: 'histogram(__field__,__start_value__, __end_value__, __interval, __min_doc__)',
|
|
203
|
+
detail: 'snippet',
|
|
204
|
+
info: 'Create a histogram from a series of values',
|
|
205
|
+
type: 'function',
|
|
206
|
+
apply: (0, autocomplete_1.snippet)('histogram(${__field__},${__start_value__}, ${__end_value__}, ${__interval}, ${__min_doc__}))'),
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
//# sourceMappingURL=dql.terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dql.terms.js","sourceRoot":"","sources":["../../../src/complete/dql.terms.ts"],"names":[],"mappings":";;;AAAA,yDAA+D;AAClD,QAAA,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAClI,QAAA,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AACzH,QAAA,UAAU,GAAG;IACxB,EAAE,KAAK,EAAE,GAAG,EAAE;IACd,EAAE,KAAK,EAAE,GAAG,EAAE;IACd,EAAE,KAAK,EAAE,GAAG,EAAE;IACd,E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,EAAE,UAAU,EAAE,IAAI,EAAE,mDAAmD,EAAE,IAAI,EAAE,UAAU,EAAE;IAClH,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,mCAAmC,EAAE,IAAI,EAAE,UAAU,EAAE;CAClG,CAAC;AACW,QAAA,QAAQ,GAA0B;IAC7C;QACE,KAAK,EAAE,8CAA8C;QACrD,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,8DAA8D;QACpE,KAAK,EAAE,IAAA,sBAAO,EAAC,oDAAoD,CAAC;KACrE;IACD;QACE,KAAK,EAAE,8CAA8C;QACrD,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,0CAA0C;QAChD,KAAK,EAAE,IAAA,sBAAO,EAAC,oDAAoD,CAAC;KACrE;IACD;QACE,KAAK,EAAE,8EAA8E;QACrF,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAA,sBAAO,EAAC,8FAA8F,CAAC;KAC/G;CACF,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CompleteStrategy } from './index';
|
|
2
|
+
import { SyntaxNode } from '@lezer/common';
|
|
3
|
+
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
4
|
+
import { EditorState } from '@codemirror/state';
|
|
5
|
+
import { Matcher } from '../types';
|
|
6
|
+
import { DQLClient } from '../client';
|
|
7
|
+
export declare enum ContextKind {
|
|
8
|
+
Namespace = 0,
|
|
9
|
+
Index = 1,
|
|
10
|
+
DataSource = 2,
|
|
11
|
+
ShowFunction = 3,
|
|
12
|
+
FieldName = 4,
|
|
13
|
+
FieldValue = 5,
|
|
14
|
+
Function = 6,
|
|
15
|
+
OuterFunction = 7,
|
|
16
|
+
BinOp = 8,
|
|
17
|
+
MatchOp = 9,
|
|
18
|
+
ConnectOp = 10,
|
|
19
|
+
Duration = 11,
|
|
20
|
+
Offset = 12,
|
|
21
|
+
SOffset = 13,
|
|
22
|
+
Limit = 14,
|
|
23
|
+
SLimit = 15,
|
|
24
|
+
Orderby = 16,
|
|
25
|
+
SOrderby = 17,
|
|
26
|
+
By = 18,
|
|
27
|
+
Number = 19,
|
|
28
|
+
Desc = 20,
|
|
29
|
+
Asc = 21
|
|
30
|
+
}
|
|
31
|
+
export interface Context {
|
|
32
|
+
kind: ContextKind;
|
|
33
|
+
Namespace?: string;
|
|
34
|
+
Index?: string[];
|
|
35
|
+
DataSource?: string[];
|
|
36
|
+
matcher?: Matcher;
|
|
37
|
+
}
|
|
38
|
+
export declare function computeStartCompletePosition(state: EditorState, node: SyntaxNode, pos: number): number;
|
|
39
|
+
export declare function analyzeCompletion(state: EditorState, node: SyntaxNode, pos: number): Context[];
|
|
40
|
+
export declare class HybridComplete implements CompleteStrategy {
|
|
41
|
+
private readonly dqlClient;
|
|
42
|
+
constructor(dqlClient?: DQLClient);
|
|
43
|
+
DQL(context: CompletionContext): Promise<CompletionResult | null> | CompletionResult | null;
|
|
44
|
+
private autocompleteNamespace;
|
|
45
|
+
private autocompleteIndex;
|
|
46
|
+
private autocompleteDataSource;
|
|
47
|
+
private autocompleteShowFuncs;
|
|
48
|
+
private autocompleteFieldNames;
|
|
49
|
+
private autocomplteFieldValues;
|
|
50
|
+
}
|