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,363 @@
|
|
|
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
|
+
exports.DEFAULT_BATCH_SIZE = void 0;
|
|
58
|
+
/**
|
|
59
|
+
* @author Jorge Bay Gondra
|
|
60
|
+
*/
|
|
61
|
+
const buffer_1 = require("node:buffer");
|
|
62
|
+
const eventemitter3_1 = require("eventemitter3");
|
|
63
|
+
const GraphBinary_js_1 = __importStar(require("../structure/io/binary/GraphBinary.cjs"));
|
|
64
|
+
const GraphBinaryReader_js_1 = __importDefault(require("../structure/io/binary/internals/GraphBinaryReader.cjs"));
|
|
65
|
+
const StreamReader_js_1 = __importDefault(require("../structure/io/binary/internals/StreamReader.cjs"));
|
|
66
|
+
const utils = __importStar(require("../utils.cjs"));
|
|
67
|
+
const result_set_js_1 = __importDefault(require("./result-set.cjs"));
|
|
68
|
+
const request_message_js_1 = require("./request-message.cjs");
|
|
69
|
+
const http_request_js_1 = require("./http-request.cjs");
|
|
70
|
+
const response_error_js_1 = __importDefault(require("./response-error.cjs"));
|
|
71
|
+
const traversal_js_1 = require("../process/traversal.cjs");
|
|
72
|
+
const dispatcher_js_1 = require("./dispatcher.cjs");
|
|
73
|
+
const logger_js_1 = require("./logger.cjs");
|
|
74
|
+
const responseStatusCode = {
|
|
75
|
+
success: 200,
|
|
76
|
+
noContent: 204,
|
|
77
|
+
partialContent: 206,
|
|
78
|
+
};
|
|
79
|
+
/** The default per-request batch size used when neither the request nor the connection sets one. */
|
|
80
|
+
exports.DEFAULT_BATCH_SIZE = 64;
|
|
81
|
+
/**
|
|
82
|
+
* Represents a single connection to a Gremlin Server.
|
|
83
|
+
*/
|
|
84
|
+
class Connection extends eventemitter3_1.EventEmitter {
|
|
85
|
+
url;
|
|
86
|
+
options;
|
|
87
|
+
_responseSerializer;
|
|
88
|
+
isOpen = true;
|
|
89
|
+
traversalSource;
|
|
90
|
+
_enableUserAgentOnConnect;
|
|
91
|
+
_interceptors;
|
|
92
|
+
_dispatcher;
|
|
93
|
+
_compression;
|
|
94
|
+
_batchSize;
|
|
95
|
+
_bulkResults;
|
|
96
|
+
_log;
|
|
97
|
+
/**
|
|
98
|
+
* Creates a new instance of {@link Connection}.
|
|
99
|
+
* @param {String} url The resource uri.
|
|
100
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
101
|
+
*/
|
|
102
|
+
constructor(url, options = {}) {
|
|
103
|
+
super();
|
|
104
|
+
this.url = url;
|
|
105
|
+
this.options = options;
|
|
106
|
+
this._responseSerializer =
|
|
107
|
+
options.responseSerializer || (options.preciseNumbers === true ? (0, GraphBinary_js_1.createPreciseReader)() : new GraphBinaryReader_js_1.default(GraphBinary_js_1.default));
|
|
108
|
+
if (options.pdtRegistry) {
|
|
109
|
+
this._responseSerializer.pdtRegistry = options.pdtRegistry;
|
|
110
|
+
}
|
|
111
|
+
this.traversalSource = options.traversalSource || 'g';
|
|
112
|
+
this._enableUserAgentOnConnect = options.enableUserAgentOnConnect !== false;
|
|
113
|
+
this._log = (0, logger_js_1.normalizeLogger)(options.logger);
|
|
114
|
+
if (options.compression === undefined) {
|
|
115
|
+
this._compression = 'deflate';
|
|
116
|
+
}
|
|
117
|
+
else if (options.compression === 'none' || options.compression === 'deflate') {
|
|
118
|
+
this._compression = options.compression;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
throw new TypeError(`compression must be 'none' or 'deflate'`);
|
|
122
|
+
}
|
|
123
|
+
this._batchSize = options.batchSize ?? exports.DEFAULT_BATCH_SIZE;
|
|
124
|
+
this._bulkResults = options.bulkResults ?? false;
|
|
125
|
+
// The driver builds and owns the undici dispatcher from the discrete options.
|
|
126
|
+
// TLS is configured through the Node/undici runtime (e.g. NODE_EXTRA_CA_CERTS),
|
|
127
|
+
// not through a driver option.
|
|
128
|
+
this._dispatcher = (0, dispatcher_js_1.buildDispatcher)({
|
|
129
|
+
maxConnections: options.maxConnections,
|
|
130
|
+
readTimeoutMillis: options.readTimeoutMillis,
|
|
131
|
+
maxResponseHeaderBytes: options.maxResponseHeaderBytes,
|
|
132
|
+
keepAliveTimeMillis: options.keepAliveTimeMillis,
|
|
133
|
+
proxy: options.proxy,
|
|
134
|
+
});
|
|
135
|
+
const interceptors = options.interceptors;
|
|
136
|
+
if (typeof interceptors === 'function') {
|
|
137
|
+
this._interceptors = [interceptors];
|
|
138
|
+
}
|
|
139
|
+
else if (Array.isArray(interceptors)) {
|
|
140
|
+
this._interceptors = [...interceptors];
|
|
141
|
+
}
|
|
142
|
+
else if (interceptors === undefined || interceptors === null) {
|
|
143
|
+
this._interceptors = [];
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
throw new TypeError('interceptors must be a function, array, or undefined');
|
|
147
|
+
}
|
|
148
|
+
// Auth interceptor is always last so it runs after user interceptors
|
|
149
|
+
if (options.auth) {
|
|
150
|
+
this._interceptors.push(options.auth);
|
|
151
|
+
}
|
|
152
|
+
this._log('debug', `Connection created for ${this.url}`);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The connection-level default batch size, used to fill a request's `batchSize` when unset.
|
|
156
|
+
*/
|
|
157
|
+
get batchSize() {
|
|
158
|
+
return this._batchSize;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The connection-level default for `bulkResults`, applied to every request unless overridden
|
|
162
|
+
* per-request. Defaults to `false`.
|
|
163
|
+
*/
|
|
164
|
+
get bulkResults() {
|
|
165
|
+
return this._bulkResults;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Opens the connection, if its not already opened.
|
|
169
|
+
* @returns {Promise}
|
|
170
|
+
*/
|
|
171
|
+
async open() {
|
|
172
|
+
// No-op for HTTP connections
|
|
173
|
+
return Promise.resolve();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Send a request and buffer the entire response. Returns a Promise<ResultSet>.
|
|
177
|
+
*/
|
|
178
|
+
async submit(request) {
|
|
179
|
+
const response = await this.#makeHttpRequest(request);
|
|
180
|
+
return this.#handleResponse(response);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Send a request and stream the response incrementally.
|
|
184
|
+
* Returns an AsyncGenerator that yields deserialized result items.
|
|
185
|
+
* For bulked responses, yields Traverser objects.
|
|
186
|
+
*
|
|
187
|
+
* In the GraphBinary v4 streaming protocol, the server sends the status after all
|
|
188
|
+
* result data. If the server encounters an error mid-traversal, values yielded before
|
|
189
|
+
* the error are valid partial results. A ResponseError is thrown after the last value
|
|
190
|
+
* has been yielded.
|
|
191
|
+
*
|
|
192
|
+
* @param {RequestMessage} request
|
|
193
|
+
* @returns {AsyncGenerator<any>}
|
|
194
|
+
*/
|
|
195
|
+
async *stream(request) {
|
|
196
|
+
const abortController = new AbortController();
|
|
197
|
+
let response;
|
|
198
|
+
try {
|
|
199
|
+
response = await this.#makeHttpRequest(request, abortController.signal);
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
throw new Error(`Stream request failed: ${e.message}`, { cause: e });
|
|
203
|
+
}
|
|
204
|
+
if (!response.ok) {
|
|
205
|
+
// For error responses, buffer and parse the error body
|
|
206
|
+
const buffer = buffer_1.Buffer.from(await response.arrayBuffer());
|
|
207
|
+
const errorMessage = `Server returned HTTP ${response.status}: ${response.statusText}`;
|
|
208
|
+
const contentType = response.headers.get("Content-Type");
|
|
209
|
+
const reader = this.#getReaderForContentType(contentType);
|
|
210
|
+
try {
|
|
211
|
+
if (reader) {
|
|
212
|
+
const deserialized = await reader.readResponse(buffer);
|
|
213
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
214
|
+
code: deserialized.status.code,
|
|
215
|
+
message: deserialized.status.message || response.statusText,
|
|
216
|
+
exception: deserialized.status.exception,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
else if (contentType === 'application/json') {
|
|
220
|
+
const errorBody = JSON.parse(buffer.toString());
|
|
221
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
222
|
+
code: response.status,
|
|
223
|
+
message: errorBody.message || errorBody.error || response.statusText,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
if (err instanceof response_error_js_1.default)
|
|
229
|
+
throw err;
|
|
230
|
+
}
|
|
231
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
232
|
+
code: response.status,
|
|
233
|
+
message: response.statusText,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (!response.body) {
|
|
237
|
+
// 204 No Content - nothing to yield
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const streamReader = StreamReader_js_1.default.fromReadableStream(response.body);
|
|
241
|
+
let completed = false;
|
|
242
|
+
try {
|
|
243
|
+
yield* this._responseSerializer.readResponseStream(streamReader);
|
|
244
|
+
completed = true;
|
|
245
|
+
}
|
|
246
|
+
finally {
|
|
247
|
+
if (!completed) {
|
|
248
|
+
// Consumer broke out early or an error occurred - abort to release the connection
|
|
249
|
+
abortController.abort();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
#getReaderForContentType(contentType) {
|
|
254
|
+
if (!contentType) {
|
|
255
|
+
return this._responseSerializer;
|
|
256
|
+
}
|
|
257
|
+
if (contentType === this._responseSerializer.mimeType) {
|
|
258
|
+
return this._responseSerializer;
|
|
259
|
+
}
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
async #makeHttpRequest(request, signal) {
|
|
263
|
+
const headers = {
|
|
264
|
+
'Accept': this._responseSerializer.mimeType,
|
|
265
|
+
};
|
|
266
|
+
if (this._compression === 'deflate') {
|
|
267
|
+
headers['Accept-Encoding'] = 'deflate';
|
|
268
|
+
}
|
|
269
|
+
if (this._enableUserAgentOnConnect) {
|
|
270
|
+
const userAgent = await utils.getUserAgent();
|
|
271
|
+
if (userAgent !== undefined) {
|
|
272
|
+
headers[utils.getUserAgentHeader()] = userAgent;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
const httpRequest = new http_request_js_1.HttpRequest('POST', this.url, headers, request);
|
|
276
|
+
// Promote transactionId to HTTP header before interceptors run.
|
|
277
|
+
// The field remains in the serialized body as well (dual transmission
|
|
278
|
+
// per the HTTP transaction protocol specification).
|
|
279
|
+
if (request instanceof request_message_js_1.RequestMessage) {
|
|
280
|
+
const fields = request.getFields();
|
|
281
|
+
if (fields.has('transactionId')) {
|
|
282
|
+
httpRequest.headers['X-Transaction-Id'] = fields.get('transactionId');
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
for (let i = 0; i < this._interceptors.length; i++) {
|
|
286
|
+
try {
|
|
287
|
+
await this._interceptors[i](httpRequest);
|
|
288
|
+
}
|
|
289
|
+
catch (e) {
|
|
290
|
+
throw new Error(`Request interceptor at index ${i} failed: ${e.message}`, { cause: e });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Auto-serialize body to JSON after interceptors run (idempotent if already serialized)
|
|
294
|
+
httpRequest.serializeBody();
|
|
295
|
+
this._log('debug', `Sending ${httpRequest.method} request to ${httpRequest.url}`);
|
|
296
|
+
return dispatcher_js_1.httpFetch.fetch(httpRequest.url, {
|
|
297
|
+
method: httpRequest.method,
|
|
298
|
+
headers: httpRequest.headers,
|
|
299
|
+
body: httpRequest.body,
|
|
300
|
+
signal,
|
|
301
|
+
// Node only: the undici dispatcher carries the connection-pool options. In the browser
|
|
302
|
+
// it is undefined and the field is omitted, letting the user agent manage the transport.
|
|
303
|
+
...(this._dispatcher ? { dispatcher: this._dispatcher } : {}),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
async #handleResponse(response) {
|
|
307
|
+
const contentType = response.headers.get("Content-Type");
|
|
308
|
+
const buffer = buffer_1.Buffer.from(await response.arrayBuffer());
|
|
309
|
+
const reader = this.#getReaderForContentType(contentType);
|
|
310
|
+
if (!response.ok) {
|
|
311
|
+
const errorMessage = `Server returned HTTP ${response.status}: ${response.statusText}`;
|
|
312
|
+
try {
|
|
313
|
+
if (reader) {
|
|
314
|
+
const deserialized = await reader.readResponse(buffer);
|
|
315
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
316
|
+
code: deserialized.status.code,
|
|
317
|
+
message: deserialized.status.message || response.statusText,
|
|
318
|
+
exception: deserialized.status.exception,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
else if (contentType === 'application/json') {
|
|
322
|
+
const errorBody = JSON.parse(buffer.toString());
|
|
323
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
324
|
+
code: response.status,
|
|
325
|
+
message: errorBody.message || errorBody.error || response.statusText,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
if (err instanceof response_error_js_1.default) {
|
|
331
|
+
throw err;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
throw new response_error_js_1.default(errorMessage, {
|
|
335
|
+
code: response.status,
|
|
336
|
+
message: response.statusText,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (!reader) {
|
|
340
|
+
throw new Error(`Response Content-Type '${contentType}' does not match the configured response serializer (expected '${this._responseSerializer.mimeType}')`);
|
|
341
|
+
}
|
|
342
|
+
const deserialized = await reader.readResponse(buffer);
|
|
343
|
+
if (deserialized.status.code && deserialized.status.code !== responseStatusCode.success && deserialized.status.code !== responseStatusCode.noContent && deserialized.status.code !== responseStatusCode.partialContent) {
|
|
344
|
+
throw new response_error_js_1.default(`Server error: ${deserialized.status.message || 'Unknown error'} (${deserialized.status.code})`, {
|
|
345
|
+
code: deserialized.status.code,
|
|
346
|
+
message: deserialized.status.message || '',
|
|
347
|
+
exception: deserialized.status.exception,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return new result_set_js_1.default(deserialized.result.bulked
|
|
351
|
+
? deserialized.result.data.map((item) => new traversal_js_1.Traverser(item.v, item.bulk))
|
|
352
|
+
: deserialized.result.data, new Map());
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Closes the Connection.
|
|
356
|
+
* @return {Promise}
|
|
357
|
+
*/
|
|
358
|
+
async close() {
|
|
359
|
+
this._log('debug', `Closing connection to ${this.url}`);
|
|
360
|
+
await this._dispatcher?.close();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
exports.default = Connection;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { EventEmitter } from 'eventemitter3';
|
|
2
|
+
import ResultSet from './result-set.cjs';
|
|
3
|
+
import { RequestMessage } from "./request-message.cjs";
|
|
4
|
+
import { RequestInterceptor } from './http-request.cjs';
|
|
5
|
+
import { Logger } from './logger.cjs';
|
|
6
|
+
/**
|
|
7
|
+
* Selects the content encoding requested from, and decoded for, the server. `'deflate'` (the
|
|
8
|
+
* default) sends an `Accept-Encoding: deflate` header and decodes deflate responses; `'none'`
|
|
9
|
+
* turns compression off.
|
|
10
|
+
*/
|
|
11
|
+
export type Compression = 'none' | 'deflate';
|
|
12
|
+
export type ConnectionOptions = {
|
|
13
|
+
preciseNumbers?: boolean;
|
|
14
|
+
pdtRegistry?: any;
|
|
15
|
+
responseSerializer?: any;
|
|
16
|
+
traversalSource?: string;
|
|
17
|
+
enableUserAgentOnConnect?: boolean;
|
|
18
|
+
/** Maximum number of concurrent connections per origin. Defaults to 128. */
|
|
19
|
+
maxConnections?: number;
|
|
20
|
+
/** Read timeout in ms, applied to the default dispatcher. Maps to undici `headersTimeout` (wait for first response byte) and `bodyTimeout` (idle between body chunks). */
|
|
21
|
+
readTimeoutMillis?: number;
|
|
22
|
+
/** Maximum size of the response headers in bytes, applied to the default dispatcher. */
|
|
23
|
+
maxResponseHeaderBytes?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Idle time in milliseconds before TCP keep-alive probes begin on a connection. Defaults to
|
|
26
|
+
* 30000 (30s) when unset. Set to `0` to disable keep-alive entirely.
|
|
27
|
+
*/
|
|
28
|
+
keepAliveTimeMillis?: number;
|
|
29
|
+
/** HTTP proxy URI. When set, requests are routed through an undici `ProxyAgent`. */
|
|
30
|
+
proxy?: string;
|
|
31
|
+
/** Response compression codec. Defaults to `'deflate'` (on). */
|
|
32
|
+
compression?: Compression;
|
|
33
|
+
/** Connection-level default that fills a request's `batchSize` when it is left unset. Defaults to 64. */
|
|
34
|
+
batchSize?: number;
|
|
35
|
+
/** Connection-level default for `bulkResults`, applied to every request unless overridden per-request. Defaults to `false`. */
|
|
36
|
+
bulkResults?: boolean;
|
|
37
|
+
/** An optional logger (a logger object or a callback). Logging is disabled when unset. */
|
|
38
|
+
logger?: Logger;
|
|
39
|
+
interceptors?: RequestInterceptor | RequestInterceptor[];
|
|
40
|
+
/** An optional auth interceptor. As a convenience, this is always appended to the end of the
|
|
41
|
+
* interceptor list so it runs last, after any user interceptors have modified the request. */
|
|
42
|
+
auth?: RequestInterceptor;
|
|
43
|
+
};
|
|
44
|
+
/** The default per-request batch size used when neither the request nor the connection sets one. */
|
|
45
|
+
export declare const DEFAULT_BATCH_SIZE = 64;
|
|
46
|
+
/**
|
|
47
|
+
* Represents a single connection to a Gremlin Server.
|
|
48
|
+
*/
|
|
49
|
+
export default class Connection extends EventEmitter {
|
|
50
|
+
#private;
|
|
51
|
+
readonly url: string;
|
|
52
|
+
readonly options: ConnectionOptions;
|
|
53
|
+
private readonly _responseSerializer;
|
|
54
|
+
isOpen: boolean;
|
|
55
|
+
traversalSource: string;
|
|
56
|
+
private readonly _enableUserAgentOnConnect;
|
|
57
|
+
private readonly _interceptors;
|
|
58
|
+
private readonly _dispatcher;
|
|
59
|
+
private readonly _compression;
|
|
60
|
+
private readonly _batchSize;
|
|
61
|
+
private readonly _bulkResults;
|
|
62
|
+
private readonly _log;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new instance of {@link Connection}.
|
|
65
|
+
* @param {String} url The resource uri.
|
|
66
|
+
* @param {ConnectionOptions} [options] The connection options.
|
|
67
|
+
*/
|
|
68
|
+
constructor(url: string, options?: ConnectionOptions);
|
|
69
|
+
/**
|
|
70
|
+
* The connection-level default batch size, used to fill a request's `batchSize` when unset.
|
|
71
|
+
*/
|
|
72
|
+
get batchSize(): number;
|
|
73
|
+
/**
|
|
74
|
+
* The connection-level default for `bulkResults`, applied to every request unless overridden
|
|
75
|
+
* per-request. Defaults to `false`.
|
|
76
|
+
*/
|
|
77
|
+
get bulkResults(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Opens the connection, if its not already opened.
|
|
80
|
+
* @returns {Promise}
|
|
81
|
+
*/
|
|
82
|
+
open(): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Send a request and buffer the entire response. Returns a Promise<ResultSet>.
|
|
85
|
+
*/
|
|
86
|
+
submit(request: RequestMessage): Promise<ResultSet>;
|
|
87
|
+
/**
|
|
88
|
+
* Send a request and stream the response incrementally.
|
|
89
|
+
* Returns an AsyncGenerator that yields deserialized result items.
|
|
90
|
+
* For bulked responses, yields Traverser objects.
|
|
91
|
+
*
|
|
92
|
+
* In the GraphBinary v4 streaming protocol, the server sends the status after all
|
|
93
|
+
* result data. If the server encounters an error mid-traversal, values yielded before
|
|
94
|
+
* the error are valid partial results. A ResponseError is thrown after the last value
|
|
95
|
+
* has been yielded.
|
|
96
|
+
*
|
|
97
|
+
* @param {RequestMessage} request
|
|
98
|
+
* @returns {AsyncGenerator<any>}
|
|
99
|
+
*/
|
|
100
|
+
stream(request: RequestMessage): AsyncGenerator<any>;
|
|
101
|
+
/**
|
|
102
|
+
* Closes the Connection.
|
|
103
|
+
* @return {Promise}
|
|
104
|
+
*/
|
|
105
|
+
close(): Promise<void>;
|
|
106
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.httpFetch = void 0;
|
|
22
|
+
exports.buildDispatcher = buildDispatcher;
|
|
23
|
+
/**
|
|
24
|
+
* Connection-pool / transport options that only the Node (`undici`) dispatcher can honor. The
|
|
25
|
+
* browser's HTTP stack owns these concerns and exposes no `fetch` API to configure them, so they
|
|
26
|
+
* are rejected here rather than silently ignored. `readTimeoutMillis` is intentionally not in this list:
|
|
27
|
+
* it has a browser analog (an `AbortSignal`-based timeout) and is handled by the connection.
|
|
28
|
+
*/
|
|
29
|
+
const NODE_ONLY_OPTIONS = [
|
|
30
|
+
'maxConnections',
|
|
31
|
+
'keepAliveTimeMillis',
|
|
32
|
+
'maxResponseHeaderBytes',
|
|
33
|
+
'proxy',
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* In the browser there is no `undici` dispatcher, so `fetch` is issued without one and the browser
|
|
37
|
+
* manages the transport. Any {@link NODE_ONLY_OPTIONS} set explicitly cannot be honored and throws,
|
|
38
|
+
* so a misconfiguration surfaces immediately instead of being silently dropped. With none set this
|
|
39
|
+
* returns `undefined` and the connection omits the `dispatcher` field.
|
|
40
|
+
*/
|
|
41
|
+
function buildDispatcher(options = {}) {
|
|
42
|
+
const unsupported = NODE_ONLY_OPTIONS.filter((key) => options[key] !== undefined);
|
|
43
|
+
if (unsupported.length > 0) {
|
|
44
|
+
throw new Error(`The following connection options are not supported in the browser and are managed by the ` +
|
|
45
|
+
`browser's HTTP stack: ${unsupported.join(', ')}. Remove them when running in a browser ` +
|
|
46
|
+
`(they are supported in Node).`);
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Browser counterpart of the Node `httpFetch` holder. There is no `undici` in the browser, so
|
|
52
|
+
* requests use the global `fetch` and the user agent manages the transport. Same holder shape as
|
|
53
|
+
* the Node build.
|
|
54
|
+
*/
|
|
55
|
+
exports.httpFetch = {
|
|
56
|
+
fetch: globalThis.fetch.bind(globalThis),
|
|
57
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser counterpart of {@link ./dispatcher.ts}. The Node build configures the underlying HTTP
|
|
3
|
+
* transport through an `undici` dispatcher, but `undici` is built on `node:net`/`node:tls` and
|
|
4
|
+
* cannot run in a browser. Bundlers pick this file up via the `"browser"` field in `package.json`,
|
|
5
|
+
* so a browser bundle never imports `undici`.
|
|
6
|
+
*
|
|
7
|
+
* The browser's HTTP stack manages the connection-pool options that the Node dispatcher carries,
|
|
8
|
+
* so {@link buildDispatcher} throws if any is set explicitly (rather than silently ignoring it)
|
|
9
|
+
* and otherwise returns `undefined`, leaving the connection to issue a plain `fetch`. It is the
|
|
10
|
+
* only export the connection imports through the swapped `./dispatcher.cjs` path.
|
|
11
|
+
*/
|
|
12
|
+
/** Transport options accepted by {@link buildDispatcher}; mirrors the Node dispatcher's options. */
|
|
13
|
+
type DispatcherOptions = {
|
|
14
|
+
maxConnections?: number;
|
|
15
|
+
readTimeoutMillis?: number;
|
|
16
|
+
maxResponseHeaderBytes?: number;
|
|
17
|
+
keepAliveTimeMillis?: number;
|
|
18
|
+
proxy?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* In the browser there is no `undici` dispatcher, so `fetch` is issued without one and the browser
|
|
22
|
+
* manages the transport. Any {@link NODE_ONLY_OPTIONS} set explicitly cannot be honored and throws,
|
|
23
|
+
* so a misconfiguration surfaces immediately instead of being silently dropped. With none set this
|
|
24
|
+
* returns `undefined` and the connection omits the `dispatcher` field.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildDispatcher(options?: DispatcherOptions): undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Browser counterpart of the Node `httpFetch` holder. There is no `undici` in the browser, so
|
|
29
|
+
* requests use the global `fetch` and the user agent manages the transport. Same holder shape as
|
|
30
|
+
* the Node build.
|
|
31
|
+
*/
|
|
32
|
+
export declare const httpFetch: {
|
|
33
|
+
fetch: typeof globalThis.fetch;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
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.httpFetch = exports.DEFAULT_KEEP_ALIVE_TIME = exports.DEFAULT_MAX_CONNECTIONS = void 0;
|
|
22
|
+
exports.resolveKeepAliveTime = resolveKeepAliveTime;
|
|
23
|
+
exports.buildKeepAliveConnector = buildKeepAliveConnector;
|
|
24
|
+
exports.buildAgentOptions = buildAgentOptions;
|
|
25
|
+
exports.buildDispatcher = buildDispatcher;
|
|
26
|
+
const undici_1 = require("undici");
|
|
27
|
+
/** Default concurrent-connections-per-origin cap (Node's global fetch is uncapped). */
|
|
28
|
+
exports.DEFAULT_MAX_CONNECTIONS = 128;
|
|
29
|
+
/** Canonical TinkerPop 4.x default TCP keep-alive idle time (30s), shared across the GLVs. */
|
|
30
|
+
exports.DEFAULT_KEEP_ALIVE_TIME = 30000;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves the effective keep-alive idle delay: unset falls back to {@link DEFAULT_KEEP_ALIVE_TIME},
|
|
33
|
+
* a non-positive value disables keep-alive (returns `null`).
|
|
34
|
+
*/
|
|
35
|
+
function resolveKeepAliveTime(keepAliveTime) {
|
|
36
|
+
const effective = keepAliveTime ?? exports.DEFAULT_KEEP_ALIVE_TIME;
|
|
37
|
+
return effective > 0 ? effective : null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Builds an undici connector that sets `SO_KEEPALIVE` with the given idle delay on each new socket.
|
|
41
|
+
* `baseConnector` is parameterised so the wiring can be unit-tested with a fake connector.
|
|
42
|
+
*/
|
|
43
|
+
function buildKeepAliveConnector(delay, baseConnector = (0, undici_1.buildConnector)({})) {
|
|
44
|
+
return (connectOptions, callback) => {
|
|
45
|
+
baseConnector(connectOptions, (err, socket) => {
|
|
46
|
+
if (err) {
|
|
47
|
+
callback(err, null);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (socket) {
|
|
51
|
+
socket.setKeepAlive(true, delay);
|
|
52
|
+
}
|
|
53
|
+
callback(null, socket);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Maps the discrete driver options onto undici {@link Agent.Options} (the single source of truth
|
|
59
|
+
* for that mapping). Exported as a seam so the mapping can be asserted in unit tests.
|
|
60
|
+
*/
|
|
61
|
+
function buildAgentOptions(options = {}) {
|
|
62
|
+
const maxConnections = options.maxConnections ?? exports.DEFAULT_MAX_CONNECTIONS;
|
|
63
|
+
const agentOptions = {
|
|
64
|
+
connections: maxConnections,
|
|
65
|
+
};
|
|
66
|
+
// Connect/idle timeouts are intentionally left to undici defaults (the GLV spec marks the JS
|
|
67
|
+
// connect/idle timeout as N/A), not exposed as driver options.
|
|
68
|
+
if (options.readTimeoutMillis !== undefined) {
|
|
69
|
+
agentOptions.headersTimeout = options.readTimeoutMillis;
|
|
70
|
+
agentOptions.bodyTimeout = options.readTimeoutMillis;
|
|
71
|
+
}
|
|
72
|
+
if (options.maxResponseHeaderBytes !== undefined) {
|
|
73
|
+
agentOptions.maxHeaderSize = options.maxResponseHeaderBytes;
|
|
74
|
+
}
|
|
75
|
+
const keepAliveDelay = resolveKeepAliveTime(options.keepAliveTimeMillis);
|
|
76
|
+
if (keepAliveDelay !== null) {
|
|
77
|
+
agentOptions.connect = buildKeepAliveConnector(keepAliveDelay);
|
|
78
|
+
}
|
|
79
|
+
return agentOptions;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the default undici {@link Dispatcher}: a {@link ProxyAgent} when `proxy` is set, otherwise
|
|
83
|
+
* a plain {@link Agent}. (Agent and ProxyAgent share one dispatcher slot, so only one is built.)
|
|
84
|
+
*/
|
|
85
|
+
function buildDispatcher(options = {}) {
|
|
86
|
+
const agentOptions = buildAgentOptions(options);
|
|
87
|
+
if (options.proxy) {
|
|
88
|
+
return new undici_1.ProxyAgent({ uri: options.proxy, ...agentOptions });
|
|
89
|
+
}
|
|
90
|
+
return new undici_1.Agent(agentOptions);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* HTTP `fetch` for the Node build. Uses undici's own `fetch` (not the global one) so `fetch` and the
|
|
94
|
+
* {@link buildDispatcher} dispatcher share one undici version, whatever undici the Node runtime
|
|
95
|
+
* bundles (e.g. Node 26 ships undici 8, incompatible with an undici 6 dispatcher). A holder object,
|
|
96
|
+
* not a bare export, so tests can swap `fetch` (an ESM export can't be reassigned, an object
|
|
97
|
+
* property can). The cast aligns undici's `fetch` type with the global one.
|
|
98
|
+
*/
|
|
99
|
+
exports.httpFetch = {
|
|
100
|
+
fetch: undici_1.fetch,
|
|
101
|
+
};
|