@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.
- package/LICENCE.txt +93 -0
- package/NOTICE.txt +5 -0
- package/README.md +167 -0
- package/lib/__tests__/fixtures.d.ts +4 -0
- package/lib/__tests__/fixtures.d.ts.map +1 -0
- package/lib/ast/builder/builder.d.ts +87 -0
- package/lib/ast/builder/builder.d.ts.map +1 -0
- package/lib/ast/builder/index.d.ts +3 -0
- package/lib/ast/builder/index.d.ts.map +1 -0
- package/lib/ast/builder/types.d.ts +18 -0
- package/lib/ast/builder/types.d.ts.map +1 -0
- package/lib/ast/grouping.d.ts +70 -0
- package/lib/ast/grouping.d.ts.map +1 -0
- package/lib/ast/index.d.ts +9 -0
- package/lib/ast/index.d.ts.map +1 -0
- package/lib/ast/is.d.ts +49 -0
- package/lib/ast/is.d.ts.map +1 -0
- package/lib/ast/location.d.ts +7 -0
- package/lib/ast/location.d.ts.map +1 -0
- package/lib/ast/mutate/commands/from/index.d.ts +4 -0
- package/lib/ast/mutate/commands/from/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/from/metadata.d.ts +63 -0
- package/lib/ast/mutate/commands/from/metadata.d.ts.map +1 -0
- package/lib/ast/mutate/commands/from/sources.d.ts +9 -0
- package/lib/ast/mutate/commands/from/sources.d.ts.map +1 -0
- package/lib/ast/mutate/commands/index.d.ts +9 -0
- package/lib/ast/mutate/commands/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/join/index.d.ts +17 -0
- package/lib/ast/mutate/commands/join/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/limit/index.d.ts +56 -0
- package/lib/ast/mutate/commands/limit/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/rerank/index.d.ts +41 -0
- package/lib/ast/mutate/commands/rerank/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/sort/index.d.ts +117 -0
- package/lib/ast/mutate/commands/sort/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/stats/index.d.ts +17 -0
- package/lib/ast/mutate/commands/stats/index.d.ts.map +1 -0
- package/lib/ast/mutate/commands/where/index.d.ts +48 -0
- package/lib/ast/mutate/commands/where/index.d.ts.map +1 -0
- package/lib/ast/mutate/generic/commands/args/index.d.ts +14 -0
- package/lib/ast/mutate/generic/commands/args/index.d.ts.map +1 -0
- package/lib/ast/mutate/generic/commands/index.d.ts +54 -0
- package/lib/ast/mutate/generic/commands/index.d.ts.map +1 -0
- package/lib/ast/mutate/generic/commands/options/index.d.ts +38 -0
- package/lib/ast/mutate/generic/commands/options/index.d.ts.map +1 -0
- package/lib/ast/mutate/generic/index.d.ts +2 -0
- package/lib/ast/mutate/generic/index.d.ts.map +1 -0
- package/lib/ast/mutate/index.d.ts +5 -0
- package/lib/ast/mutate/index.d.ts.map +1 -0
- package/lib/ast/mutate/types.d.ts +2 -0
- package/lib/ast/mutate/types.d.ts.map +1 -0
- package/lib/ast/mutate/util.d.ts +20 -0
- package/lib/ast/mutate/util.d.ts.map +1 -0
- package/lib/ast/visitor/contexts.d.ts +176 -0
- package/lib/ast/visitor/contexts.d.ts.map +1 -0
- package/lib/ast/visitor/global_visitor_context.d.ts +77 -0
- package/lib/ast/visitor/global_visitor_context.d.ts.map +1 -0
- package/lib/ast/visitor/index.d.ts +5 -0
- package/lib/ast/visitor/index.d.ts.map +1 -0
- package/lib/ast/visitor/types.d.ts +104 -0
- package/lib/ast/visitor/types.d.ts.map +1 -0
- package/lib/ast/visitor/utils.d.ts +26 -0
- package/lib/ast/visitor/utils.d.ts.map +1 -0
- package/lib/ast/visitor/visitor.d.ts +79 -0
- package/lib/ast/visitor/visitor.d.ts.map +1 -0
- package/lib/ast/walker/helpers.d.ts +23 -0
- package/lib/ast/walker/helpers.d.ts.map +1 -0
- package/lib/ast/walker/index.d.ts +2 -0
- package/lib/ast/walker/index.d.ts.map +1 -0
- package/lib/ast/walker/walker.d.ts +266 -0
- package/lib/ast/walker/walker.d.ts.map +1 -0
- package/lib/composer/composer_query.d.ts +684 -0
- package/lib/composer/composer_query.d.ts.map +1 -0
- package/lib/composer/esql.d.ts +25 -0
- package/lib/composer/esql.d.ts.map +1 -0
- package/lib/composer/index.d.ts +8 -0
- package/lib/composer/index.d.ts.map +1 -0
- package/lib/composer/parameter_hole.d.ts +11 -0
- package/lib/composer/parameter_hole.d.ts.map +1 -0
- package/lib/composer/query/index.d.ts +2 -0
- package/lib/composer/query/index.d.ts.map +1 -0
- package/lib/composer/query/query.d.ts +54 -0
- package/lib/composer/query/query.d.ts.map +1 -0
- package/lib/composer/synth/command.d.ts +7 -0
- package/lib/composer/synth/command.d.ts.map +1 -0
- package/lib/composer/synth/expression.d.ts +6 -0
- package/lib/composer/synth/expression.d.ts.map +1 -0
- package/lib/composer/synth/header.d.ts +7 -0
- package/lib/composer/synth/header.d.ts.map +1 -0
- package/lib/composer/synth/holes.d.ts +27 -0
- package/lib/composer/synth/holes.d.ts.map +1 -0
- package/lib/composer/synth/index.d.ts +7 -0
- package/lib/composer/synth/index.d.ts.map +1 -0
- package/lib/composer/synth/nodes.d.ts +104 -0
- package/lib/composer/synth/nodes.d.ts.map +1 -0
- package/lib/composer/synth/query.d.ts +7 -0
- package/lib/composer/synth/query.d.ts.map +1 -0
- package/lib/composer/synth/synth_literal_fragment.d.ts +19 -0
- package/lib/composer/synth/synth_literal_fragment.d.ts.map +1 -0
- package/lib/composer/synth/synth_node.d.ts +19 -0
- package/lib/composer/synth/synth_node.d.ts.map +1 -0
- package/lib/composer/synth/tag.d.ts +4 -0
- package/lib/composer/synth/tag.d.ts.map +1 -0
- package/lib/composer/synth/types.d.ts +65 -0
- package/lib/composer/synth/types.d.ts.map +1 -0
- package/lib/composer/types.d.ts +218 -0
- package/lib/composer/types.d.ts.map +1 -0
- package/lib/composer/util.d.ts +24 -0
- package/lib/composer/util.d.ts.map +1 -0
- package/lib/debug/index.d.ts +2 -0
- package/lib/debug/index.d.ts.map +1 -0
- package/lib/debug/print_ast.d.ts +60 -0
- package/lib/debug/print_ast.d.ts.map +1 -0
- package/lib/embedded_languages/index.d.ts +2 -0
- package/lib/embedded_languages/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/builder/builder.d.ts +52 -0
- package/lib/embedded_languages/promql/ast/builder/builder.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/builder/index.d.ts +3 -0
- package/lib/embedded_languages/promql/ast/builder/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/builder/types.d.ts +12 -0
- package/lib/embedded_languages/promql/ast/builder/types.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/is.d.ts +3 -0
- package/lib/embedded_languages/promql/ast/is.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/traversal.d.ts +3 -0
- package/lib/embedded_languages/promql/ast/traversal.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/walker/index.d.ts +3 -0
- package/lib/embedded_languages/promql/ast/walker/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/walker/types.d.ts +93 -0
- package/lib/embedded_languages/promql/ast/walker/types.d.ts.map +1 -0
- package/lib/embedded_languages/promql/ast/walker/walker.d.ts +43 -0
- package/lib/embedded_languages/promql/ast/walker/walker.d.ts.map +1 -0
- package/lib/embedded_languages/promql/index.d.ts +8 -0
- package/lib/embedded_languages/promql/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/parser/cst_to_ast_converter.d.ts +48 -0
- package/lib/embedded_languages/promql/parser/cst_to_ast_converter.d.ts.map +1 -0
- package/lib/embedded_languages/promql/parser/index.d.ts +4 -0
- package/lib/embedded_languages/promql/parser/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/parser/parser.d.ts +65 -0
- package/lib/embedded_languages/promql/parser/parser.d.ts.map +1 -0
- package/lib/embedded_languages/promql/parser/promql_error_listener.d.ts +11 -0
- package/lib/embedded_languages/promql/parser/promql_error_listener.d.ts.map +1 -0
- package/lib/embedded_languages/promql/pretty_print/basic_pretty_printer.d.ts +65 -0
- package/lib/embedded_languages/promql/pretty_print/basic_pretty_printer.d.ts.map +1 -0
- package/lib/embedded_languages/promql/pretty_print/helpers.d.ts +34 -0
- package/lib/embedded_languages/promql/pretty_print/helpers.d.ts.map +1 -0
- package/lib/embedded_languages/promql/pretty_print/index.d.ts +2 -0
- package/lib/embedded_languages/promql/pretty_print/index.d.ts.map +1 -0
- package/lib/embedded_languages/promql/types.d.ts +355 -0
- package/lib/embedded_languages/promql/types.d.ts.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +63055 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +62941 -0
- package/lib/index.mjs.map +1 -0
- package/lib/parser/antlr/esql_lexer.d.ts +223 -0
- package/lib/parser/antlr/esql_lexer.d.ts.map +1 -0
- package/lib/parser/antlr/esql_parser.d.ts +1847 -0
- package/lib/parser/antlr/esql_parser.d.ts.map +1 -0
- package/lib/parser/antlr/esql_parser_listener.d.ts +1634 -0
- package/lib/parser/antlr/esql_parser_listener.d.ts.map +1 -0
- package/lib/parser/antlr/lexer_config.d.ts +13 -0
- package/lib/parser/antlr/lexer_config.d.ts.map +1 -0
- package/lib/parser/antlr/parser_config.d.ts +7 -0
- package/lib/parser/antlr/parser_config.d.ts.map +1 -0
- package/lib/parser/antlr/promql_lexer.d.ts +71 -0
- package/lib/parser/antlr/promql_lexer.d.ts.map +1 -0
- package/lib/parser/antlr/promql_parser.d.ts +441 -0
- package/lib/parser/antlr/promql_parser.d.ts.map +1 -0
- package/lib/parser/antlr/promql_parser_listener.d.ts +354 -0
- package/lib/parser/antlr/promql_parser_listener.d.ts.map +1 -0
- package/lib/parser/core/constants.d.ts +8 -0
- package/lib/parser/core/constants.d.ts.map +1 -0
- package/lib/parser/core/cst_to_ast_converter.d.ts +262 -0
- package/lib/parser/core/cst_to_ast_converter.d.ts.map +1 -0
- package/lib/parser/core/decorations.d.ts +29 -0
- package/lib/parser/core/decorations.d.ts.map +1 -0
- package/lib/parser/core/esql_error_listener.d.ts +8 -0
- package/lib/parser/core/esql_error_listener.d.ts.map +1 -0
- package/lib/parser/core/helpers.d.ts +9 -0
- package/lib/parser/core/helpers.d.ts.map +1 -0
- package/lib/parser/core/parser.d.ts +136 -0
- package/lib/parser/core/parser.d.ts.map +1 -0
- package/lib/parser/core/tokens.d.ts +45 -0
- package/lib/parser/core/tokens.d.ts.map +1 -0
- package/lib/parser/core/types.d.ts +69 -0
- package/lib/parser/core/types.d.ts.map +1 -0
- package/lib/parser/index.d.ts +4 -0
- package/lib/parser/index.d.ts.map +1 -0
- package/lib/pretty_print/__tests__/fixtures.d.ts +5 -0
- package/lib/pretty_print/__tests__/fixtures.d.ts.map +1 -0
- package/lib/pretty_print/basic_pretty_printer.d.ts +87 -0
- package/lib/pretty_print/basic_pretty_printer.d.ts.map +1 -0
- package/lib/pretty_print/constants.d.ts +47 -0
- package/lib/pretty_print/constants.d.ts.map +1 -0
- package/lib/pretty_print/helpers.d.ts +22 -0
- package/lib/pretty_print/helpers.d.ts.map +1 -0
- package/lib/pretty_print/index.d.ts +4 -0
- package/lib/pretty_print/index.d.ts.map +1 -0
- package/lib/pretty_print/leaf_printer.d.ts +19 -0
- package/lib/pretty_print/leaf_printer.d.ts.map +1 -0
- package/lib/pretty_print/utils.d.ts +7 -0
- package/lib/pretty_print/utils.d.ts.map +1 -0
- package/lib/pretty_print/wrapping_pretty_printer.d.ts +113 -0
- package/lib/pretty_print/wrapping_pretty_printer.d.ts.map +1 -0
- package/lib/types.d.ts +523 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +19 -0
- package/lib/types.js.map +1 -0
- package/lib/types.mjs +1 -0
- package/lib/types.mjs.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComposerQueryGenerator, ComposerQueryTag, ComposerQueryTagMethods, ParametrizedComposerQueryTag } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* ESQL query composer tag function.
|
|
4
|
+
*
|
|
5
|
+
* This function allows you to create ESQL queries using template literals.
|
|
6
|
+
* It supports both static and dynamic inputs, but it is designed to provide
|
|
7
|
+
* safe and structured query construction with dynamic parameters.
|
|
8
|
+
*
|
|
9
|
+
* Basic example:
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const inputFromUser = 42;
|
|
13
|
+
* const query = esql`FROM index | WHERE foo > ${inputFromUser} | LIMIT 10`;
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param templateOrQuery The ESQL query template or a string representing the query.
|
|
17
|
+
* @param holes The dynamic values to be interpolated into the query.
|
|
18
|
+
* @returns A ComposerQuery instance representing the constructed ESQL query.
|
|
19
|
+
*/
|
|
20
|
+
export declare const esql: ComposerQueryTag & ParametrizedComposerQueryTag & ComposerQueryGenerator & ComposerQueryTagMethods;
|
|
21
|
+
/**
|
|
22
|
+
* Alias for {@link esql} for convenience.
|
|
23
|
+
*/
|
|
24
|
+
export declare const e: ComposerQueryTag & ParametrizedComposerQueryTag & ComposerQueryGenerator & ComposerQueryTagMethods;
|
|
25
|
+
//# sourceMappingURL=esql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esql.d.ts","sourceRoot":"","sources":["../../src/composer/esql.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,sBAAsB,EACtB,gBAAgB,EAEhB,uBAAuB,EAIvB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AA8JjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,IAAI,EAAE,gBAAgB,GACjC,4BAA4B,GAC5B,sBAAsB,GACtB,uBAmCD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,CAAC,oGAAO,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from './types';
|
|
2
|
+
export { esql, e } from './esql';
|
|
3
|
+
export { ComposerQuery } from './composer_query';
|
|
4
|
+
export { ParameterHole } from './parameter_hole';
|
|
5
|
+
export * as synth from './synth';
|
|
6
|
+
export { qry, cmd, exp } from './synth';
|
|
7
|
+
export { EsqlQuery } from './query';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composer/index.ts"],"names":[],"mappings":"AAOA,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class ParameterHole {
|
|
2
|
+
value: unknown;
|
|
3
|
+
name?: string | undefined;
|
|
4
|
+
constructor(value: unknown, name?: string | undefined);
|
|
5
|
+
}
|
|
6
|
+
export declare class DoubleParameterHole {
|
|
7
|
+
value: unknown;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
constructor(value: unknown, name?: string | undefined);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=parameter_hole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter_hole.d.ts","sourceRoot":"","sources":["../../src/composer/parameter_hole.ts"],"names":[],"mappings":"AAOA,qBAAa,aAAa;IAEf,KAAK,EAAE,OAAO;IACd,IAAI,CAAC,EAAE,MAAM;gBADb,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAEvB;AAED,qBAAa,mBAAmB;IAErB,KAAK,EAAE,OAAO;IACd,IAAI,CAAC,EAAE,MAAM;gBADb,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAEvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composer/query/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Token } from 'antlr4';
|
|
2
|
+
import type { ParseOptions } from '../../parser';
|
|
3
|
+
import type { ESQLAstQueryExpression, EditorError } from '../../types';
|
|
4
|
+
import type { WrappingPrettyPrinterOptions } from '../../pretty_print/wrapping_pretty_printer';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a parsed or programmatically created ES|QL query. Keeps track of
|
|
7
|
+
* the AST, source code, and optionally lexer tokens.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EsqlQuery {
|
|
10
|
+
/**
|
|
11
|
+
* The parsed or programmatically created ES|QL AST. The AST is the only
|
|
12
|
+
* required property for the query and is the source of truth for the query.
|
|
13
|
+
*/
|
|
14
|
+
readonly ast: ESQLAstQueryExpression;
|
|
15
|
+
/**
|
|
16
|
+
* Optional source code that was used to generate the AST. Provide this
|
|
17
|
+
* if the query was created from a parsed source code. Otherwise, set to
|
|
18
|
+
* an empty string.
|
|
19
|
+
*/
|
|
20
|
+
readonly src: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional array of ANTLR tokens, in case the query was parsed from
|
|
23
|
+
* source text.
|
|
24
|
+
*/
|
|
25
|
+
readonly tokens: Token[];
|
|
26
|
+
/**
|
|
27
|
+
* Parsing errors.
|
|
28
|
+
*/
|
|
29
|
+
readonly errors: EditorError[];
|
|
30
|
+
static readonly fromSrc: (src: string, opts?: ParseOptions) => EsqlQuery;
|
|
31
|
+
constructor(
|
|
32
|
+
/**
|
|
33
|
+
* The parsed or programmatically created ES|QL AST. The AST is the only
|
|
34
|
+
* required property for the query and is the source of truth for the query.
|
|
35
|
+
*/
|
|
36
|
+
ast: ESQLAstQueryExpression,
|
|
37
|
+
/**
|
|
38
|
+
* Optional source code that was used to generate the AST. Provide this
|
|
39
|
+
* if the query was created from a parsed source code. Otherwise, set to
|
|
40
|
+
* an empty string.
|
|
41
|
+
*/
|
|
42
|
+
src?: string,
|
|
43
|
+
/**
|
|
44
|
+
* Optional array of ANTLR tokens, in case the query was parsed from
|
|
45
|
+
* source text.
|
|
46
|
+
*/
|
|
47
|
+
tokens?: Token[],
|
|
48
|
+
/**
|
|
49
|
+
* Parsing errors.
|
|
50
|
+
*/
|
|
51
|
+
errors?: EditorError[]);
|
|
52
|
+
print(opts?: WrappingPrettyPrinterOptions): string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/composer/query/query.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAG/F;;;GAGG;AACH,qBAAa,SAAS;IAQlB;;;OAGG;aACa,GAAG,EAAE,sBAAsB;IAE3C;;;;OAIG;aACa,GAAG,EAAE,MAAM;IAE3B;;;OAGG;aACa,MAAM,EAAE,KAAK,EAAE;IAE/B;;OAEG;aACa,MAAM,EAAE,WAAW,EAAE;IA7BvC,gBAAuB,OAAO,GAAI,KAAK,MAAM,EAAE,OAAO,YAAY,KAAG,SAAS,CAI5E;;IAGA;;;OAGG;IACa,GAAG,EAAE,sBAAsB;IAE3C;;;;OAIG;IACa,GAAG,GAAE,MAAW;IAEhC;;;OAGG;IACa,MAAM,GAAE,KAAK,EAAO;IAEpC;;OAEG;IACa,MAAM,GAAE,WAAW,EAAO;IAGrC,KAAK,CAAC,IAAI,CAAC,EAAE,4BAA4B,GAAG,MAAM;CAI1D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ESQLCommand } from '../../types';
|
|
2
|
+
export declare const command: import("./types").SynthMethod<ESQLCommand<string>>;
|
|
3
|
+
/**
|
|
4
|
+
* Short 3-letter alias for DX convenience.
|
|
5
|
+
*/
|
|
6
|
+
export declare const cmd: import("./types").SynthMethod<ESQLCommand<string>>;
|
|
7
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/command.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB/C,eAAO,MAAM,OAAO,oDAAoC,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,GAAG,oDAAU,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const expression: import("./types").SynthMethod<import("../../types").ESQLSingleAstItem>;
|
|
2
|
+
/**
|
|
3
|
+
* Short 3-letter alias for DX convenience.
|
|
4
|
+
*/
|
|
5
|
+
export declare const exp: import("./types").SynthMethod<import("../../types").ESQLSingleAstItem>;
|
|
6
|
+
//# sourceMappingURL=expression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/expression.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,UAAU,wEAA0C,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,GAAG,wEAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ESQLAstHeaderCommand } from '../../types';
|
|
2
|
+
export declare const header: import("./types").SynthMethod<ESQLAstHeaderCommand<string, import("../../types").ESQLSingleAstItem>>;
|
|
3
|
+
/**
|
|
4
|
+
* Short 3-letter alias for DX convenience.
|
|
5
|
+
*/
|
|
6
|
+
export declare const hdr: import("./types").SynthMethod<ESQLAstHeaderCommand<string, import("../../types").ESQLSingleAstItem>>;
|
|
7
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/header.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAiBxD,eAAO,MAAM,MAAM,sGAA6C,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,GAAG,sGAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SynthQualifiedColumnShorthand, SynthTemplateHole } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Identifies qualified column shorthand tuples.
|
|
4
|
+
* ['qualifier', ['fieldName']]
|
|
5
|
+
* ['qualifier', ['fieldPart1', 'fieldPart2']]
|
|
6
|
+
* @param hole
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const isQualifiedColumnShorthand: (hole: unknown) => hole is SynthQualifiedColumnShorthand;
|
|
10
|
+
/**
|
|
11
|
+
* Converts a synth template hole to a string fragment. A *hole" in a tagged
|
|
12
|
+
* template is JavaScript value, which is returned as-is, during the template
|
|
13
|
+
* execution:
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* tag `SELECT * FROM table WHERE id = ${hole}`;
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* In the above example, the `hole` value is fed into the `tag` function as-is
|
|
20
|
+
* (it is not converted to a string). This function is used to convert the
|
|
21
|
+
* hole to a string fragment, which can be used in the query string.
|
|
22
|
+
*
|
|
23
|
+
* @param hole The hole to convert to a string fragment.
|
|
24
|
+
* @returns A string representation of the hole.
|
|
25
|
+
*/
|
|
26
|
+
export declare const holeToFragment: (hole: SynthTemplateHole) => string;
|
|
27
|
+
//# sourceMappingURL=holes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holes.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/holes.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,6BAA6B,EAC7B,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAYjB;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,OAAO,KACZ,IAAI,IAAI,6BAOV,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,iBAAiB,KAAG,MAyDxD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type * from './types';
|
|
2
|
+
export { exp, expression } from './expression';
|
|
3
|
+
export { cmd, command } from './command';
|
|
4
|
+
export { qry, query } from './query';
|
|
5
|
+
export { hdr, header } from './header';
|
|
6
|
+
export * from './nodes';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/index.ts"],"names":[],"mappings":"AAOA,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ESQLColumn, ESQLDecimalLiteral, ESQLFunction, ESQLIntegerLiteral, ESQLList, ESQLParamLiteral, ESQLSource, ESQLStringLiteral } from '../../types';
|
|
2
|
+
import { SynthLiteralFragment } from './synth_literal_fragment';
|
|
3
|
+
import { SynthNode } from './synth_node';
|
|
4
|
+
import type { SynthColumnShorthand, SynthQualifiedColumnShorthand } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Creates an ES|QL source node.
|
|
7
|
+
*
|
|
8
|
+
* @param index Elasticsearch index name to create a source node for.
|
|
9
|
+
* @returns ES|QL source node.
|
|
10
|
+
*/
|
|
11
|
+
export declare const src: (index: string, prefix?: string, selector?: string) => ESQLSource;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an ES|QL source node with an alias (e.g., `index AS alias`).
|
|
14
|
+
*
|
|
15
|
+
* @param index Elasticsearch index name to create a source node for.
|
|
16
|
+
* @param alias The alias name for the source.
|
|
17
|
+
* @returns ES|QL binary expression node representing `source AS alias`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const srcAs: (index: string, alias: string) => ESQLFunction<"binary-expression", "as">;
|
|
20
|
+
/**
|
|
21
|
+
* Crates an ES|QL integer literal node.
|
|
22
|
+
*
|
|
23
|
+
* @param value The integer value to create a literal for.
|
|
24
|
+
* @returns ES|QL integer literal node.
|
|
25
|
+
*/
|
|
26
|
+
export declare const int: (value: number) => ESQLIntegerLiteral;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an ES|QL decimal (float, double) literal node.
|
|
29
|
+
*
|
|
30
|
+
* @param value The decimal value to create a literal for.
|
|
31
|
+
* @returns ES|QL decimal literal node.
|
|
32
|
+
*/
|
|
33
|
+
export declare const float: (value: number) => ESQLDecimalLiteral;
|
|
34
|
+
/**
|
|
35
|
+
* Creates an ES|QL numeric literal node. If the value is an integer, an integer
|
|
36
|
+
* literal node is created, otherwise a decimal literal node is created.
|
|
37
|
+
*
|
|
38
|
+
* @param value The numeric value to create a literal for.
|
|
39
|
+
* @returns ES|QL numeric literal node.
|
|
40
|
+
*/
|
|
41
|
+
export declare const num: (value: number) => ESQLDecimalLiteral | ESQLIntegerLiteral;
|
|
42
|
+
/**
|
|
43
|
+
* Creates an ES|QL boolean literal node.
|
|
44
|
+
*
|
|
45
|
+
* @param value The boolean value to create a literal for.
|
|
46
|
+
* @returns ES|QL boolean literal node.
|
|
47
|
+
*/
|
|
48
|
+
export declare const bool: (value: boolean) => import("../../types").ESQLBooleanLiteral & SynthNode;
|
|
49
|
+
/**
|
|
50
|
+
* Creates an ES|QL string literal node.
|
|
51
|
+
*
|
|
52
|
+
* @param value The string value to create a literal for.
|
|
53
|
+
* @returns ES|QL string literal node.
|
|
54
|
+
*/
|
|
55
|
+
export declare const str: (value: string) => ESQLStringLiteral;
|
|
56
|
+
/**
|
|
57
|
+
* Creates an ES|QL named parameter node.
|
|
58
|
+
*
|
|
59
|
+
* @param name The name of the parameter.
|
|
60
|
+
* @returns ES|QL named parameter node.
|
|
61
|
+
*/
|
|
62
|
+
export declare const par: (name: string) => ESQLParamLiteral;
|
|
63
|
+
/**
|
|
64
|
+
* Creates an ES|QL named double parameter node.
|
|
65
|
+
*
|
|
66
|
+
* @param name The name of the parameter.
|
|
67
|
+
* @returns ES|QL named parameter node.
|
|
68
|
+
*/
|
|
69
|
+
export declare const dpar: (name: string) => ESQLParamLiteral;
|
|
70
|
+
/**
|
|
71
|
+
* Creates an ES|QL column node.
|
|
72
|
+
*
|
|
73
|
+
* @param name The name of the column.
|
|
74
|
+
* @returns ES|QL column node.
|
|
75
|
+
*/
|
|
76
|
+
export declare const col: (name: string | SynthColumnShorthand | SynthQualifiedColumnShorthand) => ESQLColumn;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a literal fragment representing a keyword.
|
|
79
|
+
*
|
|
80
|
+
* @param keyword The keyword to create a literal fragment for.
|
|
81
|
+
* @returns A SynthLiteralFragment representing the keyword.
|
|
82
|
+
*/
|
|
83
|
+
export declare const kwd: (keyword: string) => SynthLiteralFragment;
|
|
84
|
+
/**
|
|
85
|
+
* Supported primitive types for ES|QL list literals.
|
|
86
|
+
*/
|
|
87
|
+
export type ListPrimitive = string | number | boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Creates an ES|QL list literal AST node from an array of primitive values.
|
|
90
|
+
*
|
|
91
|
+
* The array elements must all be of the same primitive type: string, number,
|
|
92
|
+
* or boolean. ES|QL list literals use square brackets and are rendered as:
|
|
93
|
+
*
|
|
94
|
+
* - `[1, 2, 3]` for integer lists
|
|
95
|
+
* - `["a", "b"]` for string lists
|
|
96
|
+
* - `[TRUE, FALSE]` for boolean lists
|
|
97
|
+
*
|
|
98
|
+
* @param values An array of primitive values (strings, numbers, or booleans).
|
|
99
|
+
* All elements must be of the same type.
|
|
100
|
+
* @returns ES|QL list literal node.
|
|
101
|
+
* @throws Error if the array is empty or contains unsupported types.
|
|
102
|
+
*/
|
|
103
|
+
export declare const list: (values: ListPrimitive[]) => ESQLList;
|
|
104
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/nodes.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,KAAG,UAIvE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,YAAY,CAAC,mBAAmB,EAAE,IAAI,CAM1F,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,KAAG,kBAInC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,kBAIrC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,KAAG,kBAAkB,GAAG,kBAMxD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,OAAO,yDAIlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,KAAG,iBAInC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,gBAIlC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,gBAInC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GACd,MAAM,MAAM,GAAG,oBAAoB,GAAG,6BAA6B,KAClE,UAgBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,SAAS,MAAM,KAAG,oBAErC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ,aAAa,EAAE,KAAG,QAmC9C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ESQLAstQueryExpression } from '../../types';
|
|
2
|
+
export declare const query: import("./types").SynthMethod<ESQLAstQueryExpression>;
|
|
3
|
+
/**
|
|
4
|
+
* Short 3-letter alias for DX convenience.
|
|
5
|
+
*/
|
|
6
|
+
export declare const qry: import("./types").SynthMethod<ESQLAstQueryExpression>;
|
|
7
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/query.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAyC1D,eAAO,MAAM,KAAK,uDAA+C,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,GAAG,uDAAQ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple wrapper class to represent a literal string fragment in the Synth
|
|
3
|
+
* API. This is used to represent string fragments that are not parsed into
|
|
4
|
+
* proper AST nodes, but are still valid parts of the query string. Caution
|
|
5
|
+
* needed when using this, as this allows to insert arbitrary strings into
|
|
6
|
+
* the query, the intended use is for conditionally inserting command names or
|
|
7
|
+
* other keywords.
|
|
8
|
+
*
|
|
9
|
+
* For example, a literal fragment can be used to insert a raw ES|QL keyword:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* synth.cmd `SORT a NULLS ${ new SynthLiteralFragment('FIRST') }`
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class SynthLiteralFragment {
|
|
16
|
+
readonly value: string;
|
|
17
|
+
constructor(value: string);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=synth_literal_fragment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synth_literal_fragment.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/synth_literal_fragment.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAoB;aACH,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAC1C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type PrintAstOptions } from '../../debug';
|
|
2
|
+
import type { ESQLProperNode } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* This is used as a prototype of AST nodes created by the synth methods.
|
|
5
|
+
* It implements the `toString` method, which is invoked when the node is
|
|
6
|
+
* coerced to a string. So you can easily convert the node to a string by
|
|
7
|
+
* calling `String(node)` or `${node}`:
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* const node = expr`a.b`; // { type: 'column', name: 'a.b' }
|
|
11
|
+
* String(node) // 'a.b'
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class SynthNode {
|
|
15
|
+
static from<N extends ESQLProperNode>(node: N): N & SynthNode;
|
|
16
|
+
toString(this: ESQLProperNode): string;
|
|
17
|
+
dump(this: ESQLProperNode, options?: PrintAstOptions): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=synth_node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synth_node.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/synth_node.ts"],"names":[],"mappings":"AAUA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;WACN,IAAI,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAapE,QAAQ,CAAC,IAAI,EAAE,cAAc;IAI7B,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,eAAe;CAGrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/tag.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EAGZ,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,cAAc,EAChD,WAAW,cAAc,CAAC,CAAC,CAAC,KAC3B,WAAW,CAAC,CAAC,CAyDf,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ParseOptions } from '../../parser';
|
|
2
|
+
import type { ESQLAstExpression, ESQLProperNode } from '../../types';
|
|
3
|
+
import type { SynthLiteralFragment } from './synth_literal_fragment';
|
|
4
|
+
import type { SynthNode } from './synth_node';
|
|
5
|
+
export type SynthGenerator<N extends ESQLProperNode> = (src: string, opts?: ParseOptions) => N;
|
|
6
|
+
export type SynthTemplateHole =
|
|
7
|
+
/**
|
|
8
|
+
* A hole is normally an AST node.
|
|
9
|
+
*/
|
|
10
|
+
ESQLAstExpression
|
|
11
|
+
/**
|
|
12
|
+
* If a list of AST nodes is provided, it will be joined with a comma.
|
|
13
|
+
*/
|
|
14
|
+
| ESQLAstExpression[]
|
|
15
|
+
/**
|
|
16
|
+
* A shorthand for a column name, which is an array of column parts.
|
|
17
|
+
*/
|
|
18
|
+
| SynthColumnShorthand
|
|
19
|
+
/**
|
|
20
|
+
* A shorthand for a qualified column name, which is a tuple where
|
|
21
|
+
* the first element is the qualifier (e.g., index name) and the second
|
|
22
|
+
* element is the column name represented as a `SynthColumnShorthand`.
|
|
23
|
+
*/
|
|
24
|
+
| SynthQualifiedColumnShorthand
|
|
25
|
+
/**
|
|
26
|
+
* If a number is provided, it will be converted to the right AST node type:
|
|
27
|
+
*
|
|
28
|
+
* - integer for integers
|
|
29
|
+
* - decimal for floats
|
|
30
|
+
*/
|
|
31
|
+
| number
|
|
32
|
+
/**
|
|
33
|
+
* A string will be converted to a string literal AST node.
|
|
34
|
+
*/
|
|
35
|
+
| string
|
|
36
|
+
/**
|
|
37
|
+
* A boolean will be converted to a boolean literal (TRUE/FALSE) AST node.
|
|
38
|
+
*/
|
|
39
|
+
| boolean
|
|
40
|
+
/**
|
|
41
|
+
* A literal fragment can be used to insert raw strings into the query.
|
|
42
|
+
* Use it for inserting keywords or other query elements that are "smaller"
|
|
43
|
+
* than a full AST node.
|
|
44
|
+
*/
|
|
45
|
+
| SynthLiteralFragment;
|
|
46
|
+
/**
|
|
47
|
+
* A developer-friendly way to specify nested column names in ESQL queries.
|
|
48
|
+
* Each part in the array represents a segment of the column name.
|
|
49
|
+
*
|
|
50
|
+
* For example, `['user', 'name']` represents the column `user.name`.
|
|
51
|
+
*/
|
|
52
|
+
export type SynthColumnShorthand = string[];
|
|
53
|
+
/**
|
|
54
|
+
* A developer-friendly way to specify qualified column names in ESQL queries.
|
|
55
|
+
* The first element in the tuple is the qualifier (e.g., index name), and the
|
|
56
|
+
* second element is the column name represented as a `SynthColumnShorthand`.
|
|
57
|
+
*
|
|
58
|
+
* For example, `['index', ['user', 'name']]` represents the column
|
|
59
|
+
* `[index].[user.name]`.
|
|
60
|
+
*/
|
|
61
|
+
export type SynthQualifiedColumnShorthand = [string, SynthColumnShorthand];
|
|
62
|
+
export type SynthTaggedTemplate<N extends ESQLProperNode> = (template: TemplateStringsArray, ...params: SynthTemplateHole[]) => N & SynthNode;
|
|
63
|
+
export type SynthTaggedTemplateWithOpts<N extends ESQLProperNode> = (opts?: ParseOptions) => SynthTaggedTemplate<N>;
|
|
64
|
+
export type SynthMethod<N extends ESQLProperNode> = SynthGenerator<N> & SynthTaggedTemplate<N> & SynthTaggedTemplateWithOpts<N>;
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composer/synth/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,CAAC,CAAC;AAE/F,MAAM,MAAM,iBAAiB;AAC3B;;GAEG;AACD,iBAAiB;AAEnB;;GAEG;GACD,iBAAiB,EAAE;AAErB;;GAEG;GACD,oBAAoB;AAEtB;;;;GAIG;GACD,6BAA6B;AAE/B;;;;;GAKG;GACD,MAAM;AAER;;GAEG;GACD,MAAM;AAER;;GAEG;GACD,OAAO;AAET;;;;GAIG;GACD,oBAAoB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,EAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAE3E,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAAI,CAC1D,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,MAAM,EAAE,iBAAiB,EAAE,KAC3B,CAAC,GAAG,SAAS,CAAC;AAEnB,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,cAAc,IAAI,CAClE,IAAI,CAAC,EAAE,YAAY,KAChB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE5B,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,cAAc,IAAI,cAAc,CAAC,CAAC,CAAC,GACnE,mBAAmB,CAAC,CAAC,CAAC,GACtB,2BAA2B,CAAC,CAAC,CAAC,CAAC"}
|