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
|
@@ -0,0 +1,469 @@
|
|
|
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 GremlinLang from './gremlin-lang.js';
|
|
20
|
+
const itemDone = Object.freeze({ value: null, done: true });
|
|
21
|
+
const asyncIteratorSymbol = Symbol.asyncIterator || Symbol('@@asyncIterator');
|
|
22
|
+
export class Traversal {
|
|
23
|
+
graph;
|
|
24
|
+
traversalStrategies;
|
|
25
|
+
gremlinLang;
|
|
26
|
+
results = null;
|
|
27
|
+
sideEffects = null;
|
|
28
|
+
_traversalStrategiesPromise = null;
|
|
29
|
+
_resultsIteratorIndex = 0;
|
|
30
|
+
constructor(graph, traversalStrategies, gremlinLang = new GremlinLang()) {
|
|
31
|
+
this.graph = graph;
|
|
32
|
+
this.traversalStrategies = traversalStrategies;
|
|
33
|
+
this.gremlinLang = gremlinLang;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Async iterable method implementation.
|
|
37
|
+
*/
|
|
38
|
+
[asyncIteratorSymbol]() {
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
/** @returns {GremlinLang} */
|
|
42
|
+
getGremlinLang() {
|
|
43
|
+
return this.gremlinLang;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns an Array containing the traverser objects.
|
|
47
|
+
* @returns {Promise.<Array>}
|
|
48
|
+
*/
|
|
49
|
+
toList() {
|
|
50
|
+
return this._applyStrategies().then(() => {
|
|
51
|
+
const result = [];
|
|
52
|
+
let it;
|
|
53
|
+
while ((it = this._getNext()) && !it.done) {
|
|
54
|
+
result.push(it.value);
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Determines if there are any more items to iterate from the traversal.
|
|
61
|
+
* @returns {Promise.<boolean>}
|
|
62
|
+
*/
|
|
63
|
+
hasNext() {
|
|
64
|
+
return this._applyStrategies().then(() => {
|
|
65
|
+
if (!this.results || this.results.length <= 0 || this._resultsIteratorIndex >= this.results.length) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (this.results[this._resultsIteratorIndex] instanceof Traverser) {
|
|
69
|
+
return this.results[this._resultsIteratorIndex].bulk > 0 || this._resultsIteratorIndex + 1 < this.results.length;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Iterates all Traverser instances in the traversal.
|
|
78
|
+
* @returns {Promise}
|
|
79
|
+
*/
|
|
80
|
+
iterate() {
|
|
81
|
+
this.gremlinLang.addStep('discard');
|
|
82
|
+
return this._applyStrategies().then(() => {
|
|
83
|
+
let it;
|
|
84
|
+
while ((it = this._getNext()) && !it.done) {
|
|
85
|
+
//
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Async iterator method implementation.
|
|
91
|
+
* Returns a promise containing an iterator item.
|
|
92
|
+
* @returns {Promise.<{value, done}>}
|
|
93
|
+
*/
|
|
94
|
+
next() {
|
|
95
|
+
return this._applyStrategies().then(() => this._getNext());
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Synchronous iterator of traversers including
|
|
99
|
+
* @private
|
|
100
|
+
*/
|
|
101
|
+
_getNext() {
|
|
102
|
+
while (this.results && this._resultsIteratorIndex < this.results.length) {
|
|
103
|
+
const next = this.results[this._resultsIteratorIndex];
|
|
104
|
+
if (next instanceof Traverser) {
|
|
105
|
+
if (next.bulk > 0) {
|
|
106
|
+
next.bulk--;
|
|
107
|
+
return { value: next.object, done: false };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
this._resultsIteratorIndex++;
|
|
111
|
+
if (!(next instanceof Traverser)) {
|
|
112
|
+
return { value: next, done: false };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return itemDone;
|
|
116
|
+
}
|
|
117
|
+
_applyStrategies() {
|
|
118
|
+
if (this._traversalStrategiesPromise) {
|
|
119
|
+
// Apply strategies only once
|
|
120
|
+
return this._traversalStrategiesPromise;
|
|
121
|
+
}
|
|
122
|
+
return (this._traversalStrategiesPromise = this.traversalStrategies?.applyStrategies(this) ?? Promise.resolve());
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Returns step instructions during JSON serialization
|
|
126
|
+
* @returns {Array}
|
|
127
|
+
*/
|
|
128
|
+
toJSON() {
|
|
129
|
+
return this.gremlinLang.getGremlin();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Returns the GremlinLang representation of the traversal
|
|
133
|
+
* @returns {String}
|
|
134
|
+
*/
|
|
135
|
+
toString() {
|
|
136
|
+
return this.gremlinLang.getGremlin();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export class IO {
|
|
140
|
+
static get graphml() {
|
|
141
|
+
return 'graphml';
|
|
142
|
+
}
|
|
143
|
+
static get graphson() {
|
|
144
|
+
return 'graphson';
|
|
145
|
+
}
|
|
146
|
+
static get gryo() {
|
|
147
|
+
return 'gryo';
|
|
148
|
+
}
|
|
149
|
+
static get reader() {
|
|
150
|
+
return '~tinkerpop.io.reader';
|
|
151
|
+
}
|
|
152
|
+
static get registry() {
|
|
153
|
+
return '~tinkerpop.io.registry';
|
|
154
|
+
}
|
|
155
|
+
static get writer() {
|
|
156
|
+
return '~tinkerpop.io.writer';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// eslint-disable-next-line no-unused-vars
|
|
160
|
+
class ConnectedComponent {
|
|
161
|
+
static get component() {
|
|
162
|
+
return 'gremlin.connectedComponentVertexProgram.component';
|
|
163
|
+
}
|
|
164
|
+
static get edges() {
|
|
165
|
+
return '~tinkerpop.connectedComponent.edges';
|
|
166
|
+
}
|
|
167
|
+
static get propertyName() {
|
|
168
|
+
return '~tinkerpop.connectedComponent.propertyName';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// eslint-disable-next-line no-unused-vars
|
|
172
|
+
class ShortestPath {
|
|
173
|
+
static get distance() {
|
|
174
|
+
return '~tinkerpop.shortestPath.distance';
|
|
175
|
+
}
|
|
176
|
+
static get edges() {
|
|
177
|
+
return '~tinkerpop.shortestPath.edges';
|
|
178
|
+
}
|
|
179
|
+
static get includeEdges() {
|
|
180
|
+
return '~tinkerpop.shortestPath.includeEdges';
|
|
181
|
+
}
|
|
182
|
+
static get maxDistance() {
|
|
183
|
+
return '~tinkerpop.shortestPath.maxDistance';
|
|
184
|
+
}
|
|
185
|
+
static get target() {
|
|
186
|
+
return '~tinkerpop.shortestPath.target';
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// eslint-disable-next-line no-unused-vars
|
|
190
|
+
class PageRank {
|
|
191
|
+
static get edges() {
|
|
192
|
+
return '~tinkerpop.pageRank.edges';
|
|
193
|
+
}
|
|
194
|
+
static get propertyName() {
|
|
195
|
+
return '~tinkerpop.pageRank.propertyName';
|
|
196
|
+
}
|
|
197
|
+
static get times() {
|
|
198
|
+
return '~tinkerpop.pageRank.times';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// eslint-disable-next-line no-unused-vars
|
|
202
|
+
class PeerPressure {
|
|
203
|
+
static get edges() {
|
|
204
|
+
return '~tinkerpop.peerPressure.edges';
|
|
205
|
+
}
|
|
206
|
+
static get propertyName() {
|
|
207
|
+
return '~tinkerpop.peerPressure.propertyName';
|
|
208
|
+
}
|
|
209
|
+
static get times() {
|
|
210
|
+
return '~tinkerpop.peerPressure.times';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export class P {
|
|
214
|
+
operator;
|
|
215
|
+
value;
|
|
216
|
+
other;
|
|
217
|
+
/**
|
|
218
|
+
* Represents an operation.
|
|
219
|
+
*/
|
|
220
|
+
constructor(operator, value, other) {
|
|
221
|
+
this.operator = operator;
|
|
222
|
+
this.value = value;
|
|
223
|
+
this.other = other;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Returns the string representation of the instance.
|
|
227
|
+
* @returns {string}
|
|
228
|
+
*/
|
|
229
|
+
toString() {
|
|
230
|
+
function formatValue(value) {
|
|
231
|
+
if (Array.isArray(value)) {
|
|
232
|
+
const acc = [];
|
|
233
|
+
for (const item of value) {
|
|
234
|
+
acc.push(formatValue(item));
|
|
235
|
+
}
|
|
236
|
+
return '[' + acc.join(', ') + ']';
|
|
237
|
+
}
|
|
238
|
+
if (value && typeof value === 'string') {
|
|
239
|
+
return `'${value}'`;
|
|
240
|
+
}
|
|
241
|
+
return String(value);
|
|
242
|
+
}
|
|
243
|
+
if (this.other === undefined || this.other === null) {
|
|
244
|
+
return this.operator + '(' + formatValue(this.value) + ')';
|
|
245
|
+
}
|
|
246
|
+
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
|
|
247
|
+
}
|
|
248
|
+
and(arg) {
|
|
249
|
+
return new P('and', this, arg);
|
|
250
|
+
}
|
|
251
|
+
or(arg) {
|
|
252
|
+
return new P('or', this, arg);
|
|
253
|
+
}
|
|
254
|
+
static within(...args) {
|
|
255
|
+
if (args.length === 1 && Array.isArray(args[0])) {
|
|
256
|
+
return new P('within', args[0], null);
|
|
257
|
+
}
|
|
258
|
+
return new P('within', args, null);
|
|
259
|
+
}
|
|
260
|
+
static without(...args) {
|
|
261
|
+
if (args.length === 1 && Array.isArray(args[0])) {
|
|
262
|
+
return new P('without', args[0], null);
|
|
263
|
+
}
|
|
264
|
+
return new P('without', args, null);
|
|
265
|
+
}
|
|
266
|
+
/** @param {...Object} args */
|
|
267
|
+
static between(...args) {
|
|
268
|
+
return createP('between', args);
|
|
269
|
+
}
|
|
270
|
+
/** @param {...Object} args */
|
|
271
|
+
static eq(...args) {
|
|
272
|
+
return createP('eq', args);
|
|
273
|
+
}
|
|
274
|
+
/** @param {...Object} args */
|
|
275
|
+
static gt(...args) {
|
|
276
|
+
return createP('gt', args);
|
|
277
|
+
}
|
|
278
|
+
/** @param {...Object} args */
|
|
279
|
+
static gte(...args) {
|
|
280
|
+
return createP('gte', args);
|
|
281
|
+
}
|
|
282
|
+
/** @param {...Object} args */
|
|
283
|
+
static inside(...args) {
|
|
284
|
+
return createP('inside', args);
|
|
285
|
+
}
|
|
286
|
+
/** @param {...Object} args */
|
|
287
|
+
static lt(...args) {
|
|
288
|
+
return createP('lt', args);
|
|
289
|
+
}
|
|
290
|
+
/** @param {...Object} args */
|
|
291
|
+
static lte(...args) {
|
|
292
|
+
return createP('lte', args);
|
|
293
|
+
}
|
|
294
|
+
/** @param {...Object} args */
|
|
295
|
+
static neq(...args) {
|
|
296
|
+
return createP('neq', args);
|
|
297
|
+
}
|
|
298
|
+
/** @param {...Object} args */
|
|
299
|
+
static not(...args) {
|
|
300
|
+
return createP('not', args);
|
|
301
|
+
}
|
|
302
|
+
/** @param {...Object} args */
|
|
303
|
+
static outside(...args) {
|
|
304
|
+
return createP('outside', args);
|
|
305
|
+
}
|
|
306
|
+
/** @param {...Object} args */
|
|
307
|
+
static typeOf(...args) {
|
|
308
|
+
return createP('typeOf', args);
|
|
309
|
+
}
|
|
310
|
+
/** @param {...Object} args */
|
|
311
|
+
static test(...args) {
|
|
312
|
+
return createP('test', args);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function createP(operator, args) {
|
|
316
|
+
args.unshift(null, operator);
|
|
317
|
+
return new (Function.prototype.bind.apply(P, args))();
|
|
318
|
+
}
|
|
319
|
+
export class TextP {
|
|
320
|
+
operator;
|
|
321
|
+
value;
|
|
322
|
+
other;
|
|
323
|
+
/**
|
|
324
|
+
* Represents an operation.
|
|
325
|
+
*/
|
|
326
|
+
constructor(operator, value, other) {
|
|
327
|
+
this.operator = operator;
|
|
328
|
+
this.value = value;
|
|
329
|
+
this.other = other;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Returns the string representation of the instance.
|
|
333
|
+
* @returns {string}
|
|
334
|
+
*/
|
|
335
|
+
toString() {
|
|
336
|
+
function formatValue(value) {
|
|
337
|
+
if (value && typeof value === 'string') {
|
|
338
|
+
return `'${value}'`;
|
|
339
|
+
}
|
|
340
|
+
return value;
|
|
341
|
+
}
|
|
342
|
+
if (this.other === undefined) {
|
|
343
|
+
return this.operator + '(' + formatValue(this.value) + ')';
|
|
344
|
+
}
|
|
345
|
+
return this.operator + '(' + formatValue(this.value) + ', ' + formatValue(this.other) + ')';
|
|
346
|
+
}
|
|
347
|
+
and(arg) {
|
|
348
|
+
return new P('and', this, arg);
|
|
349
|
+
}
|
|
350
|
+
or(arg) {
|
|
351
|
+
return new P('or', this, arg);
|
|
352
|
+
}
|
|
353
|
+
/** @param {...Object} args */
|
|
354
|
+
static containing(...args) {
|
|
355
|
+
return createTextP('containing', args);
|
|
356
|
+
}
|
|
357
|
+
/** @param {...Object} args */
|
|
358
|
+
static endingWith(...args) {
|
|
359
|
+
return createTextP('endingWith', args);
|
|
360
|
+
}
|
|
361
|
+
/** @param {...Object} args */
|
|
362
|
+
static notContaining(...args) {
|
|
363
|
+
return createTextP('notContaining', args);
|
|
364
|
+
}
|
|
365
|
+
/** @param {...Object} args */
|
|
366
|
+
static notEndingWith(...args) {
|
|
367
|
+
return createTextP('notEndingWith', args);
|
|
368
|
+
}
|
|
369
|
+
/** @param {...Object} args */
|
|
370
|
+
static notStartingWith(...args) {
|
|
371
|
+
return createTextP('notStartingWith', args);
|
|
372
|
+
}
|
|
373
|
+
/** @param {...Object} args */
|
|
374
|
+
static startingWith(...args) {
|
|
375
|
+
return createTextP('startingWith', args);
|
|
376
|
+
}
|
|
377
|
+
/** @param {...Object} args */
|
|
378
|
+
static regex(...args) {
|
|
379
|
+
return createTextP('regex', args);
|
|
380
|
+
}
|
|
381
|
+
/** @param {...Object} args */
|
|
382
|
+
static notRegex(...args) {
|
|
383
|
+
return createTextP('notRegex', args);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function createTextP(operator, args) {
|
|
387
|
+
args.unshift(null, operator);
|
|
388
|
+
return new (Function.prototype.bind.apply(TextP, args))();
|
|
389
|
+
}
|
|
390
|
+
export class Traverser {
|
|
391
|
+
object;
|
|
392
|
+
bulk;
|
|
393
|
+
constructor(object, bulk) {
|
|
394
|
+
this.object = object;
|
|
395
|
+
this.bulk = bulk;
|
|
396
|
+
this.bulk = bulk || 1;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
export class TraversalSideEffects {
|
|
400
|
+
}
|
|
401
|
+
export const withOptions = {
|
|
402
|
+
tokens: '~tinkerpop.valueMap.tokens',
|
|
403
|
+
none: 0,
|
|
404
|
+
ids: 1,
|
|
405
|
+
labels: 2,
|
|
406
|
+
keys: 4,
|
|
407
|
+
values: 8,
|
|
408
|
+
all: 15,
|
|
409
|
+
indexer: '~tinkerpop.index.indexer',
|
|
410
|
+
list: 0,
|
|
411
|
+
map: 1,
|
|
412
|
+
};
|
|
413
|
+
function toEnum(typeName, keys) {
|
|
414
|
+
const result = {};
|
|
415
|
+
keys.split(' ').forEach((k) => {
|
|
416
|
+
let jsKey = k;
|
|
417
|
+
if (jsKey === jsKey.toUpperCase()) {
|
|
418
|
+
jsKey = jsKey.toLowerCase();
|
|
419
|
+
}
|
|
420
|
+
result[jsKey] = new EnumValue(typeName, k);
|
|
421
|
+
});
|
|
422
|
+
return result;
|
|
423
|
+
}
|
|
424
|
+
const directionAlias = {
|
|
425
|
+
from_: 'out',
|
|
426
|
+
to: 'in',
|
|
427
|
+
};
|
|
428
|
+
// for direction enums, maps the same EnumValue object to the enum aliases after creating them
|
|
429
|
+
function toDirectionEnum(typeName, keys) {
|
|
430
|
+
const result = toEnum(typeName, keys);
|
|
431
|
+
Object.keys(directionAlias).forEach((k) => {
|
|
432
|
+
result[k] = result[directionAlias[k]];
|
|
433
|
+
});
|
|
434
|
+
return result;
|
|
435
|
+
}
|
|
436
|
+
function toGTypeEnum(typeName, keys) {
|
|
437
|
+
const result = {};
|
|
438
|
+
keys.split(' ').forEach((k) => {
|
|
439
|
+
result[k] = new EnumValue(typeName, k.toUpperCase());
|
|
440
|
+
});
|
|
441
|
+
return result;
|
|
442
|
+
}
|
|
443
|
+
export class EnumValue {
|
|
444
|
+
typeName;
|
|
445
|
+
elementName;
|
|
446
|
+
constructor(typeName, elementName) {
|
|
447
|
+
this.typeName = typeName;
|
|
448
|
+
this.elementName = elementName;
|
|
449
|
+
}
|
|
450
|
+
toString() {
|
|
451
|
+
return this.typeName + '.' + this.elementName;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
export const barrier = toEnum('Barrier', 'normSack');
|
|
455
|
+
export const cardinality = toEnum('Cardinality', 'list set single');
|
|
456
|
+
export const column = toEnum('Column', 'keys values');
|
|
457
|
+
export const direction = toDirectionEnum('Direction', 'BOTH IN OUT from_ to');
|
|
458
|
+
export const dt = toEnum('DT', 'second minute hour day');
|
|
459
|
+
export const gType = toGTypeEnum('GType', 'bigDecimal bigInt binary boolean byte char datetime double duration edge float graph int list long map null number path property set short string tree uuid vertex vproperty');
|
|
460
|
+
export const graphSONVersion = toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0');
|
|
461
|
+
export const gryoVersion = toEnum('GryoVersion', 'V1_0 V3_0');
|
|
462
|
+
export const merge = toEnum('Merge', 'onCreate onMatch outV inV');
|
|
463
|
+
export const operator = toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong');
|
|
464
|
+
export const order = toEnum('Order', 'asc desc shuffle');
|
|
465
|
+
export const pick = toEnum('Pick', 'any none unproductive');
|
|
466
|
+
export const pop = toEnum('Pop', 'all first last mixed');
|
|
467
|
+
export const scope = toEnum('Scope', 'global local');
|
|
468
|
+
export const t = toEnum('T', 'id key label value');
|
|
469
|
+
export const n = toEnum('N', 'byte_ short_ int_ long_ float_ double_ bigInt bigDecimal');
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Jorge Bay Gondra
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* An "empty" graph object to server only as a reference.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Graph {
|
|
8
|
+
toString(): string;
|
|
9
|
+
}
|
|
10
|
+
declare class Element<TLabel extends string = string, TId = any> {
|
|
11
|
+
readonly id: TId;
|
|
12
|
+
readonly label: TLabel;
|
|
13
|
+
readonly properties: Property[];
|
|
14
|
+
constructor(id: TId, label: TLabel, properties?: Property[]);
|
|
15
|
+
/**
|
|
16
|
+
* Compares this instance to another and determines if they can be considered as equal.
|
|
17
|
+
*/
|
|
18
|
+
equals(other: any): boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class Vertex<TLabel extends string = string, TProperties extends Record<string, any> = Record<string, any>, TId = number, TVertexProperties = {
|
|
21
|
+
[P in keyof TProperties]: P extends string ? VertexProperties<P, TProperties[P]> : never;
|
|
22
|
+
}> extends Element<TLabel, TId> {
|
|
23
|
+
constructor(id: TId, label: TLabel, properties?: Property[] | null);
|
|
24
|
+
toString(): string;
|
|
25
|
+
}
|
|
26
|
+
export declare class Edge<TOutVertex extends Vertex = Vertex, TLabel extends string = string, TInVertex extends Vertex = Vertex, TProperties extends Record<string, any> = Record<string, any>, TId = number> extends Element<TLabel, TId> {
|
|
27
|
+
readonly outV: TOutVertex;
|
|
28
|
+
readonly label: TLabel;
|
|
29
|
+
readonly inV: TInVertex;
|
|
30
|
+
constructor(id: TId, outV: TOutVertex, label: TLabel, inV: TInVertex, properties?: Property[] | null);
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
33
|
+
export declare class VertexProperty<TLabel extends string = string, TValue = any, TProperties extends Record<string, any> | null | undefined = Record<string, any>, TId = any> extends Element<TLabel, TId> {
|
|
34
|
+
readonly value: TValue;
|
|
35
|
+
readonly key: string;
|
|
36
|
+
constructor(id: TId, label: TLabel, value: TValue, properties?: Property[] | null);
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
39
|
+
export type VertexProperties<TLabel extends string = string, TValue = any, TProperties extends Record<string, any> = Record<string, any>, TId = any> = [VertexProperty<TLabel, TValue, TProperties, TId>, ...Array<VertexProperty<TLabel, TValue, TProperties, TId>>];
|
|
40
|
+
export declare class Property<T = any> {
|
|
41
|
+
readonly key: string;
|
|
42
|
+
readonly value: T;
|
|
43
|
+
constructor(key: string, value: T);
|
|
44
|
+
toString(): string;
|
|
45
|
+
equals(other: any): boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents a walk through a graph as defined by a traversal.
|
|
49
|
+
*/
|
|
50
|
+
export declare class Path {
|
|
51
|
+
readonly labels: string[][];
|
|
52
|
+
readonly objects: any[];
|
|
53
|
+
constructor(labels: string[][], objects: any[]);
|
|
54
|
+
toString(): string;
|
|
55
|
+
equals(other: any): any;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
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
|
+
/**
|
|
23
|
+
* An "empty" graph object to server only as a reference.
|
|
24
|
+
*/
|
|
25
|
+
export class Graph {
|
|
26
|
+
toString() {
|
|
27
|
+
return 'graph[]';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
class Element {
|
|
31
|
+
id;
|
|
32
|
+
label;
|
|
33
|
+
properties;
|
|
34
|
+
// properties are stored as list of property objects
|
|
35
|
+
constructor(id, label, properties = []) {
|
|
36
|
+
this.id = id;
|
|
37
|
+
this.label = label;
|
|
38
|
+
this.properties = properties;
|
|
39
|
+
this.properties = properties ?? [];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Compares this instance to another and determines if they can be considered as equal.
|
|
43
|
+
*/
|
|
44
|
+
equals(other) {
|
|
45
|
+
return other instanceof Element && this.id === other.id;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class Vertex extends Element {
|
|
49
|
+
constructor(id, label, properties = []) {
|
|
50
|
+
super(id, label, properties ?? []);
|
|
51
|
+
}
|
|
52
|
+
toString() {
|
|
53
|
+
return `v[${this.id}]`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export class Edge extends Element {
|
|
57
|
+
outV;
|
|
58
|
+
label;
|
|
59
|
+
inV;
|
|
60
|
+
constructor(id, outV, label, inV, properties = []) {
|
|
61
|
+
super(id, label, properties ?? []);
|
|
62
|
+
this.outV = outV;
|
|
63
|
+
this.label = label;
|
|
64
|
+
this.inV = inV;
|
|
65
|
+
}
|
|
66
|
+
toString() {
|
|
67
|
+
const outVId = this.outV ? this.outV.id : '?';
|
|
68
|
+
const inVId = this.inV ? this.inV.id : '?';
|
|
69
|
+
return `e[${this.id}][${outVId}-${this.label}->${inVId}]`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export class VertexProperty extends Element {
|
|
73
|
+
value;
|
|
74
|
+
key;
|
|
75
|
+
constructor(id, label, value, properties = []) {
|
|
76
|
+
super(id, label, properties ?? []);
|
|
77
|
+
this.value = value;
|
|
78
|
+
this.value = value;
|
|
79
|
+
this.key = this.label;
|
|
80
|
+
}
|
|
81
|
+
toString() {
|
|
82
|
+
return `vp[${this.label}->${summarize(this.value)}]`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export class Property {
|
|
86
|
+
key;
|
|
87
|
+
value;
|
|
88
|
+
constructor(key, value) {
|
|
89
|
+
this.key = key;
|
|
90
|
+
this.value = value;
|
|
91
|
+
}
|
|
92
|
+
toString() {
|
|
93
|
+
return `p[${this.key}->${summarize(this.value)}]`;
|
|
94
|
+
}
|
|
95
|
+
equals(other) {
|
|
96
|
+
return other instanceof Property && this.key === other.key && this.value === other.value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Represents a walk through a graph as defined by a traversal.
|
|
101
|
+
*/
|
|
102
|
+
export class Path {
|
|
103
|
+
labels;
|
|
104
|
+
objects;
|
|
105
|
+
constructor(labels, objects) {
|
|
106
|
+
this.labels = labels;
|
|
107
|
+
this.objects = objects;
|
|
108
|
+
}
|
|
109
|
+
toString() {
|
|
110
|
+
return `path[${(this.objects || []).join(', ')}]`;
|
|
111
|
+
}
|
|
112
|
+
equals(other) {
|
|
113
|
+
if (!(other instanceof Path)) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (other === this) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return areEqual(this.objects, other.objects) && areEqual(this.labels, other.labels);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function areEqual(obj1, obj2) {
|
|
123
|
+
if (obj1 === obj2) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
if (typeof obj1.equals === 'function') {
|
|
127
|
+
return obj1.equals(obj2);
|
|
128
|
+
}
|
|
129
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
130
|
+
if (obj1.length !== obj2.length) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
134
|
+
if (!areEqual(obj1[i], obj2[i])) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
function summarize(value) {
|
|
143
|
+
if (value === null || value === undefined) {
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
const strValue = value.toString();
|
|
147
|
+
return strValue.length > 20 ? strValue.substr(0, 20) : strValue;
|
|
148
|
+
}
|