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,48 @@
|
|
|
1
|
+
import { Agent, buildConnector, Dispatcher } from 'undici';
|
|
2
|
+
/** Default concurrent-connections-per-origin cap (Node's global fetch is uncapped). */
|
|
3
|
+
export declare const DEFAULT_MAX_CONNECTIONS = 128;
|
|
4
|
+
/** Canonical TinkerPop 4.x default TCP keep-alive idle time (30s), shared across the GLVs. */
|
|
5
|
+
export declare const DEFAULT_KEEP_ALIVE_TIME = 30000;
|
|
6
|
+
/** Options for the default undici {@link Dispatcher}; unset fields use undici defaults. */
|
|
7
|
+
export type DispatcherOptions = {
|
|
8
|
+
/** Max concurrent connections per origin. Defaults to {@link DEFAULT_MAX_CONNECTIONS}. */
|
|
9
|
+
maxConnections?: number;
|
|
10
|
+
/** Read timeout in ms. Maps to undici `headersTimeout` (wait for first response byte) and `bodyTimeout` (idle between body chunks). */
|
|
11
|
+
readTimeoutMillis?: number;
|
|
12
|
+
/** Max response header size in bytes. Maps to undici `maxHeaderSize`. */
|
|
13
|
+
maxResponseHeaderBytes?: number;
|
|
14
|
+
/** Idle ms before TCP keep-alive probes begin. Defaults to 30s; `0` disables keep-alive. */
|
|
15
|
+
keepAliveTimeMillis?: number;
|
|
16
|
+
/** HTTP proxy URI. When set, a {@link ProxyAgent} is built instead of an {@link Agent}. */
|
|
17
|
+
proxy?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the effective keep-alive idle delay: unset falls back to {@link DEFAULT_KEEP_ALIVE_TIME},
|
|
21
|
+
* a non-positive value disables keep-alive (returns `null`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveKeepAliveTime(keepAliveTime?: number): number | null;
|
|
24
|
+
/**
|
|
25
|
+
* Builds an undici connector that sets `SO_KEEPALIVE` with the given idle delay on each new socket.
|
|
26
|
+
* `baseConnector` is parameterised so the wiring can be unit-tested with a fake connector.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildKeepAliveConnector(delay: number, baseConnector?: ReturnType<typeof buildConnector>): ReturnType<typeof buildConnector>;
|
|
29
|
+
/**
|
|
30
|
+
* Maps the discrete driver options onto undici {@link Agent.Options} (the single source of truth
|
|
31
|
+
* for that mapping). Exported as a seam so the mapping can be asserted in unit tests.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildAgentOptions(options?: DispatcherOptions): Agent.Options;
|
|
34
|
+
/**
|
|
35
|
+
* Builds the default undici {@link Dispatcher}: a {@link ProxyAgent} when `proxy` is set, otherwise
|
|
36
|
+
* a plain {@link Agent}. (Agent and ProxyAgent share one dispatcher slot, so only one is built.)
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildDispatcher(options?: DispatcherOptions): Dispatcher;
|
|
39
|
+
/**
|
|
40
|
+
* HTTP `fetch` for the Node build. Uses undici's own `fetch` (not the global one) so `fetch` and the
|
|
41
|
+
* {@link buildDispatcher} dispatcher share one undici version, whatever undici the Node runtime
|
|
42
|
+
* bundles (e.g. Node 26 ships undici 8, incompatible with an undici 6 dispatcher). A holder object,
|
|
43
|
+
* not a bare export, so tests can swap `fetch` (an ESM export can't be reassigned, an object
|
|
44
|
+
* property can). The cast aligns undici's `fetch` type with the global one.
|
|
45
|
+
*/
|
|
46
|
+
export declare const httpFetch: {
|
|
47
|
+
fetch: typeof globalThis.fetch;
|
|
48
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
+
}) : function(o, v) {
|
|
34
|
+
o["default"] = v;
|
|
35
|
+
});
|
|
36
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
37
|
+
var ownKeys = function(o) {
|
|
38
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
39
|
+
var ar = [];
|
|
40
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
41
|
+
return ar;
|
|
42
|
+
};
|
|
43
|
+
return ownKeys(o);
|
|
44
|
+
};
|
|
45
|
+
return function (mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
/**
|
|
58
|
+
* @author Jorge Bay Gondra
|
|
59
|
+
*/
|
|
60
|
+
const rcModule = __importStar(require("./remote-connection.cjs"));
|
|
61
|
+
const RemoteConnection = rcModule.RemoteConnection;
|
|
62
|
+
const RemoteTraversal = rcModule.RemoteTraversal;
|
|
63
|
+
const client_js_1 = __importDefault(require("./client.cjs"));
|
|
64
|
+
/**
|
|
65
|
+
* Represents the default `RemoteConnection` implementation.
|
|
66
|
+
*/
|
|
67
|
+
class DriverRemoteConnection extends RemoteConnection {
|
|
68
|
+
// Exposed as package-internal for Transaction to submit begin/commit/rollback.
|
|
69
|
+
// Not part of the public API contract.
|
|
70
|
+
_client;
|
|
71
|
+
_transactionId;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new instance of {@link DriverRemoteConnection}.
|
|
74
|
+
* @param {String} url The resource uri.
|
|
75
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
76
|
+
* @param {String} [transactionId] Optional transaction ID to attach to all requests.
|
|
77
|
+
*/
|
|
78
|
+
constructor(url, options = {}, transactionId) {
|
|
79
|
+
super(url, options);
|
|
80
|
+
this._client = new client_js_1.default(url, options);
|
|
81
|
+
this._transactionId = transactionId;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the transaction ID if this connection is bound to a transaction, undefined otherwise.
|
|
85
|
+
*/
|
|
86
|
+
get transactionId() {
|
|
87
|
+
return this._transactionId;
|
|
88
|
+
}
|
|
89
|
+
/** @override */
|
|
90
|
+
open() {
|
|
91
|
+
return this._client.open();
|
|
92
|
+
}
|
|
93
|
+
/** @override */
|
|
94
|
+
get isOpen() {
|
|
95
|
+
return this._client.isOpen;
|
|
96
|
+
}
|
|
97
|
+
/** @override */
|
|
98
|
+
submit(gremlinLang) {
|
|
99
|
+
const { gremlin, requestOptions } = this.#buildRequestArgs(gremlinLang);
|
|
100
|
+
// Use streaming internally — returns an AsyncGenerator backed RemoteTraversal
|
|
101
|
+
const generator = this._client.stream(gremlin, null, requestOptions);
|
|
102
|
+
return Promise.resolve(new RemoteTraversal(generator));
|
|
103
|
+
}
|
|
104
|
+
#buildRequestArgs(gremlinLang) {
|
|
105
|
+
let requestOptions = undefined;
|
|
106
|
+
const strategies = gremlinLang.getOptionsStrategies();
|
|
107
|
+
if (strategies.length > 0) {
|
|
108
|
+
requestOptions = {};
|
|
109
|
+
const allowedKeys = [
|
|
110
|
+
'timeoutMillis',
|
|
111
|
+
'batchSize',
|
|
112
|
+
'requestId',
|
|
113
|
+
'userAgent',
|
|
114
|
+
'materializeProperties',
|
|
115
|
+
'bulkResults',
|
|
116
|
+
];
|
|
117
|
+
for (const strategy of strategies) {
|
|
118
|
+
for (const key in strategy.configuration) {
|
|
119
|
+
if (allowedKeys.indexOf(key) > -1) {
|
|
120
|
+
requestOptions[key] = strategy.configuration[key];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!requestOptions) {
|
|
126
|
+
requestOptions = {};
|
|
127
|
+
}
|
|
128
|
+
if (!('bulkResults' in requestOptions)) {
|
|
129
|
+
requestOptions.bulkResults = true;
|
|
130
|
+
}
|
|
131
|
+
const parametersString = gremlinLang.getParametersAsString();
|
|
132
|
+
if (parametersString !== '[:]') {
|
|
133
|
+
requestOptions.parameters = parametersString;
|
|
134
|
+
}
|
|
135
|
+
// If this connection is bound to a transaction, attach the transactionId
|
|
136
|
+
if (this._transactionId) {
|
|
137
|
+
requestOptions.transactionId = this._transactionId;
|
|
138
|
+
}
|
|
139
|
+
return { gremlin: gremlinLang.getGremlin(), requestOptions };
|
|
140
|
+
}
|
|
141
|
+
close() {
|
|
142
|
+
return this._client.close();
|
|
143
|
+
}
|
|
144
|
+
/** @override */
|
|
145
|
+
addListener(event, handler) {
|
|
146
|
+
return this._client.addListener(event, handler);
|
|
147
|
+
}
|
|
148
|
+
/** @override */
|
|
149
|
+
removeListener(event, handler) {
|
|
150
|
+
return this._client.removeListener(event, handler);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.default = DriverRemoteConnection;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Jorge Bay Gondra
|
|
3
|
+
*/
|
|
4
|
+
import * as rcModule from './remote-connection.cjs';
|
|
5
|
+
declare const RemoteConnection: typeof rcModule.RemoteConnection;
|
|
6
|
+
import Client from './client.cjs';
|
|
7
|
+
import GremlinLang from '../process/gremlin-lang.cjs';
|
|
8
|
+
import { ConnectionOptions } from './connection.cjs';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the default `RemoteConnection` implementation.
|
|
11
|
+
*/
|
|
12
|
+
export default class DriverRemoteConnection extends RemoteConnection {
|
|
13
|
+
#private;
|
|
14
|
+
readonly _client: Client;
|
|
15
|
+
private _transactionId?;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of {@link DriverRemoteConnection}.
|
|
18
|
+
* @param {String} url The resource uri.
|
|
19
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
20
|
+
* @param {String} [transactionId] Optional transaction ID to attach to all requests.
|
|
21
|
+
*/
|
|
22
|
+
constructor(url: string, options?: ConnectionOptions, transactionId?: string);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the transaction ID if this connection is bound to a transaction, undefined otherwise.
|
|
25
|
+
*/
|
|
26
|
+
get transactionId(): string | undefined;
|
|
27
|
+
/** @override */
|
|
28
|
+
open(): Promise<void>;
|
|
29
|
+
/** @override */
|
|
30
|
+
get isOpen(): boolean;
|
|
31
|
+
/** @override */
|
|
32
|
+
submit(gremlinLang: GremlinLang): Promise<rcModule.RemoteTraversal>;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
/** @override */
|
|
35
|
+
addListener(event: string, handler: (...args: any[]) => unknown): void;
|
|
36
|
+
/** @override */
|
|
37
|
+
removeListener(event: string, handler: (...args: any[]) => unknown): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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.HttpRequest = void 0;
|
|
22
|
+
const buffer_1 = require("node:buffer");
|
|
23
|
+
const request_message_js_1 = require("./request-message.cjs");
|
|
24
|
+
/**
|
|
25
|
+
* Represents an HTTP request that is passed through interceptors before being sent to the server.
|
|
26
|
+
* Interceptors may mutate any field. The {@link serializeBody} method serializes the body to JSON
|
|
27
|
+
* if it is still a RequestMessage, or returns the existing bytes if already serialized.
|
|
28
|
+
*/
|
|
29
|
+
class HttpRequest {
|
|
30
|
+
url;
|
|
31
|
+
method;
|
|
32
|
+
headers;
|
|
33
|
+
body;
|
|
34
|
+
constructor(method, url, headers, body) {
|
|
35
|
+
this.method = method;
|
|
36
|
+
this.url = url;
|
|
37
|
+
this.headers = headers;
|
|
38
|
+
this.body = body;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Serializes the request body to JSON if it is still a RequestMessage.
|
|
42
|
+
* If body is already a Buffer, returns it as-is (idempotent).
|
|
43
|
+
* Sets Content-Type and Content-Length headers on successful serialization.
|
|
44
|
+
*
|
|
45
|
+
* @returns The serialized body as a Buffer.
|
|
46
|
+
* @throws Error if body is neither a RequestMessage nor a Buffer.
|
|
47
|
+
*/
|
|
48
|
+
serializeBody() {
|
|
49
|
+
if (buffer_1.Buffer.isBuffer(this.body)) {
|
|
50
|
+
return this.body;
|
|
51
|
+
}
|
|
52
|
+
if (this.body instanceof request_message_js_1.RequestMessage) {
|
|
53
|
+
// RequestMessage.toJSON() produces the flattened wire object (standard + custom fields).
|
|
54
|
+
const data = buffer_1.Buffer.from(JSON.stringify(this.body), 'utf-8');
|
|
55
|
+
this.body = data;
|
|
56
|
+
this.headers['Content-Type'] = 'application/json';
|
|
57
|
+
this.headers['Content-Length'] = String(data.length);
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
const typeName = this.body === null ? 'null' : typeof this.body;
|
|
61
|
+
throw new Error(`unsupported body type: ${typeName}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.HttpRequest = HttpRequest;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
2
|
+
import { RequestMessage } from './request-message.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an HTTP request that is passed through interceptors before being sent to the server.
|
|
5
|
+
* Interceptors may mutate any field. The {@link serializeBody} method serializes the body to JSON
|
|
6
|
+
* if it is still a RequestMessage, or returns the existing bytes if already serialized.
|
|
7
|
+
*/
|
|
8
|
+
export declare class HttpRequest {
|
|
9
|
+
url: string;
|
|
10
|
+
method: string;
|
|
11
|
+
headers: Record<string, string>;
|
|
12
|
+
body: RequestMessage | Buffer | any;
|
|
13
|
+
constructor(method: string, url: string, headers: Record<string, string>, body: any);
|
|
14
|
+
/**
|
|
15
|
+
* Serializes the request body to JSON if it is still a RequestMessage.
|
|
16
|
+
* If body is already a Buffer, returns it as-is (idempotent).
|
|
17
|
+
* Sets Content-Type and Content-Length headers on successful serialization.
|
|
18
|
+
*
|
|
19
|
+
* @returns The serialized body as a Buffer.
|
|
20
|
+
* @throws Error if body is neither a RequestMessage nor a Buffer.
|
|
21
|
+
*/
|
|
22
|
+
serializeBody(): Buffer;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A request interceptor receives an HttpRequest and mutates it in place.
|
|
26
|
+
* Interceptors must not return a value.
|
|
27
|
+
*/
|
|
28
|
+
export type RequestInterceptor = (request: HttpRequest) => void | Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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.normalizeLogger = normalizeLogger;
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes the user-supplied {@link Logger} option into a single callback. When no logger is
|
|
24
|
+
* provided, a no-op callback is returned so call sites do not need to null-check.
|
|
25
|
+
*
|
|
26
|
+
* @param {Logger} [logger] The user-supplied logger option.
|
|
27
|
+
* @returns {LoggerCallback} A callback that dispatches to the configured logger.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeLogger(logger) {
|
|
30
|
+
if (logger === undefined || logger === null) {
|
|
31
|
+
return () => { };
|
|
32
|
+
}
|
|
33
|
+
if (typeof logger === 'function') {
|
|
34
|
+
return logger;
|
|
35
|
+
}
|
|
36
|
+
if (typeof logger === 'object') {
|
|
37
|
+
return (level, message, ...args) => {
|
|
38
|
+
const fn = logger[level];
|
|
39
|
+
if (typeof fn === 'function') {
|
|
40
|
+
fn.call(logger, message, ...args);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
throw new TypeError('logger must be a function, a logger object, or undefined');
|
|
45
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The set of log levels emitted by the driver, ordered from least to most severe. */
|
|
2
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
3
|
+
/**
|
|
4
|
+
* A logger object with one method per {@link LogLevel}. This shape is compatible with the
|
|
5
|
+
* global `console` as well as common logging libraries.
|
|
6
|
+
*/
|
|
7
|
+
export interface LoggerObject {
|
|
8
|
+
debug(message: string, ...args: any[]): void;
|
|
9
|
+
info(message: string, ...args: any[]): void;
|
|
10
|
+
warn(message: string, ...args: any[]): void;
|
|
11
|
+
error(message: string, ...args: any[]): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A logger callback that receives the level alongside the message and any extra arguments.
|
|
15
|
+
*/
|
|
16
|
+
export type LoggerCallback = (level: LogLevel, message: string, ...args: any[]) => void;
|
|
17
|
+
/**
|
|
18
|
+
* The `logger` connection option. It may be either a {@link LoggerObject} (e.g. the global
|
|
19
|
+
* `console`) or a {@link LoggerCallback}. Logging is disabled when no logger is provided.
|
|
20
|
+
*/
|
|
21
|
+
export type Logger = LoggerObject | LoggerCallback;
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes the user-supplied {@link Logger} option into a single callback. When no logger is
|
|
24
|
+
* provided, a no-op callback is returned so call sites do not need to null-check.
|
|
25
|
+
*
|
|
26
|
+
* @param {Logger} [logger] The user-supplied logger option.
|
|
27
|
+
* @returns {LoggerCallback} A callback that dispatches to the configured logger.
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeLogger(logger?: Logger): LoggerCallback;
|
|
@@ -0,0 +1,72 @@
|
|
|
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.RemoteStrategy = exports.RemoteTraversal = exports.RemoteConnection = void 0;
|
|
22
|
+
const traversal_strategy_js_1 = require("../process/traversal-strategy.cjs");
|
|
23
|
+
const traversal_js_1 = require("../process/traversal.cjs");
|
|
24
|
+
/**
|
|
25
|
+
* Represents an abstraction of a "connection" to a "server" that is capable of processing a traversal and
|
|
26
|
+
* returning results.
|
|
27
|
+
*/
|
|
28
|
+
class RemoteConnection {
|
|
29
|
+
url;
|
|
30
|
+
options;
|
|
31
|
+
/**
|
|
32
|
+
* @param {String} url The resource uri.
|
|
33
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
34
|
+
*/
|
|
35
|
+
constructor(url, options = {}) {
|
|
36
|
+
this.url = url;
|
|
37
|
+
this.options = options;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.RemoteConnection = RemoteConnection;
|
|
41
|
+
/**
|
|
42
|
+
* Represents a traversal as a result of a {@link RemoteConnection} submission.
|
|
43
|
+
*/
|
|
44
|
+
class RemoteTraversal extends traversal_js_1.Traversal {
|
|
45
|
+
constructor(source, sideEffects) {
|
|
46
|
+
super(null, null);
|
|
47
|
+
this._resultsStream = source;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.RemoteTraversal = RemoteTraversal;
|
|
51
|
+
class RemoteStrategy extends traversal_strategy_js_1.TraversalStrategy {
|
|
52
|
+
connection;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new instance of RemoteStrategy.
|
|
55
|
+
* @param {RemoteConnection} connection
|
|
56
|
+
*/
|
|
57
|
+
constructor(connection) {
|
|
58
|
+
super();
|
|
59
|
+
this.connection = connection;
|
|
60
|
+
}
|
|
61
|
+
/** @override */
|
|
62
|
+
apply(traversal) {
|
|
63
|
+
if (traversal._resultsStream) {
|
|
64
|
+
return Promise.resolve();
|
|
65
|
+
}
|
|
66
|
+
return this.connection.submit(traversal.getGremlinLang()).then(function (remoteTraversal) {
|
|
67
|
+
traversal.sideEffects = remoteTraversal.sideEffects;
|
|
68
|
+
traversal._resultsStream = remoteTraversal._resultsStream;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.RemoteStrategy = RemoteStrategy;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Jorge Bay Gondra
|
|
3
|
+
*/
|
|
4
|
+
import GremlinLang from '../process/gremlin-lang.cjs';
|
|
5
|
+
import { TraversalStrategy } from '../process/traversal-strategy.cjs';
|
|
6
|
+
import { Traversal } from '../process/traversal.cjs';
|
|
7
|
+
import type { ConnectionOptions } from './connection.cjs';
|
|
8
|
+
/**
|
|
9
|
+
* Represents an abstraction of a "connection" to a "server" that is capable of processing a traversal and
|
|
10
|
+
* returning results.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class RemoteConnection {
|
|
13
|
+
url: string;
|
|
14
|
+
readonly options: ConnectionOptions;
|
|
15
|
+
/**
|
|
16
|
+
* @param {String} url The resource uri.
|
|
17
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
18
|
+
*/
|
|
19
|
+
constructor(url: string, options?: ConnectionOptions);
|
|
20
|
+
/**
|
|
21
|
+
* Opens the connection, if its not already opened.
|
|
22
|
+
* @returns {Promise}
|
|
23
|
+
*/
|
|
24
|
+
abstract open(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns true if connection is open
|
|
27
|
+
* @returns {Boolean}
|
|
28
|
+
*/
|
|
29
|
+
abstract get isOpen(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Submits the <code>GremlinLang</code> provided and returns a <code>RemoteTraversal</code>.
|
|
32
|
+
* @param {GremlinLang} gremlinLang
|
|
33
|
+
* @returns {Promise} Returns a <code>Promise</code> that resolves to a <code>RemoteTraversal</code>.
|
|
34
|
+
*/
|
|
35
|
+
abstract submit(gremlinLang: GremlinLang): Promise<RemoteTraversal>;
|
|
36
|
+
/**
|
|
37
|
+
* Closes the connection and releases any associated resources.
|
|
38
|
+
* @returns {Promise}
|
|
39
|
+
*/
|
|
40
|
+
abstract close(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Represents a traversal as a result of a {@link RemoteConnection} submission.
|
|
44
|
+
*/
|
|
45
|
+
export declare class RemoteTraversal extends Traversal {
|
|
46
|
+
constructor(source: AsyncGenerator<any>, sideEffects?: any[]);
|
|
47
|
+
}
|
|
48
|
+
export declare class RemoteStrategy extends TraversalStrategy {
|
|
49
|
+
connection: RemoteConnection;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new instance of RemoteStrategy.
|
|
52
|
+
* @param {RemoteConnection} connection
|
|
53
|
+
*/
|
|
54
|
+
constructor(connection: RemoteConnection);
|
|
55
|
+
/** @override */
|
|
56
|
+
apply(traversal: Traversal): Promise<void>;
|
|
57
|
+
}
|