gremlin 3.8.1 → 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} +23 -33
- 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} +11 -11
- 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 +56 -20
- package/.nvmrc +0 -1
- 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/DriverRemoteConnection.html +0 -1528
- package/doc/EdgeLabelVerificationStrategy.html +0 -238
- package/doc/Graph.html +0 -343
- 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 -76
- package/eslint.config.mjs +0 -143
- 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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Jorge Bay Gondra
|
|
3
|
+
*/
|
|
4
|
+
import GremlinLang from '../process/gremlin-lang.js';
|
|
5
|
+
import { TraversalStrategy } from '../process/traversal-strategy.js';
|
|
6
|
+
import { Traversal, Traverser } from '../process/traversal.js';
|
|
7
|
+
import type { ConnectionOptions } from './connection.js';
|
|
8
|
+
export type RemoteConnectionOptions = ConnectionOptions & {
|
|
9
|
+
session?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Represents an abstraction of a "connection" to a "server" that is capable of processing a traversal and
|
|
13
|
+
* returning results.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class RemoteConnection {
|
|
16
|
+
url: string;
|
|
17
|
+
protected readonly options: RemoteConnectionOptions;
|
|
18
|
+
/**
|
|
19
|
+
* @param {String} url The resource uri.
|
|
20
|
+
* @param {RemoteConnectionOptions} [options] The connection options.
|
|
21
|
+
*/
|
|
22
|
+
constructor(url: string, options?: RemoteConnectionOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Opens the connection, if its not already opened.
|
|
25
|
+
* @returns {Promise}
|
|
26
|
+
*/
|
|
27
|
+
abstract open(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if connection is open
|
|
30
|
+
* @returns {Boolean}
|
|
31
|
+
*/
|
|
32
|
+
abstract get isOpen(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Submits the <code>GremlinLang</code> provided and returns a <code>RemoteTraversal</code>.
|
|
35
|
+
* @param {GremlinLang} gremlinLang
|
|
36
|
+
* @returns {Promise} Returns a <code>Promise</code> that resolves to a <code>RemoteTraversal</code>.
|
|
37
|
+
*/
|
|
38
|
+
abstract submit(gremlinLang: GremlinLang): Promise<RemoteTraversal>;
|
|
39
|
+
/**
|
|
40
|
+
* Submits a commit operation to the server and closes the connection.
|
|
41
|
+
* @returns {Promise}
|
|
42
|
+
*/
|
|
43
|
+
abstract commit(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Submits a rollback operation to the server and closes the connection.
|
|
46
|
+
* @returns {Promise}
|
|
47
|
+
*/
|
|
48
|
+
abstract rollback(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Closes the connection where open transactions will close according to the features of the graph provider.
|
|
51
|
+
* @returns {Promise}
|
|
52
|
+
*/
|
|
53
|
+
abstract close(): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Represents a traversal as a result of a {@link RemoteConnection} submission.
|
|
57
|
+
*/
|
|
58
|
+
export declare class RemoteTraversal extends Traversal {
|
|
59
|
+
results: Traverser<any>[];
|
|
60
|
+
sideEffects?: any[] | undefined;
|
|
61
|
+
constructor(results: Traverser<any>[], sideEffects?: any[] | undefined);
|
|
62
|
+
}
|
|
63
|
+
export declare class RemoteStrategy extends TraversalStrategy {
|
|
64
|
+
connection: RemoteConnection;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new instance of RemoteStrategy.
|
|
67
|
+
* @param {RemoteConnection} connection
|
|
68
|
+
*/
|
|
69
|
+
constructor(connection: RemoteConnection);
|
|
70
|
+
/** @override */
|
|
71
|
+
apply(traversal: Traversal): Promise<void>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
import { TraversalStrategy } from '../process/traversal-strategy.js';
|
|
20
|
+
import { Traversal } from '../process/traversal.js';
|
|
21
|
+
/**
|
|
22
|
+
* Represents an abstraction of a "connection" to a "server" that is capable of processing a traversal and
|
|
23
|
+
* returning results.
|
|
24
|
+
*/
|
|
25
|
+
export class RemoteConnection {
|
|
26
|
+
url;
|
|
27
|
+
options;
|
|
28
|
+
/**
|
|
29
|
+
* @param {String} url The resource uri.
|
|
30
|
+
* @param {RemoteConnectionOptions} [options] The connection options.
|
|
31
|
+
*/
|
|
32
|
+
constructor(url, options = {}) {
|
|
33
|
+
this.url = url;
|
|
34
|
+
this.options = options;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Represents a traversal as a result of a {@link RemoteConnection} submission.
|
|
39
|
+
*/
|
|
40
|
+
export class RemoteTraversal extends Traversal {
|
|
41
|
+
results;
|
|
42
|
+
sideEffects;
|
|
43
|
+
constructor(results, sideEffects) {
|
|
44
|
+
super(null, null);
|
|
45
|
+
this.results = results;
|
|
46
|
+
this.sideEffects = sideEffects;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export class RemoteStrategy extends TraversalStrategy {
|
|
50
|
+
connection;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new instance of RemoteStrategy.
|
|
53
|
+
* @param {RemoteConnection} connection
|
|
54
|
+
*/
|
|
55
|
+
constructor(connection) {
|
|
56
|
+
super();
|
|
57
|
+
this.connection = connection;
|
|
58
|
+
}
|
|
59
|
+
/** @override */
|
|
60
|
+
apply(traversal) {
|
|
61
|
+
if (traversal.results) {
|
|
62
|
+
return Promise.resolve();
|
|
63
|
+
}
|
|
64
|
+
return this.connection.submit(traversal.getGremlinLang()).then(function (remoteTraversal) {
|
|
65
|
+
traversal.sideEffects = remoteTraversal.sideEffects;
|
|
66
|
+
traversal.results = remoteTraversal.results;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The model for a request message in the HTTP body that is sent to the server beginning in 4.0.0.
|
|
3
|
+
*/
|
|
4
|
+
export declare class RequestMessage {
|
|
5
|
+
private gremlin;
|
|
6
|
+
private language;
|
|
7
|
+
private timeoutMs?;
|
|
8
|
+
private bindings?;
|
|
9
|
+
private g?;
|
|
10
|
+
private materializeProperties?;
|
|
11
|
+
private bulkResults?;
|
|
12
|
+
private customFields;
|
|
13
|
+
private constructor();
|
|
14
|
+
getGremlin(): string;
|
|
15
|
+
getLanguage(): string;
|
|
16
|
+
getTimeoutMs(): number | undefined;
|
|
17
|
+
getBindings(): object | undefined;
|
|
18
|
+
getG(): string | undefined;
|
|
19
|
+
getMaterializeProperties(): string | undefined;
|
|
20
|
+
getBulkResults(): boolean | undefined;
|
|
21
|
+
getFields(): ReadonlyMap<string, any>;
|
|
22
|
+
static build(gremlin: string): Builder;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Builder class for RequestMessage.
|
|
26
|
+
*/
|
|
27
|
+
export declare class Builder {
|
|
28
|
+
private readonly gremlin;
|
|
29
|
+
private readonly bindings;
|
|
30
|
+
language: string;
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
g?: string;
|
|
33
|
+
materializeProperties?: string;
|
|
34
|
+
bulkResults?: boolean;
|
|
35
|
+
additionalFields: Map<string, any>;
|
|
36
|
+
constructor(gremlin: string);
|
|
37
|
+
addLanguage(language: string): Builder;
|
|
38
|
+
addBinding(key: string, value: any): Builder;
|
|
39
|
+
addBindings(otherBindings: object): Builder;
|
|
40
|
+
addG(g: string): Builder;
|
|
41
|
+
addMaterializeProperties(materializeProps: string): Builder;
|
|
42
|
+
addTimeoutMillis(timeout: number): Builder;
|
|
43
|
+
addBulkResults(bulking: boolean): Builder;
|
|
44
|
+
addField(key: string, value: any): Builder;
|
|
45
|
+
/**
|
|
46
|
+
* Create the request message given the settings provided to the Builder.
|
|
47
|
+
*/
|
|
48
|
+
create(): RequestMessage;
|
|
49
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
// Token constants
|
|
20
|
+
const Tokens = {
|
|
21
|
+
ARGS_LANGUAGE: 'language',
|
|
22
|
+
ARGS_BINDINGS: 'bindings',
|
|
23
|
+
ARGS_G: 'g',
|
|
24
|
+
ARGS_MATERIALIZE_PROPERTIES: 'materializeProperties',
|
|
25
|
+
TIMEOUT_MS: 'timeoutMs',
|
|
26
|
+
BULK_RESULTS: 'bulkResults',
|
|
27
|
+
MATERIALIZE_PROPERTIES_TOKENS: 'tokens',
|
|
28
|
+
MATERIALIZE_PROPERTIES_ALL: 'all'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The model for a request message in the HTTP body that is sent to the server beginning in 4.0.0.
|
|
32
|
+
*/
|
|
33
|
+
export class RequestMessage {
|
|
34
|
+
gremlin;
|
|
35
|
+
language;
|
|
36
|
+
timeoutMs;
|
|
37
|
+
bindings;
|
|
38
|
+
g;
|
|
39
|
+
materializeProperties;
|
|
40
|
+
bulkResults;
|
|
41
|
+
customFields;
|
|
42
|
+
constructor(gremlin, language, timeoutMs, bindings, g, materializeProperties, bulkResults, customFields) {
|
|
43
|
+
if (!gremlin) {
|
|
44
|
+
throw new Error('RequestMessage requires gremlin argument');
|
|
45
|
+
}
|
|
46
|
+
this.gremlin = gremlin;
|
|
47
|
+
this.language = language;
|
|
48
|
+
this.timeoutMs = timeoutMs;
|
|
49
|
+
this.bindings = bindings;
|
|
50
|
+
this.g = g;
|
|
51
|
+
this.materializeProperties = materializeProperties;
|
|
52
|
+
this.bulkResults = bulkResults;
|
|
53
|
+
this.customFields = customFields;
|
|
54
|
+
}
|
|
55
|
+
getGremlin() {
|
|
56
|
+
return this.gremlin;
|
|
57
|
+
}
|
|
58
|
+
getLanguage() {
|
|
59
|
+
return this.language;
|
|
60
|
+
}
|
|
61
|
+
getTimeoutMs() {
|
|
62
|
+
return this.timeoutMs;
|
|
63
|
+
}
|
|
64
|
+
getBindings() {
|
|
65
|
+
return this.bindings;
|
|
66
|
+
}
|
|
67
|
+
getG() {
|
|
68
|
+
return this.g;
|
|
69
|
+
}
|
|
70
|
+
getMaterializeProperties() {
|
|
71
|
+
return this.materializeProperties;
|
|
72
|
+
}
|
|
73
|
+
getBulkResults() {
|
|
74
|
+
return this.bulkResults;
|
|
75
|
+
}
|
|
76
|
+
getFields() {
|
|
77
|
+
return this.customFields;
|
|
78
|
+
}
|
|
79
|
+
static build(gremlin) {
|
|
80
|
+
return new Builder(gremlin);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Builder class for RequestMessage.
|
|
85
|
+
*/
|
|
86
|
+
export class Builder {
|
|
87
|
+
gremlin;
|
|
88
|
+
bindings = {};
|
|
89
|
+
language;
|
|
90
|
+
timeoutMs;
|
|
91
|
+
g;
|
|
92
|
+
materializeProperties;
|
|
93
|
+
bulkResults;
|
|
94
|
+
additionalFields = new Map();
|
|
95
|
+
constructor(gremlin) {
|
|
96
|
+
this.gremlin = gremlin;
|
|
97
|
+
this.language = "gremlin-lang";
|
|
98
|
+
}
|
|
99
|
+
addLanguage(language) {
|
|
100
|
+
if (!language)
|
|
101
|
+
throw new Error('language argument cannot be null.');
|
|
102
|
+
this.language = language;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
addBinding(key, value) {
|
|
106
|
+
Object.assign(this.bindings, { [key]: value });
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
addBindings(otherBindings) {
|
|
110
|
+
if (!otherBindings)
|
|
111
|
+
throw new Error('bindings argument cannot be null.');
|
|
112
|
+
Object.assign(this.bindings, otherBindings);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
addG(g) {
|
|
116
|
+
if (!g)
|
|
117
|
+
throw new Error('g argument cannot be null.');
|
|
118
|
+
this.g = g;
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
addMaterializeProperties(materializeProps) {
|
|
122
|
+
if (!materializeProps)
|
|
123
|
+
throw new Error('materializeProps argument cannot be null.');
|
|
124
|
+
if (materializeProps !== Tokens.MATERIALIZE_PROPERTIES_TOKENS &&
|
|
125
|
+
materializeProps !== Tokens.MATERIALIZE_PROPERTIES_ALL) {
|
|
126
|
+
throw new Error(`materializeProperties argument must be either "${Tokens.MATERIALIZE_PROPERTIES_TOKENS}" or "${Tokens.MATERIALIZE_PROPERTIES_ALL}".`);
|
|
127
|
+
}
|
|
128
|
+
this.materializeProperties = materializeProps;
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
addTimeoutMillis(timeout) {
|
|
132
|
+
if (timeout < 0)
|
|
133
|
+
throw new Error('timeout argument cannot be negative.');
|
|
134
|
+
this.timeoutMs = timeout;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
addBulkResults(bulking) {
|
|
138
|
+
this.bulkResults = bulking;
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
addField(key, value) {
|
|
142
|
+
this.additionalFields.set(key, value);
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create the request message given the settings provided to the Builder.
|
|
147
|
+
*/
|
|
148
|
+
create() {
|
|
149
|
+
// @ts-ignore - accessing private constructor from Builder
|
|
150
|
+
return new RequestMessage(this.gremlin, this.language || 'gremlin-lang', this.timeoutMs, Object.keys(this.bindings).length > 0 ? this.bindings : undefined, this.g, this.materializeProperties, this.bulkResults, this.additionalFields);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an error obtained from the server.
|
|
3
|
+
*/
|
|
4
|
+
export default class ResponseError extends Error {
|
|
5
|
+
statusCode: number;
|
|
6
|
+
statusMessage: string;
|
|
7
|
+
statusAttributes: Map<string, string>;
|
|
8
|
+
constructor(message: string, responseStatus: {
|
|
9
|
+
code: ResponseError['statusCode'];
|
|
10
|
+
message: ResponseError['statusMessage'];
|
|
11
|
+
attributes: ResponseError['statusAttributes'];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* "License"); you may not use this file except in compliance
|
|
8
8
|
* with the License. You may obtain a copy of the License at
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
11
|
*
|
|
12
12
|
* Unless required by applicable law or agreed to in writing,
|
|
13
13
|
* software distributed under the License is distributed on an
|
|
@@ -16,32 +16,27 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
'use strict';
|
|
21
|
-
|
|
22
19
|
/**
|
|
23
20
|
* Represents an error obtained from the server.
|
|
24
21
|
*/
|
|
25
|
-
class ResponseError extends Error {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
export default class ResponseError extends Error {
|
|
23
|
+
statusCode;
|
|
24
|
+
statusMessage;
|
|
25
|
+
statusAttributes;
|
|
26
|
+
constructor(message, responseStatus) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = 'ResponseError';
|
|
29
|
+
/**
|
|
30
|
+
* Gets the server status code.
|
|
31
|
+
*/
|
|
32
|
+
this.statusCode = responseStatus.code;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the server status message.
|
|
35
|
+
*/
|
|
36
|
+
this.statusMessage = responseStatus.message;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the server status attributes as a Map (may contain provider specific status information).
|
|
39
|
+
*/
|
|
40
|
+
this.statusAttributes = responseStatus.attributes || {};
|
|
41
|
+
}
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
module.exports = ResponseError;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the response returned from the execution of a Gremlin traversal or script.
|
|
3
|
+
*/
|
|
4
|
+
export default class ResultSet {
|
|
5
|
+
private readonly items;
|
|
6
|
+
private readonly attributes;
|
|
7
|
+
readonly length: number;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new instance of {@link ResultSet}.
|
|
10
|
+
* @param {Array} items
|
|
11
|
+
* @param {Map} [attributes]
|
|
12
|
+
*/
|
|
13
|
+
constructor(items: any[], attributes: Map<string, any>);
|
|
14
|
+
/**
|
|
15
|
+
* Gets the iterator associated with this instance.
|
|
16
|
+
* @returns {Iterator}
|
|
17
|
+
*/
|
|
18
|
+
[Symbol.iterator](): ArrayIterator<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets an array of result items.
|
|
21
|
+
* @returns {Array}
|
|
22
|
+
*/
|
|
23
|
+
toArray(): Array<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the first item.
|
|
26
|
+
* @returns {Object|null}
|
|
27
|
+
*/
|
|
28
|
+
first(): any | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
* @author Jorge Bay Gondra
|
|
21
|
+
*/
|
|
22
|
+
import * as utils from '../utils.js';
|
|
23
|
+
const emptyMap = Object.freeze(new utils.ImmutableMap());
|
|
24
|
+
/**
|
|
25
|
+
* Represents the response returned from the execution of a Gremlin traversal or script.
|
|
26
|
+
*/
|
|
27
|
+
export default class ResultSet {
|
|
28
|
+
items;
|
|
29
|
+
attributes;
|
|
30
|
+
length;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new instance of {@link ResultSet}.
|
|
33
|
+
* @param {Array} items
|
|
34
|
+
* @param {Map} [attributes]
|
|
35
|
+
*/
|
|
36
|
+
constructor(items, attributes) {
|
|
37
|
+
this.items = items;
|
|
38
|
+
if (!Array.isArray(items)) {
|
|
39
|
+
throw new TypeError('items must be an Array instance');
|
|
40
|
+
}
|
|
41
|
+
this.items = items;
|
|
42
|
+
/**
|
|
43
|
+
* Gets a Map representing the attributes of the response.
|
|
44
|
+
* @type {Map}
|
|
45
|
+
*/
|
|
46
|
+
this.attributes = attributes || emptyMap;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the amount of items in the result.
|
|
49
|
+
* @type {Number}
|
|
50
|
+
*/
|
|
51
|
+
this.length = items.length;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets the iterator associated with this instance.
|
|
55
|
+
* @returns {Iterator}
|
|
56
|
+
*/
|
|
57
|
+
[Symbol.iterator]() {
|
|
58
|
+
return this.items[Symbol.iterator]();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets an array of result items.
|
|
62
|
+
* @returns {Array}
|
|
63
|
+
*/
|
|
64
|
+
toArray() {
|
|
65
|
+
return this.items;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns the first item.
|
|
69
|
+
* @returns {Object|null}
|
|
70
|
+
*/
|
|
71
|
+
first() {
|
|
72
|
+
const item = this.items[0];
|
|
73
|
+
return item !== undefined ? item : null;
|
|
74
|
+
}
|
|
75
|
+
}
|