You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by va...@apache.org on 2024/04/01 16:23:43 UTC
(tinkerpop) branch master updated: feat: TypeScript integration (#2515)
This is an automated email from the ASF dual-hosted git repository.
valentyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 5030f68d64 feat: TypeScript integration (#2515)
5030f68d64 is described below
commit 5030f68d64bcbce26d7073ebb8ef5eb3dfb2c573
Author: Tiến Nguyễn Khắc <ti...@icloud.com>
AuthorDate: Mon Apr 1 23:23:38 2024 +0700
feat: TypeScript integration (#2515)
- Change public interfacing files to TypeScript
- Keep internal serializers as JavaScript
- Change CommonJS to Module
---
CHANGELOG.asciidoc | 1 +
gremlin-javascript/build/generate.groovy | 8 +-
gremlin-javascript/examples/browser/index.html | 2 +-
.../examples/browser/{index.js => index.ts} | 18 +-
.../examples/browser/{utils.js => utils.ts} | 0
gremlin-javascript/examples/browser/yarn.lock | 6 +-
gremlin-javascript/pom.xml | 2 +-
.../{.eslintrc.js => .eslintrc.cjs} | 5 +-
.../main/javascript/gremlin-javascript/.gitignore | 3 +-
.../javascript/gremlin-javascript/.mocharc.json | 5 +
.../{.prettierrc.js => .prettierrc.cjs} | 0
.../{Gruntfile.js => Gruntfile.cjs} | 1 -
.../main/javascript/gremlin-javascript/index.js | 96 -
.../auth/{authenticator.js => authenticator.ts} | 20 +-
...sl-mechanism-base.js => sasl-mechanism-base.ts} | 23 +-
...-mechanism-plain.js => sasl-mechanism-plain.ts} | 35 +-
...ticator.js => plain-text-sasl-authenticator.ts} | 16 +-
...sasl-authenticator.js => sasl-authenticator.ts} | 17 +-
.../lib/driver/{client.js => client.ts} | 80 +-
.../lib/driver/{connection.js => connection.ts} | 162 +-
...e-connection.js => driver-remote-connection.ts} | 53 +-
.../{remote-connection.js => remote-connection.ts} | 75 +-
.../{response-error.js => response-error.ts} | 18 +-
.../lib/driver/{result-set.js => result-set.ts} | 27 +-
.../javascript/gremlin-javascript/lib/index.ts | 95 +
...onymous-traversal.js => anonymous-traversal.ts} | 36 +-
.../lib/process/{bytecode.js => bytecode.ts} | 26 +-
.../{graph-traversal.js => graph-traversal.ts} | 605 +-
.../lib/process/{transaction.js => transaction.ts} | 49 +-
.../lib/process/{translator.js => translator.ts} | 25 +-
...traversal-strategy.js => traversal-strategy.ts} | 148 +-
.../lib/process/{traversal.js => traversal.ts} | 194 +-
.../lib/structure/{graph.js => graph.ts} | 94 +-
.../lib/structure/io/binary/GraphBinary.js | 158 +-
.../structure/io/binary/internals/AnySerializer.js | 7 +-
.../io/binary/internals/ArraySerializer.js | 7 +-
.../io/binary/internals/BigIntegerSerializer.js | 7 +-
.../io/binary/internals/BooleanSerializer.js | 7 +-
.../io/binary/internals/BulkSetSerializer.js | 7 +-
.../io/binary/internals/ByteBufferSerializer.js | 7 +-
.../io/binary/internals/ByteSerializer.js | 7 +-
.../io/binary/internals/BytecodeSerializer.js | 15 +-
.../lib/structure/io/binary/internals/DataType.js | 3 +-
.../io/binary/internals/DateSerializer.js | 7 +-
.../io/binary/internals/DoubleSerializer.js | 7 +-
.../io/binary/internals/EdgeSerializer.js | 19 +-
.../io/binary/internals/EnumSerializer.js | 53 +-
.../io/binary/internals/FloatSerializer.js | 7 +-
.../io/binary/internals/GraphBinaryReader.js | 7 +-
.../io/binary/internals/GraphBinaryWriter.js | 7 +-
.../structure/io/binary/internals/IntSerializer.js | 7 +-
.../io/binary/internals/LambdaSerializer.js | 9 +-
.../io/binary/internals/LongSerializer.js | 7 +-
.../io/binary/internals/LongSerializerNg.js | 7 +-
.../structure/io/binary/internals/MapSerializer.js | 7 +-
.../internals/NumberSerializationStrategy.js | 5 +-
.../structure/io/binary/internals/PSerializer.js | 17 +-
.../io/binary/internals/PathSerializer.js | 13 +-
.../io/binary/internals/PropertySerializer.js | 13 +-
.../structure/io/binary/internals/SetSerializer.js | 7 +-
.../io/binary/internals/ShortSerializer.js | 7 +-
.../io/binary/internals/StringSerializer.js | 7 +-
.../io/binary/internals/TextPSerializer.js | 17 +-
.../internals/TraversalStrategySerializer.js | 9 +-
.../io/binary/internals/TraverserSerializer.js | 13 +-
.../binary/internals/UnspecifiedNullSerializer.js | 7 +-
.../io/binary/internals/UuidSerializer.js | 7 +-
.../binary/internals/VertexPropertySerializer.js | 13 +-
.../io/binary/internals/VertexSerializer.js | 13 +-
.../lib/structure/io/binary/internals/utils.js | 9 +-
.../{graph-serializer.js => graph-serializer.ts} | 196 +-
.../{type-serializers.js => type-serializers.ts} | 222 +-
.../gremlin-javascript/lib/{utils.js => utils.ts} | 55 +-
.../gremlin-javascript/package-lock.json | 9081 +++++++++++++-------
.../javascript/gremlin-javascript/package.json | 36 +-
.../test/cucumber/element-comparison.js | 22 +-
.../test/cucumber/feature-steps.js | 88 +-
.../gremlin-javascript/test/cucumber/gremlin.js | 8 +-
.../gremlin-javascript/test/cucumber/world.js | 23 +-
.../javascript/gremlin-javascript/test/helper.js | 51 +-
.../test/integration/client-behavior-tests.js | 14 +-
.../test/integration/client-tests.js | 42 +-
.../test/integration/remote-connection-tests.js | 13 +-
.../test/integration/sasl-authentication-tests.js | 25 +-
.../test/integration/session-client-tests.js | 11 +-
.../test/integration/traversal-test.js | 66 +-
.../gremlin-javascript/test/unit/bytecode-test.js | 19 +-
.../gremlin-javascript/test/unit/client-test.js | 6 +-
.../test/unit/element-comparison-test.js | 10 +-
.../gremlin-javascript/test/unit/exports-test.js | 7 +-
.../test/unit/graphbinary/AnySerializer-test.js | 83 +-
.../graphbinary/ArraySerializerTestTemplate.js | 22 +-
.../unit/graphbinary/BigIntegerSerializer-test.js | 13 +-
.../unit/graphbinary/BooleanSerializer-test.js | 13 +-
.../unit/graphbinary/BulkSetSerializer-test.js | 9 +-
.../unit/graphbinary/ByteBufferSerializer-test.js | 23 +-
.../test/unit/graphbinary/ByteSerializer-test.js | 11 +-
.../unit/graphbinary/BytecodeSerializer-test.js | 27 +-
.../test/unit/graphbinary/ClassSerializer-test.js | 5 +-
.../test/unit/graphbinary/DateSerializer-test.js | 5 +-
.../unit/graphbinary/DateSerializerTestTemplate.js | 25 +-
.../test/unit/graphbinary/DoubleSerializer-test.js | 13 +-
.../test/unit/graphbinary/EdgeSerializer-test.js | 35 +-
.../test/unit/graphbinary/EnumSerializer-test.js | 43 +-
.../test/unit/graphbinary/FloatSerializer-test.js | 11 +-
.../unit/graphbinary/GraphBinaryReader-test.js | 11 +-
.../unit/graphbinary/GraphBinaryWriter-test.js | 9 +-
.../test/unit/graphbinary/IntSerializer-test.js | 13 +-
.../test/unit/graphbinary/LambdaSerializer-test.js | 18 +-
.../test/unit/graphbinary/ListSerializer-test.js | 5 +-
.../test/unit/graphbinary/LongSerializer-test.js | 11 +-
.../test/unit/graphbinary/LongSerializerNg-test.js | 11 +-
.../test/unit/graphbinary/MapSerializer-test.js | 21 +-
.../test/unit/graphbinary/PSerializer-test.js | 37 +-
.../test/unit/graphbinary/PathSerializer-test.js | 31 +-
.../unit/graphbinary/PropertySerializer-test.js | 31 +-
.../test/unit/graphbinary/SetSerializer-test.js | 5 +-
.../unit/graphbinary/SetSerializerTestTemplate.js | 20 +-
.../test/unit/graphbinary/ShortSerializer-test.js | 11 +-
.../test/unit/graphbinary/StringSerializer-test.js | 5 +-
.../graphbinary/StringSerializerTestTemplate.js | 17 +-
.../test/unit/graphbinary/TextPSerializer-test.js | 27 +-
.../unit/graphbinary/TimestampSerializer-test.js | 5 +-
.../TraversalStrategySerializer-test.js | 25 +-
.../unit/graphbinary/TraverserSerializer-test.js | 25 +-
.../graphbinary/UnspecifiedNullSerializer-test.js | 17 +-
.../test/unit/graphbinary/UuidSerializer-test.js | 11 +-
.../graphbinary/VertexPropertySerializer-test.js | 31 +-
.../test/unit/graphbinary/VertexSerializer-test.js | 33 +-
.../test/unit/graphbinary/utils.js | 20 +-
.../gremlin-javascript/test/unit/graphson-test.js | 25 +-
.../test/unit/result-set-test.js | 7 +-
.../test/unit/structure-types-test.js | 5 +-
.../test/unit/translator-test.js | 44 +-
.../test/unit/traversal-strategy-test.js | 6 +-
.../gremlin-javascript/test/unit/traversal-test.js | 62 +-
.../javascript/gremlin-javascript/tsconfig.json | 10 +
.../gremlin-javascript/tsconfig.test.json | 7 +
pom.xml | 1 +
139 files changed, 8153 insertions(+), 5268 deletions(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 2d4fd714f8..1c1580782a 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -39,6 +39,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Added `withoutStrategies()` syntax to the Gremlin ANTLR grammar.
* Modified the Gremlin ANTLR grammar to more dynamically interact with any strategies registered globally to the `TraversalStrategies` cache sets.
* Made `new` keyword optional in the Gremlin grammar.
+* Added TypeScript & ECMAScript module support.
== TinkerPop 3.7.0 (Gremfir Master of the Pan Flute)
diff --git a/gremlin-javascript/build/generate.groovy b/gremlin-javascript/build/generate.groovy
index 55656ba966..bf3762a343 100644
--- a/gremlin-javascript/build/generate.groovy
+++ b/gremlin-javascript/build/generate.groovy
@@ -89,9 +89,9 @@ radishGremlinFile.withWriter('UTF-8') { Writer writer ->
writer.writeLine("//********************************************************************************\n\n")
writer.writeLine(
- 'const graphTraversalModule = require(\'../../lib/process/graph-traversal\');\n' +
- 'const traversalModule = require(\'../../lib/process/traversal\');\n' +
- 'const { TraversalStrategies, VertexProgramStrategy, OptionsStrategy, PartitionStrategy, ReadOnlyStrategy, SeedStrategy, SubgraphStrategy, ProductiveByStrategy } = require(\'../../lib/process/traversal-strategy\');\n' +
+ 'import * as graphTraversalModule from \'../../lib/process/graph-traversal.js\';\n' +
+ 'import * as traversalModule from \'../../lib/process/traversal.js\';\n' +
+ 'import { TraversalStrategies, VertexProgramStrategy, OptionsStrategy, PartitionStrategy, ReadOnlyStrategy, SeedStrategy, SubgraphStrategy, ProductiveByStrategy } from \'../../lib/process/traversal-strategy.js\';\n' +
'const __ = graphTraversalModule.statics;\n' +
'const Barrier = traversalModule.barrier\n' +
'const Cardinality = traversalModule.cardinality\n' +
@@ -154,7 +154,7 @@ radishGremlinFile.withWriter('UTF-8') { Writer writer ->
}
writer.writeLine('}\n')
- writer.writeLine('exports.gremlin = gremlins')
+ writer.writeLine('export const gremlin = gremlins')
}
diff --git a/gremlin-javascript/examples/browser/index.html b/gremlin-javascript/examples/browser/index.html
index fa9ca839b5..8f05553c7a 100644
--- a/gremlin-javascript/examples/browser/index.html
+++ b/gremlin-javascript/examples/browser/index.html
@@ -27,6 +27,6 @@ under the License.
</head>
<body>
<main id="graph"></main>
- <script type="module" src="index.js"></script>
+ <script type="module" src="index.ts"></script>
</body>
</html>
diff --git a/gremlin-javascript/examples/browser/index.js b/gremlin-javascript/examples/browser/index.ts
similarity index 89%
rename from gremlin-javascript/examples/browser/index.js
rename to gremlin-javascript/examples/browser/index.ts
index 7af7084ff7..720ea79c4a 100644
--- a/gremlin-javascript/examples/browser/index.js
+++ b/gremlin-javascript/examples/browser/index.ts
@@ -19,18 +19,19 @@
import Color from "colorjs.io";
import cytoscape from "cytoscape";
-import gremlin from "gremlin";
+import * as gremlin from "gremlin";
+import type { Edge, Vertex } from "gremlin/build/esm/structure/graph";
import { createRandomColorGenerator } from "./utils";
const randomColor = createRandomColorGenerator();
-const g = gremlin.process.AnonymousTraversalSource.traversal().withRemote(
+const g = gremlin.process.AnonymousTraversalSource.traversal().with_(
new gremlin.driver.DriverRemoteConnection("ws://localhost:8182/gremlin")
);
const [vertices, edges] = await Promise.all([
- await g.V().toList(),
- await g.E().toList(),
+ await g.V().toList<Vertex>(),
+ await g.E().toList<Edge>(),
]);
cytoscape({
@@ -43,9 +44,12 @@ cytoscape({
style: {
label: `${vertex.label}\n${vertex.id}`,
"background-color": randomColor(vertex.label),
- "border-color": new Color(randomColor(vertex.label)).darken().toString({
- format: "hex",
- }),
+ "border-color": new Color(randomColor(vertex.label)).darken().toString(
+ // @ts-expect-error
+ {
+ format: "hex",
+ }
+ ),
},
})),
...edges.map((edge) => ({
diff --git a/gremlin-javascript/examples/browser/utils.js b/gremlin-javascript/examples/browser/utils.ts
similarity index 100%
rename from gremlin-javascript/examples/browser/utils.js
rename to gremlin-javascript/examples/browser/utils.ts
diff --git a/gremlin-javascript/examples/browser/yarn.lock b/gremlin-javascript/examples/browser/yarn.lock
index 256cf44e65..5d7f2b2160 100644
--- a/gremlin-javascript/examples/browser/yarn.lock
+++ b/gremlin-javascript/examples/browser/yarn.lock
@@ -728,15 +728,15 @@ __metadata:
linkType: hard
"gremlin@file:../../src/main/javascript/gremlin-javascript::locator=browser%40workspace%3A.":
- version: 3.7.2-alpha1
- resolution: "gremlin@file:../../src/main/javascript/gremlin-javascript#../../src/main/javascript/gremlin-javascript::hash=4bd845&locator=browser%40workspace%3A."
+ version: 4.0.0-alpha1
+ resolution: "gremlin@file:../../src/main/javascript/gremlin-javascript#../../src/main/javascript/gremlin-javascript::hash=83bc8e&locator=browser%40workspace%3A."
dependencies:
buffer: "npm:^6.0.3"
eventemitter3: "npm:^5.0.1"
readable-stream: "npm:^4.5.2"
uuid: "npm:^9.0.1"
ws: "npm:^8.16.0"
- checksum: 10c0/1a8172b44851cb71eb11f5aee438034912762351d941684fae942a142d9d757e3be72bd136a5cc43dd81dd00594a17c36009d46ef06e0ba4120f7644aefa675e
+ checksum: 10c0/13986e0b78a84a421e5542a7bb4ba8cca3fb7a12cb7fcce1426a40233f434a4ce86315aa943ce6818b101126a0167b8fa8e0a516dea0e98576fd68a22eef5650
languageName: node
linkType: hard
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 9eacdfca5b..bf722c94f0 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -216,7 +216,7 @@ limitations under the License.
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<configuration>
- <file>src/main/javascript/gremlin-javascript/lib/utils.js</file>
+ <file>src/main/javascript/gremlin-javascript/lib/utils.ts</file>
<replacements>
<replacement>
<token>gremlinVersion = '.*'</token>
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.cjs
similarity index 98%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.cjs
index 97675b5399..0c099e5aee 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.eslintrc.cjs
@@ -17,8 +17,6 @@
* under the License.
*/
-'use strict';
-
module.exports = {
env: {
commonjs: true,
@@ -27,8 +25,9 @@ module.exports = {
},
parserOptions: {
ecmaVersion: 2022,
+ sourceType: 'module',
},
- ignorePatterns: ['test/**/*.js', 'doc/**/*.js'],
+ ignorePatterns: ['test/**/*.js', 'doc/**/*.js', 'build'],
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
rules: {
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
index 5e83b29c57..4a67f551e6 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
@@ -3,4 +3,5 @@ node_modules/
npm-debug.log
# maven plugin com.github.eirslett frontend-maven-plugin installs node.js runtime in "node" folder
node/
-doc/
\ No newline at end of file
+doc/
+build/
\ No newline at end of file
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.mocharc.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/.mocharc.json
new file mode 100644
index 0000000000..935e50bcce
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.mocharc.json
@@ -0,0 +1,5 @@
+{
+ "extension": ["js", "ts"],
+ "require": "ts-node/register",
+ "loader": "ts-node/esm"
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.prettierrc.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/.prettierrc.cjs
similarity index 100%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/.prettierrc.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/.prettierrc.cjs
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.cjs
similarity index 98%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.cjs
index 8aaade3683..1468c2f9de 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.cjs
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-jsdoc');
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
deleted file mode 100644
index 3b8a80bdb0..0000000000
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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('./lib/process/traversal');
-const gt = require('./lib/process/graph-traversal');
-const strategiesModule = require('./lib/process/traversal-strategy');
-const graph = require('./lib/structure/graph');
-const gs = require('./lib/structure/io/graph-serializer');
-const rc = require('./lib/driver/remote-connection');
-const Bytecode = require('./lib/process/bytecode');
-const Translator = require('./lib/process/translator');
-const utils = require('./lib/utils');
-const DriverRemoteConnection = require('./lib/driver/driver-remote-connection');
-const ResponseError = require('./lib/driver/response-error');
-const Client = require('./lib/driver/client');
-const ResultSet = require('./lib/driver/result-set');
-const Authenticator = require('./lib/driver/auth/authenticator');
-const PlainTextSaslAuthenticator = require('./lib/driver/auth/plain-text-sasl-authenticator');
-const AnonymousTraversalSource = require('./lib/process/anonymous-traversal');
-
-module.exports = {
- driver: {
- RemoteConnection: rc.RemoteConnection,
- RemoteStrategy: rc.RemoteStrategy,
- RemoteTraversal: rc.RemoteTraversal,
- ResponseError,
- DriverRemoteConnection,
- Client,
- ResultSet,
- auth: {
- Authenticator,
- PlainTextSaslAuthenticator,
- },
- },
- process: {
- Bytecode,
- EnumValue: t.EnumValue,
- P: t.P,
- TextP: t.TextP,
- Traversal: t.Traversal,
- TraversalSideEffects: t.TraversalSideEffects,
- TraversalStrategies: strategiesModule.TraversalStrategies,
- TraversalStrategy: strategiesModule.TraversalStrategy,
- Traverser: t.Traverser,
- barrier: t.barrier,
- cardinality: t.cardinality,
- column: t.column,
- direction: t.direction,
- dt: t.dt,
- merge: t.merge,
- operator: t.operator,
- order: t.order,
- pick: t.pick,
- pop: t.pop,
- scope: t.scope,
- t: t.t,
- GraphTraversal: gt.GraphTraversal,
- GraphTraversalSource: gt.GraphTraversalSource,
- statics: gt.statics,
- Translator,
- traversal: AnonymousTraversalSource.traversal,
- AnonymousTraversalSource,
- withOptions: t.withOptions,
- },
- structure: {
- io: gs,
- Edge: graph.Edge,
- Graph: graph.Graph,
- Path: graph.Path,
- Property: graph.Property,
- Vertex: graph.Vertex,
- VertexProperty: graph.VertexProperty,
- toLong: utils.toLong,
- },
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.ts
similarity index 78%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.ts
index 1f7c3a1ab5..16b0643695 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/authenticator.ts
@@ -17,22 +17,18 @@
* under the License.
*/
-'use strict';
+export type AuthenticatorOptions = {
+ username?: string;
+ password?: string;
+ mechanism?: any;
+};
-/** @abstract */
-class Authenticator {
- constructor(options) {
- this._options = options;
- }
+export default abstract class Authenticator {
+ constructor(protected readonly options: AuthenticatorOptions) {}
/**
- * @abstract
* Evaluates the challenge from the server and returns appropriate response.
* @param {String} challenge Challenge string presented by the server.
*/
- evaluateChallenge(challenge) {
- throw new Error('evaluateChallenge should be implemented');
- }
+ abstract evaluateChallenge(challenge: string): any;
}
-
-module.exports = Authenticator;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.ts
similarity index 74%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.ts
index 250c3b9ac8..e23642ef6c 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-base.ts
@@ -16,18 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
-/** @abstract */
-class SaslMechanismBase {
- constructor(options) {
+import { AuthenticatorOptions } from '../authenticator.js';
+
+export type SaslMechanismBaseOptions = AuthenticatorOptions & { authzid?: string };
+
+export default abstract class SaslMechanismBase {
+ constructor(protected options: SaslMechanismBaseOptions) {
this.setopts(options);
}
/**
* Returns the name of the mechanism
*/
- get name() {
+ get name(): string | null {
return null;
}
@@ -35,18 +37,13 @@ class SaslMechanismBase {
* Set the options for the mechanism
* @param {object} options Options specific to the mechanism
*/
- setopts(options) {
- this._options = options;
+ setopts(options: SaslMechanismBaseOptions) {
+ this.options = options;
}
/**
- * @abstract
* Evaluates the challenge from the server and returns appropriate response
* @param {String} challenge Challenge string presented by the server
*/
- evaluateChallenge(challenge) {
- throw new Error('evaluateChallenge should be implemented');
- }
+ abstract evaluateChallenge(challenge: String): any;
}
-
-module.exports = SaslMechanismBase;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.ts
similarity index 74%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.ts
index e13945aa53..f80cf4dd56 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/mechanisms/sasl-mechanism-plain.ts
@@ -16,12 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
-const { Buffer } = require('buffer');
-const SaslMechanismBase = require('./sasl-mechanism-base');
+import { Buffer } from 'buffer';
+import SaslMechanismBase, { SaslMechanismBaseOptions } from './sasl-mechanism-base.js';
-class SaslMechanismPlain extends SaslMechanismBase {
+export type SaslMechanismPlainOptions = SaslMechanismBaseOptions & {};
+
+export default class SaslMechanismPlain extends SaslMechanismBase {
/**
* Creates a new instance of SaslMechanismPlain.
* @param {Object} [options] The mechanism options.
@@ -30,16 +31,16 @@ class SaslMechanismPlain extends SaslMechanismBase {
* @param {String} [options.password] The password of user with access to server.
* @constructor
*/
- constructor(options) {
+ constructor(options: SaslMechanismPlainOptions) {
super(options);
if (
- this._options.username === undefined ||
- this._options.username === null ||
- this._options.username.length === 0 ||
- this._options.password === undefined ||
- this._options.password === null ||
- this._options.password.length === 0
+ this.options?.username === undefined ||
+ this.options.username === null ||
+ this.options.username.length === 0 ||
+ this.options.password === undefined ||
+ this.options.password === null ||
+ this.options.password.length === 0
) {
throw new Error('Missing credentials for SASL PLAIN mechanism');
}
@@ -57,16 +58,16 @@ class SaslMechanismPlain extends SaslMechanismBase {
* @param {String} challenge Challenge string presented by the server.
* @return {Object} A Promise that resolves to a valid sasl response object.
*/
- evaluateChallenge(challenge) {
+ evaluateChallenge(challenge: string) {
if (this._hasInitialResponse(challenge)) {
return Promise.resolve({
saslMechanism: this.name,
- sasl: this._saslArgument(this._options.authzid, this._options.username, this._options.password),
+ sasl: this._saslArgument(this.options!.authzid!, this.options!.username!, this.options!.password!),
});
}
return Promise.resolve({
- sasl: this._saslArgument(this._options.authzid, this._options.username, this._options.password),
+ sasl: this._saslArgument(this.options!.authzid!, this.options!.username!, this.options!.password!),
});
}
@@ -76,7 +77,7 @@ class SaslMechanismPlain extends SaslMechanismBase {
* @param {String} username The identity of user with access to server.
* @param {String} password The password of user with access to server.
*/
- _saslArgument(authzid, username, password) {
+ _saslArgument(authzid: string, username: String, password: string) {
if (authzid === undefined || authzid === null) {
authzid = '';
}
@@ -95,12 +96,10 @@ class SaslMechanismPlain extends SaslMechanismBase {
* @param {String} challenge The challenge string from the server.
* @return {Boolean}
*/
- _hasInitialResponse(challenge) {
+ _hasInitialResponse(challenge: string) {
if (challenge === undefined || challenge === null) {
return false;
}
return true;
}
}
-
-module.exports = SaslMechanismPlain;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.ts
similarity index 79%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.ts
index 2f6845a4c5..9a45f21982 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/plain-text-sasl-authenticator.ts
@@ -17,12 +17,10 @@
* under the License.
*/
-'use strict';
+import Authenticator from './authenticator.js';
+import SaslMechanismPlain from './mechanisms/sasl-mechanism-plain.js';
-const Authenticator = require('./authenticator');
-const SaslMechanismPlain = require('./mechanisms/sasl-mechanism-plain');
-
-class PlainTextSaslAuthenticator extends Authenticator {
+export default class PlainTextSaslAuthenticator extends Authenticator {
/**
* Creates a new instance of PlainTextSaslAuthenticator.
* @param {string} username Username to log into the server.
@@ -30,7 +28,7 @@ class PlainTextSaslAuthenticator extends Authenticator {
* @param {string} [authzid] Optional id
* @constructor
*/
- constructor(username, password, authzid) {
+ constructor(username: string, password: string, authzid?: string) {
const options = {
mechanism: new SaslMechanismPlain({
username: username,
@@ -47,9 +45,7 @@ class PlainTextSaslAuthenticator extends Authenticator {
* @param {String} challenge Challenge string presented by the server.
* @return {Object} A Promise that resolves to a valid sasl response object.
*/
- evaluateChallenge(challenge) {
- return this._options.mechanism.evaluateChallenge(challenge);
+ evaluateChallenge(challenge: string): any {
+ return this.options.mechanism.evaluateChallenge(challenge);
}
}
-
-module.exports = PlainTextSaslAuthenticator;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.ts
similarity index 79%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.ts
index 4ad32c4459..af5877f5bb 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/auth/sasl-authenticator.ts
@@ -17,18 +17,21 @@
* under the License.
*/
-'use strict';
-const Authenticator = require('./authenticator');
+import Authenticator, { AuthenticatorOptions } from './authenticator.js';
-class SaslAuthenticator extends Authenticator {
+export type SaslAuthenticatorOptions = AuthenticatorOptions & {
+ mechanism?: any;
+};
+
+export default class SaslAuthenticator extends Authenticator {
/**
* Creates a new instance of SaslAuthenticator.
* @param {Object} [options] The authentication options.
* @param {Object} [options.mechanism] The mechanism to be used for authentication.
* @constructor
*/
- constructor(options) {
+ constructor(options: SaslAuthenticatorOptions) {
super(options);
if (options.mechanism === null || options.mechanism === undefined) {
@@ -41,9 +44,7 @@ class SaslAuthenticator extends Authenticator {
* @param {String} challenge Challenge string presented by the server.
* @return {Object} A Promise that resolves to a valid sasl response object.
*/
- evaluateChallenge(challenge) {
- return this._options.mechanism.evaluateChallenge(challenge);
+ evaluateChallenge(challenge: string) {
+ return this.options.mechanism.evaluateChallenge(challenge);
}
}
-
-module.exports = SaslAuthenticator;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
similarity index 74%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
index acd71b504d..609626f22a 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
@@ -16,16 +16,28 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
-const utils = require('../utils');
-const Connection = require('./connection');
-const Bytecode = require('../process/bytecode');
+import * as utils from '../utils.js';
+import Connection, { ConnectionOptions } from './connection.js';
+import Bytecode from '../process/bytecode.js';
+import { Readable } from 'stream';
+
+export type RequestOptions = {
+ requestId?: string;
+ session?: string;
+ bindings?: any;
+ language?: string;
+ accept?: string;
+};
+
+type ClientOptions = ConnectionOptions & RequestOptions & { processor?: string };
/**
* A {@link Client} contains methods to send messages to a Gremlin Server.
*/
-class Client {
+export default class Client {
+ private readonly _connection: Connection;
+
/**
* Creates a new instance of {@link Client}.
* @param {String} url The resource uri.
@@ -46,15 +58,17 @@ class Client {
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
- constructor(url, options = {}) {
- this._options = options;
- if (this._options.processor === 'session') {
+ constructor(
+ url: string,
+ private readonly options: ClientOptions = {},
+ ) {
+ if (this.options.processor === 'session') {
// compatibility with old 'session' processor setting
- this._options.session = options.session || utils.getUuid();
+ this.options.session = options.session || utils.getUuid();
}
- if (this._options.session) {
+ if (this.options.session) {
// re-assign processor to 'session' when in session mode
- this._options.processor = options.processor || 'session';
+ this.options.processor = options.processor || 'session';
}
this._connection = new Connection(url, options);
}
@@ -63,7 +77,7 @@ class Client {
* Opens the underlying connection to the Gremlin Server, if it's not already opened.
* @returns {Promise}
*/
- open() {
+ open(): Promise<void> {
return this._connection.open();
}
@@ -71,7 +85,7 @@ class Client {
* Returns true if the underlying connection is open
* @returns {Boolean}
*/
- get isOpen() {
+ get isOpen(): boolean {
return this._connection.isOpen;
}
@@ -88,11 +102,11 @@ class Client {
/**
* Send a request to the Gremlin Server, can send a script or bytecode steps.
* @param {Bytecode|string} message The bytecode or script to send
- * @param {Object} [bindings] The script bindings, if any.
+ * @param {Object|null} [bindings] The script bindings, if any.
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
* @returns {Promise}
*/
- submit(message, bindings, requestOptions) {
+ submit(message: Bytecode | string, bindings: any | null, requestOptions?: RequestOptions): Promise<any> {
const requestIdOverride = requestOptions && requestOptions.requestId;
if (requestIdOverride) {
delete requestOptions['requestId'];
@@ -101,17 +115,17 @@ class Client {
const args = Object.assign(
{
gremlin: message,
- aliases: { g: this._options.traversalSource || 'g' },
+ aliases: { g: this.options.traversalSource || 'g' },
},
requestOptions,
);
- if (this._options.session && this._options.processor === 'session') {
- args['session'] = this._options.session;
+ if (this.options.session && this.options.processor === 'session') {
+ args['session'] = this.options.session;
}
if (message instanceof Bytecode) {
- if (this._options.session && this._options.processor === 'session') {
+ if (this.options.session && this.options.processor === 'session') {
return this._connection.submit('session', 'bytecode', args, requestIdOverride);
}
return this._connection.submit('traversal', 'bytecode', args, requestIdOverride);
@@ -119,7 +133,7 @@ class Client {
args['bindings'] = bindings;
args['language'] = 'gremlin-groovy';
args['accept'] = this._connection.mimeType;
- return this._connection.submit(this._options.processor || '', 'eval', args, requestIdOverride);
+ return this._connection.submit(this.options.processor || '', 'eval', args, requestIdOverride);
}
throw new TypeError('message must be of type Bytecode or string');
}
@@ -131,7 +145,7 @@ class Client {
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
* @returns {ReadableStream}
*/
- stream(message, bindings, requestOptions) {
+ stream(message: Bytecode | string, bindings: any, requestOptions?: RequestOptions): Readable {
const requestIdOverride = requestOptions && requestOptions.requestId;
if (requestIdOverride) {
delete requestOptions['requestId'];
@@ -140,17 +154,17 @@ class Client {
const args = Object.assign(
{
gremlin: message,
- aliases: { g: this._options.traversalSource || 'g' },
+ aliases: { g: this.options.traversalSource || 'g' },
},
requestOptions,
);
- if (this._options.session && this._options.processor === 'session') {
- args['session'] = this._options.session;
+ if (this.options.session && this.options.processor === 'session') {
+ args['session'] = this.options.session;
}
if (message instanceof Bytecode) {
- if (this._options.session && this._options.processor === 'session') {
+ if (this.options.session && this.options.processor === 'session') {
return this._connection.stream('session', 'bytecode', args, requestIdOverride);
}
return this._connection.stream('traversal', 'bytecode', args, requestIdOverride);
@@ -158,7 +172,7 @@ class Client {
args['bindings'] = bindings;
args['language'] = 'gremlin-groovy';
args['accept'] = this._connection.mimeType;
- return this._connection.stream(this._options.processor || '', 'eval', args, requestIdOverride);
+ return this._connection.stream(this.options.processor || '', 'eval', args, requestIdOverride);
}
throw new TypeError('message must be of type Bytecode or string');
}
@@ -168,10 +182,10 @@ class Client {
* send session close request before connection close if session mode
* @returns {Promise}
*/
- close() {
- if (this._options.session && this._options.processor === 'session') {
- const args = { session: this._options.session };
- return this._connection.submit(this._options.processor, 'close', args, null).then(() => this._connection.close());
+ close(): Promise<void> {
+ if (this.options.session && this.options.processor === 'session') {
+ const args = { session: this.options.session };
+ return this._connection.submit(this.options.processor, 'close', args, null).then(() => this._connection.close());
}
return this._connection.close();
}
@@ -181,7 +195,7 @@ class Client {
* @param {String} event The event name that you want to listen to.
* @param {Function} handler The callback to be called when the event occurs.
*/
- addListener(event, handler) {
+ addListener(event: string, handler: (...args: any[]) => unknown) {
this._connection.on(event, handler);
}
@@ -190,9 +204,7 @@ class Client {
* @param {String} event The event name that you want to listen to.
* @param {Function} handler The event handler to be removed.
*/
- removeListener(event, handler) {
+ removeListener(event: string, handler: (...args: any[]) => unknown) {
this._connection.removeListener(event, handler);
}
}
-
-module.exports = Client;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
similarity index 73%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
index 0bf8214e15..1d2efd7617 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
@@ -20,17 +20,27 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const { Buffer } = require('buffer');
-const EventEmitter = require('eventemitter3');
-const Stream = require('readable-stream');
-const utils = require('../utils');
+import { Buffer } from 'buffer';
+import { EventEmitter } from 'eventemitter3';
+import type { Agent } from 'node:http';
+import Stream from 'readable-stream';
+import type {
+ CloseEvent as NodeWebSocketCloseEvent,
+ ErrorEvent as NodeWebSocketErrorEvent,
+ MessageEvent as NodeWebSocketMessageEvent,
+ WebSocket as NodeWebSocket,
+ Event as NodeWebSocketEvent,
+} from 'ws';
+import ioc from '../structure/io/binary/GraphBinary.js';
+import * as serializer from '../structure/io/graph-serializer.js';
+import * as utils from '../utils.js';
+import Authenticator from './auth/authenticator.js';
+import ResponseError from './response-error.js';
+import ResultSet from './result-set.js';
+
const { DeferredPromise } = utils;
-const serializer = require('../structure/io/graph-serializer');
-const { graphBinaryReader, graphBinaryWriter } = require('../structure/io/binary/GraphBinary');
-const ResultSet = require('./result-set');
-const ResponseError = require('./response-error');
+const { graphBinaryReader, graphBinaryWriter } = ioc;
const responseStatusCode = {
success: 200,
@@ -43,12 +53,50 @@ const defaultMimeType = 'application/vnd.gremlin-v3.0+json';
const graphSON2MimeType = 'application/vnd.gremlin-v2.0+json';
const graphBinaryMimeType = 'application/vnd.graphbinary-v1.0';
+type MimeType = typeof defaultMimeType | typeof graphSON2MimeType | typeof graphBinaryMimeType;
+
const uuidPattern = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
+export type ConnectionOptions = {
+ ca?: string[];
+ cert?: string | string[] | Buffer;
+ mimeType?: MimeType;
+ pfx?: string | Buffer;
+ reader?: any;
+ rejectUnauthorized?: boolean;
+ traversalSource?: string;
+ writer?: any;
+ authenticator?: Authenticator;
+ headers?: Record<string, string | string[]>;
+ enableUserAgentOnConnect?: boolean;
+ agent?: Agent;
+};
+
/**
* Represents a single connection to a Gremlin Server.
*/
-class Connection extends EventEmitter {
+export default class Connection extends EventEmitter {
+ private _ws: WebSocket | NodeWebSocket | undefined;
+
+ readonly mimeType: MimeType;
+
+ private readonly _responseHandlers: Record<string, { callback: (...args: any[]) => unknown; result: any }> = {};
+ private readonly _reader: any;
+ private readonly _writer: any;
+ private _openPromise: ReturnType<typeof DeferredPromise<void>> | null;
+ private _openCallback: (() => unknown) | null;
+ private _closePromise: Promise<void> | null;
+ private _closeCallback: (() => unknown) | null;
+
+ private readonly _header: string;
+ private readonly _header_buf: Buffer;
+
+ isOpen = false;
+ traversalSource: string;
+
+ private readonly _authenticator: any;
+ private readonly _enableUserAgentOnConnect: boolean;
+
/**
* Creates a new instance of {@link Connection}.
* @param {String} url The resource uri.
@@ -67,12 +115,12 @@ class Connection extends EventEmitter {
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
- constructor(url, options) {
+ constructor(
+ readonly url: string,
+ readonly options: ConnectionOptions = {},
+ ) {
super();
- this.url = url;
- this.options = options = options || {};
-
/**
* Gets the MIME type.
* @type {String}
@@ -90,7 +138,6 @@ class Connection extends EventEmitter {
this._header = String.fromCharCode(this.mimeType.length) + this.mimeType; // TODO: what if mimeType.length > 255
this._header_buf = Buffer.from(this._header);
- this.isOpen = false;
this.traversalSource = options.traversalSource || 'g';
this._authenticator = options.authenticator;
this._enableUserAgentOnConnect = options.enableUserAgentOnConnect !== false;
@@ -114,21 +161,22 @@ class Connection extends EventEmitter {
let headers = this.options.headers;
if (this._enableUserAgentOnConnect) {
if (!headers) {
- headers = [];
+ headers = {};
}
const userAgent = await utils.getUserAgent();
if (userAgent !== undefined) {
- headers[utils.getUserAgentHeader()] = await utils.getUserAgent();
+ headers[utils.getUserAgentHeader()] = userAgent;
}
}
- const WebSocket = globalThis.WebSocket ?? (await import('ws')).default;
+ const WebSocket = (globalThis.WebSocket as typeof globalThis.WebSocket | undefined) ?? (await import('ws')).default;
this._ws = new WebSocket(
this.url,
globalThis.WebSocket === undefined
? {
+ // @ts-expect-error
headers: headers,
ca: this.options.ca,
cert: this.options.cert,
@@ -139,20 +187,24 @@ class Connection extends EventEmitter {
: undefined,
);
- if ('binaryType' in this._ws) {
+ if ('binaryType' in this._ws!) {
this._ws.binaryType = 'arraybuffer';
}
- this._ws.addEventListener('open', this.#handleOpen);
- this._ws.addEventListener('error', this.#handleError);
- this._ws.addEventListener('message', this.#handleMessage);
- this._ws.addEventListener('close', this.#handleClose);
+ // @ts-expect-error
+ this._ws!.addEventListener('open', this.#handleOpen);
+ // @ts-expect-error
+ this._ws!.addEventListener('error', this.#handleError);
+ // @ts-expect-error
+ this._ws!.addEventListener('message', this.#handleMessage);
+ // @ts-expect-error
+ this._ws!.addEventListener('close', this.#handleClose);
return await this._openPromise;
}
/** @override */
- submit(processor, op, args, requestId) {
+ submit(processor: string | undefined, op: string, args: any, requestId?: string | null) {
// TINKERPOP-2847: Use lower case to prevent string comparison issues.
const rid = (requestId || utils.getUuid()).toLowerCase();
if (!rid.match(uuidPattern)) {
@@ -164,7 +216,7 @@ class Connection extends EventEmitter {
new Promise((resolve, reject) => {
if (op !== 'authentication') {
this._responseHandlers[rid] = {
- callback: (err, result) => (err ? reject(err) : resolve(result)),
+ callback: (err: Error, result: any) => (err ? reject(err) : resolve(result)),
result: null,
};
}
@@ -179,13 +231,13 @@ class Connection extends EventEmitter {
const request_buf = this._writer.writeRequest(request);
const message = utils.toArrayBuffer(Buffer.concat([this._header_buf, request_buf]));
- this._ws.send(message);
+ this._ws!.send(message);
}),
);
}
/** @override */
- stream(processor, op, args, requestId) {
+ stream(processor: string, op: string, args: any, requestId?: string) {
// TINKERPOP-2847: Use lower case to prevent string comparison issues.
const rid = (requestId || utils.getUuid()).toLowerCase();
if (!rid.match(uuidPattern)) {
@@ -198,7 +250,7 @@ class Connection extends EventEmitter {
});
this._responseHandlers[rid] = {
- callback: (err) => (err ? readableStream.destroy(err) : readableStream.push(null)),
+ callback: (err: Error) => (err ? readableStream.destroy(err) : readableStream.push(null)),
result: readableStream,
};
@@ -214,14 +266,14 @@ class Connection extends EventEmitter {
const request_buf = this._writer.writeRequest(request);
const message = utils.toArrayBuffer(Buffer.concat([this._header_buf, request_buf]));
- this._ws.send(message);
+ this._ws!.send(message);
})
.catch((err) => readableStream.destroy(err));
return readableStream;
}
- #getDefaultReader(mimeType) {
+ #getDefaultReader(mimeType: MimeType) {
if (mimeType === graphBinaryMimeType) {
return graphBinaryReader;
}
@@ -229,7 +281,7 @@ class Connection extends EventEmitter {
return mimeType === graphSON2MimeType ? new serializer.GraphSON2Reader() : new serializer.GraphSONReader();
}
- #getDefaultWriter(mimeType) {
+ #getDefaultWriter(mimeType: MimeType) {
if (mimeType === graphBinaryMimeType) {
return graphBinaryWriter;
}
@@ -237,37 +289,29 @@ class Connection extends EventEmitter {
return mimeType === graphSON2MimeType ? new serializer.GraphSON2Writer() : new serializer.GraphSONWriter();
}
- #handleOpen = () => {
- this._openPromise.resolve();
+ #handleOpen = (_: Event | NodeWebSocketEvent) => {
+ this._openPromise?.resolve();
this.isOpen = true;
};
- /**
- * @param {Event} event
- */
- #handleError = ({ error }) => {
- this._openPromise.reject(error);
+ #handleError = (event: Event | NodeWebSocketErrorEvent) => {
+ const error = 'error' in event ? event.error : event;
+ this._openPromise?.reject(error);
this.emit('log', `ws error ${error}`);
this.#cleanupWebsocket(error);
this.emit('socketError', error);
};
- /**
- * @param {CloseEvent} event
- */
- #handleClose = ({ code, message }) => {
- this.emit('log', `ws close code=${code} message=${message}`);
+ #handleClose = ({ code, reason }: CloseEvent | NodeWebSocketCloseEvent) => {
+ this.emit('log', `ws close code=${code} message=${reason}`);
this.#cleanupWebsocket();
if (this._closeCallback) {
this._closeCallback();
}
- this.emit('close', code, message);
+ this.emit('close', code, reason);
};
- /**
- * @param {MessageEvent<any>} event
- */
- #handleMessage = ({ data: _data }) => {
+ #handleMessage = ({ data: _data }: MessageEvent | NodeWebSocketMessageEvent) => {
const data = _data instanceof ArrayBuffer ? Buffer.from(_data) : _data;
const response = this._reader.readResponse(data);
@@ -307,7 +351,7 @@ class Connection extends EventEmitter {
if (response.status.code === responseStatusCode.authenticationChallenge && this._authenticator) {
this._authenticator
.evaluateChallenge(response.result.data)
- .then((res) => this.submit(undefined, 'authentication', res, response.requestId))
+ .then((res: any) => this.submit(undefined, 'authentication', res, response.requestId))
.catch(handler.callback);
return;
@@ -355,7 +399,7 @@ class Connection extends EventEmitter {
/**
* clean websocket context
*/
- #cleanupWebsocket(err) {
+ #cleanupWebsocket(err?: Error) {
// Invoke waiting callbacks to complete Promises when closing the websocket
Object.keys(this._responseHandlers).forEach((requestId) => {
const handler = this._responseHandlers[requestId];
@@ -367,10 +411,14 @@ class Connection extends EventEmitter {
handler.callback(cause);
}
});
- this._ws.removeEventListener('open', this.#handleOpen);
- this._ws.removeEventListener('error', this.#handleError);
- this._ws.removeEventListener('message', this.#handleMessage);
- this._ws.removeEventListener('close', this.#handleClose);
+ // @ts-expect-error
+ this._ws?.removeEventListener('open', this.#handleOpen);
+ // @ts-expect-error
+ this._ws?.removeEventListener('error', this.#handleError);
+ // @ts-expect-error
+ this._ws?.removeEventListener('message', this.#handleMessage);
+ // @ts-expect-error
+ this._ws?.removeEventListener('close', this.#handleClose);
this._openPromise = null;
this._closePromise = null;
this.isOpen = false;
@@ -381,7 +429,7 @@ class Connection extends EventEmitter {
* @param requestId
* @private
*/
- #clearHandler(requestId) {
+ #clearHandler(requestId: string) {
delete this._responseHandlers[requestId];
}
@@ -396,11 +444,9 @@ class Connection extends EventEmitter {
if (!this._closePromise) {
this._closePromise = new Promise((resolve) => {
this._closeCallback = resolve;
- this._ws.close();
+ this._ws?.close();
});
}
return this._closePromise;
}
}
-
-module.exports = Connection;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.ts
similarity index 76%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.ts
index 25c7cf0e4d..f3d93deba2 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.ts
@@ -20,24 +20,26 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const rcModule = require('./remote-connection');
+import * as rcModule from './remote-connection.js';
const RemoteConnection = rcModule.RemoteConnection;
const RemoteTraversal = rcModule.RemoteTraversal;
-const utils = require('../utils');
-const Client = require('./client');
-const Bytecode = require('../process/bytecode');
-const OptionsStrategy = require('../process/traversal-strategy').OptionsStrategy;
+import * as utils from '../utils.js';
+import Client, { RequestOptions } from './client.js';
+import Bytecode from '../process/bytecode.js';
+import { ConnectionOptions } from './connection.js';
+import { OptionsStrategy } from '../process/traversal-strategy.js';
/**
* Represents the default {@link RemoteConnection} implementation.
*/
-class DriverRemoteConnection extends RemoteConnection {
+export default class DriverRemoteConnection extends RemoteConnection {
+ private readonly _client: Client;
+
/**
* Creates a new instance of {@link DriverRemoteConnection}.
* @param {String} url The resource uri.
- * @param {Object} [options] The connection options.
+ * @param {ConnectionOptions} [options] The connection options.
* @param {Array} [options.ca] Trusted certificates.
* @param {String|Array|Buffer} [options.cert] The certificate key.
* @param {String} [options.mimeType] The mime type to use.
@@ -52,7 +54,7 @@ class DriverRemoteConnection extends RemoteConnection {
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
* @constructor
*/
- constructor(url, options = {}) {
+ constructor(url: string, options: ConnectionOptions = {}) {
super(url, options);
this._client = new Client(url, options);
}
@@ -68,7 +70,7 @@ class DriverRemoteConnection extends RemoteConnection {
}
/** @override */
- submit(bytecode) {
+ submit(bytecode: Bytecode) {
const optionsStrategy = bytecode.sourceInstructions.find(
(i) => i[0] === 'withStrategies' && i[1] instanceof OptionsStrategy,
);
@@ -81,13 +83,13 @@ class DriverRemoteConnection extends RemoteConnection {
'materializeProperties',
];
- let requestOptions = undefined;
+ let requestOptions: RequestOptions | undefined = undefined;
if (optionsStrategy !== undefined) {
requestOptions = {};
const conf = optionsStrategy[1].configuration;
for (const key in conf) {
if (conf.hasOwnProperty(key) && allowedKeys.indexOf(key) > -1) {
- requestOptions[key] = conf[key];
+ requestOptions[key as keyof RequestOptions] = conf[key];
}
}
}
@@ -95,8 +97,7 @@ class DriverRemoteConnection extends RemoteConnection {
return this._client.submit(bytecode, null, requestOptions).then((result) => new RemoteTraversal(result.toArray()));
}
- /** @override */
- createSession() {
+ override createSession() {
if (this.isSessionBound) {
throw new Error('Connection is already bound to a session - child sessions are not allowed');
}
@@ -107,35 +108,29 @@ class DriverRemoteConnection extends RemoteConnection {
return new DriverRemoteConnection(this.url, copiedOptions);
}
- /** @override */
- get isSessionBound() {
- return this.options.session;
+ override get isSessionBound() {
+ return Boolean(this.options.session);
}
- /** @override */
- commit() {
+ override commit() {
return this._client.submit(Bytecode.GraphOp.commit, null);
}
- /** @override */
- rollback() {
+ override rollback() {
return this._client.submit(Bytecode.GraphOp.rollback, null);
}
- /** @override */
- close() {
+ override close() {
return this._client.close();
}
/** @override */
- addListener(...args) {
- return this._client.addListener(...args);
+ addListener(event: string, handler: (...args: any[]) => unknown) {
+ return this._client.addListener(event, handler);
}
/** @override */
- removeListener(...args) {
- return this._client.removeListener(...args);
+ removeListener(event: string, handler: (...args: any[]) => unknown) {
+ return this._client.removeListener(event, handler);
}
}
-
-module.exports = DriverRemoteConnection;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.ts
similarity index 71%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.ts
index 053d519b58..d653c4d975 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.ts
@@ -20,128 +20,115 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const t = require('../process/traversal');
-const TraversalStrategy = require('../process/traversal-strategy').TraversalStrategy;
+import Bytecode from '../process/bytecode.js';
+import { TraversalStrategy } from '../process/traversal-strategy.js';
+import { Traversal, Traverser } from '../process/traversal.js';
+import type { ConnectionOptions } from './connection.js';
+
+export type RemoteConnectionOptions = ConnectionOptions & { session?: string };
/**
* Represents an abstraction of a "connection" to a "server" that is capable of processing a traversal and
* returning results.
*/
-class RemoteConnection {
+export abstract class RemoteConnection {
/**
* @param {String} url The resource uri.
- * @param {Object} [options] The connection options.
+ * @param {RemoteConnectionOptions} [options] The connection options.
*/
- constructor(url, options = {}) {
- this.url = url;
- this.options = options;
- }
+ constructor(
+ public url: string,
+ protected readonly options: RemoteConnectionOptions = {},
+ ) {}
/**
* Opens the connection, if its not already opened.
* @returns {Promise}
*/
- open() {
- throw new Error('open() must be implemented');
- }
+ abstract open(): Promise<void>;
/**
* Returns true if connection is open
* @returns {Boolean}
*/
- get isOpen() {
- throw new Error('isOpen() must be implemented');
- }
+ abstract get isOpen(): boolean;
/**
* Determines if the connection is already bound to a session. If so, this indicates that the
* <code>#createSession()</code> cannot be called so as to produce child sessions.
* @returns {boolean}
*/
- get isSessionBound() {
+ get isSessionBound(): boolean {
return false;
}
/**
* Submits the <code>Bytecode</code> provided and returns a <code>RemoteTraversal</code>.
- * @abstract
* @param {Bytecode} bytecode
* @returns {Promise} Returns a <code>Promise</code> that resolves to a <code>RemoteTraversal</code>.
*/
- submit(bytecode) {
- throw new Error('submit() must be implemented');
- }
+ abstract submit(bytecode: Bytecode | null): Promise<RemoteTraversal>;
/**
* Create a new <code>RemoteConnection</code> that is bound to a session using the configuration from this one.
* If the connection is already session bound then this function should throw an exception.
* @returns {RemoteConnection}
*/
- createSession() {
- throw new Error('createSession() must be implemented');
- }
+ abstract createSession(): RemoteConnection;
/**
* Submits a <code>Bytecode.GraphOp.commit</code> to the server and closes the connection.
* @returns {Promise}
*/
- commit() {
- throw new Error('commit() must be implemented');
- }
+ abstract commit(): Promise<void>;
+
/**
* Submits a <code>Bytecode.GraphOp.rollback</code> to the server and closes the connection.
* @returns {Promise}
*/
- rollback() {
- throw new Error('rollback() must be implemented');
- }
+ abstract rollback(): Promise<void>;
/**
* Closes the connection where open transactions will close according to the features of the graph provider.
* @returns {Promise}
*/
- close() {
- throw new Error('close() must be implemented');
- }
+ abstract close(): Promise<void>;
}
/**
* Represents a traversal as a result of a {@link RemoteConnection} submission.
*/
-class RemoteTraversal extends t.Traversal {
- constructor(traversers, sideEffects) {
- super(null, null, null);
- this.traversers = traversers;
- this.sideEffects = sideEffects;
+export class RemoteTraversal extends Traversal {
+ constructor(
+ public traversers: Traverser<any>[],
+ public sideEffects?: any[],
+ ) {
+ super(null, null, new Bytecode());
}
}
-class RemoteStrategy extends TraversalStrategy {
+export class RemoteStrategy extends TraversalStrategy {
/**
* Creates a new instance of RemoteStrategy.
* @param {RemoteConnection} connection
*/
- constructor(connection) {
+ constructor(public connection: RemoteConnection) {
// gave this a fqcn that has a local "js:" prefix since this strategy isn't sent as bytecode to the server.
// this is a sort of local-only strategy that actually executes client side. not sure if this prefix is the
// right way to name this or not, but it should have a name to identify it.
super('js:RemoteStrategy');
- this.connection = connection;
}
/** @override */
- apply(traversal) {
+ apply(traversal: Traversal) {
if (traversal.traversers) {
return Promise.resolve();
}
- return this.connection.submit(traversal.getBytecode()).then(function (remoteTraversal) {
+ return this.connection.submit(traversal.getBytecode()).then(function (remoteTraversal: RemoteTraversal) {
traversal.sideEffects = remoteTraversal.sideEffects;
traversal.traversers = remoteTraversal.traversers;
});
}
}
-
-module.exports = { RemoteConnection, RemoteStrategy, RemoteTraversal };
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.ts
similarity index 78%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.ts
index 6004f77354..faa072c90f 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/response-error.ts
@@ -17,13 +17,23 @@
* under the License.
*/
-'use strict';
/**
* Represents an error obtained from the server.
*/
-class ResponseError extends Error {
- constructor(message, responseStatus) {
+export default class ResponseError extends Error {
+ statusCode: number;
+ statusMessage: string;
+ statusAttributes: Map<string, string>;
+
+ constructor(
+ message: string,
+ responseStatus: {
+ code: ResponseError['statusCode'];
+ message: ResponseError['statusMessage'];
+ attributes: ResponseError['statusAttributes'];
+ },
+ ) {
super(message);
this.name = 'ResponseError';
@@ -43,5 +53,3 @@ class ResponseError extends Error {
this.statusAttributes = responseStatus.attributes || {};
}
}
-
-module.exports = ResponseError;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.ts
similarity index 81%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.ts
index 8a7e401b25..29301e3edb 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/result-set.ts
@@ -20,26 +20,31 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const utils = require('../utils');
+import * as utils from '../utils.js';
const emptyMap = Object.freeze(new utils.ImmutableMap());
/**
* Represents the response returned from the execution of a Gremlin traversal or script.
*/
-class ResultSet {
+export default class ResultSet {
+ private readonly attributes: Map<string, string>;
+ readonly length: number;
+
/**
* Creates a new instance of {@link ResultSet}.
* @param {Array} items
* @param {Map} [attributes]
*/
- constructor(items, attributes) {
+ constructor(
+ private readonly items: any[],
+ attributes: Map<string, any>,
+ ) {
if (!Array.isArray(items)) {
throw new TypeError('items must be an Array instance');
}
- this._items = items;
+ this.items = items;
/**
* Gets a Map representing the attributes of the response.
@@ -59,25 +64,23 @@ class ResultSet {
* @returns {Iterator}
*/
[Symbol.iterator]() {
- return this._items[Symbol.iterator]();
+ return this.items[Symbol.iterator]();
}
/**
* Gets an array of result items.
* @returns {Array}
*/
- toArray() {
- return this._items;
+ toArray(): Array<any> {
+ return this.items;
}
/**
* Returns the first item.
* @returns {Object|null}
*/
- first() {
- const item = this._items[0];
+ first(): any | null {
+ const item = this.items[0];
return item !== undefined ? item : null;
}
}
-
-module.exports = ResultSet;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/index.ts b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/index.ts
new file mode 100644
index 0000000000..acc5a1b33f
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/index.ts
@@ -0,0 +1,95 @@
+/*
+ * 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
+ */
+
+import * as t from './process/traversal.js';
+import * as gt from './process/graph-traversal.js';
+import * as strategiesModule from './process/traversal-strategy.js';
+import * as graph from './structure/graph.js';
+import * as gs from './structure/io/graph-serializer.js';
+import * as rc from './driver/remote-connection.js';
+import Bytecode from './process/bytecode.js';
+import Translator from './process/translator.js';
+import * as utils from './utils.js';
+import DriverRemoteConnection from './driver/driver-remote-connection.js';
+import ResponseError from './driver/response-error.js';
+import Client from './driver/client.js';
+import ResultSet from './driver/result-set.js';
+import Authenticator from './driver/auth/authenticator.js';
+import PlainTextSaslAuthenticator from './driver/auth/plain-text-sasl-authenticator.js';
+import AnonymousTraversalSource from './process/anonymous-traversal.js';
+
+export const driver = {
+ RemoteConnection: rc.RemoteConnection,
+ RemoteStrategy: rc.RemoteStrategy,
+ RemoteTraversal: rc.RemoteTraversal,
+ ResponseError,
+ DriverRemoteConnection,
+ Client,
+ ResultSet,
+ auth: {
+ Authenticator,
+ PlainTextSaslAuthenticator,
+ },
+};
+
+export const process = {
+ Bytecode,
+ EnumValue: t.EnumValue,
+ P: t.P,
+ TextP: t.TextP,
+ Traversal: t.Traversal,
+ TraversalSideEffects: t.TraversalSideEffects,
+ TraversalStrategies: strategiesModule.TraversalStrategies,
+ TraversalStrategy: strategiesModule.TraversalStrategy,
+ Traverser: t.Traverser,
+ barrier: t.barrier,
+ cardinality: t.cardinality,
+ column: t.column,
+ direction: t.direction,
+ dt: t.dt,
+ merge: t.merge,
+ operator: t.operator,
+ order: t.order,
+ pick: t.pick,
+ pop: t.pop,
+ scope: t.scope,
+ t: t.t,
+ GraphTraversal: gt.GraphTraversal,
+ GraphTraversalSource: gt.GraphTraversalSource,
+ statics: gt.statics,
+ Translator,
+ traversal: AnonymousTraversalSource.traversal,
+ AnonymousTraversalSource,
+ withOptions: t.withOptions,
+};
+
+export const structure = {
+ io: gs,
+ Edge: graph.Edge,
+ Graph: graph.Graph,
+ Path: graph.Path,
+ Property: graph.Property,
+ Vertex: graph.Vertex,
+ VertexProperty: graph.VertexProperty,
+ toLong: utils.toLong,
+};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.ts
similarity index 75%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.ts
index e7f44c1664..479ed21199 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/anonymous-traversal.ts
@@ -17,31 +17,27 @@
* under the License.
*/
-'use strict';
-
-const graphTraversalModule = require('./graph-traversal');
-const remote = require('../driver/remote-connection');
-const TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
-const GraphTraversalSource = graphTraversalModule.GraphTraversalSource;
-const GraphTraversal = graphTraversalModule.GraphTraversal;
-const Bytecode = require('./bytecode');
-const Graph = require('../structure/graph').Graph;
+import { RemoteConnection, RemoteStrategy } from '../driver/remote-connection.js';
+import { Graph } from '../structure/graph.js';
+import Bytecode from './bytecode.js';
+import { GraphTraversalSource, GraphTraversal } from './graph-traversal.js';
+import { TraversalStrategies } from './traversal-strategy.js';
/**
* Provides a unified way to construct a <code>TraversalSource</code> from the perspective of the traversal. In this
* syntax the user is creating the source and binding it to a reference which is either an existing <code>Graph</code>
* instance or a <code>RemoteConnection</code>.
*/
-class AnonymousTraversalSource {
+export default class AnonymousTraversalSource {
/**
* Creates a new instance of {@code AnonymousTraversalSource}.
* @param {Function} [traversalSourceClass] Optional {@code GraphTraversalSource} constructor.
* @param {Function} [traversalClass] Optional {@code GraphTraversal} constructor.
*/
- constructor(traversalSourceClass, traversalClass) {
- this.traversalSourceClass = traversalSourceClass;
- this.traversalClass = traversalClass;
- }
+ constructor(
+ readonly traversalSourceClass?: typeof GraphTraversalSource,
+ readonly traversalClass?: typeof GraphTraversal,
+ ) {}
/**
* Constructs an {@code AnonymousTraversalSource} which will then be configured to spawn a
@@ -50,7 +46,7 @@ class AnonymousTraversalSource {
* @param {Function} [traversalClass] Optional {@code GraphTraversalSource} constructor.
* @returns {AnonymousTraversalSource}.
*/
- static traversal(traversalSourceClass, traversalClass) {
+ static traversal(traversalSourceClass?: typeof GraphTraversalSource, traversalClass?: typeof GraphTraversal) {
return new AnonymousTraversalSource(traversalSourceClass || GraphTraversalSource, traversalClass || GraphTraversal);
}
@@ -60,10 +56,10 @@ class AnonymousTraversalSource {
* @param {RemoteConnection} connection
* @return {GraphTraversalSource}
*/
- with_(connection) {
+ with_(connection: RemoteConnection) {
const traversalStrategies = new TraversalStrategies();
- traversalStrategies.addStrategy(new remote.RemoteStrategy(connection));
- return new this.traversalSourceClass(
+ traversalStrategies.addStrategy(new RemoteStrategy(connection));
+ return new this.traversalSourceClass!(
new Graph(),
traversalStrategies,
new Bytecode(),
@@ -79,9 +75,7 @@ class AnonymousTraversalSource {
* @return {GraphTraversalSource}
* @deprecated As of release 4.0.0, prefer {@link with_}.
*/
- withRemote(remoteConnection) {
+ withRemote(remoteConnection: RemoteConnection) {
return this.with_(remoteConnection);
}
}
-
-module.exports = AnonymousTraversalSource;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.ts
similarity index 85%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.ts
index 1f355f0911..0df6802472 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/bytecode.ts
@@ -20,16 +20,18 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const { Traversal } = require('./traversal');
+import { Traversal } from './traversal.js';
+
+export default class Bytecode {
+ sourceInstructions: any[] = [];
+ stepInstructions: any[] = [];
-class Bytecode {
/**
* Creates a new instance of Bytecode
* @param {Bytecode} [toClone]
*/
- constructor(toClone) {
+ constructor(toClone?: Bytecode) {
if (!toClone) {
this.sourceInstructions = [];
this.stepInstructions = [];
@@ -45,7 +47,7 @@ class Bytecode {
* @param {Array} values
* @returns {Bytecode}
*/
- addSource(name, values) {
+ addSource(name: string, values: any[]): Bytecode {
if (name === undefined) {
throw new Error('Name is not defined');
}
@@ -64,7 +66,7 @@ class Bytecode {
* @param {Array} values
* @returns {Bytecode}
*/
- addStep(name, values) {
+ addStep(name: string, values?: any[]): Bytecode {
if (name === undefined) {
throw new Error('Name is not defined');
}
@@ -72,12 +74,12 @@ class Bytecode {
return this;
}
- static _generateInstruction(name, values) {
+ private static _generateInstruction(name: string, values?: any[]) {
const length = (values ? values.length : 0) + 1;
const instruction = new Array(length);
instruction[0] = name;
for (let i = 1; i < length; i++) {
- const val = values[i - 1];
+ const val = values?.[i - 1];
if (val instanceof Traversal && val.graph != null) {
throw new Error(
`The child traversal of ${val} was not spawned anonymously - use ` +
@@ -93,7 +95,7 @@ class Bytecode {
* Returns the JSON representation of the source and step instructions
* @returns {String}
*/
- toString() {
+ toString(): string {
return JSON.stringify([this.sourceInstructions, this.stepInstructions]);
}
@@ -103,7 +105,7 @@ class Bytecode {
* @param {Array} values
* @returns {Bytecode}
*/
- static _createGraphOp(name, values) {
+ static _createGraphOp(name: string, values: any[]): Bytecode {
const bc = new Bytecode();
bc.addSource(name, values);
return bc;
@@ -113,12 +115,10 @@ class Bytecode {
* Gets the <code>Bytecode</code> that is meant to be sent as "graph operations" to the server.
* @returns {{rollback: Bytecode, commit: Bytecode}}
*/
- static get GraphOp() {
+ static get GraphOp(): { rollback: Bytecode; commit: Bytecode } {
return {
commit: Bytecode._createGraphOp('tx', ['commit']),
rollback: Bytecode._createGraphOp('tx', ['rollback']),
};
}
}
-
-module.exports = Bytecode;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.ts
similarity index 69%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.ts
index f2dee06600..1cd7718b96 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.ts
@@ -20,17 +20,20 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const { Traversal, cardinality } = require('./traversal');
-const { Transaction } = require('./transaction');
-const Bytecode = require('./bytecode');
-const { TraversalStrategies, VertexProgramStrategy, OptionsStrategy } = require('./traversal-strategy');
+import { EnumValue, Traversal, cardinality } from './traversal.js';
+import { Transaction } from './transaction.js';
+import Bytecode from './bytecode.js';
+import { TraversalStrategies, VertexProgramStrategy, OptionsStrategy } from './traversal-strategy.js';
+import { Graph } from '../structure/graph.js';
+import { RemoteConnection, RemoteStrategy } from '../driver/remote-connection.js';
/**
* Represents the primary DSL of the Gremlin traversal machine.
*/
-class GraphTraversalSource {
+export class GraphTraversalSource {
+ remoteConnection?: RemoteConnection;
+
/**
* Creates a new instance of {@link GraphTraversalSource}.
* @param {Graph} graph
@@ -39,12 +42,13 @@ class GraphTraversalSource {
* @param {Function} [graphTraversalSourceClass] Optional {@link GraphTraversalSource} constructor.
* @param {Function} [graphTraversalClass] Optional {@link GraphTraversal} constructor.
*/
- constructor(graph, traversalStrategies, bytecode, graphTraversalSourceClass, graphTraversalClass) {
- this.graph = graph;
- this.traversalStrategies = traversalStrategies;
- this.bytecode = bytecode || new Bytecode();
- this.graphTraversalSourceClass = graphTraversalSourceClass || GraphTraversalSource;
- this.graphTraversalClass = graphTraversalClass || GraphTraversal;
+ constructor(
+ public graph: Graph,
+ public traversalStrategies: TraversalStrategies,
+ public bytecode: Bytecode = new Bytecode(),
+ public graphTraversalSourceClass: typeof GraphTraversalSource = GraphTraversalSource,
+ public graphTraversalClass: typeof GraphTraversal = GraphTraversal,
+ ) {
const strat = traversalStrategies.strategies.find((ts) => ts.fqcn === 'js:RemoteStrategy');
this.remoteConnection = strat !== undefined ? strat.connection : undefined;
}
@@ -53,7 +57,7 @@ class GraphTraversalSource {
* Spawn a new <code>Transaction</code> object that can then start and stop a transaction.
* @returns {Transaction}
*/
- tx() {
+ tx(): Transaction {
// you can't do g.tx().begin().tx() - no child transactions
if (this.remoteConnection && this.remoteConnection.isSessionBound) {
throw new Error('This TraversalSource is already bound to a transaction - child transactions are not supported');
@@ -72,8 +76,16 @@ class GraphTraversalSource {
* @param configuration
* @returns {GraphTraversalSource}
*/
- withComputer(graphComputer, workers, result, persist, vertices, edges, configuration) {
- const m = {};
+ withComputer(
+ graphComputer: any,
+ workers: any,
+ result: any,
+ persist: any,
+ vertices: any[],
+ edges: any[],
+ configuration: any,
+ ): GraphTraversalSource {
+ const m: any = {};
if (graphComputer !== undefined) {
m.graphComputer = graphComputer;
}
@@ -104,7 +116,7 @@ class GraphTraversalSource {
* @param {Object} value if not specified, the value with default to {@code true}
* @returns {GraphTraversalSource}
*/
- with_(key, value = undefined) {
+ with_(key: string, value: object | undefined = undefined): GraphTraversalSource {
const val = value === undefined ? true : value;
let optionsStrategy = this.bytecode.sourceInstructions.find(
(i) => i[0] === 'withStrategies' && i[1] instanceof OptionsStrategy,
@@ -127,7 +139,7 @@ class GraphTraversalSource {
* Returns the string representation of the GraphTraversalSource.
* @returns {string}
*/
- toString() {
+ toString(): string {
return 'graphtraversalsource[' + this.graph.toString() + ']';
}
@@ -136,7 +148,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withBulk(...args) {
+ withBulk(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withBulk', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -152,7 +164,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withPath(...args) {
+ withPath(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withPath', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -168,7 +180,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withSack(...args) {
+ withSack(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withSack', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -184,7 +196,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withSideEffect(...args) {
+ withSideEffect(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withSideEffect', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -200,7 +212,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withStrategies(...args) {
+ withStrategies(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withStrategies', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -216,7 +228,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversalSource}
*/
- withoutStrategies(...args) {
+ withoutStrategies(...args: any[]): GraphTraversalSource {
const b = new Bytecode(this.bytecode).addSource('withoutStrategies', args);
return new this.graphTraversalSourceClass(
this.graph,
@@ -232,7 +244,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- E(...args) {
+ E(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('E', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -242,7 +254,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- V(...args) {
+ V(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('V', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -252,7 +264,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- addE(...args) {
+ addE(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('addE', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -262,7 +274,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- mergeE(...args) {
+ mergeE(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('mergeE', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -272,7 +284,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- addV(...args) {
+ addV(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('addV', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -282,7 +294,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- mergeV(...args) {
+ mergeV(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('mergeV', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -292,7 +304,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- inject(...args) {
+ inject(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('inject', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -302,7 +314,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- io(...args) {
+ io(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('io', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -312,7 +324,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- call(...args) {
+ call(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('call', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -322,7 +334,7 @@ class GraphTraversalSource {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- union(...args) {
+ union(...args: any[]): GraphTraversal {
const b = new Bytecode(this.bytecode).addStep('union', args);
return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
@@ -331,8 +343,8 @@ class GraphTraversalSource {
/**
* Represents a graph traversal.
*/
-class GraphTraversal extends Traversal {
- constructor(graph, traversalStrategies, bytecode) {
+export class GraphTraversal extends Traversal {
+ constructor(graph: Graph | null, traversalStrategies: TraversalStrategies | null, bytecode: Bytecode) {
super(graph, traversalStrategies, bytecode);
}
@@ -348,7 +360,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- V(...args) {
+ V(...args: any[]): this {
this.bytecode.addStep('V', args);
return this;
}
@@ -358,7 +370,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- E(...args) {
+ E(...args: any[]): this {
this.bytecode.addStep('E', args);
return this;
}
@@ -368,7 +380,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- addE(...args) {
+ addE(...args: any[]): this {
this.bytecode.addStep('addE', args);
return this;
}
@@ -378,7 +390,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- addV(...args) {
+ addV(...args: any[]): this {
this.bytecode.addStep('addV', args);
return this;
}
@@ -388,7 +400,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- aggregate(...args) {
+ aggregate(...args: any[]): this {
this.bytecode.addStep('aggregate', args);
return this;
}
@@ -398,7 +410,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- all(...args) {
+ all(...args: any[]): this {
this.bytecode.addStep('all', args);
return this;
}
@@ -408,7 +420,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- and(...args) {
+ and(...args: any[]): this {
this.bytecode.addStep('and', args);
return this;
}
@@ -418,7 +430,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- any(...args) {
+ any(...args: any[]): this {
this.bytecode.addStep('any', args);
return this;
}
@@ -428,7 +440,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- as(...args) {
+ as(...args: any[]): this {
this.bytecode.addStep('as', args);
return this;
}
@@ -438,7 +450,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- asDate(...args) {
+ asDate(...args: any[]): this {
this.bytecode.addStep('asDate', args);
return this;
}
@@ -448,7 +460,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- asString(...args) {
+ asString(...args: any[]): this {
this.bytecode.addStep('asString', args);
return this;
}
@@ -458,7 +470,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- barrier(...args) {
+ barrier(...args: any[]): this {
this.bytecode.addStep('barrier', args);
return this;
}
@@ -468,7 +480,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- both(...args) {
+ both(...args: any[]): this {
this.bytecode.addStep('both', args);
return this;
}
@@ -478,7 +490,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- bothE(...args) {
+ bothE(...args: any[]): this {
this.bytecode.addStep('bothE', args);
return this;
}
@@ -488,7 +500,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- bothV(...args) {
+ bothV(...args: any[]): this {
this.bytecode.addStep('bothV', args);
return this;
}
@@ -498,7 +510,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- branch(...args) {
+ branch(...args: any[]): this {
this.bytecode.addStep('branch', args);
return this;
}
@@ -508,7 +520,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- by(...args) {
+ by(...args: any[]): this {
this.bytecode.addStep('by', args);
return this;
}
@@ -518,7 +530,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- call(...args) {
+ call(...args: any[]): this {
this.bytecode.addStep('call', args);
return this;
}
@@ -527,7 +539,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- cap(...args) {
+ cap(...args: any[]): this {
this.bytecode.addStep('cap', args);
return this;
}
@@ -537,7 +549,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- choose(...args) {
+ choose(...args: any[]): this {
this.bytecode.addStep('choose', args);
return this;
}
@@ -547,7 +559,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- coalesce(...args) {
+ coalesce(...args: any[]): this {
this.bytecode.addStep('coalesce', args);
return this;
}
@@ -557,7 +569,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- coin(...args) {
+ coin(...args: any[]): this {
this.bytecode.addStep('coin', args);
return this;
}
@@ -567,7 +579,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- combine(...args) {
+ combine(...args: any[]): this {
this.bytecode.addStep('combine', args);
return this;
}
@@ -577,7 +589,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- concat(...args) {
+ concat(...args: any[]): this {
this.bytecode.addStep('concat', args);
return this;
}
@@ -587,7 +599,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- conjoin(...args) {
+ conjoin(...args: any[]): this {
this.bytecode.addStep('conjoin', args);
return this;
}
@@ -597,7 +609,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- connectedComponent(...args) {
+ connectedComponent(...args: any[]): this {
this.bytecode.addStep('connectedComponent', args);
return this;
}
@@ -607,7 +619,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- constant(...args) {
+ constant(...args: any[]): this {
this.bytecode.addStep('constant', args);
return this;
}
@@ -617,7 +629,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- count(...args) {
+ count(...args: any[]): this {
this.bytecode.addStep('count', args);
return this;
}
@@ -627,7 +639,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- cyclicPath(...args) {
+ cyclicPath(...args: any[]): this {
this.bytecode.addStep('cyclicPath', args);
return this;
}
@@ -637,7 +649,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- dateAdd(...args) {
+ dateAdd(...args: any[]): this {
this.bytecode.addStep('dateAdd', args);
return this;
}
@@ -647,7 +659,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- dateDiff(...args) {
+ dateDiff(...args: any[]): this {
this.bytecode.addStep('dateDiff', args);
return this;
}
@@ -657,7 +669,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- dedup(...args) {
+ dedup(...args: any[]): this {
this.bytecode.addStep('dedup', args);
return this;
}
@@ -667,7 +679,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- difference(...args) {
+ difference(...args: any[]): this {
this.bytecode.addStep('difference', args);
return this;
}
@@ -677,7 +689,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- discard(...args) {
+ discard(...args: any[]): this {
this.bytecode.addStep('discard', args);
return this;
}
@@ -687,7 +699,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- disjunct(...args) {
+ disjunct(...args: any[]): this {
this.bytecode.addStep('disjunct', args);
return this;
}
@@ -697,7 +709,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- drop(...args) {
+ drop(...args: any[]): this {
this.bytecode.addStep('drop', args);
return this;
}
@@ -707,7 +719,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- element(...args) {
+ element(...args: any[]): this {
this.bytecode.addStep('element', args);
return this;
}
@@ -716,7 +728,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- elementMap(...args) {
+ elementMap(...args: any[]): this {
this.bytecode.addStep('elementMap', args);
return this;
}
@@ -726,7 +738,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- emit(...args) {
+ emit(...args: any[]): this {
this.bytecode.addStep('emit', args);
return this;
}
@@ -736,7 +748,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- fail(...args) {
+ fail(...args: any[]): this {
this.bytecode.addStep('fail', args);
return this;
}
@@ -746,7 +758,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- filter(...args) {
+ filter(...args: any[]): this {
this.bytecode.addStep('filter', args);
return this;
}
@@ -756,7 +768,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- flatMap(...args) {
+ flatMap(...args: any[]): this {
this.bytecode.addStep('flatMap', args);
return this;
}
@@ -766,7 +778,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- fold(...args) {
+ fold(...args: any[]): this {
this.bytecode.addStep('fold', args);
return this;
}
@@ -776,7 +788,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- format(...args) {
+ format(...args: any[]): this {
this.bytecode.addStep('format', args);
return this;
}
@@ -786,7 +798,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- from_(...args) {
+ from_(...args: any[]): this {
this.bytecode.addStep('from', args);
return this;
}
@@ -796,7 +808,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- group(...args) {
+ group(...args: any[]): this {
this.bytecode.addStep('group', args);
return this;
}
@@ -806,7 +818,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- groupCount(...args) {
+ groupCount(...args: any[]): this {
this.bytecode.addStep('groupCount', args);
return this;
}
@@ -816,7 +828,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- has(...args) {
+ has(...args: any[]): this {
this.bytecode.addStep('has', args);
return this;
}
@@ -826,7 +838,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- hasId(...args) {
+ hasId(...args: any[]): this {
this.bytecode.addStep('hasId', args);
return this;
}
@@ -836,7 +848,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- hasKey(...args) {
+ hasKey(...args: any[]): this {
this.bytecode.addStep('hasKey', args);
return this;
}
@@ -846,7 +858,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- hasLabel(...args) {
+ hasLabel(...args: any[]): this {
this.bytecode.addStep('hasLabel', args);
return this;
}
@@ -856,7 +868,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- hasNot(...args) {
+ hasNot(...args: any[]): this {
this.bytecode.addStep('hasNot', args);
return this;
}
@@ -866,7 +878,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- hasValue(...args) {
+ hasValue(...args: any[]): this {
this.bytecode.addStep('hasValue', args);
return this;
}
@@ -876,7 +888,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- id(...args) {
+ id(...args: any[]): this {
this.bytecode.addStep('id', args);
return this;
}
@@ -886,7 +898,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- identity(...args) {
+ identity(...args: any[]): this {
this.bytecode.addStep('identity', args);
return this;
}
@@ -896,7 +908,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- in_(...args) {
+ in_(...args: any[]): this {
this.bytecode.addStep('in', args);
return this;
}
@@ -906,7 +918,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- inE(...args) {
+ inE(...args: any[]): this {
this.bytecode.addStep('inE', args);
return this;
}
@@ -916,7 +928,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- inV(...args) {
+ inV(...args: any[]): this {
this.bytecode.addStep('inV', args);
return this;
}
@@ -926,7 +938,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- index(...args) {
+ index(...args: any[]): this {
this.bytecode.addStep('index', args);
return this;
}
@@ -936,7 +948,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- inject(...args) {
+ inject(...args: any[]): this {
this.bytecode.addStep('inject', args);
return this;
}
@@ -946,7 +958,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- intersect(...args) {
+ intersect(...args: any[]): this {
this.bytecode.addStep('intersect', args);
return this;
}
@@ -956,7 +968,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- is(...args) {
+ is(...args: any[]): this {
this.bytecode.addStep('is', args);
return this;
}
@@ -966,7 +978,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- key(...args) {
+ key(...args: any[]): this {
this.bytecode.addStep('key', args);
return this;
}
@@ -976,7 +988,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- label(...args) {
+ label(...args: any[]): this {
this.bytecode.addStep('label', args);
return this;
}
@@ -986,7 +998,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- length(...args) {
+ length(...args: any[]): this {
this.bytecode.addStep('length', args);
return this;
}
@@ -996,7 +1008,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- limit(...args) {
+ limit(...args: any[]): this {
this.bytecode.addStep('limit', args);
return this;
}
@@ -1006,7 +1018,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- local(...args) {
+ local(...args: any[]): this {
this.bytecode.addStep('local', args);
return this;
}
@@ -1016,7 +1028,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- loops(...args) {
+ loops(...args: any[]): this {
this.bytecode.addStep('loops', args);
return this;
}
@@ -1026,7 +1038,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- lTrim(...args) {
+ lTrim(...args: any[]): this {
this.bytecode.addStep('lTrim', args);
return this;
}
@@ -1036,7 +1048,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- map(...args) {
+ map(...args: any[]): this {
this.bytecode.addStep('map', args);
return this;
}
@@ -1046,7 +1058,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- match(...args) {
+ match(...args: any[]): this {
this.bytecode.addStep('match', args);
return this;
}
@@ -1056,7 +1068,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- math(...args) {
+ math(...args: any[]): this {
this.bytecode.addStep('math', args);
return this;
}
@@ -1066,7 +1078,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- max(...args) {
+ max(...args: any[]): this {
this.bytecode.addStep('max', args);
return this;
}
@@ -1076,7 +1088,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- mean(...args) {
+ mean(...args: any[]): this {
this.bytecode.addStep('mean', args);
return this;
}
@@ -1086,7 +1098,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- merge(...args) {
+ merge(...args: any[]): this {
this.bytecode.addStep('merge', args);
return this;
}
@@ -1096,7 +1108,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- mergeE(...args) {
+ mergeE(...args: any[]): this {
this.bytecode.addStep('mergeE', args);
return this;
}
@@ -1106,7 +1118,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- mergeV(...args) {
+ mergeV(...args: any[]): this {
this.bytecode.addStep('mergeV', args);
return this;
}
@@ -1116,7 +1128,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- min(...args) {
+ min(...args: any[]): this {
this.bytecode.addStep('min', args);
return this;
}
@@ -1126,7 +1138,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- none(...args) {
+ none(...args: any[]): this {
this.bytecode.addStep('none', args);
return this;
}
@@ -1136,7 +1148,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- not(...args) {
+ not(...args: any[]): this {
this.bytecode.addStep('not', args);
return this;
}
@@ -1146,7 +1158,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- option(...args) {
+ option(...args: any[]): this {
this.bytecode.addStep('option', args);
return this;
}
@@ -1156,7 +1168,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- optional(...args) {
+ optional(...args: any[]): this {
this.bytecode.addStep('optional', args);
return this;
}
@@ -1166,7 +1178,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- or(...args) {
+ or(...args: any[]): this {
this.bytecode.addStep('or', args);
return this;
}
@@ -1176,7 +1188,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- order(...args) {
+ order(...args: any[]): this {
this.bytecode.addStep('order', args);
return this;
}
@@ -1186,7 +1198,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- otherV(...args) {
+ otherV(...args: any[]): this {
this.bytecode.addStep('otherV', args);
return this;
}
@@ -1196,7 +1208,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- out(...args) {
+ out(...args: any[]): this {
this.bytecode.addStep('out', args);
return this;
}
@@ -1206,7 +1218,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- outE(...args) {
+ outE(...args: any[]): this {
this.bytecode.addStep('outE', args);
return this;
}
@@ -1216,7 +1228,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- outV(...args) {
+ outV(...args: any[]): this {
this.bytecode.addStep('outV', args);
return this;
}
@@ -1226,7 +1238,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- pageRank(...args) {
+ pageRank(...args: any[]): this {
this.bytecode.addStep('pageRank', args);
return this;
}
@@ -1236,7 +1248,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- path(...args) {
+ path(...args: any[]): this {
this.bytecode.addStep('path', args);
return this;
}
@@ -1246,7 +1258,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- peerPressure(...args) {
+ peerPressure(...args: any[]): this {
this.bytecode.addStep('peerPressure', args);
return this;
}
@@ -1256,7 +1268,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- product(...args) {
+ product(...args: any[]): this {
this.bytecode.addStep('product', args);
return this;
}
@@ -1266,7 +1278,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- profile(...args) {
+ profile(...args: any[]): this {
this.bytecode.addStep('profile', args);
return this;
}
@@ -1276,7 +1288,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- program(...args) {
+ program(...args: any[]): this {
this.bytecode.addStep('program', args);
return this;
}
@@ -1286,7 +1298,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- project(...args) {
+ project(...args: any[]): this {
this.bytecode.addStep('project', args);
return this;
}
@@ -1296,7 +1308,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- properties(...args) {
+ properties(...args: any[]): this {
this.bytecode.addStep('properties', args);
return this;
}
@@ -1306,7 +1318,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- property(...args) {
+ property(...args: any[]): this {
this.bytecode.addStep('property', args);
return this;
}
@@ -1316,7 +1328,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- propertyMap(...args) {
+ propertyMap(...args: any[]): this {
this.bytecode.addStep('propertyMap', args);
return this;
}
@@ -1326,7 +1338,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- range(...args) {
+ range(...args: any[]): this {
this.bytecode.addStep('range', args);
return this;
}
@@ -1336,7 +1348,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- read(...args) {
+ read(...args: any[]): this {
this.bytecode.addStep('read', args);
return this;
}
@@ -1346,7 +1358,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- repeat(...args) {
+ repeat(...args: any[]): this {
this.bytecode.addStep('repeat', args);
return this;
}
@@ -1356,7 +1368,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- replace(...args) {
+ replace(...args: any[]): this {
this.bytecode.addStep('replace', args);
return this;
}
@@ -1366,7 +1378,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- reverse(...args) {
+ reverse(...args: any[]): this {
this.bytecode.addStep('reverse', args);
return this;
}
@@ -1376,7 +1388,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- rTrim(...args) {
+ rTrim(...args: any[]): this {
this.bytecode.addStep('rTrim', args);
return this;
}
@@ -1386,7 +1398,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- sack(...args) {
+ sack(...args: any[]): this {
this.bytecode.addStep('sack', args);
return this;
}
@@ -1396,7 +1408,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- sample(...args) {
+ sample(...args: any[]): this {
this.bytecode.addStep('sample', args);
return this;
}
@@ -1406,7 +1418,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- select(...args) {
+ select(...args: any[]): this {
this.bytecode.addStep('select', args);
return this;
}
@@ -1416,7 +1428,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- shortestPath(...args) {
+ shortestPath(...args: any[]): this {
this.bytecode.addStep('shortestPath', args);
return this;
}
@@ -1426,7 +1438,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- sideEffect(...args) {
+ sideEffect(...args: any[]): this {
this.bytecode.addStep('sideEffect', args);
return this;
}
@@ -1436,7 +1448,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- simplePath(...args) {
+ simplePath(...args: any[]): this {
this.bytecode.addStep('simplePath', args);
return this;
}
@@ -1446,7 +1458,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- skip(...args) {
+ skip(...args: any[]): this {
this.bytecode.addStep('skip', args);
return this;
}
@@ -1456,7 +1468,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- split(...args) {
+ split(...args: any[]): this {
this.bytecode.addStep('split', args);
return this;
}
@@ -1466,7 +1478,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- store(...args) {
+ store(...args: any[]): this {
this.bytecode.addStep('store', args);
return this;
}
@@ -1476,7 +1488,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- subgraph(...args) {
+ subgraph(...args: any[]): this {
this.bytecode.addStep('subgraph', args);
return this;
}
@@ -1486,7 +1498,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- substring(...args) {
+ substring(...args: any[]): this {
this.bytecode.addStep('substring', args);
return this;
}
@@ -1496,7 +1508,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- sum(...args) {
+ sum(...args: any[]): this {
this.bytecode.addStep('sum', args);
return this;
}
@@ -1506,7 +1518,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- tail(...args) {
+ tail(...args: any[]): this {
this.bytecode.addStep('tail', args);
return this;
}
@@ -1516,7 +1528,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- timeLimit(...args) {
+ timeLimit(...args: any[]): this {
this.bytecode.addStep('timeLimit', args);
return this;
}
@@ -1526,7 +1538,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- times(...args) {
+ times(...args: any[]): this {
this.bytecode.addStep('times', args);
return this;
}
@@ -1536,7 +1548,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- to(...args) {
+ to(...args: any[]): this {
this.bytecode.addStep('to', args);
return this;
}
@@ -1546,7 +1558,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- toE(...args) {
+ toE(...args: any[]): this {
this.bytecode.addStep('toE', args);
return this;
}
@@ -1556,7 +1568,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- toLower(...args) {
+ toLower(...args: any[]): this {
this.bytecode.addStep('toLower', args);
return this;
}
@@ -1566,7 +1578,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- toUpper(...args) {
+ toUpper(...args: any[]): this {
this.bytecode.addStep('toUpper', args);
return this;
}
@@ -1576,7 +1588,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- toV(...args) {
+ toV(...args: any[]): this {
this.bytecode.addStep('toV', args);
return this;
}
@@ -1586,7 +1598,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- tree(...args) {
+ tree(...args: any[]): this {
this.bytecode.addStep('tree', args);
return this;
}
@@ -1596,7 +1608,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- trim(...args) {
+ trim(...args: any[]): this {
this.bytecode.addStep('trim', args);
return this;
}
@@ -1606,7 +1618,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- unfold(...args) {
+ unfold(...args: any[]): this {
this.bytecode.addStep('unfold', args);
return this;
}
@@ -1616,7 +1628,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- union(...args) {
+ union(...args: any[]): this {
this.bytecode.addStep('union', args);
return this;
}
@@ -1626,7 +1638,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- until(...args) {
+ until(...args: any[]): this {
this.bytecode.addStep('until', args);
return this;
}
@@ -1636,7 +1648,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- value(...args) {
+ value(...args: any[]): this {
this.bytecode.addStep('value', args);
return this;
}
@@ -1646,7 +1658,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- valueMap(...args) {
+ valueMap(...args: any[]): this {
this.bytecode.addStep('valueMap', args);
return this;
}
@@ -1656,7 +1668,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- values(...args) {
+ values(...args: any[]): this {
this.bytecode.addStep('values', args);
return this;
}
@@ -1666,7 +1678,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- where(...args) {
+ where(...args: any[]): this {
this.bytecode.addStep('where', args);
return this;
}
@@ -1676,7 +1688,7 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- with_(...args) {
+ with_(...args: any[]): this {
this.bytecode.addStep('with', args);
return this;
}
@@ -1686,19 +1698,19 @@ class GraphTraversal extends Traversal {
* @param {...Object} args
* @returns {GraphTraversal}
*/
- write(...args) {
+ write(...args: any[]): this {
this.bytecode.addStep('write', args);
return this;
}
}
-class CardinalityValue extends Bytecode {
+export class CardinalityValue extends Bytecode {
/**
* Creates a new instance of {@link CardinalityValue}.
* @param {String} card
* @param {Object} value
*/
- constructor(card, value) {
+ constructor(card: string | EnumValue, value: any) {
super();
this.addSource('CardinalityValueTraversal', [card, value]);
}
@@ -1708,7 +1720,7 @@ class CardinalityValue extends Bytecode {
* @param {Array} value
* @returns {CardinalityValue}
*/
- static single(value) {
+ static single(value: any[]): CardinalityValue {
return new CardinalityValue(cardinality.single, value);
}
@@ -1717,7 +1729,7 @@ class CardinalityValue extends Bytecode {
* @param {Array} value
* @returns {CardinalityValue}
*/
- static list(value) {
+ static list(value: any[]): CardinalityValue {
return new CardinalityValue(cardinality.list, value);
}
@@ -1726,141 +1738,132 @@ class CardinalityValue extends Bytecode {
* @param {Array} value
* @returns {CardinalityValue}
*/
- static set(value) {
+ static set(value: any[]): CardinalityValue {
return new CardinalityValue(cardinality.set, value);
}
}
-function callOnEmptyTraversal(fnName, args) {
+function callOnEmptyTraversal(fnName: string, args: any[]) {
const g = new GraphTraversal(null, null, new Bytecode());
- return g[fnName].apply(g, args);
+ return g[fnName as keyof typeof g].apply(g, args);
}
/**
* Contains the static method definitions
- * @type {Object}
*/
-const statics = {
- E: (...args) => callOnEmptyTraversal('E', args),
- V: (...args) => callOnEmptyTraversal('V', args),
- addE: (...args) => callOnEmptyTraversal('addE', args),
- addV: (...args) => callOnEmptyTraversal('addV', args),
- aggregate: (...args) => callOnEmptyTraversal('aggregate', args),
- all: (...args) => callOnEmptyTraversal('all', args),
- and: (...args) => callOnEmptyTraversal('and', args),
- any: (...args) => callOnEmptyTraversal('any', args),
- as: (...args) => callOnEmptyTraversal('as', args),
- asDate: (...args) => callOnEmptyTraversal('asDate', args),
- asString: (...args) => callOnEmptyTraversal('asString', args),
- barrier: (...args) => callOnEmptyTraversal('barrier', args),
- both: (...args) => callOnEmptyTraversal('both', args),
- bothE: (...args) => callOnEmptyTraversal('bothE', args),
- bothV: (...args) => callOnEmptyTraversal('bothV', args),
- branch: (...args) => callOnEmptyTraversal('branch', args),
- call: (...args) => callOnEmptyTraversal('call', args),
- cap: (...args) => callOnEmptyTraversal('cap', args),
- choose: (...args) => callOnEmptyTraversal('choose', args),
- coalesce: (...args) => callOnEmptyTraversal('coalesce', args),
- coin: (...args) => callOnEmptyTraversal('coin', args),
- concat: (...args) => callOnEmptyTraversal('concat', args),
- constant: (...args) => callOnEmptyTraversal('constant', args),
- count: (...args) => callOnEmptyTraversal('count', args),
- cyclicPath: (...args) => callOnEmptyTraversal('cyclicPath', args),
- dateAdd: (...args) => callOnEmptyTraversal('dateAdd', args),
- dateDiff: (...args) => callOnEmptyTraversal('dateDiff', args),
- dedup: (...args) => callOnEmptyTraversal('dedup', args),
- drop: (...args) => callOnEmptyTraversal('drop', args),
- element: (...args) => callOnEmptyTraversal('element', args),
- elementMap: (...args) => callOnEmptyTraversal('elementMap', args),
- emit: (...args) => callOnEmptyTraversal('emit', args),
- fail: (...args) => callOnEmptyTraversal('fail', args),
- filter: (...args) => callOnEmptyTraversal('filter', args),
- flatMap: (...args) => callOnEmptyTraversal('flatMap', args),
- fold: (...args) => callOnEmptyTraversal('fold', args),
- format: (...args) => callOnEmptyTraversal('format', args),
- group: (...args) => callOnEmptyTraversal('group', args),
- groupCount: (...args) => callOnEmptyTraversal('groupCount', args),
- has: (...args) => callOnEmptyTraversal('has', args),
- hasId: (...args) => callOnEmptyTraversal('hasId', args),
- hasKey: (...args) => callOnEmptyTraversal('hasKey', args),
- hasLabel: (...args) => callOnEmptyTraversal('hasLabel', args),
- hasNot: (...args) => callOnEmptyTraversal('hasNot', args),
- hasValue: (...args) => callOnEmptyTraversal('hasValue', args),
- id: (...args) => callOnEmptyTraversal('id', args),
- identity: (...args) => callOnEmptyTraversal('identity', args),
- in_: (...args) => callOnEmptyTraversal('in_', args),
- inE: (...args) => callOnEmptyTraversal('inE', args),
- inV: (...args) => callOnEmptyTraversal('inV', args),
- index: (...args) => callOnEmptyTraversal('index', args),
- inject: (...args) => callOnEmptyTraversal('inject', args),
- is: (...args) => callOnEmptyTraversal('is', args),
- key: (...args) => callOnEmptyTraversal('key', args),
- label: (...args) => callOnEmptyTraversal('label', args),
- length: (...args) => callOnEmptyTraversal('length', args),
- limit: (...args) => callOnEmptyTraversal('limit', args),
- local: (...args) => callOnEmptyTraversal('local', args),
- loops: (...args) => callOnEmptyTraversal('loops', args),
- lTrim: (...args) => callOnEmptyTraversal('lTrim', args),
- map: (...args) => callOnEmptyTraversal('map', args),
- match: (...args) => callOnEmptyTraversal('match', args),
- math: (...args) => callOnEmptyTraversal('math', args),
- max: (...args) => callOnEmptyTraversal('max', args),
- mean: (...args) => callOnEmptyTraversal('mean', args),
- mergeE: (...args) => callOnEmptyTraversal('mergeE', args),
- mergeV: (...args) => callOnEmptyTraversal('mergeV', args),
- min: (...args) => callOnEmptyTraversal('min', args),
- none: (...args) => callOnEmptyTraversal('none', args),
- not: (...args) => callOnEmptyTraversal('not', args),
- optional: (...args) => callOnEmptyTraversal('optional', args),
- or: (...args) => callOnEmptyTraversal('or', args),
- order: (...args) => callOnEmptyTraversal('order', args),
- otherV: (...args) => callOnEmptyTraversal('otherV', args),
- out: (...args) => callOnEmptyTraversal('out', args),
- outE: (...args) => callOnEmptyTraversal('outE', args),
- outV: (...args) => callOnEmptyTraversal('outV', args),
- path: (...args) => callOnEmptyTraversal('path', args),
- project: (...args) => callOnEmptyTraversal('project', args),
- properties: (...args) => callOnEmptyTraversal('properties', args),
- property: (...args) => callOnEmptyTraversal('property', args),
- propertyMap: (...args) => callOnEmptyTraversal('propertyMap', args),
- range: (...args) => callOnEmptyTraversal('range', args),
- repeat: (...args) => callOnEmptyTraversal('repeat', args),
- replace: (...args) => callOnEmptyTraversal('replace', args),
- reverse: (...args) => callOnEmptyTraversal('reverse', args),
- rTrim: (...args) => callOnEmptyTraversal('rTrim', args),
- sack: (...args) => callOnEmptyTraversal('sack', args),
- sample: (...args) => callOnEmptyTraversal('sample', args),
- select: (...args) => callOnEmptyTraversal('select', args),
- sideEffect: (...args) => callOnEmptyTraversal('sideEffect', args),
- simplePath: (...args) => callOnEmptyTraversal('simplePath', args),
- skip: (...args) => callOnEmptyTraversal('skip', args),
- split: (...args) => callOnEmptyTraversal('split', args),
- store: (...args) => callOnEmptyTraversal('store', args),
- subgraph: (...args) => callOnEmptyTraversal('subgraph', args),
- substring: (...args) => callOnEmptyTraversal('substring', args),
- sum: (...args) => callOnEmptyTraversal('sum', args),
- tail: (...args) => callOnEmptyTraversal('tail', args),
- timeLimit: (...args) => callOnEmptyTraversal('timeLimit', args),
- times: (...args) => callOnEmptyTraversal('times', args),
- to: (...args) => callOnEmptyTraversal('to', args),
- toE: (...args) => callOnEmptyTraversal('toE', args),
- toLower: (...args) => callOnEmptyTraversal('toLower', args),
- toUpper: (...args) => callOnEmptyTraversal('toUpper', args),
- toV: (...args) => callOnEmptyTraversal('toV', args),
- tree: (...args) => callOnEmptyTraversal('tree', args),
- trim: (...args) => callOnEmptyTraversal('trim', args),
- unfold: (...args) => callOnEmptyTraversal('unfold', args),
- union: (...args) => callOnEmptyTraversal('union', args),
- until: (...args) => callOnEmptyTraversal('until', args),
- value: (...args) => callOnEmptyTraversal('value', args),
- valueMap: (...args) => callOnEmptyTraversal('valueMap', args),
- values: (...args) => callOnEmptyTraversal('values', args),
- where: (...args) => callOnEmptyTraversal('where', args),
-};
-
-module.exports = {
- GraphTraversal,
- GraphTraversalSource,
- CardinalityValue,
- statics,
+export const statics = {
+ E: (...args: any[]) => callOnEmptyTraversal('E', args),
+ V: (...args: any[]) => callOnEmptyTraversal('V', args),
+ addE: (...args: any[]) => callOnEmptyTraversal('addE', args),
+ addV: (...args: any[]) => callOnEmptyTraversal('addV', args),
+ aggregate: (...args: any[]) => callOnEmptyTraversal('aggregate', args),
+ all: (...args: any[]) => callOnEmptyTraversal('all', args),
+ and: (...args: any[]) => callOnEmptyTraversal('and', args),
+ any: (...args: any[]) => callOnEmptyTraversal('any', args),
+ as: (...args: any[]) => callOnEmptyTraversal('as', args),
+ asDate: (...args: any[]) => callOnEmptyTraversal('asDate', args),
+ asString: (...args: any[]) => callOnEmptyTraversal('asString', args),
+ barrier: (...args: any[]) => callOnEmptyTraversal('barrier', args),
+ both: (...args: any[]) => callOnEmptyTraversal('both', args),
+ bothE: (...args: any[]) => callOnEmptyTraversal('bothE', args),
+ bothV: (...args: any[]) => callOnEmptyTraversal('bothV', args),
+ branch: (...args: any[]) => callOnEmptyTraversal('branch', args),
+ call: (...args: any[]) => callOnEmptyTraversal('call', args),
+ cap: (...args: any[]) => callOnEmptyTraversal('cap', args),
+ choose: (...args: any[]) => callOnEmptyTraversal('choose', args),
+ coalesce: (...args: any[]) => callOnEmptyTraversal('coalesce', args),
+ coin: (...args: any[]) => callOnEmptyTraversal('coin', args),
+ concat: (...args: any[]) => callOnEmptyTraversal('concat', args),
+ constant: (...args: any[]) => callOnEmptyTraversal('constant', args),
+ count: (...args: any[]) => callOnEmptyTraversal('count', args),
+ cyclicPath: (...args: any[]) => callOnEmptyTraversal('cyclicPath', args),
+ dateAdd: (...args: any[]) => callOnEmptyTraversal('dateAdd', args),
+ dateDiff: (...args: any[]) => callOnEmptyTraversal('dateDiff', args),
+ dedup: (...args: any[]) => callOnEmptyTraversal('dedup', args),
+ drop: (...args: any[]) => callOnEmptyTraversal('drop', args),
+ element: (...args: any[]) => callOnEmptyTraversal('element', args),
+ elementMap: (...args: any[]) => callOnEmptyTraversal('elementMap', args),
+ emit: (...args: any[]) => callOnEmptyTraversal('emit', args),
+ fail: (...args: any[]) => callOnEmptyTraversal('fail', args),
+ filter: (...args: any[]) => callOnEmptyTraversal('filter', args),
+ flatMap: (...args: any[]) => callOnEmptyTraversal('flatMap', args),
+ fold: (...args: any[]) => callOnEmptyTraversal('fold', args),
+ format: (...args: any[]) => callOnEmptyTraversal('format', args),
+ group: (...args: any[]) => callOnEmptyTraversal('group', args),
+ groupCount: (...args: any[]) => callOnEmptyTraversal('groupCount', args),
+ has: (...args: any[]) => callOnEmptyTraversal('has', args),
+ hasId: (...args: any[]) => callOnEmptyTraversal('hasId', args),
+ hasKey: (...args: any[]) => callOnEmptyTraversal('hasKey', args),
+ hasLabel: (...args: any[]) => callOnEmptyTraversal('hasLabel', args),
+ hasNot: (...args: any[]) => callOnEmptyTraversal('hasNot', args),
+ hasValue: (...args: any[]) => callOnEmptyTraversal('hasValue', args),
+ id: (...args: any[]) => callOnEmptyTraversal('id', args),
+ identity: (...args: any[]) => callOnEmptyTraversal('identity', args),
+ in_: (...args: any[]) => callOnEmptyTraversal('in_', args),
+ inE: (...args: any[]) => callOnEmptyTraversal('inE', args),
+ inV: (...args: any[]) => callOnEmptyTraversal('inV', args),
+ index: (...args: any[]) => callOnEmptyTraversal('index', args),
+ inject: (...args: any[]) => callOnEmptyTraversal('inject', args),
+ is: (...args: any[]) => callOnEmptyTraversal('is', args),
+ key: (...args: any[]) => callOnEmptyTraversal('key', args),
+ label: (...args: any[]) => callOnEmptyTraversal('label', args),
+ length: (...args: any[]) => callOnEmptyTraversal('length', args),
+ limit: (...args: any[]) => callOnEmptyTraversal('limit', args),
+ local: (...args: any[]) => callOnEmptyTraversal('local', args),
+ loops: (...args: any[]) => callOnEmptyTraversal('loops', args),
+ lTrim: (...args: any[]) => callOnEmptyTraversal('lTrim', args),
+ map: (...args: any[]) => callOnEmptyTraversal('map', args),
+ match: (...args: any[]) => callOnEmptyTraversal('match', args),
+ math: (...args: any[]) => callOnEmptyTraversal('math', args),
+ max: (...args: any[]) => callOnEmptyTraversal('max', args),
+ mean: (...args: any[]) => callOnEmptyTraversal('mean', args),
+ mergeE: (...args: any[]) => callOnEmptyTraversal('mergeE', args),
+ mergeV: (...args: any[]) => callOnEmptyTraversal('mergeV', args),
+ min: (...args: any[]) => callOnEmptyTraversal('min', args),
+ not: (...args: any[]) => callOnEmptyTraversal('not', args),
+ optional: (...args: any[]) => callOnEmptyTraversal('optional', args),
+ or: (...args: any[]) => callOnEmptyTraversal('or', args),
+ order: (...args: any[]) => callOnEmptyTraversal('order', args),
+ otherV: (...args: any[]) => callOnEmptyTraversal('otherV', args),
+ out: (...args: any[]) => callOnEmptyTraversal('out', args),
+ outE: (...args: any[]) => callOnEmptyTraversal('outE', args),
+ outV: (...args: any[]) => callOnEmptyTraversal('outV', args),
+ path: (...args: any[]) => callOnEmptyTraversal('path', args),
+ project: (...args: any[]) => callOnEmptyTraversal('project', args),
+ properties: (...args: any[]) => callOnEmptyTraversal('properties', args),
+ property: (...args: any[]) => callOnEmptyTraversal('property', args),
+ propertyMap: (...args: any[]) => callOnEmptyTraversal('propertyMap', args),
+ range: (...args: any[]) => callOnEmptyTraversal('range', args),
+ repeat: (...args: any[]) => callOnEmptyTraversal('repeat', args),
+ replace: (...args: any[]) => callOnEmptyTraversal('replace', args),
+ reverse: (...args: any[]) => callOnEmptyTraversal('reverse', args),
+ rTrim: (...args: any[]) => callOnEmptyTraversal('rTrim', args),
+ sack: (...args: any[]) => callOnEmptyTraversal('sack', args),
+ sample: (...args: any[]) => callOnEmptyTraversal('sample', args),
+ select: (...args: any[]) => callOnEmptyTraversal('select', args),
+ sideEffect: (...args: any[]) => callOnEmptyTraversal('sideEffect', args),
+ simplePath: (...args: any[]) => callOnEmptyTraversal('simplePath', args),
+ skip: (...args: any[]) => callOnEmptyTraversal('skip', args),
+ split: (...args: any[]) => callOnEmptyTraversal('split', args),
+ store: (...args: any[]) => callOnEmptyTraversal('store', args),
+ subgraph: (...args: any[]) => callOnEmptyTraversal('subgraph', args),
+ substring: (...args: any[]) => callOnEmptyTraversal('substring', args),
+ sum: (...args: any[]) => callOnEmptyTraversal('sum', args),
+ tail: (...args: any[]) => callOnEmptyTraversal('tail', args),
+ timeLimit: (...args: any[]) => callOnEmptyTraversal('timeLimit', args),
+ times: (...args: any[]) => callOnEmptyTraversal('times', args),
+ to: (...args: any[]) => callOnEmptyTraversal('to', args),
+ toE: (...args: any[]) => callOnEmptyTraversal('toE', args),
+ toLower: (...args: any[]) => callOnEmptyTraversal('toLower', args),
+ toUpper: (...args: any[]) => callOnEmptyTraversal('toUpper', args),
+ toV: (...args: any[]) => callOnEmptyTraversal('toV', args),
+ tree: (...args: any[]) => callOnEmptyTraversal('tree', args),
+ trim: (...args: any[]) => callOnEmptyTraversal('trim', args),
+ unfold: (...args: any[]) => callOnEmptyTraversal('unfold', args),
+ union: (...args: any[]) => callOnEmptyTraversal('union', args),
+ until: (...args: any[]) => callOnEmptyTraversal('until', args),
+ value: (...args: any[]) => callOnEmptyTraversal('value', args),
+ valueMap: (...args: any[]) => callOnEmptyTraversal('valueMap', args),
+ values: (...args: any[]) => callOnEmptyTraversal('values', args),
+ where: (...args: any[]) => callOnEmptyTraversal('where', args),
};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.ts
similarity index 70%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.ts
index a60e38ff40..55b6310f9b 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/transaction.ts
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
-const remote = require('../driver/remote-connection');
-const Bytecode = require('./bytecode');
-const { TraversalStrategies } = require('./traversal-strategy');
+import { RemoteConnection, RemoteStrategy } from '../driver/remote-connection.js';
+import Bytecode from './bytecode.js';
+import { GraphTraversalSource } from './graph-traversal.js';
+import { TraversalStrategies } from './traversal-strategy.js';
/**
* A controller for a remote transaction that is constructed from <code>g.tx()</code>. Calling <code>begin()</code>
@@ -28,37 +28,36 @@ const { TraversalStrategies } = require('./traversal-strategy');
* multiple traversals may be executed in that context. Calling <code>commit()</code> or <code>rollback()</code> will
* then close the transaction and thus, the session. This feature only works with transaction enabled graphs.
*/
-class Transaction {
- constructor(g) {
- this._g = g;
- this._sessionBasedConnection = undefined;
- }
+export class Transaction {
+ private _sessionBasedConnection?: RemoteConnection = undefined;
+
+ constructor(private readonly g: GraphTraversalSource) {}
/**
* Spawns a <code>GraphTraversalSource</code> that is bound to a remote session which enables a transaction.
- * @returns {*}
+ * @returns {GraphTraversalSource}
*/
- begin() {
+ begin(): GraphTraversalSource {
if (this._sessionBasedConnection) {
throw new Error('Transaction already started on this object');
}
- this._sessionBasedConnection = this._g.remoteConnection.createSession();
+ this._sessionBasedConnection = this.g.remoteConnection!.createSession();
const traversalStrategy = new TraversalStrategies();
- traversalStrategy.addStrategy(new remote.RemoteStrategy(this._sessionBasedConnection));
- return new this._g.graphTraversalSourceClass(
- this._g.graph,
+ traversalStrategy.addStrategy(new RemoteStrategy(this._sessionBasedConnection));
+ return new this.g.graphTraversalSourceClass(
+ this.g.graph,
traversalStrategy,
- new Bytecode(this._g.bytecode),
- this._g.graphTraversalSourceClass,
- this._g.graphTraversalClass,
+ new Bytecode(this.g.bytecode),
+ this.g.graphTraversalSourceClass,
+ this.g.graphTraversalClass,
);
}
/**
* @returns {Promise}
*/
- commit() {
+ commit(): Promise<void> {
if (!this._sessionBasedConnection) {
throw new Error('Cannot commit a transaction that is not started');
}
@@ -69,7 +68,7 @@ class Transaction {
/**
* @returns {Promise}
*/
- rollback() {
+ rollback(): Promise<void> {
if (!this._sessionBasedConnection) {
throw new Error('Cannot rollback a transaction that is not started');
}
@@ -81,20 +80,16 @@ class Transaction {
* Returns true if transaction is open.
* @returns {Boolean}
*/
- get isOpen() {
- return this._sessionBasedConnection.isOpen;
+ get isOpen(): boolean {
+ return this._sessionBasedConnection?.isOpen ?? false;
}
/**
* @returns {Promise}
*/
- close() {
+ async close(): Promise<void> {
if (this._sessionBasedConnection) {
this._sessionBasedConnection.close();
}
}
}
-
-module.exports = {
- Transaction,
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.ts
similarity index 87%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.ts
index bb6a5d0645..348bb114a1 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.ts
@@ -16,29 +16,26 @@
* specific language governing permissions and limitations
* under the License.
*/
-'use strict';
-const Traversal = require('./traversal').Traversal;
-const Bytecode = require('./bytecode');
+import { Traversal } from './traversal.js';
+import Bytecode from './bytecode.js';
/**
* Class to translate glv bytecode steps into executable Gremlin-Groovy script
*/
-class Translator {
- constructor(traversalSource) {
- this._traversalSource = traversalSource;
- }
+export default class Translator {
+ constructor(private traversalSource: string) {}
getTraversalSource() {
- return this._traversalSource;
+ return this.traversalSource;
}
getTargetLanguage() {
return 'gremlin-groovy';
}
- of(traversalSource) {
- this._traversalSource = traversalSource;
+ of(traversalSource: string) {
+ this.traversalSource = traversalSource;
}
/**
@@ -47,8 +44,8 @@ class Translator {
* @param {boolean} child Determines if a traversal object should be treated as an anonymous child or if it is a spawn from "g"
* @returns {string} Gremlin-Groovy script
*/
- translate(bytecodeOrTraversal, child = false) {
- let script = child ? '__' : this._traversalSource;
+ translate(bytecodeOrTraversal: Traversal | Bytecode, child: boolean = false): string {
+ let script = child ? '__' : this.traversalSource;
const bc = bytecodeOrTraversal instanceof Bytecode ? bytecodeOrTraversal : bytecodeOrTraversal.getBytecode();
const instructions = bc.stepInstructions;
@@ -79,7 +76,7 @@ class Translator {
* @param {Object} anyObject The object to convert to a script representation
* @returns {string} The Gremlin script representation
*/
- convert(anyObject) {
+ convert(anyObject: any): string {
let script = '';
if (Object(anyObject) === anyObject) {
if (anyObject instanceof Traversal) {
@@ -117,5 +114,3 @@ class Translator {
return script;
}
}
-
-module.exports = Translator;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.ts
similarity index 69%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.ts
index d041123497..68f094acf4 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.ts
@@ -20,17 +20,19 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const Traversal = require('./traversal').Traversal;
+import { RemoteConnection } from '../driver/remote-connection.js';
+import { Traversal } from './traversal.js';
+
+export class TraversalStrategies {
+ readonly strategies: TraversalStrategy[];
-class TraversalStrategies {
/**
* Creates a new instance of TraversalStrategies.
* @param {TraversalStrategies} [parent] The parent strategies from where to clone the values from.
* @constructor
*/
- constructor(parent) {
+ constructor(parent?: TraversalStrategies) {
if (parent) {
// Clone the strategies
this.strategies = [...parent.strategies];
@@ -40,12 +42,12 @@ class TraversalStrategies {
}
/** @param {TraversalStrategy} strategy */
- addStrategy(strategy) {
+ addStrategy(strategy: TraversalStrategy) {
this.strategies.push(strategy);
}
/** @param {TraversalStrategy} strategy */
- removeStrategy(strategy) {
+ removeStrategy(strategy: TraversalStrategy) {
const idx = this.strategies.findIndex((s) => s.fqcn === strategy.fqcn);
if (idx !== -1) {
return this.strategies.splice(idx, 1)[0];
@@ -58,7 +60,7 @@ class TraversalStrategies {
* @param {Traversal} traversal
* @returns {Promise}
*/
- applyStrategies(traversal) {
+ applyStrategies(traversal: Traversal) {
// Apply all strategies serially
return this.strategies.reduce(
(promise, strategy) => promise.then(() => strategy.apply(traversal)),
@@ -67,42 +69,45 @@ class TraversalStrategies {
}
}
-/** @abstract */
-class TraversalStrategy {
+export type TraversalStrategyConfiguration = any;
+
+export abstract class TraversalStrategy {
+ connection?: RemoteConnection;
+
/**
* @param {String} fqcn fully qualified class name in Java of the strategy
- * @param {Object} configuration for the strategy
+ * @param {TraversalStrategyConfiguration} configuration for the strategy
*/
- constructor(fqcn, configuration = {}) {
- this.fqcn = fqcn;
- this.configuration = configuration;
- }
+ constructor(
+ public fqcn: string,
+ public configuration: TraversalStrategyConfiguration = {},
+ ) {}
/**
* @abstract
* @param {Traversal} traversal
* @returns {Promise}
*/
- apply(traversal) {}
+ async apply(traversal: Traversal): Promise<void> {}
}
-class ConnectiveStrategy extends TraversalStrategy {
+export class ConnectiveStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy');
}
}
-class ElementIdStrategy extends TraversalStrategy {
+export class ElementIdStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy');
}
}
-class HaltedTraverserStrategy extends TraversalStrategy {
+export class HaltedTraverserStrategy extends TraversalStrategy {
/**
* @param {String} haltedTraverserFactory full qualified class name in Java of a {@code HaltedTraverserFactory} implementation
*/
- constructor(haltedTraverserFactory) {
+ constructor(haltedTraverserFactory: string) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy');
if (haltedTraverserFactory !== undefined) {
this.configuration['haltedTraverserFactory'] = haltedTraverserFactory;
@@ -110,13 +115,13 @@ class HaltedTraverserStrategy extends TraversalStrategy {
}
}
-class OptionsStrategy extends TraversalStrategy {
- constructor(options) {
+export class OptionsStrategy extends TraversalStrategy {
+ constructor(options: TraversalStrategyConfiguration) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy', options);
}
}
-class PartitionStrategy extends TraversalStrategy {
+export class PartitionStrategy extends TraversalStrategy {
/**
* @param {Object} [options]
* @param {String} [options.partitionKey] name of the property key to partition by
@@ -124,12 +129,12 @@ class PartitionStrategy extends TraversalStrategy {
* @param {Array<String>} [options.readPartitions] list of strings representing the partitions to include for reads
* @param {boolean} [options.includeMetaProperties] determines if meta-properties should be included in partitioning defaulting to false
*/
- constructor(options) {
+ constructor(options: TraversalStrategyConfiguration) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy', options);
}
}
-class SubgraphStrategy extends TraversalStrategy {
+export class SubgraphStrategy extends TraversalStrategy {
/**
* @param {Object} [options]
* @param {GraphTraversal} [options.vertices] name of the property key to partition by
@@ -137,7 +142,7 @@ class SubgraphStrategy extends TraversalStrategy {
* @param {GraphTraversal} [options.vertexProperties] list of strings representing the partitions to include for reads
* @param {boolean} [options.checkAdjacentVertices] enables the strategy to apply the {@code vertices} filter to the adjacent vertices of an edge.
*/
- constructor(options) {
+ constructor(options: TraversalStrategyConfiguration) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy', options);
if (this.configuration.vertices instanceof Traversal) {
this.configuration.vertices = this.configuration.vertices.bytecode;
@@ -151,27 +156,27 @@ class SubgraphStrategy extends TraversalStrategy {
}
}
-class ProductiveByStrategy extends TraversalStrategy {
+export class ProductiveByStrategy extends TraversalStrategy {
/**
* @param {Object} [options]
* @param {Array<String>} [options.productiveKeys] set of keys that will always be productive
*/
- constructor(options) {
+ constructor(options: TraversalStrategyConfiguration) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.ProductiveByStrategy', options);
}
}
-class VertexProgramStrategy extends TraversalStrategy {
- constructor(options) {
+export class VertexProgramStrategy extends TraversalStrategy {
+ constructor(options: TraversalStrategyConfiguration) {
super('org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy', options);
}
}
-class MatchAlgorithmStrategy extends TraversalStrategy {
+export class MatchAlgorithmStrategy extends TraversalStrategy {
/**
* @param matchAlgorithm
*/
- constructor(matchAlgorithm) {
+ constructor(matchAlgorithm: string) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy');
if (matchAlgorithm !== undefined) {
this.configuration['matchAlgorithm'] = matchAlgorithm;
@@ -179,103 +184,103 @@ class MatchAlgorithmStrategy extends TraversalStrategy {
}
}
-class AdjacentToIncidentStrategy extends TraversalStrategy {
+export class AdjacentToIncidentStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy');
}
}
-class FilterRankingStrategy extends TraversalStrategy {
+export class FilterRankingStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy');
}
}
-class IdentityRemovalStrategy extends TraversalStrategy {
+export class IdentityRemovalStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IdentityRemovalStrategy');
}
}
-class IncidentToAdjacentStrategy extends TraversalStrategy {
+export class IncidentToAdjacentStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy');
}
}
-class InlineFilterStrategy extends TraversalStrategy {
+export class InlineFilterStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy');
}
}
-class LazyBarrierStrategy extends TraversalStrategy {
+export class LazyBarrierStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy');
}
}
-class MatchPredicateStrategy extends TraversalStrategy {
+export class MatchPredicateStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.MatchPredicateStrategy');
}
}
-class OrderLimitStrategy extends TraversalStrategy {
+export class OrderLimitStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.OrderLimitStrategy');
}
}
-class PathProcessorStrategy extends TraversalStrategy {
+export class PathProcessorStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathProcessorStrategy');
}
}
-class PathRetractionStrategy extends TraversalStrategy {
+export class PathRetractionStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy');
}
}
-class CountStrategy extends TraversalStrategy {
+export class CountStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.CountStrategy');
}
}
-class RepeatUnrollStrategy extends TraversalStrategy {
+export class RepeatUnrollStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RepeatUnrollStrategy');
}
}
-class GraphFilterStrategy extends TraversalStrategy {
+export class GraphFilterStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.GraphFilterStrategy');
}
}
-class EarlyLimitStrategy extends TraversalStrategy {
+export class EarlyLimitStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.EarlyLimitStrategy');
}
}
-class LambdaRestrictionStrategy extends TraversalStrategy {
+export class LambdaRestrictionStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.LambdaRestrictionStrategy');
}
}
-class ReadOnlyStrategy extends TraversalStrategy {
+export class ReadOnlyStrategy extends TraversalStrategy {
constructor() {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy');
}
}
-class EdgeLabelVerificationStrategy extends TraversalStrategy {
+export class EdgeLabelVerificationStrategy extends TraversalStrategy {
/**
* @param {boolean} logWarnings determines if warnings should be written to the logger when verification fails
* @param {boolean} throwException determines if exceptions should be thrown when verifications fails
@@ -288,7 +293,7 @@ class EdgeLabelVerificationStrategy extends TraversalStrategy {
}
}
-class ReservedKeysVerificationStrategy extends TraversalStrategy {
+export class ReservedKeysVerificationStrategy extends TraversalStrategy {
/**
* @param {boolean} logWarnings determines if warnings should be written to the logger when verification fails
* @param {boolean} throwException determines if exceptions should be thrown when verifications fails
@@ -303,51 +308,16 @@ class ReservedKeysVerificationStrategy extends TraversalStrategy {
}
}
-class SeedStrategy extends TraversalStrategy {
+export type SeedStrategyOptions = { seed: number };
+
+export class SeedStrategy extends TraversalStrategy {
/**
- * @param {Object} [options]
+ * @param {SeedStrategyOptions} [options]
* @param {number} [options.seed] the seed to provide to the random number generator for the traversal
*/
- constructor(options) {
+ constructor(options: SeedStrategyOptions) {
super('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SeedStrategy', {
seed: options.seed,
});
}
}
-
-module.exports = {
- TraversalStrategies: TraversalStrategies,
- TraversalStrategy: TraversalStrategy,
- // decoration
- ConnectiveStrategy: ConnectiveStrategy,
- ElementIdStrategy: ElementIdStrategy,
- HaltedTraverserStrategy: HaltedTraverserStrategy,
- OptionsStrategy: OptionsStrategy,
- PartitionStrategy: PartitionStrategy,
- SeedStrategy: SeedStrategy,
- SubgraphStrategy: SubgraphStrategy,
- VertexProgramStrategy: VertexProgramStrategy,
- // finalization
- MatchAlgorithmStrategy: MatchAlgorithmStrategy,
- // optimization
- AdjacentToIncidentStrategy: AdjacentToIncidentStrategy,
- FilterRankingStrategy: FilterRankingStrategy,
- IdentityRemovalStrategy: IdentityRemovalStrategy,
- IncidentToAdjacentStrategy: IncidentToAdjacentStrategy,
- InlineFilterStrategy: InlineFilterStrategy,
- LazyBarrierStrategy: LazyBarrierStrategy,
- MatchPredicateStrategy: MatchPredicateStrategy,
- OrderLimitStrategy: OrderLimitStrategy,
- PathProcessorStrategy: PathProcessorStrategy,
- PathRetractionStrategy: PathRetractionStrategy,
- ProductiveByStrategy: ProductiveByStrategy,
- CountStrategy: CountStrategy,
- RepeatUnrollStrategy: RepeatUnrollStrategy,
- GraphFilterStrategy: GraphFilterStrategy,
- EarlyLimitStrategy: EarlyLimitStrategy,
- // verification
- EdgeLabelVerificationStrategy: EdgeLabelVerificationStrategy,
- LambdaRestrictionStrategy: LambdaRestrictionStrategy,
- ReadOnlyStrategy: ReadOnlyStrategy,
- ReservedKeysVerificationStrategy: ReservedKeysVerificationStrategy,
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.ts
similarity index 71%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.ts
index f925a72624..5aefc1d472 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.ts
@@ -21,22 +21,24 @@
* @author Jorge Bay Gondra
*/
-'use strict';
+import { Graph } from '../structure/graph.js';
+import Bytecode from './bytecode.js';
+import { TraversalStrategies } from './traversal-strategy.js';
const itemDone = Object.freeze({ value: null, done: true });
const asyncIteratorSymbol = Symbol.asyncIterator || Symbol('@@asyncIterator');
-class Traversal {
- constructor(graph, traversalStrategies, bytecode) {
- this.graph = graph;
- this.traversalStrategies = traversalStrategies;
- this.bytecode = bytecode;
- /** @type {Array<Traverser>} */
- this.traversers = null;
- this.sideEffects = null;
- this._traversalStrategiesPromise = null;
- this._traversersIteratorIndex = 0;
- }
+export class Traversal {
+ traversers: Traverser<any>[] | null = null;
+ sideEffects?: any = null;
+ private _traversalStrategiesPromise: Promise<void> | null = null;
+ private _traversersIteratorIndex = 0;
+
+ constructor(
+ public graph: Graph | null,
+ public traversalStrategies: TraversalStrategies | null,
+ public bytecode: Bytecode,
+ ) {}
/**
* Async iterable method implementation.
@@ -54,12 +56,12 @@ class Traversal {
* Returns an Array containing the traverser objects.
* @returns {Promise.<Array>}
*/
- toList() {
+ toList<T>(): Promise<T[]> {
return this._applyStrategies().then(() => {
- const result = [];
+ const result: T[] = [];
let it;
while ((it = this._getNext()) && !it.done) {
- result.push(it.value);
+ result.push(it.value as T);
}
return result;
});
@@ -98,15 +100,15 @@ class Traversal {
* Returns a promise containing an iterator item.
* @returns {Promise.<{value, done}>}
*/
- next() {
- return this._applyStrategies().then(() => this._getNext());
+ next<T>(): Promise<IteratorResult<T, null>> {
+ return this._applyStrategies().then(() => this._getNext<T>());
}
/**
* Synchronous iterator of traversers including
* @private
*/
- _getNext() {
+ _getNext<T>(): IteratorResult<T, null> {
while (this.traversers && this._traversersIteratorIndex < this.traversers.length) {
const traverser = this.traversers[this._traversersIteratorIndex];
if (traverser.bulk > 0) {
@@ -123,7 +125,7 @@ class Traversal {
// Apply strategies only once
return this._traversalStrategiesPromise;
}
- return (this._traversalStrategiesPromise = this.traversalStrategies.applyStrategies(this));
+ return (this._traversalStrategiesPromise = this.traversalStrategies?.applyStrategies(this) ?? Promise.resolve());
}
/**
@@ -143,7 +145,7 @@ class Traversal {
}
}
-class IO {
+export class IO {
static get graphml() {
return 'graphml';
}
@@ -237,23 +239,23 @@ class PeerPressure {
}
}
-class P {
+export class P<T1 = any, T2 = any> {
/**
* Represents an operation.
* @constructor
*/
- constructor(operator, value, other) {
- this.operator = operator;
- this.value = value;
- this.other = other;
- }
+ constructor(
+ public operator: string,
+ public value: T1,
+ public other: T2,
+ ) {}
/**
* Returns the string representation of the instance.
* @returns {string}
*/
toString() {
- function formatValue(value) {
+ function formatValue(value: T1 | T2): any {
if (Array.isArray(value)) {
const acc = [];
for (const item of value) {
@@ -273,22 +275,22 @@ class P {
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
}
- and(arg) {
+ and(arg?: any) {
return new P('and', this, arg);
}
- or(arg) {
+ or(arg?: any) {
return new P('or', this, arg);
}
- static within(...args) {
+ static within(...args: any[]) {
if (args.length === 1 && Array.isArray(args[0])) {
return new P('within', args[0], null);
}
return new P('within', args, null);
}
- static without(...args) {
+ static without(...args: any[]) {
if (args.length === 1 && Array.isArray(args[0])) {
return new P('without', args[0], null);
}
@@ -296,83 +298,83 @@ class P {
}
/** @param {...Object} args */
- static between(...args) {
+ static between(...args: any[]) {
return createP('between', args);
}
/** @param {...Object} args */
- static eq(...args) {
+ static eq(...args: any[]) {
return createP('eq', args);
}
/** @param {...Object} args */
- static gt(...args) {
+ static gt(...args: any[]) {
return createP('gt', args);
}
/** @param {...Object} args */
- static gte(...args) {
+ static gte(...args: any[]) {
return createP('gte', args);
}
/** @param {...Object} args */
- static inside(...args) {
+ static inside(...args: any[]) {
return createP('inside', args);
}
/** @param {...Object} args */
- static lt(...args) {
+ static lt(...args: any[]) {
return createP('lt', args);
}
/** @param {...Object} args */
- static lte(...args) {
+ static lte(...args: any[]) {
return createP('lte', args);
}
/** @param {...Object} args */
- static neq(...args) {
+ static neq(...args: any[]) {
return createP('neq', args);
}
/** @param {...Object} args */
- static not(...args) {
+ static not(...args: any[]) {
return createP('not', args);
}
/** @param {...Object} args */
- static outside(...args) {
+ static outside(...args: any[]) {
return createP('outside', args);
}
/** @param {...Object} args */
- static test(...args) {
+ static test(...args: any[]) {
return createP('test', args);
}
}
-function createP(operator, args) {
+function createP(operator: string, args: any) {
args.unshift(null, operator);
return new (Function.prototype.bind.apply(P, args))();
}
-class TextP {
+export class TextP<T1 = any, T2 = any> {
/**
* Represents an operation.
* @constructor
*/
- constructor(operator, value, other) {
- this.operator = operator;
- this.value = value;
- this.other = other;
- }
+ constructor(
+ public operator: string,
+ public value: T1,
+ public other: T2,
+ ) {}
/**
* Returns the string representation of the instance.
* @returns {string}
*/
toString() {
- function formatValue(value) {
+ function formatValue(value: any) {
if (value && typeof value === 'string') {
return `'${value}'`;
}
@@ -385,70 +387,72 @@ class TextP {
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
}
- and(arg) {
+ and(arg: any) {
return new P('and', this, arg);
}
- or(arg) {
+ or(arg: any) {
return new P('or', this, arg);
}
/** @param {...Object} args */
- static containing(...args) {
+ static containing(...args: any[]) {
return createTextP('containing', args);
}
/** @param {...Object} args */
- static endingWith(...args) {
+ static endingWith(...args: any[]) {
return createTextP('endingWith', args);
}
/** @param {...Object} args */
- static notContaining(...args) {
+ static notContaining(...args: any[]) {
return createTextP('notContaining', args);
}
/** @param {...Object} args */
- static notEndingWith(...args) {
+ static notEndingWith(...args: any[]) {
return createTextP('notEndingWith', args);
}
/** @param {...Object} args */
- static notStartingWith(...args) {
+ static notStartingWith(...args: any[]) {
return createTextP('notStartingWith', args);
}
/** @param {...Object} args */
- static startingWith(...args) {
+ static startingWith(...args: any[]) {
return createTextP('startingWith', args);
}
/** @param {...Object} args */
- static regex(...args) {
+ static regex(...args: any[]) {
return createTextP('regex', args);
}
/** @param {...Object} args */
- static notRegex(...args) {
+ static notRegex(...args: any[]) {
return createTextP('notRegex', args);
}
}
-function createTextP(operator, args) {
+function createTextP(operator: string, args: any) {
args.unshift(null, operator);
return new (Function.prototype.bind.apply(TextP, args))();
}
-class Traverser {
- constructor(object, bulk) {
- this.object = object;
+export class Traverser<T = any> {
+ constructor(
+ public object: T,
+ public bulk: number,
+ ) {
this.bulk = bulk || 1;
}
}
-class TraversalSideEffects {}
+export class TraversalSideEffects {}
-const withOptions = {
+export const withOptions = {
tokens: '~tinkerpop.valueMap.tokens',
none: 0,
ids: 1,
@@ -461,8 +465,8 @@ const withOptions = {
map: 1,
};
-function toEnum(typeName, keys) {
- const result = {};
+function toEnum(typeName: string, keys: string) {
+ const result: Record<string, EnumValue> = {};
keys.split(' ').forEach((k) => {
let jsKey = k;
if (jsKey === jsKey.toUpperCase()) {
@@ -476,49 +480,39 @@ function toEnum(typeName, keys) {
const directionAlias = {
from_: 'out',
to: 'in',
-};
+} as const;
// for direction enums, maps the same EnumValue object to the enum aliases after creating them
-function toDirectionEnum(typeName, keys) {
+function toDirectionEnum(typeName: string, keys: string) {
const result = toEnum(typeName, keys);
Object.keys(directionAlias).forEach((k) => {
- result[k] = result[directionAlias[k]];
+ result[k] = result[directionAlias[k as keyof typeof directionAlias]];
});
return result;
}
-class EnumValue {
- constructor(typeName, elementName) {
- this.typeName = typeName;
- this.elementName = elementName;
- }
+export class EnumValue {
+ constructor(
+ public typeName: string,
+ public elementName: string,
+ ) {}
toString() {
return this.elementName;
}
}
-module.exports = {
- EnumValue,
- P,
- TextP,
- withOptions,
- IO,
- Traversal,
- TraversalSideEffects,
- Traverser,
- barrier: toEnum('Barrier', 'normSack'),
- cardinality: toEnum('Cardinality', 'list set single'),
- column: toEnum('Column', 'keys values'),
- direction: toDirectionEnum('Direction', 'BOTH IN OUT from_ to'),
- dt: toEnum('DT', 'second minute hour day'),
- graphSONVersion: toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0'),
- gryoVersion: toEnum('GryoVersion', 'V1_0 V3_0'),
- merge: toEnum('Merge', 'onCreate onMatch outV inV'),
- operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
- order: toEnum('Order', 'asc desc shuffle'),
- pick: toEnum('Pick', 'any none'),
- pop: toEnum('Pop', 'all first last mixed'),
- scope: toEnum('Scope', 'global local'),
- t: toEnum('T', 'id key label value'),
-};
+export const barrier = toEnum('Barrier', 'normSack');
+export const cardinality = toEnum('Cardinality', 'list set single');
+export const column = toEnum('Column', 'keys values');
+export const direction = toDirectionEnum('Direction', 'BOTH IN OUT from_ to');
+export const dt = toEnum('DT', 'second minute hour day');
+export const graphSONVersion = toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0');
+export const gryoVersion = toEnum('GryoVersion', 'V1_0 V3_0');
+export const merge = toEnum('Merge', 'onCreate onMatch outV inV');
+export const operator = toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong');
+export const order = toEnum('Order', 'asc desc shuffle');
+export const pick = toEnum('Pick', 'any none');
+export const pop = toEnum('Pop', 'all first last mixed');
+export const scope = toEnum('Scope', 'global local');
+export const t = toEnum('T', 'id key label value');
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.ts
similarity index 70%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.ts
index 4171c3556e..bffb27a01e 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.ts
@@ -20,24 +20,22 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const gt = require('../process/graph-traversal');
-const { TraversalStrategies } = require('../process/traversal-strategy');
+import { GraphTraversalSource } from '../process/graph-traversal.js';
+import { TraversalStrategies } from '../process/traversal-strategy.js';
/**
* An "empty" graph object to server only as a reference.
*/
-class Graph {
+export class Graph {
/**
* Returns the graph traversal source.
* @param {Function} [traversalSourceClass] The constructor to use for the {@code GraphTraversalSource} instance.
* @returns {GraphTraversalSource}
* @deprecated As of release 3.3.5, replaced by the traversal() anonymous function.
*/
- traversal(traversalSourceClass) {
- const traversalSourceConstructor = traversalSourceClass || gt.GraphTraversalSource;
- return new traversalSourceConstructor(this, new TraversalStrategies());
+ traversal(TraversalSourceClass: typeof GraphTraversalSource = GraphTraversalSource) {
+ return new TraversalSourceClass(this, new TraversalStrategies());
}
toString() {
@@ -46,25 +44,28 @@ class Graph {
}
class Element {
- constructor(id, label) {
- this.id = id;
- this.label = label;
- }
+ constructor(
+ readonly id: string,
+ readonly label: string,
+ ) {}
/**
* Compares this instance to another and determines if they can be considered as equal.
* @param {Element} other
* @returns {boolean}
*/
- equals(other) {
+ equals(other: any) {
return other instanceof Element && this.id === other.id;
}
}
-class Vertex extends Element {
- constructor(id, label, properties) {
+export class Vertex<T extends Record<string, any> = Record<string, any>> extends Element {
+ constructor(
+ id: string,
+ label: string,
+ readonly properties?: T,
+ ) {
super(id, label);
- this.properties = properties;
}
toString() {
@@ -72,17 +73,20 @@ class Vertex extends Element {
}
}
-class Edge extends Element {
- constructor(id, outV, label, inV, properties) {
+export class Edge<T extends Record<string, any> = Record<string, any>> extends Element {
+ constructor(
+ id: string,
+ readonly outV: Element,
+ label: string,
+ readonly inV: Element,
+ readonly properties: T = {} as T,
+ ) {
super(id, label);
- this.outV = outV;
- this.inV = inV;
- this.properties = {};
if (properties) {
const keys = Object.keys(properties);
for (let i = 0; i < keys.length; i++) {
const k = keys[i];
- this.properties[k] = properties[k].value;
+ this.properties[k as keyof T] = properties[k].value;
}
}
}
@@ -95,8 +99,15 @@ class Edge extends Element {
}
}
-class VertexProperty extends Element {
- constructor(id, label, value, properties) {
+export class VertexProperty<T1 = any, T2 = any> extends Element {
+ readonly key: string;
+
+ constructor(
+ id: string,
+ label: string,
+ readonly value: T1,
+ readonly properties: T2,
+ ) {
super(id, label);
this.value = value;
this.key = this.label;
@@ -108,38 +119,38 @@ class VertexProperty extends Element {
}
}
-class Property {
- constructor(key, value) {
- this.key = key;
- this.value = value;
- }
+export class Property<T = any> {
+ constructor(
+ readonly key: string,
+ readonly value: T,
+ ) {}
toString() {
return `p[${this.key}->${summarize(this.value)}]`;
}
- equals(other) {
+ equals(other: any) {
return other instanceof Property && this.key === other.key && this.value === other.value;
}
}
-class Path {
+export class Path {
/**
* Represents a walk through a graph as defined by a traversal.
* @param {Array} labels
* @param {Array} objects
* @constructor
*/
- constructor(labels, objects) {
- this.labels = labels;
- this.objects = objects;
- }
+ constructor(
+ readonly labels: string[],
+ readonly objects: any[],
+ ) {}
toString() {
return `path[${(this.objects || []).join(', ')}]`;
}
- equals(other) {
+ equals(other: any) {
if (!(other instanceof Path)) {
return false;
}
@@ -150,7 +161,7 @@ class Path {
}
}
-function areEqual(obj1, obj2) {
+function areEqual(obj1: any, obj2: any) {
if (obj1 === obj2) {
return true;
}
@@ -171,7 +182,7 @@ function areEqual(obj1, obj2) {
return false;
}
-function summarize(value) {
+function summarize(value: any) {
if (value === null || value === undefined) {
return value;
}
@@ -179,12 +190,3 @@ function summarize(value) {
const strValue = value.toString();
return strValue.length > 20 ? strValue.substr(0, 20) : strValue;
}
-
-module.exports = {
- Edge,
- Graph,
- Path,
- Property,
- Vertex,
- VertexProperty,
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/GraphBinary.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/GraphBinary.js
index 20bc42db02..4b8bafacad 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/GraphBinary.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/GraphBinary.js
@@ -58,52 +58,130 @@
* @author Igor Ostapenko
*/
/*eslint-disable*/
-'use strict';
+
+import DataType from './internals/DataType.js';
+import * as utils from './internals/utils.js';
+import IntSerializer from './internals/IntSerializer.js';
+import LongSerializer from './internals/LongSerializer.js';
+import LongSerializerNg from './internals/LongSerializerNg.js';
+import StringSerializer from './internals/StringSerializer.js';
+import DateSerializer from './internals/DateSerializer.js';
+import DoubleSerializer from './internals/DoubleSerializer.js';
+import FloatSerializer from './internals/FloatSerializer.js';
+import ArraySerializer from './internals/ArraySerializer.js';
+import MapSerializer from './internals/MapSerializer.js';
+import SetSerializer from './internals/SetSerializer.js';
+import UuidSerializer from './internals/UuidSerializer.js';
+import EdgeSerializer from './internals/EdgeSerializer.js';
+import PathSerializer from './internals/PathSerializer.js';
+import PropertySerializer from './internals/PropertySerializer.js';
+import VertexSerializer from './internals/VertexSerializer.js';
+import VertexPropertySerializer from './internals/VertexPropertySerializer.js';
+import BytecodeSerializer from './internals/BytecodeSerializer.js';
+import PSerializer from './internals/PSerializer.js';
+import TraverserSerializer from './internals/TraverserSerializer.js';
+import EnumSerializer from './internals/EnumSerializer.js';
+import LambdaSerializer from './internals/LambdaSerializer.js';
+import BigIntegerSerializer from './internals/BigIntegerSerializer.js';
+import ByteSerializer from './internals/ByteSerializer.js';
+import ByteBufferSerializer from './internals/ByteBufferSerializer.js';
+import ShortSerializer from './internals/ShortSerializer.js';
+import BooleanSerializer from './internals/BooleanSerializer.js';
+import TextPSerializer from './internals/TextPSerializer.js';
+import TraversalStrategySerializer from './internals/TraversalStrategySerializer.js';
+import BulkSetSerializer from './internals/BulkSetSerializer.js';
+import UnspecifiedNullSerializer from './internals/UnspecifiedNullSerializer.js';
+import NumberSerializationStrategy from './internals/NumberSerializationStrategy.js';
+import AnySerializer from './internals/AnySerializer.js';
+import GraphBinaryReader from './internals/GraphBinaryReader.js';
+import GraphBinaryWriter from './internals/GraphBinaryWriter.js';
const ioc = {};
-ioc.DataType = require('./internals/DataType');
-ioc.utils = require('./internals/utils');
+ioc.DataType = DataType;
+ioc.utils = utils;
ioc.serializers = {};
-ioc.intSerializer = new (require('./internals/IntSerializer'))(ioc);
-ioc.longSerializer = new (require('./internals/LongSerializer'))(ioc);
-ioc.longSerializerNg = new (require('./internals/LongSerializerNg'))(ioc);
-ioc.stringSerializer = new (require('./internals/StringSerializer'))(ioc, ioc.DataType.STRING);
-ioc.dateSerializer = new (require('./internals/DateSerializer'))(ioc, ioc.DataType.DATE);
-ioc.timestampSerializer = new (require('./internals/DateSerializer'))(ioc, ioc.DataType.TIMESTAMP);
-ioc.classSerializer = new (require('./internals/StringSerializer'))(ioc, ioc.DataType.CLASS);
-ioc.doubleSerializer = new (require('./internals/DoubleSerializer'))(ioc);
-ioc.floatSerializer = new (require('./internals/FloatSerializer'))(ioc);
-ioc.listSerializer = new (require('./internals/ArraySerializer'))(ioc, ioc.DataType.LIST);
-ioc.mapSerializer = new (require('./internals/MapSerializer'))(ioc);
-ioc.setSerializer = new (require('./internals/SetSerializer'))(ioc, ioc.DataType.SET);
-ioc.uuidSerializer = new (require('./internals/UuidSerializer'))(ioc);
-ioc.edgeSerializer = new (require('./internals/EdgeSerializer'))(ioc);
-ioc.pathSerializer = new (require('./internals/PathSerializer'))(ioc);
-ioc.propertySerializer = new (require('./internals/PropertySerializer'))(ioc);
-ioc.vertexSerializer = new (require('./internals/VertexSerializer'))(ioc);
-ioc.vertexPropertySerializer = new (require('./internals/VertexPropertySerializer'))(ioc);
-ioc.bytecodeSerializer = new (require('./internals/BytecodeSerializer'))(ioc);
-ioc.pSerializer = new (require('./internals/PSerializer'))(ioc);
-ioc.traverserSerializer = new (require('./internals/TraverserSerializer'))(ioc);
-ioc.enumSerializer = new (require('./internals/EnumSerializer'))(ioc);
-ioc.lambdaSerializer = new (require('./internals/LambdaSerializer'))(ioc);
-ioc.bigIntegerSerializer = new (require('./internals/BigIntegerSerializer'))(ioc);
-ioc.byteSerializer = new (require('./internals/ByteSerializer'))(ioc);
-ioc.byteBufferSerializer = new (require('./internals/ByteBufferSerializer'))(ioc);
-ioc.shortSerializer = new (require('./internals/ShortSerializer'))(ioc);
-ioc.booleanSerializer = new (require('./internals/BooleanSerializer'))(ioc);
-ioc.textPSerializer = new (require('./internals/TextPSerializer'))(ioc);
-ioc.traversalStrategySerializer = new (require('./internals/TraversalStrategySerializer'))(ioc);
-ioc.bulkSetSerializer = new (require('./internals/BulkSetSerializer'))(ioc);
-ioc.unspecifiedNullSerializer = new (require('./internals/UnspecifiedNullSerializer'))(ioc);
+ioc.intSerializer = new IntSerializer(ioc);
+ioc.longSerializer = new LongSerializer(ioc);
+ioc.longSerializerNg = new LongSerializerNg(ioc);
+ioc.stringSerializer = new StringSerializer(ioc, ioc.DataType.STRING);
+ioc.dateSerializer = new DateSerializer(ioc, ioc.DataType.DATE);
+ioc.timestampSerializer = new DateSerializer(ioc, ioc.DataType.TIMESTAMP);
+ioc.classSerializer = new StringSerializer(ioc, ioc.DataType.CLASS);
+ioc.doubleSerializer = new DoubleSerializer(ioc);
+ioc.floatSerializer = new FloatSerializer(ioc);
+ioc.listSerializer = new ArraySerializer(ioc, ioc.DataType.LIST);
+ioc.mapSerializer = new MapSerializer(ioc);
+ioc.setSerializer = new SetSerializer(ioc, ioc.DataType.SET);
+ioc.uuidSerializer = new UuidSerializer(ioc);
+ioc.edgeSerializer = new EdgeSerializer(ioc);
+ioc.pathSerializer = new PathSerializer(ioc);
+ioc.propertySerializer = new PropertySerializer(ioc);
+ioc.vertexSerializer = new VertexSerializer(ioc);
+ioc.vertexPropertySerializer = new VertexPropertySerializer(ioc);
+ioc.bytecodeSerializer = new BytecodeSerializer(ioc);
+ioc.pSerializer = new PSerializer(ioc);
+ioc.traverserSerializer = new TraverserSerializer(ioc);
+ioc.enumSerializer = new EnumSerializer(ioc);
+ioc.lambdaSerializer = new LambdaSerializer(ioc);
+ioc.bigIntegerSerializer = new BigIntegerSerializer(ioc);
+ioc.byteSerializer = new ByteSerializer(ioc);
+ioc.byteBufferSerializer = new ByteBufferSerializer(ioc);
+ioc.shortSerializer = new ShortSerializer(ioc);
+ioc.booleanSerializer = new BooleanSerializer(ioc);
+ioc.textPSerializer = new TextPSerializer(ioc);
+ioc.traversalStrategySerializer = new TraversalStrategySerializer(ioc);
+ioc.bulkSetSerializer = new BulkSetSerializer(ioc);
+ioc.unspecifiedNullSerializer = new UnspecifiedNullSerializer(ioc);
+
+ioc.numberSerializationStrategy = new NumberSerializationStrategy(ioc);
+ioc.anySerializer = new AnySerializer(ioc);
+
+ioc.graphBinaryReader = new GraphBinaryReader(ioc);
+ioc.graphBinaryWriter = new GraphBinaryWriter(ioc);
-ioc.numberSerializationStrategy = new (require('./internals/NumberSerializationStrategy'))(ioc);
-ioc.anySerializer = new (require('./internals/AnySerializer'))(ioc);
+export { default as DataType } from './internals/DataType.js';
-ioc.graphBinaryReader = new (require('./internals/GraphBinaryReader.js'))(ioc);
-ioc.graphBinaryWriter = new (require('./internals/GraphBinaryWriter'))(ioc);
+export const {
+ serializers,
+ intSerializer,
+ longSerializer,
+ longSerializerNg,
+ stringSerializer,
+ dateSerializer,
+ timestampSerializer,
+ classSerializer,
+ doubleSerializer,
+ floatSerializer,
+ listSerializer,
+ mapSerializer,
+ setSerializer,
+ uuidSerializer,
+ edgeSerializer,
+ pathSerializer,
+ propertySerializer,
+ vertexSerializer,
+ vertexPropertySerializer,
+ bytecodeSerializer,
+ pSerializer,
+ traverserSerializer,
+ enumSerializer,
+ lambdaSerializer,
+ bigIntegerSerializer,
+ byteSerializer,
+ byteBufferSerializer,
+ shortSerializer,
+ booleanSerializer,
+ textPSerializer,
+ traversalStrategySerializer,
+ bulkSetSerializer,
+ unspecifiedNullSerializer,
+ numberSerializationStrategy,
+ anySerializer,
+ graphBinaryReader,
+ graphBinaryWriter,
+} = ioc;
-module.exports = ioc;
+export default ioc;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/AnySerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/AnySerializer.js
index 0b0e2d0735..d506651e58 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/AnySerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/AnySerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class AnySerializer {
+export default class AnySerializer {
constructor(ioc) {
this.ioc = ioc;
@@ -94,4 +93,4 @@ module.exports = class AnySerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ArraySerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ArraySerializer.js
index 77aabd4cec..abfe28f859 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ArraySerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ArraySerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class ArraySerializer {
+export default class ArraySerializer {
constructor(ioc, ID) {
this.ioc = ioc;
this.ID = ID;
@@ -134,4 +133,4 @@ module.exports = class ArraySerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BigIntegerSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BigIntegerSerializer.js
index 48e6e8c0a2..436f02a95b 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BigIntegerSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BigIntegerSerializer.js
@@ -20,12 +20,11 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
// TODO: it has room for performance improvements
-module.exports = class BigIntegerSerializer {
+export default class BigIntegerSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BIGINTEGER] = this;
@@ -150,4 +149,4 @@ module.exports = class BigIntegerSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BooleanSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BooleanSerializer.js
index bbdf9fcfdd..5dc38f3910 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BooleanSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BooleanSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class BooleanSerializer {
+export default class BooleanSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BOOLEAN] = this;
@@ -102,4 +101,4 @@ module.exports = class BooleanSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BulkSetSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BulkSetSerializer.js
index 518caa22d3..89209392f8 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BulkSetSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BulkSetSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class BulkSetSerializer {
+export default class BulkSetSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BULKSET] = this;
@@ -123,4 +122,4 @@ module.exports = class BulkSetSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteBufferSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteBufferSerializer.js
index 080edefb64..358aa07604 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteBufferSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteBufferSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class ByteBufferSerializer {
+export default class ByteBufferSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BYTEBUFFER] = this;
@@ -123,4 +122,4 @@ module.exports = class ByteBufferSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteSerializer.js
index ed5e622b17..f704c09cba 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ByteSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class ByteSerializer {
+export default class ByteSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BYTE] = this;
@@ -94,4 +93,4 @@ module.exports = class ByteSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BytecodeSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BytecodeSerializer.js
index e458f55174..a2c0d74b21 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BytecodeSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/BytecodeSerializer.js
@@ -20,20 +20,19 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const Bytecode = require('../../../../process/bytecode');
-const t = require('../../../../process/traversal');
+import { Buffer } from 'buffer';
+import Bytecode from '../../../../process/bytecode.js';
+import { Traversal } from '../../../../process/traversal.js';
-module.exports = class BytecodeSerializer {
+export default class BytecodeSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.BYTECODE] = this;
}
canBeUsedFor(value) {
- return value instanceof Bytecode || value instanceof t.Traversal;
+ return value instanceof Bytecode || value instanceof Traversal;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -46,7 +45,7 @@ module.exports = class BytecodeSerializer {
return Buffer.from([...steps_length, ...sources_length]);
}
- if (item instanceof t.Traversal) {
+ if (item instanceof Traversal) {
item = item.getBytecode();
}
@@ -247,4 +246,4 @@ module.exports = class BytecodeSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DataType.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DataType.js
index 272a848d87..b0524b9f0c 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DataType.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DataType.js
@@ -20,7 +20,6 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
/**
* Represents a GraphBinary data type.
@@ -96,4 +95,4 @@ const DataType = {
UNSPECIFIED_NULL: 0xfe,
};
-module.exports = DataType;
+export default DataType;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DateSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DateSerializer.js
index a7f3dc8907..076e2d5de7 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DateSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DateSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class DateSerializer {
+export default class DateSerializer {
constructor(ioc, ID) {
this.ioc = ioc;
this.ID = ID;
@@ -102,4 +101,4 @@ module.exports = class DateSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DoubleSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DoubleSerializer.js
index bd0c65c169..4e7019e12a 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DoubleSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/DoubleSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class DoubleSerializer {
+export default class DoubleSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.DOUBLE] = this;
@@ -98,4 +97,4 @@ module.exports = class DoubleSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EdgeSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EdgeSerializer.js
index f755f1d3eb..d93cbfdc10 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EdgeSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EdgeSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const g = require('../../../graph');
+import { Buffer } from 'buffer';
+import { Edge, Vertex } from '../../../graph.js';
-module.exports = class EdgeSerializer {
+export default class EdgeSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.EDGE] = this;
}
canBeUsedFor(value) {
- return value instanceof g.Edge;
+ return value instanceof Edge;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -201,16 +200,10 @@ module.exports = class EdgeSerializer {
}
cursor = cursor.slice(properties_len);
- const v = new g.Edge(
- id,
- new g.Vertex(outVId, outVLabel, null),
- label,
- new g.Vertex(inVId, inVLabel, null),
- properties,
- );
+ const v = new Edge(id, new Vertex(outVId, outVLabel, null), label, new Vertex(inVId, inVLabel, null), properties);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EnumSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EnumSerializer.js
index 03627772da..b00ced08de 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EnumSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/EnumSerializer.js
@@ -20,12 +20,25 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const t = require('../../../../process/traversal');
-
-module.exports = class EnumSerializer {
+import { Buffer } from 'buffer';
+import {
+ barrier,
+ cardinality,
+ column,
+ direction,
+ dt,
+ merge,
+ operator,
+ order,
+ pick,
+ pop,
+ scope,
+ t as _t,
+ EnumValue,
+} from '../../../../process/traversal.js';
+
+export default class EnumSerializer {
constructor(ioc) {
this.ioc = ioc;
@@ -38,18 +51,18 @@ module.exports = class EnumSerializer {
};
const DT = ioc.DataType;
this.types = [
- { name: 'Barrier', code: DT.BARRIER, enum: to_orig_enum(t.barrier) },
- { name: 'Cardinality', code: DT.CARDINALITY, enum: to_orig_enum(t.cardinality) },
- { name: 'Column', code: DT.COLUMN, enum: to_orig_enum(t.column) },
- { name: 'Direction', code: DT.DIRECTION, enum: to_orig_enum(t.direction) },
- { name: 'DT', code: DT.DT, enum: to_orig_enum(t.dt) },
- { name: 'Merge', code: DT.MERGE, enum: to_orig_enum(t.merge) },
- { name: 'Operator', code: DT.OPERATOR, enum: to_orig_enum(t.operator) },
- { name: 'Order', code: DT.ORDER, enum: to_orig_enum(t.order) },
- { name: 'Pick', code: DT.PICK, enum: to_orig_enum(t.pick) },
- { name: 'Pop', code: DT.POP, enum: to_orig_enum(t.pop) },
- { name: 'Scope', code: DT.SCOPE, enum: to_orig_enum(t.scope) },
- { name: 'T', code: DT.T, enum: to_orig_enum(t.t) },
+ { name: 'Barrier', code: DT.BARRIER, enum: to_orig_enum(barrier) },
+ { name: 'Cardinality', code: DT.CARDINALITY, enum: to_orig_enum(cardinality) },
+ { name: 'Column', code: DT.COLUMN, enum: to_orig_enum(column) },
+ { name: 'Direction', code: DT.DIRECTION, enum: to_orig_enum(direction) },
+ { name: 'DT', code: DT.DT, enum: to_orig_enum(dt) },
+ { name: 'Merge', code: DT.MERGE, enum: to_orig_enum(merge) },
+ { name: 'Operator', code: DT.OPERATOR, enum: to_orig_enum(operator) },
+ { name: 'Order', code: DT.ORDER, enum: to_orig_enum(order) },
+ { name: 'Pick', code: DT.PICK, enum: to_orig_enum(pick) },
+ { name: 'Pop', code: DT.POP, enum: to_orig_enum(pop) },
+ { name: 'Scope', code: DT.SCOPE, enum: to_orig_enum(scope) },
+ { name: 'T', code: DT.T, enum: to_orig_enum(_t) },
];
this.byname = {};
this.bycode = {};
@@ -61,7 +74,7 @@ module.exports = class EnumSerializer {
}
canBeUsedFor(value) {
- if (!(value instanceof t.EnumValue)) {
+ if (!(value instanceof EnumValue)) {
return false;
}
if (!this.byname[value.typeName]) {
@@ -138,7 +151,7 @@ module.exports = class EnumSerializer {
let v;
if (!type) {
- v = new t.EnumValue(undefined, elementName);
+ v = new EnumValue(undefined, elementName);
} else {
v = type.enum[elementName]; // users are expected to work with maps like Map.get(T.id), i.e. it must be exactly the same object
}
@@ -148,4 +161,4 @@ module.exports = class EnumSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/FloatSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/FloatSerializer.js
index c0febcbda9..62ba0cd94b 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/FloatSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/FloatSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class FloatSerializer {
+export default class FloatSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.FLOAT] = this;
@@ -98,4 +97,4 @@ module.exports = class FloatSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryReader.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryReader.js
index 21d9f2b549..deca362305 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryReader.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryReader.js
@@ -20,14 +20,13 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
/**
* GraphBinary reader.
*/
-module.exports = class GraphBinaryReader {
+export default class GraphBinaryReader {
constructor(ioc) {
this.ioc = ioc;
}
@@ -79,4 +78,4 @@ module.exports = class GraphBinaryReader {
return response;
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryWriter.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryWriter.js
index 7440ba00f2..d69640b3f3 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryWriter.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/GraphBinaryWriter.js
@@ -20,14 +20,13 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
/**
* GraphBinary writer.
*/
-module.exports = class GraphBinaryWriter {
+export default class GraphBinaryWriter {
constructor(ioc) {
this.ioc = ioc;
}
@@ -82,4 +81,4 @@ module.exports = class GraphBinaryWriter {
0x00,0x00,0x00,0x00,
*/
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/IntSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/IntSerializer.js
index ddd32f4b2a..49a0aed2d9 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/IntSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/IntSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class IntSerializer {
+export default class IntSerializer {
get INT32_MIN() {
return -2147483648;
}
@@ -111,4 +110,4 @@ module.exports = class IntSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LambdaSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LambdaSerializer.js
index 292b7efdca..1e87a9c818 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LambdaSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LambdaSerializer.js
@@ -20,12 +20,11 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const { valueKey, LambdaSerializer: GraphsonLambdaSerializer } = require('../../type-serializers');
+import { Buffer } from 'buffer';
+import { valueKey, LambdaSerializer as GraphsonLambdaSerializer } from '../../type-serializers.js';
-module.exports = class LambdaSerializer {
+export default class LambdaSerializer {
constructor(ioc) {
this.ioc = ioc;
// this.ioc.serializers[ioc.DataType.LAMBDA] = this; // it's not expected to be deserialized
@@ -68,4 +67,4 @@ module.exports = class LambdaSerializer {
return Buffer.concat(bufs);
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializer.js
index c5f45fe289..823a312f0b 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class LongSerializer {
+export default class LongSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.LONG] = this;
@@ -106,4 +105,4 @@ module.exports = class LongSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializerNg.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializerNg.js
index e23fe5b80f..fbbde85aac 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializerNg.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/LongSerializerNg.js
@@ -20,14 +20,13 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
// TODO: it's based on BigInt native JavaScript type to completely support
// 64 bits integers, but for backward compatibility with current GraphSON
// implementation we do not use this for now. Consider its removal.
-module.exports = class LongSerializerNg {
+export default class LongSerializerNg {
constructor(ioc) {
this.ioc = ioc;
// this.ioc.serializers[ioc.DataType.LONG] = this; // disabled, see AnySerializer.deserialize()
@@ -101,4 +100,4 @@ module.exports = class LongSerializerNg {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/MapSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/MapSerializer.js
index 62e952cf87..9bed8d462f 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/MapSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/MapSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class MapSerializer {
+export default class MapSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.MAP] = this;
@@ -152,4 +151,4 @@ module.exports = class MapSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/NumberSerializationStrategy.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/NumberSerializationStrategy.js
index 0a00a74501..82ab7e63cc 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/NumberSerializationStrategy.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/NumberSerializationStrategy.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
// Based on GraphSON NumberSerializer.serialize().
// It's tested by AnySerializer.serialize() tests.
-module.exports = class NumberSerializationStrategy {
+export default class NumberSerializationStrategy {
constructor(ioc) {
this.ioc = ioc;
}
@@ -65,4 +64,4 @@ module.exports = class NumberSerializationStrategy {
return this.ioc.bigIntegerSerializer.serialize(item, fullyQualifiedFormat);
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PSerializer.js
index 046f0349dc..58260329e3 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const t = require('../../../../process/traversal');
+import { Buffer } from 'buffer';
+import { P } from '../../../../process/traversal.js';
-module.exports = class PSerializer {
+export default class PSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.P] = this;
}
canBeUsedFor(value) {
- return value instanceof t.P;
+ return value instanceof P;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -133,15 +132,15 @@ module.exports = class PSerializer {
cursor = cursor.slice(values_len);
if (values.length < 1) {
- return { v: new t.P(''), len };
+ return { v: new P(''), len };
}
let v;
- const P_static = t.P[name];
+ const P_static = P[name];
if (typeof P_static === 'function') {
v = P_static(...values); // it's better to follow existing logic which may depend on an operator name
} else {
- v = new t.P(name, ...values);
+ v = new P(name, ...values);
}
return { v, len };
@@ -149,4 +148,4 @@ module.exports = class PSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PathSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PathSerializer.js
index 8b3aeff8f0..11530d6057 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PathSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PathSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const g = require('../../../graph');
+import { Buffer } from 'buffer';
+import { Path } from '../../../graph.js';
-module.exports = class PathSerializer {
+export default class PathSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.PATH] = this;
}
canBeUsedFor(value) {
- return value instanceof g.Path;
+ return value instanceof Path;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -115,10 +114,10 @@ module.exports = class PathSerializer {
}
cursor = cursor.slice(objects_len);
- const v = new g.Path(labels, objects);
+ const v = new Path(labels, objects);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PropertySerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PropertySerializer.js
index 9738d85c0b..dd63941e8f 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PropertySerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/PropertySerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const g = require('../../../graph');
+import { Buffer } from 'buffer';
+import { Property } from '../../../graph.js';
-module.exports = class PropertySerializer {
+export default class PropertySerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.PROPERTY] = this;
}
canBeUsedFor(value) {
- return value instanceof g.Property;
+ return value instanceof Property;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -133,10 +132,10 @@ module.exports = class PropertySerializer {
// TODO: should we verify that parent is null?
cursor = cursor.slice(parent_len);
- const v = new g.Property(key, value);
+ const v = new Property(key, value);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/SetSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/SetSerializer.js
index 221a77a978..5a31fc928c 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/SetSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/SetSerializer.js
@@ -20,10 +20,9 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-module.exports = class SetSerializer {
+import { Buffer } from 'buffer';
+export default class SetSerializer {
constructor(ioc, ID) {
this.ioc = ioc;
this.ID = ID;
@@ -104,4 +103,4 @@ module.exports = class SetSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ShortSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ShortSerializer.js
index f5dda2f033..497378fef9 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ShortSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/ShortSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class ShortSerializer {
+export default class ShortSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.SHORT] = this;
@@ -98,4 +97,4 @@ module.exports = class ShortSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/StringSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/StringSerializer.js
index 17ea06defe..49349c28ac 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/StringSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/StringSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class StringSerializer {
+export default class StringSerializer {
constructor(ioc, ID) {
this.ioc = ioc;
this.ID = ID;
@@ -113,4 +112,4 @@ module.exports = class StringSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TextPSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TextPSerializer.js
index a78c1abd54..61acd103dd 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TextPSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TextPSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const t = require('../../../../process/traversal');
+import { Buffer } from 'buffer';
+import { TextP } from '../../../../process/traversal.js';
-module.exports = class TextPSerializer {
+export default class TextPSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.TEXTP] = this;
}
canBeUsedFor(value) {
- return value instanceof t.TextP;
+ return value instanceof TextP;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -127,15 +126,15 @@ module.exports = class TextPSerializer {
cursor = cursor.slice(values_len);
if (values.length < 1) {
- return { v: new t.TextP(''), len };
+ return { v: new TextP(''), len };
}
let v;
- const TextP_static = t.TextP[name];
+ const TextP_static = TextP[name];
if (typeof TextP_static === 'function') {
v = TextP_static(...values); // it's better to follow existing logic which may depend on an operator name
} else {
- v = new t.TextP(name, ...values);
+ v = new TextP(name, ...values);
}
return { v, len };
@@ -143,4 +142,4 @@ module.exports = class TextPSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraversalStrategySerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraversalStrategySerializer.js
index 3eb750c480..e6d009d371 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraversalStrategySerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraversalStrategySerializer.js
@@ -20,13 +20,12 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-const { TraversalStrategySerializer: GraphsonTraversalStrategySerializer } = require('../../type-serializers');
+import { TraversalStrategySerializer as GraphsonTraversalStrategySerializer } from '../../type-serializers.js';
-module.exports = class TraversalStrategySerializer {
+export default class TraversalStrategySerializer {
constructor(ioc) {
this.ioc = ioc;
// this.ioc.serializers[ioc.DataType.TRAVERSALSTRATEGY] = this; // TODO: it's not expected to be deserialized
@@ -71,4 +70,4 @@ module.exports = class TraversalStrategySerializer {
return Buffer.concat(bufs);
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraverserSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraverserSerializer.js
index 3d15553b43..1758d949ee 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraverserSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/TraverserSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const t = require('../../../../process/traversal');
+import { Buffer } from 'buffer';
+import { Traverser } from '../../../../process/traversal.js';
-module.exports = class TraverserSerializer {
+export default class TraverserSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.TRAVERSER] = this;
}
canBeUsedFor(value) {
- return value instanceof t.Traverser;
+ return value instanceof Traverser;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -115,10 +114,10 @@ module.exports = class TraverserSerializer {
}
cursor = cursor.slice(value_len);
- const v = new t.Traverser(value, bulk);
+ const v = new Traverser(value, bulk);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js
index 5fa1fc7e3c..8fd1601ad7 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class UnspecifiedNullSerializer {
+export default class UnspecifiedNullSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.UNSPECIFIED_NULL] = this;
@@ -74,4 +73,4 @@ module.exports = class UnspecifiedNullSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UuidSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UuidSerializer.js
index cb050de6af..9bc346c6e5 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UuidSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/UuidSerializer.js
@@ -20,11 +20,10 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
-module.exports = class UuidSerializer {
+export default class UuidSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.UUID] = this;
@@ -118,4 +117,4 @@ module.exports = class UuidSerializer {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexPropertySerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexPropertySerializer.js
index b1cfc6d001..8e91d0ce92 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexPropertySerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexPropertySerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const g = require('../../../graph');
+import { Buffer } from 'buffer';
+import { VertexProperty } from '../../../graph.js';
-module.exports = class VertexPropertySerializer {
+export default class VertexPropertySerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.VERTEXPROPERTY] = this;
}
canBeUsedFor(value) {
- return value instanceof g.VertexProperty;
+ return value instanceof VertexProperty;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -164,10 +163,10 @@ module.exports = class VertexPropertySerializer {
// TODO: should we verify that properties is null?
cursor = cursor.slice(properties_len);
- const v = new g.VertexProperty(id, label, value, properties);
+ const v = new VertexProperty(id, label, value, properties);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexSerializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexSerializer.js
index 3d050c578d..b41e693a58 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexSerializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/VertexSerializer.js
@@ -20,19 +20,18 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
-const g = require('../../../graph');
+import { Buffer } from 'buffer';
+import { Vertex } from '../../../graph.js';
-module.exports = class VertexSerializer {
+export default class VertexSerializer {
constructor(ioc) {
this.ioc = ioc;
this.ioc.serializers[ioc.DataType.VERTEX] = this;
}
canBeUsedFor(value) {
- return value instanceof g.Vertex;
+ return value instanceof Vertex;
}
serialize(item, fullyQualifiedFormat = true) {
@@ -127,10 +126,10 @@ module.exports = class VertexSerializer {
}
cursor = cursor.slice(properties_len);
- const v = new g.Vertex(id, label, properties);
+ const v = new Vertex(id, label, properties);
return { v, len };
} catch (err) {
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
}
}
-};
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/utils.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/utils.js
index bab8fdc0ec..4753a1f3ce 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/utils.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/binary/internals/utils.js
@@ -20,14 +20,13 @@
/**
* @author Igor Ostapenko
*/
-'use strict';
-const { Buffer } = require('buffer');
+import { Buffer } from 'buffer';
/*
* Deserialization error general constructor.
*/
-const des_error = ({ serializer, args, cursor, err }) => {
+export const des_error = ({ serializer, args, cursor, err }) => {
if (cursor === undefined) {
cursor = args[0]; // buffer
}
@@ -55,7 +54,3 @@ const des_error = ({ serializer, args, cursor, err }) => {
return err;
};
-
-module.exports = {
- des_error,
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.ts
similarity index 60%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.ts
index 71b1ba2dcc..ba2f4dd088 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.ts
@@ -20,24 +20,53 @@
/**
* @author Jorge Bay Gondra
*/
-'use strict';
-const { Buffer } = require('buffer');
-const typeSerializers = require('./type-serializers');
-const Bytecode = require('../../process/bytecode');
+import { Buffer } from 'buffer';
+import Bytecode from '../../process/bytecode.js';
+import {
+ BulkSetSerializer,
+ BytecodeSerializer,
+ DateSerializer,
+ DirectionSerializer,
+ EdgeSerializer,
+ EnumSerializer,
+ LambdaSerializer,
+ ListSerializer,
+ LongSerializer,
+ MapSerializer,
+ NumberSerializer,
+ PSerializer,
+ Path3Serializer,
+ PropertySerializer,
+ SetSerializer,
+ TSerializer,
+ TextPSerializer,
+ TraversalStrategySerializer,
+ TraverserSerializer,
+ TypeSerializer,
+ VertexPropertySerializer,
+ VertexSerializer,
+ typeKey,
+ valueKey,
+} from './type-serializers.js';
+
+export type GraphWriterOptions = {
+ serializers?: Record<string, TypeSerializer<any>>;
+};
/**
* GraphSON2 writer.
*/
-class GraphSON2Writer {
+export class GraphSON2Writer {
+ private readonly _serializers: TypeSerializer<any>[];
+
/**
- * @param {Object} [options]
- * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+ * @param {GraphWriterOptions} [options]
+ * @param {TypeSerializer} [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 || {};
+ constructor(private readonly options: GraphWriterOptions = {}) {
// Create instance of the default serializers
this._serializers = this.getDefaultSerializers().map((serializerConstructor) => {
const s = new serializerConstructor();
@@ -45,7 +74,7 @@ class GraphSON2Writer {
return s;
});
- const customSerializers = this._options.serializers || {};
+ const customSerializers = this.options.serializers || {};
Object.keys(customSerializers).forEach((key) => {
const s = customSerializers[key];
@@ -62,16 +91,16 @@ class GraphSON2Writer {
* Gets the default serializers to be used.
* @returns {Array}
*/
- getDefaultSerializers() {
+ getDefaultSerializers(): any[] {
return graphSON2Serializers;
}
- adaptObject(value) {
+ adaptObject<T>(value: T): any {
let s;
for (let i = 0; i < this._serializers.length; i++) {
const currentSerializer = this._serializers[i];
- if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
+ if (currentSerializer.canBeUsedFor?.(value)) {
s = currentSerializer;
break;
}
@@ -96,11 +125,21 @@ class GraphSON2Writer {
* @param {Object} obj
* @returns {String}
*/
- write(obj) {
+ write<T>(obj: T): string {
return JSON.stringify(this.adaptObject(obj));
}
- writeRequest({ requestId, op, processor, args }) {
+ writeRequest({
+ requestId,
+ op,
+ processor,
+ args,
+ }: {
+ processor: string | undefined;
+ op: string;
+ args: any;
+ requestId?: string | null;
+ }) {
const req = {
requestId: { '@type': 'g:UUID', '@value': requestId },
op,
@@ -122,9 +161,9 @@ class GraphSON2Writer {
* @returns {Object}
* @private
*/
- _adaptArgs(args, protocolLevel) {
+ _adaptArgs<T extends Record<string, any>>(args: T, protocolLevel: boolean): T {
if (args instanceof Object) {
- const newObj = {};
+ const newObj: Record<string, any> = {};
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
@@ -136,7 +175,7 @@ class GraphSON2Writer {
}
});
- return newObj;
+ return newObj as T;
}
return args;
@@ -146,37 +185,42 @@ class GraphSON2Writer {
/**
* GraphSON3 writer.
*/
-class GraphSON3Writer extends GraphSON2Writer {
+export class GraphSON3Writer extends GraphSON2Writer {
getDefaultSerializers() {
return graphSON3Serializers;
}
}
+export type GraphReaderOptions = {
+ serializers?: Record<string, TypeSerializer<any>>;
+};
+
/**
* GraphSON2 reader.
*/
-class GraphSON2Reader {
+export class GraphSON2Reader {
+ private readonly _deserializers: Record<string, TypeSerializer<any>>;
+
/**
* GraphSON Reader
- * @param {Object} [options]
- * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and
+ * @param {GraphReaderOptions} [options]
+ * @param {TypeSerializer} [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 || {};
+ constructor(private readonly options: GraphReaderOptions = {}) {
this._deserializers = {};
const defaultDeserializers = this.getDefaultDeserializers();
Object.keys(defaultDeserializers).forEach((typeName) => {
- const serializerConstructor = defaultDeserializers[typeName];
+ const serializerConstructor = defaultDeserializers[typeName as keyof typeof defaultDeserializers];
const s = new serializerConstructor();
s.reader = this;
this._deserializers[typeName] = s;
});
- if (this._options.serializers) {
- const customSerializers = this._options.serializers || {};
+ if (this.options.serializers) {
+ const customSerializers = this.options.serializers || {};
Object.keys(customSerializers).forEach((key) => {
const s = customSerializers[key];
if (!s.deserialize) {
@@ -190,13 +234,12 @@ class GraphSON2Reader {
/**
* Gets the default deserializers as an associative array.
- * @returns {Object}
*/
getDefaultDeserializers() {
return graphSON2Deserializers;
}
- read(obj) {
+ read(obj: any): any {
if (obj === undefined) {
return undefined;
}
@@ -204,16 +247,16 @@ class GraphSON2Reader {
return null;
}
if (Array.isArray(obj)) {
- return obj.map((item) => this.read(item));
+ return obj.map((item: any) => this.read(item));
}
- const type = obj[typeSerializers.typeKey];
+ const type = obj[typeKey];
if (type) {
const d = this._deserializers[type];
if (d) {
// Use type serializer
return d.deserialize(obj);
}
- return obj[typeSerializers.valueKey];
+ return obj[valueKey];
}
if (obj && typeof obj === 'object' && obj.constructor === Object) {
return this._deserializeObject(obj);
@@ -222,14 +265,15 @@ class GraphSON2Reader {
return obj;
}
- readResponse(buffer) {
+ readResponse(buffer: Buffer) {
return this.read(JSON.parse(buffer.toString()));
}
- _deserializeObject(obj) {
+ _deserializeObject<T extends Record<any, any>>(obj: T) {
const keys = Object.keys(obj);
const result = {};
for (let i = 0; i < keys.length; i++) {
+ // @ts-expect-error
result[keys[i]] = this.read(obj[keys[i]]);
}
return result;
@@ -239,63 +283,55 @@ class GraphSON2Reader {
/**
* GraphSON3 reader.
*/
-class GraphSON3Reader extends GraphSON2Reader {
+export 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,
+ 'g:Traverser': TraverserSerializer,
+ 'g:TraversalStrategy': TraversalStrategySerializer,
+ 'g:Int32': NumberSerializer,
+ 'g:Int64': NumberSerializer,
+ 'g:Float': NumberSerializer,
+ 'g:Double': NumberSerializer,
+ 'g:Date': DateSerializer,
+ 'g:Direction': DirectionSerializer,
+ 'g:Vertex': VertexSerializer,
+ 'g:Edge': EdgeSerializer,
+ 'g:VertexProperty': VertexPropertySerializer,
+ 'g:Property': PropertySerializer,
+ 'g:Path': Path3Serializer,
+ 'g:TextP': TextPSerializer,
+ 'g:T': TSerializer,
+ 'g:BulkSet': BulkSetSerializer,
};
const graphSON3Deserializers = Object.assign({}, graphSON2Deserializers, {
- 'g:List': typeSerializers.ListSerializer,
- 'g:Set': typeSerializers.SetSerializer,
- 'g:Map': typeSerializers.MapSerializer,
+ 'g:List': ListSerializer,
+ 'g:Set': SetSerializer,
+ 'g:Map': 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,
+ NumberSerializer,
+ DateSerializer,
+ BytecodeSerializer,
+ TraverserSerializer,
+ TraversalStrategySerializer,
+ PSerializer,
+ TextPSerializer,
+ LambdaSerializer,
+ EnumSerializer,
+ VertexSerializer,
+ EdgeSerializer,
+ LongSerializer,
];
-const graphSON3Serializers = graphSON2Serializers.concat([
- typeSerializers.ListSerializer,
- typeSerializers.SetSerializer,
- typeSerializers.MapSerializer,
-]);
-
-module.exports = {
- GraphSON3Writer,
- GraphSON3Reader,
- GraphSON2Writer,
- GraphSON2Reader,
- GraphSONWriter: GraphSON3Writer,
- GraphSONReader: GraphSON3Reader,
-};
+// @ts-expect-error
+const graphSON3Serializers = graphSON2Serializers.concat([ListSerializer, SetSerializer, MapSerializer]);
+
+export const GraphSONWriter = GraphSON3Writer;
+
+export const GraphSONReader = GraphSON3Reader;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.ts
similarity index 67%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.ts
index 599e132dd0..0d7aba22eb 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.ts
@@ -20,36 +20,40 @@
/**
* @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');
+import * as t from '../../process/traversal.js';
+import * as ts from '../../process/traversal-strategy.js';
+import Bytecode from '../../process/bytecode.js';
+import * as g from '../graph.js';
+import * as utils from '../../utils.js';
-const valueKey = '@value';
-const typeKey = '@type';
+export const valueKey = '@value';
+export const typeKey = '@type';
+
+export type SerializedValue = { [typeKey]: string; [valueKey]: any };
/**
* @abstract
*/
-class TypeSerializer {
- serialize() {
+export class TypeSerializer<T = any> {
+ reader: any;
+ writer: any;
+
+ serialize(value: T): T | SerializedValue {
throw new Error('serialize() method not implemented for ' + this.constructor.name);
}
- deserialize() {
+ deserialize<TObject extends SerializedValue>(value: TObject): T {
throw new Error('deserialize() method not implemented for ' + this.constructor.name);
}
- canBeUsedFor() {
+ canBeUsedFor?(value: unknown): boolean {
throw new Error('canBeUsedFor() method not implemented for ' + this.constructor.name);
}
}
-class NumberSerializer extends TypeSerializer {
- serialize(item) {
+export class NumberSerializer extends TypeSerializer<number> {
+ serialize(item: number) {
if (isNaN(item)) {
return {
[typeKey]: 'g:Double',
@@ -69,7 +73,7 @@ class NumberSerializer extends TypeSerializer {
return item;
}
- deserialize(obj) {
+ deserialize(obj: SerializedValue) {
const val = obj[valueKey];
if (val === 'NaN') {
return NaN;
@@ -81,50 +85,50 @@ class NumberSerializer extends TypeSerializer {
return parseFloat(val);
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return typeof value === 'number';
}
}
-class DateSerializer extends TypeSerializer {
- serialize(item) {
+export class DateSerializer extends TypeSerializer<Date> {
+ serialize(item: Date) {
return {
[typeKey]: 'g:Date',
[valueKey]: item.getTime(),
};
}
- deserialize(obj) {
+ deserialize(obj: SerializedValue) {
return new Date(obj[valueKey]);
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof Date;
}
}
-class LongSerializer extends TypeSerializer {
- serialize(item) {
+export class LongSerializer extends TypeSerializer<utils.Long> {
+ serialize(item: utils.Long) {
return {
[typeKey]: 'g:Int64',
[valueKey]: item.value,
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof utils.Long;
}
}
-class BytecodeSerializer extends TypeSerializer {
- serialize(item) {
+export class BytecodeSerializer extends TypeSerializer<Bytecode> {
+ serialize(item: Bytecode) {
let bytecode = item;
if (item instanceof t.Traversal) {
bytecode = item.getBytecode();
}
- const result = {};
+ const result: Partial<SerializedValue> = {};
result[typeKey] = 'g:Bytecode';
- const resultValue = (result[valueKey] = {});
+ const resultValue: any = (result[valueKey] = {});
const sources = this._serializeInstructions(bytecode.sourceInstructions);
if (sources) {
resultValue['source'] = sources;
@@ -133,32 +137,32 @@ class BytecodeSerializer extends TypeSerializer {
if (steps) {
resultValue['step'] = steps;
}
- return result;
+ return result as SerializedValue;
}
- _serializeInstructions(instructions) {
+ _serializeInstructions(instructions: any[]) {
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));
+ result[i] = instructions[i].map((item: unknown) => this.writer.adaptObject(item));
}
return result;
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof Bytecode || value instanceof t.Traversal;
}
}
-class PSerializer extends TypeSerializer {
+export class PSerializer extends TypeSerializer<t.P> {
/** @param {P} item */
- serialize(item) {
- const result = {};
+ serialize(item: t.P) {
+ const result: Partial<SerializedValue> = {};
result[typeKey] = 'g:P';
- const resultValue = (result[valueKey] = {
+ const resultValue: any = (result[valueKey] = {
predicate: item.operator,
});
if (item.other === undefined || item.other === null) {
@@ -166,20 +170,20 @@ class PSerializer extends TypeSerializer {
} else {
resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
}
- return result;
+ return result as SerializedValue;
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof t.P;
}
}
-class TextPSerializer extends TypeSerializer {
+export class TextPSerializer extends TypeSerializer<t.TextP> {
/** @param {TextP} item */
- serialize(item) {
- const result = {};
+ serialize(item: t.TextP) {
+ const result: Partial<SerializedValue> = {};
result[typeKey] = 'g:TextP';
- const resultValue = (result[valueKey] = {
+ const resultValue: any = (result[valueKey] = {
predicate: item.operator,
});
if (item.other === undefined || item.other === null) {
@@ -187,17 +191,17 @@ class TextPSerializer extends TypeSerializer {
} else {
resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
}
- return result;
+ return result as SerializedValue;
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof t.TextP;
}
}
-class LambdaSerializer extends TypeSerializer {
+export class LambdaSerializer extends TypeSerializer<() => unknown[]> {
/** @param {Function} item */
- serialize(item) {
+ serialize(item: () => any[]) {
const lambdaDef = item();
// check if the language is specified otherwise assume gremlin-groovy.
@@ -223,28 +227,28 @@ class LambdaSerializer extends TypeSerializer {
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return typeof value === 'function';
}
}
-class EnumSerializer extends TypeSerializer {
+export class EnumSerializer extends TypeSerializer<t.EnumValue> {
/** @param {EnumValue} item */
- serialize(item) {
+ serialize(item: t.EnumValue) {
return {
[typeKey]: 'g:' + item.typeName,
[valueKey]: item.elementName,
};
}
- canBeUsedFor(value) {
- return value && value.typeName && value instanceof t.EnumValue;
+ canBeUsedFor(value: unknown) {
+ return value && (value as any).typeName && value instanceof t.EnumValue;
}
}
-class TraverserSerializer extends TypeSerializer {
+export class TraverserSerializer extends TypeSerializer<t.Traverser> {
/** @param {Traverser} item */
- serialize(item) {
+ serialize(item: t.Traverser) {
return {
[typeKey]: 'g:Traverser',
[valueKey]: {
@@ -254,20 +258,20 @@ class TraverserSerializer extends TypeSerializer {
};
}
- deserialize(obj) {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof t.Traverser;
}
}
-class TraversalStrategySerializer extends TypeSerializer {
+export class TraversalStrategySerializer extends TypeSerializer<ts.TraversalStrategy> {
/** @param {TraversalStrategy} item */
- serialize(item) {
- const conf = {};
+ serialize(item: ts.TraversalStrategy) {
+ const conf: ts.TraversalStrategyConfiguration = {};
for (const k in item.configuration) {
if (item.configuration.hasOwnProperty(k)) {
conf[k] = this.writer.adaptObject(item.configuration[k]);
@@ -280,19 +284,19 @@ class TraversalStrategySerializer extends TypeSerializer {
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof ts.TraversalStrategy;
}
}
-class VertexSerializer extends TypeSerializer {
- deserialize(obj) {
+export class VertexSerializer extends TypeSerializer<g.Vertex> {
+ deserialize(obj: SerializedValue) {
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) {
+ serialize(item: g.Vertex) {
return {
[typeKey]: 'g:Vertex',
[valueKey]: {
@@ -302,13 +306,13 @@ class VertexSerializer extends TypeSerializer {
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof g.Vertex;
}
}
-class VertexPropertySerializer extends TypeSerializer {
- deserialize(obj) {
+export class VertexPropertySerializer extends TypeSerializer<g.VertexProperty> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
return new g.VertexProperty(
this.reader.read(value['id']),
@@ -319,15 +323,15 @@ class VertexPropertySerializer extends TypeSerializer {
}
}
-class PropertySerializer extends TypeSerializer {
- deserialize(obj) {
+export class PropertySerializer extends TypeSerializer<g.Property> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
return new g.Property(value['key'], this.reader.read(value['value']));
}
}
-class EdgeSerializer extends TypeSerializer {
- deserialize(obj) {
+export class EdgeSerializer extends TypeSerializer<g.Edge> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
return new g.Edge(
this.reader.read(value['id']),
@@ -339,7 +343,7 @@ class EdgeSerializer extends TypeSerializer {
}
/** @param {Edge} item */
- serialize(item) {
+ serialize(item: g.Edge) {
return {
[typeKey]: 'g:Edge',
[valueKey]: {
@@ -353,45 +357,44 @@ class EdgeSerializer extends TypeSerializer {
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof g.Edge;
}
}
-class PathSerializer extends TypeSerializer {
- deserialize(obj) {
+export class PathSerializer extends TypeSerializer<g.Path> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
- const objects = value['objects'].map((o) => this.reader.read(o));
+ const objects = value['objects'].map((o: unknown) => this.reader.read(o));
return new g.Path(this.reader.read(value['labels']), objects);
}
}
-class Path3Serializer extends TypeSerializer {
- deserialize(obj) {
+export class Path3Serializer extends TypeSerializer<g.Path> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
return new g.Path(this.reader.read(value['labels']), this.reader.read(value['objects']));
}
}
-class TSerializer extends TypeSerializer {
- deserialize(obj) {
+export class TSerializer extends TypeSerializer<t.EnumValue> {
+ deserialize(obj: SerializedValue) {
return t.t[obj[valueKey]];
}
}
-class DirectionSerializer extends TypeSerializer {
- deserialize(obj) {
+export class DirectionSerializer extends TypeSerializer<t.EnumValue> {
+ deserialize(obj: SerializedValue) {
return t.direction[obj[valueKey].toLowerCase()];
}
}
-class ArraySerializer extends TypeSerializer {
- constructor(typeKey) {
+class ArraySerializer extends TypeSerializer<unknown[]> {
+ constructor(readonly typeKey: string) {
super();
- this.typeKey = typeKey;
}
- deserialize(obj) {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
if (!Array.isArray(value)) {
throw new Error('Expected Array, obtained: ' + value);
@@ -400,20 +403,20 @@ class ArraySerializer extends TypeSerializer {
}
/** @param {Array} item */
- serialize(item) {
+ serialize(item: unknown[]) {
return {
[typeKey]: this.typeKey,
[valueKey]: item.map((x) => this.writer.adaptObject(x)),
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return Array.isArray(value);
}
}
-class BulkSetSerializer extends TypeSerializer {
- deserialize(obj) {
+export class BulkSetSerializer extends TypeSerializer<unknown> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
if (!Array.isArray(value)) {
throw new Error('Expected Array, obtained: ' + value);
@@ -423,7 +426,7 @@ class BulkSetSerializer extends TypeSerializer {
// 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 = [];
+ let result: unknown[] = [];
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])));
@@ -433,8 +436,8 @@ class BulkSetSerializer extends TypeSerializer {
}
}
-class MapSerializer extends TypeSerializer {
- deserialize(obj) {
+export class MapSerializer extends TypeSerializer<Map<unknown, unknown>> {
+ deserialize(obj: SerializedValue) {
const value = obj[valueKey];
if (!Array.isArray(value)) {
throw new Error('Expected Array, obtained: ' + value);
@@ -447,8 +450,8 @@ class MapSerializer extends TypeSerializer {
}
/** @param {Map} map */
- serialize(map) {
- const arr = [];
+ serialize(map: Map<unknown, unknown>) {
+ const arr: unknown[] = [];
map.forEach((v, k) => {
arr.push(this.writer.adaptObject(k));
arr.push(this.writer.adaptObject(v));
@@ -459,50 +462,23 @@ class MapSerializer extends TypeSerializer {
};
}
- canBeUsedFor(value) {
+ canBeUsedFor(value: unknown) {
return value instanceof Map;
}
}
-class ListSerializer extends ArraySerializer {
+export class ListSerializer extends ArraySerializer {
constructor() {
super('g:List');
}
}
-class SetSerializer extends ArraySerializer {
+export class SetSerializer extends ArraySerializer {
constructor() {
super('g:Set');
}
- deserialize(obj) {
+ deserialize(obj: SerializedValue): any {
return new Set(super.deserialize(obj));
}
}
-
-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,
-};
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.ts
similarity index 70%
rename from gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
rename to gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.ts
index bb5b58751a..f49b4d1d98 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.ts
@@ -21,32 +21,32 @@
* A module containing any utility functions.
* @author Jorge Bay Gondra
*/
-'use strict';
-const uuid = require('uuid');
+import * as uuid from 'uuid';
const gremlinVersion = '4.0.0-SNAPSHOT'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
-exports.toLong = function toLong(value) {
+export function toLong(value: number | string) {
return new Long(value);
-};
+}
-const Long = (exports.Long = function Long(value) {
- if (typeof value !== 'string' && typeof value !== 'number') {
- throw new TypeError('The value must be a string or a number');
+export class Long {
+ constructor(public value: number | string) {
+ if (typeof value !== 'string' && typeof value !== 'number') {
+ throw new TypeError('The value must be a string or a number');
+ }
}
- this.value = value.toString();
-});
+}
-exports.getUuid = function getUuid() {
+export function getUuid() {
// TODO: replace with `globalThis.crypto.randomUUID` once supported Node version is bump to >=19
return uuid.v4();
-};
+}
-exports.emptyArray = Object.freeze([]);
+export const emptyArray = Object.freeze([]) as any as any[];
-class ImmutableMap extends Map {
- constructor(iterable) {
+export class ImmutableMap<K, V> extends Map<K, V> implements ReadonlyMap<K, V> {
+ constructor(iterable?: Iterable<[K, V]>) {
super(iterable);
}
@@ -61,8 +61,6 @@ class ImmutableMap extends Map {
clear() {}
}
-exports.ImmutableMap = ImmutableMap;
-
async function generateNodeUserAgent() {
const os = await import('node:os');
@@ -91,11 +89,11 @@ async function generateNodeUserAgent() {
return userAgent;
}
-exports.getUserAgentHeader = function getUserAgentHeader() {
+export function getUserAgentHeader() {
return 'User-Agent';
-};
+}
-exports.getUserAgent = async () => {
+export const getUserAgent = async () => {
if ('navigator' in globalThis) {
return globalThis.navigator.userAgent;
}
@@ -107,24 +105,17 @@ exports.getUserAgent = async () => {
return undefined;
};
-/**
- * @param {Buffer} buffer
- * @returns {ArrayBuffer}
- */
-const toArrayBuffer = (buffer) => buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
-
-exports.toArrayBuffer = toArrayBuffer;
+export const toArrayBuffer = (buffer: Buffer) =>
+ buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
-const DeferredPromise = () => {
- let resolve = (value) => {};
- let reject = (reason) => {};
+export const DeferredPromise = <T>() => {
+ let resolve = (value: T) => {};
+ let reject = (reason: unknown) => {};
- const promise = new Promise((_resolve, _reject) => {
+ const promise = new Promise<T>((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
});
return Object.assign(promise, { resolve, reject });
};
-
-module.exports.DeferredPromise = DeferredPromise;
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/package-lock.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/package-lock.json
index 99023624b0..12573045af 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/package-lock.json
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/package-lock.json
@@ -16,11 +16,16 @@
"ws": "^8.16.0"
},
"devDependencies": {
+ "@cucumber/cucumber": "^10.3.1",
+ "@knighted/duel": "^1.0.7",
+ "@tsconfig/node18": "^18.2.2",
+ "@types/readable-stream": "^4.0.10",
+ "@types/uuid": "^9.0.8",
+ "@types/ws": "^8.5.10",
"chai": "~4.4.1",
"chai-string": "~1.5.0",
"colors": "1.4.0",
"cross-env": "^7.0.3",
- "cucumber": "~6.0.7",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
@@ -28,7 +33,9 @@
"grunt-cli": "~1.4.3",
"grunt-jsdoc": "~2.4.1",
"mocha": "^10.2.0",
- "prettier": "^3.0.0"
+ "prettier": "^3.0.0",
+ "ts-node": "^10.9.2",
+ "typescript": "^5.4.2"
},
"engines": {
"node": ">=18"
@@ -43,1470 +50,1592 @@
"node": ">=0.10.0"
}
},
- "node_modules/@babel/parser": {
- "version": "7.14.4",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
- "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
+ "node_modules/@babel/code-frame": {
+ "version": "7.23.5",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz",
+ "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==",
"dev": true,
- "bin": {
- "parser": "bin/babel-parser.js"
+ "dependencies": {
+ "@babel/highlight": "^7.23.4",
+ "chalk": "^2.4.2"
},
"engines": {
- "node": ">=6.0.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@babel/runtime-corejs3": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.18.9.tgz",
- "integrity": "sha512-qZEWeccZCrHA2Au4/X05QW5CMdm4VjUDCrGq5gf1ZDcM4hRqreKrtwAn7yci9zfgAS9apvnsFXiGBHBAxZdK9A==",
+ "node_modules/@babel/code-frame/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
- "core-js-pure": "^3.20.2",
- "regenerator-runtime": "^0.13.4"
+ "color-convert": "^1.9.0"
},
"engines": {
- "node": ">=6.9.0"
+ "node": ">=4"
}
},
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "node_modules/@babel/code-frame/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
- "eslint-visitor-keys": "^3.3.0"
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ "node": ">=4"
}
},
- "node_modules/@eslint-community/regexpp": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz",
- "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==",
+ "node_modules/@babel/code-frame/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+ "dev": true
+ },
+ "node_modules/@babel/code-frame/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ "node": ">=0.8.0"
}
},
- "node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
+ "node_modules/@babel/code-frame/node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/code-frame/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
+ "has-flag": "^3.0.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "node": ">=4"
}
},
- "node_modules/@eslint/eslintrc/node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "node_modules/@babel/generator": {
+ "version": "7.23.6",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz",
+ "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==",
"dev": true,
"dependencies": {
- "argparse": "^2.0.1"
+ "@babel/types": "^7.23.6",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
+ "jsesc": "^2.5.1"
},
- "bin": {
- "js-yaml": "bin/js-yaml.js"
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
+ "node_modules/@babel/helper-environment-visitor": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
+ "node_modules/@babel/helper-function-name": {
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
},
"engines": {
- "node": ">=10.10.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "node_modules/@babel/helper-hoist-variables": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
- "engines": {
- "node": ">=12.22"
+ "dependencies": {
+ "@babel/types": "^7.22.5"
},
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz",
- "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==",
- "dev": true
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "node_modules/@babel/helper-split-export-declaration": {
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
+ "@babel/types": "^7.22.5"
},
"engines": {
- "node": ">= 8"
+ "node": ">=6.9.0"
}
},
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.23.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz",
+ "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==",
"dev": true,
"engines": {
- "node": ">= 8"
+ "node": ">=6.9.0"
}
},
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/highlight": {
+ "version": "7.23.4",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz",
+ "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==",
"dev": true,
"dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
+ "js-tokens": "^4.0.0"
},
"engines": {
- "node": ">= 8"
+ "node": ">=6.9.0"
}
},
- "node_modules/@pkgr/core": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.0.tgz",
- "integrity": "sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==",
+ "node_modules/@babel/highlight/node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
- "engines": {
- "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
+ "dependencies": {
+ "color-convert": "^1.9.0"
},
- "funding": {
- "url": "https://opencollective.com/unts"
+ "engines": {
+ "node": ">=4"
}
},
- "node_modules/@types/linkify-it": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz",
- "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==",
- "dev": true
- },
- "node_modules/@types/markdown-it": {
- "version": "12.2.3",
- "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
- "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==",
+ "node_modules/@babel/highlight/node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
- "@types/linkify-it": "*",
- "@types/mdurl": "*"
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
}
},
- "node_modules/@types/mdurl": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz",
- "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==",
- "dev": true
+ "node_modules/@babel/highlight/node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
},
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
+ "node_modules/@babel/highlight/node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
- "node_modules/abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
+ "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
},
- "node_modules/abort-controller": {
+ "node_modules/@babel/highlight/node_modules/has-flag": {
"version": "3.0.0",
- "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
- "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/@babel/highlight/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
"dependencies": {
- "event-target-shim": "^5.0.0"
+ "has-flag": "^3.0.0"
},
"engines": {
- "node": ">=6.5"
+ "node": ">=4"
}
},
- "node_modules/acorn": {
- "version": "8.11.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
- "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
+ "node_modules/@babel/parser": {
+ "version": "7.24.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz",
+ "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==",
"dev": true,
"bin": {
- "acorn": "bin/acorn"
+ "parser": "bin/babel-parser.js"
},
"engines": {
- "node": ">=0.4.0"
+ "node": ">=6.0.0"
}
},
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "node_modules/@babel/template": {
+ "version": "7.24.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz",
+ "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==",
"dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ "dependencies": {
+ "@babel/code-frame": "^7.23.5",
+ "@babel/parser": "^7.24.0",
+ "@babel/types": "^7.24.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "node_modules/@babel/traverse": {
+ "version": "7.24.0",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz",
+ "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==",
"dev": true,
"dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
+ "@babel/code-frame": "^7.23.5",
+ "@babel/generator": "^7.23.6",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.24.0",
+ "@babel/types": "^7.24.0",
+ "debug": "^4.3.1",
+ "globals": "^11.1.0"
},
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/ansi-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
+ "node_modules/@babel/traverse/node_modules/globals": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
"dev": true,
"engines": {
- "node": ">=6"
+ "node": ">=4"
}
},
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "node_modules/@babel/types": {
+ "version": "7.24.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz",
+ "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.23.4",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "to-fast-properties": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@colors/colors": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
+ "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==",
"dev": true,
+ "optional": true,
"engines": {
- "node": ">=8"
+ "node": ">=0.1.90"
}
},
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
"dev": true,
"dependencies": {
- "color-convert": "^2.0.1"
+ "@jridgewell/trace-mapping": "0.3.9"
},
"engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ "node": ">=12"
}
},
- "node_modules/any-promise": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
- "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
+ "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@cucumber/ci-environment": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-10.0.0.tgz",
+ "integrity": "sha512-lRkiehckosIOdc7p1L44nZsttO5dVHFjpwKKWZ07x8SeoAdV/sPuGe1PISe0AmAowFGza62nMOgG4KaroGzwFQ==",
"dev": true
},
- "node_modules/anymatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
- "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
+ "node_modules/@cucumber/cucumber": {
+ "version": "10.3.1",
+ "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-10.3.1.tgz",
+ "integrity": "sha512-0H0NkOXcYTCG1qCh3o0p1HPSMODGJmlHi1rm5yfoiMx5tJbBjxVNI2VVD2xtPWA+D6ehHQD9asewuzjMXrbPIw==",
"dev": true,
"dependencies": {
- "normalize-path": "^3.0.0",
- "picomatch": "^2.0.4"
+ "@cucumber/ci-environment": "10.0.0",
+ "@cucumber/cucumber-expressions": "17.0.1",
+ "@cucumber/gherkin": "27.0.0",
+ "@cucumber/gherkin-streams": "5.0.1",
+ "@cucumber/gherkin-utils": "8.0.5",
+ "@cucumber/html-formatter": "21.2.0",
+ "@cucumber/message-streams": "4.0.1",
+ "@cucumber/messages": "24.0.1",
+ "@cucumber/tag-expressions": "6.1.0",
+ "assertion-error-formatter": "^3.0.0",
+ "capital-case": "^1.0.4",
+ "chalk": "^4.1.2",
+ "cli-table3": "0.6.3",
+ "commander": "^10.0.0",
+ "debug": "^4.3.4",
+ "error-stack-parser": "^2.1.4",
+ "figures": "^3.2.0",
+ "glob": "^10.3.10",
+ "has-ansi": "^4.0.1",
+ "indent-string": "^4.0.0",
+ "is-installed-globally": "^0.4.0",
+ "is-stream": "^2.0.0",
+ "knuth-shuffle-seeded": "^1.0.6",
+ "lodash.merge": "^4.6.2",
+ "lodash.mergewith": "^4.6.2",
+ "luxon": "3.2.1",
+ "mkdirp": "^2.1.5",
+ "mz": "^2.7.0",
+ "progress": "^2.0.3",
+ "read-pkg-up": "^7.0.1",
+ "resolve-pkg": "^2.0.0",
+ "semver": "7.5.3",
+ "string-argv": "0.3.1",
+ "strip-ansi": "6.0.1",
+ "supports-color": "^8.1.1",
+ "tmp": "^0.2.1",
+ "type-fest": "^4.8.3",
+ "util-arity": "^1.1.0",
+ "xmlbuilder": "^15.1.1",
+ "yaml": "^2.2.2",
+ "yup": "1.2.0"
+ },
+ "bin": {
+ "cucumber-js": "bin/cucumber.js"
},
"engines": {
- "node": ">= 8"
+ "node": "18 || >=20"
}
},
- "node_modules/argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "node_modules/@cucumber/cucumber-expressions": {
+ "version": "17.0.1",
+ "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-17.0.1.tgz",
+ "integrity": "sha512-reR7/sNRmDWgdz8BtFuHEwpksPnAkHty7gxUC2n0iaUPmckv9G5I5i+Vonc6xwUHDb/hmHPz/DyUL+Iv4Ao96w==",
"dev": true,
"dependencies": {
- "sprintf-js": "~1.0.2"
- }
- },
- "node_modules/argparse/node_modules/sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
- "dev": true
- },
- "node_modules/array-each": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
- "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
+ "regexp-match-indices": "1.0.2"
}
},
- "node_modules/array-slice": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
- "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
+ "node_modules/@cucumber/cucumber/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
- "engines": {
- "node": ">=0.10.0"
+ "dependencies": {
+ "balanced-match": "^1.0.0"
}
},
- "node_modules/assert-plus": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
- "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==",
+ "node_modules/@cucumber/cucumber/node_modules/cli-table3": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz",
+ "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==",
"dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0"
+ },
"engines": {
- "node": ">=0.8"
+ "node": "10.* || >= 12.*"
+ },
+ "optionalDependencies": {
+ "@colors/colors": "1.5.0"
}
},
- "node_modules/assertion-error": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
- "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
+ "node_modules/@cucumber/cucumber/node_modules/commander": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
"dev": true,
"engines": {
- "node": "*"
+ "node": ">=14"
}
},
- "node_modules/assertion-error-formatter": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz",
- "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==",
+ "node_modules/@cucumber/cucumber/node_modules/glob": {
+ "version": "10.3.10",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
+ "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dev": true,
"dependencies": {
- "diff": "^4.0.1",
- "pad-right": "^0.2.2",
- "repeat-string": "^1.6.1"
- }
- },
- "node_modules/async": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
- "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
- "dev": true
- },
- "node_modules/balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
- "dev": true
- },
- "node_modules/base64-js": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/becke-ch--regex--s0-0-v1--base--pl--lib": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.4.0.tgz",
- "integrity": "sha512-FnWonOyaw7Vivg5nIkrUll9HSS5TjFbyuURAiDssuL6VxrBe3ERzudRxOcWRhZYlP89UArMDikz7SapRPQpmZQ==",
- "dev": true
- },
- "node_modules/binary-extensions": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
- "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
- "dev": true,
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^2.3.5",
+ "minimatch": "^9.0.1",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
+ "path-scurry": "^1.10.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
"engines": {
- "node": ">=8"
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/bluebird": {
- "version": "3.7.2",
- "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
- "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=",
- "dev": true
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=",
+ "node_modules/@cucumber/cucumber/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
"dev": true,
"dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "node_modules/@cucumber/cucumber/node_modules/mkdirp": {
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz",
+ "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==",
"dev": true,
- "dependencies": {
- "fill-range": "^7.0.1"
+ "bin": {
+ "mkdirp": "dist/cjs/src/bin.js"
},
"engines": {
- "node": ">=8"
- }
- },
- "node_modules/browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
- "node_modules/buffer": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
- "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.2.1"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "node_modules/@cucumber/cucumber/node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
"engines": {
- "node": ">=6"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
- "node_modules/camelcase": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
- "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "node_modules/@cucumber/cucumber/node_modules/type-fest": {
+ "version": "4.12.0",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.12.0.tgz",
+ "integrity": "sha512-5Y2/pp2wtJk8o08G0CMkuFPCO354FGwk/vbidxrdhRGZfd0tFnb4Qb8anp9XxXriwBgVPjdWbKpGl4J9lJY2jQ==",
"dev": true,
"engines": {
- "node": ">=10"
+ "node": ">=16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/catharsis": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
- "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
+ "node_modules/@cucumber/gherkin": {
+ "version": "27.0.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-27.0.0.tgz",
+ "integrity": "sha512-j5rCsjqzRiC3iVTier3sa0kzyNbkcAmF7xr7jKnyO7qDeK3Z8Ye1P3KSVpeQRMY+KCDJ3WbTDdyxH0FwfA/fIw==",
"dev": true,
"dependencies": {
- "lodash": "^4.17.15"
- },
- "engines": {
- "node": ">= 10"
+ "@cucumber/messages": ">=19.1.4 <=22"
}
},
- "node_modules/chai": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz",
- "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==",
+ "node_modules/@cucumber/gherkin-streams": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-5.0.1.tgz",
+ "integrity": "sha512-/7VkIE/ASxIP/jd4Crlp4JHXqdNFxPGQokqWqsaCCiqBiu5qHoKMxcWNlp9njVL/n9yN4S08OmY3ZR8uC5x74Q==",
"dev": true,
"dependencies": {
- "assertion-error": "^1.1.0",
- "check-error": "^1.0.3",
- "deep-eql": "^4.1.3",
- "get-func-name": "^2.0.2",
- "loupe": "^2.3.6",
- "pathval": "^1.1.1",
- "type-detect": "^4.0.8"
+ "commander": "9.1.0",
+ "source-map-support": "0.5.21"
},
- "engines": {
- "node": ">=4"
+ "bin": {
+ "gherkin-javascript": "bin/gherkin"
+ },
+ "peerDependencies": {
+ "@cucumber/gherkin": ">=22.0.0",
+ "@cucumber/message-streams": ">=4.0.0",
+ "@cucumber/messages": ">=17.1.1"
}
},
- "node_modules/chai-string": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz",
- "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==",
+ "node_modules/@cucumber/gherkin-streams/node_modules/commander": {
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-9.1.0.tgz",
+ "integrity": "sha512-i0/MaqBtdbnJ4XQs4Pmyb+oFQl+q0lsAmokVUH92SlSw4fkeAcG3bVon+Qt7hmtF+u3Het6o4VgrcY3qAoEB6w==",
"dev": true,
- "peerDependencies": {
- "chai": "^4.1.2"
+ "engines": {
+ "node": "^12.20.0 || >=14"
}
},
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "node_modules/@cucumber/gherkin-utils": {
+ "version": "8.0.5",
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-8.0.5.tgz",
+ "integrity": "sha512-kxM1OCDjYddF26VKc892PF0GokW4wUIl1PUz3TIXsPZgS39ExM1pF8oww8mlGFD2B0+4op/cSE3SSIME5H3aNw==",
"dev": true,
"dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
+ "@cucumber/gherkin": "^26.0.0",
+ "@cucumber/messages": "^22.0.0",
+ "@teppeis/multimaps": "3.0.0",
+ "commander": "10.0.1",
+ "source-map-support": "^0.5.21"
},
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
+ "bin": {
+ "gherkin-utils": "bin/gherkin-utils"
}
},
- "node_modules/check-error": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
- "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
+ "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/gherkin": {
+ "version": "26.2.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-26.2.0.tgz",
+ "integrity": "sha512-iRSiK8YAIHAmLrn/mUfpAx7OXZ7LyNlh1zT89RoziSVCbqSVDxJS6ckEzW8loxs+EEXl0dKPQOXiDmbHV+C/fA==",
"dev": true,
"dependencies": {
- "get-func-name": "^2.0.2"
- },
- "engines": {
- "node": "*"
+ "@cucumber/messages": ">=19.1.4 <=22"
}
},
- "node_modules/chokidar": {
- "version": "3.5.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
- "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
+ "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": {
+ "version": "22.0.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-22.0.0.tgz",
+ "integrity": "sha512-EuaUtYte9ilkxcKmfqGF9pJsHRUU0jwie5ukuZ/1NPTuHS1LxHPsGEODK17RPRbZHOFhqybNzG2rHAwThxEymg==",
"dev": true,
- "funding": [
- {
- "type": "individual",
- "url": "https://paulmillr.com/funding/"
- }
- ],
"dependencies": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
- },
- "engines": {
- "node": ">= 8.10.0"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
+ "@types/uuid": "9.0.1",
+ "class-transformer": "0.5.1",
+ "reflect-metadata": "0.1.13",
+ "uuid": "9.0.0"
}
},
- "node_modules/chokidar/node_modules/braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "node_modules/@cucumber/gherkin-utils/node_modules/@types/uuid": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz",
+ "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==",
+ "dev": true
+ },
+ "node_modules/@cucumber/gherkin-utils/node_modules/commander": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
"dev": true,
- "dependencies": {
- "fill-range": "^7.0.1"
- },
"engines": {
- "node": ">=8"
+ "node": ">=14"
}
},
- "node_modules/chokidar/node_modules/fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "node_modules/@cucumber/gherkin-utils/node_modules/reflect-metadata": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
+ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==",
+ "dev": true
+ },
+ "node_modules/@cucumber/gherkin-utils/node_modules/uuid": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
+ "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
"dev": true,
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
+ "bin": {
+ "uuid": "dist/bin/uuid"
}
},
- "node_modules/chokidar/node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "node_modules/@cucumber/gherkin/node_modules/@cucumber/messages": {
+ "version": "22.0.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-22.0.0.tgz",
+ "integrity": "sha512-EuaUtYte9ilkxcKmfqGF9pJsHRUU0jwie5ukuZ/1NPTuHS1LxHPsGEODK17RPRbZHOFhqybNzG2rHAwThxEymg==",
"dev": true,
"dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
+ "@types/uuid": "9.0.1",
+ "class-transformer": "0.5.1",
+ "reflect-metadata": "0.1.13",
+ "uuid": "9.0.0"
}
},
- "node_modules/chokidar/node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "node_modules/@cucumber/gherkin/node_modules/@types/uuid": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz",
+ "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==",
+ "dev": true
+ },
+ "node_modules/@cucumber/gherkin/node_modules/reflect-metadata": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
+ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==",
+ "dev": true
+ },
+ "node_modules/@cucumber/gherkin/node_modules/uuid": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
+ "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
"dev": true,
- "engines": {
- "node": ">=0.12.0"
+ "bin": {
+ "uuid": "dist/bin/uuid"
}
},
- "node_modules/chokidar/node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "node_modules/@cucumber/html-formatter": {
+ "version": "21.2.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.2.0.tgz",
+ "integrity": "sha512-4OcSa12Y0v5e4ySDl67+QFTxCG/Y9fxGSkFqvm98ggpTvS7b75whwzupu+lM2lMBw+h3H6P8ZURQr0xQIAwE2A==",
+ "dev": true,
+ "peerDependencies": {
+ "@cucumber/messages": ">=18"
+ }
+ },
+ "node_modules/@cucumber/message-streams": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-4.0.1.tgz",
+ "integrity": "sha512-Kxap9uP5jD8tHUZVjTWgzxemi/0uOsbGjd4LBOSxcJoOCRbESFwemUzilJuzNTB8pcTQUh8D5oudUyxfkJOKmA==",
+ "dev": true,
+ "peerDependencies": {
+ "@cucumber/messages": ">=17.1.1"
+ }
+ },
+ "node_modules/@cucumber/messages": {
+ "version": "24.0.1",
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-24.0.1.tgz",
+ "integrity": "sha512-dKfNkvgc6stSQIyeHk7p/221iqEZe1BP+e/Js8XKtSmc0sS8khKMvbSBwYVeonn/67/vYKiAyo6Eo0SzXd5Plw==",
"dev": true,
"dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
+ "@types/uuid": "9.0.7",
+ "class-transformer": "0.5.1",
+ "reflect-metadata": "0.2.1",
+ "uuid": "9.0.1"
}
},
- "node_modules/cli-table3": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz",
- "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==",
+ "node_modules/@cucumber/messages/node_modules/@types/uuid": {
+ "version": "9.0.7",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.7.tgz",
+ "integrity": "sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==",
+ "dev": true
+ },
+ "node_modules/@cucumber/tag-expressions": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-6.1.0.tgz",
+ "integrity": "sha512-+3DwRumrCJG27AtzCIL37A/X+A/gSfxOPLg8pZaruh5SLumsTmpvilwroVWBT2fPzmno/tGXypeK5a7NHU4RzA==",
+ "dev": true
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
+ "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
"dev": true,
"dependencies": {
- "object-assign": "^4.1.0",
- "string-width": "^2.1.1"
+ "eslint-visitor-keys": "^3.3.0"
},
"engines": {
- "node": ">=6"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
- "optionalDependencies": {
- "colors": "^1.1.2"
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
}
},
- "node_modules/cli-table3/node_modules/ansi-regex": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
- "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz",
+ "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==",
"dev": true,
"engines": {
- "node": ">=4"
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
- "node_modules/cli-table3/node_modules/is-fullwidth-code-point": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
- "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
+ "node_modules/@eslint/eslintrc": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
+ "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true,
+ "dependencies": {
+ "ajv": "^6.12.4",
+ "debug": "^4.3.2",
+ "espree": "^9.6.0",
+ "globals": "^13.19.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.0",
+ "minimatch": "^3.1.2",
+ "strip-json-comments": "^3.1.1"
+ },
"engines": {
- "node": ">=4"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/cli-table3/node_modules/string-width": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
- "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+ "node_modules/@eslint/eslintrc/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"dependencies": {
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^4.0.0"
+ "argparse": "^2.0.1"
},
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "8.57.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
+ "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
+ "dev": true,
"engines": {
- "node": ">=4"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
- "node_modules/cli-table3/node_modules/strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==",
+ "node_modules/@humanwhocodes/config-array": {
+ "version": "0.11.14",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
+ "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
"dev": true,
"dependencies": {
- "ansi-regex": "^3.0.0"
+ "@humanwhocodes/object-schema": "^2.0.2",
+ "debug": "^4.3.1",
+ "minimatch": "^3.0.5"
},
"engines": {
- "node": ">=4"
+ "node": ">=10.10.0"
}
},
- "node_modules/cliui": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
- "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
"dev": true,
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0",
- "wrap-ansi": "^7.0.0"
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
}
},
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "node_modules/@humanwhocodes/object-schema": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz",
+ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==",
+ "dev": true
+ },
+ "node_modules/@isaacs/cliui": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
"dev": true,
"dependencies": {
- "color-name": "~1.1.4"
+ "string-width": "^5.1.2",
+ "string-width-cjs": "npm:string-width@^4.2.0",
+ "strip-ansi": "^7.0.1",
+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
+ "wrap-ansi": "^8.1.0",
+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
},
"engines": {
- "node": ">=7.0.0"
+ "node": ">=12"
}
},
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "node_modules/colors": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
- "integrity": "sha1-xQSRR51MG9rtLJztMs98fcI2D3g=",
+ "node_modules/@isaacs/cliui/node_modules/ansi-regex": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
+ "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
"dev": true,
"engines": {
- "node": ">=0.1.90"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
- "node_modules/commander": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz",
- "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==",
- "dev": true
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
- },
- "node_modules/core-js-pure": {
- "version": "3.24.1",
- "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.24.1.tgz",
- "integrity": "sha512-r1nJk41QLLPyozHUUPmILCEMtMw24NG4oWK6RbsDdjzQgg9ZvrUsPBj1MnG0wXXp1DCDU6j+wUvEmBSrtRbLXg==",
+ "node_modules/@isaacs/cliui/node_modules/ansi-styles": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
"dev": true,
- "hasInstallScript": true,
+ "engines": {
+ "node": ">=12"
+ },
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/core-js"
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "node_modules/core-util-is": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==",
+ "node_modules/@isaacs/cliui/node_modules/emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true
},
- "node_modules/cross-env": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
- "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+ "node_modules/@isaacs/cliui/node_modules/string-width": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
"dev": true,
"dependencies": {
- "cross-spawn": "^7.0.1"
- },
- "bin": {
- "cross-env": "src/bin/cross-env.js",
- "cross-env-shell": "src/bin/cross-env-shell.js"
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
},
"engines": {
- "node": ">=10.14",
- "npm": ">=6",
- "yarn": ">=1"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "node_modules/@isaacs/cliui/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
+ "ansi-regex": "^6.0.1"
},
"engines": {
- "node": ">= 8"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
- "node_modules/cross-spawn/node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "node_modules/@isaacs/cliui/node_modules/wrap-ansi": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dev": true,
"dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
+ "ansi-styles": "^6.1.0",
+ "string-width": "^5.0.1",
+ "strip-ansi": "^7.0.1"
},
"engines": {
- "node": ">= 8"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
- "node_modules/cucumber": {
- "version": "6.0.7",
- "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-6.0.7.tgz",
- "integrity": "sha512-pN3AgWxHx8rOi+wOlqjASNETOjf3TgeyqhMNLQam7nSTXgQzju1oAmXkleRQRcXvpVvejcDHiZBLFSfBkqbYpA==",
- "deprecated": "Cucumber is publishing new releases under @cucumber/cucumber",
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
+ "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
"dev": true,
"dependencies": {
- "assertion-error-formatter": "^3.0.0",
- "bluebird": "^3.4.1",
- "cli-table3": "^0.5.1",
- "colors": "^1.1.2",
- "commander": "^3.0.1",
- "cucumber-expressions": "^8.1.0",
- "cucumber-tag-expressions": "^2.0.2",
- "duration": "^0.2.1",
- "escape-string-regexp": "^2.0.0",
- "figures": "^3.0.0",
- "gherkin": "5.0.0",
- "glob": "^7.1.3",
- "indent-string": "^4.0.0",
- "is-generator": "^1.0.2",
- "is-stream": "^2.0.0",
- "knuth-shuffle-seeded": "^1.0.6",
- "lodash": "^4.17.14",
- "mz": "^2.4.0",
- "progress": "^2.0.0",
- "resolve": "^1.3.3",
- "serialize-error": "^4.1.0",
- "stack-chain": "^2.0.0",
- "stacktrace-js": "^2.0.0",
- "string-argv": "^0.3.0",
- "title-case": "^2.1.1",
- "util-arity": "^1.0.2",
- "verror": "^1.9.0"
- },
- "bin": {
- "cucumber-js": "bin/cucumber-js"
+ "@jridgewell/set-array": "^1.2.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.24"
},
"engines": {
- "node": ">=8"
+ "node": ">=6.0.0"
}
},
- "node_modules/cucumber-expressions": {
- "version": "8.3.0",
- "resolved": "https://registry.npmjs.org/cucumber-expressions/-/cucumber-expressions-8.3.0.tgz",
- "integrity": "sha512-cP2ya0EiorwXBC7Ll7Cj7NELYbasNv9Ty42L4u7sso9KruWemWG1ZiTq4PMqir3SNDSrbykoqI5wZgMbLEDjLQ==",
- "deprecated": "This package is now published under @cucumber/cucumber-expressions",
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
"dev": true,
- "dependencies": {
- "becke-ch--regex--s0-0-v1--base--pl--lib": "^1.4.0",
- "xregexp": "^4.2.4"
+ "engines": {
+ "node": ">=6.0.0"
}
},
- "node_modules/cucumber-tag-expressions": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/cucumber-tag-expressions/-/cucumber-tag-expressions-2.0.3.tgz",
- "integrity": "sha512-+x5j1IfZrBtbvYHuoUX0rl4nUGxaey6Do9sM0CABmZfDCcWXuuRm1fQeCaklIYQgOFHQ6xOHvDSdkMHHpni6tQ==",
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
- "node_modules/d": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
- "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.25",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
"dev": true,
"dependencies": {
- "es5-ext": "^0.10.50",
- "type": "^1.0.1"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
- "node_modules/dateformat": {
- "version": "4.6.3",
- "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
- "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
+ "node_modules/@knighted/duel": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@knighted/duel/-/duel-1.0.7.tgz",
+ "integrity": "sha512-N/Z/BqKFNwuyPZvrTtcsVtnPABOIfVgyQN58YpTOBBJIWCP/ZrNM4KaMjdWpf5byYjC1LIOzf8Va/9l/buHmig==",
"dev": true,
+ "dependencies": {
+ "@knighted/specifier": "^1.0.1",
+ "find-up": "^6.3.0",
+ "glob": "^10.3.3",
+ "jsonc-parser": "^3.2.0",
+ "read-package-up": "^11.0.0"
+ },
+ "bin": {
+ "duel": "dist/esm/duel.js"
+ },
"engines": {
- "node": "*"
+ "node": ">=16.19.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.0.0 || >=4.9.0-dev || >=5.3.0-dev || 5.4.0-dev || 5.5.0-dev"
}
},
- "node_modules/debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "node_modules/@knighted/duel/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
+ "balanced-match": "^1.0.0"
}
},
- "node_modules/decamelize": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
- "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
+ "node_modules/@knighted/duel/node_modules/find-up": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz",
+ "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==",
"dev": true,
+ "dependencies": {
+ "locate-path": "^7.1.0",
+ "path-exists": "^5.0.0"
+ },
"engines": {
- "node": ">=10"
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/deep-eql": {
- "version": "4.1.3",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz",
- "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==",
+ "node_modules/@knighted/duel/node_modules/glob": {
+ "version": "10.3.10",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
+ "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dev": true,
"dependencies": {
- "type-detect": "^4.0.0"
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^2.3.5",
+ "minimatch": "^9.0.1",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
+ "path-scurry": "^1.10.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
},
"engines": {
- "node": ">=6"
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/detect-file": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
- "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==",
+ "node_modules/@knighted/duel/node_modules/locate-path": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz",
+ "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==",
"dev": true,
+ "dependencies": {
+ "p-locate": "^6.0.0"
+ },
"engines": {
- "node": ">=0.10.0"
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/diff": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
- "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+ "node_modules/@knighted/duel/node_modules/minimatch": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
+ "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
"dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
"engines": {
- "node": ">=0.3.1"
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "node_modules/@knighted/duel/node_modules/p-limit": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
+ "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
"dev": true,
"dependencies": {
- "esutils": "^2.0.2"
+ "yocto-queue": "^1.0.0"
},
"engines": {
- "node": ">=6.0.0"
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/duration": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.2.tgz",
- "integrity": "sha512-06kgtea+bGreF5eKYgI/36A6pLXggY7oR4p1pq4SmdFBn1ReOL5D8RhG64VrqfTTKNucqqtBAwEj8aB88mcqrg==",
+ "node_modules/@knighted/duel/node_modules/p-locate": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz",
+ "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==",
"dev": true,
"dependencies": {
- "d": "1",
- "es5-ext": "~0.10.46"
+ "p-limit": "^4.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true
+ "node_modules/@knighted/duel/node_modules/path-exists": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
+ "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==",
+ "dev": true,
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ }
},
- "node_modules/error-stack-parser": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
- "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
+ "node_modules/@knighted/duel/node_modules/yocto-queue": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz",
+ "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==",
"dev": true,
- "dependencies": {
- "stackframe": "^1.3.4"
+ "engines": {
+ "node": ">=12.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/es5-ext": {
- "version": "0.10.62",
- "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
- "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
+ "node_modules/@knighted/specifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@knighted/specifier/-/specifier-1.0.1.tgz",
+ "integrity": "sha512-LArFWJN7wGGLU1P3TeEHgO6wGKWEYq/o4/Yij7rnKk0ng1HbQn1wythI0E9Q7B3+7LRnposEtaeY9AZlE3Cg+Q==",
"dev": true,
- "hasInstallScript": true,
"dependencies": {
- "es6-iterator": "^2.0.3",
- "es6-symbol": "^3.1.3",
- "next-tick": "^1.1.0"
+ "@babel/parser": "^7.22.7",
+ "@babel/traverse": "^7.23.2",
+ "magic-string": "^0.30.1"
},
"engines": {
- "node": ">=0.10"
+ "node": ">=14"
}
},
- "node_modules/es6-iterator": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
- "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"dev": true,
"dependencies": {
- "d": "1",
- "es5-ext": "^0.10.35",
- "es6-symbol": "^3.1.1"
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/es6-symbol": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
- "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"dev": true,
- "dependencies": {
- "d": "^1.0.1",
- "ext": "^1.1.2"
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"dev": true,
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
"engines": {
- "node": ">=6"
+ "node": ">= 8"
}
},
- "node_modules/escape-string-regexp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
- "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+ "node_modules/@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"dev": true,
+ "optional": true,
"engines": {
- "node": ">=8"
+ "node": ">=14"
}
},
- "node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
+ "node_modules/@pkgr/core": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.0.tgz",
+ "integrity": "sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==",
"dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
},
"funding": {
- "url": "https://opencollective.com/eslint"
+ "url": "https://opencollective.com/unts"
}
},
- "node_modules/eslint-config-prettier": {
- "version": "9.1.0",
- "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz",
- "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==",
+ "node_modules/@teppeis/multimaps": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-3.0.0.tgz",
+ "integrity": "sha512-ID7fosbc50TbT0MK0EG12O+gAP3W3Aa/Pz4DaTtQtEvlc9Odaqi0de+xuZ7Li2GtK4HzEX7IuRWS/JmZLksR3Q==",
"dev": true,
- "bin": {
- "eslint-config-prettier": "bin/cli.js"
- },
- "peerDependencies": {
- "eslint": ">=7.0.0"
+ "engines": {
+ "node": ">=14"
}
},
- "node_modules/eslint-plugin-prettier": {
- "version": "5.1.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz",
- "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==",
+ "node_modules/@tsconfig/node10": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
+ "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node16": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
+ "dev": true
+ },
+ "node_modules/@tsconfig/node18": {
+ "version": "18.2.2",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.2.tgz",
+ "integrity": "sha512-d6McJeGsuoRlwWZmVIeE8CUA27lu6jLjvv1JzqmpsytOYYbVi1tHZEnwCNVOXnj4pyLvneZlFlpXUK+X9wBWyw==",
+ "dev": true
+ },
+ "node_modules/@types/linkify-it": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz",
+ "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==",
+ "dev": true
+ },
+ "node_modules/@types/markdown-it": {
+ "version": "12.2.3",
+ "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
+ "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==",
"dev": true,
"dependencies": {
- "prettier-linter-helpers": "^1.0.0",
- "synckit": "^0.8.6"
- },
- "engines": {
- "node": "^14.18.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint-plugin-prettier"
- },
- "peerDependencies": {
- "@types/eslint": ">=8.0.0",
- "eslint": ">=8.0.0",
- "eslint-config-prettier": "*",
- "prettier": ">=3.0.0"
- },
- "peerDependenciesMeta": {
- "@types/eslint": {
- "optional": true
- },
- "eslint-config-prettier": {
- "optional": true
- }
+ "@types/linkify-it": "*",
+ "@types/mdurl": "*"
}
},
- "node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
+ "node_modules/@types/mdurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz",
+ "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==",
+ "dev": true
+ },
+ "node_modules/@types/node": {
+ "version": "20.11.26",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.26.tgz",
+ "integrity": "sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==",
"dev": true,
"dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "undici-types": "~5.26.4"
}
},
- "node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "node_modules/@types/normalize-package-data": {
+ "version": "2.4.4",
+ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz",
+ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==",
+ "dev": true
+ },
+ "node_modules/@types/readable-stream": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.10.tgz",
+ "integrity": "sha512-AbUKBjcC8SHmImNi4yK2bbjogQlkFSg7shZCcicxPQapniOlajG8GCc39lvXzCWX4lLRRs7DM3VAeSlqmEVZUA==",
"dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "dependencies": {
+ "@types/node": "*",
+ "safe-buffer": "~5.1.1"
}
},
- "node_modules/eslint/node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "node_modules/@types/readable-stream/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true
},
- "node_modules/eslint/node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
+ "node_modules/@types/uuid": {
+ "version": "9.0.8",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
+ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
+ "dev": true
},
- "node_modules/eslint/node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "node_modules/@types/ws": {
+ "version": "8.5.10",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz",
+ "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==",
"dev": true,
"dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
+ "@types/node": "*"
}
},
- "node_modules/eslint/node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
+ "node_modules/@ungap/structured-clone": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
+ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
+ "dev": true
},
- "node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "node_modules/abort-controller": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
+ "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"dependencies": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
+ "event-target-shim": "^5.0.0"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "node": ">=6.5"
}
},
- "node_modules/esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "node_modules/acorn": {
+ "version": "8.11.2",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
+ "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"dev": true,
"bin": {
- "esparse": "bin/esparse.js",
- "esvalidate": "bin/esvalidate.js"
+ "acorn": "bin/acorn"
},
"engines": {
- "node": ">=4"
+ "node": ">=0.4.0"
}
},
- "node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "node_modules/acorn-walk": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz",
+ "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==",
"dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
"engines": {
- "node": ">=4.0"
+ "node": ">=0.4.0"
}
},
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
- "engines": {
- "node": ">=4.0"
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "node_modules/ansi-colors": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
+ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
"dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/event-target-shim": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
- "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
"engines": {
"node": ">=6"
}
},
- "node_modules/eventemitter2": {
- "version": "0.4.14",
- "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
- "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==",
- "dev": true
- },
- "node_modules/eventemitter3": {
+ "node_modules/ansi-regex": {
"version": "5.0.1",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
- "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
- },
- "node_modules/events": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
- "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
- "engines": {
- "node": ">=0.8.x"
- }
- },
- "node_modules/exit": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
- "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
- "node": ">= 0.8.0"
+ "node": ">=8"
}
},
- "node_modules/expand-tilde": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
- "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==",
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"dependencies": {
- "homedir-polyfill": "^1.0.1"
+ "color-convert": "^2.0.1"
},
"engines": {
- "node": ">=0.10.0"
- }
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
},
- "node_modules/ext": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz",
- "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==",
+ "node_modules/any-promise": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
+ "dev": true
+ },
+ "node_modules/anymatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
+ "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
"dev": true,
"dependencies": {
- "type": "^2.5.0"
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/ext/node_modules/type": {
- "version": "2.7.2",
- "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
- "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==",
+ "node_modules/arg": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
- "node_modules/extend": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
- "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "node_modules/argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "dependencies": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "node_modules/argparse/node_modules/sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true
},
- "node_modules/extsprintf": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz",
- "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==",
+ "node_modules/array-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
+ "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==",
"dev": true,
- "engines": [
- "node >=0.6.0"
- ]
+ "engines": {
+ "node": ">=0.10.0"
+ }
},
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true
+ "node_modules/array-slice": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
},
- "node_modules/fast-diff": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
- "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
+ "node_modules/assertion-error": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
+ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/assertion-error-formatter": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz",
+ "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==",
+ "dev": true,
+ "dependencies": {
+ "diff": "^4.0.1",
+ "pad-right": "^0.2.2",
+ "repeat-string": "^1.6.1"
+ }
+ },
+ "node_modules/async": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
+ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
"dev": true
},
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "node_modules/balanced-match": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/binary-extensions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/bluebird": {
+ "version": "3.7.2",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
+ "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=",
"dev": true
},
- "node_modules/fastq": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
- "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=",
"dev": true,
"dependencies": {
- "reusify": "^1.0.4"
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
}
},
- "node_modules/figures": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
- "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
+ "node_modules/braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"dependencies": {
- "escape-string-regexp": "^1.0.5"
+ "fill-range": "^7.0.1"
},
"engines": {
"node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/figures/node_modules/escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
+ "node_modules/browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
},
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
"dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
}
},
- "node_modules/fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "node_modules/buffer-from": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
+ "dev": true
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true,
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
"engines": {
- "node": ">=8"
+ "node": ">=6"
}
},
- "node_modules/find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
"dev": true,
- "dependencies": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- },
"engines": {
"node": ">=10"
},
@@ -1514,191 +1643,155 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/findup-sync": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz",
- "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==",
+ "node_modules/capital-case": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz",
+ "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==",
"dev": true,
"dependencies": {
- "detect-file": "^1.0.0",
- "is-glob": "^4.0.3",
- "micromatch": "^4.0.4",
- "resolve-dir": "^1.0.1"
- },
- "engines": {
- "node": ">= 10.13.0"
+ "no-case": "^3.0.4",
+ "tslib": "^2.0.3",
+ "upper-case-first": "^2.0.2"
}
},
- "node_modules/fined": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
- "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
+ "node_modules/capital-case/node_modules/lower-case": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
+ "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
"dev": true,
"dependencies": {
- "expand-tilde": "^2.0.2",
- "is-plain-object": "^2.0.3",
- "object.defaults": "^1.1.0",
- "object.pick": "^1.2.0",
- "parse-filepath": "^1.0.1"
- },
- "engines": {
- "node": ">= 0.10"
+ "tslib": "^2.0.3"
}
},
- "node_modules/flagged-respawn": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
- "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
+ "node_modules/capital-case/node_modules/no-case": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
+ "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
"dev": true,
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/flat": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
- "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
- "dev": true,
- "bin": {
- "flat": "cli.js"
+ "dependencies": {
+ "lower-case": "^2.0.2",
+ "tslib": "^2.0.3"
}
},
- "node_modules/flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "node_modules/catharsis": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
+ "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dev": true,
"dependencies": {
- "flatted": "^3.1.0",
- "rimraf": "^3.0.2"
+ "lodash": "^4.17.15"
},
"engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz",
- "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==",
- "dev": true
- },
- "node_modules/for-in": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
- "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
+ "node": ">= 10"
}
},
- "node_modules/for-own": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
- "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==",
+ "node_modules/chai": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz",
+ "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==",
"dev": true,
"dependencies": {
- "for-in": "^1.0.1"
+ "assertion-error": "^1.1.0",
+ "check-error": "^1.0.3",
+ "deep-eql": "^4.1.3",
+ "get-func-name": "^2.0.2",
+ "loupe": "^2.3.6",
+ "pathval": "^1.1.1",
+ "type-detect": "^4.0.8"
},
"engines": {
- "node": ">=0.10.0"
+ "node": ">=4"
}
},
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
- "dev": true
- },
- "node_modules/fsevents": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
- "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
... 11883 lines suppressed ...