@lowgular/code-graph 0.0.1 → 0.1.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.
Files changed (179) hide show
  1. package/bin/cli.js +10 -0
  2. package/code-graph-v2/code.graph.js +37 -0
  3. package/code-graph-v2/config-from-query.js +131 -0
  4. package/code-graph-v2/extractors/extractor.js +27 -0
  5. package/code-graph-v2/extractors/index.js +1 -0
  6. package/code-graph-v2/graph-builder/code-graph.builder.js +49 -0
  7. package/code-graph-v2/graph-builder/index.js +1 -0
  8. package/code-graph-v2/graph-builder/node.processor.js +22 -0
  9. package/{libs/cli/code-graph/src/lib/v2 → code-graph-v2}/graph-builder/relationship.processor.js +11 -35
  10. package/code-graph-v2/graph-builder/type.processor.js +21 -0
  11. package/code-graph-v2/index.js +4 -0
  12. package/code-graph-v2/tools/build-code-graph.tool.js +19 -0
  13. package/code-graph-v2/utils.js +34 -0
  14. package/codegular/index.js +5 -0
  15. package/codegular/node.js +71 -0
  16. package/codegular/program.js +100 -0
  17. package/{libs/core/codegular/src/lib → codegular}/string.js +6 -53
  18. package/{libs/core/codegular/src/lib → codegular}/type-checker.js +3 -40
  19. package/codegular/type.js +356 -0
  20. package/{libs/core/codegular/src/lib → codegular}/utils.js +50 -62
  21. package/cypher/index.js +1 -0
  22. package/{libs/cli/cypher/src → cypher}/lib/executor/condition-evaluator.js +2 -25
  23. package/cypher/lib/executor/executor.js +60 -0
  24. package/cypher/lib/executor/graph.js +0 -0
  25. package/{libs/cli/cypher/src → cypher}/lib/executor/match-engine.js +4 -27
  26. package/{libs/cli/cypher/src → cypher}/lib/executor/pattern-matcher.js +2 -25
  27. package/{libs/cli/cypher/src → cypher}/lib/executor/relationship-navigator.js +2 -25
  28. package/{libs/cli/cypher/src → cypher}/lib/executor/result-formatter.js +37 -31
  29. package/{libs/cli/cypher/src → cypher}/lib/executor/traverse-engine.js +4 -27
  30. package/cypher/lib/executor/utils.js +14 -0
  31. package/cypher/lib/graph.stub.js +38 -0
  32. package/cypher/lib/index.js +32 -0
  33. package/{libs/cli/cypher/src → cypher}/lib/lexer.js +4 -26
  34. package/{libs/cli/cypher/src → cypher}/lib/parser.js +119 -135
  35. package/{libs/cli/cypher/src → cypher}/lib/validator/query-validator.js +12 -32
  36. package/{libs/cli/cypher/src → cypher}/lib/validator/supported-features.config.js +2 -30
  37. package/{libs/cli/cypher/src → cypher}/lib/validator/unsupported-features.config.js +8 -34
  38. package/cypher-cli.js +41 -0
  39. package/infra/code-graph.js +147 -0
  40. package/main.js +0 -43
  41. package/package.json +25 -7
  42. package/resources-cli.js +75 -0
  43. package/run-cli.js +43 -0
  44. package/apps/code-graph/src/main.js +0 -50
  45. package/libs/cli/code-graph/src/index.js +0 -39
  46. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
  47. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
  48. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
  49. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
  50. package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
  51. package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
  52. package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
  53. package/libs/cli/code-graph/src/lib/core/core.js +0 -58
  54. package/libs/cli/code-graph/src/lib/core.js +0 -85
  55. package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
  56. package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
  57. package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
  58. package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
  59. package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
  60. package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
  61. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
  62. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
  63. package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
  64. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
  65. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
  66. package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
  67. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
  68. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
  69. package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
  70. package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
  71. package/libs/cli/code-graph/src/lib/types/index.js +0 -99
  72. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
  73. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
  74. package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
  75. package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
  76. package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
  77. package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
  78. package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
  79. package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
  80. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
  81. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
  82. package/libs/cli/cypher/src/index.js +0 -25
  83. package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
  84. package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
  85. package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
  86. package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
  87. package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
  88. package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
  89. package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
  90. package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
  91. package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
  92. package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
  93. package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
  94. package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
  95. package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
  96. package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
  97. package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
  98. package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
  99. package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
  100. package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
  101. package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
  102. package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
  103. package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
  104. package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
  105. package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
  106. package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
  107. package/libs/cli/cypher/src/lib/index.js +0 -74
  108. package/libs/cli/shared/src/index.js +0 -53
  109. package/libs/cli/shared/src/lib/admin-token.js +0 -121
  110. package/libs/cli/shared/src/lib/config.js +0 -49
  111. package/libs/cli/shared/src/lib/consts.js +0 -57
  112. package/libs/cli/shared/src/lib/core.js +0 -46
  113. package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
  114. package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
  115. package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
  116. package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
  117. package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
  118. package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
  119. package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
  120. package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
  121. package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
  122. package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
  123. package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
  124. package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
  125. package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
  126. package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
  127. package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
  128. package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
  129. package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
  130. package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
  131. package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
  132. package/libs/cli/shared/src/lib/token.js +0 -135
  133. package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
  134. package/libs/cli/shared/src/lib/utils/utils.js +0 -89
  135. package/libs/cli/typescript/src/index.js +0 -21
  136. package/libs/cli/typescript/src/lib/base/index.js +0 -23
  137. package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
  138. package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
  139. package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
  140. package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
  141. package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
  142. package/libs/cli/typescript/src/lib/core/index.js +0 -35
  143. package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
  144. package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
  145. package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
  146. package/libs/cli/typescript/src/lib/core/type.js +0 -374
  147. package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
  148. package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
  149. package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
  150. package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
  151. package/libs/cli/typescript/src/lib/index.js +0 -57
  152. package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
  153. package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
  154. package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
  155. package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
  156. package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
  157. package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
  158. package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
  159. package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
  160. package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
  161. package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
  162. package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
  163. package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
  164. package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
  165. package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
  166. package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
  167. package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
  168. package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
  169. package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
  170. package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
  171. package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
  172. package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
  173. package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
  174. package/libs/cli/typescript/src/lib/utils.js +0 -39
  175. package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
  176. package/libs/core/codegular/src/index.js +0 -21
  177. package/libs/core/codegular/src/lib/index.js +0 -29
  178. package/libs/core/codegular/src/lib/node.js +0 -112
  179. package/libs/core/codegular/src/lib/program.js +0 -92
@@ -1,152 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var property_matching_feature_exports = {};
19
- __export(property_matching_feature_exports, {
20
- PROPERTY_MATCHING_FEATURES: () => PROPERTY_MATCHING_FEATURES
21
- });
22
- module.exports = __toCommonJS(property_matching_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const PROPERTY_MATCHING_FEATURES = [
25
- {
26
- name: "Match node with single property",
27
- description: "Filter nodes by a single property value in the pattern. Properties are matched exactly.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { id: "1" })).addNode((0, import_graph2.stubNode)("2", "A", { id: "2" })).build(),
29
- queries: [['MATCH (n:A {id: "1"})', "RETURN n"]],
30
- results: [
31
- {
32
- n: {
33
- id: "1"
34
- }
35
- }
36
- ]
37
- },
38
- {
39
- name: "Match node with number property",
40
- description: "Properties can be numbers (integers or floats).",
41
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 42 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 10 })).build(),
42
- queries: [["MATCH (n:A {count: 42})", "RETURN n"]],
43
- results: [
44
- {
45
- n: {
46
- id: "1"
47
- }
48
- }
49
- ]
50
- },
51
- {
52
- name: "Match node with boolean property",
53
- description: "Properties can be boolean values (true/false).",
54
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { active: true })).addNode((0, import_graph2.stubNode)("2", "A", { active: false })).build(),
55
- queries: [["MATCH (n:A {active: true})", "RETURN n"]],
56
- results: [
57
- {
58
- n: {
59
- id: "1"
60
- }
61
- }
62
- ]
63
- },
64
- {
65
- name: "Match node with multiple properties",
66
- description: "Filter nodes by multiple property values. All properties must match exactly.",
67
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 5 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 5 })).addNode((0, import_graph2.stubNode)("3", "A", { count: 3 })).build(),
68
- queries: [['MATCH (n:A {id: "1", count: 5})', "RETURN n"]],
69
- results: [
70
- {
71
- n: {
72
- id: "1"
73
- }
74
- }
75
- ]
76
- },
77
- {
78
- name: "Match node with empty property map",
79
- description: "Empty property map `{}` matches all nodes with the specified label, regardless of their properties.",
80
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).build(),
81
- queries: [["MATCH (n:A {})", "RETURN n"]],
82
- results: [
83
- {
84
- n: {
85
- id: "1"
86
- }
87
- },
88
- {
89
- n: {
90
- id: "2"
91
- }
92
- }
93
- ]
94
- },
95
- {
96
- name: "Match node with array property",
97
- description: "Properties can be arrays. Arrays are matched exactly (same elements in same order).",
98
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { tags: ["a", "b"] })).addNode((0, import_graph2.stubNode)("2", "A", { tags: ["a"] })).addNode((0, import_graph2.stubNode)("3", "A", { tags: ["a", "b", "c"] })).build(),
99
- queries: [['MATCH (n:A {tags: ["a", "b"]})', "RETURN n"]],
100
- results: [
101
- {
102
- n: {
103
- id: "1"
104
- }
105
- }
106
- ]
107
- },
108
- {
109
- name: "Match node with array of numbers property",
110
- description: "Array properties can contain numbers.",
111
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { tags: [1, 2, 3] })).addNode((0, import_graph2.stubNode)("2", "A", { tags: [1, 2] })).build(),
112
- queries: [["MATCH (n:A {tags: [1, 2, 3]})", "RETURN n"]],
113
- results: [
114
- {
115
- n: {
116
- id: "1"
117
- }
118
- }
119
- ]
120
- },
121
- {
122
- name: "Match node with mixed property types including array",
123
- description: "Multiple properties of different types (boolean, array, etc.) can be combined in a single pattern.",
124
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { active: true, tags: ["a"] })).addNode((0, import_graph2.stubNode)("2", "A", { active: true, tags: ["b"] })).addNode((0, import_graph2.stubNode)("3", "A", { active: false, tags: ["a"] })).build(),
125
- queries: [['MATCH (n:A {active: true, tags: ["a"]})', "RETURN n"]],
126
- results: [
127
- {
128
- n: {
129
- id: "1"
130
- }
131
- }
132
- ]
133
- },
134
- {
135
- name: "Return empty when matching non-existent property",
136
- description: "If a property specified in the pattern does not exist on any nodes, the query returns no results.",
137
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).build(),
138
- queries: [['MATCH (n:A {missing: "value"})', "RETURN n"]],
139
- results: []
140
- },
141
- {
142
- name: "Return empty when one property exists but other does not",
143
- description: "All properties in the pattern must exist and match. If any property is missing, no results are returned.",
144
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).build(),
145
- queries: [['MATCH (n:A {id: "1", missing: "value"})', "RETURN n"]],
146
- results: []
147
- }
148
- ];
149
- // Annotate the CommonJS export names for ESM import in node:
150
- 0 && (module.exports = {
151
- PROPERTY_MATCHING_FEATURES
152
- });
@@ -1,48 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var relationship_without_variable_feature_exports = {};
19
- __export(relationship_without_variable_feature_exports, {
20
- RELATIONSHIP_WITHOUT_VARIABLE_FEATURES: () => RELATIONSHIP_WITHOUT_VARIABLE_FEATURES
21
- });
22
- module.exports = __toCommonJS(relationship_without_variable_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const RELATIONSHIP_WITHOUT_VARIABLE_FEATURES = [
25
- {
26
- name: "Not include edge in results when no variable",
27
- description: "When relationship variable is not bound (e.g., -[:TYPE]->), edge is not included in results. Only nodes are returned.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).build(),
29
- queries: [
30
- ["MATCH (a:A)-[:R1]->(b:B)", "RETURN a, b"],
31
- ["MATCH (b:B)<-[:R1]-(a:A)", "RETURN a, b"]
32
- ],
33
- results: [
34
- {
35
- a: {
36
- id: "1"
37
- },
38
- b: {
39
- id: "2"
40
- }
41
- }
42
- ]
43
- }
44
- ];
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
47
- RELATIONSHIP_WITHOUT_VARIABLE_FEATURES
48
- });
@@ -1,65 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var return_statement_feature_exports = {};
19
- __export(return_statement_feature_exports, {
20
- RETURN_STATEMENT_FEATURES: () => RETURN_STATEMENT_FEATURES
21
- });
22
- module.exports = __toCommonJS(return_statement_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const RETURN_STATEMENT_FEATURES = [
25
- {
26
- name: "Return all nodes",
27
- description: "The default behavior is to return all nodes.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1")).addNode((0, import_graph2.stubNode)("2")).build(),
29
- queries: [["MATCH (n) RETURN *"]],
30
- results: [
31
- {
32
- n: {
33
- id: "1"
34
- }
35
- },
36
- {
37
- n: {
38
- id: "2"
39
- }
40
- }
41
- ]
42
- },
43
- {
44
- name: "Return aliased nodes",
45
- description: "Return aliased nodes by using the AS keyword.",
46
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1")).addNode((0, import_graph2.stubNode)("2")).build(),
47
- queries: [["MATCH (n) RETURN n AS node"]],
48
- results: [
49
- {
50
- node: {
51
- id: "1"
52
- }
53
- },
54
- {
55
- node: {
56
- id: "2"
57
- }
58
- }
59
- ]
60
- }
61
- ];
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- RETURN_STATEMENT_FEATURES
65
- });
@@ -1,82 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var unidirected_relationship_feature_exports = {};
19
- __export(unidirected_relationship_feature_exports, {
20
- UNDIRECTED_RELATIONSHIP_FEATURES: () => UNDIRECTED_RELATIONSHIP_FEATURES
21
- });
22
- module.exports = __toCommonJS(unidirected_relationship_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const UNDIRECTED_RELATIONSHIP_FEATURES = [
25
- {
26
- name: "Match undirected relationship (both directions)",
27
- description: "Undirected relationships match edges in either direction. Use -[:TYPE]- syntax.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).build(),
29
- queries: [["MATCH (a:A)-[:R1]-(b:B)", "RETURN a, b"]],
30
- results: [
31
- {
32
- a: {
33
- id: "1"
34
- },
35
- b: {
36
- id: "2"
37
- }
38
- }
39
- ]
40
- },
41
- {
42
- name: "Match undirected relationship in reverse direction",
43
- description: "Undirected relationships match edges regardless of their stored direction.",
44
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("2", "1", "R1")).build(),
45
- queries: [["MATCH (a:A)-[:R1]-(b:B)", "RETURN a, b"]],
46
- results: [
47
- {
48
- a: {
49
- id: "1"
50
- },
51
- b: {
52
- id: "2"
53
- }
54
- }
55
- ]
56
- },
57
- {
58
- name: "Bind relationship variable in undirected relationship",
59
- description: "When relationship variable is bound in undirected relationship, edge object is included in results with source, target, and type.",
60
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).build(),
61
- queries: [["MATCH (a:A)-[rel:R1]-(b:B)", "RETURN a, rel, b"]],
62
- results: [
63
- {
64
- a: {
65
- id: "1"
66
- },
67
- rel: {
68
- source: "1",
69
- target: "2",
70
- type: "R1"
71
- },
72
- b: {
73
- id: "2"
74
- }
75
- }
76
- ]
77
- }
78
- ];
79
- // Annotate the CommonJS export names for ESM import in node:
80
- 0 && (module.exports = {
81
- UNDIRECTED_RELATIONSHIP_FEATURES
82
- });
@@ -1,136 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var variable_length_path_feature_exports = {};
19
- __export(variable_length_path_feature_exports, {
20
- VARIABLE_LENGTH_PATH_FEATURES: () => VARIABLE_LENGTH_PATH_FEATURES
21
- });
22
- module.exports = __toCommonJS(variable_length_path_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const VARIABLE_LENGTH_PATH_FEATURES = [
25
- {
26
- name: "Match zero-length path (same node)",
27
- description: "Variable-length paths with * support zero-length paths, matching when source and target are the same node.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).build(),
29
- queries: [["MATCH (a:A)-[:R*]->(a)", "RETURN a"]],
30
- results: [
31
- {
32
- a: {
33
- id: "1"
34
- }
35
- }
36
- ]
37
- },
38
- {
39
- name: "Return empty when no path exists",
40
- description: "When no path exists between source and target nodes, variable-length path returns no results.",
41
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).build(),
42
- queries: [["MATCH (a:A)-[:R*]->(b:B)", "RETURN a, b"]],
43
- results: []
44
- },
45
- {
46
- name: "Handle multiple valid paths",
47
- description: "Variable-length paths find all valid paths between source and target nodes.",
48
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "C")).addNode((0, import_graph2.stubNode)("3", "C")).addNode((0, import_graph2.stubNode)("4", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R")).addEdge((0, import_graph2.stubEdge)("1", "3", "R")).addEdge((0, import_graph2.stubEdge)("2", "4", "R")).addEdge((0, import_graph2.stubEdge)("3", "4", "R")).build(),
49
- queries: [["MATCH (a:A)-[r:R*]->(b:B)", "RETURN a, r, b"]],
50
- results: [
51
- {
52
- a: {
53
- id: "1"
54
- },
55
- r: {
56
- source: "2",
57
- target: "4",
58
- type: "R"
59
- },
60
- b: {
61
- id: "4"
62
- }
63
- },
64
- {
65
- a: {
66
- id: "1"
67
- },
68
- r: {
69
- source: "3",
70
- target: "4",
71
- type: "R"
72
- },
73
- b: {
74
- id: "4"
75
- }
76
- }
77
- ]
78
- },
79
- {
80
- name: "Prevent infinite loops with cycles",
81
- description: "Variable-length paths handle cycles correctly, preventing infinite loops while still finding valid paths.",
82
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "C")).addNode((0, import_graph2.stubNode)("3", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R")).addEdge((0, import_graph2.stubEdge)("2", "2", "R")).addEdge((0, import_graph2.stubEdge)("2", "3", "R")).build(),
83
- queries: [["MATCH (a:A)-[:R*]->(b:B)", "RETURN a, b"]],
84
- results: [
85
- {
86
- a: {
87
- id: "1"
88
- },
89
- b: {
90
- id: "3"
91
- }
92
- }
93
- ]
94
- },
95
- {
96
- name: "Handle cycle in path but still reach target",
97
- description: "Variable-length paths can traverse through cycles but still reach the target node without getting stuck.",
98
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "C")).addNode((0, import_graph2.stubNode)("3", "C")).addNode((0, import_graph2.stubNode)("4", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R")).addEdge((0, import_graph2.stubEdge)("2", "3", "R")).addEdge((0, import_graph2.stubEdge)("3", "2", "R")).addEdge((0, import_graph2.stubEdge)("2", "4", "R")).build(),
99
- queries: [["MATCH (a:A)-[:R*]->(b:B)", "RETURN a, b"]],
100
- results: [
101
- {
102
- a: {
103
- id: "1"
104
- },
105
- b: {
106
- id: "4"
107
- }
108
- }
109
- ]
110
- },
111
- {
112
- name: "Bind relationship variable in variable-length path",
113
- description: "When relationship variable is bound in variable-length path, it binds to the last edge in the path.",
114
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "C")).addNode((0, import_graph2.stubNode)("3", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R")).addEdge((0, import_graph2.stubEdge)("2", "3", "R")).build(),
115
- queries: [["MATCH (a:A)-[rel:R*]->(b:B)", "RETURN a, rel, b"]],
116
- results: [
117
- {
118
- a: {
119
- id: "1"
120
- },
121
- rel: {
122
- source: "2",
123
- target: "3",
124
- type: "R"
125
- },
126
- b: {
127
- id: "3"
128
- }
129
- }
130
- ]
131
- }
132
- ];
133
- // Annotate the CommonJS export names for ESM import in node:
134
- 0 && (module.exports = {
135
- VARIABLE_LENGTH_PATH_FEATURES
136
- });
@@ -1,187 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var where_conditional_feature_exports = {};
19
- __export(where_conditional_feature_exports, {
20
- WHERE_CONDITIONAL_LOGIC_FEATURES: () => WHERE_CONDITIONAL_LOGIC_FEATURES
21
- });
22
- module.exports = __toCommonJS(where_conditional_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const WHERE_CONDITIONAL_LOGIC_FEATURES = [
25
- {
26
- name: "Filter with OR logic (strings)",
27
- description: "Use OR operator to filter nodes where property matches any of multiple string values.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { type: "X" })).addNode((0, import_graph2.stubNode)("2", "A", { type: "Y" })).addNode((0, import_graph2.stubNode)("3", "A", { type: "Z" })).build(),
29
- queries: [
30
- ["MATCH (a:A)", 'WHERE a.type = "X" OR a.type = "Y"', "RETURN a"]
31
- ],
32
- results: [
33
- {
34
- a: {
35
- id: "1"
36
- }
37
- },
38
- {
39
- a: {
40
- id: "2"
41
- }
42
- }
43
- ]
44
- },
45
- {
46
- name: "Filter with OR logic (numbers)",
47
- description: "Use OR operator to filter nodes where property matches any of multiple number values.",
48
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 3 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 5 })).addNode((0, import_graph2.stubNode)("3", "A", { count: 7 })).build(),
49
- queries: [["MATCH (a:A)", "WHERE a.count = 3 OR a.count = 7", "RETURN a"]],
50
- results: [
51
- {
52
- a: {
53
- id: "1"
54
- }
55
- },
56
- {
57
- a: {
58
- id: "3"
59
- }
60
- }
61
- ]
62
- },
63
- {
64
- name: "Filter with multiple OR conditions",
65
- description: "Use multiple OR conditions to filter nodes matching any of three or more values.",
66
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { type: "X" })).addNode((0, import_graph2.stubNode)("2", "A", { type: "Y" })).addNode((0, import_graph2.stubNode)("3", "A", { type: "Z" })).addNode((0, import_graph2.stubNode)("4", "A", { type: "W" })).build(),
67
- queries: [
68
- [
69
- "MATCH (a:A)",
70
- 'WHERE a.type = "X" OR a.type = "Y" OR a.type = "Z"',
71
- "RETURN a"
72
- ]
73
- ],
74
- results: [
75
- {
76
- a: {
77
- id: "1"
78
- }
79
- },
80
- {
81
- a: {
82
- id: "2"
83
- }
84
- },
85
- {
86
- a: {
87
- id: "3"
88
- }
89
- }
90
- ]
91
- },
92
- {
93
- name: "Filter with multiple AND conditions",
94
- description: "Use multiple AND conditions to filter nodes where all specified properties match.",
95
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { type: "X", count: 5 })).addNode((0, import_graph2.stubNode)("2", "A", { type: "X", count: 3 })).addNode((0, import_graph2.stubNode)("3", "A", { type: "Y", count: 5 })).build(),
96
- queries: [
97
- ["MATCH (a:A)", 'WHERE a.type = "X" AND a.count = 5', "RETURN a"]
98
- ],
99
- results: [
100
- {
101
- a: {
102
- id: "1"
103
- }
104
- }
105
- ]
106
- },
107
- {
108
- name: "Filter with AND using comparison operators",
109
- description: "Use AND with comparison operators to filter nodes within a range of values.",
110
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 2 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 5 })).addNode((0, import_graph2.stubNode)("3", "A", { count: 7 })).addNode((0, import_graph2.stubNode)("4", "A", { count: 12 })).build(),
111
- queries: [
112
- ["MATCH (a:A)", "WHERE a.count > 3 AND a.count < 10", "RETURN a"]
113
- ],
114
- results: [
115
- {
116
- a: {
117
- id: "2"
118
- }
119
- },
120
- {
121
- a: {
122
- id: "3"
123
- }
124
- }
125
- ]
126
- },
127
- {
128
- name: "Filter with WHERE on relationship pattern (source node)",
129
- description: "Apply WHERE clause to filter relationship matches based on source node properties.",
130
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 3 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 7 })).addNode((0, import_graph2.stubNode)("3", "B")).addEdge((0, import_graph2.stubEdge)("1", "3", "R1")).addEdge((0, import_graph2.stubEdge)("2", "3", "R1")).build(),
131
- queries: [["MATCH (a:A)-[r:R1]->(:B)", "WHERE a.count > 5", "RETURN a"]],
132
- results: [
133
- {
134
- a: {
135
- id: "2"
136
- }
137
- }
138
- ]
139
- },
140
- {
141
- name: "Filter with WHERE on relationship pattern (target node)",
142
- description: "Apply WHERE clause to filter relationship matches based on target node properties.",
143
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B", { type: "X" })).addNode((0, import_graph2.stubNode)("3", "B", { type: "Y" })).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addEdge((0, import_graph2.stubEdge)("1", "3", "R1")).build(),
144
- queries: [
145
- ["MATCH (a:A)-[:R1]->(b:B)", 'WHERE b.type = "X"', "RETURN a, b"]
146
- ],
147
- results: [
148
- {
149
- a: {
150
- id: "1"
151
- },
152
- b: {
153
- id: "2"
154
- }
155
- }
156
- ]
157
- },
158
- {
159
- name: "Filter with WHERE on 2-hop relationship pattern",
160
- description: "Apply WHERE clause to filter multi-hop relationship matches based on properties of nodes at different hops.",
161
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A", { count: 5 })).addNode((0, import_graph2.stubNode)("2", "A", { count: 3 })).addNode((0, import_graph2.stubNode)("3", "B")).addNode((0, import_graph2.stubNode)("4", "C", { type: "X" })).addNode((0, import_graph2.stubNode)("5", "C", { type: "Y" })).addEdge((0, import_graph2.stubEdge)("1", "3", "R1")).addEdge((0, import_graph2.stubEdge)("2", "3", "R1")).addEdge((0, import_graph2.stubEdge)("3", "4", "R2")).addEdge((0, import_graph2.stubEdge)("3", "5", "R2")).build(),
162
- queries: [
163
- [
164
- "MATCH (a:A)-[:R1]->(b:B)-[:R2]->(c:C)",
165
- 'WHERE a.count = 5 AND c.type = "X"',
166
- "RETURN a, b, c"
167
- ]
168
- ],
169
- results: [
170
- {
171
- a: {
172
- id: "1"
173
- },
174
- b: {
175
- id: "3"
176
- },
177
- c: {
178
- id: "4"
179
- }
180
- }
181
- ]
182
- }
183
- ];
184
- // Annotate the CommonJS export names for ESM import in node:
185
- 0 && (module.exports = {
186
- WHERE_CONDITIONAL_LOGIC_FEATURES
187
- });