You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by xi...@apache.org on 2023/01/21 03:22:47 UTC
svn commit: r1906850 [22/22] - in /tinkerpop/site/jsdocs/3.6.2: ./ fonts/ scripts/ scripts/prettify/ styles/
Added: tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_DataType.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_DataType.js.html?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_DataType.js.html (added)
+++ tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_DataType.js.html Sat Jan 21 03:22:46 2023
@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: structure/io/binary/internals/DataType.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: structure/io/binary/internals/DataType.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Igor Ostapenko
+ */
+'use strict';
+
+/**
+ * Represents a GraphBinary data type.
+ *
+ * See org.apache.tinkerpop.gremlin.structure.io.binary.DataType Java class.
+ */
+const DataType = {
+ INT: 0x01,
+ LONG: 0x02,
+ STRING: 0x03,
+ DATE: 0x04,
+ TIMESTAMP: 0x05,
+ CLASS: 0x06,
+ DOUBLE: 0x07,
+ FLOAT: 0x08,
+ LIST: 0x09,
+ MAP: 0x0a,
+ SET: 0x0b,
+ UUID: 0x0c,
+ EDGE: 0x0d,
+ PATH: 0x0e,
+ PROPERTY: 0x0f,
+ GRAPH: 0x10,
+ VERTEX: 0x11,
+ VERTEXPROPERTY: 0x12,
+ BARRIER: 0x13,
+ BINDING: 0x14,
+ BYTECODE: 0x15,
+ CARDINALITY: 0x16,
+ COLUMN: 0x17,
+ DIRECTION: 0x18,
+ OPERATOR: 0x19,
+ ORDER: 0x1a,
+ PICK: 0x1b,
+ POP: 0x1c,
+ LAMBDA: 0x1d,
+ P: 0x1e,
+ SCOPE: 0x1f,
+ T: 0x20,
+ TRAVERSER: 0x21,
+ BIGDECIMAL: 0x22,
+ BIGINTEGER: 0x23,
+ BYTE: 0x24,
+ BYTEBUFFER: 0x25,
+ SHORT: 0x26,
+ BOOLEAN: 0x27,
+ TEXTP: 0x28,
+ TRAVERSALSTRATEGY: 0x29,
+ BULKSET: 0x2a,
+ TREE: 0x2b,
+ METRICS: 0x2c,
+ TRAVERSALMETRICS: 0x2d,
+ MERGE: 0x2e,
+
+ CHAR: 0x80,
+ DURATION: 0x81,
+ INETADDRESS: 0x82,
+ INSTANT: 0x83,
+ LOCALDATE: 0x84,
+ LOCALDATETIME: 0x85,
+ LOCALTIME: 0x86,
+ MONTHDAY: 0x87,
+ OFFSETDATETIME: 0x88,
+ OFFSETTIME: 0x89,
+ PERIOD: 0x8a,
+ YEAR: 0x8b,
+ YEARMONTH: 0x8c,
+ ZONEDATETIME: 0x8d,
+ ZONEOFFSET: 0x8e,
+
+ CUSTOM: 0,
+ UNSPECIFIED_NULL: 0xfe,
+};
+
+module.exports = DataType;
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrat
egy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a hr
ef="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#statics">statics</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Jan 20 2023 17:38:51 GMT-0800 (Pacific Standard Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
Added: tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryReader.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryReader.js.html?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryReader.js.html (added)
+++ tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryReader.js.html Sat Jan 21 03:22:46 2023
@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: structure/io/binary/internals/GraphBinaryReader.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: structure/io/binary/internals/GraphBinaryReader.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Igor Ostapenko
+ */
+'use strict';
+
+/**
+ * GraphBinary reader.
+ */
+module.exports = class GraphBinaryReader {
+ constructor(ioc) {
+ this.ioc = ioc;
+ }
+
+ readResponse(buffer) {
+ if (buffer === undefined || buffer === null) {
+ throw new Error('Buffer is missing.');
+ }
+ if (!(buffer instanceof Buffer)) {
+ throw new Error('Not an instance of Buffer.');
+ }
+ if (buffer.length < 1) {
+ throw new Error('Buffer is empty.');
+ }
+
+ const response = { status: {}, result: {} };
+ let cursor = buffer;
+ let len;
+
+ // {version} is a Byte representing the protocol version
+ const version = cursor[0];
+ if (version !== 0x81) {
+ throw new Error(`Unsupported version '${version}'.`);
+ }
+ cursor = cursor.slice(1); // skip version
+
+ // {request_id} is a nullable UUID
+ ({ v: response.requestId, len } = this.ioc.uuidSerializer.deserialize(cursor, false, true));
+ cursor = cursor.slice(len);
+
+ // {status_code} is an Int
+ ({ v: response.status.code, len } = this.ioc.intSerializer.deserialize(cursor, false));
+ cursor = cursor.slice(len);
+
+ // {status_message} is a nullable String
+ ({ v: response.status.message, len } = this.ioc.stringSerializer.deserialize(cursor, false, true));
+ cursor = cursor.slice(len);
+
+ // {status_attributes} is a Map
+ ({ v: response.status.attributes, len } = this.ioc.mapSerializer.deserialize(cursor, false));
+ cursor = cursor.slice(len);
+
+ // {result_meta} is a Map
+ ({ v: response.result.meta, len } = this.ioc.mapSerializer.deserialize(cursor, false));
+ cursor = cursor.slice(len);
+
+ // {result_data} is a fully qualified typed value composed of {type_code}{type_info}{value_flag}{value}
+ ({ v: response.result.data } = this.ioc.anySerializer.deserialize(cursor));
+
+ return response;
+ }
+};
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrat
egy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a hr
ef="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#statics">statics</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Jan 20 2023 17:38:51 GMT-0800 (Pacific Standard Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
Added: tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryWriter.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryWriter.js.html?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryWriter.js.html (added)
+++ tinkerpop/site/jsdocs/3.6.2/structure_io_binary_internals_GraphBinaryWriter.js.html Sat Jan 21 03:22:46 2023
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: structure/io/binary/internals/GraphBinaryWriter.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: structure/io/binary/internals/GraphBinaryWriter.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Igor Ostapenko
+ */
+'use strict';
+
+/**
+ * GraphBinary writer.
+ */
+module.exports = class GraphBinaryWriter {
+ constructor(ioc) {
+ this.ioc = ioc;
+ }
+
+ writeRequest({ requestId, op, processor, args }) {
+ const bufs = [
+ // {version} 1 byte
+ Buffer.from([0x81]),
+ // {request_id} UUID
+ this.ioc.uuidSerializer.serialize(requestId, false),
+ // {op} String
+ this.ioc.stringSerializer.serialize(op, false),
+ // {processor} String
+ this.ioc.stringSerializer.serialize(processor, false),
+ // {args} Map
+ this.ioc.mapSerializer.serialize(args, false),
+ ];
+ return Buffer.concat(bufs);
+
+ /*// Detailed example for a quick reference:
+ // {version}
+ 0x81,
+ // {request_id} UUID
+ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+ // {op} String
+ 0x00,0x00,0x00,0x08, ...Buffer.from('bytecode'),
+ // {processor} String
+ 0x00,0x00,0x00,0x09, ...Buffer.from('traversal'),
+ // {args} Map
+ 0x00,0x00,0x00,0x02,
+ // 1.
+ // args.aliases key String
+ 0x03,0x00, 0x00,0x00,0x00,0x07, ...Buffer.from('aliases'),
+ // args.aliases value Map
+ 0x0A,0x00, 0x00,0x00,0x00,0x01,
+ // aliases.g key String
+ 0x03,0x00, 0x00,0x00,0x00,0x01, ...Buffer.from('g'),
+ // aliases.g value String
+ 0x03,0x00, 0x00,0x00,0x00,0x01, ...Buffer.from('g'),
+ // 2.
+ // args.gremlin key String
+ 0x03,0x00, 0x00,0x00,0x00,0x07, ...Buffer.from('gremlin'),
+ // args.gremlin value Bytecode
+ 0x15,0x00,
+ // {steps_length}
+ 0x00,0x00,0x00,0x01,
+ // step 1 - {name} String
+ 0x00,0x00,0x00,0x01, ...Buffer.from('V'),
+ // step 1 - {values_length} Int
+ 0x00,0x00,0x00,0x00,
+ // {sources_length}
+ 0x00,0x00,0x00,0x00,
+ */
+ }
+};
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrat
egy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a hr
ef="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#statics">statics</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Jan 20 2023 17:38:51 GMT-0800 (Pacific Standard Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
Added: tinkerpop/site/jsdocs/3.6.2/structure_io_graph-serializer.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/structure_io_graph-serializer.js.html?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/structure_io_graph-serializer.js.html (added)
+++ tinkerpop/site/jsdocs/3.6.2/structure_io_graph-serializer.js.html Sat Jan 21 03:22:46 2023
@@ -0,0 +1,351 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: structure/io/graph-serializer.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: structure/io/graph-serializer.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+const typeSerializers = require('./type-serializers');
+const Bytecode = require('../../process/bytecode');
+
+/**
+ * GraphSON2 writer.
+ */
+class GraphSON2Writer {
+ /**
+ * @param {Object} [options]
+ * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+ * serializer instances as values, ie: { 'g:Int64': longSerializer }.
+ * @constructor
+ */
+ constructor(options) {
+ this._options = options || {};
+ // Create instance of the default serializers
+ this._serializers = this.getDefaultSerializers().map((serializerConstructor) => {
+ const s = new serializerConstructor();
+ s.writer = this;
+ return s;
+ });
+
+ const customSerializers = this._options.serializers || {};
+
+ Object.keys(customSerializers).forEach((key) => {
+ const s = customSerializers[key];
+ if (!s.serialize) {
+ return;
+ }
+ s.writer = this;
+ // Insert custom serializers first
+ this._serializers.unshift(s);
+ });
+ }
+
+ /**
+ * Gets the default serializers to be used.
+ * @returns {Array}
+ */
+ getDefaultSerializers() {
+ return graphSON2Serializers;
+ }
+
+ adaptObject(value) {
+ let s;
+
+ for (let i = 0; i < this._serializers.length; i++) {
+ const currentSerializer = this._serializers[i];
+ if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
+ s = currentSerializer;
+ break;
+ }
+ }
+
+ if (s) {
+ return s.serialize(value);
+ }
+
+ if (Array.isArray(value)) {
+ // We need to handle arrays when there is no serializer
+ // for older versions of GraphSON
+ return value.map((item) => this.adaptObject(item));
+ }
+
+ // Default (strings / objects / ...)
+ return value;
+ }
+
+ /**
+ * Returns the GraphSON representation of the provided object instance.
+ * @param {Object} obj
+ * @returns {String}
+ */
+ write(obj) {
+ return JSON.stringify(this.adaptObject(obj));
+ }
+
+ writeRequest({ requestId, op, processor, args }) {
+ const req = {
+ requestId: { '@type': 'g:UUID', '@value': requestId },
+ op,
+ processor,
+ args: this._adaptArgs(args, true),
+ };
+
+ if (req.args['gremlin'] instanceof Bytecode) {
+ req.args['gremlin'] = this.adaptObject(req.args['gremlin']);
+ }
+
+ return Buffer.from(JSON.stringify(req));
+ }
+
+ /**
+ * Takes the given args map and ensures all arguments are passed through to adaptObject
+ * @param {Object} args Map of arguments to process.
+ * @param {Boolean} protocolLevel Determines whether it's a protocol level binding.
+ * @returns {Object}
+ * @private
+ */
+ _adaptArgs(args, protocolLevel) {
+ if (args instanceof Object) {
+ const newObj = {};
+ Object.keys(args).forEach((key) => {
+ // bindings key (at the protocol-level needs special handling. without this, it wraps the generated Map
+ // in another map for types like EnumValue. Could be a nicer way to do this but for now it's solving the
+ // problem with script submission of non JSON native types
+ if (protocolLevel && key === 'bindings') {
+ newObj[key] = this._adaptArgs(args[key], false);
+ } else {
+ newObj[key] = this.adaptObject(args[key]);
+ }
+ });
+
+ return newObj;
+ }
+
+ return args;
+ }
+}
+
+/**
+ * GraphSON3 writer.
+ */
+class GraphSON3Writer extends GraphSON2Writer {
+ getDefaultSerializers() {
+ return graphSON3Serializers;
+ }
+}
+
+/**
+ * GraphSON2 reader.
+ */
+class GraphSON2Reader {
+ /**
+ * GraphSON Reader
+ * @param {Object} [options]
+ * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+ * deserializer instances as values, ie: { 'g:Int64': longSerializer }.
+ * @constructor
+ */
+ constructor(options) {
+ this._options = options || {};
+ this._deserializers = {};
+
+ const defaultDeserializers = this.getDefaultDeserializers();
+ Object.keys(defaultDeserializers).forEach((typeName) => {
+ const serializerConstructor = defaultDeserializers[typeName];
+ const s = new serializerConstructor();
+ s.reader = this;
+ this._deserializers[typeName] = s;
+ });
+
+ if (this._options.serializers) {
+ const customSerializers = this._options.serializers || {};
+ Object.keys(customSerializers).forEach((key) => {
+ const s = customSerializers[key];
+ if (!s.deserialize) {
+ return;
+ }
+ s.reader = this;
+ this._deserializers[key] = s;
+ });
+ }
+ }
+
+ /**
+ * Gets the default deserializers as an associative array.
+ * @returns {Object}
+ */
+ getDefaultDeserializers() {
+ return graphSON2Deserializers;
+ }
+
+ read(obj) {
+ if (obj === undefined) {
+ return undefined;
+ }
+ if (obj === null) {
+ return null;
+ }
+ if (Array.isArray(obj)) {
+ return obj.map((item) => this.read(item));
+ }
+ const type = obj[typeSerializers.typeKey];
+ if (type) {
+ const d = this._deserializers[type];
+ if (d) {
+ // Use type serializer
+ return d.deserialize(obj);
+ }
+ return obj[typeSerializers.valueKey];
+ }
+ if (obj && typeof obj === 'object' && obj.constructor === Object) {
+ return this._deserializeObject(obj);
+ }
+ // Default (for boolean, number and other scalars)
+ return obj;
+ }
+
+ readResponse(buffer) {
+ return this.read(JSON.parse(buffer.toString()));
+ }
+
+ _deserializeObject(obj) {
+ const keys = Object.keys(obj);
+ const result = {};
+ for (let i = 0; i < keys.length; i++) {
+ result[keys[i]] = this.read(obj[keys[i]]);
+ }
+ return result;
+ }
+}
+
+/**
+ * GraphSON3 reader.
+ */
+class GraphSON3Reader extends GraphSON2Reader {
+ getDefaultDeserializers() {
+ return graphSON3Deserializers;
+ }
+}
+
+const graphSON2Deserializers = {
+ 'g:Traverser': typeSerializers.TraverserSerializer,
+ 'g:TraversalStrategy': typeSerializers.TraversalStrategySerializer,
+ 'g:Int32': typeSerializers.NumberSerializer,
+ 'g:Int64': typeSerializers.NumberSerializer,
+ 'g:Float': typeSerializers.NumberSerializer,
+ 'g:Double': typeSerializers.NumberSerializer,
+ 'g:Date': typeSerializers.DateSerializer,
+ 'g:Direction': typeSerializers.DirectionSerializer,
+ 'g:Vertex': typeSerializers.VertexSerializer,
+ 'g:Edge': typeSerializers.EdgeSerializer,
+ 'g:VertexProperty': typeSerializers.VertexPropertySerializer,
+ 'g:Property': typeSerializers.PropertySerializer,
+ 'g:Path': typeSerializers.Path3Serializer,
+ 'g:TextP': typeSerializers.TextPSerializer,
+ 'g:T': typeSerializers.TSerializer,
+ 'g:BulkSet': typeSerializers.BulkSetSerializer,
+};
+
+const graphSON3Deserializers = Object.assign({}, graphSON2Deserializers, {
+ 'g:List': typeSerializers.ListSerializer,
+ 'g:Set': typeSerializers.SetSerializer,
+ 'g:Map': typeSerializers.MapSerializer,
+});
+
+const graphSON2Serializers = [
+ typeSerializers.NumberSerializer,
+ typeSerializers.DateSerializer,
+ typeSerializers.BytecodeSerializer,
+ typeSerializers.TraverserSerializer,
+ typeSerializers.TraversalStrategySerializer,
+ typeSerializers.PSerializer,
+ typeSerializers.TextPSerializer,
+ typeSerializers.LambdaSerializer,
+ typeSerializers.EnumSerializer,
+ typeSerializers.VertexSerializer,
+ typeSerializers.EdgeSerializer,
+ typeSerializers.LongSerializer,
+];
+
+const graphSON3Serializers = graphSON2Serializers.concat([
+ typeSerializers.ListSerializer,
+ typeSerializers.SetSerializer,
+ typeSerializers.MapSerializer,
+]);
+
+module.exports = {
+ GraphSON3Writer,
+ GraphSON3Reader,
+ GraphSON2Writer,
+ GraphSON2Reader,
+ GraphSONWriter: GraphSON3Writer,
+ GraphSONReader: GraphSON3Reader,
+};
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrat
egy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a hr
ef="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#statics">statics</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Jan 20 2023 17:38:51 GMT-0800 (Pacific Standard Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
Added: tinkerpop/site/jsdocs/3.6.2/structure_io_type-serializers.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/structure_io_type-serializers.js.html?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/structure_io_type-serializers.js.html (added)
+++ tinkerpop/site/jsdocs/3.6.2/structure_io_type-serializers.js.html Sat Jan 21 03:22:46 2023
@@ -0,0 +1,555 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: structure/io/type-serializers.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: structure/io/type-serializers.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Jorge Bay Gondra
+ */
+'use strict';
+
+const t = require('../../process/traversal');
+const ts = require('../../process/traversal-strategy');
+const Bytecode = require('../../process/bytecode');
+const g = require('../graph');
+const utils = require('../../utils');
+
+const valueKey = '@value';
+const typeKey = '@type';
+
+/**
+ * @abstract
+ */
+class TypeSerializer {
+ serialize() {
+ throw new Error('serialize() method not implemented for ' + this.constructor.name);
+ }
+
+ deserialize() {
+ throw new Error('deserialize() method not implemented for ' + this.constructor.name);
+ }
+
+ canBeUsedFor() {
+ throw new Error('canBeUsedFor() method not implemented for ' + this.constructor.name);
+ }
+}
+
+class NumberSerializer extends TypeSerializer {
+ serialize(item) {
+ if (isNaN(item)) {
+ return {
+ [typeKey]: 'g:Double',
+ [valueKey]: 'NaN',
+ };
+ } else if (item === Number.POSITIVE_INFINITY) {
+ return {
+ [typeKey]: 'g:Double',
+ [valueKey]: 'Infinity',
+ };
+ } else if (item === Number.NEGATIVE_INFINITY) {
+ return {
+ [typeKey]: 'g:Double',
+ [valueKey]: '-Infinity',
+ };
+ }
+ return item;
+ }
+
+ deserialize(obj) {
+ const val = obj[valueKey];
+ if (val === 'NaN') {
+ return NaN;
+ } else if (val === 'Infinity') {
+ return Number.POSITIVE_INFINITY;
+ } else if (val === '-Infinity') {
+ return Number.NEGATIVE_INFINITY;
+ }
+ return parseFloat(val);
+ }
+
+ canBeUsedFor(value) {
+ return typeof value === 'number';
+ }
+}
+
+class DateSerializer extends TypeSerializer {
+ serialize(item) {
+ return {
+ [typeKey]: 'g:Date',
+ [valueKey]: item.getTime(),
+ };
+ }
+
+ deserialize(obj) {
+ return new Date(obj[valueKey]);
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof Date;
+ }
+}
+
+class LongSerializer extends TypeSerializer {
+ serialize(item) {
+ return {
+ [typeKey]: 'g:Int64',
+ [valueKey]: item.value,
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof utils.Long;
+ }
+}
+
+class BytecodeSerializer extends TypeSerializer {
+ serialize(item) {
+ let bytecode = item;
+ if (item instanceof t.Traversal) {
+ bytecode = item.getBytecode();
+ }
+ const result = {};
+ result[typeKey] = 'g:Bytecode';
+ const resultValue = (result[valueKey] = {});
+ const sources = this._serializeInstructions(bytecode.sourceInstructions);
+ if (sources) {
+ resultValue['source'] = sources;
+ }
+ const steps = this._serializeInstructions(bytecode.stepInstructions);
+ if (steps) {
+ resultValue['step'] = steps;
+ }
+ return result;
+ }
+
+ _serializeInstructions(instructions) {
+ if (instructions.length === 0) {
+ return null;
+ }
+ const result = new Array(instructions.length);
+ result[0] = instructions[0];
+ for (let i = 0; i < instructions.length; i++) {
+ result[i] = instructions[i].map((item) => this.writer.adaptObject(item));
+ }
+ return result;
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof Bytecode || value instanceof t.Traversal;
+ }
+}
+
+class PSerializer extends TypeSerializer {
+ /** @param {P} item */
+ serialize(item) {
+ const result = {};
+ result[typeKey] = 'g:P';
+ const resultValue = (result[valueKey] = {
+ predicate: item.operator,
+ });
+ if (item.other === undefined || item.other === null) {
+ resultValue['value'] = this.writer.adaptObject(item.value);
+ } else {
+ resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
+ }
+ return result;
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof t.P;
+ }
+}
+
+class TextPSerializer extends TypeSerializer {
+ /** @param {TextP} item */
+ serialize(item) {
+ const result = {};
+ result[typeKey] = 'g:TextP';
+ const resultValue = (result[valueKey] = {
+ predicate: item.operator,
+ });
+ if (item.other === undefined || item.other === null) {
+ resultValue['value'] = this.writer.adaptObject(item.value);
+ } else {
+ resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
+ }
+ return result;
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof t.TextP;
+ }
+}
+
+class LambdaSerializer extends TypeSerializer {
+ /** @param {Function} item */
+ serialize(item) {
+ const lambdaDef = item();
+
+ // check if the language is specified otherwise assume gremlin-groovy.
+ const returnIsString = typeof lambdaDef === 'string';
+ const script = returnIsString ? lambdaDef : lambdaDef[0];
+ const lang = returnIsString ? 'gremlin-groovy' : lambdaDef[1];
+
+ // detect argument count
+ const argCount =
+ lang === 'gremlin-groovy' && script.includes('->')
+ ? script.substring(0, script.indexOf('->')).includes(',')
+ ? 2
+ : 1
+ : -1;
+
+ return {
+ [typeKey]: 'g:Lambda',
+ [valueKey]: {
+ arguments: argCount,
+ language: lang,
+ script: script,
+ },
+ };
+ }
+
+ canBeUsedFor(value) {
+ return typeof value === 'function';
+ }
+}
+
+class EnumSerializer extends TypeSerializer {
+ /** @param {EnumValue} item */
+ serialize(item) {
+ return {
+ [typeKey]: 'g:' + item.typeName,
+ [valueKey]: item.elementName,
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value && value.typeName && value instanceof t.EnumValue;
+ }
+}
+
+class TraverserSerializer extends TypeSerializer {
+ /** @param {Traverser} item */
+ serialize(item) {
+ return {
+ [typeKey]: 'g:Traverser',
+ [valueKey]: {
+ value: this.writer.adaptObject(item.object),
+ bulk: this.writer.adaptObject(item.bulk),
+ },
+ };
+ }
+
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof t.Traverser;
+ }
+}
+
+class TraversalStrategySerializer extends TypeSerializer {
+ /** @param {TraversalStrategy} item */
+ serialize(item) {
+ const conf = {};
+ for (const k in item.configuration) {
+ if (item.configuration.hasOwnProperty(k)) {
+ conf[k] = this.writer.adaptObject(item.configuration[k]);
+ }
+ }
+
+ return {
+ [typeKey]: 'g:' + item.constructor.name,
+ [valueKey]: conf,
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof ts.TraversalStrategy;
+ }
+}
+
+class VertexSerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new g.Vertex(this.reader.read(value['id']), value['label'], this.reader.read(value['properties']));
+ }
+
+ /** @param {Vertex} item */
+ serialize(item) {
+ return {
+ [typeKey]: 'g:Vertex',
+ [valueKey]: {
+ id: this.writer.adaptObject(item.id),
+ label: item.label,
+ },
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof g.Vertex;
+ }
+}
+
+class VertexPropertySerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new g.VertexProperty(
+ this.reader.read(value['id']),
+ value['label'],
+ this.reader.read(value['value']),
+ this.reader.read(value['properties']),
+ );
+ }
+}
+
+class PropertySerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new g.Property(value['key'], this.reader.read(value['value']));
+ }
+}
+
+class EdgeSerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new g.Edge(
+ this.reader.read(value['id']),
+ new g.Vertex(this.reader.read(value['outV']), this.reader.read(value['outVLabel'])),
+ value['label'],
+ new g.Vertex(this.reader.read(value['inV']), this.reader.read(value['inVLabel'])),
+ this.reader.read(value['properties']),
+ );
+ }
+
+ /** @param {Edge} item */
+ serialize(item) {
+ return {
+ [typeKey]: 'g:Edge',
+ [valueKey]: {
+ id: this.writer.adaptObject(item.id),
+ label: item.label,
+ outV: this.writer.adaptObject(item.outV.id),
+ outVLabel: item.outV.label,
+ inV: this.writer.adaptObject(item.inV.id),
+ inVLabel: item.inV.label,
+ },
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof g.Edge;
+ }
+}
+
+class PathSerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ const objects = value['objects'].map((o) => this.reader.read(o));
+ return new g.Path(this.reader.read(value['labels']), objects);
+ }
+}
+
+class Path3Serializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ return new g.Path(this.reader.read(value['labels']), this.reader.read(value['objects']));
+ }
+}
+
+class TSerializer extends TypeSerializer {
+ deserialize(obj) {
+ return t.t[obj[valueKey]];
+ }
+}
+
+class DirectionSerializer extends TypeSerializer {
+ deserialize(obj) {
+ return t.direction[obj[valueKey].toLowerCase()];
+ }
+}
+
+class ArraySerializer extends TypeSerializer {
+ constructor(typeKey) {
+ super();
+ this.typeKey = typeKey;
+ }
+
+ deserialize(obj) {
+ const value = obj[valueKey];
+ if (!Array.isArray(value)) {
+ throw new Error('Expected Array, obtained: ' + value);
+ }
+ return value.map((x) => this.reader.read(x));
+ }
+
+ /** @param {Array} item */
+ serialize(item) {
+ return {
+ [typeKey]: this.typeKey,
+ [valueKey]: item.map((x) => this.writer.adaptObject(x)),
+ };
+ }
+
+ canBeUsedFor(value) {
+ return Array.isArray(value);
+ }
+}
+
+class BulkSetSerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ if (!Array.isArray(value)) {
+ throw new Error('Expected Array, obtained: ' + value);
+ }
+
+ // coerce the BulkSet to List. if the bulk exceeds the int space then we can't coerce to List anyway,
+ // so this query will be trouble. we'd need a legit BulkSet implementation here in js. this current
+ // implementation is here to replicate the previous functionality that existed on the server side in
+ // previous versions.
+ let result = [];
+ for (let ix = 0, iy = value.length; ix < iy; ix += 2) {
+ const pair = value.slice(ix, ix + 2);
+ result = result.concat(Array(this.reader.read(pair[1])).fill(this.reader.read(pair[0])));
+ }
+
+ return result;
+ }
+}
+
+class MapSerializer extends TypeSerializer {
+ deserialize(obj) {
+ const value = obj[valueKey];
+ if (!Array.isArray(value)) {
+ throw new Error('Expected Array, obtained: ' + value);
+ }
+ const result = new Map();
+ for (let i = 0; i < value.length; i += 2) {
+ result.set(this.reader.read(value[i]), this.reader.read(value[i + 1]));
+ }
+ return result;
+ }
+
+ /** @param {Map} map */
+ serialize(map) {
+ const arr = [];
+ map.forEach((v, k) => {
+ arr.push(this.writer.adaptObject(k));
+ arr.push(this.writer.adaptObject(v));
+ });
+ return {
+ [typeKey]: 'g:Map',
+ [valueKey]: arr,
+ };
+ }
+
+ canBeUsedFor(value) {
+ return value instanceof Map;
+ }
+}
+
+class ListSerializer extends ArraySerializer {
+ constructor() {
+ super('g:List');
+ }
+}
+
+class SetSerializer extends ArraySerializer {
+ constructor() {
+ super('g:Set');
+ }
+}
+
+module.exports = {
+ BulkSetSerializer,
+ BytecodeSerializer,
+ DateSerializer,
+ DirectionSerializer,
+ EdgeSerializer,
+ EnumSerializer,
+ LambdaSerializer,
+ ListSerializer,
+ LongSerializer,
+ MapSerializer,
+ NumberSerializer,
+ Path3Serializer,
+ PathSerializer,
+ PropertySerializer,
+ PSerializer,
+ TextPSerializer,
+ SetSerializer,
+ TSerializer,
+ TraverserSerializer,
+ TraversalStrategySerializer,
+ typeKey,
+ valueKey,
+ VertexPropertySerializer,
+ VertexSerializer,
+};
+</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrat
egy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a hr
ef="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#statics">statics</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Fri Jan 20 2023 17:38:51 GMT-0800 (Pacific Standard Time)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
Added: tinkerpop/site/jsdocs/3.6.2/styles/jsdoc-default.css
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/styles/jsdoc-default.css?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/styles/jsdoc-default.css (added)
+++ tinkerpop/site/jsdocs/3.6.2/styles/jsdoc-default.css Sat Jan 21 03:22:46 2023
@@ -0,0 +1,358 @@
+@font-face {
+ font-family: 'Open Sans';
+ font-weight: normal;
+ font-style: normal;
+ src: url('../fonts/OpenSans-Regular-webfont.eot');
+ src:
+ local('Open Sans'),
+ local('OpenSans'),
+ url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
+ url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
+ url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
+}
+
+@font-face {
+ font-family: 'Open Sans Light';
+ font-weight: normal;
+ font-style: normal;
+ src: url('../fonts/OpenSans-Light-webfont.eot');
+ src:
+ local('Open Sans Light'),
+ local('OpenSans Light'),
+ url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
+ url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
+ url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
+}
+
+html
+{
+ overflow: auto;
+ background-color: #fff;
+ font-size: 14px;
+}
+
+body
+{
+ font-family: 'Open Sans', sans-serif;
+ line-height: 1.5;
+ color: #4d4e53;
+ background-color: white;
+}
+
+a, a:visited, a:active {
+ color: #0095dd;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+header
+{
+ display: block;
+ padding: 0px 4px;
+}
+
+tt, code, kbd, samp {
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.class-description {
+ font-size: 130%;
+ line-height: 140%;
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.class-description:empty {
+ margin: 0;
+}
+
+#main {
+ float: left;
+ width: 70%;
+}
+
+article dl {
+ margin-bottom: 40px;
+}
+
+article img {
+ max-width: 100%;
+}
+
+section
+{
+ display: block;
+ background-color: #fff;
+ padding: 12px 24px;
+ border-bottom: 1px solid #ccc;
+ margin-right: 30px;
+}
+
+.variation {
+ display: none;
+}
+
+.signature-attributes {
+ font-size: 60%;
+ color: #aaa;
+ font-style: italic;
+ font-weight: lighter;
+}
+
+nav
+{
+ display: block;
+ float: right;
+ margin-top: 28px;
+ width: 30%;
+ box-sizing: border-box;
+ border-left: 1px solid #ccc;
+ padding-left: 16px;
+}
+
+nav ul {
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
+ font-size: 100%;
+ line-height: 17px;
+ padding: 0;
+ margin: 0;
+ list-style-type: none;
+}
+
+nav ul a, nav ul a:visited, nav ul a:active {
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ line-height: 18px;
+ color: #4D4E53;
+}
+
+nav h3 {
+ margin-top: 12px;
+}
+
+nav li {
+ margin-top: 6px;
+}
+
+footer {
+ display: block;
+ padding: 6px;
+ margin-top: 12px;
+ font-style: italic;
+ font-size: 90%;
+}
+
+h1, h2, h3, h4 {
+ font-weight: 200;
+ margin: 0;
+}
+
+h1
+{
+ font-family: 'Open Sans Light', sans-serif;
+ font-size: 48px;
+ letter-spacing: -2px;
+ margin: 12px 24px 20px;
+}
+
+h2, h3.subsection-title
+{
+ font-size: 30px;
+ font-weight: 700;
+ letter-spacing: -1px;
+ margin-bottom: 12px;
+}
+
+h3
+{
+ font-size: 24px;
+ letter-spacing: -0.5px;
+ margin-bottom: 12px;
+}
+
+h4
+{
+ font-size: 18px;
+ letter-spacing: -0.33px;
+ margin-bottom: 12px;
+ color: #4d4e53;
+}
+
+h5, .container-overview .subsection-title
+{
+ font-size: 120%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin: 8px 0 3px 0;
+}
+
+h6
+{
+ font-size: 100%;
+ letter-spacing: -0.01em;
+ margin: 6px 0 3px 0;
+ font-style: italic;
+}
+
+table
+{
+ border-spacing: 0;
+ border: 0;
+ border-collapse: collapse;
+}
+
+td, th
+{
+ border: 1px solid #ddd;
+ margin: 0px;
+ text-align: left;
+ vertical-align: top;
+ padding: 4px 6px;
+ display: table-cell;
+}
+
+thead tr
+{
+ background-color: #ddd;
+ font-weight: bold;
+}
+
+th { border-right: 1px solid #aaa; }
+tr > th:last-child { border-right: 1px solid #ddd; }
+
+.ancestors, .attribs { color: #999; }
+.ancestors a, .attribs a
+{
+ color: #999 !important;
+ text-decoration: none;
+}
+
+.clear
+{
+ clear: both;
+}
+
+.important
+{
+ font-weight: bold;
+ color: #950B02;
+}
+
+.yes-def {
+ text-indent: -1000px;
+}
+
+.type-signature {
+ color: #aaa;
+}
+
+.name, .signature {
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.details { margin-top: 14px; border-left: 2px solid #DDD; }
+.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
+.details dd { margin-left: 70px; }
+.details ul { margin: 0; }
+.details ul { list-style-type: none; }
+.details li { margin-left: 30px; padding-top: 6px; }
+.details pre.prettyprint { margin: 0 }
+.details .object-value { padding-top: 0; }
+
+.description {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.code-caption
+{
+ font-style: italic;
+ font-size: 107%;
+ margin: 0;
+}
+
+.source
+{
+ border: 1px solid #ddd;
+ width: 80%;
+ overflow: auto;
+}
+
+.prettyprint.source {
+ width: inherit;
+}
+
+.source code
+{
+ font-size: 100%;
+ line-height: 18px;
+ display: block;
+ padding: 4px 12px;
+ margin: 0;
+ background-color: #fff;
+ color: #4D4E53;
+}
+
+.prettyprint code span.line
+{
+ display: inline-block;
+}
+
+.prettyprint.linenums
+{
+ padding-left: 70px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.prettyprint.linenums ol
+{
+ padding-left: 0;
+}
+
+.prettyprint.linenums li
+{
+ border-left: 3px #ddd solid;
+}
+
+.prettyprint.linenums li.selected,
+.prettyprint.linenums li.selected *
+{
+ background-color: lightyellow;
+}
+
+.prettyprint.linenums li *
+{
+ -webkit-user-select: text;
+ -moz-user-select: text;
+ -ms-user-select: text;
+ user-select: text;
+}
+
+.params .name, .props .name, .name code {
+ color: #4D4E53;
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ font-size: 100%;
+}
+
+.params td.description > p:first-child,
+.props td.description > p:first-child
+{
+ margin-top: 0;
+ padding-top: 0;
+}
+
+.params td.description > p:last-child,
+.props td.description > p:last-child
+{
+ margin-bottom: 0;
+ padding-bottom: 0;
+}
+
+.disabled {
+ color: #454545;
+}
Added: tinkerpop/site/jsdocs/3.6.2/styles/prettify-jsdoc.css
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/styles/prettify-jsdoc.css?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/styles/prettify-jsdoc.css (added)
+++ tinkerpop/site/jsdocs/3.6.2/styles/prettify-jsdoc.css Sat Jan 21 03:22:46 2023
@@ -0,0 +1,111 @@
+/* JSDoc prettify.js theme */
+
+/* plain text */
+.pln {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* string content */
+.str {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a keyword */
+.kwd {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a comment */
+.com {
+ font-weight: normal;
+ font-style: italic;
+}
+
+/* a type name */
+.typ {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a literal value */
+.lit {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* punctuation */
+.pun {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* lisp open bracket */
+.opn {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* lisp close bracket */
+.clo {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a markup tag name */
+.tag {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a markup attribute name */
+.atn {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a markup attribute value */
+.atv {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a declaration */
+.dec {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a variable name */
+.var {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a function name */
+.fun {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+ margin-top: 0;
+ margin-bottom: 0;
+}
Added: tinkerpop/site/jsdocs/3.6.2/styles/prettify-tomorrow.css
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.6.2/styles/prettify-tomorrow.css?rev=1906850&view=auto
==============================================================================
--- tinkerpop/site/jsdocs/3.6.2/styles/prettify-tomorrow.css (added)
+++ tinkerpop/site/jsdocs/3.6.2/styles/prettify-tomorrow.css Sat Jan 21 03:22:46 2023
@@ -0,0 +1,132 @@
+/* Tomorrow Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* Pretty printing styles. Used with prettify.js. */
+/* SPAN elements with the classes below are added by prettyprint. */
+/* plain text */
+.pln {
+ color: #4d4d4c; }
+
+@media screen {
+ /* string content */
+ .str {
+ color: #718c00; }
+
+ /* a keyword */
+ .kwd {
+ color: #8959a8; }
+
+ /* a comment */
+ .com {
+ color: #8e908c; }
+
+ /* a type name */
+ .typ {
+ color: #4271ae; }
+
+ /* a literal value */
+ .lit {
+ color: #f5871f; }
+
+ /* punctuation */
+ .pun {
+ color: #4d4d4c; }
+
+ /* lisp open bracket */
+ .opn {
+ color: #4d4d4c; }
+
+ /* lisp close bracket */
+ .clo {
+ color: #4d4d4c; }
+
+ /* a markup tag name */
+ .tag {
+ color: #c82829; }
+
+ /* a markup attribute name */
+ .atn {
+ color: #f5871f; }
+
+ /* a markup attribute value */
+ .atv {
+ color: #3e999f; }
+
+ /* a declaration */
+ .dec {
+ color: #f5871f; }
+
+ /* a variable name */
+ .var {
+ color: #c82829; }
+
+ /* a function name */
+ .fun {
+ color: #4271ae; } }
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+ .str {
+ color: #060; }
+
+ .kwd {
+ color: #006;
+ font-weight: bold; }
+
+ .com {
+ color: #600;
+ font-style: italic; }
+
+ .typ {
+ color: #404;
+ font-weight: bold; }
+
+ .lit {
+ color: #044; }
+
+ .pun, .opn, .clo {
+ color: #440; }
+
+ .tag {
+ color: #006;
+ font-weight: bold; }
+
+ .atn {
+ color: #404; }
+
+ .atv {
+ color: #060; } }
+/* Style */
+/*
+pre.prettyprint {
+ background: white;
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ font-size: 12px;
+ line-height: 1.5;
+ border: 1px solid #ccc;
+ padding: 10px; }
+*/
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+ margin-top: 0;
+ margin-bottom: 0; }
+
+/* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L4,
+li.L5,
+li.L6,
+li.L7,
+li.L8,
+li.L9 {
+ /* */ }
+
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 {
+ /* */ }