@elastic/esql 1.8.0 → 2.0.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/lib/ast/mutate/commands/index.d.ts +2 -1
- package/lib/ast/mutate/commands/index.d.ts.map +1 -1
- package/lib/ast/mutate/commands/set/index.d.ts +54 -0
- package/lib/ast/mutate/commands/set/index.d.ts.map +1 -0
- package/lib/index.js +3954 -4002
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +3954 -4002
- package/lib/index.mjs.map +1 -1
- package/lib/parser/antlr/esql_parser.d.ts +57 -68
- package/lib/parser/antlr/esql_parser.d.ts.map +1 -1
- package/lib/parser/antlr/esql_parser_listener.d.ts +0 -11
- package/lib/parser/antlr/esql_parser_listener.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as from from './from';
|
|
2
2
|
import * as limit from './limit';
|
|
3
|
+
import * as set from './set';
|
|
3
4
|
import * as sort from './sort';
|
|
4
5
|
import * as stats from './stats';
|
|
5
6
|
import * as where from './where';
|
|
6
7
|
import * as join from './join';
|
|
7
8
|
import * as rerank from './rerank';
|
|
8
|
-
export { from, limit, sort, stats, where, join, rerank };
|
|
9
|
+
export { from, limit, set, sort, stats, where, join, rerank };
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ast/mutate/commands/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ast/mutate/commands/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ESQLAstQueryExpression, ESQLAstSetHeaderCommand } from '../../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Lists all SET header commands in the query AST.
|
|
4
|
+
*
|
|
5
|
+
* @param ast The root AST node.
|
|
6
|
+
* @returns An iterable of SET header commands.
|
|
7
|
+
*/
|
|
8
|
+
export declare const list: (ast: ESQLAstQueryExpression) => IterableIterator<ESQLAstSetHeaderCommand>;
|
|
9
|
+
/**
|
|
10
|
+
* Finds a SET header command by its setting name.
|
|
11
|
+
*
|
|
12
|
+
* @param ast The root AST node.
|
|
13
|
+
* @param settingName The name of the setting to find (e.g. "unmapped_fields").
|
|
14
|
+
* @returns The matching SET header command, or undefined.
|
|
15
|
+
*/
|
|
16
|
+
export declare const findBySettingName: (ast: ESQLAstQueryExpression, settingName: string) => ESQLAstSetHeaderCommand | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the value of an existing SET setting. Returns the modified header
|
|
19
|
+
* command, or `undefined` if no matching setting was found.
|
|
20
|
+
*
|
|
21
|
+
* @param ast The root AST node.
|
|
22
|
+
* @param settingName The name of the setting to modify.
|
|
23
|
+
* @param value The new value, parsed as an ES|QL expression. For example:
|
|
24
|
+
* - `'"LOAD"'` → string literal `"LOAD"`
|
|
25
|
+
* - `'true'` → boolean literal `TRUE`
|
|
26
|
+
* - `'42'` → integer literal `42`
|
|
27
|
+
* - `'{ "key": "value" }'` → map expression
|
|
28
|
+
* @returns The modified SET header command, or undefined if not found.
|
|
29
|
+
*/
|
|
30
|
+
export declare const update: (ast: ESQLAstQueryExpression, settingName: string, value: string) => ESQLAstSetHeaderCommand | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Updates the value of an existing SET setting, or inserts a new SET header
|
|
33
|
+
* command if the setting does not exist. The new command is inserted as the last
|
|
34
|
+
* command in the header.
|
|
35
|
+
*
|
|
36
|
+
* @param ast The root AST node.
|
|
37
|
+
* @param settingName The name of the setting (e.g. "unmapped_fields").
|
|
38
|
+
* @param value The new value, parsed as an ES|QL expression. For example:
|
|
39
|
+
* - `'"LOAD"'` → string literal `"LOAD"`
|
|
40
|
+
* - `'true'` → boolean literal `TRUE`
|
|
41
|
+
* - `'42'` → integer literal `42`
|
|
42
|
+
* - `'{ "key": "value" }'` → map expression
|
|
43
|
+
* @returns The modified or newly created SET header command.
|
|
44
|
+
*/
|
|
45
|
+
export declare const upsert: (ast: ESQLAstQueryExpression, settingName: string, value: string) => ESQLAstSetHeaderCommand;
|
|
46
|
+
/**
|
|
47
|
+
* Removes a SET header command by its setting name.
|
|
48
|
+
*
|
|
49
|
+
* @param ast The root AST node.
|
|
50
|
+
* @param settingName The name of the setting to remove.
|
|
51
|
+
* @returns The removed SET header command, or undefined if not found.
|
|
52
|
+
*/
|
|
53
|
+
export declare const remove: (ast: ESQLAstQueryExpression, settingName: string) => ESQLAstSetHeaderCommand | undefined;
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ast/mutate/commands/set/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EAIxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GACf,KAAK,sBAAsB,KAC1B,gBAAgB,CAAC,uBAAuB,CAO1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,sBAAsB,EAC3B,aAAa,MAAM,KAClB,uBAAuB,GAAG,SAW5B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,sBAAsB,EAC3B,aAAa,MAAM,EACnB,OAAO,MAAM,KACZ,uBAAuB,GAAG,SAU5B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,sBAAsB,EAC3B,aAAa,MAAM,EACnB,OAAO,MAAM,KACZ,uBAiBF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,sBAAsB,EAC3B,aAAa,MAAM,KAClB,uBAAuB,GAAG,SAS5B,CAAC"}
|