@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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { snippet } from '@codemirror/autocomplete';
|
|
2
|
+
export const durationTerms = [{ label: 'y' }, { label: 'w' }, { label: 'd' }, { label: 'h' }, { label: 'm' }, { label: 's' }, { label: 'ms' }];
|
|
3
|
+
export const matchOpTerms = [{ label: '=' }, { label: '!=' }, { label: '=~' }, { label: '!~' }, { label: 'in' }, { label: 'not in' }];
|
|
4
|
+
export const binOpTerms = [
|
|
5
|
+
{ label: '^' },
|
|
6
|
+
{ label: '*' },
|
|
7
|
+
{ label: '/' },
|
|
8
|
+
{ label: '%' },
|
|
9
|
+
{ label: '+' },
|
|
10
|
+
{ label: '-' },
|
|
11
|
+
{ label: '==' },
|
|
12
|
+
{ label: '>=' },
|
|
13
|
+
{ label: '>' },
|
|
14
|
+
{ label: '<' },
|
|
15
|
+
{ label: '<=' },
|
|
16
|
+
{ label: '!=' },
|
|
17
|
+
{ label: '&&' },
|
|
18
|
+
{ label: '||' },
|
|
19
|
+
];
|
|
20
|
+
export const connectOpTerms = [{ label: 'and' }, { label: 'or' }];
|
|
21
|
+
// Abs,
|
|
22
|
+
// Ceil,
|
|
23
|
+
// CountDistinct,
|
|
24
|
+
// CountSeries,
|
|
25
|
+
// Derivative,
|
|
26
|
+
// Difference,
|
|
27
|
+
// Distinct,
|
|
28
|
+
// Floor,
|
|
29
|
+
// Rate,
|
|
30
|
+
// Irate,
|
|
31
|
+
// Deriv,
|
|
32
|
+
// Increase,
|
|
33
|
+
// Log,
|
|
34
|
+
// Log10,
|
|
35
|
+
// Log2,
|
|
36
|
+
// Max,
|
|
37
|
+
// Min,
|
|
38
|
+
// Mode,
|
|
39
|
+
// NonNegativeDerivative,
|
|
40
|
+
// NonNegativeDifference,
|
|
41
|
+
// Round,
|
|
42
|
+
// Spread,
|
|
43
|
+
// Stddev,
|
|
44
|
+
// Sum,
|
|
45
|
+
// Schema,
|
|
46
|
+
// DistinctByCollapse,
|
|
47
|
+
// Default,
|
|
48
|
+
// Fill,
|
|
49
|
+
// CountFilter,
|
|
50
|
+
// Count,
|
|
51
|
+
// First,
|
|
52
|
+
// Any,
|
|
53
|
+
// Last,
|
|
54
|
+
// LastRow,
|
|
55
|
+
// Bottom,
|
|
56
|
+
// Top,
|
|
57
|
+
// MovingAverage,
|
|
58
|
+
// Percentile,
|
|
59
|
+
// Median,
|
|
60
|
+
// Set,
|
|
61
|
+
// Int,
|
|
62
|
+
// Float,
|
|
63
|
+
// String,
|
|
64
|
+
// Md5,
|
|
65
|
+
// Histogram,
|
|
66
|
+
// Exists,
|
|
67
|
+
// Cidr,
|
|
68
|
+
// Match,
|
|
69
|
+
// Regex,
|
|
70
|
+
// Re,
|
|
71
|
+
// Regexp,
|
|
72
|
+
// RegexpExtract,
|
|
73
|
+
// RegexpExtractAll,
|
|
74
|
+
// Collect,
|
|
75
|
+
// Concat,
|
|
76
|
+
// Drain,
|
|
77
|
+
// Wildcard,
|
|
78
|
+
// QueryString,
|
|
79
|
+
// Querystring,
|
|
80
|
+
// WithLabels,
|
|
81
|
+
// WithoutLabels,
|
|
82
|
+
// Unwrap,
|
|
83
|
+
// Now,
|
|
84
|
+
// Cumsum,
|
|
85
|
+
// Window,
|
|
86
|
+
// Dbscan,
|
|
87
|
+
// Eval,
|
|
88
|
+
// Avg,
|
|
89
|
+
export const functionIdentifierTerms = [
|
|
90
|
+
{
|
|
91
|
+
label: 'abs',
|
|
92
|
+
detail: 'function',
|
|
93
|
+
info: 'Return absolute values of input series',
|
|
94
|
+
type: 'function',
|
|
95
|
+
},
|
|
96
|
+
{ label: 'ceil', detail: 'function', info: 'Round up to the nearest integer', type: 'function' },
|
|
97
|
+
{ label: 'count', detail: 'function', info: 'Count the number of elements in a series', type: 'function' },
|
|
98
|
+
{ label: 'count_distinct', detail: 'function', info: 'Count the number of distinct elements in a series', type: 'function' },
|
|
99
|
+
{ label: 'count_series', detail: 'function', info: 'Count the number of series in a query', type: 'function' },
|
|
100
|
+
{ label: 'derivative', detail: 'function', info: 'Calculate the derivative of a series', type: 'function' },
|
|
101
|
+
{ label: 'difference', detail: 'function', info: 'Calculate the difference between consecutive values in a series', type: 'function' },
|
|
102
|
+
{ label: 'distinct', detail: 'function', info: 'Return distinct values from a series', type: 'function' },
|
|
103
|
+
{ label: 'floor', detail: 'function', info: 'Round down to the nearest integer', type: 'function' },
|
|
104
|
+
{ label: 'rate', detail: 'function', info: 'Calculate the per-second rate of increase of a time series', type: 'function' },
|
|
105
|
+
{ label: 'irate', detail: 'function', info: 'Calculate the per-second instant rate of increase of a time series', type: 'function' },
|
|
106
|
+
{
|
|
107
|
+
label: 'deriv',
|
|
108
|
+
detail: 'function',
|
|
109
|
+
info: 'Calculate the derivative of a series',
|
|
110
|
+
type: 'function',
|
|
111
|
+
},
|
|
112
|
+
{ label: 'increase', detail: 'function', info: 'Calculate the increase of a series over a specified time period', type: 'function' },
|
|
113
|
+
{ label: 'log', detail: 'function', info: 'Calculate the natural logarithm of a series', type: 'function' },
|
|
114
|
+
{ label: 'log10', detail: 'function', info: 'Calculate the base-10 logarithm of a series', type: 'function' },
|
|
115
|
+
{ label: 'log2', detail: 'function', info: 'Calculate the base-2 logarithm of a series', type: 'function' },
|
|
116
|
+
{ label: 'max', detail: 'function', info: 'Return the maximum value from a series', type: 'function' },
|
|
117
|
+
{ label: 'min', detail: 'function', info: 'Return the minimum value from a series', type: 'function' },
|
|
118
|
+
{ label: 'mode', detail: 'function', info: 'Return the mode (most frequent value) from a series', type: 'function' },
|
|
119
|
+
{ label: 'non_negative_derivative', detail: 'function', info: 'Calculate the non-negative derivative of a series', type: 'function' },
|
|
120
|
+
{
|
|
121
|
+
label: 'non_negative_difference',
|
|
122
|
+
detail: 'function',
|
|
123
|
+
info: 'Calculate the non-negative difference between consecutive values in a series',
|
|
124
|
+
type: 'function',
|
|
125
|
+
},
|
|
126
|
+
{ label: 'round', detail: 'function', info: 'Round values in a series to the nearest integer', type: 'function' },
|
|
127
|
+
{ label: 'spread', detail: 'function', info: 'Calculate the spread (difference between max and min) of a series', type: 'function' },
|
|
128
|
+
{ label: 'stddev', detail: 'function', info: 'Calculate the standard deviation of a series', type: 'function' },
|
|
129
|
+
{ label: 'sum', detail: 'function', info: 'Calculate the sum of values in a series', type: 'function' },
|
|
130
|
+
{ label: 'schema', detail: 'function', info: 'Return the schema of a series', type: 'function' },
|
|
131
|
+
{ label: 'distinct_by_collapse', detail: 'function', info: 'Collapse a series to distinct values', type: 'function' },
|
|
132
|
+
{ label: 'default', detail: 'function', info: 'Set a default value for a series', type: 'function' },
|
|
133
|
+
{
|
|
134
|
+
label: 'fill',
|
|
135
|
+
detail: 'function',
|
|
136
|
+
info: 'Fill missing values in a series with a specified value',
|
|
137
|
+
type: 'function',
|
|
138
|
+
},
|
|
139
|
+
{ label: 'count_filter', detail: 'function', info: 'Count the number of elements that match a filter in a series', type: 'function' },
|
|
140
|
+
{ label: 'first', detail: 'function', info: 'Return the first value from a series', type: 'function' },
|
|
141
|
+
{ label: 'any', detail: 'function', info: 'Return any value from a series', type: 'function' },
|
|
142
|
+
{ label: 'last', detail: 'function', info: 'Return the last value from a series', type: 'function' },
|
|
143
|
+
{ label: 'last_row', detail: 'function', info: 'Return the last row of a series', type: 'function' },
|
|
144
|
+
{ label: 'bottom', detail: 'function', info: 'Return the bottom N values from a series', type: 'function' },
|
|
145
|
+
{ label: 'top', detail: 'function', info: 'Return the top N values from a series', type: 'function' },
|
|
146
|
+
{ label: 'moving_average', detail: 'function', info: 'Calculate the moving average of a series', type: 'function' },
|
|
147
|
+
{ label: 'percentile', detail: 'function', info: 'Calculate the percentile of a series', type: 'function' },
|
|
148
|
+
{ label: 'median', detail: 'function', info: 'Calculate the median of a series', type: 'function' },
|
|
149
|
+
{ label: 'set', detail: 'function', info: 'Set values in a series based on conditions', type: 'function' },
|
|
150
|
+
{ label: 'int', detail: 'function', info: 'Convert values in a series to integers', type: 'function' },
|
|
151
|
+
{ label: 'float', detail: 'function', info: 'Convert values in a series to floats', type: 'function' },
|
|
152
|
+
{ label: 'string', detail: 'function', info: 'Convert values in a series to strings', type: 'function' },
|
|
153
|
+
{ label: 'md5', detail: 'function', info: 'Calculate the MD5 hash of values in a series', type: 'function' },
|
|
154
|
+
{ label: 'histogram', detail: 'function', info: 'Create a histogram from a series of values', type: 'function' },
|
|
155
|
+
{ label: 'exists', detail: 'function', info: 'Check if a value exists in a series', type: 'function' },
|
|
156
|
+
{ label: 'cidr', detail: ' function', info: ' Check if an IP address is within a CIDR range', type: ' function' },
|
|
157
|
+
{ label: 'match', detail: ' function', info: ' Match values against a pattern', type: ' function' },
|
|
158
|
+
{ label: 'regex', detail: ' function', info: ' Match values against a regular expression', type: ' function' },
|
|
159
|
+
{ label: 're', detail: ' function', info: ' Match values against a regular expression (alias for regex)', type: ' function' },
|
|
160
|
+
{ label: 'regexp_extract', detail: ' function', info: ' Extract substrings from values using regular expressions', type: ' function' },
|
|
161
|
+
{
|
|
162
|
+
label: 'regexp_extract_all',
|
|
163
|
+
detail: 'function',
|
|
164
|
+
info: 'Extract all matching substrings from values using regular expressions',
|
|
165
|
+
type: 'function',
|
|
166
|
+
},
|
|
167
|
+
{ label: 'collect', detail: ' function', info: ' Collect values into a list or array', type: ' function' },
|
|
168
|
+
{ label: 'concat', detail: ' function', info: ' Concatenate values in a series', type: ' function' },
|
|
169
|
+
{ label: 'drain', detail: ' function', info: ' Drain values from a series', type: ' function' },
|
|
170
|
+
{ label: 'wildcard', detail: ' function', info: ' Match values using wildcard patterns', type: ' function' },
|
|
171
|
+
{ label: 'query_string', detail: ' function', info: ' Parse and evaluate a query string', type: ' function' },
|
|
172
|
+
{ label: 'querystring', detail: ' function', info: ' Parse and evaluate a query string (alias for query_string)', type: ' function' },
|
|
173
|
+
{ label: 'with_labels', detail: ' function', info: ' Add labels to a series', type: ' function' },
|
|
174
|
+
{ label: 'without_labels', detail: ' function', info: ' Remove labels from a series', type: ' function' },
|
|
175
|
+
{ label: 'unwrap', detail: ' function', info: ' Unwrap values in a series', type: ' function' },
|
|
176
|
+
{ label: 'now', detail: ' function', info: ' Get the current time or timestamp', type: ' function' },
|
|
177
|
+
{ label: 'cumsum', detail: ' function', info: ' Calculate the cumulative sum of a series', type: ' function' },
|
|
178
|
+
{ label: 'window', detail: ' function', info: ' Create a sliding window over a series of values', type: 'function' },
|
|
179
|
+
{ label: 'dbscan', detail: 'function', info: 'Perform DBSCAN clustering on a series of values', type: 'function' },
|
|
180
|
+
{ label: 'eval', detail: 'function', info: 'Evaluate an expression in the context of a series', type: 'function' },
|
|
181
|
+
{ label: 'avg', detail: 'function', info: 'Calculate the average of a series', type: 'function' },
|
|
182
|
+
];
|
|
183
|
+
export const snippets = [
|
|
184
|
+
{
|
|
185
|
+
label: "count_filter(__field__, ['__field_value__'])",
|
|
186
|
+
type: 'function',
|
|
187
|
+
detail: 'snippet',
|
|
188
|
+
info: 'Count the number of elements that match a filter in a series',
|
|
189
|
+
apply: snippet("count_filter(${__field__}, ['${__field_value__}'])"),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
label: 'moving_average(`__field__`, __window_size__)',
|
|
193
|
+
type: 'function',
|
|
194
|
+
detail: 'snippet',
|
|
195
|
+
info: 'Calculate the moving average of a series',
|
|
196
|
+
apply: snippet('moving_average(`${__field__}`, ${__window_size__})'),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: 'histogram(__field__,__start_value__, __end_value__, __interval, __min_doc__)',
|
|
200
|
+
detail: 'snippet',
|
|
201
|
+
info: 'Create a histogram from a series of values',
|
|
202
|
+
type: 'function',
|
|
203
|
+
apply: snippet('histogram(${__field__},${__start_value__}, ${__end_value__}, ${__interval}, ${__min_doc__}))'),
|
|
204
|
+
},
|
|
205
|
+
];
|
|
206
|
+
//# sourceMappingURL=dql.terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dql.terms.js","source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ACE,KAAK,EAAE,8CAA8C;QACrD,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,0CAA0C;QAChD,KAAK,EAAE,OAAO,CAAC,oDAAoD,CAAC;KACrE;IACD;QACE,KAAK,EAAE,8EAA8E;QACrF,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,OAAO,CAAC,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
|
+
}
|