flowquery 1.0.3 → 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.
Files changed (168) hide show
  1. package/dist/compute/runner.d.ts +81 -0
  2. package/dist/compute/runner.d.ts.map +1 -0
  3. package/dist/index.browser.d.ts +10 -0
  4. package/dist/index.browser.d.ts.map +1 -0
  5. package/dist/index.d.ts +9 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.node.d.ts +14 -0
  8. package/dist/index.node.d.ts.map +1 -0
  9. package/dist/io/command_line.d.ts +28 -0
  10. package/dist/io/command_line.d.ts.map +1 -0
  11. package/dist/parsing/alias.d.ts +10 -0
  12. package/dist/parsing/alias.d.ts.map +1 -0
  13. package/dist/parsing/alias_option.d.ts +6 -0
  14. package/dist/parsing/alias_option.d.ts.map +1 -0
  15. package/dist/parsing/ast_node.d.ts +100 -0
  16. package/dist/parsing/ast_node.d.ts.map +1 -0
  17. package/dist/parsing/base_parser.d.ts +49 -0
  18. package/dist/parsing/base_parser.d.ts.map +1 -0
  19. package/dist/parsing/components/csv.d.ts +6 -0
  20. package/dist/parsing/components/csv.d.ts.map +1 -0
  21. package/dist/parsing/components/from.d.ts +7 -0
  22. package/dist/parsing/components/from.d.ts.map +1 -0
  23. package/dist/parsing/components/headers.d.ts +7 -0
  24. package/dist/parsing/components/headers.d.ts.map +1 -0
  25. package/dist/parsing/components/json.d.ts +6 -0
  26. package/dist/parsing/components/json.d.ts.map +1 -0
  27. package/dist/parsing/components/null.d.ts +6 -0
  28. package/dist/parsing/components/null.d.ts.map +1 -0
  29. package/dist/parsing/components/post.d.ts +6 -0
  30. package/dist/parsing/components/post.d.ts.map +1 -0
  31. package/dist/parsing/components/text.d.ts +6 -0
  32. package/dist/parsing/components/text.d.ts.map +1 -0
  33. package/dist/parsing/context.d.ts +38 -0
  34. package/dist/parsing/context.d.ts.map +1 -0
  35. package/dist/parsing/data_structures/associative_array.d.ts +28 -0
  36. package/dist/parsing/data_structures/associative_array.d.ts.map +1 -0
  37. package/dist/parsing/data_structures/json_array.d.ts +26 -0
  38. package/dist/parsing/data_structures/json_array.d.ts.map +1 -0
  39. package/dist/parsing/data_structures/key_value_pair.d.ts +25 -0
  40. package/dist/parsing/data_structures/key_value_pair.d.ts.map +1 -0
  41. package/dist/parsing/data_structures/lookup.d.ts +25 -0
  42. package/dist/parsing/data_structures/lookup.d.ts.map +1 -0
  43. package/dist/parsing/data_structures/range_lookup.d.ts +14 -0
  44. package/dist/parsing/data_structures/range_lookup.d.ts.map +1 -0
  45. package/dist/parsing/expressions/expression.d.ts +53 -0
  46. package/dist/parsing/expressions/expression.d.ts.map +1 -0
  47. package/dist/parsing/expressions/f_string.d.ts +21 -0
  48. package/dist/parsing/expressions/f_string.d.ts.map +1 -0
  49. package/dist/parsing/expressions/identifier.d.ts +17 -0
  50. package/dist/parsing/expressions/identifier.d.ts.map +1 -0
  51. package/dist/parsing/expressions/number.d.ts +25 -0
  52. package/dist/parsing/expressions/number.d.ts.map +1 -0
  53. package/dist/parsing/expressions/operator.d.ts +79 -0
  54. package/dist/parsing/expressions/operator.d.ts.map +1 -0
  55. package/dist/parsing/expressions/reference.d.ts +29 -0
  56. package/dist/parsing/expressions/reference.d.ts.map +1 -0
  57. package/dist/parsing/expressions/string.d.ts +23 -0
  58. package/dist/parsing/expressions/string.d.ts.map +1 -0
  59. package/dist/parsing/functions/aggregate_function.d.ts +42 -0
  60. package/dist/parsing/functions/aggregate_function.d.ts.map +1 -0
  61. package/dist/parsing/functions/async_function.d.ts +52 -0
  62. package/dist/parsing/functions/async_function.d.ts.map +1 -0
  63. package/dist/parsing/functions/avg.d.ts +15 -0
  64. package/dist/parsing/functions/avg.d.ts.map +1 -0
  65. package/dist/parsing/functions/collect.d.ts +21 -0
  66. package/dist/parsing/functions/collect.d.ts.map +1 -0
  67. package/dist/parsing/functions/function.d.ts +36 -0
  68. package/dist/parsing/functions/function.d.ts.map +1 -0
  69. package/dist/parsing/functions/function_factory.d.ts +151 -0
  70. package/dist/parsing/functions/function_factory.d.ts.map +1 -0
  71. package/dist/parsing/functions/function_metadata.d.ts +83 -0
  72. package/dist/parsing/functions/function_metadata.d.ts.map +1 -0
  73. package/dist/parsing/functions/functions.d.ts +21 -0
  74. package/dist/parsing/functions/functions.d.ts.map +1 -0
  75. package/dist/parsing/functions/join.d.ts +9 -0
  76. package/dist/parsing/functions/join.d.ts.map +1 -0
  77. package/dist/parsing/functions/predicate_function.d.ts +18 -0
  78. package/dist/parsing/functions/predicate_function.d.ts.map +1 -0
  79. package/dist/parsing/functions/predicate_function_factory.d.ts +6 -0
  80. package/dist/parsing/functions/predicate_function_factory.d.ts.map +1 -0
  81. package/dist/parsing/functions/predicate_sum.d.ts +7 -0
  82. package/dist/parsing/functions/predicate_sum.d.ts.map +1 -0
  83. package/dist/parsing/functions/rand.d.ts +7 -0
  84. package/dist/parsing/functions/rand.d.ts.map +1 -0
  85. package/dist/parsing/functions/range.d.ts +7 -0
  86. package/dist/parsing/functions/range.d.ts.map +1 -0
  87. package/dist/parsing/functions/reducer_element.d.ts +6 -0
  88. package/dist/parsing/functions/reducer_element.d.ts.map +1 -0
  89. package/dist/parsing/functions/replace.d.ts +7 -0
  90. package/dist/parsing/functions/replace.d.ts.map +1 -0
  91. package/dist/parsing/functions/round.d.ts +7 -0
  92. package/dist/parsing/functions/round.d.ts.map +1 -0
  93. package/dist/parsing/functions/size.d.ts +7 -0
  94. package/dist/parsing/functions/size.d.ts.map +1 -0
  95. package/dist/parsing/functions/split.d.ts +9 -0
  96. package/dist/parsing/functions/split.d.ts.map +1 -0
  97. package/dist/parsing/functions/stringify.d.ts +9 -0
  98. package/dist/parsing/functions/stringify.d.ts.map +1 -0
  99. package/dist/parsing/functions/sum.d.ts +14 -0
  100. package/dist/parsing/functions/sum.d.ts.map +1 -0
  101. package/dist/parsing/functions/to_json.d.ts +7 -0
  102. package/dist/parsing/functions/to_json.d.ts.map +1 -0
  103. package/dist/parsing/functions/value_holder.d.ts +8 -0
  104. package/dist/parsing/functions/value_holder.d.ts.map +1 -0
  105. package/dist/parsing/logic/case.d.ts +7 -0
  106. package/dist/parsing/logic/case.d.ts.map +1 -0
  107. package/dist/parsing/logic/else.d.ts +7 -0
  108. package/dist/parsing/logic/else.d.ts.map +1 -0
  109. package/dist/parsing/logic/end.d.ts +6 -0
  110. package/dist/parsing/logic/end.d.ts.map +1 -0
  111. package/dist/parsing/logic/then.d.ts +7 -0
  112. package/dist/parsing/logic/then.d.ts.map +1 -0
  113. package/dist/parsing/logic/when.d.ts +7 -0
  114. package/dist/parsing/logic/when.d.ts.map +1 -0
  115. package/dist/parsing/operations/aggregated_return.d.ts +8 -0
  116. package/dist/parsing/operations/aggregated_return.d.ts.map +1 -0
  117. package/dist/parsing/operations/aggregated_with.d.ts +8 -0
  118. package/dist/parsing/operations/aggregated_with.d.ts.map +1 -0
  119. package/dist/parsing/operations/group_by.d.ts +35 -0
  120. package/dist/parsing/operations/group_by.d.ts.map +1 -0
  121. package/dist/parsing/operations/limit.d.ts +10 -0
  122. package/dist/parsing/operations/limit.d.ts.map +1 -0
  123. package/dist/parsing/operations/load.d.ts +48 -0
  124. package/dist/parsing/operations/load.d.ts.map +1 -0
  125. package/dist/parsing/operations/operation.d.ts +39 -0
  126. package/dist/parsing/operations/operation.d.ts.map +1 -0
  127. package/dist/parsing/operations/projection.d.ts +8 -0
  128. package/dist/parsing/operations/projection.d.ts.map +1 -0
  129. package/dist/parsing/operations/return.d.ts +23 -0
  130. package/dist/parsing/operations/return.d.ts.map +1 -0
  131. package/dist/parsing/operations/unwind.d.ts +12 -0
  132. package/dist/parsing/operations/unwind.d.ts.map +1 -0
  133. package/dist/parsing/operations/where.d.ts +26 -0
  134. package/dist/parsing/operations/where.d.ts.map +1 -0
  135. package/dist/parsing/operations/with.d.ts +17 -0
  136. package/dist/parsing/operations/with.d.ts.map +1 -0
  137. package/dist/parsing/parser.d.ts +66 -0
  138. package/dist/parsing/parser.d.ts.map +1 -0
  139. package/dist/parsing/parser.js +1 -1
  140. package/dist/parsing/token_to_node.d.ts +7 -0
  141. package/dist/parsing/token_to_node.d.ts.map +1 -0
  142. package/dist/tokenization/keyword.d.ts +43 -0
  143. package/dist/tokenization/keyword.d.ts.map +1 -0
  144. package/dist/tokenization/operator.d.ts +22 -0
  145. package/dist/tokenization/operator.d.ts.map +1 -0
  146. package/dist/tokenization/string_walker.d.ts +55 -0
  147. package/dist/tokenization/string_walker.d.ts.map +1 -0
  148. package/dist/tokenization/symbol.d.ts +15 -0
  149. package/dist/tokenization/symbol.d.ts.map +1 -0
  150. package/dist/tokenization/token.d.ts +176 -0
  151. package/dist/tokenization/token.d.ts.map +1 -0
  152. package/dist/tokenization/token_mapper.d.ts +40 -0
  153. package/dist/tokenization/token_mapper.d.ts.map +1 -0
  154. package/dist/tokenization/token_type.d.ts +16 -0
  155. package/dist/tokenization/token_type.d.ts.map +1 -0
  156. package/dist/tokenization/tokenizer.d.ts +45 -0
  157. package/dist/tokenization/tokenizer.d.ts.map +1 -0
  158. package/dist/tokenization/trie.d.ts +41 -0
  159. package/dist/tokenization/trie.d.ts.map +1 -0
  160. package/dist/utils/object_utils.d.ts +15 -0
  161. package/dist/utils/object_utils.d.ts.map +1 -0
  162. package/dist/utils/string_utils.d.ts +51 -0
  163. package/dist/utils/string_utils.d.ts.map +1 -0
  164. package/misc/apps/RAG/package.json +1 -1
  165. package/misc/apps/RAG/src/index.ts +4 -4
  166. package/package.json +1 -1
  167. package/src/parsing/parser.ts +1 -1
  168. package/tsconfig.json +3 -1
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Utility class for object-related operations.
3
+ */
4
+ declare class ObjectUtils {
5
+ /**
6
+ * Checks if an object is an instance of any of the provided classes.
7
+ *
8
+ * @param obj - The object to check
9
+ * @param classes - Array of class constructors to test against
10
+ * @returns True if the object is an instance of any class, false otherwise
11
+ */
12
+ static isInstanceOfAny(obj: any, classes: any[]): boolean;
13
+ }
14
+ export default ObjectUtils;
15
+ //# sourceMappingURL=object_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object_utils.d.ts","sourceRoot":"","sources":["../../src/utils/object_utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAM,WAAW;IACb;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO;CAG5D;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Utility class for string manipulation and validation.
3
+ *
4
+ * Provides methods for handling quoted strings, comments, escape sequences,
5
+ * and identifier validation.
6
+ */
7
+ declare class StringUtils {
8
+ static readonly quotes: string[];
9
+ static readonly letters = "abcdefghijklmnopqrstuvwxyz";
10
+ static readonly digits = "0123456789";
11
+ static readonly whitespace = " \t\n\r";
12
+ static readonly word_valid_chars: string;
13
+ /**
14
+ * Removes surrounding quotes from a string.
15
+ *
16
+ * @param str - The string to unquote
17
+ * @returns The unquoted string
18
+ */
19
+ static unquote(str: string): string;
20
+ /**
21
+ * Removes comment markers from a string.
22
+ *
23
+ * @param str - The comment string
24
+ * @returns The string without comment markers
25
+ */
26
+ static uncomment(str: string): string;
27
+ /**
28
+ * Removes escape sequences before quotes in a string.
29
+ *
30
+ * @param str - The string to process
31
+ * @param quoteChar - The quote character that was escaped
32
+ * @returns The string with escape sequences removed
33
+ */
34
+ static removeEscapedQuotes(str: string, quoteChar: string): string;
35
+ /**
36
+ * Removes escaped braces ({{ and }}) from f-strings.
37
+ *
38
+ * @param str - The string to process
39
+ * @returns The string with escaped braces resolved
40
+ */
41
+ static removeEscapedBraces(str: string): string;
42
+ /**
43
+ * Checks if a string is a valid identifier.
44
+ *
45
+ * @param str - The string to validate
46
+ * @returns True if the string can be used as an identifier, false otherwise
47
+ */
48
+ static can_be_identifier(str: string): boolean;
49
+ }
50
+ export default StringUtils;
51
+ //# sourceMappingURL=string_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string_utils.d.ts","sourceRoot":"","sources":["../../src/utils/string_utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAM,WAAW;IACb,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAmB;IACnD,MAAM,CAAC,QAAQ,CAAC,OAAO,gCAAgC;IACvD,MAAM,CAAC,QAAQ,CAAC,MAAM,gBAAgB;IACtC,MAAM,CAAC,QAAQ,CAAC,UAAU,aAAa;IACvC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,SAAkD;IAElF;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAqBnC;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAarC;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAWlE;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAW/C;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAWjD;AAED,eAAe,WAAW,CAAC"}
@@ -18,7 +18,7 @@
18
18
  "author": "",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "flowquery": "^1.0.2"
21
+ "flowquery": "^1.0.3"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^22.0.0",
@@ -1,4 +1,4 @@
1
- import { run } from 'flowquery';
1
+ import { FlowQuery } from 'flowquery';
2
2
 
3
3
  /**
4
4
  * RAG (Retrieval Augmented Generation) loop using FlowQuery.
@@ -7,11 +7,11 @@ import { run } from 'flowquery';
7
7
  */
8
8
  async function main() {
9
9
  // Example: Run a simple FlowQuery query
10
- const query = `return 1`;
10
+ const query = new FlowQuery('WITH 1 AS x RETURN x + 1');
11
11
 
12
12
  try {
13
- const result = await run(query);
14
- console.log('Result:', result);
13
+ await query.run();
14
+ console.log('Result:', query.results); // [ { expr0: 2 } ]
15
15
  } catch (error) {
16
16
  console.error('Error running query:', error);
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowquery",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A declarative query language for data processing pipelines.",
5
5
  "main": "dist/index.node.js",
6
6
  "types": "dist/index.node.d.ts",
@@ -50,7 +50,7 @@ import Null from "./components/null";
50
50
  * @example
51
51
  * ```typescript
52
52
  * const parser = new Parser();
53
- * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
53
+ * const ast = parser.parse("unwind [1, 2, 3, 4] as num return num");
54
54
  * ```
55
55
  */
56
56
  class Parser extends BaseParser {
package/tsconfig.json CHANGED
@@ -9,7 +9,9 @@
9
9
  "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
10
10
  "strict": true,
11
11
  "types": ["node", "jest"],
12
- "sourceMap": true
12
+ "sourceMap": true,
13
+ "declaration": true, /* Generate .d.ts declaration files. */
14
+ "declarationMap": true /* Generate sourcemaps for .d.ts files. */
13
15
  },
14
16
  "include": ["src"]
15
17
  }