gremlin 3.5.0 → 3.5.3

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 (91) hide show
  1. package/.eslintrc.js +154 -0
  2. package/.prettierrc.js +29 -0
  3. package/Gruntfile.js +15 -16
  4. package/NOTICE +1 -1
  5. package/doc/AnonymousTraversalSource.html +7 -7
  6. package/doc/Authenticator.html +3 -3
  7. package/doc/Bytecode.html +249 -5
  8. package/doc/Client.html +139 -65
  9. package/doc/Connection.html +90 -6
  10. package/doc/DriverRemoteConnection.html +380 -8
  11. package/doc/EdgeLabelVerificationStrategy.html +3 -3
  12. package/doc/Graph.html +2 -2
  13. package/doc/GraphSON2Reader.html +4 -4
  14. package/doc/GraphSON2Writer.html +3 -3
  15. package/doc/GraphSON3Reader.html +3 -3
  16. package/doc/GraphSON3Writer.html +3 -3
  17. package/doc/GraphTraversal.html +107 -107
  18. package/doc/GraphTraversalSource.html +130 -19
  19. package/doc/HaltedTraverserStrategy.html +3 -3
  20. package/doc/MatchAlgorithmStrategy.html +3 -3
  21. package/doc/P.html +13 -13
  22. package/doc/PartitionStrategy.html +3 -3
  23. package/doc/Path.html +2 -2
  24. package/doc/PlainTextSaslAuthenticator.html +2 -2
  25. package/doc/ProductiveByStrategy.html +288 -0
  26. package/doc/RemoteConnection.html +484 -10
  27. package/doc/RemoteStrategy.html +4 -4
  28. package/doc/RemoteTraversal.html +3 -3
  29. package/doc/ReservedKeysVerificationStrategy.html +3 -3
  30. package/doc/ResponseError.html +3 -3
  31. package/doc/ResultSet.html +8 -8
  32. package/doc/SaslAuthenticator.html +2 -2
  33. package/doc/SaslMechanismBase.html +3 -3
  34. package/doc/SaslMechanismPlain.html +6 -6
  35. package/doc/{GraphSONReader.html → SeedStrategy.html} +12 -15
  36. package/doc/SubgraphStrategy.html +3 -3
  37. package/doc/TextP.html +10 -10
  38. package/doc/Transaction.html +655 -0
  39. package/doc/Translator.html +200 -6
  40. package/doc/TraversalStrategies.html +137 -4
  41. package/doc/TraversalStrategy.html +4 -4
  42. package/doc/TypeSerializer.html +2 -2
  43. package/doc/driver_auth_authenticator.js.html +4 -4
  44. package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +3 -3
  45. package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +26 -17
  46. package/doc/driver_auth_plain-text-sasl-authenticator.js.html +7 -7
  47. package/doc/driver_auth_sasl-authenticator.js.html +3 -3
  48. package/doc/driver_client.js.html +75 -25
  49. package/doc/driver_connection.js.html +108 -89
  50. package/doc/driver_driver-remote-connection.js.html +40 -9
  51. package/doc/driver_remote-connection.js.html +47 -6
  52. package/doc/driver_response-error.js.html +5 -4
  53. package/doc/driver_result-set.js.html +4 -4
  54. package/doc/global.html +200 -3
  55. package/doc/index.html +2 -2
  56. package/doc/process_anonymous-traversal.js.html +5 -5
  57. package/doc/process_bytecode.js.html +32 -7
  58. package/doc/process_graph-traversal.js.html +213 -143
  59. package/doc/process_transaction.js.html +143 -0
  60. package/doc/process_translator.js.html +58 -39
  61. package/doc/process_traversal-strategy.js.html +79 -52
  62. package/doc/process_traversal.js.html +101 -108
  63. package/doc/structure_graph.js.html +7 -7
  64. package/doc/structure_io_graph-serializer.js.html +65 -18
  65. package/doc/structure_io_type-serializers.js.html +86 -89
  66. package/index.js +5 -5
  67. package/lib/driver/auth/authenticator.js +2 -2
  68. package/lib/driver/auth/mechanisms/sasl-mechanism-base.js +1 -1
  69. package/lib/driver/auth/mechanisms/sasl-mechanism-plain.js +24 -15
  70. package/lib/driver/auth/plain-text-sasl-authenticator.js +5 -5
  71. package/lib/driver/auth/sasl-authenticator.js +1 -1
  72. package/lib/driver/client.js +73 -23
  73. package/lib/driver/connection.js +106 -87
  74. package/lib/driver/driver-remote-connection.js +38 -7
  75. package/lib/driver/remote-connection.js +45 -4
  76. package/lib/driver/response-error.js +2 -2
  77. package/lib/driver/result-set.js +1 -2
  78. package/lib/process/anonymous-traversal.js +2 -3
  79. package/lib/process/bytecode.js +30 -5
  80. package/lib/process/graph-traversal.js +210 -141
  81. package/lib/process/transaction.js +92 -0
  82. package/lib/process/translator.js +55 -37
  83. package/lib/process/traversal-strategy.js +76 -50
  84. package/lib/process/traversal.js +99 -106
  85. package/lib/structure/graph.js +5 -5
  86. package/lib/structure/io/graph-serializer.js +62 -16
  87. package/lib/structure/io/type-serializers.js +84 -87
  88. package/lib/utils.js +15 -10
  89. package/package.json +11 -5
  90. package/doc/GraphSONWriter.html +0 -436
  91. package/gremlin-javascript.iml +0 -9
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ 'use strict';
20
+
21
+ const remote = require('../driver/remote-connection');
22
+ const Bytecode = require('./bytecode');
23
+ const { TraversalStrategies } = require('./traversal-strategy');
24
+
25
+ /**
26
+ * A controller for a remote transaction that is constructed from <code>g.tx()</code>. Calling <code>begin()</code>
27
+ * on this object will produce a new <code>GraphTraversalSource</code> that is bound to a remote transaction over which
28
+ * multiple traversals may be executed in that context. Calling <code>commit()</code> or <code>rollback()</code> will
29
+ * then close the transaction and thus, the session. This feature only works with transaction enabled graphs.
30
+ */
31
+ class Transaction {
32
+ constructor(g) {
33
+ this._g = g;
34
+ this._sessionBasedConnection = undefined;
35
+ }
36
+
37
+ /**
38
+ * Spawns a <code>GraphTraversalSource</code> that is bound to a remote session which enables a transaction.
39
+ * @returns {*}
40
+ */
41
+ begin() {
42
+ if (this._sessionBasedConnection) {
43
+ throw new Error('Transaction already started on this object');
44
+ }
45
+
46
+ this._sessionBasedConnection = this._g.remoteConnection.createSession();
47
+ const traversalStrategy = new TraversalStrategies();
48
+ traversalStrategy.addStrategy(new remote.RemoteStrategy(this._sessionBasedConnection));
49
+ return new this._g.graphTraversalSourceClass(
50
+ this._g.graph,
51
+ traversalStrategy,
52
+ new Bytecode(this._g.bytecode),
53
+ this._g.graphTraversalSourceClass,
54
+ this._g.graphTraversalClass,
55
+ );
56
+ }
57
+
58
+ /**
59
+ * @returns {Promise}
60
+ */
61
+ commit() {
62
+ return this._sessionBasedConnection.commit().then(() => this.close());
63
+ }
64
+
65
+ /**
66
+ * @returns {Promise}
67
+ */
68
+ rollback() {
69
+ return this._sessionBasedConnection.rollback().then(() => this.close());
70
+ }
71
+
72
+ /**
73
+ * Returns true if transaction is open.
74
+ * @returns {Boolean}
75
+ */
76
+ get isOpen() {
77
+ return this._sessionBasedConnection.isOpen;
78
+ }
79
+
80
+ /**
81
+ * @returns {Promise}
82
+ */
83
+ close() {
84
+ if (this._sessionBasedConnection) {
85
+ this._sessionBasedConnection.close();
86
+ }
87
+ }
88
+ }
89
+
90
+ module.exports = {
91
+ Transaction,
92
+ };
@@ -19,6 +19,7 @@
19
19
  'use strict';
20
20
 
21
21
  const Traversal = require('./traversal').Traversal;
22
+ const Bytecode = require('./bytecode');
22
23
 
23
24
  /**
24
25
  * Class to translate glv bytecode steps into executable Gremlin-Groovy script
@@ -33,7 +34,7 @@ class Translator {
33
34
  }
34
35
 
35
36
  getTargetLanguage() {
36
- return "gremlin-groovy";
37
+ return 'gremlin-groovy';
37
38
  }
38
39
 
39
40
  of(traversalSource) {
@@ -42,12 +43,15 @@ class Translator {
42
43
 
43
44
  /**
44
45
  * Returns a script representation of the given bytecode instructions.
45
- * @param {Object} bytecode The bytecode object containing step instructions.
46
+ * @param {Object} bytecodeOrTraversal The traversal or bytecode of a traversal containing step instructions.
47
+ * @param {boolean} child Determines if a traversal object should be treated as an anonymous child or if it is a spawn from "g"
46
48
  * @returns {string} Gremlin-Groovy script
47
49
  */
48
- translate(bytecode, child = false) {
49
- let script = child ? "__" : this._traversalSource;
50
- let instructions = bytecode.stepInstructions;
50
+ translate(bytecodeOrTraversal, child = false) {
51
+ let script = child ? '__' : this._traversalSource;
52
+ const bc = bytecodeOrTraversal instanceof Bytecode ? bytecodeOrTraversal : bytecodeOrTraversal.getBytecode();
53
+
54
+ const instructions = bc.stepInstructions;
51
55
 
52
56
  // build the script from the glv instructions.
53
57
  for (let i = 0; i < instructions.length; i++) {
@@ -60,44 +64,58 @@ class Translator {
60
64
  script += ', ';
61
65
  }
62
66
 
63
- if (Object(params[k]) === params[k]) {
64
- if (params[k] instanceof Traversal) {
65
- script += this.translate(params[k].getBytecode(), true);
66
- } else if (params[k].toString() === '[object Object]') {
67
- Object.keys(params[k]).forEach(function (key, index) {
68
- if (index > 0) script += ', ';
69
- script += '(\'' + key + '\', ';
70
- if (params[k][key] instanceof String || typeof params[k][key] === 'string') {
71
- script += '\'' + params[k][key] + '\'';
72
- } else {
73
- script += params[k][key];
74
- }
75
- script += ')';
76
- });
77
- } else if (Array.isArray(params[k])) {
78
- const parts = [];
79
- for (const param of params[k]) {
80
- parts.push(translate(param.getBytecode(), true));
81
- }
82
- script += parts.join(",");
83
- } else {
84
- script += params[k].toString();
85
- }
86
- } else if (params[k] === undefined) {
87
- script += '';
88
- } else if (typeof params[k] === 'number' || typeof params[k] === 'boolean') {
89
- script += params[k];
90
- } else {
91
- script += '\'' + params[k] + '\'';
92
- }
67
+ script += this.convert(params[k]);
93
68
  }
94
69
  }
95
70
 
96
71
  script += ')';
97
72
  }
98
-
73
+
74
+ return script;
75
+ }
76
+
77
+ /**
78
+ * Converts an object to a Gremlin script representation.
79
+ * @param {Object} anyObject The object to convert to a script representation
80
+ * @returns {string} The Gremlin script representation
81
+ */
82
+ convert(anyObject) {
83
+ let script = '';
84
+ if (Object(anyObject) === anyObject) {
85
+ if (anyObject instanceof Traversal) {
86
+ script += this.translate(anyObject.getBytecode(), true);
87
+ } else if (anyObject.toString() === '[object Object]') {
88
+ Object.keys(anyObject).forEach(function (key, index) {
89
+ if (index > 0) {
90
+ script += ', ';
91
+ }
92
+ script += `('${key}', `;
93
+ if (anyObject[key] instanceof String || typeof anyObject[key] === 'string') {
94
+ script += `'${anyObject[key]}'`;
95
+ } else {
96
+ script += anyObject[key];
97
+ }
98
+ script += ')';
99
+ });
100
+ } else if (Array.isArray(anyObject)) {
101
+ const parts = [];
102
+ for (const item of anyObject) {
103
+ parts.push(this.convert(item));
104
+ }
105
+ script += '[' + parts.join(', ') + ']';
106
+ } else {
107
+ script += anyObject.toString();
108
+ }
109
+ } else if (anyObject === undefined) {
110
+ script += '';
111
+ } else if (typeof anyObject === 'number' || typeof anyObject === 'boolean') {
112
+ script += anyObject;
113
+ } else {
114
+ script += `'${anyObject}'`;
115
+ }
116
+
99
117
  return script;
100
118
  }
101
119
  }
102
120
 
103
- module.exports = Translator;
121
+ module.exports = Translator;
@@ -34,8 +34,7 @@ class TraversalStrategies {
34
34
  if (parent) {
35
35
  // Clone the strategies
36
36
  this.strategies = [...parent.strategies];
37
- }
38
- else {
37
+ } else {
39
38
  this.strategies = [];
40
39
  }
41
40
  }
@@ -45,21 +44,31 @@ class TraversalStrategies {
45
44
  this.strategies.push(strategy);
46
45
  }
47
46
 
47
+ /** @param {TraversalStrategy} strategy */
48
+ removeStrategy(strategy) {
49
+ const idx = this.strategies.findIndex((s) => s.fqcn === strategy.fqcn);
50
+ if (idx !== -1) {
51
+ return this.strategies.splice(idx, 1)[0];
52
+ }
53
+
54
+ return undefined;
55
+ }
56
+
48
57
  /**
49
58
  * @param {Traversal} traversal
50
59
  * @returns {Promise}
51
60
  */
52
61
  applyStrategies(traversal) {
53
62
  // Apply all strategies serially
54
- return this.strategies.reduce((promise, strategy) => {
55
- return promise.then(() => strategy.apply(traversal));
56
- }, Promise.resolve());
63
+ return this.strategies.reduce(
64
+ (promise, strategy) => promise.then(() => strategy.apply(traversal)),
65
+ Promise.resolve(),
66
+ );
57
67
  }
58
68
  }
59
69
 
60
70
  /** @abstract */
61
71
  class TraversalStrategy {
62
-
63
72
  /**
64
73
  * @param {String} fqcn fully qualified class name in Java of the strategy
65
74
  * @param {Object} configuration for the strategy
@@ -74,38 +83,36 @@ class TraversalStrategy {
74
83
  * @param {Traversal} traversal
75
84
  * @returns {Promise}
76
85
  */
77
- apply(traversal) {
78
-
79
- }
86
+ apply(traversal) {}
80
87
  }
81
88
 
82
89
  class ConnectiveStrategy extends TraversalStrategy {
83
90
  constructor() {
84
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy");
91
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy');
85
92
  }
86
93
  }
87
94
 
88
95
  class ElementIdStrategy extends TraversalStrategy {
89
96
  constructor() {
90
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy");
97
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy');
91
98
  }
92
99
  }
93
100
 
94
101
  class HaltedTraverserStrategy extends TraversalStrategy {
95
-
96
102
  /**
97
103
  * @param {String} haltedTraverserFactory full qualified class name in Java of a {@code HaltedTraverserFactory} implementation
98
104
  */
99
105
  constructor(haltedTraverserFactory) {
100
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy");
101
- if (haltedTraverserFactory !== undefined)
102
- this.configuration["haltedTraverserFactory"] = haltedTraverserFactory;
106
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy');
107
+ if (haltedTraverserFactory !== undefined) {
108
+ this.configuration['haltedTraverserFactory'] = haltedTraverserFactory;
109
+ }
103
110
  }
104
111
  }
105
112
 
106
113
  class OptionsStrategy extends TraversalStrategy {
107
114
  constructor(options) {
108
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy", options);
115
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy', options);
109
116
  }
110
117
  }
111
118
 
@@ -118,7 +125,7 @@ class PartitionStrategy extends TraversalStrategy {
118
125
  * @param {boolean} [options.includeMetaProperties] determines if meta-properties should be included in partitioning defaulting to false
119
126
  */
120
127
  constructor(options) {
121
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy", options);
128
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy', options);
122
129
  }
123
130
  }
124
131
 
@@ -131,20 +138,32 @@ class SubgraphStrategy extends TraversalStrategy {
131
138
  * @param {boolean} [options.checkAdjacentVertices] enables the strategy to apply the {@code vertices} filter to the adjacent vertices of an edge.
132
139
  */
133
140
  constructor(options) {
134
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy", options);
135
- if (this.configuration.vertices instanceof Traversal)
141
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy', options);
142
+ if (this.configuration.vertices instanceof Traversal) {
136
143
  this.configuration.vertices = this.configuration.vertices.bytecode;
137
- if (this.configuration.edges instanceof Traversal)
144
+ }
145
+ if (this.configuration.edges instanceof Traversal) {
138
146
  this.configuration.edges = this.configuration.edges.bytecode;
139
- if (this.configuration.vertexProperties instanceof Traversal)
147
+ }
148
+ if (this.configuration.vertexProperties instanceof Traversal) {
140
149
  this.configuration.vertexProperties = this.configuration.vertexProperties.bytecode;
150
+ }
141
151
  }
142
152
  }
143
153
 
144
- class VertexProgramStrategy extends TraversalStrategy {
154
+ class ProductiveByStrategy extends TraversalStrategy {
155
+ /**
156
+ * @param {Object} [options]
157
+ * @param {Array<String>} [options.productiveKeys] set of keys that will always be productive
158
+ */
159
+ constructor(options) {
160
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.ProductiveByStrategy', options);
161
+ }
162
+ }
145
163
 
164
+ class VertexProgramStrategy extends TraversalStrategy {
146
165
  constructor(options) {
147
- super("org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy", options);
166
+ super('org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy', options);
148
167
  }
149
168
  }
150
169
 
@@ -153,105 +172,106 @@ class MatchAlgorithmStrategy extends TraversalStrategy {
153
172
  * @param matchAlgorithm
154
173
  */
155
174
  constructor(matchAlgorithm) {
156
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy");
157
- if (matchAlgorithm !== undefined)
158
- this.configuration["matchAlgorithm"] = matchAlgorithm;
175
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy');
176
+ if (matchAlgorithm !== undefined) {
177
+ this.configuration['matchAlgorithm'] = matchAlgorithm;
178
+ }
159
179
  }
160
180
  }
161
181
 
162
182
  class AdjacentToIncidentStrategy extends TraversalStrategy {
163
183
  constructor() {
164
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy");
184
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy');
165
185
  }
166
186
  }
167
187
 
168
188
  class FilterRankingStrategy extends TraversalStrategy {
169
189
  constructor() {
170
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy");
190
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy');
171
191
  }
172
192
  }
173
193
 
174
194
  class IdentityRemovalStrategy extends TraversalStrategy {
175
195
  constructor() {
176
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy");
196
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy');
177
197
  }
178
198
  }
179
199
 
180
200
  class IncidentToAdjacentStrategy extends TraversalStrategy {
181
201
  constructor() {
182
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy");
202
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy');
183
203
  }
184
204
  }
185
205
 
186
206
  class InlineFilterStrategy extends TraversalStrategy {
187
207
  constructor() {
188
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy");
208
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy');
189
209
  }
190
210
  }
191
211
 
192
212
  class LazyBarrierStrategy extends TraversalStrategy {
193
213
  constructor() {
194
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy");
214
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy');
195
215
  }
196
216
  }
197
217
 
198
218
  class MatchPredicateStrategy extends TraversalStrategy {
199
219
  constructor() {
200
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy");
220
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy');
201
221
  }
202
222
  }
203
223
 
204
224
  class OrderLimitStrategy extends TraversalStrategy {
205
225
  constructor() {
206
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.OrderLimitStrategy");
226
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.OrderLimitStrategy');
207
227
  }
208
228
  }
209
229
 
210
230
  class PathProcessorStrategy extends TraversalStrategy {
211
231
  constructor() {
212
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathProcessorStrategy");
232
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathProcessorStrategy');
213
233
  }
214
234
  }
215
235
 
216
236
  class PathRetractionStrategy extends TraversalStrategy {
217
237
  constructor() {
218
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy");
238
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy');
219
239
  }
220
240
  }
221
241
 
222
242
  class CountStrategy extends TraversalStrategy {
223
243
  constructor() {
224
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.CountStrategy");
244
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.CountStrategy');
225
245
  }
226
246
  }
227
247
 
228
248
  class RepeatUnrollStrategy extends TraversalStrategy {
229
249
  constructor() {
230
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RepeatUnrollStrategy");
250
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RepeatUnrollStrategy');
231
251
  }
232
252
  }
233
253
 
234
254
  class GraphFilterStrategy extends TraversalStrategy {
235
255
  constructor() {
236
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.GraphFilterStrategy");
256
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.GraphFilterStrategy');
237
257
  }
238
258
  }
239
259
 
240
260
  class EarlyLimitStrategy extends TraversalStrategy {
241
261
  constructor() {
242
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.EarlyLimitStrategy");
262
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.EarlyLimitStrategy');
243
263
  }
244
264
  }
245
265
 
246
266
  class LambdaRestrictionStrategy extends TraversalStrategy {
247
267
  constructor() {
248
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy");
268
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy');
249
269
  }
250
270
  }
251
271
 
252
272
  class ReadOnlyStrategy extends TraversalStrategy {
253
273
  constructor() {
254
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy");
274
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy');
255
275
  }
256
276
  }
257
277
 
@@ -260,9 +280,11 @@ class EdgeLabelVerificationStrategy extends TraversalStrategy {
260
280
  * @param {boolean} logWarnings determines if warnings should be written to the logger when verification fails
261
281
  * @param {boolean} throwException determines if exceptions should be thrown when verifications fails
262
282
  */
263
- constructor(logWarnings = false, throwException=false) {
264
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy",
265
- {logWarnings: logWarnings, throwException: throwException});
283
+ constructor(logWarnings = false, throwException = false) {
284
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy', {
285
+ logWarnings: logWarnings,
286
+ throwException: throwException,
287
+ });
266
288
  }
267
289
  }
268
290
 
@@ -272,9 +294,12 @@ class ReservedKeysVerificationStrategy extends TraversalStrategy {
272
294
  * @param {boolean} throwException determines if exceptions should be thrown when verifications fails
273
295
  * @param {Array<String>} keys the list of reserved keys to verify
274
296
  */
275
- constructor(logWarnings = false, throwException=false, keys=["id", "label"]) {
276
- super("org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy",
277
- {logWarnings: logWarnings, throwException: throwException, keys: keys});
297
+ constructor(logWarnings = false, throwException = false, keys = ['id', 'label']) {
298
+ super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.EdgeLabelVerificationStrategy', {
299
+ logWarnings: logWarnings,
300
+ throwException: throwException,
301
+ keys: keys,
302
+ });
278
303
  }
279
304
  }
280
305
 
@@ -302,6 +327,7 @@ module.exports = {
302
327
  OrderLimitStrategy: OrderLimitStrategy,
303
328
  PathProcessorStrategy: PathProcessorStrategy,
304
329
  PathRetractionStrategy: PathRetractionStrategy,
330
+ ProductiveByStrategy: ProductiveByStrategy,
305
331
  CountStrategy: CountStrategy,
306
332
  RepeatUnrollStrategy: RepeatUnrollStrategy,
307
333
  GraphFilterStrategy: GraphFilterStrategy,
@@ -310,5 +336,5 @@ module.exports = {
310
336
  EdgeLabelVerificationStrategy: EdgeLabelVerificationStrategy,
311
337
  LambdaRestrictionStrategy: LambdaRestrictionStrategy,
312
338
  ReadOnlyStrategy: ReadOnlyStrategy,
313
- ReservedKeysVerificationStrategy: ReservedKeysVerificationStrategy
314
- };
339
+ ReservedKeysVerificationStrategy: ReservedKeysVerificationStrategy,
340
+ };