gremlin 3.8.0 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/build/cjs/driver/auth.cjs +69 -0
- package/build/cjs/driver/auth.d.cts +9 -0
- package/build/cjs/driver/client.cjs +134 -0
- package/build/cjs/driver/client.d.cts +85 -0
- package/build/cjs/driver/connection.cjs +250 -0
- package/build/cjs/driver/connection.d.cts +63 -0
- package/build/cjs/driver/driver-remote-connection.cjs +141 -0
- package/build/cjs/driver/driver-remote-connection.d.cts +33 -0
- package/build/cjs/driver/remote-connection.cjs +75 -0
- package/build/cjs/driver/remote-connection.d.cts +72 -0
- package/build/cjs/driver/request-message.cjs +157 -0
- package/build/cjs/driver/request-message.d.cts +49 -0
- package/build/cjs/driver/response-error.cjs +45 -0
- package/build/cjs/driver/response-error.d.cts +13 -0
- package/build/cjs/driver/result-set.cjs +111 -0
- package/build/cjs/driver/result-set.d.cts +29 -0
- package/build/cjs/index.cjs +125 -0
- package/build/cjs/index.d.cts +393 -0
- package/build/cjs/language/grammar/GremlinLexer.cjs +1851 -0
- package/build/cjs/language/grammar/GremlinLexer.d.cts +340 -0
- package/build/cjs/language/grammar/GremlinListener.cjs +4490 -0
- package/build/cjs/language/grammar/GremlinListener.d.cts +4898 -0
- package/build/cjs/language/grammar/GremlinParser.cjs +35244 -0
- package/build/cjs/language/grammar/GremlinParser.d.cts +5881 -0
- package/build/cjs/language/index.cjs +48 -0
- package/build/cjs/language/index.d.cts +12 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.cjs +157 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.d.cts +36 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.cjs +826 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.d.cts +155 -0
- package/build/cjs/language/translator/GoTranslateVisitor.cjs +339 -0
- package/build/cjs/language/translator/GoTranslateVisitor.d.cts +31 -0
- package/build/cjs/language/translator/GremlinTranslator.cjs +96 -0
- package/build/cjs/language/translator/GremlinTranslator.d.cts +18 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.cjs +287 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.d.cts +34 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.cjs +247 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.d.cts +23 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.cjs +220 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.d.cts +25 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.cjs +304 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.d.cts +28 -0
- package/build/cjs/language/translator/TranslateVisitor.cjs +389 -0
- package/build/cjs/language/translator/TranslateVisitor.d.cts +91 -0
- package/build/cjs/language/translator/Translation.cjs +47 -0
- package/build/cjs/language/translator/Translation.d.cts +13 -0
- package/build/cjs/language/translator/Translator.cjs +46 -0
- package/build/cjs/language/translator/Translator.d.cts +24 -0
- package/build/cjs/language/translator/TranslatorException.cjs +31 -0
- package/build/cjs/language/translator/TranslatorException.d.cts +6 -0
- package/build/cjs/process/anonymous-traversal.cjs +78 -0
- package/build/cjs/process/anonymous-traversal.d.cts +40 -0
- package/build/cjs/process/graph-traversal.cjs +1702 -0
- package/build/cjs/process/graph-traversal.d.cts +1134 -0
- package/build/cjs/process/gremlin-lang.cjs +196 -0
- package/build/cjs/process/gremlin-lang.d.cts +15 -0
- package/build/cjs/process/transaction.cjs +69 -0
- package/build/cjs/process/transaction.d.cts +34 -0
- package/build/cjs/process/traversal-strategy.cjs +360 -0
- package/build/cjs/process/traversal-strategy.d.cts +211 -0
- package/build/cjs/process/traversal.cjs +482 -0
- package/build/cjs/process/traversal.d.cts +186 -0
- package/build/cjs/structure/graph.cjs +157 -0
- package/build/cjs/structure/graph.d.cts +57 -0
- package/build/cjs/structure/io/binary/GraphBinary.cjs +148 -0
- package/build/cjs/structure/io/binary/GraphBinary.d.cts +91 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.cjs +80 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.d.cts +8 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.cjs +139 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.cjs +136 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.d.cts +14 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.cjs +112 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.cjs +93 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.cjs +88 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.d.cts +10 -0
- package/build/cjs/structure/io/binary/internals/DataType.cjs +63 -0
- package/build/cjs/structure/io/binary/internals/DataType.d.cts +35 -0
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.cjs +139 -0
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.cjs +201 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.d.cts +20 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.cjs +127 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.d.cts +24 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.cjs +97 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryWriter.cjs +85 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryWriter.d.cts +9 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.cjs +103 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.d.cts +13 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.cjs +95 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.cjs +144 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.d.cts +13 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.cjs +63 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.d.cts +8 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.cjs +66 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.d.cts +9 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.cjs +113 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.cjs +130 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.cjs +138 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.cjs +91 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.cjs +107 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.d.cts +11 -0
- package/{lib/driver/auth/authenticator.js → build/cjs/structure/io/binary/internals/StubSerializer.cjs} +14 -20
- package/build/cjs/structure/io/binary/internals/StubSerializer.d.cts +7 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.cjs +70 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.d.cts +11 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.cjs +109 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.d.cts +14 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.cjs +163 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.d.cts +15 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.cjs +128 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.d.cts +17 -0
- package/build/cjs/structure/io/binary/internals/utils.cjs +53 -0
- package/build/cjs/structure/io/binary/internals/utils.d.cts +6 -0
- package/build/cjs/utils.cjs +142 -0
- package/build/cjs/utils.d.cts +20 -0
- package/build/esm/driver/auth.d.ts +9 -0
- package/build/esm/driver/auth.js +65 -0
- package/build/esm/driver/client.d.ts +85 -0
- package/build/esm/driver/client.js +128 -0
- package/build/esm/driver/connection.d.ts +63 -0
- package/build/esm/driver/connection.js +211 -0
- package/build/esm/driver/driver-remote-connection.d.ts +33 -0
- package/build/esm/driver/driver-remote-connection.js +102 -0
- package/build/esm/driver/remote-connection.d.ts +72 -0
- package/build/esm/driver/remote-connection.js +69 -0
- package/build/esm/driver/request-message.d.ts +49 -0
- package/build/esm/driver/request-message.js +152 -0
- package/build/esm/driver/response-error.d.ts +13 -0
- package/{lib → build/esm}/driver/response-error.js +21 -26
- package/build/esm/driver/result-set.d.ts +29 -0
- package/build/esm/driver/result-set.js +75 -0
- package/build/esm/index.d.ts +393 -0
- package/{index.js → build/esm/index.js} +22 -32
- package/build/esm/language/grammar/GremlinLexer.d.ts +340 -0
- package/build/esm/language/grammar/GremlinLexer.js +1814 -0
- package/build/esm/language/grammar/GremlinListener.d.ts +4898 -0
- package/build/esm/language/grammar/GremlinListener.js +4486 -0
- package/build/esm/language/grammar/GremlinParser.d.ts +5881 -0
- package/build/esm/language/grammar/GremlinParser.js +34711 -0
- package/build/esm/language/index.d.ts +12 -0
- package/build/esm/language/index.js +30 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.d.ts +36 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.js +151 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.d.ts +155 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.js +820 -0
- package/build/esm/language/translator/GoTranslateVisitor.d.ts +31 -0
- package/build/esm/language/translator/GoTranslateVisitor.js +333 -0
- package/build/esm/language/translator/GremlinTranslator.d.ts +18 -0
- package/build/esm/language/translator/GremlinTranslator.js +89 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.d.ts +34 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.js +281 -0
- package/build/esm/language/translator/JavaTranslateVisitor.d.ts +23 -0
- package/build/esm/language/translator/JavaTranslateVisitor.js +241 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.d.ts +25 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.js +214 -0
- package/build/esm/language/translator/PythonTranslateVisitor.d.ts +28 -0
- package/build/esm/language/translator/PythonTranslateVisitor.js +298 -0
- package/build/esm/language/translator/TranslateVisitor.d.ts +91 -0
- package/build/esm/language/translator/TranslateVisitor.js +386 -0
- package/build/esm/language/translator/Translation.d.ts +13 -0
- package/build/esm/language/translator/Translation.js +43 -0
- package/build/esm/language/translator/Translator.d.ts +24 -0
- package/build/esm/language/translator/Translator.js +40 -0
- package/build/esm/language/translator/TranslatorException.d.ts +6 -0
- package/build/esm/language/translator/TranslatorException.js +27 -0
- package/build/esm/process/anonymous-traversal.d.ts +40 -0
- package/build/esm/process/anonymous-traversal.js +72 -0
- package/build/esm/process/graph-traversal.d.ts +1134 -0
- package/build/esm/process/graph-traversal.js +1693 -0
- package/build/esm/process/gremlin-lang.d.ts +15 -0
- package/build/esm/process/gremlin-lang.js +193 -0
- package/build/esm/process/transaction.d.ts +34 -0
- package/build/esm/process/transaction.js +65 -0
- package/build/esm/process/traversal-strategy.d.ts +211 -0
- package/build/esm/process/traversal-strategy.js +319 -0
- package/build/esm/process/traversal.d.ts +186 -0
- package/build/esm/process/traversal.js +469 -0
- package/build/esm/structure/graph.d.ts +57 -0
- package/build/esm/structure/graph.js +148 -0
- package/build/esm/structure/io/binary/GraphBinary.d.ts +91 -0
- package/build/esm/structure/io/binary/GraphBinary.js +108 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.d.ts +8 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.js +77 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.js +136 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.d.ts +14 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.js +133 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.js +109 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.js +90 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.d.ts +10 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.js +85 -0
- package/build/esm/structure/io/binary/internals/DataType.d.ts +35 -0
- package/{lib/driver/auth/mechanisms/sasl-mechanism-base.js → build/esm/structure/io/binary/internals/DataType.js} +43 -34
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.js +136 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.d.ts +20 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.js +198 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.d.ts +24 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.js +124 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.js +94 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryWriter.d.ts +9 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryWriter.js +82 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.d.ts +13 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.js +100 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.js +92 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.d.ts +13 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.js +141 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.d.ts +8 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.js +60 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.d.ts +9 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.js +63 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.js +110 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.js +127 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.js +135 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.js +88 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.js +104 -0
- package/build/esm/structure/io/binary/internals/StubSerializer.d.ts +7 -0
- package/{.prettierrc.js → build/esm/structure/io/binary/internals/StubSerializer.js} +12 -12
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.d.ts +11 -0
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.js +67 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.d.ts +14 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.js +106 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.d.ts +15 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.js +160 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.d.ts +17 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.js +125 -0
- package/build/esm/structure/io/binary/internals/utils.d.ts +6 -0
- package/{lib → build/esm}/structure/io/binary/internals/utils.js +23 -35
- package/build/esm/utils.d.ts +20 -0
- package/build/esm/utils.js +98 -0
- package/package.json +61 -23
- package/.eslintrc.js +0 -154
- package/.nvmrc +0 -1
- package/Gruntfile.js +0 -35
- package/NOTICE +0 -5
- package/doc/AnonymousTraversalSource.html +0 -793
- package/doc/Authenticator.html +0 -303
- package/doc/Bytecode.html +0 -941
- package/doc/CardinalityValue.html +0 -711
- package/doc/Client.html +0 -1869
- package/doc/Connection.html +0 -1192
- package/doc/DataType.js.html +0 -150
- package/doc/DriverRemoteConnection.html +0 -1528
- package/doc/EdgeLabelVerificationStrategy.html +0 -238
- package/doc/Graph.html +0 -343
- package/doc/GraphBinaryReader.js.html +0 -132
- package/doc/GraphBinaryWriter.js.html +0 -135
- package/doc/GraphSON2Reader.html +0 -407
- package/doc/GraphSON2Writer.html +0 -558
- package/doc/GraphSON3Reader.html +0 -170
- package/doc/GraphSON3Writer.html +0 -170
- package/doc/GraphTraversal.html +0 -22974
- package/doc/GraphTraversalSource.html +0 -3683
- package/doc/HaltedTraverserStrategy.html +0 -215
- package/doc/MatchAlgorithmStrategy.html +0 -210
- package/doc/P.html +0 -2020
- package/doc/PartitionStrategy.html +0 -387
- package/doc/Path.html +0 -242
- package/doc/PlainTextSaslAuthenticator.html +0 -456
- package/doc/ProductiveByStrategy.html +0 -258
- package/doc/RemoteConnection.html +0 -1086
- package/doc/RemoteStrategy.html +0 -307
- package/doc/RemoteTraversal.html +0 -170
- package/doc/ReservedKeysVerificationStrategy.html +0 -261
- package/doc/ResponseError.html +0 -360
- package/doc/ResultSet.html +0 -633
- package/doc/SaslAuthenticator.html +0 -455
- package/doc/SaslMechanismBase.html +0 -506
- package/doc/SaslMechanismPlain.html +0 -925
- package/doc/SeedStrategy.html +0 -288
- package/doc/SubgraphStrategy.html +0 -387
- package/doc/TextP.html +0 -1440
- package/doc/Transaction.html +0 -655
- package/doc/Translator.html +0 -527
- package/doc/TraversalStrategies.html +0 -652
- package/doc/TraversalStrategy.html +0 -393
- package/doc/TypeSerializer.html +0 -166
- package/doc/driver_auth_authenticator.js.html +0 -89
- package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +0 -103
- package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +0 -157
- package/doc/driver_auth_plain-text-sasl-authenticator.js.html +0 -106
- package/doc/driver_auth_sasl-authenticator.js.html +0 -100
- package/doc/driver_client.js.html +0 -250
- package/doc/driver_connection.js.html +0 -518
- package/doc/driver_driver-remote-connection.js.html +0 -193
- package/doc/driver_remote-connection.js.html +0 -198
- package/doc/driver_response-error.js.html +0 -98
- package/doc/driver_result-set.js.html +0 -134
- package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/global.html +0 -728
- package/doc/index.html +0 -185
- package/doc/module.exports.html +0 -301
- package/doc/process_anonymous-traversal.js.html +0 -138
- package/doc/process_bytecode.js.html +0 -175
- package/doc/process_graph-traversal.js.html +0 -1936
- package/doc/process_transaction.js.html +0 -151
- package/doc/process_translator.js.html +0 -172
- package/doc/process_traversal-strategy.js.html +0 -466
- package/doc/process_traversal.js.html +0 -592
- package/doc/scripts/linenumber.js +0 -25
- package/doc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/doc/scripts/prettify/lang-css.js +0 -2
- package/doc/scripts/prettify/prettify.js +0 -28
- package/doc/structure_graph.js.html +0 -233
- package/doc/structure_io_binary_internals_DataType.js.html +0 -151
- package/doc/structure_io_binary_internals_GraphBinaryReader.js.html +0 -133
- package/doc/structure_io_binary_internals_GraphBinaryWriter.js.html +0 -136
- package/doc/structure_io_graph-serializer.js.html +0 -354
- package/doc/structure_io_type-serializers.js.html +0 -617
- package/doc/styles/jsdoc-default.css +0 -358
- package/doc/styles/prettify-jsdoc.css +0 -111
- package/doc/styles/prettify-tomorrow.css +0 -132
- package/doc/utils.js.html +0 -181
- package/docker-compose.yml +0 -66
- package/lib/driver/auth/mechanisms/sasl-mechanism-plain.js +0 -106
- package/lib/driver/auth/plain-text-sasl-authenticator.js +0 -55
- package/lib/driver/auth/sasl-authenticator.js +0 -49
- package/lib/driver/client.js +0 -199
- package/lib/driver/connection.js +0 -467
- package/lib/driver/driver-remote-connection.js +0 -142
- package/lib/driver/remote-connection.js +0 -147
- package/lib/driver/result-set.js +0 -83
- package/lib/process/anonymous-traversal.js +0 -87
- package/lib/process/bytecode.js +0 -124
- package/lib/process/graph-traversal.js +0 -1885
- package/lib/process/transaction.js +0 -100
- package/lib/process/translator.js +0 -121
- package/lib/process/traversal-strategy.js +0 -415
- package/lib/process/traversal.js +0 -541
- package/lib/structure/graph.js +0 -182
- package/lib/structure/io/binary/GraphBinary.js +0 -110
- package/lib/structure/io/binary/internals/AnySerializer.js +0 -100
- package/lib/structure/io/binary/internals/ArraySerializer.js +0 -137
- package/lib/structure/io/binary/internals/BigIntegerSerializer.js +0 -153
- package/lib/structure/io/binary/internals/BooleanSerializer.js +0 -105
- package/lib/structure/io/binary/internals/BulkSetSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteBufferSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteSerializer.js +0 -97
- package/lib/structure/io/binary/internals/BytecodeSerializer.js +0 -250
- package/lib/structure/io/binary/internals/ClassSerializer.js +0 -60
- package/lib/structure/io/binary/internals/DataType.js +0 -100
- package/lib/structure/io/binary/internals/DateSerializer.js +0 -105
- package/lib/structure/io/binary/internals/DoubleSerializer.js +0 -101
- package/lib/structure/io/binary/internals/EdgeSerializer.js +0 -216
- package/lib/structure/io/binary/internals/EnumSerializer.js +0 -152
- package/lib/structure/io/binary/internals/FloatSerializer.js +0 -101
- package/lib/structure/io/binary/internals/GraphBinaryReader.js +0 -82
- package/lib/structure/io/binary/internals/GraphBinaryWriter.js +0 -85
- package/lib/structure/io/binary/internals/IntSerializer.js +0 -114
- package/lib/structure/io/binary/internals/LambdaSerializer.js +0 -71
- package/lib/structure/io/binary/internals/LongSerializer.js +0 -109
- package/lib/structure/io/binary/internals/LongSerializerNg.js +0 -104
- package/lib/structure/io/binary/internals/MapSerializer.js +0 -155
- package/lib/structure/io/binary/internals/NumberSerializationStrategy.js +0 -73
- package/lib/structure/io/binary/internals/OffsetDateTimeSerializer.js +0 -151
- package/lib/structure/io/binary/internals/PSerializer.js +0 -152
- package/lib/structure/io/binary/internals/PathSerializer.js +0 -124
- package/lib/structure/io/binary/internals/PropertySerializer.js +0 -142
- package/lib/structure/io/binary/internals/SetSerializer.js +0 -134
- package/lib/structure/io/binary/internals/ShortSerializer.js +0 -101
- package/lib/structure/io/binary/internals/StringSerializer.js +0 -116
- package/lib/structure/io/binary/internals/TextPSerializer.js +0 -146
- package/lib/structure/io/binary/internals/TraversalStrategySerializer.js +0 -69
- package/lib/structure/io/binary/internals/TraverserSerializer.js +0 -124
- package/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js +0 -77
- package/lib/structure/io/binary/internals/UuidSerializer.js +0 -121
- package/lib/structure/io/binary/internals/VertexPropertySerializer.js +0 -176
- package/lib/structure/io/binary/internals/VertexSerializer.js +0 -139
- package/lib/structure/io/graph-serializer.js +0 -303
- package/lib/structure/io/type-serializers.js +0 -566
- package/lib/utils.js +0 -130
- package/licenses/chai +0 -21
package/doc/utils.js.html
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: utils.js</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: utils.js</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>/*
|
|
30
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
31
|
-
* or more contributor license agreements. See the NOTICE file
|
|
32
|
-
* distributed with this work for additional information
|
|
33
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
34
|
-
* to you under the Apache License, Version 2.0 (the
|
|
35
|
-
* "License"); you may not use this file except in compliance
|
|
36
|
-
* with the License. You may obtain a copy of the License at
|
|
37
|
-
*
|
|
38
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
39
|
-
*
|
|
40
|
-
* Unless required by applicable law or agreed to in writing,
|
|
41
|
-
* software distributed under the License is distributed on an
|
|
42
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
43
|
-
* KIND, either express or implied. See the License for the
|
|
44
|
-
* specific language governing permissions and limitations
|
|
45
|
-
* under the License.
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* A module containing any utility functions.
|
|
50
|
-
* @author Jorge Bay Gondra
|
|
51
|
-
*/
|
|
52
|
-
'use strict';
|
|
53
|
-
|
|
54
|
-
const uuid = require('uuid');
|
|
55
|
-
|
|
56
|
-
const gremlinVersion = '3.8.0'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
|
|
57
|
-
|
|
58
|
-
exports.toLong = function toLong(value) {
|
|
59
|
-
return new Long(value);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const Long = (exports.Long = function Long(value) {
|
|
63
|
-
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
64
|
-
throw new TypeError('The value must be a string or a number');
|
|
65
|
-
}
|
|
66
|
-
this.value = value.toString();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
exports.getUuid = function getUuid() {
|
|
70
|
-
// TODO: replace with `globalThis.crypto.randomUUID` once supported Node version is bump to >=19
|
|
71
|
-
return uuid.v4();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
exports.emptyArray = Object.freeze([]);
|
|
75
|
-
|
|
76
|
-
class ImmutableMap extends Map {
|
|
77
|
-
constructor(iterable) {
|
|
78
|
-
super(iterable);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
set() {
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
['delete']() {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
clear() {}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
exports.ImmutableMap = ImmutableMap;
|
|
93
|
-
|
|
94
|
-
async function generateNodeUserAgent() {
|
|
95
|
-
const os = await import('node:os');
|
|
96
|
-
|
|
97
|
-
const applicationName = (process?.env.npm_package_name ?? 'NotAvailable').replace('_', ' ');
|
|
98
|
-
let runtimeVersion;
|
|
99
|
-
let osName;
|
|
100
|
-
let osVersion;
|
|
101
|
-
let cpuArch;
|
|
102
|
-
runtimeVersion = osName = osVersion = cpuArch = 'NotAvailable';
|
|
103
|
-
if (process != null) {
|
|
104
|
-
if (process.version) {
|
|
105
|
-
runtimeVersion = process.version.replace(' ', '_');
|
|
106
|
-
}
|
|
107
|
-
if (process.arch) {
|
|
108
|
-
cpuArch = process.arch.replace(' ', '_');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (os != null) {
|
|
113
|
-
osName = os.platform().replace(' ', '_');
|
|
114
|
-
osVersion = os.release().replace(' ', '_');
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const userAgent = `${applicationName} Gremlin-Javascript.${gremlinVersion} ${runtimeVersion} ${osName}.${osVersion} ${cpuArch}`;
|
|
118
|
-
|
|
119
|
-
return userAgent;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
exports.getUserAgentHeader = function getUserAgentHeader() {
|
|
123
|
-
return 'User-Agent';
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
exports.getUserAgent = async () => {
|
|
127
|
-
if ('navigator' in globalThis) {
|
|
128
|
-
return globalThis.navigator.userAgent;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (process?.versions?.node !== undefined) {
|
|
132
|
-
return await generateNodeUserAgent();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return undefined;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @param {Buffer} buffer
|
|
140
|
-
* @returns {ArrayBuffer}
|
|
141
|
-
*/
|
|
142
|
-
const toArrayBuffer = (buffer) => buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
143
|
-
|
|
144
|
-
exports.toArrayBuffer = toArrayBuffer;
|
|
145
|
-
|
|
146
|
-
const DeferredPromise = () => {
|
|
147
|
-
let resolve = (value) => {};
|
|
148
|
-
let reject = (reason) => {};
|
|
149
|
-
|
|
150
|
-
const promise = new Promise((_resolve, _reject) => {
|
|
151
|
-
resolve = _resolve;
|
|
152
|
-
reject = _reject;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
return Object.assign(promise, { resolve, reject });
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
module.exports.DeferredPromise = DeferredPromise;
|
|
159
|
-
</code></pre>
|
|
160
|
-
</article>
|
|
161
|
-
</section>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<nav>
|
|
169
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnonymousTraversalSource.html">AnonymousTraversalSource</a></li><li><a href="Authenticator.html">Authenticator</a></li><li><a href="Bytecode.html">Bytecode</a></li><li><a href="CardinalityValue.html">CardinalityValue</a></li><li><a href="Client.html">Client</a></li><li><a href="Connection.html">Connection</a></li><li><a href="DriverRemoteConnection.html">DriverRemoteConnection</a></li><li><a href="EdgeLabelVerificationStrategy.html">EdgeLabelVerificationStrategy</a></li><li><a href="Graph.html">Graph</a></li><li><a href="GraphSON2Reader.html">GraphSON2Reader</a></li><li><a href="GraphSON2Writer.html">GraphSON2Writer</a></li><li><a href="GraphSON3Reader.html">GraphSON3Reader</a></li><li><a href="GraphSON3Writer.html">GraphSON3Writer</a></li><li><a href="GraphTraversal.html">GraphTraversal</a></li><li><a href="GraphTraversalSource.html">GraphTraversalSource</a></li><li><a href="HaltedTraverserStrategy.html">HaltedTraverserStrategy</a></li><li><a href="MatchAlgorithmStrategy.html">MatchAlgorithmStrategy</a></li><li><a href="module.exports.html">exports</a></li><li><a href="P.html">P</a></li><li><a href="PartitionStrategy.html">PartitionStrategy</a></li><li><a href="Path.html">Path</a></li><li><a href="PlainTextSaslAuthenticator.html">PlainTextSaslAuthenticator</a></li><li><a href="ProductiveByStrategy.html">ProductiveByStrategy</a></li><li><a href="RemoteConnection.html">RemoteConnection</a></li><li><a href="RemoteStrategy.html">RemoteStrategy</a></li><li><a href="RemoteTraversal.html">RemoteTraversal</a></li><li><a href="ReservedKeysVerificationStrategy.html">ReservedKeysVerificationStrategy</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="SaslAuthenticator.html">SaslAuthenticator</a></li><li><a href="SaslMechanismBase.html">SaslMechanismBase</a></li><li><a href="SaslMechanismPlain.html">SaslMechanismPlain</a></li><li><a href="SeedStrategy.html">SeedStrategy</a></li><li><a href="SubgraphStrategy.html">SubgraphStrategy</a></li><li><a href="TextP.html">TextP</a></li><li><a href="Transaction.html">Transaction</a></li><li><a href="Translator.html">Translator</a></li><li><a href="TraversalStrategies.html">TraversalStrategies</a></li><li><a href="TraversalStrategy.html">TraversalStrategy</a></li><li><a href="TypeSerializer.html">TypeSerializer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#DataType">DataType</a></li><li><a href="global.html#deserializeProperties">deserializeProperties</a></li><li><a href="global.html#statics">statics</a></li><li><a href="global.html#toArrayBuffer">toArrayBuffer</a></li></ul>
|
|
170
|
-
</nav>
|
|
171
|
-
|
|
172
|
-
<br class="clear">
|
|
173
|
-
|
|
174
|
-
<footer>
|
|
175
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Mon Nov 17 2025 15:09:27 GMT-0800 (Pacific Standard Time)
|
|
176
|
-
</footer>
|
|
177
|
-
|
|
178
|
-
<script> prettyPrint(); </script>
|
|
179
|
-
<script src="scripts/linenumber.js"> </script>
|
|
180
|
-
</body>
|
|
181
|
-
</html>
|
package/docker-compose.yml
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
services:
|
|
19
|
-
|
|
20
|
-
gremlin-server-test-js:
|
|
21
|
-
container_name: gremlin-server-test-js
|
|
22
|
-
image: tinkerpop/gremlin-server-test:${GREMLIN_SERVER}
|
|
23
|
-
build:
|
|
24
|
-
context: ../../../../../
|
|
25
|
-
dockerfile: docker/gremlin-test-server/Dockerfile
|
|
26
|
-
args:
|
|
27
|
-
- GREMLIN_SERVER=${GREMLIN_SERVER}
|
|
28
|
-
ports:
|
|
29
|
-
- "45940:45940"
|
|
30
|
-
- "45941:45941"
|
|
31
|
-
- "45942:45942"
|
|
32
|
-
- "4588:4588"
|
|
33
|
-
volumes:
|
|
34
|
-
- ${HOME}/.groovy:/root/.groovy
|
|
35
|
-
- ${HOME}/.m2:/root/.m2
|
|
36
|
-
- ${ABS_PROJECT_HOME}/gremlin-test/target:/opt/gremlin-test
|
|
37
|
-
healthcheck:
|
|
38
|
-
test: [ "CMD-SHELL", "apk add curl && curl -f http://localhost:45940?gremlin=100-1" ]
|
|
39
|
-
interval: 30s
|
|
40
|
-
timeout: 10s
|
|
41
|
-
retries: 30
|
|
42
|
-
start_period: 30s
|
|
43
|
-
|
|
44
|
-
gremlin-js-integration-tests:
|
|
45
|
-
container_name: gremlin-js-integration-tests
|
|
46
|
-
image: node:${NODE_VERSION:-20}
|
|
47
|
-
volumes:
|
|
48
|
-
- .:/js_app
|
|
49
|
-
- ../../../../../gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features:/gremlin-test
|
|
50
|
-
- ../../../../../docker/gremlin-test-server:/js_app/gremlin-test-server
|
|
51
|
-
- ../../../../../gremlin-tools/gremlin-socket-server/conf:/js_app/gremlin-socket-server/conf/
|
|
52
|
-
environment:
|
|
53
|
-
- DOCKER_ENVIRONMENT=true
|
|
54
|
-
working_dir: /js_app
|
|
55
|
-
command: >
|
|
56
|
-
bash -c "npm config set cache /tmp --global
|
|
57
|
-
&& npm ci && npm run test && npm run features-docker"
|
|
58
|
-
depends_on:
|
|
59
|
-
gremlin-server-test-js:
|
|
60
|
-
condition: service_healthy
|
|
61
|
-
|
|
62
|
-
gremlin-socket-server:
|
|
63
|
-
container_name: gremlin-socket-server-js
|
|
64
|
-
image: tinkerpop/gremlin-socket-server:${GREMLIN_SERVER}
|
|
65
|
-
ports:
|
|
66
|
-
- "45943:45943"
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
const { Buffer } = require('buffer');
|
|
22
|
-
const SaslMechanismBase = require('./sasl-mechanism-base');
|
|
23
|
-
|
|
24
|
-
class SaslMechanismPlain extends SaslMechanismBase {
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new instance of SaslMechanismPlain.
|
|
27
|
-
* @param {Object} [options] The mechanism options.
|
|
28
|
-
* @param {String} [options.authzid] The identity of the client.
|
|
29
|
-
* @param {String} [options.username] The identity of user with access to server.
|
|
30
|
-
* @param {String} [options.password] The password of user with access to server.
|
|
31
|
-
* @constructor
|
|
32
|
-
*/
|
|
33
|
-
constructor(options) {
|
|
34
|
-
super(options);
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
this._options.username === undefined ||
|
|
38
|
-
this._options.username === null ||
|
|
39
|
-
this._options.username.length === 0 ||
|
|
40
|
-
this._options.password === undefined ||
|
|
41
|
-
this._options.password === null ||
|
|
42
|
-
this._options.password.length === 0
|
|
43
|
-
) {
|
|
44
|
-
throw new Error('Missing credentials for SASL PLAIN mechanism');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Returns the name of the mechanism
|
|
50
|
-
*/
|
|
51
|
-
get name() {
|
|
52
|
-
return 'PLAIN';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Evaluates the challenge from the server and returns appropriate response.
|
|
57
|
-
* @param {String} challenge Challenge string presented by the server.
|
|
58
|
-
* @return {Object} A Promise that resolves to a valid sasl response object.
|
|
59
|
-
*/
|
|
60
|
-
evaluateChallenge(challenge) {
|
|
61
|
-
if (this._hasInitialResponse(challenge)) {
|
|
62
|
-
return Promise.resolve({
|
|
63
|
-
saslMechanism: this.name,
|
|
64
|
-
sasl: this._saslArgument(this._options.authzid, this._options.username, this._options.password),
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return Promise.resolve({
|
|
69
|
-
sasl: this._saslArgument(this._options.authzid, this._options.username, this._options.password),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Generates a base64 encoded sasl argument based on the given parameters.
|
|
75
|
-
* @param {String} authzid Identitiy of the client.
|
|
76
|
-
* @param {String} username The identity of user with access to server.
|
|
77
|
-
* @param {String} password The password of user with access to server.
|
|
78
|
-
*/
|
|
79
|
-
_saslArgument(authzid, username, password) {
|
|
80
|
-
if (authzid === undefined || authzid === null) {
|
|
81
|
-
authzid = '';
|
|
82
|
-
}
|
|
83
|
-
if (username === undefined || username === null) {
|
|
84
|
-
username = '';
|
|
85
|
-
}
|
|
86
|
-
if (password === undefined || password.length === null) {
|
|
87
|
-
password = '';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return Buffer.from(`${authzid}\0${username}\0${password}`).toString('base64');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Checks challenge to see if we have the initial sasl response from the server.
|
|
95
|
-
* @param {String} challenge The challenge string from the server.
|
|
96
|
-
* @return {Boolean}
|
|
97
|
-
*/
|
|
98
|
-
_hasInitialResponse(challenge) {
|
|
99
|
-
if (challenge === undefined || challenge === null) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
module.exports = SaslMechanismPlain;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
'use strict';
|
|
21
|
-
|
|
22
|
-
const Authenticator = require('./authenticator');
|
|
23
|
-
const SaslMechanismPlain = require('./mechanisms/sasl-mechanism-plain');
|
|
24
|
-
|
|
25
|
-
class PlainTextSaslAuthenticator extends Authenticator {
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new instance of PlainTextSaslAuthenticator.
|
|
28
|
-
* @param {string} username Username to log into the server.
|
|
29
|
-
* @param {string} password Password for the user.
|
|
30
|
-
* @param {string} [authzid] Optional id
|
|
31
|
-
* @constructor
|
|
32
|
-
*/
|
|
33
|
-
constructor(username, password, authzid) {
|
|
34
|
-
const options = {
|
|
35
|
-
mechanism: new SaslMechanismPlain({
|
|
36
|
-
username: username,
|
|
37
|
-
password: password,
|
|
38
|
-
authzid: authzid,
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
super(options);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Evaluates the challenge from the server and returns appropriate response.
|
|
47
|
-
* @param {String} challenge Challenge string presented by the server.
|
|
48
|
-
* @return {Object} A Promise that resolves to a valid sasl response object.
|
|
49
|
-
*/
|
|
50
|
-
evaluateChallenge(challenge) {
|
|
51
|
-
return this._options.mechanism.evaluateChallenge(challenge);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = PlainTextSaslAuthenticator;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
'use strict';
|
|
21
|
-
|
|
22
|
-
const Authenticator = require('./authenticator');
|
|
23
|
-
|
|
24
|
-
class SaslAuthenticator extends Authenticator {
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new instance of SaslAuthenticator.
|
|
27
|
-
* @param {Object} [options] The authentication options.
|
|
28
|
-
* @param {Object} [options.mechanism] The mechanism to be used for authentication.
|
|
29
|
-
* @constructor
|
|
30
|
-
*/
|
|
31
|
-
constructor(options) {
|
|
32
|
-
super(options);
|
|
33
|
-
|
|
34
|
-
if (options.mechanism === null || options.mechanism === undefined) {
|
|
35
|
-
throw new Error('No Sasl Mechanism Specified');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Evaluates the challenge from the server and returns appropriate response.
|
|
41
|
-
* @param {String} challenge Challenge string presented by the server.
|
|
42
|
-
* @return {Object} A Promise that resolves to a valid sasl response object.
|
|
43
|
-
*/
|
|
44
|
-
evaluateChallenge(challenge) {
|
|
45
|
-
return this._options.mechanism.evaluateChallenge(challenge);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
module.exports = SaslAuthenticator;
|
package/lib/driver/client.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* 'License'); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
const utils = require('../utils');
|
|
22
|
-
const Connection = require('./connection');
|
|
23
|
-
const Bytecode = require('../process/bytecode');
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A {@link Client} contains methods to send messages to a Gremlin Server.
|
|
27
|
-
*/
|
|
28
|
-
class Client {
|
|
29
|
-
/**
|
|
30
|
-
* Creates a new instance of {@link Client}.
|
|
31
|
-
* @param {String} url The resource uri.
|
|
32
|
-
* @param {Object} [options] The connection options.
|
|
33
|
-
* @param {Array} [options.ca] Trusted certificates.
|
|
34
|
-
* @param {String|Array|Buffer} [options.cert] The certificate key.
|
|
35
|
-
* @param {String} [options.mimeType] The mime type to use.
|
|
36
|
-
* @param {String|Buffer} [options.pfx] The private key, certificate, and CA certs.
|
|
37
|
-
* @param {GraphSONReader} [options.reader] The reader to use.
|
|
38
|
-
* @param {Boolean} [options.rejectUnauthorized] Determines whether to verify or not the server certificate.
|
|
39
|
-
* @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'.
|
|
40
|
-
* @param {GraphSONWriter} [options.writer] The writer to use.
|
|
41
|
-
* @param {Authenticator} [options.authenticator] The authentication handler to use.
|
|
42
|
-
* @param {Object} [options.headers] An associative array containing the additional header key/values for the initial request.
|
|
43
|
-
* @param {Boolean} [options.enableUserAgentOnConnect] Determines if a user agent will be sent during connection handshake. Defaults to: true
|
|
44
|
-
* @param {String} [options.processor] The name of the opProcessor to use, leave it undefined or set 'session' when session mode.
|
|
45
|
-
* @param {String} [options.session] The sessionId of Client in session mode. Defaults to null means session-less Client.
|
|
46
|
-
* @param {http.Agent} [options.agent] The http.Agent implementation to use.
|
|
47
|
-
* @param {Boolean} [options.enableCompression] Enable per-message deflate compression. Defaults to: false.
|
|
48
|
-
* @constructor
|
|
49
|
-
*/
|
|
50
|
-
constructor(url, options = {}) {
|
|
51
|
-
this._options = options;
|
|
52
|
-
if (this._options.processor === 'session') {
|
|
53
|
-
// compatibility with old 'session' processor setting
|
|
54
|
-
this._options.session = options.session || utils.getUuid();
|
|
55
|
-
}
|
|
56
|
-
if (this._options.session) {
|
|
57
|
-
// re-assign processor to 'session' when in session mode
|
|
58
|
-
this._options.processor = options.processor || 'session';
|
|
59
|
-
}
|
|
60
|
-
this._connection = new Connection(url, options);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Opens the underlying connection to the Gremlin Server, if it's not already opened.
|
|
65
|
-
* @returns {Promise}
|
|
66
|
-
*/
|
|
67
|
-
open() {
|
|
68
|
-
return this._connection.open();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Returns true if the underlying connection is open
|
|
73
|
-
* @returns {Boolean}
|
|
74
|
-
*/
|
|
75
|
-
get isOpen() {
|
|
76
|
-
return this._connection.isOpen;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Configuration specific to the current request.
|
|
81
|
-
* @typedef {Object} RequestOptions
|
|
82
|
-
* @property {String} requestId - User specified request identifier which must be a UUID.
|
|
83
|
-
* @property {Number} batchSize - Indicates whether the Power component is present.
|
|
84
|
-
* @property {String} userAgent - The size in which the result of a request is to be 'batched' back to the client
|
|
85
|
-
* @property {Number} evaluationTimeout - The timeout for the evaluation of the request.
|
|
86
|
-
* @property {String} materializeProperties - Indicates whether element properties should be returned or not.
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Send a request to the Gremlin Server, can send a script or bytecode steps.
|
|
91
|
-
* @param {Bytecode|string} message The bytecode or script to send
|
|
92
|
-
* @param {Object} [bindings] The script bindings, if any.
|
|
93
|
-
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
|
|
94
|
-
* @returns {Promise}
|
|
95
|
-
*/
|
|
96
|
-
submit(message, bindings, requestOptions) {
|
|
97
|
-
const requestIdOverride = requestOptions && requestOptions.requestId;
|
|
98
|
-
if (requestIdOverride) {
|
|
99
|
-
delete requestOptions['requestId'];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const args = Object.assign(
|
|
103
|
-
{
|
|
104
|
-
gremlin: message,
|
|
105
|
-
aliases: { g: this._options.traversalSource || 'g' },
|
|
106
|
-
},
|
|
107
|
-
requestOptions,
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
if (this._options.session && this._options.processor === 'session') {
|
|
111
|
-
args['session'] = this._options.session;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (message instanceof Bytecode) {
|
|
115
|
-
if (this._options.session && this._options.processor === 'session') {
|
|
116
|
-
return this._connection.submit('session', 'bytecode', args, requestIdOverride);
|
|
117
|
-
}
|
|
118
|
-
return this._connection.submit('traversal', 'bytecode', args, requestIdOverride);
|
|
119
|
-
} else if (typeof message === 'string') {
|
|
120
|
-
args['bindings'] = bindings;
|
|
121
|
-
args['language'] = 'gremlin-groovy';
|
|
122
|
-
args['accept'] = this._connection.mimeType;
|
|
123
|
-
return this._connection.submit(this._options.processor || '', 'eval', args, requestIdOverride);
|
|
124
|
-
}
|
|
125
|
-
throw new TypeError('message must be of type Bytecode or string');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Send a request to the Gremlin Server and receive a stream for the results, can send a script or bytecode steps.
|
|
130
|
-
* @param {Bytecode|string} message The bytecode or script to send
|
|
131
|
-
* @param {Object} [bindings] The script bindings, if any.
|
|
132
|
-
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
|
|
133
|
-
* @returns {ReadableStream}
|
|
134
|
-
*/
|
|
135
|
-
stream(message, bindings, requestOptions) {
|
|
136
|
-
const requestIdOverride = requestOptions && requestOptions.requestId;
|
|
137
|
-
if (requestIdOverride) {
|
|
138
|
-
delete requestOptions['requestId'];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const args = Object.assign(
|
|
142
|
-
{
|
|
143
|
-
gremlin: message,
|
|
144
|
-
aliases: { g: this._options.traversalSource || 'g' },
|
|
145
|
-
},
|
|
146
|
-
requestOptions,
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
if (this._options.session && this._options.processor === 'session') {
|
|
150
|
-
args['session'] = this._options.session;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (message instanceof Bytecode) {
|
|
154
|
-
if (this._options.session && this._options.processor === 'session') {
|
|
155
|
-
return this._connection.stream('session', 'bytecode', args, requestIdOverride);
|
|
156
|
-
}
|
|
157
|
-
return this._connection.stream('traversal', 'bytecode', args, requestIdOverride);
|
|
158
|
-
} else if (typeof message === 'string') {
|
|
159
|
-
args['bindings'] = bindings;
|
|
160
|
-
args['language'] = 'gremlin-groovy';
|
|
161
|
-
args['accept'] = this._connection.mimeType;
|
|
162
|
-
return this._connection.stream(this._options.processor || '', 'eval', args, requestIdOverride);
|
|
163
|
-
}
|
|
164
|
-
throw new TypeError('message must be of type Bytecode or string');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Closes the underlying connection
|
|
169
|
-
* send session close request before connection close if session mode
|
|
170
|
-
* @returns {Promise}
|
|
171
|
-
*/
|
|
172
|
-
close() {
|
|
173
|
-
if (this._options.session && this._options.processor === 'session') {
|
|
174
|
-
const args = { session: this._options.session };
|
|
175
|
-
return this._connection.submit(this._options.processor, 'close', args, null).then(() => this._connection.close());
|
|
176
|
-
}
|
|
177
|
-
return this._connection.close();
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Adds an event listener to the connection
|
|
182
|
-
* @param {String} event The event name that you want to listen to.
|
|
183
|
-
* @param {Function} handler The callback to be called when the event occurs.
|
|
184
|
-
*/
|
|
185
|
-
addListener(event, handler) {
|
|
186
|
-
this._connection.on(event, handler);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Removes a previowsly added event listener to the connection
|
|
191
|
-
* @param {String} event The event name that you want to listen to.
|
|
192
|
-
* @param {Function} handler The event handler to be removed.
|
|
193
|
-
*/
|
|
194
|
-
removeListener(event, handler) {
|
|
195
|
-
this._connection.removeListener(event, handler);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
module.exports = Client;
|