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
|
@@ -1,617 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: structure/io/type-serializers.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: structure/io/type-serializers.js</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>/*
|
|
30
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
31
|
-
* or more contributor license agreements. See the NOTICE file
|
|
32
|
-
* distributed with this work for additional information
|
|
33
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
34
|
-
* to you under the Apache License, Version 2.0 (the
|
|
35
|
-
* "License"); you may not use this file except in compliance
|
|
36
|
-
* with the License. You may obtain a copy of the License at
|
|
37
|
-
*
|
|
38
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
39
|
-
*
|
|
40
|
-
* Unless required by applicable law or agreed to in writing,
|
|
41
|
-
* software distributed under the License is distributed on an
|
|
42
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
43
|
-
* KIND, either express or implied. See the License for the
|
|
44
|
-
* specific language governing permissions and limitations
|
|
45
|
-
* under the License.
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @author Jorge Bay Gondra
|
|
50
|
-
*/
|
|
51
|
-
'use strict';
|
|
52
|
-
|
|
53
|
-
const t = require('../../process/traversal');
|
|
54
|
-
const ts = require('../../process/traversal-strategy');
|
|
55
|
-
const Bytecode = require('../../process/bytecode');
|
|
56
|
-
const g = require('../graph');
|
|
57
|
-
const utils = require('../../utils');
|
|
58
|
-
|
|
59
|
-
const valueKey = '@value';
|
|
60
|
-
const typeKey = '@type';
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @abstract
|
|
64
|
-
*/
|
|
65
|
-
class TypeSerializer {
|
|
66
|
-
serialize() {
|
|
67
|
-
throw new Error('serialize() method not implemented for ' + this.constructor.name);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
deserialize() {
|
|
71
|
-
throw new Error('deserialize() method not implemented for ' + this.constructor.name);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
canBeUsedFor() {
|
|
75
|
-
throw new Error('canBeUsedFor() method not implemented for ' + this.constructor.name);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
class NumberSerializer extends TypeSerializer {
|
|
80
|
-
serialize(item) {
|
|
81
|
-
if (isNaN(item)) {
|
|
82
|
-
return {
|
|
83
|
-
[typeKey]: 'g:Double',
|
|
84
|
-
[valueKey]: 'NaN',
|
|
85
|
-
};
|
|
86
|
-
} else if (item === Number.POSITIVE_INFINITY) {
|
|
87
|
-
return {
|
|
88
|
-
[typeKey]: 'g:Double',
|
|
89
|
-
[valueKey]: 'Infinity',
|
|
90
|
-
};
|
|
91
|
-
} else if (item === Number.NEGATIVE_INFINITY) {
|
|
92
|
-
return {
|
|
93
|
-
[typeKey]: 'g:Double',
|
|
94
|
-
[valueKey]: '-Infinity',
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
return item;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
deserialize(obj) {
|
|
101
|
-
const val = obj[valueKey];
|
|
102
|
-
if (val === 'NaN') {
|
|
103
|
-
return NaN;
|
|
104
|
-
} else if (val === 'Infinity') {
|
|
105
|
-
return Number.POSITIVE_INFINITY;
|
|
106
|
-
} else if (val === '-Infinity') {
|
|
107
|
-
return Number.NEGATIVE_INFINITY;
|
|
108
|
-
}
|
|
109
|
-
return parseFloat(val);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
canBeUsedFor(value) {
|
|
113
|
-
return typeof value === 'number';
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
class DateSerializer extends TypeSerializer {
|
|
118
|
-
// only deserialize g:Date objects
|
|
119
|
-
deserialize(obj) {
|
|
120
|
-
return new Date(obj[valueKey]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
class OffsetDateTimeSerializer extends TypeSerializer {
|
|
125
|
-
// Date objects are serialized as OffsetDateTime by default
|
|
126
|
-
serialize(item) {
|
|
127
|
-
return {
|
|
128
|
-
[typeKey]: 'gx:OffsetDateTime',
|
|
129
|
-
[valueKey]: item.toISOString(),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
deserialize(obj) {
|
|
134
|
-
return new Date(obj[valueKey]);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
canBeUsedFor(value) {
|
|
138
|
-
return value instanceof Date;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
class ClassSerializer extends TypeSerializer {
|
|
143
|
-
serialize(item) {
|
|
144
|
-
return {
|
|
145
|
-
[typeKey]: 'g:Class',
|
|
146
|
-
[valueKey]: new item().fqcn,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
canBeUsedFor(value) {
|
|
151
|
-
return (
|
|
152
|
-
typeof value === 'function' &&
|
|
153
|
-
!!value.prototype &&
|
|
154
|
-
!!value.prototype.constructor.name &&
|
|
155
|
-
new value() instanceof ts.TraversalStrategy
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
class LongSerializer extends TypeSerializer {
|
|
161
|
-
serialize(item) {
|
|
162
|
-
return {
|
|
163
|
-
[typeKey]: 'g:Int64',
|
|
164
|
-
[valueKey]: item.value,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
canBeUsedFor(value) {
|
|
169
|
-
return value instanceof utils.Long;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
class BytecodeSerializer extends TypeSerializer {
|
|
174
|
-
serialize(item) {
|
|
175
|
-
let bytecode = item;
|
|
176
|
-
if (item instanceof t.Traversal) {
|
|
177
|
-
bytecode = item.getBytecode();
|
|
178
|
-
}
|
|
179
|
-
const result = {};
|
|
180
|
-
result[typeKey] = 'g:Bytecode';
|
|
181
|
-
const resultValue = (result[valueKey] = {});
|
|
182
|
-
const sources = this._serializeInstructions(bytecode.sourceInstructions);
|
|
183
|
-
if (sources) {
|
|
184
|
-
resultValue['source'] = sources;
|
|
185
|
-
}
|
|
186
|
-
const steps = this._serializeInstructions(bytecode.stepInstructions);
|
|
187
|
-
if (steps) {
|
|
188
|
-
resultValue['step'] = steps;
|
|
189
|
-
}
|
|
190
|
-
return result;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
_serializeInstructions(instructions) {
|
|
194
|
-
if (instructions.length === 0) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
const result = new Array(instructions.length);
|
|
198
|
-
result[0] = instructions[0];
|
|
199
|
-
for (let i = 0; i < instructions.length; i++) {
|
|
200
|
-
result[i] = instructions[i].map((item) => this.writer.adaptObject(item));
|
|
201
|
-
}
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
canBeUsedFor(value) {
|
|
206
|
-
return value instanceof Bytecode || value instanceof t.Traversal;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
class PSerializer extends TypeSerializer {
|
|
211
|
-
/** @param {P} item */
|
|
212
|
-
serialize(item) {
|
|
213
|
-
const result = {};
|
|
214
|
-
result[typeKey] = 'g:P';
|
|
215
|
-
const resultValue = (result[valueKey] = {
|
|
216
|
-
predicate: item.operator,
|
|
217
|
-
});
|
|
218
|
-
if (item.other === undefined || item.other === null) {
|
|
219
|
-
resultValue['value'] = this.writer.adaptObject(item.value);
|
|
220
|
-
} else {
|
|
221
|
-
resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
|
|
222
|
-
}
|
|
223
|
-
return result;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
canBeUsedFor(value) {
|
|
227
|
-
return value instanceof t.P;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
class TextPSerializer extends TypeSerializer {
|
|
232
|
-
/** @param {TextP} item */
|
|
233
|
-
serialize(item) {
|
|
234
|
-
const result = {};
|
|
235
|
-
result[typeKey] = 'g:TextP';
|
|
236
|
-
const resultValue = (result[valueKey] = {
|
|
237
|
-
predicate: item.operator,
|
|
238
|
-
});
|
|
239
|
-
if (item.other === undefined || item.other === null) {
|
|
240
|
-
resultValue['value'] = this.writer.adaptObject(item.value);
|
|
241
|
-
} else {
|
|
242
|
-
resultValue['value'] = [this.writer.adaptObject(item.value), this.writer.adaptObject(item.other)];
|
|
243
|
-
}
|
|
244
|
-
return result;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
canBeUsedFor(value) {
|
|
248
|
-
return value instanceof t.TextP;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
class LambdaSerializer extends TypeSerializer {
|
|
253
|
-
/** @param {Function} item */
|
|
254
|
-
serialize(item) {
|
|
255
|
-
const lambdaDef = item();
|
|
256
|
-
|
|
257
|
-
// check if the language is specified otherwise assume gremlin-groovy.
|
|
258
|
-
const returnIsString = typeof lambdaDef === 'string';
|
|
259
|
-
const script = returnIsString ? lambdaDef : lambdaDef[0];
|
|
260
|
-
const lang = returnIsString ? 'gremlin-groovy' : lambdaDef[1];
|
|
261
|
-
|
|
262
|
-
// detect argument count
|
|
263
|
-
const argCount =
|
|
264
|
-
lang === 'gremlin-groovy' && script.includes('->')
|
|
265
|
-
? script.substring(0, script.indexOf('->')).includes(',')
|
|
266
|
-
? 2
|
|
267
|
-
: 1
|
|
268
|
-
: -1;
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
[typeKey]: 'g:Lambda',
|
|
272
|
-
[valueKey]: {
|
|
273
|
-
arguments: argCount,
|
|
274
|
-
language: lang,
|
|
275
|
-
script: script,
|
|
276
|
-
},
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
canBeUsedFor(value) {
|
|
281
|
-
return typeof value === 'function';
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
class EnumSerializer extends TypeSerializer {
|
|
286
|
-
/** @param {EnumValue} item */
|
|
287
|
-
serialize(item) {
|
|
288
|
-
return {
|
|
289
|
-
[typeKey]: 'g:' + item.typeName,
|
|
290
|
-
[valueKey]: item.elementName,
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
canBeUsedFor(value) {
|
|
295
|
-
return value && value.typeName && value instanceof t.EnumValue;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
class TraverserSerializer extends TypeSerializer {
|
|
300
|
-
/** @param {Traverser} item */
|
|
301
|
-
serialize(item) {
|
|
302
|
-
return {
|
|
303
|
-
[typeKey]: 'g:Traverser',
|
|
304
|
-
[valueKey]: {
|
|
305
|
-
value: this.writer.adaptObject(item.object),
|
|
306
|
-
bulk: this.writer.adaptObject(item.bulk),
|
|
307
|
-
},
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
deserialize(obj) {
|
|
312
|
-
const value = obj[valueKey];
|
|
313
|
-
return new t.Traverser(this.reader.read(value['value']), this.reader.read(value['bulk']));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
canBeUsedFor(value) {
|
|
317
|
-
return value instanceof t.Traverser;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
class TraversalStrategySerializer extends TypeSerializer {
|
|
322
|
-
/** @param {TraversalStrategy} item */
|
|
323
|
-
serialize(item) {
|
|
324
|
-
const conf = {};
|
|
325
|
-
for (const k in item.configuration) {
|
|
326
|
-
if (item.configuration.hasOwnProperty(k)) {
|
|
327
|
-
conf[k] = this.writer.adaptObject(item.configuration[k]);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
return {
|
|
332
|
-
[typeKey]: 'g:' + item.constructor.name,
|
|
333
|
-
[valueKey]: { ['fqcn']: item.fqcn, ['conf']: conf },
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
canBeUsedFor(value) {
|
|
338
|
-
return value instanceof ts.TraversalStrategy;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Helper function to deserialize properties into arrays of VertexProperty or Property according to graphSONV3.
|
|
344
|
-
*/
|
|
345
|
-
function deserializeProperties(value, reader) {
|
|
346
|
-
let properties = [];
|
|
347
|
-
if ('properties' in value) {
|
|
348
|
-
const props = reader.read(value['properties']);
|
|
349
|
-
if (props !== null && props !== undefined) {
|
|
350
|
-
properties = Object.entries(props).flatMap(([key, values]) => {
|
|
351
|
-
if (Array.isArray(values) && values.length > 0 && values[0] instanceof g.VertexProperty) {
|
|
352
|
-
return values; // Flatten VertexProperty arrays
|
|
353
|
-
}
|
|
354
|
-
return values instanceof g.Property ? values : new g.Property(key, values); // create Property object when needed
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return properties;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
class VertexSerializer extends TypeSerializer {
|
|
362
|
-
deserialize(obj) {
|
|
363
|
-
const value = obj[valueKey];
|
|
364
|
-
return new g.Vertex(this.reader.read(value['id']), value['label'], deserializeProperties(value, this.reader));
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/** @param {Vertex} item */
|
|
368
|
-
serialize(item) {
|
|
369
|
-
return {
|
|
370
|
-
[typeKey]: 'g:Vertex',
|
|
371
|
-
[valueKey]: {
|
|
372
|
-
id: this.writer.adaptObject(item.id),
|
|
373
|
-
label: item.label,
|
|
374
|
-
},
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
canBeUsedFor(value) {
|
|
379
|
-
return value instanceof g.Vertex;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
class VertexPropertySerializer extends TypeSerializer {
|
|
384
|
-
deserialize(obj) {
|
|
385
|
-
const value = obj[valueKey];
|
|
386
|
-
return new g.VertexProperty(
|
|
387
|
-
this.reader.read(value['id']),
|
|
388
|
-
value['label'],
|
|
389
|
-
this.reader.read(value['value']),
|
|
390
|
-
deserializeProperties(value, this.reader),
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
class PropertySerializer extends TypeSerializer {
|
|
396
|
-
deserialize(obj) {
|
|
397
|
-
const value = obj[valueKey];
|
|
398
|
-
return new g.Property(value['key'], this.reader.read(value['value']));
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
class EdgeSerializer extends TypeSerializer {
|
|
403
|
-
deserialize(obj) {
|
|
404
|
-
const value = obj[valueKey];
|
|
405
|
-
return new g.Edge(
|
|
406
|
-
this.reader.read(value['id']),
|
|
407
|
-
new g.Vertex(this.reader.read(value['outV']), this.reader.read(value['outVLabel'])),
|
|
408
|
-
value['label'],
|
|
409
|
-
new g.Vertex(this.reader.read(value['inV']), this.reader.read(value['inVLabel'])),
|
|
410
|
-
deserializeProperties(value, this.reader),
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/** @param {Edge} item */
|
|
415
|
-
serialize(item) {
|
|
416
|
-
return {
|
|
417
|
-
[typeKey]: 'g:Edge',
|
|
418
|
-
[valueKey]: {
|
|
419
|
-
id: this.writer.adaptObject(item.id),
|
|
420
|
-
label: item.label,
|
|
421
|
-
outV: this.writer.adaptObject(item.outV.id),
|
|
422
|
-
outVLabel: item.outV.label,
|
|
423
|
-
inV: this.writer.adaptObject(item.inV.id),
|
|
424
|
-
inVLabel: item.inV.label,
|
|
425
|
-
},
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
canBeUsedFor(value) {
|
|
430
|
-
return value instanceof g.Edge;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
class PathSerializer extends TypeSerializer {
|
|
435
|
-
deserialize(obj) {
|
|
436
|
-
const value = obj[valueKey];
|
|
437
|
-
const objects = value['objects'].map((o) => this.reader.read(o));
|
|
438
|
-
return new g.Path(this.reader.read(value['labels']), objects);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
class Path3Serializer extends TypeSerializer {
|
|
443
|
-
deserialize(obj) {
|
|
444
|
-
const value = obj[valueKey];
|
|
445
|
-
return new g.Path(this.reader.read(value['labels']), this.reader.read(value['objects']));
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
class TSerializer extends TypeSerializer {
|
|
450
|
-
deserialize(obj) {
|
|
451
|
-
return t.t[obj[valueKey]];
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
class DirectionSerializer extends TypeSerializer {
|
|
456
|
-
deserialize(obj) {
|
|
457
|
-
return t.direction[obj[valueKey].toLowerCase()];
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
class ArraySerializer extends TypeSerializer {
|
|
462
|
-
constructor(typeKey) {
|
|
463
|
-
super();
|
|
464
|
-
this.typeKey = typeKey;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
deserialize(obj) {
|
|
468
|
-
const value = obj[valueKey];
|
|
469
|
-
if (!Array.isArray(value)) {
|
|
470
|
-
throw new Error('Expected Array, obtained: ' + value);
|
|
471
|
-
}
|
|
472
|
-
return value.map((x) => this.reader.read(x));
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/** @param {Array} item */
|
|
476
|
-
serialize(item) {
|
|
477
|
-
return {
|
|
478
|
-
[typeKey]: this.typeKey,
|
|
479
|
-
[valueKey]: item.map((x) => this.writer.adaptObject(x)),
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
canBeUsedFor(value) {
|
|
484
|
-
return Array.isArray(value);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
class BulkSetSerializer extends TypeSerializer {
|
|
489
|
-
deserialize(obj) {
|
|
490
|
-
const value = obj[valueKey];
|
|
491
|
-
if (!Array.isArray(value)) {
|
|
492
|
-
throw new Error('Expected Array, obtained: ' + value);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
// coerce the BulkSet to List. if the bulk exceeds the int space then we can't coerce to List anyway,
|
|
496
|
-
// so this query will be trouble. we'd need a legit BulkSet implementation here in js. this current
|
|
497
|
-
// implementation is here to replicate the previous functionality that existed on the server side in
|
|
498
|
-
// previous versions.
|
|
499
|
-
let result = [];
|
|
500
|
-
for (let ix = 0, iy = value.length; ix < iy; ix += 2) {
|
|
501
|
-
const pair = value.slice(ix, ix + 2);
|
|
502
|
-
result = result.concat(Array(this.reader.read(pair[1])).fill(this.reader.read(pair[0])));
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
return result;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
class MapSerializer extends TypeSerializer {
|
|
510
|
-
deserialize(obj) {
|
|
511
|
-
const value = obj[valueKey];
|
|
512
|
-
if (!Array.isArray(value)) {
|
|
513
|
-
throw new Error('Expected Array, obtained: ' + value);
|
|
514
|
-
}
|
|
515
|
-
const result = new Map();
|
|
516
|
-
for (let i = 0; i < value.length; i += 2) {
|
|
517
|
-
result.set(this.reader.read(value[i]), this.reader.read(value[i + 1]));
|
|
518
|
-
}
|
|
519
|
-
return result;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
/** @param {Map} map */
|
|
523
|
-
serialize(map) {
|
|
524
|
-
const arr = [];
|
|
525
|
-
map.forEach((v, k) => {
|
|
526
|
-
arr.push(this.writer.adaptObject(k));
|
|
527
|
-
arr.push(this.writer.adaptObject(v));
|
|
528
|
-
});
|
|
529
|
-
return {
|
|
530
|
-
[typeKey]: 'g:Map',
|
|
531
|
-
[valueKey]: arr,
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
canBeUsedFor(value) {
|
|
536
|
-
return value instanceof Map;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
class ListSerializer extends ArraySerializer {
|
|
541
|
-
constructor() {
|
|
542
|
-
super('g:List');
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
class SetSerializer extends ArraySerializer {
|
|
547
|
-
constructor() {
|
|
548
|
-
super('g:Set');
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
deserialize(obj) {
|
|
552
|
-
return new Set(super.deserialize(obj));
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
serialize(item) {
|
|
556
|
-
return {
|
|
557
|
-
[typeKey]: this.typeKey,
|
|
558
|
-
[valueKey]: [...item].map((x) => this.writer.adaptObject(x)),
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
canBeUsedFor(value) {
|
|
563
|
-
return value instanceof Set;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
module.exports = {
|
|
568
|
-
BulkSetSerializer,
|
|
569
|
-
BytecodeSerializer,
|
|
570
|
-
ClassSerializer,
|
|
571
|
-
DateSerializer,
|
|
572
|
-
OffsetDateTimeSerializer,
|
|
573
|
-
DirectionSerializer,
|
|
574
|
-
EdgeSerializer,
|
|
575
|
-
EnumSerializer,
|
|
576
|
-
LambdaSerializer,
|
|
577
|
-
ListSerializer,
|
|
578
|
-
LongSerializer,
|
|
579
|
-
MapSerializer,
|
|
580
|
-
NumberSerializer,
|
|
581
|
-
Path3Serializer,
|
|
582
|
-
PathSerializer,
|
|
583
|
-
PropertySerializer,
|
|
584
|
-
PSerializer,
|
|
585
|
-
TextPSerializer,
|
|
586
|
-
SetSerializer,
|
|
587
|
-
TSerializer,
|
|
588
|
-
TraverserSerializer,
|
|
589
|
-
TraversalStrategySerializer,
|
|
590
|
-
typeKey,
|
|
591
|
-
valueKey,
|
|
592
|
-
VertexPropertySerializer,
|
|
593
|
-
VertexSerializer,
|
|
594
|
-
};
|
|
595
|
-
</code></pre>
|
|
596
|
-
</article>
|
|
597
|
-
</section>
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
</div>
|
|
603
|
-
|
|
604
|
-
<nav>
|
|
605
|
-
<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>
|
|
606
|
-
</nav>
|
|
607
|
-
|
|
608
|
-
<br class="clear">
|
|
609
|
-
|
|
610
|
-
<footer>
|
|
611
|
-
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)
|
|
612
|
-
</footer>
|
|
613
|
-
|
|
614
|
-
<script> prettyPrint(); </script>
|
|
615
|
-
<script src="scripts/linenumber.js"> </script>
|
|
616
|
-
</body>
|
|
617
|
-
</html>
|