gremlin 3.6.4 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/AnonymousTraversalSource.html +2 -2
- package/doc/Authenticator.html +2 -2
- package/doc/Bytecode.html +2 -2
- package/doc/CardinalityValue.html +711 -0
- package/doc/Client.html +7 -7
- package/doc/Connection.html +8 -41
- package/doc/DriverRemoteConnection.html +9 -9
- package/doc/EdgeLabelVerificationStrategy.html +2 -2
- package/doc/Graph.html +2 -2
- package/doc/GraphSON2Reader.html +2 -2
- package/doc/GraphSON2Writer.html +2 -2
- package/doc/GraphSON3Reader.html +2 -2
- package/doc/GraphSON3Writer.html +2 -2
- package/doc/GraphTraversal.html +465 -131
- package/doc/GraphTraversalSource.html +169 -2
- package/doc/HaltedTraverserStrategy.html +2 -2
- package/doc/MatchAlgorithmStrategy.html +2 -2
- package/doc/P.html +2 -2
- package/doc/PartitionStrategy.html +2 -2
- package/doc/Path.html +2 -2
- package/doc/PlainTextSaslAuthenticator.html +2 -2
- package/doc/ProductiveByStrategy.html +2 -2
- package/doc/RemoteConnection.html +2 -2
- package/doc/RemoteStrategy.html +2 -2
- package/doc/RemoteTraversal.html +2 -2
- package/doc/ReservedKeysVerificationStrategy.html +2 -2
- package/doc/ResponseError.html +2 -2
- package/doc/ResultSet.html +2 -2
- package/doc/SaslAuthenticator.html +2 -2
- package/doc/SaslMechanismBase.html +2 -2
- package/doc/SaslMechanismPlain.html +2 -2
- package/doc/SeedStrategy.html +2 -2
- package/doc/SubgraphStrategy.html +2 -2
- package/doc/TextP.html +2 -2
- package/doc/Transaction.html +2 -2
- package/doc/Translator.html +2 -2
- package/doc/TraversalStrategies.html +2 -2
- package/doc/TraversalStrategy.html +2 -2
- package/doc/TypeSerializer.html +2 -2
- package/doc/driver_auth_authenticator.js.html +2 -2
- package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +2 -2
- package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +2 -2
- package/doc/driver_auth_plain-text-sasl-authenticator.js.html +2 -2
- package/doc/driver_auth_sasl-authenticator.js.html +2 -2
- package/doc/driver_client.js.html +3 -2
- package/doc/driver_connection.js.html +2 -9
- package/doc/driver_driver-remote-connection.js.html +10 -3
- package/doc/driver_remote-connection.js.html +2 -2
- package/doc/driver_response-error.js.html +2 -2
- package/doc/driver_result-set.js.html +2 -2
- package/doc/global.html +26 -3
- package/doc/index.html +2 -2
- package/doc/module.exports.html +2 -2
- package/doc/process_anonymous-traversal.js.html +2 -2
- package/doc/process_bytecode.js.html +2 -2
- package/doc/process_graph-traversal.js.html +75 -3
- package/doc/process_transaction.js.html +2 -2
- package/doc/process_translator.js.html +2 -2
- package/doc/process_traversal-strategy.js.html +2 -2
- package/doc/process_traversal.js.html +2 -2
- package/doc/structure_graph.js.html +2 -2
- package/doc/structure_io_binary_internals_DataType.js.html +2 -2
- package/doc/structure_io_binary_internals_GraphBinaryReader.js.html +2 -2
- package/doc/structure_io_binary_internals_GraphBinaryWriter.js.html +2 -2
- package/doc/structure_io_graph-serializer.js.html +2 -2
- package/doc/structure_io_type-serializers.js.html +2 -2
- package/docker-compose.yml +7 -2
- package/lib/driver/client.js +1 -0
- package/lib/driver/connection.js +0 -7
- package/lib/driver/driver-remote-connection.js +8 -1
- package/lib/process/graph-traversal.js +73 -1
- package/lib/structure/io/binary/internals/VertexPropertySerializer.js +1 -1
- package/lib/utils.js +3 -8
- package/package.json +5 -5
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
'use strict';
|
|
24
24
|
|
|
25
|
-
const { Traversal } = require('./traversal');
|
|
25
|
+
const { Traversal, cardinality } = require('./traversal');
|
|
26
26
|
const { Transaction } = require('./transaction');
|
|
27
27
|
const remote = require('../driver/remote-connection');
|
|
28
28
|
const Bytecode = require('./bytecode');
|
|
@@ -337,6 +337,16 @@ class GraphTraversalSource {
|
|
|
337
337
|
const b = new Bytecode(this.bytecode).addStep('call', args);
|
|
338
338
|
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
|
|
339
339
|
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* union GraphTraversalSource method.
|
|
343
|
+
* @param {...Object} args
|
|
344
|
+
* @returns {GraphTraversal}
|
|
345
|
+
*/
|
|
346
|
+
union(...args) {
|
|
347
|
+
const b = new Bytecode(this.bytecode).addStep('union', args);
|
|
348
|
+
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
|
|
349
|
+
}
|
|
340
350
|
}
|
|
341
351
|
|
|
342
352
|
/**
|
|
@@ -364,6 +374,16 @@ class GraphTraversal extends Traversal {
|
|
|
364
374
|
return this;
|
|
365
375
|
}
|
|
366
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Graph traversal E method.
|
|
379
|
+
* @param {...Object} args
|
|
380
|
+
* @returns {GraphTraversal}
|
|
381
|
+
*/
|
|
382
|
+
E(...args) {
|
|
383
|
+
this.bytecode.addStep('E', args);
|
|
384
|
+
return this;
|
|
385
|
+
}
|
|
386
|
+
|
|
367
387
|
/**
|
|
368
388
|
* Graph traversal addE method.
|
|
369
389
|
* @param {...Object} args
|
|
@@ -523,6 +543,16 @@ class GraphTraversal extends Traversal {
|
|
|
523
543
|
return this;
|
|
524
544
|
}
|
|
525
545
|
|
|
546
|
+
/**
|
|
547
|
+
* Graph traversal concat method.
|
|
548
|
+
* @param {...Object} args
|
|
549
|
+
* @returns {GraphTraversal}
|
|
550
|
+
*/
|
|
551
|
+
concat(...args) {
|
|
552
|
+
this.bytecode.addStep('concat', args);
|
|
553
|
+
return this;
|
|
554
|
+
}
|
|
555
|
+
|
|
526
556
|
/**
|
|
527
557
|
* Graph traversal connectedComponent method.
|
|
528
558
|
* @param {...Object} args
|
|
@@ -1433,6 +1463,45 @@ class GraphTraversal extends Traversal {
|
|
|
1433
1463
|
}
|
|
1434
1464
|
}
|
|
1435
1465
|
|
|
1466
|
+
class CardinalityValue extends Bytecode {
|
|
1467
|
+
/**
|
|
1468
|
+
* Creates a new instance of {@link CardinalityValue}.
|
|
1469
|
+
* @param {String} card
|
|
1470
|
+
* @param {Object} value
|
|
1471
|
+
*/
|
|
1472
|
+
constructor(card, value) {
|
|
1473
|
+
super();
|
|
1474
|
+
this.addSource('CardinalityValueTraversal', [card, value]);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Create a value with single cardinality.
|
|
1479
|
+
* @param {Array} value
|
|
1480
|
+
* @returns {CardinalityValue}
|
|
1481
|
+
*/
|
|
1482
|
+
static single(value) {
|
|
1483
|
+
return new CardinalityValue(cardinality.single, value);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Create a value with list cardinality.
|
|
1488
|
+
* @param {Array} value
|
|
1489
|
+
* @returns {CardinalityValue}
|
|
1490
|
+
*/
|
|
1491
|
+
static list(value) {
|
|
1492
|
+
return new CardinalityValue(cardinality.list, value);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* Create a value with set cardinality.
|
|
1497
|
+
* @param {Array} value
|
|
1498
|
+
* @returns {CardinalityValue}
|
|
1499
|
+
*/
|
|
1500
|
+
static set(value) {
|
|
1501
|
+
return new CardinalityValue(cardinality.set, value);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1436
1505
|
function callOnEmptyTraversal(fnName, args) {
|
|
1437
1506
|
const g = new GraphTraversal(null, null, new Bytecode());
|
|
1438
1507
|
return g[fnName].apply(g, args);
|
|
@@ -1443,6 +1512,7 @@ function callOnEmptyTraversal(fnName, args) {
|
|
|
1443
1512
|
* @type {Object}
|
|
1444
1513
|
*/
|
|
1445
1514
|
const statics = {
|
|
1515
|
+
E: (...args) => callOnEmptyTraversal('E', args),
|
|
1446
1516
|
V: (...args) => callOnEmptyTraversal('V', args),
|
|
1447
1517
|
addE: (...args) => callOnEmptyTraversal('addE', args),
|
|
1448
1518
|
addV: (...args) => callOnEmptyTraversal('addV', args),
|
|
@@ -1459,6 +1529,7 @@ const statics = {
|
|
|
1459
1529
|
choose: (...args) => callOnEmptyTraversal('choose', args),
|
|
1460
1530
|
coalesce: (...args) => callOnEmptyTraversal('coalesce', args),
|
|
1461
1531
|
coin: (...args) => callOnEmptyTraversal('coin', args),
|
|
1532
|
+
concat: (...args) => callOnEmptyTraversal('concat', args),
|
|
1462
1533
|
constant: (...args) => callOnEmptyTraversal('constant', args),
|
|
1463
1534
|
count: (...args) => callOnEmptyTraversal('count', args),
|
|
1464
1535
|
cyclicPath: (...args) => callOnEmptyTraversal('cyclicPath', args),
|
|
@@ -1543,5 +1614,6 @@ const statics = {
|
|
|
1543
1614
|
module.exports = {
|
|
1544
1615
|
GraphTraversal,
|
|
1545
1616
|
GraphTraversalSource,
|
|
1617
|
+
CardinalityValue,
|
|
1546
1618
|
statics,
|
|
1547
1619
|
};
|
|
@@ -154,7 +154,7 @@ module.exports = class VertexPropertySerializer {
|
|
|
154
154
|
// {properties} is a fully qualified typed value composed of {type_code}{type_info}{value_flag}{value} which contains properties. Note that as TinkerPop currently send "references" only, this value will always be null.
|
|
155
155
|
let properties, properties_len;
|
|
156
156
|
try {
|
|
157
|
-
({ v: properties, len: properties_len } = this.ioc.
|
|
157
|
+
({ v: properties, len: properties_len } = this.ioc.anySerializer.deserialize(cursor));
|
|
158
158
|
len += properties_len;
|
|
159
159
|
} catch (err) {
|
|
160
160
|
err.message = '{properties}: ' + err.message;
|
package/lib/utils.js
CHANGED
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
const crypto = require('crypto');
|
|
27
27
|
const os = require('os');
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
const gremlinVersion = '3.7.0'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
|
|
29
30
|
|
|
30
31
|
exports.toLong = function toLong(value) {
|
|
31
32
|
return new Long(value);
|
|
@@ -84,12 +85,6 @@ exports.ImmutableMap = ImmutableMap;
|
|
|
84
85
|
|
|
85
86
|
function generateUserAgent() {
|
|
86
87
|
const applicationName = (process.env.npm_package_name || 'NotAvailable').replace('_', ' ');
|
|
87
|
-
let driverVersion;
|
|
88
|
-
try {
|
|
89
|
-
driverVersion = JSON.parse(readFileSync(__dirname + '/../package.json')).version.replace('_', ' ');
|
|
90
|
-
} catch (e) {
|
|
91
|
-
driverVersion = 'NotAvailable';
|
|
92
|
-
}
|
|
93
88
|
let runtimeVersion;
|
|
94
89
|
let osName;
|
|
95
90
|
let osVersion;
|
|
@@ -108,7 +103,7 @@ function generateUserAgent() {
|
|
|
108
103
|
osVersion = os.release().replace(' ', '_');
|
|
109
104
|
}
|
|
110
105
|
|
|
111
|
-
const userAgent = `${applicationName} Gremlin-Javascript.${
|
|
106
|
+
const userAgent = `${applicationName} Gremlin-Javascript.${gremlinVersion} ${runtimeVersion} ${osName}.${osVersion} ${cpuArch}`;
|
|
112
107
|
|
|
113
108
|
return userAgent;
|
|
114
109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gremlin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "JavaScript Gremlin Language Variant",
|
|
5
5
|
"author": "Apache TinkerPop team",
|
|
6
6
|
"keywords": [
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"colors": "1.4.0",
|
|
23
23
|
"cross-env": "^7.0.3",
|
|
24
24
|
"cucumber": "~6.0.7",
|
|
25
|
-
"eslint": "^8.
|
|
25
|
+
"eslint": "^8.42.0",
|
|
26
26
|
"eslint-config-prettier": "^8.5.0",
|
|
27
|
-
"eslint-plugin-prettier": "^
|
|
27
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
28
28
|
"grunt": "^1.5.3",
|
|
29
29
|
"grunt-cli": "~1.4.3",
|
|
30
30
|
"grunt-jsdoc": "~2.4.1",
|
|
31
31
|
"mocha": "^10.2.0",
|
|
32
|
-
"prettier": "^
|
|
32
|
+
"prettier": "^3.0.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"lint": "eslint --ext .js ."
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
58
|
+
"node": ">=18"
|
|
59
59
|
}
|
|
60
60
|
}
|