gremlin 3.8.1 → 4.0.0-beta.3
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 +76 -0
- package/build/cjs/driver/auth.d.cts +9 -0
- package/build/cjs/driver/client.cjs +178 -0
- package/build/cjs/driver/client.d.cts +88 -0
- package/build/cjs/driver/connection.cjs +363 -0
- package/build/cjs/driver/connection.d.cts +106 -0
- package/build/cjs/driver/dispatcher.browser.cjs +57 -0
- package/build/cjs/driver/dispatcher.browser.d.cts +35 -0
- package/build/cjs/driver/dispatcher.cjs +101 -0
- package/build/cjs/driver/dispatcher.d.cts +48 -0
- package/build/cjs/driver/driver-remote-connection.cjs +153 -0
- package/build/cjs/driver/driver-remote-connection.d.cts +39 -0
- package/build/cjs/driver/http-request.cjs +64 -0
- package/build/cjs/driver/http-request.d.cts +28 -0
- package/build/cjs/driver/logger.cjs +45 -0
- package/build/cjs/driver/logger.d.cts +29 -0
- package/build/cjs/driver/remote-connection.cjs +72 -0
- package/build/cjs/driver/remote-connection.d.cts +57 -0
- package/build/cjs/driver/request-message.cjs +246 -0
- package/build/cjs/driver/request-message.d.cts +79 -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 +146 -0
- package/build/cjs/index.d.cts +440 -0
- package/build/cjs/language/grammar/GremlinLexer.cjs +1905 -0
- package/build/cjs/language/grammar/GremlinLexer.d.cts +349 -0
- package/build/cjs/language/grammar/GremlinListener.cjs +4804 -0
- package/build/cjs/language/grammar/GremlinListener.d.cts +5239 -0
- package/build/cjs/language/grammar/GremlinParser.cjs +38146 -0
- package/build/cjs/language/grammar/GremlinParser.d.cts +6260 -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 +166 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.d.cts +39 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.cjs +935 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.d.cts +166 -0
- package/build/cjs/language/translator/GoTranslateVisitor.cjs +421 -0
- package/build/cjs/language/translator/GoTranslateVisitor.d.cts +40 -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 +310 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.d.cts +37 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.cjs +270 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.d.cts +26 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.cjs +231 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.d.cts +28 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.cjs +340 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.d.cts +31 -0
- package/build/cjs/language/translator/TranslateVisitor.cjs +398 -0
- package/build/cjs/language/translator/TranslateVisitor.d.cts +94 -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 +82 -0
- package/build/cjs/process/anonymous-traversal.d.cts +40 -0
- package/build/cjs/process/graph-traversal.cjs +1833 -0
- package/build/cjs/process/graph-traversal.d.cts +1215 -0
- package/build/cjs/process/gremlin-lang.cjs +308 -0
- package/build/cjs/process/gremlin-lang.d.cts +20 -0
- package/{lib/driver/response-error.js → build/cjs/process/gvalue.cjs} +23 -28
- package/build/cjs/process/gvalue.d.cts +7 -0
- package/build/cjs/process/transaction.cjs +171 -0
- package/build/cjs/process/transaction.d.cts +70 -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 +539 -0
- package/build/cjs/process/traversal.d.cts +212 -0
- package/build/cjs/structure/PDTRegistry.cjs +116 -0
- package/build/cjs/structure/PDTRegistry.d.cts +34 -0
- package/build/cjs/structure/graph.cjs +500 -0
- package/build/cjs/structure/graph.d.cts +176 -0
- package/build/cjs/structure/io/binary/GraphBinary.cjs +177 -0
- package/build/cjs/structure/io/binary/GraphBinary.d.cts +105 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.cjs +97 -0
- package/build/cjs/structure/io/binary/internals/AnySerializer.d.cts +18 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.cjs +108 -0
- package/build/cjs/structure/io/binary/internals/ArraySerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.cjs +116 -0
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.cjs +92 -0
- package/build/cjs/structure/io/binary/internals/BinarySerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.cjs +79 -0
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.cjs +74 -0
- package/build/cjs/structure/io/binary/internals/ByteSerializer.d.cts +18 -0
- package/build/cjs/structure/io/binary/internals/CompositePDTSerializer.cjs +81 -0
- package/build/cjs/structure/io/binary/internals/CompositePDTSerializer.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 +122 -0
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.d.cts +20 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.cjs +77 -0
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.cjs +146 -0
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.cjs +115 -0
- package/build/cjs/structure/io/binary/internals/EnumSerializer.d.cts +39 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.cjs +77 -0
- package/build/cjs/structure/io/binary/internals/FloatSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.cjs +171 -0
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.d.cts +43 -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/GraphSerializer.cjs +184 -0
- package/build/cjs/structure/io/binary/internals/GraphSerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.cjs +98 -0
- package/build/cjs/structure/io/binary/internals/IntSerializer.d.cts +28 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.cjs +82 -0
- package/build/cjs/structure/io/binary/internals/LongSerializer.d.cts +20 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.cjs +110 -0
- package/build/cjs/structure/io/binary/internals/MapSerializer.d.cts +20 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.cjs +60 -0
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.d.cts +17 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.cjs +92 -0
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.d.cts +6 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.cjs +88 -0
- package/build/cjs/structure/io/binary/internals/PathSerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/PrimitivePDTSerializer.cjs +80 -0
- package/build/cjs/structure/io/binary/internals/PrimitivePDTSerializer.d.cts +10 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.cjs +93 -0
- package/build/cjs/structure/io/binary/internals/PropertySerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.cjs +104 -0
- package/build/cjs/structure/io/binary/internals/SetSerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.cjs +77 -0
- package/build/cjs/structure/io/binary/internals/ShortSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/StreamReader.cjs +184 -0
- package/build/cjs/structure/io/binary/internals/StreamReader.d.cts +69 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.cjs +88 -0
- package/build/cjs/structure/io/binary/internals/StringSerializer.d.cts +21 -0
- package/build/cjs/structure/io/binary/internals/StubSerializer.cjs +33 -0
- package/build/cjs/structure/io/binary/internals/StubSerializer.d.cts +7 -0
- package/build/cjs/structure/io/binary/internals/TreeSerializer.cjs +139 -0
- package/build/cjs/structure/io/binary/internals/TreeSerializer.d.cts +54 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.cjs +47 -0
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.d.cts +13 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.cjs +93 -0
- package/build/cjs/structure/io/binary/internals/UuidSerializer.d.cts +19 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.cjs +105 -0
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.d.cts +22 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.cjs +101 -0
- package/build/cjs/structure/io/binary/internals/VertexSerializer.d.cts +22 -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 +259 -0
- package/build/cjs/utils.d.cts +78 -0
- package/build/esm/driver/auth.d.ts +9 -0
- package/build/esm/driver/auth.js +72 -0
- package/build/esm/driver/client.d.ts +88 -0
- package/build/esm/driver/client.js +172 -0
- package/build/esm/driver/connection.d.ts +106 -0
- package/build/esm/driver/connection.js +323 -0
- package/build/esm/driver/dispatcher.browser.d.ts +35 -0
- package/build/esm/driver/dispatcher.browser.js +53 -0
- package/build/esm/driver/dispatcher.d.ts +48 -0
- package/build/esm/driver/dispatcher.js +94 -0
- package/build/esm/driver/driver-remote-connection.d.ts +39 -0
- package/build/esm/driver/driver-remote-connection.js +114 -0
- package/build/esm/driver/http-request.d.ts +28 -0
- package/build/esm/driver/http-request.js +60 -0
- package/build/esm/driver/logger.d.ts +29 -0
- package/build/esm/driver/logger.js +42 -0
- package/build/esm/driver/remote-connection.d.ts +57 -0
- package/build/esm/driver/remote-connection.js +66 -0
- package/build/esm/driver/request-message.d.ts +79 -0
- package/build/esm/driver/request-message.js +238 -0
- package/build/esm/driver/response-error.d.ts +13 -0
- package/{lib/driver/auth/mechanisms/sasl-mechanism-base.js → build/esm/driver/response-error.js} +24 -34
- 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 +440 -0
- package/{index.js → build/esm/index.js} +44 -33
- package/build/esm/language/grammar/GremlinLexer.d.ts +349 -0
- package/build/esm/language/grammar/GremlinLexer.js +1868 -0
- package/build/esm/language/grammar/GremlinListener.d.ts +5239 -0
- package/build/esm/language/grammar/GremlinListener.js +4800 -0
- package/build/esm/language/grammar/GremlinParser.d.ts +6260 -0
- package/build/esm/language/grammar/GremlinParser.js +37579 -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 +39 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.js +160 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.d.ts +166 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.js +929 -0
- package/build/esm/language/translator/GoTranslateVisitor.d.ts +40 -0
- package/build/esm/language/translator/GoTranslateVisitor.js +415 -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 +37 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.js +304 -0
- package/build/esm/language/translator/JavaTranslateVisitor.d.ts +26 -0
- package/build/esm/language/translator/JavaTranslateVisitor.js +264 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.d.ts +28 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.js +225 -0
- package/build/esm/language/translator/PythonTranslateVisitor.d.ts +31 -0
- package/build/esm/language/translator/PythonTranslateVisitor.js +334 -0
- package/build/esm/language/translator/TranslateVisitor.d.ts +94 -0
- package/build/esm/language/translator/TranslateVisitor.js +395 -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 +76 -0
- package/build/esm/process/graph-traversal.d.ts +1215 -0
- package/build/esm/process/graph-traversal.js +1824 -0
- package/build/esm/process/gremlin-lang.d.ts +20 -0
- package/build/esm/process/gremlin-lang.js +305 -0
- package/build/esm/process/gvalue.d.ts +7 -0
- package/{lib/driver/auth/authenticator.js → build/esm/process/gvalue.js} +19 -19
- package/build/esm/process/transaction.d.ts +70 -0
- package/build/esm/process/transaction.js +164 -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 +212 -0
- package/build/esm/process/traversal.js +526 -0
- package/build/esm/structure/PDTRegistry.d.ts +34 -0
- package/build/esm/structure/PDTRegistry.js +112 -0
- package/build/esm/structure/graph.d.ts +176 -0
- package/build/esm/structure/graph.js +488 -0
- package/build/esm/structure/io/binary/GraphBinary.d.ts +105 -0
- package/build/esm/structure/io/binary/GraphBinary.js +136 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.d.ts +18 -0
- package/build/esm/structure/io/binary/internals/AnySerializer.js +94 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/ArraySerializer.js +105 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.js +113 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/BinarySerializer.js +89 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/BooleanSerializer.js +76 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.d.ts +18 -0
- package/build/esm/structure/io/binary/internals/ByteSerializer.js +71 -0
- package/build/esm/structure/io/binary/internals/CompositePDTSerializer.d.ts +10 -0
- package/build/esm/structure/io/binary/internals/CompositePDTSerializer.js +78 -0
- package/build/esm/structure/io/binary/internals/DataType.d.ts +35 -0
- package/build/esm/structure/io/binary/internals/DataType.js +61 -0
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.d.ts +20 -0
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.js +119 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/DoubleSerializer.js +74 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/EdgeSerializer.js +143 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.d.ts +39 -0
- package/build/esm/structure/io/binary/internals/EnumSerializer.js +112 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/FloatSerializer.js +74 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.d.ts +43 -0
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.js +165 -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/GraphSerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/GraphSerializer.js +181 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.d.ts +28 -0
- package/build/esm/structure/io/binary/internals/IntSerializer.js +95 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.d.ts +20 -0
- package/build/esm/structure/io/binary/internals/LongSerializer.js +79 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.d.ts +20 -0
- package/build/esm/structure/io/binary/internals/MapSerializer.js +107 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.d.ts +17 -0
- package/build/esm/structure/io/binary/internals/MarkerSerializer.js +56 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.d.ts +6 -0
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.js +89 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/PathSerializer.js +85 -0
- package/build/esm/structure/io/binary/internals/PrimitivePDTSerializer.d.ts +10 -0
- package/build/esm/structure/io/binary/internals/PrimitivePDTSerializer.js +77 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/PropertySerializer.js +90 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/SetSerializer.js +101 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/ShortSerializer.js +74 -0
- package/build/esm/structure/io/binary/internals/StreamReader.d.ts +69 -0
- package/build/esm/structure/io/binary/internals/StreamReader.js +181 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.d.ts +21 -0
- package/build/esm/structure/io/binary/internals/StringSerializer.js +85 -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 -11
- package/build/esm/structure/io/binary/internals/TreeSerializer.d.ts +54 -0
- package/build/esm/structure/io/binary/internals/TreeSerializer.js +136 -0
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.d.ts +13 -0
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.js +44 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.d.ts +19 -0
- package/build/esm/structure/io/binary/internals/UuidSerializer.js +90 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.js +102 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.d.ts +22 -0
- package/build/esm/structure/io/binary/internals/VertexSerializer.js +98 -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 +78 -0
- package/build/esm/utils.js +237 -0
- package/package.json +71 -26
- package/.nvmrc +0 -1
- package/NOTICE +0 -5
- package/doc/AnonymousTraversalSource.html +0 -793
- package/doc/Authenticator.html +0 -303
- package/doc/Bytecode.html +0 -941
- package/doc/CardinalityValue.html +0 -711
- package/doc/Client.html +0 -1869
- package/doc/Connection.html +0 -1192
- package/doc/DriverRemoteConnection.html +0 -1528
- package/doc/EdgeLabelVerificationStrategy.html +0 -238
- package/doc/Graph.html +0 -343
- package/doc/GraphSON2Reader.html +0 -407
- package/doc/GraphSON2Writer.html +0 -558
- package/doc/GraphSON3Reader.html +0 -170
- package/doc/GraphSON3Writer.html +0 -170
- package/doc/GraphTraversal.html +0 -22974
- package/doc/GraphTraversalSource.html +0 -3683
- package/doc/HaltedTraverserStrategy.html +0 -215
- package/doc/MatchAlgorithmStrategy.html +0 -210
- package/doc/P.html +0 -2020
- package/doc/PartitionStrategy.html +0 -387
- package/doc/Path.html +0 -242
- package/doc/PlainTextSaslAuthenticator.html +0 -456
- package/doc/ProductiveByStrategy.html +0 -258
- package/doc/RemoteConnection.html +0 -1086
- package/doc/RemoteStrategy.html +0 -307
- package/doc/RemoteTraversal.html +0 -170
- package/doc/ReservedKeysVerificationStrategy.html +0 -261
- package/doc/ResponseError.html +0 -360
- package/doc/ResultSet.html +0 -633
- package/doc/SaslAuthenticator.html +0 -455
- package/doc/SaslMechanismBase.html +0 -506
- package/doc/SaslMechanismPlain.html +0 -925
- package/doc/SeedStrategy.html +0 -288
- package/doc/SubgraphStrategy.html +0 -387
- package/doc/TextP.html +0 -1440
- package/doc/Transaction.html +0 -655
- package/doc/Translator.html +0 -527
- package/doc/TraversalStrategies.html +0 -652
- package/doc/TraversalStrategy.html +0 -393
- package/doc/TypeSerializer.html +0 -166
- package/doc/driver_auth_authenticator.js.html +0 -89
- package/doc/driver_auth_mechanisms_sasl-mechanism-base.js.html +0 -103
- package/doc/driver_auth_mechanisms_sasl-mechanism-plain.js.html +0 -157
- package/doc/driver_auth_plain-text-sasl-authenticator.js.html +0 -106
- package/doc/driver_auth_sasl-authenticator.js.html +0 -100
- package/doc/driver_client.js.html +0 -250
- package/doc/driver_connection.js.html +0 -518
- package/doc/driver_driver-remote-connection.js.html +0 -193
- package/doc/driver_remote-connection.js.html +0 -198
- package/doc/driver_response-error.js.html +0 -98
- package/doc/driver_result-set.js.html +0 -134
- package/doc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/doc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/doc/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/doc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/doc/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/doc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/doc/global.html +0 -728
- package/doc/index.html +0 -185
- package/doc/module.exports.html +0 -301
- package/doc/process_anonymous-traversal.js.html +0 -138
- package/doc/process_bytecode.js.html +0 -175
- package/doc/process_graph-traversal.js.html +0 -1936
- package/doc/process_transaction.js.html +0 -151
- package/doc/process_translator.js.html +0 -172
- package/doc/process_traversal-strategy.js.html +0 -466
- package/doc/process_traversal.js.html +0 -592
- package/doc/scripts/linenumber.js +0 -25
- package/doc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/doc/scripts/prettify/lang-css.js +0 -2
- package/doc/scripts/prettify/prettify.js +0 -28
- package/doc/structure_graph.js.html +0 -233
- package/doc/structure_io_binary_internals_DataType.js.html +0 -151
- package/doc/structure_io_binary_internals_GraphBinaryReader.js.html +0 -133
- package/doc/structure_io_binary_internals_GraphBinaryWriter.js.html +0 -136
- package/doc/structure_io_graph-serializer.js.html +0 -354
- package/doc/structure_io_type-serializers.js.html +0 -617
- package/doc/styles/jsdoc-default.css +0 -358
- package/doc/styles/prettify-jsdoc.css +0 -111
- package/doc/styles/prettify-tomorrow.css +0 -132
- package/doc/utils.js.html +0 -181
- package/docker-compose.yml +0 -76
- package/eslint.config.mjs +0 -143
- package/lib/driver/auth/mechanisms/sasl-mechanism-plain.js +0 -106
- package/lib/driver/auth/plain-text-sasl-authenticator.js +0 -55
- package/lib/driver/auth/sasl-authenticator.js +0 -49
- package/lib/driver/client.js +0 -199
- package/lib/driver/connection.js +0 -467
- package/lib/driver/driver-remote-connection.js +0 -142
- package/lib/driver/remote-connection.js +0 -147
- package/lib/driver/result-set.js +0 -83
- package/lib/process/anonymous-traversal.js +0 -87
- package/lib/process/bytecode.js +0 -124
- package/lib/process/graph-traversal.js +0 -1885
- package/lib/process/transaction.js +0 -100
- package/lib/process/translator.js +0 -121
- package/lib/process/traversal-strategy.js +0 -415
- package/lib/process/traversal.js +0 -541
- package/lib/structure/graph.js +0 -182
- package/lib/structure/io/binary/GraphBinary.js +0 -110
- package/lib/structure/io/binary/internals/AnySerializer.js +0 -100
- package/lib/structure/io/binary/internals/ArraySerializer.js +0 -137
- package/lib/structure/io/binary/internals/BigIntegerSerializer.js +0 -153
- package/lib/structure/io/binary/internals/BooleanSerializer.js +0 -105
- package/lib/structure/io/binary/internals/BulkSetSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteBufferSerializer.js +0 -126
- package/lib/structure/io/binary/internals/ByteSerializer.js +0 -97
- package/lib/structure/io/binary/internals/BytecodeSerializer.js +0 -250
- package/lib/structure/io/binary/internals/ClassSerializer.js +0 -60
- package/lib/structure/io/binary/internals/DataType.js +0 -100
- package/lib/structure/io/binary/internals/DateSerializer.js +0 -105
- package/lib/structure/io/binary/internals/DoubleSerializer.js +0 -101
- package/lib/structure/io/binary/internals/EdgeSerializer.js +0 -216
- package/lib/structure/io/binary/internals/EnumSerializer.js +0 -152
- package/lib/structure/io/binary/internals/FloatSerializer.js +0 -101
- package/lib/structure/io/binary/internals/GraphBinaryReader.js +0 -82
- package/lib/structure/io/binary/internals/GraphBinaryWriter.js +0 -85
- package/lib/structure/io/binary/internals/IntSerializer.js +0 -114
- package/lib/structure/io/binary/internals/LambdaSerializer.js +0 -71
- package/lib/structure/io/binary/internals/LongSerializer.js +0 -109
- package/lib/structure/io/binary/internals/LongSerializerNg.js +0 -104
- package/lib/structure/io/binary/internals/MapSerializer.js +0 -155
- package/lib/structure/io/binary/internals/NumberSerializationStrategy.js +0 -73
- package/lib/structure/io/binary/internals/OffsetDateTimeSerializer.js +0 -151
- package/lib/structure/io/binary/internals/PSerializer.js +0 -152
- package/lib/structure/io/binary/internals/PathSerializer.js +0 -124
- package/lib/structure/io/binary/internals/PropertySerializer.js +0 -142
- package/lib/structure/io/binary/internals/SetSerializer.js +0 -134
- package/lib/structure/io/binary/internals/ShortSerializer.js +0 -101
- package/lib/structure/io/binary/internals/StringSerializer.js +0 -116
- package/lib/structure/io/binary/internals/TextPSerializer.js +0 -146
- package/lib/structure/io/binary/internals/TraversalStrategySerializer.js +0 -69
- package/lib/structure/io/binary/internals/TraverserSerializer.js +0 -124
- package/lib/structure/io/binary/internals/UnspecifiedNullSerializer.js +0 -77
- package/lib/structure/io/binary/internals/UuidSerializer.js +0 -121
- package/lib/structure/io/binary/internals/VertexPropertySerializer.js +0 -176
- package/lib/structure/io/binary/internals/VertexSerializer.js +0 -139
- package/lib/structure/io/graph-serializer.js +0 -303
- package/lib/structure/io/type-serializers.js +0 -566
- package/lib/utils.js +0 -130
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default class VertexSerializer {
|
|
2
|
+
constructor(ioc: any);
|
|
3
|
+
ioc: any;
|
|
4
|
+
canBeUsedFor(value: any): value is Vertex<any, any, any, any>;
|
|
5
|
+
serialize(item: any, fullyQualifiedFormat?: boolean): Buffer<ArrayBuffer>;
|
|
6
|
+
/**
|
|
7
|
+
* Async deserialization of vertex value bytes from a StreamReader.
|
|
8
|
+
* @param {StreamReader} reader
|
|
9
|
+
* @param {number} valueFlag
|
|
10
|
+
* @param {number} typeCode
|
|
11
|
+
* @returns {Promise<Vertex>}
|
|
12
|
+
*/
|
|
13
|
+
deserializeValue(reader: StreamReader, valueFlag: number, typeCode: number): Promise<Vertex>;
|
|
14
|
+
/**
|
|
15
|
+
* Async fully-qualified deserialization from a StreamReader.
|
|
16
|
+
* @param {StreamReader} reader
|
|
17
|
+
* @returns {Promise<Vertex|null>}
|
|
18
|
+
*/
|
|
19
|
+
deserialize(reader: StreamReader): Promise<Vertex | null>;
|
|
20
|
+
}
|
|
21
|
+
import { Vertex } from '../../../graph.cjs';
|
|
22
|
+
import { Buffer } from 'buffer';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.des_error = void 0;
|
|
22
|
+
/**
|
|
23
|
+
* @author Igor Ostapenko
|
|
24
|
+
*/
|
|
25
|
+
const buffer_1 = require("node:buffer");
|
|
26
|
+
/*
|
|
27
|
+
* Deserialization error general constructor.
|
|
28
|
+
*/
|
|
29
|
+
const des_error = ({ serializer, args, cursor, err }) => {
|
|
30
|
+
if (cursor === undefined) {
|
|
31
|
+
cursor = args[0]; // buffer
|
|
32
|
+
}
|
|
33
|
+
let cursor_tail = '';
|
|
34
|
+
if (cursor instanceof buffer_1.Buffer) {
|
|
35
|
+
if (cursor.length > 32) {
|
|
36
|
+
cursor_tail = '...';
|
|
37
|
+
}
|
|
38
|
+
cursor = cursor.slice(0, 32).toString('hex');
|
|
39
|
+
}
|
|
40
|
+
const fullyQualifiedFormat = args[1];
|
|
41
|
+
const nullable = args[2];
|
|
42
|
+
let m = `${serializer.constructor.name}.deserialize(cursor=${cursor}${cursor_tail}`;
|
|
43
|
+
if (fullyQualifiedFormat !== undefined) {
|
|
44
|
+
m += `, fullyQualifiedFormat=${fullyQualifiedFormat}`;
|
|
45
|
+
}
|
|
46
|
+
if (nullable !== undefined) {
|
|
47
|
+
m += `, nullable=${nullable}`;
|
|
48
|
+
}
|
|
49
|
+
m += `): ${err.message.replace(/\.$/, '')}.`;
|
|
50
|
+
err.message = m;
|
|
51
|
+
return err;
|
|
52
|
+
};
|
|
53
|
+
exports.des_error = des_error;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.DeferredPromise = exports.toArrayBuffer = exports.getUserAgent = exports.ImmutableMap = exports.emptyArray = exports.Byte = exports.Short = exports.Double = exports.Float = exports.Int = exports.Long = exports.INT32_MAX = exports.INT32_MIN = void 0;
|
|
22
|
+
exports.toLong = toLong;
|
|
23
|
+
exports.toInt = toInt;
|
|
24
|
+
exports.toFloat = toFloat;
|
|
25
|
+
exports.toDouble = toDouble;
|
|
26
|
+
exports.toShort = toShort;
|
|
27
|
+
exports.toByte = toByte;
|
|
28
|
+
exports.unwrap = unwrap;
|
|
29
|
+
exports.getUuid = getUuid;
|
|
30
|
+
exports.getUserAgentHeader = getUserAgentHeader;
|
|
31
|
+
/**
|
|
32
|
+
* A module containing any utility functions.
|
|
33
|
+
* @author Jorge Bay Gondra
|
|
34
|
+
*/
|
|
35
|
+
const gremlinVersion = '4.0.0-beta.3'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
|
|
36
|
+
const INT64_MIN = -9223372036854775808n;
|
|
37
|
+
const INT64_MAX = 9223372036854775807n;
|
|
38
|
+
exports.INT32_MIN = -2147483648;
|
|
39
|
+
exports.INT32_MAX = 2147483647;
|
|
40
|
+
function toLong(value) {
|
|
41
|
+
return new Long(value);
|
|
42
|
+
}
|
|
43
|
+
class Long {
|
|
44
|
+
value;
|
|
45
|
+
type = 'long';
|
|
46
|
+
constructor(value) {
|
|
47
|
+
this.value = value;
|
|
48
|
+
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'bigint') {
|
|
49
|
+
throw new TypeError('The value must be a string, a number, or a bigint');
|
|
50
|
+
}
|
|
51
|
+
if (typeof value === 'string') {
|
|
52
|
+
if (!/^(?:0|-?[1-9]\d*)$/.test(value)) {
|
|
53
|
+
throw new TypeError('Long value must be a valid integer');
|
|
54
|
+
}
|
|
55
|
+
const n = BigInt(value);
|
|
56
|
+
if (n < INT64_MIN || n > INT64_MAX) {
|
|
57
|
+
throw new RangeError('Long value is outside int64 range');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (typeof value === 'number') {
|
|
61
|
+
if (!Number.isInteger(value)) {
|
|
62
|
+
throw new TypeError('Long value must be an integer');
|
|
63
|
+
}
|
|
64
|
+
if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER) {
|
|
65
|
+
throw new RangeError('Long number values outside safe integer range lose precision; use string or bigint');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (typeof value === 'bigint') {
|
|
69
|
+
if (value < INT64_MIN || value > INT64_MAX) {
|
|
70
|
+
throw new RangeError('Long value is outside int64 range');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
valueOf() {
|
|
75
|
+
if (typeof this.value === 'number')
|
|
76
|
+
return this.value;
|
|
77
|
+
const big = typeof this.value === 'bigint' ? this.value : BigInt(this.value);
|
|
78
|
+
if (big > BigInt(Number.MAX_SAFE_INTEGER) || big < BigInt(Number.MIN_SAFE_INTEGER)) {
|
|
79
|
+
throw new RangeError('Long value is outside safe integer range');
|
|
80
|
+
}
|
|
81
|
+
return Number(big);
|
|
82
|
+
}
|
|
83
|
+
[Symbol.toPrimitive](hint) {
|
|
84
|
+
if (hint === 'string')
|
|
85
|
+
return String(this.value);
|
|
86
|
+
return this.valueOf();
|
|
87
|
+
}
|
|
88
|
+
toJSON() {
|
|
89
|
+
if (typeof this.value === 'bigint')
|
|
90
|
+
return this.value.toString();
|
|
91
|
+
return this.value;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Long = Long;
|
|
95
|
+
class Int {
|
|
96
|
+
value;
|
|
97
|
+
type = 'int';
|
|
98
|
+
constructor(value) {
|
|
99
|
+
this.value = value;
|
|
100
|
+
if (typeof value !== 'number') {
|
|
101
|
+
throw new TypeError('Int value must be a number');
|
|
102
|
+
}
|
|
103
|
+
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
104
|
+
throw new TypeError('Int value must be a finite integer');
|
|
105
|
+
}
|
|
106
|
+
if (value < exports.INT32_MIN || value > exports.INT32_MAX) {
|
|
107
|
+
throw new RangeError('Int value must be within int32 range');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
valueOf() { return this.value; }
|
|
111
|
+
[Symbol.toPrimitive](hint) { return hint === 'string' ? String(this.value) : this.value; }
|
|
112
|
+
toJSON() { return this.value; }
|
|
113
|
+
}
|
|
114
|
+
exports.Int = Int;
|
|
115
|
+
class Float {
|
|
116
|
+
value;
|
|
117
|
+
type = 'float';
|
|
118
|
+
constructor(value) {
|
|
119
|
+
this.value = value;
|
|
120
|
+
if (typeof value !== 'number') {
|
|
121
|
+
throw new TypeError('Float value must be a number');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
valueOf() { return this.value; }
|
|
125
|
+
[Symbol.toPrimitive](hint) { return hint === 'string' ? String(this.value) : this.value; }
|
|
126
|
+
toJSON() { return this.value; }
|
|
127
|
+
}
|
|
128
|
+
exports.Float = Float;
|
|
129
|
+
class Double {
|
|
130
|
+
value;
|
|
131
|
+
type = 'double';
|
|
132
|
+
constructor(value) {
|
|
133
|
+
this.value = value;
|
|
134
|
+
if (typeof value !== 'number') {
|
|
135
|
+
throw new TypeError('Double value must be a number');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
valueOf() { return this.value; }
|
|
139
|
+
[Symbol.toPrimitive](hint) { return hint === 'string' ? String(this.value) : this.value; }
|
|
140
|
+
toJSON() { return this.value; }
|
|
141
|
+
}
|
|
142
|
+
exports.Double = Double;
|
|
143
|
+
class Short {
|
|
144
|
+
value;
|
|
145
|
+
type = 'short';
|
|
146
|
+
constructor(value) {
|
|
147
|
+
this.value = value;
|
|
148
|
+
if (typeof value !== 'number') {
|
|
149
|
+
throw new TypeError('Short value must be a number');
|
|
150
|
+
}
|
|
151
|
+
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
152
|
+
throw new TypeError('Short value must be a finite integer');
|
|
153
|
+
}
|
|
154
|
+
if (value < -32768 || value > 32767) {
|
|
155
|
+
throw new RangeError('Short value must be within int16 range');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
valueOf() { return this.value; }
|
|
159
|
+
[Symbol.toPrimitive](hint) { return hint === 'string' ? String(this.value) : this.value; }
|
|
160
|
+
toJSON() { return this.value; }
|
|
161
|
+
}
|
|
162
|
+
exports.Short = Short;
|
|
163
|
+
class Byte {
|
|
164
|
+
value;
|
|
165
|
+
type = 'byte';
|
|
166
|
+
constructor(value) {
|
|
167
|
+
this.value = value;
|
|
168
|
+
if (typeof value !== 'number') {
|
|
169
|
+
throw new TypeError('Byte value must be a number');
|
|
170
|
+
}
|
|
171
|
+
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
172
|
+
throw new TypeError('Byte value must be a finite integer');
|
|
173
|
+
}
|
|
174
|
+
if (value < -128 || value > 127) {
|
|
175
|
+
throw new RangeError('Byte value must be within int8 range');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
valueOf() { return this.value; }
|
|
179
|
+
[Symbol.toPrimitive](hint) { return hint === 'string' ? String(this.value) : this.value; }
|
|
180
|
+
toJSON() { return this.value; }
|
|
181
|
+
}
|
|
182
|
+
exports.Byte = Byte;
|
|
183
|
+
function toInt(value) { return new Int(value); }
|
|
184
|
+
function toFloat(value) { return new Float(value); }
|
|
185
|
+
function toDouble(value) { return new Double(value); }
|
|
186
|
+
function toShort(value) { return new Short(value); }
|
|
187
|
+
function toByte(value) { return new Byte(value); }
|
|
188
|
+
function unwrap(value) {
|
|
189
|
+
if (value instanceof Long || value instanceof Int || value instanceof Float ||
|
|
190
|
+
value instanceof Double || value instanceof Short || value instanceof Byte) {
|
|
191
|
+
return value.value;
|
|
192
|
+
}
|
|
193
|
+
return value;
|
|
194
|
+
}
|
|
195
|
+
function getUuid() {
|
|
196
|
+
return globalThis.crypto.randomUUID();
|
|
197
|
+
}
|
|
198
|
+
exports.emptyArray = Object.freeze([]);
|
|
199
|
+
class ImmutableMap extends Map {
|
|
200
|
+
constructor(iterable) {
|
|
201
|
+
super(iterable);
|
|
202
|
+
}
|
|
203
|
+
set() {
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
['delete']() {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
clear() { }
|
|
210
|
+
}
|
|
211
|
+
exports.ImmutableMap = ImmutableMap;
|
|
212
|
+
async function generateNodeUserAgent() {
|
|
213
|
+
const os = await import('node:os');
|
|
214
|
+
const applicationName = (process?.env.npm_package_name ?? 'NotAvailable').replace('_', ' ');
|
|
215
|
+
let runtimeVersion;
|
|
216
|
+
let osName;
|
|
217
|
+
let osVersion;
|
|
218
|
+
let cpuArch;
|
|
219
|
+
runtimeVersion = osName = osVersion = cpuArch = 'NotAvailable';
|
|
220
|
+
if (process != null) {
|
|
221
|
+
if (process.version) {
|
|
222
|
+
runtimeVersion = process.version.replace(' ', '_');
|
|
223
|
+
}
|
|
224
|
+
if (process.arch) {
|
|
225
|
+
cpuArch = process.arch.replace(' ', '_');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (os != null) {
|
|
229
|
+
osName = os.platform().replace(' ', '_');
|
|
230
|
+
osVersion = os.release().replace(' ', '_');
|
|
231
|
+
}
|
|
232
|
+
const userAgent = `${applicationName} Gremlin-Javascript.${gremlinVersion} ${runtimeVersion} ${osName}.${osVersion} ${cpuArch}`;
|
|
233
|
+
return userAgent;
|
|
234
|
+
}
|
|
235
|
+
function getUserAgentHeader() {
|
|
236
|
+
return 'User-Agent';
|
|
237
|
+
}
|
|
238
|
+
const getUserAgent = async () => {
|
|
239
|
+
if ('navigator' in globalThis) {
|
|
240
|
+
return globalThis.navigator.userAgent;
|
|
241
|
+
}
|
|
242
|
+
if (process?.versions?.node !== undefined) {
|
|
243
|
+
return await generateNodeUserAgent();
|
|
244
|
+
}
|
|
245
|
+
return undefined;
|
|
246
|
+
};
|
|
247
|
+
exports.getUserAgent = getUserAgent;
|
|
248
|
+
const toArrayBuffer = (buffer) => buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
249
|
+
exports.toArrayBuffer = toArrayBuffer;
|
|
250
|
+
const DeferredPromise = () => {
|
|
251
|
+
let resolve = (value) => { };
|
|
252
|
+
let reject = (reason) => { };
|
|
253
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
254
|
+
resolve = _resolve;
|
|
255
|
+
reject = _reject;
|
|
256
|
+
});
|
|
257
|
+
return Object.assign(promise, { resolve, reject });
|
|
258
|
+
};
|
|
259
|
+
exports.DeferredPromise = DeferredPromise;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const INT32_MIN = -2147483648;
|
|
2
|
+
export declare const INT32_MAX = 2147483647;
|
|
3
|
+
export declare function toLong(value: number | string | bigint): Long;
|
|
4
|
+
export declare class Long {
|
|
5
|
+
readonly value: number | string | bigint;
|
|
6
|
+
readonly type = "long";
|
|
7
|
+
constructor(value: number | string | bigint);
|
|
8
|
+
valueOf(): number;
|
|
9
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
10
|
+
toJSON(): string | number;
|
|
11
|
+
}
|
|
12
|
+
export declare class Int {
|
|
13
|
+
readonly value: number;
|
|
14
|
+
readonly type = "int";
|
|
15
|
+
constructor(value: number);
|
|
16
|
+
valueOf(): number;
|
|
17
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
18
|
+
toJSON(): number;
|
|
19
|
+
}
|
|
20
|
+
export declare class Float {
|
|
21
|
+
readonly value: number;
|
|
22
|
+
readonly type = "float";
|
|
23
|
+
constructor(value: number);
|
|
24
|
+
valueOf(): number;
|
|
25
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
26
|
+
toJSON(): number;
|
|
27
|
+
}
|
|
28
|
+
export declare class Double {
|
|
29
|
+
readonly value: number;
|
|
30
|
+
readonly type = "double";
|
|
31
|
+
constructor(value: number);
|
|
32
|
+
valueOf(): number;
|
|
33
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
34
|
+
toJSON(): number;
|
|
35
|
+
}
|
|
36
|
+
export declare class Short {
|
|
37
|
+
readonly value: number;
|
|
38
|
+
readonly type = "short";
|
|
39
|
+
constructor(value: number);
|
|
40
|
+
valueOf(): number;
|
|
41
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
42
|
+
toJSON(): number;
|
|
43
|
+
}
|
|
44
|
+
export declare class Byte {
|
|
45
|
+
readonly value: number;
|
|
46
|
+
readonly type = "byte";
|
|
47
|
+
constructor(value: number);
|
|
48
|
+
valueOf(): number;
|
|
49
|
+
[Symbol.toPrimitive](hint: string): string | number;
|
|
50
|
+
toJSON(): number;
|
|
51
|
+
}
|
|
52
|
+
export declare function toInt(value: number): Int;
|
|
53
|
+
export declare function toFloat(value: number): Float;
|
|
54
|
+
export declare function toDouble(value: number): Double;
|
|
55
|
+
export declare function toShort(value: number): Short;
|
|
56
|
+
export declare function toByte(value: number): Byte;
|
|
57
|
+
export declare function unwrap(value: Float): number;
|
|
58
|
+
export declare function unwrap(value: Double): number;
|
|
59
|
+
export declare function unwrap(value: Int): number;
|
|
60
|
+
export declare function unwrap(value: Long): number | string | bigint;
|
|
61
|
+
export declare function unwrap(value: Short): number;
|
|
62
|
+
export declare function unwrap(value: Byte): number;
|
|
63
|
+
export declare function unwrap<T>(value: T): T;
|
|
64
|
+
export declare function getUuid(): `${string}-${string}-${string}-${string}-${string}`;
|
|
65
|
+
export declare const emptyArray: any[];
|
|
66
|
+
export declare class ImmutableMap<K, V> extends Map<K, V> implements ReadonlyMap<K, V> {
|
|
67
|
+
constructor(iterable?: Iterable<[K, V]>);
|
|
68
|
+
set(): this;
|
|
69
|
+
['delete'](): boolean;
|
|
70
|
+
clear(): void;
|
|
71
|
+
}
|
|
72
|
+
export declare function getUserAgentHeader(): string;
|
|
73
|
+
export declare const getUserAgent: () => Promise<string | undefined>;
|
|
74
|
+
export declare const toArrayBuffer: (buffer: Buffer) => ArrayBuffer | SharedArrayBuffer;
|
|
75
|
+
export declare const DeferredPromise: <T>() => Promise<T> & {
|
|
76
|
+
resolve: (value: T) => void;
|
|
77
|
+
reject: (reason: unknown) => void;
|
|
78
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RequestInterceptor } from './http-request.js';
|
|
2
|
+
export declare function basic(username: string, password: string): RequestInterceptor;
|
|
3
|
+
export interface AwsCredentials {
|
|
4
|
+
accessKeyId: string;
|
|
5
|
+
secretAccessKey: string;
|
|
6
|
+
sessionToken?: string;
|
|
7
|
+
}
|
|
8
|
+
export type AwsCredentialsProvider = () => AwsCredentials | Promise<AwsCredentials>;
|
|
9
|
+
export declare function sigv4(region: string, service: string, credentialsProvider?: AwsCredentialsProvider): RequestInterceptor;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { Buffer } from 'buffer';
|
|
20
|
+
export function basic(username, password) {
|
|
21
|
+
return (request) => {
|
|
22
|
+
request.headers['authorization'] = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64');
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function sigv4(region, service, credentialsProvider) {
|
|
26
|
+
let signer;
|
|
27
|
+
let resolvedProvider;
|
|
28
|
+
return async (request) => {
|
|
29
|
+
// Ensure body is serialized to JSON bytes before signing.
|
|
30
|
+
// serializeBody is idempotent: safe to call even if already serialized.
|
|
31
|
+
request.serializeBody();
|
|
32
|
+
// Lazy-initialize signer and credentials provider on first use
|
|
33
|
+
if (!signer) {
|
|
34
|
+
const { SignatureV4 } = await import('@smithy/signature-v4');
|
|
35
|
+
const { Hash } = await import('@smithy/hash-node');
|
|
36
|
+
if (credentialsProvider) {
|
|
37
|
+
resolvedProvider = credentialsProvider;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const { fromNodeProviderChain } = await import('@aws-sdk/credential-providers');
|
|
41
|
+
const chain = fromNodeProviderChain({ clientConfig: { region } });
|
|
42
|
+
resolvedProvider = () => chain();
|
|
43
|
+
}
|
|
44
|
+
signer = new SignatureV4({
|
|
45
|
+
service,
|
|
46
|
+
region,
|
|
47
|
+
sha256: Hash.bind(null, 'sha256'),
|
|
48
|
+
credentials: () => Promise.resolve(resolvedProvider()),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const url = new URL(request.url);
|
|
52
|
+
// Sign only the Host header; the signer itself adds (and signs) x-amz-date, the payload hash,
|
|
53
|
+
// and x-amz-security-token for session credentials. The request's own headers (accept,
|
|
54
|
+
// content-type, ...) are deliberately NOT fed into the signature: the HTTP stack may add or
|
|
55
|
+
// rewrite transport-managed headers such as accept-encoding after this interceptor runs, so a
|
|
56
|
+
// signature covering them would no longer match the bytes actually sent.
|
|
57
|
+
const signed = await signer.sign({
|
|
58
|
+
method: request.method,
|
|
59
|
+
protocol: url.protocol,
|
|
60
|
+
hostname: url.hostname,
|
|
61
|
+
port: url.port ? Number(url.port) : undefined,
|
|
62
|
+
path: url.pathname + url.search,
|
|
63
|
+
headers: {
|
|
64
|
+
host: url.host,
|
|
65
|
+
},
|
|
66
|
+
body: request.body,
|
|
67
|
+
});
|
|
68
|
+
// Merge the signed auth headers onto the request; the request's other headers (accept,
|
|
69
|
+
// content-type, ...) still reach the wire, they are simply not part of the signature.
|
|
70
|
+
request.headers = { ...request.headers, ...signed.headers };
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ConnectionOptions } from './connection.js';
|
|
2
|
+
import { Transaction } from '../process/transaction.js';
|
|
3
|
+
export type RequestOptions = {
|
|
4
|
+
parameters?: any;
|
|
5
|
+
language?: string;
|
|
6
|
+
accept?: string;
|
|
7
|
+
timeoutMillis?: number;
|
|
8
|
+
batchSize?: number;
|
|
9
|
+
userAgent?: string;
|
|
10
|
+
materializeProperties?: string;
|
|
11
|
+
bulkResults?: boolean;
|
|
12
|
+
params?: Record<string, any>;
|
|
13
|
+
transactionId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ClientOptions = ConnectionOptions & RequestOptions & {
|
|
16
|
+
processor?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A {@link Client} contains methods to send messages to a Gremlin Server.
|
|
20
|
+
*/
|
|
21
|
+
export default class Client {
|
|
22
|
+
#private;
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly options: ClientOptions;
|
|
25
|
+
private readonly _connection;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new instance of {@link Client}.
|
|
28
|
+
* @param {String} url The resource uri.
|
|
29
|
+
* @param {ClientOptions} [options] The connection options.
|
|
30
|
+
*/
|
|
31
|
+
private readonly _trackedTransactions;
|
|
32
|
+
constructor(url: string, options?: ClientOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Opens the underlying connection to the Gremlin Server, if it's not already opened.
|
|
35
|
+
* @returns {Promise}
|
|
36
|
+
*/
|
|
37
|
+
open(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns true if the underlying connection is open
|
|
40
|
+
* @returns {Boolean}
|
|
41
|
+
*/
|
|
42
|
+
get isOpen(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Send a request to the Gremlin Server and buffer the entire response.
|
|
45
|
+
* @param {string} message The script to send
|
|
46
|
+
* @param {Object|null} [parameters] The query parameters, if any.
|
|
47
|
+
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
|
|
48
|
+
* @returns {Promise<ResultSet>}
|
|
49
|
+
*/
|
|
50
|
+
submit(message: string, parameters: any | null, requestOptions?: RequestOptions): Promise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Send a request to the Gremlin Server and stream results incrementally.
|
|
53
|
+
* Returns an AsyncGenerator that yields individual result items as they are
|
|
54
|
+
* deserialized from the response. For bulked responses, yields Traverser objects.
|
|
55
|
+
* @param {string} message The script to send
|
|
56
|
+
* @param {Object|null} [parameters] The query parameters, if any.
|
|
57
|
+
* @param {RequestOptions} [requestOptions] Configuration specific to the current request.
|
|
58
|
+
* @returns {AsyncGenerator<any>}
|
|
59
|
+
*/
|
|
60
|
+
stream(message: string, parameters: any | null, requestOptions?: RequestOptions): AsyncGenerator<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Closes the underlying connection
|
|
63
|
+
* @returns {Promise}
|
|
64
|
+
*/
|
|
65
|
+
close(): Promise<void>;
|
|
66
|
+
trackTransaction(tx: any): void;
|
|
67
|
+
untrackTransaction(tx: any): void;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a new Transaction for executing operations within an explicit transaction.
|
|
70
|
+
* Transactions are short-lived and single-use. After commit or rollback,
|
|
71
|
+
* create a new Transaction for the next unit of work.
|
|
72
|
+
* The traversal source (g alias) is inherited from this Client.
|
|
73
|
+
* @returns {Transaction}
|
|
74
|
+
*/
|
|
75
|
+
transact(): Transaction;
|
|
76
|
+
/**
|
|
77
|
+
* Adds an event listener to the connection
|
|
78
|
+
* @param {String} event The event name that you want to listen to.
|
|
79
|
+
* @param {Function} handler The callback to be called when the event occurs.
|
|
80
|
+
*/
|
|
81
|
+
addListener(event: string, handler: (...args: any[]) => unknown): void;
|
|
82
|
+
/**
|
|
83
|
+
* Removes a previously added event listener to the connection
|
|
84
|
+
* @param {String} event The event name that you want to listen to.
|
|
85
|
+
* @param {Function} handler The event handler to be removed.
|
|
86
|
+
*/
|
|
87
|
+
removeListener(event: string, handler: (...args: any[]) => unknown): void;
|
|
88
|
+
}
|