gremlin 3.7.5 → 3.7.6

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 (81) hide show
  1. package/.prettierrc.js +1 -1
  2. package/NOTICE +1 -1
  3. package/doc/AnonymousTraversalSource.html +46 -46
  4. package/doc/Authenticator.html +2 -2
  5. package/doc/Bytecode.html +87 -87
  6. package/doc/CardinalityValue.html +2 -2
  7. package/doc/Client.html +2 -2
  8. package/doc/Connection.html +5 -5
  9. package/doc/DriverRemoteConnection.html +2 -2
  10. package/doc/EdgeLabelVerificationStrategy.html +2 -2
  11. package/doc/Graph.html +2 -2
  12. package/doc/GraphSON2Reader.html +2 -2
  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 +328 -328
  17. package/doc/GraphTraversalSource.html +299 -299
  18. package/doc/HaltedTraverserStrategy.html +2 -2
  19. package/doc/MatchAlgorithmStrategy.html +2 -2
  20. package/doc/P.html +107 -107
  21. package/doc/PartitionStrategy.html +2 -2
  22. package/doc/Path.html +2 -2
  23. package/doc/PlainTextSaslAuthenticator.html +2 -2
  24. package/doc/ProductiveByStrategy.html +2 -2
  25. package/doc/RemoteConnection.html +2 -2
  26. package/doc/RemoteStrategy.html +2 -2
  27. package/doc/RemoteTraversal.html +2 -2
  28. package/doc/ReservedKeysVerificationStrategy.html +2 -2
  29. package/doc/ResponseError.html +2 -2
  30. package/doc/ResultSet.html +2 -2
  31. package/doc/SaslAuthenticator.html +2 -2
  32. package/doc/SaslMechanismBase.html +2 -2
  33. package/doc/SaslMechanismPlain.html +2 -2
  34. package/doc/SeedStrategy.html +2 -2
  35. package/doc/SubgraphStrategy.html +2 -2
  36. package/doc/TextP.html +101 -101
  37. package/doc/Transaction.html +2 -2
  38. package/doc/Translator.html +2 -2
  39. package/doc/TraversalStrategies.html +2 -2
  40. package/doc/TraversalStrategy.html +2 -2
  41. package/doc/TypeSerializer.html +2 -2
  42. package/doc/driver_auth_authenticator.js.html +2 -2
  43. package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +2 -2
  44. package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +2 -2
  45. package/doc/driver_auth_plain-text-sasl-authenticator.js.html +2 -2
  46. package/doc/driver_auth_sasl-authenticator.js.html +2 -2
  47. package/doc/driver_client.js.html +2 -2
  48. package/doc/driver_connection.js.html +8 -5
  49. package/doc/driver_driver-remote-connection.js.html +2 -2
  50. package/doc/driver_remote-connection.js.html +2 -2
  51. package/doc/driver_response-error.js.html +2 -2
  52. package/doc/driver_result-set.js.html +2 -2
  53. package/doc/global.html +2 -2
  54. package/doc/index.html +2 -2
  55. package/doc/module.exports.html +2 -2
  56. package/doc/process_anonymous-traversal.js.html +2 -2
  57. package/doc/process_bytecode.js.html +2 -2
  58. package/doc/process_graph-traversal.js.html +2 -2
  59. package/doc/process_transaction.js.html +2 -2
  60. package/doc/process_translator.js.html +2 -2
  61. package/doc/process_traversal-strategy.js.html +2 -2
  62. package/doc/process_traversal.js.html +2 -2
  63. package/doc/structure_graph.js.html +2 -2
  64. package/doc/structure_io_binary_internals_DataType.js.html +2 -2
  65. package/doc/structure_io_binary_internals_GraphBinaryReader.js.html +2 -2
  66. package/doc/structure_io_binary_internals_GraphBinaryWriter.js.html +2 -2
  67. package/doc/structure_io_graph-serializer.js.html +2 -2
  68. package/doc/structure_io_type-serializers.js.html +2 -2
  69. package/doc/utils.js.html +3 -3
  70. package/docker-compose.yml +14 -4
  71. package/eslint.config.mjs +143 -0
  72. package/index.js +1 -1
  73. package/lib/driver/connection.js +6 -3
  74. package/lib/utils.js +1 -1
  75. package/package.json +11 -9
  76. package/.eslintrc.js +0 -154
  77. package/Gruntfile.js +0 -35
  78. package/doc/DataType.js.html +0 -150
  79. package/doc/GraphBinaryReader.js.html +0 -132
  80. package/doc/GraphBinaryWriter.js.html +0 -135
  81. package/licenses/chai +0 -21
@@ -0,0 +1,143 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ import js from "@eslint/js";
21
+ import prettier from "eslint-config-prettier";
22
+ import prettierPlugin from "eslint-plugin-prettier";
23
+ import globals from "globals";
24
+
25
+ export default [
26
+ js.configs.recommended,
27
+ prettier,
28
+ {
29
+ plugins: {
30
+ prettier: prettierPlugin,
31
+ },
32
+ languageOptions: {
33
+ ecmaVersion: 2022,
34
+ sourceType: "commonjs",
35
+ globals: {
36
+ ...globals.node,
37
+ ...globals.commonjs,
38
+ ...globals.mocha,
39
+ BigInt: "readonly",
40
+ },
41
+ },
42
+ rules: {
43
+ "prettier/prettier": ["error", { endOfLine: "auto" }],
44
+ "linebreak-style": 0,
45
+ quotes: ["error", "single"],
46
+ semi: ["error", "always"],
47
+ "no-constant-condition": ["error", { checkLoops: false }],
48
+ strict: ["error", "global"],
49
+ "array-callback-return": "error",
50
+ curly: "error",
51
+ "no-unused-vars": ["error", { args: "none" }],
52
+ "global-require": "error",
53
+ eqeqeq: ["error", "allow-null"],
54
+ "guard-for-in": "error",
55
+ "no-alert": "error",
56
+ "no-caller": "error",
57
+ "no-case-declarations": "error",
58
+ "no-else-return": "error",
59
+ "no-empty-pattern": "error",
60
+ "no-eval": "error",
61
+ "no-extend-native": "error",
62
+ "no-extra-bind": "error",
63
+ "no-extra-label": "error",
64
+ "no-floating-decimal": "error",
65
+ "no-global-assign": ["error", { exceptions: [] }],
66
+ "no-implicit-coercion": [
67
+ "off",
68
+ {
69
+ boolean: false,
70
+ number: true,
71
+ string: true,
72
+ allow: [],
73
+ },
74
+ ],
75
+ "no-implied-eval": "error",
76
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
77
+ "no-lone-blocks": "error",
78
+ "no-loop-func": "error",
79
+ "no-multi-spaces": "error",
80
+ "no-new": "error",
81
+ "no-new-func": "error",
82
+ "no-new-wrappers": "error",
83
+ "no-octal-escape": "error",
84
+ "no-proto": "error",
85
+ "no-prototype-builtins": 0,
86
+ "no-redeclare": "error",
87
+ "no-restricted-properties": [
88
+ "error",
89
+ {
90
+ object: "arguments",
91
+ property: "callee",
92
+ message: "arguments.callee is deprecated",
93
+ },
94
+ {
95
+ property: "__defineGetter__",
96
+ message: "Please use Object.defineProperty instead.",
97
+ },
98
+ {
99
+ property: "__defineSetter__",
100
+ message: "Please use Object.defineProperty instead.",
101
+ },
102
+ ],
103
+ "no-self-assign": "error",
104
+ "no-self-compare": "error",
105
+ "no-sequences": "error",
106
+ "no-throw-literal": "error",
107
+ "no-unmodified-loop-condition": "off",
108
+ "no-unused-expressions": [
109
+ "error",
110
+ {
111
+ allowShortCircuit: false,
112
+ allowTernary: false,
113
+ },
114
+ ],
115
+ "no-useless-call": "off",
116
+ "no-useless-concat": "error",
117
+ "no-useless-escape": "error",
118
+ "no-useless-return": "error",
119
+ "no-void": "error",
120
+ "no-with": "error",
121
+ "no-buffer-constructor": "error",
122
+ radix: "error",
123
+ "no-var": "error",
124
+ "prefer-const": "error",
125
+ "arrow-body-style": ["error", "as-needed"],
126
+ "arrow-spacing": "error",
127
+ "no-confusing-arrow": ["error", { allowParens: true }],
128
+ yoda: "error",
129
+ "constructor-super": "error",
130
+ "require-await": "error",
131
+ "require-atomic-updates": "off",
132
+ },
133
+ },
134
+ {
135
+ ignores: ["test/**/*.js", "doc/**/*.js", "node_modules/**/*", ".prettierrc.js", "eslint.config.mjs"],
136
+ },
137
+ {
138
+ files: ["eslint.config.mjs"],
139
+ languageOptions: {
140
+ sourceType: "module",
141
+ },
142
+ },
143
+ ];
package/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * "License"); you may not use this file except in compliance
8
8
  * with the License. You may obtain a copy of the License at
9
9
  *
10
- * http://www.apache.org/licenses/LICENSE-2.0
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
11
  *
12
12
  * Unless required by applicable law or agreed to in writing,
13
13
  * software distributed under the License is distributed on an
@@ -135,9 +135,12 @@ class Connection extends EventEmitter {
135
135
  'perMessageDeflate',
136
136
  ]);
137
137
  // Check if any `ws` specific options are provided and are non-null / non-undefined
138
- const hasWsSpecificOptions = Object.entries(this.options).some(
139
- ([key, value]) => wsSpecificOptions.has(key) && ![null, undefined].includes(value),
140
- );
138
+ const hasWsSpecificOptions =
139
+ Object.entries(this.options).some(
140
+ ([key, value]) => wsSpecificOptions.has(key) && ![null, undefined].includes(value),
141
+ ) ||
142
+ this._enableCompression || // we need to check the presence of this variable and pass this into ws
143
+ this._enableUserAgentOnConnect; // global websocket will send "node" as user agent by default which doesn't comply with Gremlin
141
144
  // Only use the global websocket if we don't have any unsupported options
142
145
  const useGlobalWebSocket = !hasWsSpecificOptions && globalThis.WebSocket;
143
146
  const WebSocket = useGlobalWebSocket || (await import('ws')).default;
package/lib/utils.js CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  const uuid = require('uuid');
27
27
 
28
- const gremlinVersion = '3.7.5'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
28
+ const gremlinVersion = '3.7.6'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
29
29
 
30
30
  exports.toLong = function toLong(value) {
31
31
  return new Long(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gremlin",
3
- "version": "3.7.5",
3
+ "version": "3.7.6",
4
4
  "description": "JavaScript Gremlin Language Variant",
5
5
  "author": "Apache TinkerPop team",
6
6
  "keywords": [
@@ -24,15 +24,16 @@
24
24
  "chai": "~4.5.0",
25
25
  "chai-string": "~1.5.0",
26
26
  "colors": "1.4.0",
27
- "cross-env": "^7.0.3",
28
- "cucumber": "~6.0.7",
29
- "eslint": "^8.42.0",
27
+ "cross-env": "^10.1.0",
28
+ "@cucumber/cucumber": "~12.7.0",
29
+ "@eslint/js": "^9.16.0",
30
+ "eslint": "^9.36.0",
30
31
  "eslint-config-prettier": "^10.0.1",
31
32
  "eslint-plugin-prettier": "^5.0.0",
32
- "grunt": "^1.5.3",
33
- "grunt-cli": "~1.5.0",
34
- "grunt-jsdoc": "~2.4.1",
35
- "mocha": "^10.2.0",
33
+ "globals": "^15.14.0",
34
+ "jsdoc": "^4.0.5",
35
+ "js-yaml": "^3.14.2",
36
+ "mocha": "^11.7.5",
36
37
  "prettier": "^3.0.0"
37
38
  },
38
39
  "repository": {
@@ -56,7 +57,8 @@
56
57
  "features-docker": "npm run features-graphson30-docker && npm run features-graphbinary-docker",
57
58
  "features-graphson30-docker": "cross-env CLIENT_MIMETYPE='application/vnd.gremlin-v3.0+json' cucumber-js --require test/cucumber ../gremlin-test/",
58
59
  "features-graphbinary-docker": "cross-env CLIENT_MIMETYPE='application/vnd.graphbinary-v1.0' cucumber-js --require test/cucumber ../gremlin-test/",
59
- "lint": "eslint --ext .js ."
60
+ "lint": "eslint .",
61
+ "doc": "jsdoc -r -d doc -R README.md lib/"
60
62
  },
61
63
  "engines": {
62
64
  "node": ">=20"
package/.eslintrc.js DELETED
@@ -1,154 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
-
20
- 'use strict';
21
-
22
- module.exports = {
23
- env: {
24
- commonjs: true,
25
- es2022: true,
26
- node: true,
27
- },
28
- parserOptions: {
29
- ecmaVersion: 2022,
30
- },
31
- ignorePatterns: ['test/**/*.js', 'doc/**/*.js'],
32
- extends: ['eslint:recommended', 'prettier'],
33
- plugins: ['prettier'],
34
- rules: {
35
- 'prettier/prettier': ['error', { endOfLine: 'auto' }],
36
- 'linebreak-style': 0,
37
- quotes: ['error', 'single'],
38
- semi: ['error', 'always'],
39
- 'no-constant-condition': ['error', { checkLoops: false }],
40
- strict: ['error', 'global'],
41
- 'array-callback-return': 'error',
42
- curly: 'error',
43
- 'no-unused-vars': ['error', { args: 'none' }],
44
- 'global-require': 'error',
45
- eqeqeq: ['error', 'allow-null'],
46
-
47
- // make sure for-in loops have an if statement
48
- 'guard-for-in': 'error',
49
- 'no-alert': 'error',
50
- 'no-caller': 'error',
51
- 'no-case-declarations': 'error',
52
- 'no-else-return': 'error',
53
- 'no-empty-pattern': 'error',
54
- 'no-eval': 'error',
55
- 'no-extend-native': 'error',
56
- 'no-extra-bind': 'error',
57
- 'no-extra-label': 'error',
58
- 'no-floating-decimal': 'error',
59
- 'no-global-assign': ['error', { exceptions: [] }],
60
- 'no-implicit-coercion': [
61
- 'off',
62
- {
63
- boolean: false,
64
- number: true,
65
- string: true,
66
- allow: [],
67
- },
68
- ],
69
- 'no-implied-eval': 'error',
70
- 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
71
- 'no-lone-blocks': 'error',
72
- 'no-loop-func': 'error',
73
- //
74
- // disallow use of multiple spaces
75
- 'no-multi-spaces': 'error',
76
- 'no-new': 'error',
77
- 'no-new-func': 'error',
78
- 'no-new-wrappers': 'error',
79
- 'no-octal-escape': 'error',
80
- 'no-proto': 'error',
81
- 'no-prototype-builtins': 0,
82
- 'no-redeclare': 'error',
83
- 'no-restricted-properties': [
84
- 'error',
85
- {
86
- object: 'arguments',
87
- property: 'callee',
88
- message: 'arguments.callee is deprecated',
89
- },
90
- {
91
- property: '__defineGetter__',
92
- message: 'Please use Object.defineProperty instead.',
93
- },
94
- {
95
- property: '__defineSetter__',
96
- message: 'Please use Object.defineProperty instead.',
97
- },
98
- ],
99
- 'no-self-assign': 'error',
100
- 'no-self-compare': 'error',
101
- 'no-sequences': 'error',
102
- 'no-throw-literal': 'error',
103
- 'no-unmodified-loop-condition': 'off',
104
- 'no-unused-expressions': [
105
- 'error',
106
- {
107
- allowShortCircuit: false,
108
- allowTernary: false,
109
- },
110
- ],
111
- 'no-useless-call': 'off',
112
- 'no-useless-concat': 'error',
113
- 'no-useless-escape': 'error',
114
- 'no-useless-return': 'error',
115
- 'no-void': 'error',
116
- 'no-with': 'error',
117
- 'no-buffer-constructor': 'error',
118
- radix: 'error',
119
- 'no-var': 'error',
120
- 'prefer-const': 'error',
121
- 'arrow-body-style': ['error', 'as-needed'],
122
- 'arrow-spacing': 'error',
123
- 'no-confusing-arrow': ['error', { allowParens: true }],
124
- yoda: 'error',
125
- 'constructor-super': 'error',
126
- 'require-await': 'error',
127
- 'require-atomic-updates': 'off',
128
- },
129
- globals: {
130
- Buffer: 'off',
131
- Promise: true,
132
- Symbol: false,
133
- Uint16Array: false,
134
- Int32Array: false,
135
- Int8Array: false,
136
- BigInt: false,
137
- process: false,
138
- setInterval: false,
139
- setTimeout: false,
140
- setImmediate: false,
141
- clearInterval: false,
142
- clearTimeout: false,
143
- describe: false,
144
- xdescribe: false,
145
- it: false,
146
- xit: false,
147
- context: false,
148
- after: false,
149
- afterEach: false,
150
- before: false,
151
- beforeEach: false,
152
- __filename: false,
153
- },
154
- };
package/Gruntfile.js DELETED
@@ -1,35 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
- 'use strict';
20
-
21
- module.exports = function (grunt) {
22
- grunt.loadNpmTasks('grunt-jsdoc');
23
- grunt.initConfig({
24
- jsdoc: {
25
- dist: {
26
- src: ['lib'],
27
- options: {
28
- destination: 'doc',
29
- recurse: true,
30
- readme: 'README.md',
31
- },
32
- },
33
- },
34
- });
35
- };
@@ -1,150 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: DataType.js</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Source: DataType.js</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
- <article>
29
- <pre class="prettyprint source linenums"><code>/*
30
- * Licensed to the Apache Software Foundation (ASF) under one
31
- * or more contributor license agreements. See the NOTICE file
32
- * distributed with this work for additional information
33
- * regarding copyright ownership. The ASF licenses this file
34
- * to you under the Apache License, Version 2.0 (the
35
- * "License"); you may not use this file except in compliance
36
- * with the License. You may obtain a copy of the License at
37
- *
38
- * http://www.apache.org/licenses/LICENSE-2.0
39
- *
40
- * Unless required by applicable law or agreed to in writing,
41
- * software distributed under the License is distributed on an
42
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
43
- * KIND, either express or implied. See the License for the
44
- * specific language governing permissions and limitations
45
- * under the License.
46
- */
47
-
48
- /**
49
- * @author Igor Ostapenko
50
- */
51
-
52
- /**
53
- * Represents a GraphBinary data type.
54
- *
55
- * See org.apache.tinkerpop.gremlin.structure.io.binary.DataType Java class.
56
- */
57
- const DataType = {
58
- INT: 0x01,
59
- LONG: 0x02,
60
- STRING: 0x03,
61
- DATE: 0x04,
62
- TIMESTAMP: 0x05,
63
- CLASS: 0x06,
64
- DOUBLE: 0x07,
65
- FLOAT: 0x08,
66
- LIST: 0x09,
67
- MAP: 0x0a,
68
- SET: 0x0b,
69
- UUID: 0x0c,
70
- EDGE: 0x0d,
71
- PATH: 0x0e,
72
- PROPERTY: 0x0f,
73
- GRAPH: 0x10,
74
- VERTEX: 0x11,
75
- VERTEXPROPERTY: 0x12,
76
- BARRIER: 0x13,
77
- BINDING: 0x14,
78
- BYTECODE: 0x15,
79
- CARDINALITY: 0x16,
80
- COLUMN: 0x17,
81
- DIRECTION: 0x18,
82
- OPERATOR: 0x19,
83
- ORDER: 0x1a,
84
- PICK: 0x1b,
85
- POP: 0x1c,
86
- LAMBDA: 0x1d,
87
- P: 0x1e,
88
- SCOPE: 0x1f,
89
- T: 0x20,
90
- TRAVERSER: 0x21,
91
- BIGDECIMAL: 0x22,
92
- BIGINTEGER: 0x23,
93
- BYTE: 0x24,
94
- BYTEBUFFER: 0x25,
95
- SHORT: 0x26,
96
- BOOLEAN: 0x27,
97
- TEXTP: 0x28,
98
- TRAVERSALSTRATEGY: 0x29,
99
- BULKSET: 0x2a,
100
- TREE: 0x2b,
101
- METRICS: 0x2c,
102
- TRAVERSALMETRICS: 0x2d,
103
- MERGE: 0x2e,
104
- DT: 0x2f,
105
- GTYPE: 0x30,
106
-
107
- CHAR: 0x80,
108
- DURATION: 0x81,
109
- INETADDRESS: 0x82,
110
- INSTANT: 0x83,
111
- LOCALDATE: 0x84,
112
- LOCALDATETIME: 0x85,
113
- LOCALTIME: 0x86,
114
- MONTHDAY: 0x87,
115
- OFFSETDATETIME: 0x88,
116
- OFFSETTIME: 0x89,
117
- PERIOD: 0x8a,
118
- YEAR: 0x8b,
119
- YEARMONTH: 0x8c,
120
- ZONEDATETIME: 0x8d,
121
- ZONEOFFSET: 0x8e,
122
-
123
- CUSTOM: 0,
124
- UNSPECIFIED_NULL: 0xfe,
125
- };
126
-
127
- export default DataType;
128
- </code></pre>
129
- </article>
130
- </section>
131
-
132
-
133
-
134
-
135
- </div>
136
-
137
- <nav>
138
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li></ul>
139
- </nav>
140
-
141
- <br class="clear">
142
-
143
- <footer>
144
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Nov 10 2025 14:42:27 GMT-0800 (Pacific Standard Time)
145
- </footer>
146
-
147
- <script> prettyPrint(); </script>
148
- <script src="scripts/linenumber.js"> </script>
149
- </body>
150
- </html>
@@ -1,132 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: GraphBinaryReader.js</title>
6
-
7
- <script src="scripts/prettify/prettify.js"> </script>
8
- <script src="scripts/prettify/lang-css.js"> </script>
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
- </head>
15
-
16
- <body>
17
-
18
- <div id="main">
19
-
20
- <h1 class="page-title">Source: GraphBinaryReader.js</h1>
21
-
22
-
23
-
24
-
25
-
26
-
27
- <section>
28
- <article>
29
- <pre class="prettyprint source linenums"><code>/*
30
- * Licensed to the Apache Software Foundation (ASF) under one
31
- * or more contributor license agreements. See the NOTICE file
32
- * distributed with this work for additional information
33
- * regarding copyright ownership. The ASF licenses this file
34
- * to you under the Apache License, Version 2.0 (the
35
- * "License"); you may not use this file except in compliance
36
- * with the License. You may obtain a copy of the License at
37
- *
38
- * http://www.apache.org/licenses/LICENSE-2.0
39
- *
40
- * Unless required by applicable law or agreed to in writing,
41
- * software distributed under the License is distributed on an
42
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
43
- * KIND, either express or implied. See the License for the
44
- * specific language governing permissions and limitations
45
- * under the License.
46
- */
47
-
48
- /**
49
- * @author Igor Ostapenko
50
- */
51
-
52
- import { Buffer } from 'buffer';
53
-
54
- /**
55
- * GraphBinary reader.
56
- */
57
- export default class GraphBinaryReader {
58
- constructor(ioc) {
59
- this.ioc = ioc;
60
- }
61
-
62
- readResponse(buffer) {
63
- if (buffer === undefined || buffer === null) {
64
- throw new Error('Buffer is missing.');
65
- }
66
- if (!(buffer instanceof Buffer)) {
67
- throw new Error('Not an instance of Buffer.');
68
- }
69
- if (buffer.length &lt; 1) {
70
- throw new Error('Buffer is empty.');
71
- }
72
-
73
- const response = { status: {}, result: {} };
74
- let cursor = buffer;
75
- let len;
76
-
77
- // {version} is a Byte representing the protocol version
78
- const version = cursor[0];
79
- if (version !== 0x81) {
80
- throw new Error(`Unsupported version '${version}'.`);
81
- }
82
- cursor = cursor.slice(1); // skip version
83
-
84
- // {request_id} is a nullable UUID
85
- ({ v: response.requestId, len } = this.ioc.uuidSerializer.deserialize(cursor, false, true));
86
- cursor = cursor.slice(len);
87
-
88
- // {status_code} is an Int
89
- ({ v: response.status.code, len } = this.ioc.intSerializer.deserialize(cursor, false));
90
- cursor = cursor.slice(len);
91
-
92
- // {status_message} is a nullable String
93
- ({ v: response.status.message, len } = this.ioc.stringSerializer.deserialize(cursor, false, true));
94
- cursor = cursor.slice(len);
95
-
96
- // {status_attributes} is a Map
97
- ({ v: response.status.attributes, len } = this.ioc.mapSerializer.deserialize(cursor, false));
98
- cursor = cursor.slice(len);
99
-
100
- // {result_meta} is a Map
101
- ({ v: response.result.meta, len } = this.ioc.mapSerializer.deserialize(cursor, false));
102
- cursor = cursor.slice(len);
103
-
104
- // {result_data} is a fully qualified typed value composed of {type_code}{type_info}{value_flag}{value}
105
- ({ v: response.result.data } = this.ioc.anySerializer.deserialize(cursor));
106
-
107
- return response;
108
- }
109
- }
110
- </code></pre>
111
- </article>
112
- </section>
113
-
114
-
115
-
116
-
117
- </div>
118
-
119
- <nav>
120
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li></ul>
121
- </nav>
122
-
123
- <br class="clear">
124
-
125
- <footer>
126
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Nov 10 2025 14:42:27 GMT-0800 (Pacific Standard Time)
127
- </footer>
128
-
129
- <script> prettyPrint(); </script>
130
- <script src="scripts/linenumber.js"> </script>
131
- </body>
132
- </html>