@elastic/esql 0.0.1

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.

Potentially problematic release.


This version of @elastic/esql might be problematic. Click here for more details.

Files changed (212) hide show
  1. package/LICENCE.txt +93 -0
  2. package/NOTICE.txt +5 -0
  3. package/README.md +167 -0
  4. package/lib/__tests__/fixtures.d.ts +4 -0
  5. package/lib/__tests__/fixtures.d.ts.map +1 -0
  6. package/lib/ast/builder/builder.d.ts +87 -0
  7. package/lib/ast/builder/builder.d.ts.map +1 -0
  8. package/lib/ast/builder/index.d.ts +3 -0
  9. package/lib/ast/builder/index.d.ts.map +1 -0
  10. package/lib/ast/builder/types.d.ts +18 -0
  11. package/lib/ast/builder/types.d.ts.map +1 -0
  12. package/lib/ast/grouping.d.ts +70 -0
  13. package/lib/ast/grouping.d.ts.map +1 -0
  14. package/lib/ast/index.d.ts +9 -0
  15. package/lib/ast/index.d.ts.map +1 -0
  16. package/lib/ast/is.d.ts +49 -0
  17. package/lib/ast/is.d.ts.map +1 -0
  18. package/lib/ast/location.d.ts +7 -0
  19. package/lib/ast/location.d.ts.map +1 -0
  20. package/lib/ast/mutate/commands/from/index.d.ts +4 -0
  21. package/lib/ast/mutate/commands/from/index.d.ts.map +1 -0
  22. package/lib/ast/mutate/commands/from/metadata.d.ts +63 -0
  23. package/lib/ast/mutate/commands/from/metadata.d.ts.map +1 -0
  24. package/lib/ast/mutate/commands/from/sources.d.ts +9 -0
  25. package/lib/ast/mutate/commands/from/sources.d.ts.map +1 -0
  26. package/lib/ast/mutate/commands/index.d.ts +9 -0
  27. package/lib/ast/mutate/commands/index.d.ts.map +1 -0
  28. package/lib/ast/mutate/commands/join/index.d.ts +17 -0
  29. package/lib/ast/mutate/commands/join/index.d.ts.map +1 -0
  30. package/lib/ast/mutate/commands/limit/index.d.ts +56 -0
  31. package/lib/ast/mutate/commands/limit/index.d.ts.map +1 -0
  32. package/lib/ast/mutate/commands/rerank/index.d.ts +41 -0
  33. package/lib/ast/mutate/commands/rerank/index.d.ts.map +1 -0
  34. package/lib/ast/mutate/commands/sort/index.d.ts +117 -0
  35. package/lib/ast/mutate/commands/sort/index.d.ts.map +1 -0
  36. package/lib/ast/mutate/commands/stats/index.d.ts +17 -0
  37. package/lib/ast/mutate/commands/stats/index.d.ts.map +1 -0
  38. package/lib/ast/mutate/commands/where/index.d.ts +48 -0
  39. package/lib/ast/mutate/commands/where/index.d.ts.map +1 -0
  40. package/lib/ast/mutate/generic/commands/args/index.d.ts +14 -0
  41. package/lib/ast/mutate/generic/commands/args/index.d.ts.map +1 -0
  42. package/lib/ast/mutate/generic/commands/index.d.ts +54 -0
  43. package/lib/ast/mutate/generic/commands/index.d.ts.map +1 -0
  44. package/lib/ast/mutate/generic/commands/options/index.d.ts +38 -0
  45. package/lib/ast/mutate/generic/commands/options/index.d.ts.map +1 -0
  46. package/lib/ast/mutate/generic/index.d.ts +2 -0
  47. package/lib/ast/mutate/generic/index.d.ts.map +1 -0
  48. package/lib/ast/mutate/index.d.ts +5 -0
  49. package/lib/ast/mutate/index.d.ts.map +1 -0
  50. package/lib/ast/mutate/types.d.ts +2 -0
  51. package/lib/ast/mutate/types.d.ts.map +1 -0
  52. package/lib/ast/mutate/util.d.ts +20 -0
  53. package/lib/ast/mutate/util.d.ts.map +1 -0
  54. package/lib/ast/visitor/contexts.d.ts +176 -0
  55. package/lib/ast/visitor/contexts.d.ts.map +1 -0
  56. package/lib/ast/visitor/global_visitor_context.d.ts +77 -0
  57. package/lib/ast/visitor/global_visitor_context.d.ts.map +1 -0
  58. package/lib/ast/visitor/index.d.ts +5 -0
  59. package/lib/ast/visitor/index.d.ts.map +1 -0
  60. package/lib/ast/visitor/types.d.ts +104 -0
  61. package/lib/ast/visitor/types.d.ts.map +1 -0
  62. package/lib/ast/visitor/utils.d.ts +26 -0
  63. package/lib/ast/visitor/utils.d.ts.map +1 -0
  64. package/lib/ast/visitor/visitor.d.ts +79 -0
  65. package/lib/ast/visitor/visitor.d.ts.map +1 -0
  66. package/lib/ast/walker/helpers.d.ts +23 -0
  67. package/lib/ast/walker/helpers.d.ts.map +1 -0
  68. package/lib/ast/walker/index.d.ts +2 -0
  69. package/lib/ast/walker/index.d.ts.map +1 -0
  70. package/lib/ast/walker/walker.d.ts +266 -0
  71. package/lib/ast/walker/walker.d.ts.map +1 -0
  72. package/lib/composer/composer_query.d.ts +684 -0
  73. package/lib/composer/composer_query.d.ts.map +1 -0
  74. package/lib/composer/esql.d.ts +25 -0
  75. package/lib/composer/esql.d.ts.map +1 -0
  76. package/lib/composer/index.d.ts +8 -0
  77. package/lib/composer/index.d.ts.map +1 -0
  78. package/lib/composer/parameter_hole.d.ts +11 -0
  79. package/lib/composer/parameter_hole.d.ts.map +1 -0
  80. package/lib/composer/query/index.d.ts +2 -0
  81. package/lib/composer/query/index.d.ts.map +1 -0
  82. package/lib/composer/query/query.d.ts +54 -0
  83. package/lib/composer/query/query.d.ts.map +1 -0
  84. package/lib/composer/synth/command.d.ts +7 -0
  85. package/lib/composer/synth/command.d.ts.map +1 -0
  86. package/lib/composer/synth/expression.d.ts +6 -0
  87. package/lib/composer/synth/expression.d.ts.map +1 -0
  88. package/lib/composer/synth/header.d.ts +7 -0
  89. package/lib/composer/synth/header.d.ts.map +1 -0
  90. package/lib/composer/synth/holes.d.ts +27 -0
  91. package/lib/composer/synth/holes.d.ts.map +1 -0
  92. package/lib/composer/synth/index.d.ts +7 -0
  93. package/lib/composer/synth/index.d.ts.map +1 -0
  94. package/lib/composer/synth/nodes.d.ts +104 -0
  95. package/lib/composer/synth/nodes.d.ts.map +1 -0
  96. package/lib/composer/synth/query.d.ts +7 -0
  97. package/lib/composer/synth/query.d.ts.map +1 -0
  98. package/lib/composer/synth/synth_literal_fragment.d.ts +19 -0
  99. package/lib/composer/synth/synth_literal_fragment.d.ts.map +1 -0
  100. package/lib/composer/synth/synth_node.d.ts +19 -0
  101. package/lib/composer/synth/synth_node.d.ts.map +1 -0
  102. package/lib/composer/synth/tag.d.ts +4 -0
  103. package/lib/composer/synth/tag.d.ts.map +1 -0
  104. package/lib/composer/synth/types.d.ts +65 -0
  105. package/lib/composer/synth/types.d.ts.map +1 -0
  106. package/lib/composer/types.d.ts +218 -0
  107. package/lib/composer/types.d.ts.map +1 -0
  108. package/lib/composer/util.d.ts +24 -0
  109. package/lib/composer/util.d.ts.map +1 -0
  110. package/lib/debug/index.d.ts +2 -0
  111. package/lib/debug/index.d.ts.map +1 -0
  112. package/lib/debug/print_ast.d.ts +60 -0
  113. package/lib/debug/print_ast.d.ts.map +1 -0
  114. package/lib/embedded_languages/index.d.ts +2 -0
  115. package/lib/embedded_languages/index.d.ts.map +1 -0
  116. package/lib/embedded_languages/promql/ast/builder/builder.d.ts +52 -0
  117. package/lib/embedded_languages/promql/ast/builder/builder.d.ts.map +1 -0
  118. package/lib/embedded_languages/promql/ast/builder/index.d.ts +3 -0
  119. package/lib/embedded_languages/promql/ast/builder/index.d.ts.map +1 -0
  120. package/lib/embedded_languages/promql/ast/builder/types.d.ts +12 -0
  121. package/lib/embedded_languages/promql/ast/builder/types.d.ts.map +1 -0
  122. package/lib/embedded_languages/promql/ast/is.d.ts +3 -0
  123. package/lib/embedded_languages/promql/ast/is.d.ts.map +1 -0
  124. package/lib/embedded_languages/promql/ast/traversal.d.ts +3 -0
  125. package/lib/embedded_languages/promql/ast/traversal.d.ts.map +1 -0
  126. package/lib/embedded_languages/promql/ast/walker/index.d.ts +3 -0
  127. package/lib/embedded_languages/promql/ast/walker/index.d.ts.map +1 -0
  128. package/lib/embedded_languages/promql/ast/walker/types.d.ts +93 -0
  129. package/lib/embedded_languages/promql/ast/walker/types.d.ts.map +1 -0
  130. package/lib/embedded_languages/promql/ast/walker/walker.d.ts +43 -0
  131. package/lib/embedded_languages/promql/ast/walker/walker.d.ts.map +1 -0
  132. package/lib/embedded_languages/promql/index.d.ts +8 -0
  133. package/lib/embedded_languages/promql/index.d.ts.map +1 -0
  134. package/lib/embedded_languages/promql/parser/cst_to_ast_converter.d.ts +48 -0
  135. package/lib/embedded_languages/promql/parser/cst_to_ast_converter.d.ts.map +1 -0
  136. package/lib/embedded_languages/promql/parser/index.d.ts +4 -0
  137. package/lib/embedded_languages/promql/parser/index.d.ts.map +1 -0
  138. package/lib/embedded_languages/promql/parser/parser.d.ts +65 -0
  139. package/lib/embedded_languages/promql/parser/parser.d.ts.map +1 -0
  140. package/lib/embedded_languages/promql/parser/promql_error_listener.d.ts +11 -0
  141. package/lib/embedded_languages/promql/parser/promql_error_listener.d.ts.map +1 -0
  142. package/lib/embedded_languages/promql/pretty_print/basic_pretty_printer.d.ts +65 -0
  143. package/lib/embedded_languages/promql/pretty_print/basic_pretty_printer.d.ts.map +1 -0
  144. package/lib/embedded_languages/promql/pretty_print/helpers.d.ts +34 -0
  145. package/lib/embedded_languages/promql/pretty_print/helpers.d.ts.map +1 -0
  146. package/lib/embedded_languages/promql/pretty_print/index.d.ts +2 -0
  147. package/lib/embedded_languages/promql/pretty_print/index.d.ts.map +1 -0
  148. package/lib/embedded_languages/promql/types.d.ts +355 -0
  149. package/lib/embedded_languages/promql/types.d.ts.map +1 -0
  150. package/lib/index.d.ts +7 -0
  151. package/lib/index.d.ts.map +1 -0
  152. package/lib/index.js +63055 -0
  153. package/lib/index.js.map +1 -0
  154. package/lib/index.mjs +62941 -0
  155. package/lib/index.mjs.map +1 -0
  156. package/lib/parser/antlr/esql_lexer.d.ts +223 -0
  157. package/lib/parser/antlr/esql_lexer.d.ts.map +1 -0
  158. package/lib/parser/antlr/esql_parser.d.ts +1847 -0
  159. package/lib/parser/antlr/esql_parser.d.ts.map +1 -0
  160. package/lib/parser/antlr/esql_parser_listener.d.ts +1634 -0
  161. package/lib/parser/antlr/esql_parser_listener.d.ts.map +1 -0
  162. package/lib/parser/antlr/lexer_config.d.ts +13 -0
  163. package/lib/parser/antlr/lexer_config.d.ts.map +1 -0
  164. package/lib/parser/antlr/parser_config.d.ts +7 -0
  165. package/lib/parser/antlr/parser_config.d.ts.map +1 -0
  166. package/lib/parser/antlr/promql_lexer.d.ts +71 -0
  167. package/lib/parser/antlr/promql_lexer.d.ts.map +1 -0
  168. package/lib/parser/antlr/promql_parser.d.ts +441 -0
  169. package/lib/parser/antlr/promql_parser.d.ts.map +1 -0
  170. package/lib/parser/antlr/promql_parser_listener.d.ts +354 -0
  171. package/lib/parser/antlr/promql_parser_listener.d.ts.map +1 -0
  172. package/lib/parser/core/constants.d.ts +8 -0
  173. package/lib/parser/core/constants.d.ts.map +1 -0
  174. package/lib/parser/core/cst_to_ast_converter.d.ts +262 -0
  175. package/lib/parser/core/cst_to_ast_converter.d.ts.map +1 -0
  176. package/lib/parser/core/decorations.d.ts +29 -0
  177. package/lib/parser/core/decorations.d.ts.map +1 -0
  178. package/lib/parser/core/esql_error_listener.d.ts +8 -0
  179. package/lib/parser/core/esql_error_listener.d.ts.map +1 -0
  180. package/lib/parser/core/helpers.d.ts +9 -0
  181. package/lib/parser/core/helpers.d.ts.map +1 -0
  182. package/lib/parser/core/parser.d.ts +136 -0
  183. package/lib/parser/core/parser.d.ts.map +1 -0
  184. package/lib/parser/core/tokens.d.ts +45 -0
  185. package/lib/parser/core/tokens.d.ts.map +1 -0
  186. package/lib/parser/core/types.d.ts +69 -0
  187. package/lib/parser/core/types.d.ts.map +1 -0
  188. package/lib/parser/index.d.ts +4 -0
  189. package/lib/parser/index.d.ts.map +1 -0
  190. package/lib/pretty_print/__tests__/fixtures.d.ts +5 -0
  191. package/lib/pretty_print/__tests__/fixtures.d.ts.map +1 -0
  192. package/lib/pretty_print/basic_pretty_printer.d.ts +87 -0
  193. package/lib/pretty_print/basic_pretty_printer.d.ts.map +1 -0
  194. package/lib/pretty_print/constants.d.ts +47 -0
  195. package/lib/pretty_print/constants.d.ts.map +1 -0
  196. package/lib/pretty_print/helpers.d.ts +22 -0
  197. package/lib/pretty_print/helpers.d.ts.map +1 -0
  198. package/lib/pretty_print/index.d.ts +4 -0
  199. package/lib/pretty_print/index.d.ts.map +1 -0
  200. package/lib/pretty_print/leaf_printer.d.ts +19 -0
  201. package/lib/pretty_print/leaf_printer.d.ts.map +1 -0
  202. package/lib/pretty_print/utils.d.ts +7 -0
  203. package/lib/pretty_print/utils.d.ts.map +1 -0
  204. package/lib/pretty_print/wrapping_pretty_printer.d.ts +113 -0
  205. package/lib/pretty_print/wrapping_pretty_printer.d.ts.map +1 -0
  206. package/lib/types.d.ts +523 -0
  207. package/lib/types.d.ts.map +1 -0
  208. package/lib/types.js +19 -0
  209. package/lib/types.js.map +1 -0
  210. package/lib/types.mjs +1 -0
  211. package/lib/types.mjs.map +1 -0
  212. package/package.json +98 -0
@@ -0,0 +1,354 @@
1
+ import { ParseTreeListener } from "antlr4";
2
+ import { SingleStatementContext } from "./promql_parser.js";
3
+ import { ValueExpressionContext } from "./promql_parser.js";
4
+ import { SubqueryContext } from "./promql_parser.js";
5
+ import { ParenthesizedContext } from "./promql_parser.js";
6
+ import { ArithmeticBinaryContext } from "./promql_parser.js";
7
+ import { ArithmeticUnaryContext } from "./promql_parser.js";
8
+ import { SubqueryResolutionContext } from "./promql_parser.js";
9
+ import { ValueContext } from "./promql_parser.js";
10
+ import { FunctionContext } from "./promql_parser.js";
11
+ import { FunctionParamsContext } from "./promql_parser.js";
12
+ import { GroupingContext } from "./promql_parser.js";
13
+ import { SelectorContext } from "./promql_parser.js";
14
+ import { SeriesMatcherContext } from "./promql_parser.js";
15
+ import { ModifierContext } from "./promql_parser.js";
16
+ import { LabelListContext } from "./promql_parser.js";
17
+ import { LabelsContext } from "./promql_parser.js";
18
+ import { LabelContext } from "./promql_parser.js";
19
+ import { LabelNameContext } from "./promql_parser.js";
20
+ import { IdentifierContext } from "./promql_parser.js";
21
+ import { EvaluationContext } from "./promql_parser.js";
22
+ import { OffsetContext } from "./promql_parser.js";
23
+ import { DurationContext } from "./promql_parser.js";
24
+ import { AtContext } from "./promql_parser.js";
25
+ import { ConstantContext } from "./promql_parser.js";
26
+ import { DecimalLiteralContext } from "./promql_parser.js";
27
+ import { IntegerLiteralContext } from "./promql_parser.js";
28
+ import { HexLiteralContext } from "./promql_parser.js";
29
+ import { StringContext } from "./promql_parser.js";
30
+ import { TimeValueContext } from "./promql_parser.js";
31
+ import { NonReservedContext } from "./promql_parser.js";
32
+ /**
33
+ * This interface defines a complete listener for a parse tree produced by
34
+ * `promql_parser`.
35
+ */
36
+ export default class promql_parserListener extends ParseTreeListener {
37
+ /**
38
+ * Enter a parse tree produced by `promql_parser.singleStatement`.
39
+ * @param ctx the parse tree
40
+ */
41
+ enterSingleStatement?: (ctx: SingleStatementContext) => void;
42
+ /**
43
+ * Exit a parse tree produced by `promql_parser.singleStatement`.
44
+ * @param ctx the parse tree
45
+ */
46
+ exitSingleStatement?: (ctx: SingleStatementContext) => void;
47
+ /**
48
+ * Enter a parse tree produced by the `valueExpression`
49
+ * labeled alternative in `promql_parser.expression`.
50
+ * @param ctx the parse tree
51
+ */
52
+ enterValueExpression?: (ctx: ValueExpressionContext) => void;
53
+ /**
54
+ * Exit a parse tree produced by the `valueExpression`
55
+ * labeled alternative in `promql_parser.expression`.
56
+ * @param ctx the parse tree
57
+ */
58
+ exitValueExpression?: (ctx: ValueExpressionContext) => void;
59
+ /**
60
+ * Enter a parse tree produced by the `subquery`
61
+ * labeled alternative in `promql_parser.expression`.
62
+ * @param ctx the parse tree
63
+ */
64
+ enterSubquery?: (ctx: SubqueryContext) => void;
65
+ /**
66
+ * Exit a parse tree produced by the `subquery`
67
+ * labeled alternative in `promql_parser.expression`.
68
+ * @param ctx the parse tree
69
+ */
70
+ exitSubquery?: (ctx: SubqueryContext) => void;
71
+ /**
72
+ * Enter a parse tree produced by the `parenthesized`
73
+ * labeled alternative in `promql_parser.expression`.
74
+ * @param ctx the parse tree
75
+ */
76
+ enterParenthesized?: (ctx: ParenthesizedContext) => void;
77
+ /**
78
+ * Exit a parse tree produced by the `parenthesized`
79
+ * labeled alternative in `promql_parser.expression`.
80
+ * @param ctx the parse tree
81
+ */
82
+ exitParenthesized?: (ctx: ParenthesizedContext) => void;
83
+ /**
84
+ * Enter a parse tree produced by the `arithmeticBinary`
85
+ * labeled alternative in `promql_parser.expression`.
86
+ * @param ctx the parse tree
87
+ */
88
+ enterArithmeticBinary?: (ctx: ArithmeticBinaryContext) => void;
89
+ /**
90
+ * Exit a parse tree produced by the `arithmeticBinary`
91
+ * labeled alternative in `promql_parser.expression`.
92
+ * @param ctx the parse tree
93
+ */
94
+ exitArithmeticBinary?: (ctx: ArithmeticBinaryContext) => void;
95
+ /**
96
+ * Enter a parse tree produced by the `arithmeticUnary`
97
+ * labeled alternative in `promql_parser.expression`.
98
+ * @param ctx the parse tree
99
+ */
100
+ enterArithmeticUnary?: (ctx: ArithmeticUnaryContext) => void;
101
+ /**
102
+ * Exit a parse tree produced by the `arithmeticUnary`
103
+ * labeled alternative in `promql_parser.expression`.
104
+ * @param ctx the parse tree
105
+ */
106
+ exitArithmeticUnary?: (ctx: ArithmeticUnaryContext) => void;
107
+ /**
108
+ * Enter a parse tree produced by `promql_parser.subqueryResolution`.
109
+ * @param ctx the parse tree
110
+ */
111
+ enterSubqueryResolution?: (ctx: SubqueryResolutionContext) => void;
112
+ /**
113
+ * Exit a parse tree produced by `promql_parser.subqueryResolution`.
114
+ * @param ctx the parse tree
115
+ */
116
+ exitSubqueryResolution?: (ctx: SubqueryResolutionContext) => void;
117
+ /**
118
+ * Enter a parse tree produced by `promql_parser.value`.
119
+ * @param ctx the parse tree
120
+ */
121
+ enterValue?: (ctx: ValueContext) => void;
122
+ /**
123
+ * Exit a parse tree produced by `promql_parser.value`.
124
+ * @param ctx the parse tree
125
+ */
126
+ exitValue?: (ctx: ValueContext) => void;
127
+ /**
128
+ * Enter a parse tree produced by `promql_parser.function`.
129
+ * @param ctx the parse tree
130
+ */
131
+ enterFunction?: (ctx: FunctionContext) => void;
132
+ /**
133
+ * Exit a parse tree produced by `promql_parser.function`.
134
+ * @param ctx the parse tree
135
+ */
136
+ exitFunction?: (ctx: FunctionContext) => void;
137
+ /**
138
+ * Enter a parse tree produced by `promql_parser.functionParams`.
139
+ * @param ctx the parse tree
140
+ */
141
+ enterFunctionParams?: (ctx: FunctionParamsContext) => void;
142
+ /**
143
+ * Exit a parse tree produced by `promql_parser.functionParams`.
144
+ * @param ctx the parse tree
145
+ */
146
+ exitFunctionParams?: (ctx: FunctionParamsContext) => void;
147
+ /**
148
+ * Enter a parse tree produced by `promql_parser.grouping`.
149
+ * @param ctx the parse tree
150
+ */
151
+ enterGrouping?: (ctx: GroupingContext) => void;
152
+ /**
153
+ * Exit a parse tree produced by `promql_parser.grouping`.
154
+ * @param ctx the parse tree
155
+ */
156
+ exitGrouping?: (ctx: GroupingContext) => void;
157
+ /**
158
+ * Enter a parse tree produced by `promql_parser.selector`.
159
+ * @param ctx the parse tree
160
+ */
161
+ enterSelector?: (ctx: SelectorContext) => void;
162
+ /**
163
+ * Exit a parse tree produced by `promql_parser.selector`.
164
+ * @param ctx the parse tree
165
+ */
166
+ exitSelector?: (ctx: SelectorContext) => void;
167
+ /**
168
+ * Enter a parse tree produced by `promql_parser.seriesMatcher`.
169
+ * @param ctx the parse tree
170
+ */
171
+ enterSeriesMatcher?: (ctx: SeriesMatcherContext) => void;
172
+ /**
173
+ * Exit a parse tree produced by `promql_parser.seriesMatcher`.
174
+ * @param ctx the parse tree
175
+ */
176
+ exitSeriesMatcher?: (ctx: SeriesMatcherContext) => void;
177
+ /**
178
+ * Enter a parse tree produced by `promql_parser.modifier`.
179
+ * @param ctx the parse tree
180
+ */
181
+ enterModifier?: (ctx: ModifierContext) => void;
182
+ /**
183
+ * Exit a parse tree produced by `promql_parser.modifier`.
184
+ * @param ctx the parse tree
185
+ */
186
+ exitModifier?: (ctx: ModifierContext) => void;
187
+ /**
188
+ * Enter a parse tree produced by `promql_parser.labelList`.
189
+ * @param ctx the parse tree
190
+ */
191
+ enterLabelList?: (ctx: LabelListContext) => void;
192
+ /**
193
+ * Exit a parse tree produced by `promql_parser.labelList`.
194
+ * @param ctx the parse tree
195
+ */
196
+ exitLabelList?: (ctx: LabelListContext) => void;
197
+ /**
198
+ * Enter a parse tree produced by `promql_parser.labels`.
199
+ * @param ctx the parse tree
200
+ */
201
+ enterLabels?: (ctx: LabelsContext) => void;
202
+ /**
203
+ * Exit a parse tree produced by `promql_parser.labels`.
204
+ * @param ctx the parse tree
205
+ */
206
+ exitLabels?: (ctx: LabelsContext) => void;
207
+ /**
208
+ * Enter a parse tree produced by `promql_parser.label`.
209
+ * @param ctx the parse tree
210
+ */
211
+ enterLabel?: (ctx: LabelContext) => void;
212
+ /**
213
+ * Exit a parse tree produced by `promql_parser.label`.
214
+ * @param ctx the parse tree
215
+ */
216
+ exitLabel?: (ctx: LabelContext) => void;
217
+ /**
218
+ * Enter a parse tree produced by `promql_parser.labelName`.
219
+ * @param ctx the parse tree
220
+ */
221
+ enterLabelName?: (ctx: LabelNameContext) => void;
222
+ /**
223
+ * Exit a parse tree produced by `promql_parser.labelName`.
224
+ * @param ctx the parse tree
225
+ */
226
+ exitLabelName?: (ctx: LabelNameContext) => void;
227
+ /**
228
+ * Enter a parse tree produced by `promql_parser.identifier`.
229
+ * @param ctx the parse tree
230
+ */
231
+ enterIdentifier?: (ctx: IdentifierContext) => void;
232
+ /**
233
+ * Exit a parse tree produced by `promql_parser.identifier`.
234
+ * @param ctx the parse tree
235
+ */
236
+ exitIdentifier?: (ctx: IdentifierContext) => void;
237
+ /**
238
+ * Enter a parse tree produced by `promql_parser.evaluation`.
239
+ * @param ctx the parse tree
240
+ */
241
+ enterEvaluation?: (ctx: EvaluationContext) => void;
242
+ /**
243
+ * Exit a parse tree produced by `promql_parser.evaluation`.
244
+ * @param ctx the parse tree
245
+ */
246
+ exitEvaluation?: (ctx: EvaluationContext) => void;
247
+ /**
248
+ * Enter a parse tree produced by `promql_parser.offset`.
249
+ * @param ctx the parse tree
250
+ */
251
+ enterOffset?: (ctx: OffsetContext) => void;
252
+ /**
253
+ * Exit a parse tree produced by `promql_parser.offset`.
254
+ * @param ctx the parse tree
255
+ */
256
+ exitOffset?: (ctx: OffsetContext) => void;
257
+ /**
258
+ * Enter a parse tree produced by `promql_parser.duration`.
259
+ * @param ctx the parse tree
260
+ */
261
+ enterDuration?: (ctx: DurationContext) => void;
262
+ /**
263
+ * Exit a parse tree produced by `promql_parser.duration`.
264
+ * @param ctx the parse tree
265
+ */
266
+ exitDuration?: (ctx: DurationContext) => void;
267
+ /**
268
+ * Enter a parse tree produced by `promql_parser.at`.
269
+ * @param ctx the parse tree
270
+ */
271
+ enterAt?: (ctx: AtContext) => void;
272
+ /**
273
+ * Exit a parse tree produced by `promql_parser.at`.
274
+ * @param ctx the parse tree
275
+ */
276
+ exitAt?: (ctx: AtContext) => void;
277
+ /**
278
+ * Enter a parse tree produced by `promql_parser.constant`.
279
+ * @param ctx the parse tree
280
+ */
281
+ enterConstant?: (ctx: ConstantContext) => void;
282
+ /**
283
+ * Exit a parse tree produced by `promql_parser.constant`.
284
+ * @param ctx the parse tree
285
+ */
286
+ exitConstant?: (ctx: ConstantContext) => void;
287
+ /**
288
+ * Enter a parse tree produced by the `decimalLiteral`
289
+ * labeled alternative in `promql_parser.number`.
290
+ * @param ctx the parse tree
291
+ */
292
+ enterDecimalLiteral?: (ctx: DecimalLiteralContext) => void;
293
+ /**
294
+ * Exit a parse tree produced by the `decimalLiteral`
295
+ * labeled alternative in `promql_parser.number`.
296
+ * @param ctx the parse tree
297
+ */
298
+ exitDecimalLiteral?: (ctx: DecimalLiteralContext) => void;
299
+ /**
300
+ * Enter a parse tree produced by the `integerLiteral`
301
+ * labeled alternative in `promql_parser.number`.
302
+ * @param ctx the parse tree
303
+ */
304
+ enterIntegerLiteral?: (ctx: IntegerLiteralContext) => void;
305
+ /**
306
+ * Exit a parse tree produced by the `integerLiteral`
307
+ * labeled alternative in `promql_parser.number`.
308
+ * @param ctx the parse tree
309
+ */
310
+ exitIntegerLiteral?: (ctx: IntegerLiteralContext) => void;
311
+ /**
312
+ * Enter a parse tree produced by the `hexLiteral`
313
+ * labeled alternative in `promql_parser.number`.
314
+ * @param ctx the parse tree
315
+ */
316
+ enterHexLiteral?: (ctx: HexLiteralContext) => void;
317
+ /**
318
+ * Exit a parse tree produced by the `hexLiteral`
319
+ * labeled alternative in `promql_parser.number`.
320
+ * @param ctx the parse tree
321
+ */
322
+ exitHexLiteral?: (ctx: HexLiteralContext) => void;
323
+ /**
324
+ * Enter a parse tree produced by `promql_parser.string`.
325
+ * @param ctx the parse tree
326
+ */
327
+ enterString?: (ctx: StringContext) => void;
328
+ /**
329
+ * Exit a parse tree produced by `promql_parser.string`.
330
+ * @param ctx the parse tree
331
+ */
332
+ exitString?: (ctx: StringContext) => void;
333
+ /**
334
+ * Enter a parse tree produced by `promql_parser.timeValue`.
335
+ * @param ctx the parse tree
336
+ */
337
+ enterTimeValue?: (ctx: TimeValueContext) => void;
338
+ /**
339
+ * Exit a parse tree produced by `promql_parser.timeValue`.
340
+ * @param ctx the parse tree
341
+ */
342
+ exitTimeValue?: (ctx: TimeValueContext) => void;
343
+ /**
344
+ * Enter a parse tree produced by `promql_parser.nonReserved`.
345
+ * @param ctx the parse tree
346
+ */
347
+ enterNonReserved?: (ctx: NonReservedContext) => void;
348
+ /**
349
+ * Exit a parse tree produced by `promql_parser.nonReserved`.
350
+ * @param ctx the parse tree
351
+ */
352
+ exitNonReserved?: (ctx: NonReservedContext) => void;
353
+ }
354
+ //# sourceMappingURL=promql_parser_listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promql_parser_listener.d.ts","sourceRoot":"","sources":["../../../src/parser/antlr/promql_parser_listener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAUzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD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AAgB,KAAK,IAAI,CAAC;IACjD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD"}
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_CHANNEL: number;
2
+ export declare const HIDDEN_CHANNEL: number;
3
+ export declare const HEADER_COMMANDS: Set<string>;
4
+ export declare const SOURCE_COMMANDS: Set<string>;
5
+ export declare const TIME_DURATION_UNITS: Set<string>;
6
+ export declare const DATE_PERIOD_UNITS: Set<string>;
7
+ export declare const TIME_SPAN_UNITS: string[];
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/parser/core/constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,EAAE,MAA+B,CAAC;AAC9D,eAAO,MAAM,cAAc,EAAE,MAA8B,CAAC;AAE5D,eAAO,MAAM,eAAe,aAA2B,CAAC;AACxD,eAAO,MAAM,eAAe,aAAsE,CAAC;AAGnG,eAAO,MAAM,mBAAmB,aAe9B,CAAC;AAGH,eAAO,MAAM,iBAAiB,aAiB5B,CAAC;AAEH,eAAO,MAAM,eAAe,UAAiD,CAAC"}
@@ -0,0 +1,262 @@
1
+ import * as cst from '../antlr/esql_parser';
2
+ import type * as ast from '../../types';
3
+ import type { Parser } from './parser';
4
+ /**
5
+ * Transforms an ANTLR ES|QL Concrete Syntax Tree (CST) into a
6
+ * Kibana Abstract Syntax Tree (AST).
7
+ *
8
+ * Most of the methods in this class are 1-to-1 mapping from CST-to-AST,
9
+ * they are designed to convert specific CST nodes into their
10
+ * corresponding AST nodes.
11
+ */
12
+ export declare class CstToAstConverter {
13
+ protected readonly parser: Parser;
14
+ constructor(parser: Parser);
15
+ private getParserFields;
16
+ private createParserFieldsFromToken;
17
+ private createParserFieldsFromTerminalNode;
18
+ private toIdentifierFromTerminalNode;
19
+ private toIdentifierFromToken;
20
+ private fromParserRuleToUnknown;
21
+ /**
22
+ * Extends `fn.location` to cover all its arguments.
23
+ *
24
+ * @deprecated This should never have been necessary. Function location should be
25
+ * accurately set during parsing or initial AST construction.
26
+ */
27
+ private extendLocationToArgs;
28
+ /**
29
+ * @deprecated Do not use. This method will be removed once
30
+ * `extendLocationToArgs` is removed.
31
+ */
32
+ private walkFunctionStructure;
33
+ fromStatements(ctx: cst.StatementsContext): ast.ESQLAstQueryExpression | undefined;
34
+ fromSingleStatement(ctx: cst.SingleStatementContext): ast.ESQLAstQueryExpression | undefined;
35
+ private fromAnyQuery;
36
+ private fromCompositeQuery;
37
+ private fromSingleCommandQuery;
38
+ private fromQuery;
39
+ private fromAny;
40
+ private fromSubqueryExpression;
41
+ private fromSetCommands;
42
+ private fromSetCommand;
43
+ private fromSetFieldContext;
44
+ private toIdentifierFromContext;
45
+ fromSourceCommand(ctx: cst.SourceCommandContext): ast.ESQLCommand | undefined;
46
+ fromProcessingCommand(ctx: cst.ProcessingCommandContext): ast.ESQLCommand | undefined;
47
+ private createCommand;
48
+ private toOption;
49
+ private fromExplainCommand;
50
+ private fromFromCommand;
51
+ private fromFromCompatibleCommand;
52
+ private fromSubquery;
53
+ private fromRowCommand;
54
+ private fromTimeseriesCommand;
55
+ private fromShowCommand;
56
+ private fromLimitCommand;
57
+ private fromEvalCommand;
58
+ private fromWhereCommand;
59
+ private fromKeepCommand;
60
+ private fromQualifiedNamePatterns;
61
+ private fromStatsCommand;
62
+ private fromStatsLikeCommand;
63
+ private fromAggField;
64
+ private toByOption;
65
+ private fromSortCommand;
66
+ private fromOrderExpressions;
67
+ private fromOrderExpression;
68
+ private fromDropCommand;
69
+ private fromRenameCommand;
70
+ private fromRenameClauses;
71
+ private fromDissectCommand;
72
+ private fromDissectCommandOptions;
73
+ private fromGrokCommand;
74
+ private fromEnrichCommand;
75
+ private toPolicyNameFromEnrichCommand;
76
+ private toOnOptionFromEnrichCommand;
77
+ private toWithOptionFromEnrichCommand;
78
+ private fromMvExpandCommand;
79
+ private fromJoinCommand;
80
+ private fromJoinTarget;
81
+ private fromChangePointCommand;
82
+ private fromCompletionCommand;
83
+ private fromSampleCommand;
84
+ private fromInlinestatsCommand;
85
+ /**
86
+ * Supports two syntax forms:
87
+ * - RERANK "query" ON fields WITH {options}
88
+ * - RERANK target = "query" ON fields WITH {options}
89
+ */
90
+ private fromRerankCommand;
91
+ /**
92
+ * Parses the query text and optional target field assignment.
93
+ * Handles: RERANK [target =] "query" ...
94
+ */
95
+ private parseRerankQuery;
96
+ /**
97
+ * Parses the ON fields list.
98
+ * Handles: ... ON field1, field2 = X(field2, 2)
99
+ */
100
+ private parseRerankOnOption;
101
+ /**
102
+ * Parses WITH parameters as a generic map.
103
+ * Handles: ... WITH {inference_id: "model", scoreColumn: "score", ...}
104
+ */
105
+ private parseRerankWithOption;
106
+ private fromFuseCommand;
107
+ private fromFuseConfigurationItem;
108
+ /**
109
+ * Expanded all forms of the PROMQL command:
110
+ *
111
+ * ```
112
+ * PROMQL query
113
+ * PROMQL ( query )
114
+ * PROMQL name = ( query )
115
+ * PROMQL key1=value1 key2=value2... query
116
+ * PROMQL key1=value1 key2=value2... ( query )
117
+ * PROMQL key1=value1 key2=value2... name = ( query )
118
+ * ```
119
+ */
120
+ private fromPromqlCommand;
121
+ /**
122
+ * Converts promql params to a map with "assignment" representation.
123
+ */
124
+ private fromPromqlParamsToMap;
125
+ /**
126
+ * Converts a single promql param (key=value) to a map entry.
127
+ */
128
+ private fromPromqlParam;
129
+ /**
130
+ * Converts a promql param name to an AST node.
131
+ * Grammar: UNQUOTED_IDENTIFIER | QUOTED_IDENTIFIER | QUOTED_STRING | NAMED_OR_POSITIONAL_PARAM
132
+ */
133
+ private fromPromqlParamName;
134
+ /**
135
+ * Converts a promql param value to an AST node.
136
+ * Grammar: promqlIndexPattern (COMMA promqlIndexPattern)* | QUOTED_IDENTIFIER | NAMED_OR_POSITIONAL_PARAM
137
+ */
138
+ private fromPromqlParamValue;
139
+ private fromPromqlIndexPatternList;
140
+ private fromPromqlIndexPattern;
141
+ private fromPromqlIndexString;
142
+ private fromUnquotedStringContext;
143
+ private toPromqlCommandQuery;
144
+ /**
145
+ * Parses promql query parts into a PromQL AST node.
146
+ */
147
+ private fromPromqlQueryParts;
148
+ private fromForkCommand;
149
+ private fromForkSubQuery;
150
+ private fromMmrCommand;
151
+ private fromMmrQueryVectorParam;
152
+ private fromMmrOnOption;
153
+ private fromMmrLimitOption;
154
+ private fromMmrWithOption;
155
+ private toColumnsFromCommand;
156
+ private extractIdentifiers;
157
+ private wrapIdentifierAsArray;
158
+ /**
159
+ * Converts a terminal node directly to a column AST node.
160
+ * Used for metadata fields where we have terminal nodes instead of parser
161
+ * rule contexts.
162
+ */
163
+ private toColumnFromTerminalNode;
164
+ private toColumns;
165
+ private getMathOperation;
166
+ /**
167
+ * @todo Make it return a single value, not an array.
168
+ */
169
+ private visitValueExpression;
170
+ private fromOperatorExpression;
171
+ private createFakeMultiplyLiteral;
172
+ private getBooleanValue;
173
+ private fromPrimaryExpression;
174
+ private fromPrimaryExpressionStrict;
175
+ private fromCommandNamedParameters;
176
+ private collectInlineCast;
177
+ private fromBooleanExpressions;
178
+ fromBooleanExpression(ctx: cst.BooleanExpressionContext): ast.ESQLAstExpression | undefined;
179
+ fromBooleanExpressionToExpressionOrUnknown(ctx: cst.BooleanExpressionContext): ast.ESQLAstExpression;
180
+ private fromLogicalNot;
181
+ private fromLogicalBinary;
182
+ private fromLogicalIn;
183
+ private fromRegexExpression;
184
+ private fromRegexBooleanExpression;
185
+ private toRegexBinaryExpression;
186
+ private toRegexListExpression;
187
+ private fromIsNull;
188
+ private fromBooleanDefault;
189
+ private visitMatchExpression;
190
+ private visitMatchBooleanExpression;
191
+ private toSource;
192
+ /**
193
+ * Converts selector string context to string literal
194
+ *
195
+ * @todo Re-use {@link toUnquotedString} here.
196
+ */
197
+ private toSelectorString;
198
+ /**
199
+ * Converts UNQUOTED_IDENTIFIER or UNQUOTED_SOURCE to an unquoted string literal.
200
+ */
201
+ private toUnquotedString;
202
+ /**
203
+ * Converts index string (quoted or unquoted) to string literal
204
+ */
205
+ private toIndexString;
206
+ private toColumn;
207
+ private fromQualifiedName;
208
+ private fromQualifiedNamePattern;
209
+ private toColumnStar;
210
+ private isQuoted;
211
+ private fromFuseKeyByFields;
212
+ private fromFields;
213
+ private fromAggFields;
214
+ private fromField;
215
+ private fromFunction;
216
+ private toFunction;
217
+ private toBinaryExpression;
218
+ private fromMapExpression;
219
+ private fromMapEntryExpression;
220
+ private fromConstant;
221
+ private fromConstantStrict;
222
+ /**
223
+ * @todo Make return type more specific.
224
+ * @todo Make it not return arrays.
225
+ */
226
+ private fromConstantToArray;
227
+ /**
228
+ * @deprecated
229
+ * @todo This method should not exist, the two call sites should be replaced
230
+ * by a more specific implementation.
231
+ */
232
+ private toLiteral;
233
+ private toNumericLiteral;
234
+ private fromNumericValue;
235
+ private fromStringOrParameter;
236
+ private toStringLiteral;
237
+ private fromParameter;
238
+ private fromInputParameter;
239
+ private toParam;
240
+ private fromNumericArrayLiteral;
241
+ private fromBooleanArrayLiteral;
242
+ private fromStringArrayLiteral;
243
+ /**
244
+ * Constructs a *tuple* `list` AST node (round parens):
245
+ *
246
+ * ```
247
+ * (1, 2, 3)
248
+ * ```
249
+ *
250
+ * Can be used in IN-expression:
251
+ *
252
+ * ```
253
+ * WHERE x IN (1, 2, 3)
254
+ * ```
255
+ */
256
+ private toTuple;
257
+ private fromQualifiedIntegerLiteral;
258
+ private fromIdentifierOrParam;
259
+ private fromIdentifier;
260
+ private fromNodeToIdentifier;
261
+ }
262
+ //# sourceMappingURL=cst_to_ast_converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cst_to_ast_converter.d.ts","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B;IAO9B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,OAAO;IAgDf,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,oBAAoB;CAe7B"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module
3
+ * @description Decorations are comments and extra whitespace lines that can
4
+ * be optionally collected and attached to the AST nodes.
5
+ */
6
+ import type { Token } from 'antlr4';
7
+ import { type CommonTokenStream } from 'antlr4';
8
+ import type { ESQLAstComment, ESQLAstQueryExpression } from '../../types';
9
+ import type { ParsedFormattingDecorationLines } from './types';
10
+ /**
11
+ * Collects *decorations* (all comments and whitespace of interest) from the
12
+ * token stream.
13
+ *
14
+ * @param tokens Lexer token stream
15
+ * @returns List of comments found in the token stream
16
+ */
17
+ export declare const collectDecorations: (tokens: CommonTokenStream) => {
18
+ comments: ESQLAstComment[];
19
+ lines: ParsedFormattingDecorationLines;
20
+ };
21
+ /**
22
+ * Walks through the AST and - for each decoration - attaches it to the
23
+ * appropriate AST node, which is determined by the layout of the source text.
24
+ *
25
+ * @param ast AST to attach comments to.
26
+ * @param comments List of comments to attach to the AST.
27
+ */
28
+ export declare const attachDecorations: (ast: ESQLAstQueryExpression, tokens: Token[], lines: ParsedFormattingDecorationLines) => void;
29
+ //# sourceMappingURL=decorations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorations.d.ts","sourceRoot":"","sources":["../../../src/parser/core/decorations.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,KAAK,EACV,cAAc,EAId,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAGV,+BAA+B,EAChC,MAAM,SAAS,CAAC;AA0BjB;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,iBAAiB,KACxB;IAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,+BAA+B,CAAA;CAmFtE,CAAC;AAkHF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,sBAAsB,EAC3B,QAAQ,KAAK,EAAE,EACf,OAAO,+BAA+B,SAYvC,CAAC"}