flowquery 1.0.2 → 1.0.5
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/README.md +54 -1
- package/dist/compute/runner.d.ts +81 -0
- package/dist/compute/runner.d.ts.map +1 -0
- package/dist/index.browser.d.ts +10 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.node.d.ts +14 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/io/command_line.d.ts +28 -0
- package/dist/io/command_line.d.ts.map +1 -0
- package/dist/parsing/alias.d.ts +10 -0
- package/dist/parsing/alias.d.ts.map +1 -0
- package/dist/parsing/alias_option.d.ts +6 -0
- package/dist/parsing/alias_option.d.ts.map +1 -0
- package/dist/parsing/ast_node.d.ts +100 -0
- package/dist/parsing/ast_node.d.ts.map +1 -0
- package/dist/parsing/base_parser.d.ts +49 -0
- package/dist/parsing/base_parser.d.ts.map +1 -0
- package/dist/parsing/components/csv.d.ts +6 -0
- package/dist/parsing/components/csv.d.ts.map +1 -0
- package/dist/parsing/components/from.d.ts +7 -0
- package/dist/parsing/components/from.d.ts.map +1 -0
- package/dist/parsing/components/headers.d.ts +7 -0
- package/dist/parsing/components/headers.d.ts.map +1 -0
- package/dist/parsing/components/json.d.ts +6 -0
- package/dist/parsing/components/json.d.ts.map +1 -0
- package/dist/parsing/components/null.d.ts +6 -0
- package/dist/parsing/components/null.d.ts.map +1 -0
- package/dist/parsing/components/post.d.ts +6 -0
- package/dist/parsing/components/post.d.ts.map +1 -0
- package/dist/parsing/components/text.d.ts +6 -0
- package/dist/parsing/components/text.d.ts.map +1 -0
- package/dist/parsing/context.d.ts +38 -0
- package/dist/parsing/context.d.ts.map +1 -0
- package/dist/parsing/data_structures/associative_array.d.ts +28 -0
- package/dist/parsing/data_structures/associative_array.d.ts.map +1 -0
- package/dist/parsing/data_structures/json_array.d.ts +26 -0
- package/dist/parsing/data_structures/json_array.d.ts.map +1 -0
- package/dist/parsing/data_structures/key_value_pair.d.ts +25 -0
- package/dist/parsing/data_structures/key_value_pair.d.ts.map +1 -0
- package/dist/parsing/data_structures/lookup.d.ts +25 -0
- package/dist/parsing/data_structures/lookup.d.ts.map +1 -0
- package/dist/parsing/data_structures/range_lookup.d.ts +14 -0
- package/dist/parsing/data_structures/range_lookup.d.ts.map +1 -0
- package/dist/parsing/expressions/expression.d.ts +53 -0
- package/dist/parsing/expressions/expression.d.ts.map +1 -0
- package/dist/parsing/expressions/f_string.d.ts +21 -0
- package/dist/parsing/expressions/f_string.d.ts.map +1 -0
- package/dist/parsing/expressions/identifier.d.ts +17 -0
- package/dist/parsing/expressions/identifier.d.ts.map +1 -0
- package/dist/parsing/expressions/number.d.ts +25 -0
- package/dist/parsing/expressions/number.d.ts.map +1 -0
- package/dist/parsing/expressions/operator.d.ts +79 -0
- package/dist/parsing/expressions/operator.d.ts.map +1 -0
- package/dist/parsing/expressions/reference.d.ts +29 -0
- package/dist/parsing/expressions/reference.d.ts.map +1 -0
- package/dist/parsing/expressions/string.d.ts +23 -0
- package/dist/parsing/expressions/string.d.ts.map +1 -0
- package/dist/parsing/functions/aggregate_function.d.ts +42 -0
- package/dist/parsing/functions/aggregate_function.d.ts.map +1 -0
- package/dist/parsing/functions/async_function.d.ts +52 -0
- package/dist/parsing/functions/async_function.d.ts.map +1 -0
- package/dist/parsing/functions/avg.d.ts +15 -0
- package/dist/parsing/functions/avg.d.ts.map +1 -0
- package/dist/parsing/functions/collect.d.ts +21 -0
- package/dist/parsing/functions/collect.d.ts.map +1 -0
- package/dist/parsing/functions/function.d.ts +36 -0
- package/dist/parsing/functions/function.d.ts.map +1 -0
- package/dist/parsing/functions/function_factory.d.ts +151 -0
- package/dist/parsing/functions/function_factory.d.ts.map +1 -0
- package/dist/parsing/functions/function_metadata.d.ts +83 -0
- package/dist/parsing/functions/function_metadata.d.ts.map +1 -0
- package/dist/parsing/functions/functions.d.ts +21 -0
- package/dist/parsing/functions/functions.d.ts.map +1 -0
- package/dist/parsing/functions/join.d.ts +9 -0
- package/dist/parsing/functions/join.d.ts.map +1 -0
- package/dist/parsing/functions/predicate_function.d.ts +18 -0
- package/dist/parsing/functions/predicate_function.d.ts.map +1 -0
- package/dist/parsing/functions/predicate_function_factory.d.ts +6 -0
- package/dist/parsing/functions/predicate_function_factory.d.ts.map +1 -0
- package/dist/parsing/functions/predicate_sum.d.ts +7 -0
- package/dist/parsing/functions/predicate_sum.d.ts.map +1 -0
- package/dist/parsing/functions/rand.d.ts +7 -0
- package/dist/parsing/functions/rand.d.ts.map +1 -0
- package/dist/parsing/functions/range.d.ts +7 -0
- package/dist/parsing/functions/range.d.ts.map +1 -0
- package/dist/parsing/functions/reducer_element.d.ts +6 -0
- package/dist/parsing/functions/reducer_element.d.ts.map +1 -0
- package/dist/parsing/functions/replace.d.ts +7 -0
- package/dist/parsing/functions/replace.d.ts.map +1 -0
- package/dist/parsing/functions/round.d.ts +7 -0
- package/dist/parsing/functions/round.d.ts.map +1 -0
- package/dist/parsing/functions/size.d.ts +7 -0
- package/dist/parsing/functions/size.d.ts.map +1 -0
- package/dist/parsing/functions/split.d.ts +9 -0
- package/dist/parsing/functions/split.d.ts.map +1 -0
- package/dist/parsing/functions/stringify.d.ts +9 -0
- package/dist/parsing/functions/stringify.d.ts.map +1 -0
- package/dist/parsing/functions/sum.d.ts +14 -0
- package/dist/parsing/functions/sum.d.ts.map +1 -0
- package/dist/parsing/functions/to_json.d.ts +7 -0
- package/dist/parsing/functions/to_json.d.ts.map +1 -0
- package/dist/parsing/functions/value_holder.d.ts +8 -0
- package/dist/parsing/functions/value_holder.d.ts.map +1 -0
- package/dist/parsing/logic/case.d.ts +7 -0
- package/dist/parsing/logic/case.d.ts.map +1 -0
- package/dist/parsing/logic/else.d.ts +7 -0
- package/dist/parsing/logic/else.d.ts.map +1 -0
- package/dist/parsing/logic/end.d.ts +6 -0
- package/dist/parsing/logic/end.d.ts.map +1 -0
- package/dist/parsing/logic/then.d.ts +7 -0
- package/dist/parsing/logic/then.d.ts.map +1 -0
- package/dist/parsing/logic/when.d.ts +7 -0
- package/dist/parsing/logic/when.d.ts.map +1 -0
- package/dist/parsing/operations/aggregated_return.d.ts +8 -0
- package/dist/parsing/operations/aggregated_return.d.ts.map +1 -0
- package/dist/parsing/operations/aggregated_with.d.ts +8 -0
- package/dist/parsing/operations/aggregated_with.d.ts.map +1 -0
- package/dist/parsing/operations/group_by.d.ts +35 -0
- package/dist/parsing/operations/group_by.d.ts.map +1 -0
- package/dist/parsing/operations/limit.d.ts +10 -0
- package/dist/parsing/operations/limit.d.ts.map +1 -0
- package/dist/parsing/operations/load.d.ts +48 -0
- package/dist/parsing/operations/load.d.ts.map +1 -0
- package/dist/parsing/operations/operation.d.ts +39 -0
- package/dist/parsing/operations/operation.d.ts.map +1 -0
- package/dist/parsing/operations/projection.d.ts +8 -0
- package/dist/parsing/operations/projection.d.ts.map +1 -0
- package/dist/parsing/operations/return.d.ts +23 -0
- package/dist/parsing/operations/return.d.ts.map +1 -0
- package/dist/parsing/operations/unwind.d.ts +12 -0
- package/dist/parsing/operations/unwind.d.ts.map +1 -0
- package/dist/parsing/operations/where.d.ts +26 -0
- package/dist/parsing/operations/where.d.ts.map +1 -0
- package/dist/parsing/operations/with.d.ts +17 -0
- package/dist/parsing/operations/with.d.ts.map +1 -0
- package/dist/parsing/parser.d.ts +66 -0
- package/dist/parsing/parser.d.ts.map +1 -0
- package/dist/parsing/parser.js +1 -1
- package/dist/parsing/token_to_node.d.ts +7 -0
- package/dist/parsing/token_to_node.d.ts.map +1 -0
- package/dist/tokenization/keyword.d.ts +43 -0
- package/dist/tokenization/keyword.d.ts.map +1 -0
- package/dist/tokenization/operator.d.ts +22 -0
- package/dist/tokenization/operator.d.ts.map +1 -0
- package/dist/tokenization/string_walker.d.ts +55 -0
- package/dist/tokenization/string_walker.d.ts.map +1 -0
- package/dist/tokenization/symbol.d.ts +15 -0
- package/dist/tokenization/symbol.d.ts.map +1 -0
- package/dist/tokenization/token.d.ts +176 -0
- package/dist/tokenization/token.d.ts.map +1 -0
- package/dist/tokenization/token_mapper.d.ts +40 -0
- package/dist/tokenization/token_mapper.d.ts.map +1 -0
- package/dist/tokenization/token_mapper.js +2 -2
- package/dist/tokenization/token_mapper.js.map +1 -1
- package/dist/tokenization/token_type.d.ts +16 -0
- package/dist/tokenization/token_type.d.ts.map +1 -0
- package/dist/tokenization/tokenizer.d.ts +45 -0
- package/dist/tokenization/tokenizer.d.ts.map +1 -0
- package/dist/tokenization/trie.d.ts +41 -0
- package/dist/tokenization/trie.d.ts.map +1 -0
- package/dist/utils/object_utils.d.ts +15 -0
- package/dist/utils/object_utils.d.ts.map +1 -0
- package/dist/utils/string_utils.d.ts +51 -0
- package/dist/utils/string_utils.d.ts.map +1 -0
- package/misc/apps/RAG/README.md +48 -0
- package/misc/apps/RAG/package.json +31 -0
- package/misc/apps/RAG/src/index.ts +20 -0
- package/misc/apps/RAG/tsconfig.json +19 -0
- package/misc/apps/RAG/webpack.config.js +32 -0
- package/misc/apps/README.md +1 -0
- package/package.json +1 -1
- package/src/parsing/parser.ts +1 -1
- package/src/tokenization/token_mapper.ts +2 -2
- package/tsconfig.json +3 -1
- /package/{queries → misc/queries}/analyze_catfacts.cql +0 -0
- /package/{queries → misc/queries}/azure_openai_completions.cql +0 -0
- /package/{queries → misc/queries}/azure_openai_models.cql +0 -0
- /package/{queries → misc/queries}/mock_pipeline.cql +0 -0
- /package/{queries → misc/queries}/openai_completions.cql +0 -0
- /package/{queries → misc/queries}/openai_models.cql +0 -0
- /package/{queries → misc/queries}/test.cql +0 -0
- /package/{queries → misc/queries}/tool_inference.cql +0 -0
- /package/{queries → misc/queries}/wisdom.cql +0 -0
- /package/{queries → misc/queries}/wisdom_letter_histogram.cql +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a lookup operation (array/object indexing) in the AST.
|
|
4
|
+
*
|
|
5
|
+
* Lookups access elements from arrays or properties from objects using an index or key.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // For array[0] or obj.property or obj["key"]
|
|
10
|
+
* const lookup = new Lookup();
|
|
11
|
+
* lookup.variable = arrayOrObjNode;
|
|
12
|
+
* lookup.index = indexNode;
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare class Lookup extends ASTNode {
|
|
16
|
+
constructor();
|
|
17
|
+
set index(index: ASTNode);
|
|
18
|
+
get index(): ASTNode;
|
|
19
|
+
set variable(variable: ASTNode);
|
|
20
|
+
get variable(): ASTNode;
|
|
21
|
+
isOperand(): boolean;
|
|
22
|
+
value(): any;
|
|
23
|
+
}
|
|
24
|
+
export default Lookup;
|
|
25
|
+
//# sourceMappingURL=lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/lookup.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,cAAM,MAAO,SAAQ,OAAO;;IAIxB,IAAW,KAAK,CAAC,KAAK,EAAE,OAAO,EAE9B;IACD,IAAW,KAAK,IAAI,OAAO,CAE1B;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;IACD,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACM,SAAS,IAAI,OAAO;IAGpB,KAAK,IAAI,GAAG;CAGtB;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
declare class RangeLookup extends ASTNode {
|
|
3
|
+
constructor();
|
|
4
|
+
set from(from: ASTNode);
|
|
5
|
+
get from(): ASTNode;
|
|
6
|
+
set to(to: ASTNode);
|
|
7
|
+
get to(): ASTNode;
|
|
8
|
+
set variable(variable: ASTNode);
|
|
9
|
+
get variable(): ASTNode;
|
|
10
|
+
isOperand(): boolean;
|
|
11
|
+
value(): any;
|
|
12
|
+
}
|
|
13
|
+
export default RangeLookup;
|
|
14
|
+
//# sourceMappingURL=range_lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range_lookup.d.ts","sourceRoot":"","sources":["../../../src/parsing/data_structures/range_lookup.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,cAAM,WAAY,SAAQ,OAAO;;IAI7B,IAAW,IAAI,CAAC,IAAI,EAAE,OAAO,EAE5B;IACD,IAAW,IAAI,IAAI,OAAO,CAEzB;IACD,IAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAExB;IACD,IAAW,EAAE,IAAI,OAAO,CAEvB;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;IACD,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACM,SAAS,IAAI,OAAO;IAGpB,KAAK,IAAI,GAAG;CAMtB;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
import AggregateFunction from "../functions/aggregate_function";
|
|
3
|
+
/**
|
|
4
|
+
* Represents an expression in the FlowQuery AST.
|
|
5
|
+
*
|
|
6
|
+
* Expressions are built using the Shunting Yard algorithm to handle operator
|
|
7
|
+
* precedence and associativity. They can contain operands (numbers, strings, identifiers)
|
|
8
|
+
* and operators (arithmetic, logical, comparison).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const expr = new Expression();
|
|
13
|
+
* expr.addNode(numberNode);
|
|
14
|
+
* expr.addNode(plusOperator);
|
|
15
|
+
* expr.addNode(anotherNumberNode);
|
|
16
|
+
* expr.finish();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare class Expression extends ASTNode {
|
|
20
|
+
private operators;
|
|
21
|
+
private output;
|
|
22
|
+
private _alias;
|
|
23
|
+
private _overridden;
|
|
24
|
+
private _reducers;
|
|
25
|
+
/**
|
|
26
|
+
* Adds a node (operand or operator) to the expression.
|
|
27
|
+
*
|
|
28
|
+
* Uses the Shunting Yard algorithm to maintain correct operator precedence.
|
|
29
|
+
*
|
|
30
|
+
* @param node - The AST node to add (operand or operator)
|
|
31
|
+
*/
|
|
32
|
+
addNode(node: ASTNode): void;
|
|
33
|
+
/**
|
|
34
|
+
* Finalizes the expression by converting it to a tree structure.
|
|
35
|
+
*
|
|
36
|
+
* Should be called after all nodes have been added.
|
|
37
|
+
*/
|
|
38
|
+
finish(): void;
|
|
39
|
+
private toTree;
|
|
40
|
+
nodesAdded(): boolean;
|
|
41
|
+
value(): any;
|
|
42
|
+
setAlias(alias: string): void;
|
|
43
|
+
set alias(alias: string);
|
|
44
|
+
get alias(): string | null;
|
|
45
|
+
toString(): string;
|
|
46
|
+
reducers(): AggregateFunction[];
|
|
47
|
+
private _extract_reducers;
|
|
48
|
+
mappable(): boolean;
|
|
49
|
+
has_reducers(): boolean;
|
|
50
|
+
set overridden(value: any);
|
|
51
|
+
}
|
|
52
|
+
export default Expression;
|
|
53
|
+
//# sourceMappingURL=expression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/expression.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAGhE;;;;;;;;;;;;;;;GAeG;AACH,cAAM,UAAW,SAAQ,OAAO;IAC5B,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,SAAS,CAAoC;IAErD;;;;;;OAMG;IACI,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAsBnC;;;;OAIG;IACI,MAAM,IAAI,IAAI;IAQrB,OAAO,CAAC,MAAM;IAWP,UAAU,IAAI,OAAO;IAIrB,KAAK,IAAI,GAAG;IAUZ,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIpC,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,IAAW,KAAK,IAAI,MAAM,GAAG,IAAI,CAKhC;IAEM,QAAQ,IAAI,MAAM;IAOlB,QAAQ,IAAI,iBAAiB,EAAE;IAMtC,OAAO,CAAE,iBAAiB;IAQnB,QAAQ,IAAI,OAAO;IAGnB,YAAY,IAAI,OAAO;IAG9B,IAAW,UAAU,CAAC,KAAK,EAAE,GAAG,EAE/B;CACJ;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a formatted string (f-string) in the AST.
|
|
4
|
+
*
|
|
5
|
+
* F-strings allow embedding expressions within string literals.
|
|
6
|
+
* Child nodes represent the parts of the f-string (literal strings and expressions).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // For f"Hello {name}!"
|
|
11
|
+
* const fstr = new FString();
|
|
12
|
+
* fstr.addChild(new String("Hello "));
|
|
13
|
+
* fstr.addChild(nameExpression);
|
|
14
|
+
* fstr.addChild(new String("!"));
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare class FString extends ASTNode {
|
|
18
|
+
value(): string;
|
|
19
|
+
}
|
|
20
|
+
export default FString;
|
|
21
|
+
//# sourceMappingURL=f_string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"f_string.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/f_string.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC;;;;;;;;;;;;;;GAcG;AACH,cAAM,OAAQ,SAAQ,OAAO;IAClB,KAAK,IAAI,MAAM;CAIzB;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import String from "./string";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an identifier in the AST.
|
|
4
|
+
*
|
|
5
|
+
* Identifiers are used for variable names, property names, and similar constructs.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const id = new Identifier("myVariable");
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
declare class Identifier extends String {
|
|
13
|
+
toString(): string;
|
|
14
|
+
value(): any;
|
|
15
|
+
}
|
|
16
|
+
export default Identifier;
|
|
17
|
+
//# sourceMappingURL=identifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B;;;;;;;;;GASG;AACH,cAAM,UAAW,SAAQ,MAAM;IACpB,QAAQ,IAAI,MAAM;IAGlB,KAAK,IAAI,GAAG;CAGtB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a numeric literal in the AST.
|
|
4
|
+
*
|
|
5
|
+
* Parses string representations of numbers into integer or float values.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const num = new Number("42");
|
|
10
|
+
* console.log(num.value()); // 42
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare class Number extends ASTNode {
|
|
14
|
+
private _value;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new Number node by parsing the string value.
|
|
17
|
+
*
|
|
18
|
+
* @param value - The string representation of the number
|
|
19
|
+
*/
|
|
20
|
+
constructor(value: string);
|
|
21
|
+
value(): number;
|
|
22
|
+
protected toString(): string;
|
|
23
|
+
}
|
|
24
|
+
export default Number;
|
|
25
|
+
//# sourceMappingURL=number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/number.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;GAUG;AACH,cAAM,MAAO,SAAQ,OAAO;IACxB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;OAIG;gBACS,KAAK,EAAE,MAAM;IASlB,KAAK,IAAI,MAAM;IAItB,SAAS,CAAC,QAAQ,IAAI,MAAM;CAG/B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
declare abstract class Operator extends ASTNode {
|
|
3
|
+
private _precedence;
|
|
4
|
+
private _leftAssociative;
|
|
5
|
+
constructor(precedence: number, leftAssociative: boolean);
|
|
6
|
+
isOperator(): boolean;
|
|
7
|
+
get precedence(): number;
|
|
8
|
+
get leftAssociative(): boolean;
|
|
9
|
+
abstract value(): number;
|
|
10
|
+
get lhs(): ASTNode;
|
|
11
|
+
get rhs(): ASTNode;
|
|
12
|
+
}
|
|
13
|
+
declare class Add extends Operator {
|
|
14
|
+
constructor();
|
|
15
|
+
value(): number;
|
|
16
|
+
}
|
|
17
|
+
declare class Subtract extends Operator {
|
|
18
|
+
constructor();
|
|
19
|
+
value(): number;
|
|
20
|
+
}
|
|
21
|
+
declare class Multiply extends Operator {
|
|
22
|
+
constructor();
|
|
23
|
+
value(): number;
|
|
24
|
+
}
|
|
25
|
+
declare class Divide extends Operator {
|
|
26
|
+
constructor();
|
|
27
|
+
value(): number;
|
|
28
|
+
}
|
|
29
|
+
declare class Modulo extends Operator {
|
|
30
|
+
constructor();
|
|
31
|
+
value(): number;
|
|
32
|
+
}
|
|
33
|
+
declare class Power extends Operator {
|
|
34
|
+
constructor();
|
|
35
|
+
value(): number;
|
|
36
|
+
}
|
|
37
|
+
declare class Equals extends Operator {
|
|
38
|
+
constructor();
|
|
39
|
+
value(): number;
|
|
40
|
+
}
|
|
41
|
+
declare class NotEquals extends Operator {
|
|
42
|
+
constructor();
|
|
43
|
+
value(): number;
|
|
44
|
+
}
|
|
45
|
+
declare class GreaterThan extends Operator {
|
|
46
|
+
constructor();
|
|
47
|
+
value(): number;
|
|
48
|
+
}
|
|
49
|
+
declare class LessThan extends Operator {
|
|
50
|
+
constructor();
|
|
51
|
+
value(): number;
|
|
52
|
+
}
|
|
53
|
+
declare class GreaterThanOrEqual extends Operator {
|
|
54
|
+
constructor();
|
|
55
|
+
value(): number;
|
|
56
|
+
}
|
|
57
|
+
declare class LessThanOrEqual extends Operator {
|
|
58
|
+
constructor();
|
|
59
|
+
value(): number;
|
|
60
|
+
}
|
|
61
|
+
declare class And extends Operator {
|
|
62
|
+
constructor();
|
|
63
|
+
value(): number;
|
|
64
|
+
}
|
|
65
|
+
declare class Or extends Operator {
|
|
66
|
+
constructor();
|
|
67
|
+
value(): number;
|
|
68
|
+
}
|
|
69
|
+
declare class Not extends Operator {
|
|
70
|
+
constructor();
|
|
71
|
+
isOperator(): boolean;
|
|
72
|
+
value(): number;
|
|
73
|
+
}
|
|
74
|
+
declare class Is extends Operator {
|
|
75
|
+
constructor();
|
|
76
|
+
value(): number;
|
|
77
|
+
}
|
|
78
|
+
export { Operator, Add, Subtract, Multiply, Divide, Modulo, Power, Equals, NotEquals, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, And, Or, Not, Is };
|
|
79
|
+
//# sourceMappingURL=operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/operator.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,uBAAe,QAAS,SAAQ,OAAO;IACnC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,gBAAgB,CAAiB;gBAE7B,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO;IAMjD,UAAU,IAAI,OAAO;IAI5B,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,IAAW,eAAe,IAAI,OAAO,CAEpC;aACe,KAAK,IAAI,MAAM;IAC/B,IAAW,GAAG,IAAI,OAAO,CAExB;IACD,IAAW,GAAG,IAAI,OAAO,CAExB;CACJ;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,KAAM,SAAQ,QAAQ;;IAIjB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,MAAO,SAAQ,QAAQ;;IAIlB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,SAAU,SAAQ,QAAQ;;IAIrB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,WAAY,SAAQ,QAAQ;;IAIvB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,QAAS,SAAQ,QAAQ;;IAIpB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,kBAAmB,SAAQ,QAAQ;;IAI9B,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,eAAgB,SAAQ,QAAQ;;IAI3B,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,EAAG,SAAQ,QAAQ;;IAId,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,GAAI,SAAQ,QAAQ;;IAIf,UAAU,IAAI,OAAO;IAGrB,KAAK,IAAI,MAAM;CAGzB;AAED,cAAM,EAAG,SAAQ,QAAQ;;IAId,KAAK,IAAI,MAAM;CAGzB;AAED,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
import Identifier from "./identifier";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a reference to a previously defined variable or expression.
|
|
5
|
+
*
|
|
6
|
+
* References point to values defined earlier in the query (e.g., in WITH or LOAD statements).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const ref = new Reference("myVar", previousNode);
|
|
11
|
+
* console.log(ref.value()); // Gets value from referred node
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class Reference extends Identifier {
|
|
15
|
+
private _referred;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new Reference to a variable.
|
|
18
|
+
*
|
|
19
|
+
* @param value - The identifier name
|
|
20
|
+
* @param referred - The node this reference points to (optional)
|
|
21
|
+
*/
|
|
22
|
+
constructor(value: string, referred?: ASTNode | undefined);
|
|
23
|
+
set referred(node: ASTNode);
|
|
24
|
+
toString(): string;
|
|
25
|
+
value(): any;
|
|
26
|
+
get identifier(): string;
|
|
27
|
+
}
|
|
28
|
+
export default Reference;
|
|
29
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/reference.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,cAAM,SAAU,SAAQ,UAAU;IAC9B,OAAO,CAAC,SAAS,CAAkC;IAEnD;;;;;OAKG;gBACS,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAO,GAAG,SAAqB;IAIpE,IAAW,QAAQ,CAAC,IAAI,EAAE,OAAO,EAEhC;IACM,QAAQ,IAAI,MAAM;IAGlB,KAAK,IAAI,GAAG;IAGnB,IAAW,UAAU,IAAI,MAAM,CAE9B;CACJ;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a string literal in the AST.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const str = new String("hello");
|
|
8
|
+
* console.log(str.value()); // "hello"
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
declare class String extends ASTNode {
|
|
12
|
+
protected _value: string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new String node with the given value.
|
|
15
|
+
*
|
|
16
|
+
* @param value - The string value
|
|
17
|
+
*/
|
|
18
|
+
constructor(value: string);
|
|
19
|
+
value(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
22
|
+
export default String;
|
|
23
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/parsing/expressions/string.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;GAQG;AACH,cAAM,MAAO,SAAQ,OAAO;IACxB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;gBACS,KAAK,EAAE,MAAM;IAKlB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,MAAM;CAG5B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Function from "./function";
|
|
2
|
+
import ReducerElement from "./reducer_element";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for aggregate functions that reduce multiple values to a single value.
|
|
5
|
+
*
|
|
6
|
+
* Aggregate functions like SUM, AVG, and COLLECT process multiple input values
|
|
7
|
+
* and produce a single output. They cannot be nested within other aggregate functions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const sumFunc = new Sum();
|
|
12
|
+
* // Used in: RETURN SUM(values)
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare class AggregateFunction extends Function {
|
|
16
|
+
private _overridden;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new AggregateFunction with the given name.
|
|
19
|
+
*
|
|
20
|
+
* @param name - The function name
|
|
21
|
+
*/
|
|
22
|
+
constructor(name: string);
|
|
23
|
+
/**
|
|
24
|
+
* Processes a value during the aggregation phase.
|
|
25
|
+
*
|
|
26
|
+
* @param value - The element to aggregate
|
|
27
|
+
* @throws {Error} If not implemented by subclass
|
|
28
|
+
*/
|
|
29
|
+
reduce(value: ReducerElement): void;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a reducer element for this aggregate function.
|
|
32
|
+
*
|
|
33
|
+
* @returns A ReducerElement instance
|
|
34
|
+
* @throws {Error} If not implemented by subclass
|
|
35
|
+
*/
|
|
36
|
+
element(): ReducerElement;
|
|
37
|
+
get overridden(): any | null;
|
|
38
|
+
set overridden(value: any | null);
|
|
39
|
+
value(): any;
|
|
40
|
+
}
|
|
41
|
+
export default AggregateFunction;
|
|
42
|
+
//# sourceMappingURL=aggregate_function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate_function.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/aggregate_function.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,cAAM,iBAAkB,SAAQ,QAAQ;IACpC,OAAO,CAAC,WAAW,CAAoB;IAEvC;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAIxB;;;;;OAKG;IACI,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAI1C;;;;;OAKG;IACI,OAAO,IAAI,cAAc;IAGhC,IAAW,UAAU,IAAI,GAAG,GAAG,IAAI,CAElC;IACD,IAAW,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,EAEtC;IACM,KAAK,IAAI,GAAG;CAGtB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an async data provider function call for use in LOAD operations.
|
|
4
|
+
*
|
|
5
|
+
* This class holds the function name and arguments, and provides async iteration
|
|
6
|
+
* over the results from a registered async data provider.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Used in: LOAD JSON FROM myDataSource('arg1', 'arg2') AS data
|
|
11
|
+
* const asyncFunc = new AsyncFunction("myDataSource");
|
|
12
|
+
* asyncFunc.parameters = [arg1Node, arg2Node];
|
|
13
|
+
* for await (const item of asyncFunc.execute()) {
|
|
14
|
+
* console.log(item);
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare class AsyncFunction extends ASTNode {
|
|
19
|
+
private _name;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new AsyncFunction with the given name.
|
|
22
|
+
*
|
|
23
|
+
* @param name - The function name (must be registered as an async provider)
|
|
24
|
+
*/
|
|
25
|
+
constructor(name: string);
|
|
26
|
+
/**
|
|
27
|
+
* Gets the function name.
|
|
28
|
+
*/
|
|
29
|
+
get name(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the function parameters.
|
|
32
|
+
*
|
|
33
|
+
* @param nodes - Array of AST nodes representing the function arguments
|
|
34
|
+
*/
|
|
35
|
+
set parameters(nodes: ASTNode[]);
|
|
36
|
+
/**
|
|
37
|
+
* Evaluates all parameters and returns their values.
|
|
38
|
+
*
|
|
39
|
+
* @returns Array of parameter values
|
|
40
|
+
*/
|
|
41
|
+
private getArguments;
|
|
42
|
+
/**
|
|
43
|
+
* Executes the async data provider function and yields results.
|
|
44
|
+
*
|
|
45
|
+
* @yields Data items from the async provider
|
|
46
|
+
* @throws {Error} If the function is not registered as an async provider
|
|
47
|
+
*/
|
|
48
|
+
execute(): AsyncGenerator<any, void, unknown>;
|
|
49
|
+
toString(): string;
|
|
50
|
+
}
|
|
51
|
+
export default AsyncFunction;
|
|
52
|
+
//# sourceMappingURL=async_function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async_function.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/async_function.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC;;;;;;;;;;;;;;;GAeG;AACH,cAAM,aAAc,SAAQ,OAAO;IAC/B,OAAO,CAAC,KAAK,CAAS;IAEtB;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAKxB;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;;OAIG;IACH,IAAW,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,EAErC;IAED;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACW,OAAO,IAAI,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC;IA0BpD,QAAQ,IAAI,MAAM;CAG5B;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AggregateFunction from "./aggregate_function";
|
|
2
|
+
import ReducerElement from "./reducer_element";
|
|
3
|
+
declare class AvgReducerElement extends ReducerElement {
|
|
4
|
+
private _count;
|
|
5
|
+
private _sum;
|
|
6
|
+
get value(): number | null;
|
|
7
|
+
set value(value: number);
|
|
8
|
+
}
|
|
9
|
+
declare class Avg extends AggregateFunction {
|
|
10
|
+
constructor();
|
|
11
|
+
reduce(element: AvgReducerElement): void;
|
|
12
|
+
element(): AvgReducerElement;
|
|
13
|
+
}
|
|
14
|
+
export default Avg;
|
|
15
|
+
//# sourceMappingURL=avg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avg.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/avg.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AAErD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,cAAM,iBAAkB,SAAQ,cAAc;IAC1C,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,IAAI,CAAuB;IACnC,IAAW,KAAK,IAAI,MAAM,GAAG,IAAI,CAKhC;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAO7B;CACJ;AAED,cAAM,GAAI,SAAQ,iBAAiB;;IAKxB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAGxC,OAAO,IAAI,iBAAiB;CAGtC;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AggregateFunction from "./aggregate_function";
|
|
2
|
+
import ReducerElement from "./reducer_element";
|
|
3
|
+
declare class CollectReducerElement extends ReducerElement {
|
|
4
|
+
private _value;
|
|
5
|
+
get value(): any;
|
|
6
|
+
set value(value: any);
|
|
7
|
+
}
|
|
8
|
+
declare class DistinctCollectReducerElement extends ReducerElement {
|
|
9
|
+
private _value;
|
|
10
|
+
get value(): any;
|
|
11
|
+
set value(value: any);
|
|
12
|
+
}
|
|
13
|
+
declare class Collect extends AggregateFunction {
|
|
14
|
+
private _distinct;
|
|
15
|
+
constructor();
|
|
16
|
+
reduce(element: CollectReducerElement): void;
|
|
17
|
+
element(): CollectReducerElement | DistinctCollectReducerElement;
|
|
18
|
+
set distinct(distinct: boolean);
|
|
19
|
+
}
|
|
20
|
+
export default Collect;
|
|
21
|
+
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/collect.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,cAAM,qBAAsB,SAAQ,cAAc;IAC9C,OAAO,CAAC,MAAM,CAAa;IAC3B,IAAW,KAAK,IAAI,GAAG,CAEtB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,GAAG,EAE1B;CACJ;AAED,cAAM,6BAA8B,SAAQ,cAAc;IACtD,OAAO,CAAC,MAAM,CAA4B;IAC1C,IAAW,KAAK,IAAI,GAAG,CAEtB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,GAAG,EAK1B;CACJ;AAED,cAAM,OAAQ,SAAQ,iBAAiB;IACnC,OAAO,CAAC,SAAS,CAAkB;;IAK5B,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAG5C,OAAO,IAAI,qBAAqB,GAAG,6BAA6B;IAGvE,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;CACJ;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ASTNode from "../ast_node";
|
|
2
|
+
/**
|
|
3
|
+
* Base class for all functions in FlowQuery.
|
|
4
|
+
*
|
|
5
|
+
* Functions can have parameters and may support the DISTINCT modifier.
|
|
6
|
+
* Subclasses implement specific function logic.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const func = FunctionFactory.create("sum");
|
|
11
|
+
* func.parameters = [expression1, expression2];
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class Function extends ASTNode {
|
|
15
|
+
protected _name: string;
|
|
16
|
+
protected _expectedParameterCount: number | null;
|
|
17
|
+
protected _supports_distinct: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new Function with the given name.
|
|
20
|
+
*
|
|
21
|
+
* @param name - The function name
|
|
22
|
+
*/
|
|
23
|
+
constructor(name: string);
|
|
24
|
+
/**
|
|
25
|
+
* Sets the function parameters.
|
|
26
|
+
*
|
|
27
|
+
* @param nodes - Array of AST nodes representing the function arguments
|
|
28
|
+
* @throws {Error} If the number of parameters doesn't match expected count
|
|
29
|
+
*/
|
|
30
|
+
set parameters(nodes: ASTNode[]);
|
|
31
|
+
get name(): string;
|
|
32
|
+
toString(): string;
|
|
33
|
+
set distinct(distinct: boolean);
|
|
34
|
+
}
|
|
35
|
+
export default Function;
|
|
36
|
+
//# sourceMappingURL=function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/function.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC;;;;;;;;;;;GAWG;AACH,cAAM,QAAS,SAAQ,OAAO;IAC1B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACxD,SAAS,CAAC,kBAAkB,EAAE,OAAO,CAAS;IAE9C;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAKxB;;;;;OAKG;IACH,IAAW,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,EAKrC;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;IAEM,QAAQ,IAAI,MAAM;IAIzB,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAMpC;CACJ;AAED,eAAe,QAAQ,CAAC"}
|