gremlin 3.5.2 → 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 (88) hide show
  1. package/.eslintrc.js +154 -0
  2. package/.prettierrc.js +29 -0
  3. package/Gruntfile.js +15 -16
  4. package/doc/AnonymousTraversalSource.html +4 -4
  5. package/doc/Authenticator.html +1 -1
  6. package/doc/Bytecode.html +6 -6
  7. package/doc/Client.html +137 -63
  8. package/doc/Connection.html +88 -4
  9. package/doc/DriverRemoteConnection.html +10 -10
  10. package/doc/EdgeLabelVerificationStrategy.html +1 -1
  11. package/doc/Graph.html +1 -1
  12. package/doc/GraphSON2Reader.html +3 -3
  13. package/doc/GraphSON2Writer.html +2 -2
  14. package/doc/GraphSON3Reader.html +2 -2
  15. package/doc/GraphSON3Writer.html +2 -2
  16. package/doc/GraphTraversal.html +106 -106
  17. package/doc/GraphTraversalSource.html +18 -18
  18. package/doc/HaltedTraverserStrategy.html +2 -2
  19. package/doc/MatchAlgorithmStrategy.html +2 -2
  20. package/doc/P.html +12 -12
  21. package/doc/PartitionStrategy.html +2 -2
  22. package/doc/Path.html +1 -1
  23. package/doc/PlainTextSaslAuthenticator.html +1 -1
  24. package/doc/ProductiveByStrategy.html +1 -1
  25. package/doc/RemoteConnection.html +9 -9
  26. package/doc/RemoteStrategy.html +3 -3
  27. package/doc/RemoteTraversal.html +2 -2
  28. package/doc/ReservedKeysVerificationStrategy.html +2 -2
  29. package/doc/ResponseError.html +1 -1
  30. package/doc/ResultSet.html +6 -6
  31. package/doc/SaslAuthenticator.html +1 -1
  32. package/doc/SaslMechanismBase.html +1 -1
  33. package/doc/SaslMechanismPlain.html +5 -5
  34. package/doc/SeedStrategy.html +2 -2
  35. package/doc/SubgraphStrategy.html +2 -2
  36. package/doc/TextP.html +9 -9
  37. package/doc/Transaction.html +5 -5
  38. package/doc/Translator.html +1 -1
  39. package/doc/TraversalStrategies.html +4 -4
  40. package/doc/TraversalStrategy.html +2 -2
  41. package/doc/TypeSerializer.html +1 -1
  42. package/doc/driver_auth_authenticator.js.html +3 -3
  43. package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +2 -2
  44. package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +25 -16
  45. package/doc/driver_auth_plain-text-sasl-authenticator.js.html +6 -6
  46. package/doc/driver_auth_sasl-authenticator.js.html +2 -2
  47. package/doc/driver_client.js.html +69 -23
  48. package/doc/driver_connection.js.html +107 -88
  49. package/doc/driver_driver-remote-connection.js.html +11 -10
  50. package/doc/driver_remote-connection.js.html +3 -4
  51. package/doc/driver_response-error.js.html +4 -3
  52. package/doc/driver_result-set.js.html +3 -3
  53. package/doc/global.html +199 -2
  54. package/doc/index.html +1 -1
  55. package/doc/process_anonymous-traversal.js.html +3 -3
  56. package/doc/process_bytecode.js.html +10 -8
  57. package/doc/process_graph-traversal.js.html +193 -142
  58. package/doc/process_transaction.js.html +15 -8
  59. package/doc/process_translator.js.html +13 -10
  60. package/doc/process_traversal-strategy.js.html +59 -53
  61. package/doc/process_traversal.js.html +100 -107
  62. package/doc/structure_graph.js.html +6 -6
  63. package/doc/structure_io_graph-serializer.js.html +64 -17
  64. package/doc/structure_io_type-serializers.js.html +85 -88
  65. package/index.js +5 -5
  66. package/lib/driver/auth/authenticator.js +2 -2
  67. package/lib/driver/auth/mechanisms/sasl-mechanism-base.js +1 -1
  68. package/lib/driver/auth/mechanisms/sasl-mechanism-plain.js +24 -15
  69. package/lib/driver/auth/plain-text-sasl-authenticator.js +5 -5
  70. package/lib/driver/auth/sasl-authenticator.js +1 -1
  71. package/lib/driver/client.js +68 -22
  72. package/lib/driver/connection.js +106 -87
  73. package/lib/driver/driver-remote-connection.js +10 -9
  74. package/lib/driver/remote-connection.js +2 -3
  75. package/lib/driver/response-error.js +2 -2
  76. package/lib/driver/result-set.js +1 -2
  77. package/lib/process/anonymous-traversal.js +1 -2
  78. package/lib/process/bytecode.js +9 -7
  79. package/lib/process/graph-traversal.js +191 -141
  80. package/lib/process/transaction.js +13 -7
  81. package/lib/process/translator.js +11 -9
  82. package/lib/process/traversal-strategy.js +57 -52
  83. package/lib/process/traversal.js +99 -106
  84. package/lib/structure/graph.js +5 -5
  85. package/lib/structure/io/graph-serializer.js +62 -16
  86. package/lib/structure/io/type-serializers.js +84 -87
  87. package/lib/utils.js +15 -10
  88. package/package.json +10 -5
@@ -48,9 +48,9 @@
48
48
  /**
49
49
  * @author Jorge Bay Gondra
50
50
  */
51
+
51
52
  'use strict';
52
53
 
53
- const utils = require('../utils');
54
54
  const itemDone = Object.freeze({ value: null, done: true });
55
55
  const asyncIteratorSymbol = Symbol.asyncIterator || Symbol('@@asyncIterator');
56
56
 
@@ -91,19 +91,21 @@ class Traversal {
91
91
  }
92
92
  return result;
93
93
  });
94
- };
94
+ }
95
95
 
96
96
  /**
97
97
  * Determines if there are any more items to iterate from the traversal.
98
98
  * @returns {Promise.<boolean>}
99
99
  */
100
- hasNext() {
101
- return this._applyStrategies().then(() => {
102
- return this.traversers && this.traversers.length > 0 &&
103
- this._traversersIteratorIndex < this.traversers.length &&
104
- this.traversers[this._traversersIteratorIndex].bulk > 0;
105
- });
106
- }
100
+ hasNext() {
101
+ return this._applyStrategies().then(
102
+ () =>
103
+ this.traversers &&
104
+ this.traversers.length > 0 &&
105
+ this._traversersIteratorIndex < this.traversers.length &&
106
+ this.traversers[this._traversersIteratorIndex].bulk > 0,
107
+ );
108
+ }
107
109
 
108
110
  /**
109
111
  * Iterates all Traverser instances in the traversal.
@@ -114,6 +116,7 @@ class Traversal {
114
116
  return this._applyStrategies().then(() => {
115
117
  let it;
116
118
  while ((it = this._getNext()) && !it.done) {
119
+ //
117
120
  }
118
121
  });
119
122
  }
@@ -133,7 +136,7 @@ class Traversal {
133
136
  */
134
137
  _getNext() {
135
138
  while (this.traversers && this._traversersIteratorIndex < this.traversers.length) {
136
- let traverser = this.traversers[this._traversersIteratorIndex];
139
+ const traverser = this.traversers[this._traversersIteratorIndex];
137
140
  if (traverser.bulk > 0) {
138
141
  traverser.bulk--;
139
142
  return { value: traverser.object, done: false };
@@ -148,14 +151,14 @@ class Traversal {
148
151
  // Apply strategies only once
149
152
  return this._traversalStrategiesPromise;
150
153
  }
151
- return this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this);
154
+ return (this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this));
152
155
  }
153
156
 
154
157
  /**
155
158
  * Returns step instructions during JSON serialization
156
159
  * @returns {Array}
157
160
  */
158
- toJSON(){
161
+ toJSON() {
159
162
  return this.bytecode.stepInstructions;
160
163
  }
161
164
 
@@ -165,106 +168,103 @@ class Traversal {
165
168
  */
166
169
  toString() {
167
170
  return this.bytecode.toString();
168
- };
171
+ }
169
172
  }
170
173
 
171
-
172
174
  class IO {
175
+ static get graphml() {
176
+ return 'graphml';
177
+ }
173
178
 
174
- static get graphml() {
175
- return "graphml"
176
- }
177
-
178
- static get graphson() {
179
- return "graphson"
180
- }
179
+ static get graphson() {
180
+ return 'graphson';
181
+ }
181
182
 
182
- static get gryo() {
183
- return "gryo"
184
- }
183
+ static get gryo() {
184
+ return 'gryo';
185
+ }
185
186
 
186
- static get reader() {
187
- return "~tinkerpop.io.reader"
188
- }
187
+ static get reader() {
188
+ return '~tinkerpop.io.reader';
189
+ }
189
190
 
190
- static get registry() {
191
- return "~tinkerpop.io.registry"
192
- }
191
+ static get registry() {
192
+ return '~tinkerpop.io.registry';
193
+ }
193
194
 
194
- static get writer() {
195
- return "~tinkerpop.io.writer"
196
- }
195
+ static get writer() {
196
+ return '~tinkerpop.io.writer';
197
+ }
197
198
  }
198
199
 
200
+ // eslint-disable-next-line no-unused-vars
199
201
  class ConnectedComponent {
202
+ static get component() {
203
+ return 'gremlin.connectedComponentVertexProgram.component';
204
+ }
200
205
 
201
- static get component() {
202
- return "gremlin.connectedComponentVertexProgram.component"
203
- }
204
-
205
- static get edges() {
206
- return "~tinkerpop.connectedComponent.edges"
207
- }
206
+ static get edges() {
207
+ return '~tinkerpop.connectedComponent.edges';
208
+ }
208
209
 
209
- static get propertyName() {
210
- return "~tinkerpop.connectedComponent.propertyName"
211
- }
210
+ static get propertyName() {
211
+ return '~tinkerpop.connectedComponent.propertyName';
212
+ }
212
213
  }
213
214
 
215
+ // eslint-disable-next-line no-unused-vars
214
216
  class ShortestPath {
217
+ static get distance() {
218
+ return '~tinkerpop.shortestPath.distance';
219
+ }
215
220
 
216
- static get distance() {
217
- return "~tinkerpop.shortestPath.distance"
218
- }
219
-
220
- static get edges() {
221
- return "~tinkerpop.shortestPath.edges"
222
- }
221
+ static get edges() {
222
+ return '~tinkerpop.shortestPath.edges';
223
+ }
223
224
 
224
- static get includeEdges() {
225
- return "~tinkerpop.shortestPath.includeEdges"
226
- }
225
+ static get includeEdges() {
226
+ return '~tinkerpop.shortestPath.includeEdges';
227
+ }
227
228
 
228
- static get maxDistance() {
229
- return "~tinkerpop.shortestPath.maxDistance"
230
- }
229
+ static get maxDistance() {
230
+ return '~tinkerpop.shortestPath.maxDistance';
231
+ }
231
232
 
232
- static get target() {
233
- return "~tinkerpop.shortestPath.target"
234
- }
233
+ static get target() {
234
+ return '~tinkerpop.shortestPath.target';
235
+ }
235
236
  }
236
237
 
238
+ // eslint-disable-next-line no-unused-vars
237
239
  class PageRank {
240
+ static get edges() {
241
+ return '~tinkerpop.pageRank.edges';
242
+ }
238
243
 
239
- static get edges() {
240
- return "~tinkerpop.pageRank.edges"
241
- }
242
-
243
- static get propertyName() {
244
- return "~tinkerpop.pageRank.propertyName"
245
- }
244
+ static get propertyName() {
245
+ return '~tinkerpop.pageRank.propertyName';
246
+ }
246
247
 
247
- static get times() {
248
- return "~tinkerpop.pageRank.times"
249
- }
248
+ static get times() {
249
+ return '~tinkerpop.pageRank.times';
250
+ }
250
251
  }
251
252
 
253
+ // eslint-disable-next-line no-unused-vars
252
254
  class PeerPressure {
255
+ static get edges() {
256
+ return '~tinkerpop.peerPressure.edges';
257
+ }
253
258
 
254
- static get edges() {
255
- return "~tinkerpop.peerPressure.edges"
256
- }
257
-
258
- static get propertyName() {
259
- return "~tinkerpop.peerPressure.propertyName"
260
- }
259
+ static get propertyName() {
260
+ return '~tinkerpop.peerPressure.propertyName';
261
+ }
261
262
 
262
- static get times() {
263
- return "~tinkerpop.peerPressure.times"
264
- }
263
+ static get times() {
264
+ return '~tinkerpop.peerPressure.times';
265
+ }
265
266
  }
266
267
 
267
-
268
268
  class P {
269
269
  /**
270
270
  * Represents an operation.
@@ -281,16 +281,16 @@ class P {
281
281
  * @returns {string}
282
282
  */
283
283
  toString() {
284
- function formatValue(value){
284
+ function formatValue(value) {
285
285
  if (Array.isArray(value)) {
286
- let acc = [];
286
+ const acc = [];
287
287
  for (const item of value) {
288
288
  acc.push(formatValue(item));
289
289
  }
290
290
  return acc;
291
291
  }
292
- if (value && typeof value === "string"){
293
- return "'" + value + "'";
292
+ if (value && typeof value === 'string') {
293
+ return `'${value}'`;
294
294
  }
295
295
  return value;
296
296
  }
@@ -311,21 +311,18 @@ class P {
311
311
 
312
312
  static within(...args) {
313
313
  if (args.length === 1 && Array.isArray(args[0])) {
314
- return new P("within", args[0], null);
315
- } else {
316
- return new P("within", args, null);
314
+ return new P('within', args[0], null);
317
315
  }
316
+ return new P('within', args, null);
318
317
  }
319
318
 
320
319
  static without(...args) {
321
320
  if (args.length === 1 && Array.isArray(args[0])) {
322
- return new P("without", args[0], null);
323
- } else {
324
- return new P("without", args, null);
321
+ return new P('without', args[0], null);
325
322
  }
323
+ return new P('without', args, null);
326
324
  }
327
325
 
328
-
329
326
  /** @param {...Object} args */
330
327
  static between(...args) {
331
328
  return createP('between', args);
@@ -380,12 +377,11 @@ class P {
380
377
  static test(...args) {
381
378
  return createP('test', args);
382
379
  }
383
-
384
380
  }
385
381
 
386
382
  function createP(operator, args) {
387
383
  args.unshift(null, operator);
388
- return new (Function.prototype.bind.apply(P, args));
384
+ return new (Function.prototype.bind.apply(P, args))();
389
385
  }
390
386
 
391
387
  class TextP {
@@ -404,9 +400,9 @@ class TextP {
404
400
  * @returns {string}
405
401
  */
406
402
  toString() {
407
- function formatValue(value){
408
- if (value && typeof value === "string"){
409
- return "'" + value + "'";
403
+ function formatValue(value) {
404
+ if (value && typeof value === 'string') {
405
+ return `'${value}'`;
410
406
  }
411
407
  return value;
412
408
  }
@@ -454,12 +450,11 @@ class TextP {
454
450
  static startingWith(...args) {
455
451
  return createTextP('startingWith', args);
456
452
  }
457
-
458
453
  }
459
454
 
460
455
  function createTextP(operator, args) {
461
456
  args.unshift(null, operator);
462
- return new (Function.prototype.bind.apply(TextP, args));
457
+ return new (Function.prototype.bind.apply(TextP, args))();
463
458
  }
464
459
 
465
460
  class Traverser {
@@ -469,26 +464,24 @@ class Traverser {
469
464
  }
470
465
  }
471
466
 
472
- class TraversalSideEffects {
473
-
474
- }
467
+ class TraversalSideEffects {}
475
468
 
476
469
  const withOptions = {
477
- tokens: "~tinkerpop.valueMap.tokens",
470
+ tokens: '~tinkerpop.valueMap.tokens',
478
471
  none: 0,
479
472
  ids: 1,
480
473
  labels: 2,
481
474
  keys: 4,
482
475
  values: 8,
483
476
  all: 15,
484
- indexer: "~tinkerpop.index.indexer",
477
+ indexer: '~tinkerpop.index.indexer',
485
478
  list: 0,
486
- map: 1
479
+ map: 1,
487
480
  };
488
481
 
489
482
  function toEnum(typeName, keys) {
490
483
  const result = {};
491
- keys.split(' ').forEach(k => {
484
+ keys.split(' ').forEach((k) => {
492
485
  let jsKey = k;
493
486
  if (jsKey === jsKey.toUpperCase()) {
494
487
  jsKey = jsKey.toLowerCase();
@@ -529,7 +522,7 @@ module.exports = {
529
522
  pick: toEnum('Pick', 'any none'),
530
523
  pop: toEnum('Pop', 'all first last mixed'),
531
524
  scope: toEnum('Scope', 'global local'),
532
- t: toEnum('T', 'id key label value')
525
+ t: toEnum('T', 'id key label value'),
533
526
  };
534
527
  </code></pre>
535
528
  </article>
@@ -547,7 +540,7 @@ module.exports = {
547
540
  <br class="clear">
548
541
 
549
542
  <footer>
550
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Fri Jan 14 2022 09:04:29 GMT-0500 (Eastern Standard Time)
543
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Apr 11 2022 07:21:14 GMT-0400 (Eastern Daylight Time)
551
544
  </footer>
552
545
 
553
546
  <script> prettyPrint(); </script>
@@ -85,7 +85,7 @@ class Element {
85
85
  * @returns {boolean}
86
86
  */
87
87
  equals(other) {
88
- return (other instanceof Element) &amp;&amp; this.id === other.id;
88
+ return other instanceof Element &amp;&amp; this.id === other.id;
89
89
  }
90
90
  }
91
91
 
@@ -147,7 +147,7 @@ class Property {
147
147
  }
148
148
 
149
149
  equals(other) {
150
- return (other instanceof Property) &amp;&amp; this.key === other.key &amp;&amp; this.value === other.value;
150
+ return other instanceof Property &amp;&amp; this.key === other.key &amp;&amp; this.value === other.value;
151
151
  }
152
152
  }
153
153
 
@@ -164,7 +164,7 @@ class Path {
164
164
  }
165
165
 
166
166
  toString() {
167
- return `path[${(this.objects || []).join(", ")}]`;
167
+ return `path[${(this.objects || []).join(', ')}]`;
168
168
  }
169
169
 
170
170
  equals(other) {
@@ -190,7 +190,7 @@ function areEqual(obj1, obj2) {
190
190
  return false;
191
191
  }
192
192
  for (let i = 0; i &lt; obj1.length; i++) {
193
- if (!areEqual(obj1[i], obj2[i])){
193
+ if (!areEqual(obj1[i], obj2[i])) {
194
194
  return false;
195
195
  }
196
196
  }
@@ -214,7 +214,7 @@ module.exports = {
214
214
  Path,
215
215
  Property,
216
216
  Vertex,
217
- VertexProperty
217
+ VertexProperty,
218
218
  };
219
219
  </code></pre>
220
220
  </article>
@@ -232,7 +232,7 @@ module.exports = {
232
232
  <br class="clear">
233
233
 
234
234
  <footer>
235
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Fri Jan 14 2022 09:04:29 GMT-0500 (Eastern Standard Time)
235
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Apr 11 2022 07:21:14 GMT-0400 (Eastern Daylight Time)
236
236
  </footer>
237
237
 
238
238
  <script> prettyPrint(); </script>
@@ -51,12 +51,12 @@
51
51
  'use strict';
52
52
 
53
53
  const typeSerializers = require('./type-serializers');
54
+ const Bytecode = require('../../process/bytecode');
54
55
 
55
56
  /**
56
57
  * GraphSON2 writer.
57
58
  */
58
59
  class GraphSON2Writer {
59
-
60
60
  /**
61
61
  * @param {Object} [options]
62
62
  * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
@@ -66,7 +66,7 @@ class GraphSON2Writer {
66
66
  constructor(options) {
67
67
  this._options = options || {};
68
68
  // Create instance of the default serializers
69
- this._serializers = this.getDefaultSerializers().map(serializerConstructor => {
69
+ this._serializers = this.getDefaultSerializers().map((serializerConstructor) => {
70
70
  const s = new serializerConstructor();
71
71
  s.writer = this;
72
72
  return s;
@@ -74,7 +74,7 @@ class GraphSON2Writer {
74
74
 
75
75
  const customSerializers = this._options.serializers || {};
76
76
 
77
- Object.keys(customSerializers).forEach(key => {
77
+ Object.keys(customSerializers).forEach((key) => {
78
78
  const s = customSerializers[key];
79
79
  if (!s.serialize) {
80
80
  return;
@@ -111,7 +111,7 @@ class GraphSON2Writer {
111
111
  if (Array.isArray(value)) {
112
112
  // We need to handle arrays when there is no serializer
113
113
  // for older versions of GraphSON
114
- return value.map(item => this.adaptObject(item));
114
+ return value.map((item) => this.adaptObject(item));
115
115
  }
116
116
 
117
117
  // Default (strings / objects / ...)
@@ -126,6 +126,48 @@ class GraphSON2Writer {
126
126
  write(obj) {
127
127
  return JSON.stringify(this.adaptObject(obj));
128
128
  }
129
+
130
+ writeRequest({ requestId, op, processor, args }) {
131
+ const req = {
132
+ requestId: { '@type': 'g:UUID', '@value': requestId },
133
+ op,
134
+ processor,
135
+ args: this._adaptArgs(args, true),
136
+ };
137
+
138
+ if (req.args['gremlin'] instanceof Bytecode) {
139
+ req.args['gremlin'] = this.adaptObject(req.args['gremlin']);
140
+ }
141
+
142
+ return Buffer.from(JSON.stringify(req));
143
+ }
144
+
145
+ /**
146
+ * Takes the given args map and ensures all arguments are passed through to adaptObject
147
+ * @param {Object} args Map of arguments to process.
148
+ * @param {Boolean} protocolLevel Determines whether it's a protocol level binding.
149
+ * @returns {Object}
150
+ * @private
151
+ */
152
+ _adaptArgs(args, protocolLevel) {
153
+ if (args instanceof Object) {
154
+ const newObj = {};
155
+ Object.keys(args).forEach((key) => {
156
+ // bindings key (at the protocol-level needs special handling. without this, it wraps the generated Map
157
+ // in another map for types like EnumValue. Could be a nicer way to do this but for now it's solving the
158
+ // problem with script submission of non JSON native types
159
+ if (protocolLevel &amp;&amp; key === 'bindings') {
160
+ newObj[key] = this._adaptArgs(args[key], false);
161
+ } else {
162
+ newObj[key] = this.adaptObject(args[key]);
163
+ }
164
+ });
165
+
166
+ return newObj;
167
+ }
168
+
169
+ return args;
170
+ }
129
171
  }
130
172
 
131
173
  /**
@@ -153,7 +195,7 @@ class GraphSON2Reader {
153
195
  this._deserializers = {};
154
196
 
155
197
  const defaultDeserializers = this.getDefaultDeserializers();
156
- Object.keys(defaultDeserializers).forEach(typeName => {
198
+ Object.keys(defaultDeserializers).forEach((typeName) => {
157
199
  const serializerConstructor = defaultDeserializers[typeName];
158
200
  const s = new serializerConstructor();
159
201
  s.reader = this;
@@ -162,7 +204,7 @@ class GraphSON2Reader {
162
204
 
163
205
  if (this._options.serializers) {
164
206
  const customSerializers = this._options.serializers || {};
165
- Object.keys(customSerializers).forEach(key => {
207
+ Object.keys(customSerializers).forEach((key) => {
166
208
  const s = customSerializers[key];
167
209
  if (!s.deserialize) {
168
210
  return;
@@ -189,7 +231,7 @@ class GraphSON2Reader {
189
231
  return null;
190
232
  }
191
233
  if (Array.isArray(obj)) {
192
- return obj.map(item => this.read(item));
234
+ return obj.map((item) => this.read(item));
193
235
  }
194
236
  const type = obj[typeSerializers.typeKey];
195
237
  if (type) {
@@ -207,6 +249,10 @@ class GraphSON2Reader {
207
249
  return obj;
208
250
  }
209
251
 
252
+ readResponse(buffer) {
253
+ return this.read(JSON.parse(buffer.toString()));
254
+ }
255
+
210
256
  _deserializeObject(obj) {
211
257
  const keys = Object.keys(obj);
212
258
  const result = {};
@@ -229,9 +275,9 @@ class GraphSON3Reader extends GraphSON2Reader {
229
275
  const graphSON2Deserializers = {
230
276
  'g:Traverser': typeSerializers.TraverserSerializer,
231
277
  'g:TraversalStrategy': typeSerializers.TraversalStrategySerializer,
232
- 'g:Int32': typeSerializers.NumberSerializer,
233
- 'g:Int64': typeSerializers.NumberSerializer,
234
- 'g:Float': typeSerializers.NumberSerializer,
278
+ 'g:Int32': typeSerializers.NumberSerializer,
279
+ 'g:Int64': typeSerializers.NumberSerializer,
280
+ 'g:Float': typeSerializers.NumberSerializer,
235
281
  'g:Double': typeSerializers.NumberSerializer,
236
282
  'g:Date': typeSerializers.DateSerializer,
237
283
  'g:Direction': typeSerializers.DirectionSerializer,
@@ -242,13 +288,13 @@ const graphSON2Deserializers = {
242
288
  'g:Path': typeSerializers.Path3Serializer,
243
289
  'g:TextP': typeSerializers.TextPSerializer,
244
290
  'g:T': typeSerializers.TSerializer,
245
- 'g:BulkSet': typeSerializers.BulkSetSerializer
291
+ 'g:BulkSet': typeSerializers.BulkSetSerializer,
246
292
  };
247
293
 
248
294
  const graphSON3Deserializers = Object.assign({}, graphSON2Deserializers, {
249
295
  'g:List': typeSerializers.ListSerializer,
250
296
  'g:Set': typeSerializers.SetSerializer,
251
- 'g:Map': typeSerializers.MapSerializer
297
+ 'g:Map': typeSerializers.MapSerializer,
252
298
  });
253
299
 
254
300
  const graphSON2Serializers = [
@@ -263,13 +309,13 @@ const graphSON2Serializers = [
263
309
  typeSerializers.EnumSerializer,
264
310
  typeSerializers.VertexSerializer,
265
311
  typeSerializers.EdgeSerializer,
266
- typeSerializers.LongSerializer
312
+ typeSerializers.LongSerializer,
267
313
  ];
268
314
 
269
315
  const graphSON3Serializers = graphSON2Serializers.concat([
270
316
  typeSerializers.ListSerializer,
271
317
  typeSerializers.SetSerializer,
272
- typeSerializers.MapSerializer
318
+ typeSerializers.MapSerializer,
273
319
  ]);
274
320
 
275
321
  module.exports = {
@@ -278,8 +324,9 @@ module.exports = {
278
324
  GraphSON2Writer,
279
325
  GraphSON2Reader,
280
326
  GraphSONWriter: GraphSON3Writer,
281
- GraphSONReader: GraphSON3Reader
282
- };</code></pre>
327
+ GraphSONReader: GraphSON3Reader,
328
+ };
329
+ </code></pre>
283
330
  </article>
284
331
  </section>
285
332
 
@@ -295,7 +342,7 @@ module.exports = {
295
342
  <br class="clear">
296
343
 
297
344
  <footer>
298
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Fri Jan 14 2022 09:04:29 GMT-0500 (Eastern Standard Time)
345
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Apr 11 2022 07:21:14 GMT-0400 (Eastern Daylight Time)
299
346
  </footer>
300
347
 
301
348
  <script> prettyPrint(); </script>