gremlin 4.0.0-beta.2 → 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/build/cjs/driver/auth.cjs +11 -4
- package/build/cjs/driver/auth.d.cts +1 -1
- package/build/cjs/driver/client.cjs +82 -38
- package/build/cjs/driver/client.d.cts +30 -27
- package/build/cjs/driver/connection.cjs +173 -60
- package/build/cjs/driver/connection.d.cts +69 -26
- 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 +27 -15
- package/build/cjs/driver/driver-remote-connection.d.cts +10 -4
- 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 +5 -8
- package/build/cjs/driver/remote-connection.d.cts +6 -21
- package/build/cjs/driver/request-message.cjs +110 -21
- package/build/cjs/driver/request-message.d.cts +38 -8
- package/build/cjs/driver/response-error.cjs +3 -3
- package/build/cjs/driver/response-error.d.cts +2 -2
- package/build/cjs/index.cjs +21 -0
- package/build/cjs/index.d.cts +47 -0
- package/build/cjs/language/grammar/GremlinLexer.cjs +1669 -1615
- package/build/cjs/language/grammar/GremlinLexer.d.cts +325 -316
- package/build/cjs/language/grammar/GremlinListener.cjs +322 -8
- package/build/cjs/language/grammar/GremlinListener.d.cts +351 -10
- package/build/cjs/language/grammar/GremlinParser.cjs +8700 -5798
- package/build/cjs/language/grammar/GremlinParser.d.cts +998 -619
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.cjs +9 -0
- package/build/cjs/language/translator/AnonymizedTranslateVisitor.d.cts +3 -0
- package/build/cjs/language/translator/DotNetTranslateVisitor.cjs +113 -4
- package/build/cjs/language/translator/DotNetTranslateVisitor.d.cts +13 -2
- package/build/cjs/language/translator/GoTranslateVisitor.cjs +82 -0
- package/build/cjs/language/translator/GoTranslateVisitor.d.cts +9 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.cjs +23 -0
- package/build/cjs/language/translator/GroovyTranslateVisitor.d.cts +3 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.cjs +23 -0
- package/build/cjs/language/translator/JavaTranslateVisitor.d.cts +3 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.cjs +11 -0
- package/build/cjs/language/translator/JavascriptTranslateVisitor.d.cts +3 -0
- package/build/cjs/language/translator/PythonTranslateVisitor.cjs +39 -3
- package/build/cjs/language/translator/PythonTranslateVisitor.d.cts +3 -0
- package/build/cjs/language/translator/TranslateVisitor.cjs +9 -0
- package/build/cjs/language/translator/TranslateVisitor.d.cts +3 -0
- package/build/cjs/process/anonymous-traversal.cjs +5 -1
- package/build/cjs/process/graph-traversal.cjs +139 -8
- package/build/cjs/process/graph-traversal.d.cts +84 -3
- package/build/cjs/process/gremlin-lang.cjs +119 -7
- package/build/cjs/process/gremlin-lang.d.cts +6 -1
- package/build/cjs/process/gvalue.cjs +42 -0
- package/build/cjs/process/gvalue.d.cts +7 -0
- package/build/cjs/process/transaction.cjs +125 -23
- package/build/cjs/process/transaction.d.cts +50 -14
- package/build/cjs/process/traversal.cjs +105 -48
- package/build/cjs/process/traversal.d.cts +36 -10
- package/build/cjs/structure/PDTRegistry.cjs +116 -0
- package/build/cjs/structure/PDTRegistry.d.cts +34 -0
- package/build/cjs/structure/graph.cjs +351 -8
- package/build/cjs/structure/graph.d.cts +122 -3
- package/build/cjs/structure/io/binary/GraphBinary.cjs +68 -39
- package/build/cjs/structure/io/binary/GraphBinary.d.cts +15 -1
- package/build/cjs/structure/io/binary/internals/AnySerializer.cjs +34 -17
- package/build/cjs/structure/io/binary/internals/AnySerializer.d.cts +12 -2
- package/build/cjs/structure/io/binary/internals/ArraySerializer.cjs +41 -72
- package/build/cjs/structure/io/binary/internals/ArraySerializer.d.cts +14 -7
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.cjs +34 -54
- package/build/cjs/structure/io/binary/internals/BigIntegerSerializer.d.cts +12 -7
- package/build/cjs/structure/io/binary/internals/BinarySerializer.cjs +31 -51
- package/build/cjs/structure/io/binary/internals/BinarySerializer.d.cts +12 -4
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.cjs +28 -42
- package/build/cjs/structure/io/binary/internals/BooleanSerializer.d.cts +12 -4
- package/build/cjs/structure/io/binary/internals/ByteSerializer.cjs +24 -38
- package/build/cjs/structure/io/binary/internals/ByteSerializer.d.cts +12 -4
- 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/DateTimeSerializer.cjs +52 -69
- package/build/cjs/structure/io/binary/internals/DateTimeSerializer.d.cts +12 -7
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.cjs +24 -38
- package/build/cjs/structure/io/binary/internals/DoubleSerializer.d.cts +12 -4
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.cjs +69 -124
- package/build/cjs/structure/io/binary/internals/EdgeSerializer.d.cts +14 -12
- package/build/cjs/structure/io/binary/internals/EnumSerializer.cjs +47 -59
- package/build/cjs/structure/io/binary/internals/EnumSerializer.d.cts +19 -4
- package/build/cjs/structure/io/binary/internals/FloatSerializer.cjs +24 -38
- package/build/cjs/structure/io/binary/internals/FloatSerializer.d.cts +12 -4
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.cjs +111 -37
- package/build/cjs/structure/io/binary/internals/GraphBinaryReader.d.cts +26 -2
- package/build/cjs/structure/io/binary/internals/GraphBinaryWriter.cjs +6 -6
- 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 +33 -38
- package/build/cjs/structure/io/binary/internals/IntSerializer.d.cts +19 -4
- package/build/cjs/structure/io/binary/internals/LongSerializer.cjs +29 -42
- package/build/cjs/structure/io/binary/internals/LongSerializer.d.cts +13 -4
- package/build/cjs/structure/io/binary/internals/MapSerializer.cjs +36 -70
- package/build/cjs/structure/io/binary/internals/MapSerializer.d.cts +14 -7
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.cjs +30 -33
- package/build/cjs/structure/io/binary/internals/MarkerSerializer.d.cts +13 -4
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.cjs +28 -2
- package/build/cjs/structure/io/binary/internals/NumberSerializationStrategy.d.cts +0 -3
- package/build/cjs/structure/io/binary/internals/PathSerializer.cjs +30 -55
- package/build/cjs/structure/io/binary/internals/PathSerializer.d.cts +14 -7
- 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 +32 -69
- package/build/cjs/structure/io/binary/internals/PropertySerializer.d.cts +14 -7
- package/build/cjs/structure/io/binary/internals/SetSerializer.cjs +39 -73
- package/build/cjs/structure/io/binary/internals/SetSerializer.d.cts +14 -7
- package/build/cjs/structure/io/binary/internals/ShortSerializer.cjs +24 -38
- package/build/cjs/structure/io/binary/internals/ShortSerializer.d.cts +12 -4
- 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 +34 -53
- package/build/cjs/structure/io/binary/internals/StringSerializer.d.cts +14 -4
- package/build/cjs/structure/io/binary/internals/StubSerializer.cjs +2 -1
- package/build/cjs/structure/io/binary/internals/StubSerializer.d.cts +1 -1
- 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 +8 -31
- package/build/cjs/structure/io/binary/internals/UnspecifiedNullSerializer.d.cts +6 -4
- package/build/cjs/structure/io/binary/internals/UuidSerializer.cjs +33 -49
- package/build/cjs/structure/io/binary/internals/UuidSerializer.d.cts +12 -7
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.cjs +37 -95
- package/build/cjs/structure/io/binary/internals/VertexPropertySerializer.d.cts +14 -7
- package/build/cjs/structure/io/binary/internals/VertexSerializer.cjs +41 -68
- package/build/cjs/structure/io/binary/internals/VertexSerializer.d.cts +14 -9
- package/build/cjs/utils.cjs +157 -40
- package/build/cjs/utils.d.cts +62 -4
- package/build/esm/driver/auth.d.ts +1 -1
- package/build/esm/driver/auth.js +11 -4
- package/build/esm/driver/client.d.ts +30 -27
- package/build/esm/driver/client.js +82 -38
- package/build/esm/driver/connection.d.ts +69 -26
- package/build/esm/driver/connection.js +172 -60
- 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 +10 -4
- package/build/esm/driver/driver-remote-connection.js +27 -15
- 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 +6 -21
- package/build/esm/driver/remote-connection.js +5 -8
- package/build/esm/driver/request-message.d.ts +38 -8
- package/build/esm/driver/request-message.js +107 -21
- package/build/esm/driver/response-error.d.ts +2 -2
- package/build/esm/driver/response-error.js +3 -3
- package/build/esm/index.d.ts +47 -0
- package/build/esm/index.js +21 -0
- package/build/esm/language/grammar/GremlinLexer.d.ts +325 -316
- package/build/esm/language/grammar/GremlinLexer.js +1669 -1615
- package/build/esm/language/grammar/GremlinListener.d.ts +351 -10
- package/build/esm/language/grammar/GremlinListener.js +322 -8
- package/build/esm/language/grammar/GremlinParser.d.ts +998 -619
- package/build/esm/language/grammar/GremlinParser.js +8646 -5778
- package/build/esm/language/translator/AnonymizedTranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/AnonymizedTranslateVisitor.js +9 -0
- package/build/esm/language/translator/DotNetTranslateVisitor.d.ts +13 -2
- package/build/esm/language/translator/DotNetTranslateVisitor.js +113 -4
- package/build/esm/language/translator/GoTranslateVisitor.d.ts +9 -0
- package/build/esm/language/translator/GoTranslateVisitor.js +82 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/GroovyTranslateVisitor.js +23 -0
- package/build/esm/language/translator/JavaTranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/JavaTranslateVisitor.js +23 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/JavascriptTranslateVisitor.js +11 -0
- package/build/esm/language/translator/PythonTranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/PythonTranslateVisitor.js +39 -3
- package/build/esm/language/translator/TranslateVisitor.d.ts +3 -0
- package/build/esm/language/translator/TranslateVisitor.js +9 -0
- package/build/esm/process/anonymous-traversal.js +5 -1
- package/build/esm/process/graph-traversal.d.ts +84 -3
- package/build/esm/process/graph-traversal.js +139 -8
- package/build/esm/process/gremlin-lang.d.ts +6 -1
- package/build/esm/process/gremlin-lang.js +121 -9
- package/build/esm/process/gvalue.d.ts +7 -0
- package/build/esm/process/gvalue.js +38 -0
- package/build/esm/process/transaction.d.ts +50 -14
- package/build/esm/process/transaction.js +122 -23
- package/build/esm/process/traversal.d.ts +36 -10
- package/build/esm/process/traversal.js +104 -47
- package/build/esm/structure/PDTRegistry.d.ts +34 -0
- package/build/esm/structure/PDTRegistry.js +112 -0
- package/build/esm/structure/graph.d.ts +122 -3
- package/build/esm/structure/graph.js +347 -7
- package/build/esm/structure/io/binary/GraphBinary.d.ts +15 -1
- package/build/esm/structure/io/binary/GraphBinary.js +66 -38
- package/build/esm/structure/io/binary/internals/AnySerializer.d.ts +12 -2
- package/build/esm/structure/io/binary/internals/AnySerializer.js +34 -17
- package/build/esm/structure/io/binary/internals/ArraySerializer.d.ts +14 -7
- package/build/esm/structure/io/binary/internals/ArraySerializer.js +41 -72
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.d.ts +12 -7
- package/build/esm/structure/io/binary/internals/BigIntegerSerializer.js +34 -54
- package/build/esm/structure/io/binary/internals/BinarySerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/BinarySerializer.js +31 -51
- package/build/esm/structure/io/binary/internals/BooleanSerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/BooleanSerializer.js +28 -42
- package/build/esm/structure/io/binary/internals/ByteSerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/ByteSerializer.js +24 -38
- 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/DateTimeSerializer.d.ts +12 -7
- package/build/esm/structure/io/binary/internals/DateTimeSerializer.js +52 -69
- package/build/esm/structure/io/binary/internals/DoubleSerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/DoubleSerializer.js +24 -38
- package/build/esm/structure/io/binary/internals/EdgeSerializer.d.ts +14 -12
- package/build/esm/structure/io/binary/internals/EdgeSerializer.js +69 -124
- package/build/esm/structure/io/binary/internals/EnumSerializer.d.ts +19 -4
- package/build/esm/structure/io/binary/internals/EnumSerializer.js +47 -59
- package/build/esm/structure/io/binary/internals/FloatSerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/FloatSerializer.js +24 -38
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.d.ts +26 -2
- package/build/esm/structure/io/binary/internals/GraphBinaryReader.js +108 -37
- package/build/esm/structure/io/binary/internals/GraphBinaryWriter.js +6 -6
- 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 +19 -4
- package/build/esm/structure/io/binary/internals/IntSerializer.js +33 -38
- package/build/esm/structure/io/binary/internals/LongSerializer.d.ts +13 -4
- package/build/esm/structure/io/binary/internals/LongSerializer.js +29 -42
- package/build/esm/structure/io/binary/internals/MapSerializer.d.ts +14 -7
- package/build/esm/structure/io/binary/internals/MapSerializer.js +36 -70
- package/build/esm/structure/io/binary/internals/MarkerSerializer.d.ts +13 -4
- package/build/esm/structure/io/binary/internals/MarkerSerializer.js +29 -33
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.d.ts +0 -3
- package/build/esm/structure/io/binary/internals/NumberSerializationStrategy.js +28 -2
- package/build/esm/structure/io/binary/internals/PathSerializer.d.ts +14 -7
- package/build/esm/structure/io/binary/internals/PathSerializer.js +30 -55
- 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 +14 -7
- package/build/esm/structure/io/binary/internals/PropertySerializer.js +32 -69
- package/build/esm/structure/io/binary/internals/SetSerializer.d.ts +14 -7
- package/build/esm/structure/io/binary/internals/SetSerializer.js +39 -73
- package/build/esm/structure/io/binary/internals/ShortSerializer.d.ts +12 -4
- package/build/esm/structure/io/binary/internals/ShortSerializer.js +24 -38
- 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 +14 -4
- package/build/esm/structure/io/binary/internals/StringSerializer.js +34 -53
- package/build/esm/structure/io/binary/internals/StubSerializer.d.ts +1 -1
- package/build/esm/structure/io/binary/internals/StubSerializer.js +2 -1
- 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 +6 -4
- package/build/esm/structure/io/binary/internals/UnspecifiedNullSerializer.js +8 -31
- package/build/esm/structure/io/binary/internals/UuidSerializer.d.ts +12 -7
- package/build/esm/structure/io/binary/internals/UuidSerializer.js +33 -49
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.d.ts +14 -7
- package/build/esm/structure/io/binary/internals/VertexPropertySerializer.js +37 -95
- package/build/esm/structure/io/binary/internals/VertexSerializer.d.ts +14 -9
- package/build/esm/structure/io/binary/internals/VertexSerializer.js +41 -68
- package/build/esm/utils.d.ts +62 -4
- package/build/esm/utils.js +145 -6
- package/package.json +27 -18
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async byte reader that provides a uniform interface over both a complete Buffer
|
|
3
|
+
* (for non-streaming submit()) and a ReadableStream (for streaming HTTP responses).
|
|
4
|
+
*
|
|
5
|
+
* Handles chunk boundaries transparently and blocks (awaits) until the requested bytes are available.
|
|
6
|
+
*/
|
|
7
|
+
export default class StreamReader {
|
|
8
|
+
/**
|
|
9
|
+
* Create a StreamReader backed by a complete Buffer.
|
|
10
|
+
* All reads are satisfied from the buffer; no async I/O occurs.
|
|
11
|
+
* @param {Buffer} buffer
|
|
12
|
+
* @returns {StreamReader}
|
|
13
|
+
*/
|
|
14
|
+
static fromBuffer(buffer: Buffer): StreamReader;
|
|
15
|
+
/**
|
|
16
|
+
* Create a StreamReader backed by a ReadableStream (e.g. fetch response.body).
|
|
17
|
+
* Reads pull chunks from the stream as needed.
|
|
18
|
+
* @param {ReadableStream} readableStream
|
|
19
|
+
* @returns {StreamReader}
|
|
20
|
+
*/
|
|
21
|
+
static fromReadableStream(readableStream: ReadableStream): StreamReader;
|
|
22
|
+
/**
|
|
23
|
+
* @param {Buffer} initialBuffer
|
|
24
|
+
* @param {ReadableStreamDefaultReader|null} reader
|
|
25
|
+
*/
|
|
26
|
+
constructor(initialBuffer: Buffer, reader: ReadableStreamDefaultReader | null);
|
|
27
|
+
/**
|
|
28
|
+
* Total number of bytes consumed so far (monotonically increasing).
|
|
29
|
+
* Useful for error diagnostics.
|
|
30
|
+
* @returns {number}
|
|
31
|
+
*/
|
|
32
|
+
get position(): number;
|
|
33
|
+
/**
|
|
34
|
+
* Read exactly `n` bytes and return them as a Buffer.
|
|
35
|
+
* @param {number} n
|
|
36
|
+
* @returns {Promise<Buffer>}
|
|
37
|
+
*/
|
|
38
|
+
readBytes(n: number): Promise<Buffer>;
|
|
39
|
+
/**
|
|
40
|
+
* @returns {Promise<number>} unsigned 8-bit integer
|
|
41
|
+
*/
|
|
42
|
+
readUInt8(): Promise<number>;
|
|
43
|
+
/**
|
|
44
|
+
* @returns {Promise<number>} signed 8-bit integer
|
|
45
|
+
*/
|
|
46
|
+
readByte(): Promise<number>;
|
|
47
|
+
/**
|
|
48
|
+
* @returns {Promise<number>} signed 16-bit big-endian integer
|
|
49
|
+
*/
|
|
50
|
+
readInt16BE(): Promise<number>;
|
|
51
|
+
/**
|
|
52
|
+
* @returns {Promise<number>} signed 32-bit big-endian integer
|
|
53
|
+
*/
|
|
54
|
+
readInt32BE(): Promise<number>;
|
|
55
|
+
/**
|
|
56
|
+
* @returns {Promise<bigint>} signed 64-bit big-endian integer
|
|
57
|
+
*/
|
|
58
|
+
readBigInt64BE(): Promise<bigint>;
|
|
59
|
+
/**
|
|
60
|
+
* @returns {Promise<number>} 32-bit big-endian float
|
|
61
|
+
*/
|
|
62
|
+
readFloatBE(): Promise<number>;
|
|
63
|
+
/**
|
|
64
|
+
* @returns {Promise<number>} 64-bit big-endian double
|
|
65
|
+
*/
|
|
66
|
+
readDoubleBE(): Promise<number>;
|
|
67
|
+
#private;
|
|
68
|
+
}
|
|
69
|
+
import { Buffer } from 'buffer';
|
|
@@ -47,61 +47,42 @@ class StringSerializer {
|
|
|
47
47
|
bufs.push(v);
|
|
48
48
|
return buffer_1.Buffer.concat(bufs);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
let length, length_len;
|
|
83
|
-
try {
|
|
84
|
-
({ v: length, len: length_len } = this.ioc.intSerializer.deserialize(cursor, false));
|
|
85
|
-
len += length_len;
|
|
86
|
-
}
|
|
87
|
-
catch (err) {
|
|
88
|
-
err.message = '{length}: ' + err.message;
|
|
89
|
-
throw err;
|
|
90
|
-
}
|
|
91
|
-
if (length < 0) {
|
|
92
|
-
throw new Error('{length} is less than zero');
|
|
93
|
-
}
|
|
94
|
-
cursor = cursor.slice(length_len);
|
|
95
|
-
if (cursor.length < length) {
|
|
96
|
-
throw new Error('unexpected {text_value} length');
|
|
97
|
-
}
|
|
98
|
-
len += length;
|
|
99
|
-
const v = cursor.toString('utf8', 0, length);
|
|
100
|
-
return { v, len };
|
|
50
|
+
/**
|
|
51
|
+
* Read the string value bytes from the StreamReader (length + text_value).
|
|
52
|
+
* @param {StreamReader} reader
|
|
53
|
+
* @param {number} valueFlag
|
|
54
|
+
* @param {number} typeCode
|
|
55
|
+
* @returns {Promise<string>}
|
|
56
|
+
*/
|
|
57
|
+
async deserializeValue(reader, valueFlag, typeCode) {
|
|
58
|
+
const length = await this.ioc.intSerializer.deserializeBare(reader);
|
|
59
|
+
if (length < 0) {
|
|
60
|
+
throw new Error(`StringSerializer: {length}=${length} is less than zero`);
|
|
61
|
+
}
|
|
62
|
+
if (length === 0) {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
const bytes = await reader.readBytes(length);
|
|
66
|
+
return bytes.toString('utf8');
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Read a fully-qualified string from the StreamReader.
|
|
70
|
+
* @param {StreamReader} reader
|
|
71
|
+
* @returns {Promise<string|null>}
|
|
72
|
+
*/
|
|
73
|
+
async deserialize(reader) {
|
|
74
|
+
const type_code = await reader.readUInt8();
|
|
75
|
+
if (type_code !== this.ID) {
|
|
76
|
+
throw new Error(`StringSerializer: unexpected {type_code}=0x${type_code.toString(16)}`);
|
|
77
|
+
}
|
|
78
|
+
const value_flag = await reader.readUInt8();
|
|
79
|
+
if (value_flag === 0x01) {
|
|
80
|
+
return null;
|
|
101
81
|
}
|
|
102
|
-
|
|
103
|
-
throw
|
|
82
|
+
if (value_flag !== 0x00) {
|
|
83
|
+
throw new Error(`StringSerializer: unexpected {value_flag}=0x${value_flag.toString(16)}`);
|
|
104
84
|
}
|
|
85
|
+
return this.deserializeValue(reader, value_flag, type_code);
|
|
105
86
|
}
|
|
106
87
|
}
|
|
107
88
|
exports.default = StringSerializer;
|
|
@@ -4,8 +4,18 @@ export default class StringSerializer {
|
|
|
4
4
|
ID: any;
|
|
5
5
|
canBeUsedFor(value: any): value is string;
|
|
6
6
|
serialize(item: any, fullyQualifiedFormat?: boolean): any;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Read the string value bytes from the StreamReader (length + text_value).
|
|
9
|
+
* @param {StreamReader} reader
|
|
10
|
+
* @param {number} valueFlag
|
|
11
|
+
* @param {number} typeCode
|
|
12
|
+
* @returns {Promise<string>}
|
|
13
|
+
*/
|
|
14
|
+
deserializeValue(reader: StreamReader, valueFlag: number, typeCode: number): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Read a fully-qualified string from the StreamReader.
|
|
17
|
+
* @param {StreamReader} reader
|
|
18
|
+
* @returns {Promise<string|null>}
|
|
19
|
+
*/
|
|
20
|
+
deserialize(reader: StreamReader): Promise<string | null>;
|
|
11
21
|
}
|
|
@@ -25,7 +25,8 @@ class StubSerializer {
|
|
|
25
25
|
this.typeName = typeName;
|
|
26
26
|
this.ioc.serializers[typeCode] = this;
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
// eslint-disable-next-line require-await
|
|
29
|
+
async deserializeValue(reader, valueFlag, typeCode) {
|
|
29
30
|
throw new Error(`${this.typeName} deserialization is not yet implemented`);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
const buffer_1 = require("node:buffer");
|
|
22
|
+
const graph_js_1 = require("../../../graph.cjs");
|
|
23
|
+
/**
|
|
24
|
+
* GraphBinary serializer for the Tree type (0x2b).
|
|
25
|
+
*
|
|
26
|
+
* Wire format (authoritative from Java TreeSerializer):
|
|
27
|
+
* value = {int length} then length x ( {fully-qualified key} {bare child Tree} )
|
|
28
|
+
* A child Tree is written bare: just {int length}{entries...}, with no type-id
|
|
29
|
+
* and no value-flag, recursively. A leaf is length 0. The child is never null,
|
|
30
|
+
* but a key may be null.
|
|
31
|
+
*/
|
|
32
|
+
class TreeSerializer {
|
|
33
|
+
constructor(ioc) {
|
|
34
|
+
this.ioc = ioc;
|
|
35
|
+
this.ioc.serializers[ioc.DataType.TREE] = this;
|
|
36
|
+
}
|
|
37
|
+
canBeUsedFor(value) {
|
|
38
|
+
return value instanceof graph_js_1.Tree;
|
|
39
|
+
}
|
|
40
|
+
serialize(item, fullyQualifiedFormat = true) {
|
|
41
|
+
if (item === undefined || item === null) {
|
|
42
|
+
if (fullyQualifiedFormat) {
|
|
43
|
+
return buffer_1.Buffer.from([this.ioc.DataType.TREE, 0x01]);
|
|
44
|
+
}
|
|
45
|
+
// bare null -> empty tree (length 0)
|
|
46
|
+
return this.ioc.intSerializer.serialize(0, false);
|
|
47
|
+
}
|
|
48
|
+
const bufs = [];
|
|
49
|
+
if (fullyQualifiedFormat) {
|
|
50
|
+
bufs.push(buffer_1.Buffer.from([this.ioc.DataType.TREE, 0x00]));
|
|
51
|
+
}
|
|
52
|
+
bufs.push(this._serializeValue(item));
|
|
53
|
+
return buffer_1.Buffer.concat(bufs);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Serializes the bare value of a Tree: {int length} then, for each root key, a
|
|
57
|
+
* fully-qualified key followed by a bare child Tree (recursive).
|
|
58
|
+
*
|
|
59
|
+
* Uses only the public read API ({@link Tree#rootNodes} / {@link Tree#childAt})
|
|
60
|
+
* so it never touches the Tree's private backing. Keys returned by rootNodes()
|
|
61
|
+
* are already deduped, so each is written exactly once.
|
|
62
|
+
* @param {Tree} tree
|
|
63
|
+
* @returns {Buffer}
|
|
64
|
+
*/
|
|
65
|
+
_serializeValue(tree) {
|
|
66
|
+
const keys = tree.rootNodes();
|
|
67
|
+
let length = keys.length;
|
|
68
|
+
if (length < 0) {
|
|
69
|
+
length = 0;
|
|
70
|
+
}
|
|
71
|
+
else if (length > this.ioc.intSerializer.INT32_MAX) {
|
|
72
|
+
length = this.ioc.intSerializer.INT32_MAX;
|
|
73
|
+
}
|
|
74
|
+
const bufs = [this.ioc.intSerializer.serialize(length, false)];
|
|
75
|
+
for (let i = 0; i < length; i++) {
|
|
76
|
+
const key = keys[i];
|
|
77
|
+
// fully-qualified key
|
|
78
|
+
bufs.push(this.ioc.anySerializer.serialize(key));
|
|
79
|
+
// bare child tree (no type_code, no value_flag)
|
|
80
|
+
bufs.push(this._serializeValue(tree.childAt(key)));
|
|
81
|
+
}
|
|
82
|
+
return buffer_1.Buffer.concat(bufs);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Async deserialization of tree value bytes from a StreamReader.
|
|
86
|
+
* @param {StreamReader} reader
|
|
87
|
+
* @param {number} valueFlag
|
|
88
|
+
* @param {number} typeCode
|
|
89
|
+
* @returns {Promise<Tree>}
|
|
90
|
+
*/
|
|
91
|
+
async deserializeValue(reader, valueFlag, typeCode) {
|
|
92
|
+
return await this._readTreeValue(reader);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Reads a bare tree value: {int length} then length x ( fully-qualified key,
|
|
96
|
+
* bare child tree ). The child recursion reads bare values (no type_code,
|
|
97
|
+
* no value_flag).
|
|
98
|
+
*
|
|
99
|
+
* Duplicate sibling keys are collapsed via {@link Tree#getOrCreateChild} +
|
|
100
|
+
* {@link Tree#addTree} (a server emitting
|
|
101
|
+
* the same sibling key twice yields a single merged entry, not duplicates).
|
|
102
|
+
* @param {StreamReader} reader
|
|
103
|
+
* @returns {Promise<Tree>}
|
|
104
|
+
*/
|
|
105
|
+
async _readTreeValue(reader) {
|
|
106
|
+
const length = await this.ioc.intSerializer.deserializeBare(reader);
|
|
107
|
+
const tree = new graph_js_1.Tree();
|
|
108
|
+
for (let i = 0; i < length; i++) {
|
|
109
|
+
// {fully-qualified key} - read with type_code + value_flag.
|
|
110
|
+
const key = await this.ioc.anySerializer.deserialize(reader);
|
|
111
|
+
// {bare child tree} - never null, no type_code / value_flag
|
|
112
|
+
const child = await this._readTreeValue(reader);
|
|
113
|
+
// Merge into any existing entry for this key so duplicate sibling keys
|
|
114
|
+
// collapse into a single entry.
|
|
115
|
+
tree.getOrCreateChild(key).addTree(child);
|
|
116
|
+
}
|
|
117
|
+
return tree;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Async fully-qualified deserialization from a StreamReader.
|
|
121
|
+
* @param {StreamReader} reader
|
|
122
|
+
* @returns {Promise<Tree|null>}
|
|
123
|
+
*/
|
|
124
|
+
async deserialize(reader) {
|
|
125
|
+
const type_code = await reader.readUInt8();
|
|
126
|
+
if (type_code !== this.ioc.DataType.TREE) {
|
|
127
|
+
throw new Error(`TreeSerializer: unexpected {type_code}=0x${type_code.toString(16)}`);
|
|
128
|
+
}
|
|
129
|
+
const value_flag = await reader.readUInt8();
|
|
130
|
+
if (value_flag === 0x01) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
if (value_flag !== 0x00) {
|
|
134
|
+
throw new Error(`TreeSerializer: unexpected {value_flag}=0x${value_flag.toString(16)}`);
|
|
135
|
+
}
|
|
136
|
+
return this.deserializeValue(reader, value_flag, type_code);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.default = TreeSerializer;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphBinary serializer for the Tree type (0x2b).
|
|
3
|
+
*
|
|
4
|
+
* Wire format (authoritative from Java TreeSerializer):
|
|
5
|
+
* value = {int length} then length x ( {fully-qualified key} {bare child Tree} )
|
|
6
|
+
* A child Tree is written bare: just {int length}{entries...}, with no type-id
|
|
7
|
+
* and no value-flag, recursively. A leaf is length 0. The child is never null,
|
|
8
|
+
* but a key may be null.
|
|
9
|
+
*/
|
|
10
|
+
export default class TreeSerializer {
|
|
11
|
+
constructor(ioc: any);
|
|
12
|
+
ioc: any;
|
|
13
|
+
canBeUsedFor(value: any): value is Tree;
|
|
14
|
+
serialize(item: any, fullyQualifiedFormat?: boolean): any;
|
|
15
|
+
/**
|
|
16
|
+
* Serializes the bare value of a Tree: {int length} then, for each root key, a
|
|
17
|
+
* fully-qualified key followed by a bare child Tree (recursive).
|
|
18
|
+
*
|
|
19
|
+
* Uses only the public read API ({@link Tree#rootNodes} / {@link Tree#childAt})
|
|
20
|
+
* so it never touches the Tree's private backing. Keys returned by rootNodes()
|
|
21
|
+
* are already deduped, so each is written exactly once.
|
|
22
|
+
* @param {Tree} tree
|
|
23
|
+
* @returns {Buffer}
|
|
24
|
+
*/
|
|
25
|
+
_serializeValue(tree: Tree): Buffer;
|
|
26
|
+
/**
|
|
27
|
+
* Async deserialization of tree value bytes from a StreamReader.
|
|
28
|
+
* @param {StreamReader} reader
|
|
29
|
+
* @param {number} valueFlag
|
|
30
|
+
* @param {number} typeCode
|
|
31
|
+
* @returns {Promise<Tree>}
|
|
32
|
+
*/
|
|
33
|
+
deserializeValue(reader: StreamReader, valueFlag: number, typeCode: number): Promise<Tree>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads a bare tree value: {int length} then length x ( fully-qualified key,
|
|
36
|
+
* bare child tree ). The child recursion reads bare values (no type_code,
|
|
37
|
+
* no value_flag).
|
|
38
|
+
*
|
|
39
|
+
* Duplicate sibling keys are collapsed via {@link Tree#getOrCreateChild} +
|
|
40
|
+
* {@link Tree#addTree} (a server emitting
|
|
41
|
+
* the same sibling key twice yields a single merged entry, not duplicates).
|
|
42
|
+
* @param {StreamReader} reader
|
|
43
|
+
* @returns {Promise<Tree>}
|
|
44
|
+
*/
|
|
45
|
+
_readTreeValue(reader: StreamReader): Promise<Tree>;
|
|
46
|
+
/**
|
|
47
|
+
* Async fully-qualified deserialization from a StreamReader.
|
|
48
|
+
* @param {StreamReader} reader
|
|
49
|
+
* @returns {Promise<Tree|null>}
|
|
50
|
+
*/
|
|
51
|
+
deserialize(reader: StreamReader): Promise<Tree | null>;
|
|
52
|
+
}
|
|
53
|
+
import { Tree } from '../../../graph.cjs';
|
|
54
|
+
import { Buffer } from 'buffer';
|
|
@@ -34,37 +34,14 @@ class UnspecifiedNullSerializer {
|
|
|
34
34
|
// fullyQualifiedFormat always is true
|
|
35
35
|
return buffer_1.Buffer.from([this.ioc.DataType.UNSPECIFIED_NULL, 0x01]);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (buffer.length < 1) {
|
|
46
|
-
throw new Error('buffer is empty');
|
|
47
|
-
}
|
|
48
|
-
const type_code = cursor.readUInt8();
|
|
49
|
-
len++;
|
|
50
|
-
if (type_code !== this.ioc.DataType.UNSPECIFIED_NULL) {
|
|
51
|
-
throw new Error('unexpected {type_code}');
|
|
52
|
-
}
|
|
53
|
-
cursor = cursor.slice(1);
|
|
54
|
-
if (cursor.length < 1) {
|
|
55
|
-
throw new Error('{value_flag} is missing');
|
|
56
|
-
}
|
|
57
|
-
const value_flag = cursor.readUInt8();
|
|
58
|
-
len++;
|
|
59
|
-
if (value_flag !== 1) {
|
|
60
|
-
throw new Error('unexpected {value_flag}');
|
|
61
|
-
}
|
|
62
|
-
cursor = cursor.slice(1);
|
|
63
|
-
return { v: null, len };
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
throw this.ioc.utils.des_error({ serializer: this, args: arguments, cursor, err });
|
|
67
|
-
}
|
|
37
|
+
/**
|
|
38
|
+
* @param {StreamReader} reader
|
|
39
|
+
* @param {number} valueFlag - already consumed by AnySerializer (always 0x01 for null)
|
|
40
|
+
* @returns {Promise<null>}
|
|
41
|
+
*/
|
|
42
|
+
// eslint-disable-next-line require-await
|
|
43
|
+
async deserializeValue(reader, valueFlag) {
|
|
44
|
+
throw new Error('UnspecifiedNull should always have value_flag=0x01');
|
|
68
45
|
}
|
|
69
46
|
}
|
|
70
47
|
exports.default = UnspecifiedNullSerializer;
|
|
@@ -3,9 +3,11 @@ export default class UnspecifiedNullSerializer {
|
|
|
3
3
|
ioc: any;
|
|
4
4
|
canBeUsedFor(value: any): boolean;
|
|
5
5
|
serialize(item: any): Buffer<ArrayBuffer>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {StreamReader} reader
|
|
8
|
+
* @param {number} valueFlag - already consumed by AnySerializer (always 0x01 for null)
|
|
9
|
+
* @returns {Promise<null>}
|
|
10
|
+
*/
|
|
11
|
+
deserializeValue(reader: StreamReader, valueFlag: number): Promise<null>;
|
|
10
12
|
}
|
|
11
13
|
import { Buffer } from 'buffer';
|
|
@@ -53,57 +53,41 @@ class UuidSerializer {
|
|
|
53
53
|
bufs.push(v);
|
|
54
54
|
return buffer_1.Buffer.concat(bufs);
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
cursor = cursor.slice(1);
|
|
87
|
-
}
|
|
88
|
-
if (cursor.length < 16) {
|
|
89
|
-
throw new Error('unexpected {value} length');
|
|
90
|
-
}
|
|
91
|
-
len += 16;
|
|
92
|
-
// Example: 2075278D-F624-4B2B-960D-25D374D57C04
|
|
93
|
-
const v = cursor.slice(0, 4).toString('hex') +
|
|
94
|
-
'-' +
|
|
95
|
-
cursor.slice(4, 6).toString('hex') +
|
|
96
|
-
'-' +
|
|
97
|
-
cursor.slice(6, 8).toString('hex') +
|
|
98
|
-
'-' +
|
|
99
|
-
cursor.slice(8, 10).toString('hex') +
|
|
100
|
-
'-' +
|
|
101
|
-
cursor.slice(10, 16).toString('hex');
|
|
102
|
-
return { v, len };
|
|
56
|
+
/**
|
|
57
|
+
* @param {StreamReader} reader
|
|
58
|
+
* @param {number} valueFlag
|
|
59
|
+
* @param {number} typeCode
|
|
60
|
+
* @returns {Promise<string>}
|
|
61
|
+
*/
|
|
62
|
+
async deserializeValue(reader, valueFlag, typeCode) {
|
|
63
|
+
const bytes = await reader.readBytes(16);
|
|
64
|
+
return (bytes.subarray(0, 4).toString('hex') +
|
|
65
|
+
'-' +
|
|
66
|
+
bytes.subarray(4, 6).toString('hex') +
|
|
67
|
+
'-' +
|
|
68
|
+
bytes.subarray(6, 8).toString('hex') +
|
|
69
|
+
'-' +
|
|
70
|
+
bytes.subarray(8, 10).toString('hex') +
|
|
71
|
+
'-' +
|
|
72
|
+
bytes.subarray(10, 16).toString('hex'));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param {StreamReader} reader
|
|
76
|
+
* @returns {Promise<string|null>}
|
|
77
|
+
*/
|
|
78
|
+
async deserialize(reader) {
|
|
79
|
+
const type_code = await reader.readUInt8();
|
|
80
|
+
if (type_code !== this.ioc.DataType.UUID) {
|
|
81
|
+
throw new Error(`UuidSerializer: unexpected {type_code}=0x${type_code.toString(16)}`);
|
|
82
|
+
}
|
|
83
|
+
const value_flag = await reader.readUInt8();
|
|
84
|
+
if (value_flag === 0x01) {
|
|
85
|
+
return null;
|
|
103
86
|
}
|
|
104
|
-
|
|
105
|
-
throw
|
|
87
|
+
if (value_flag !== 0x00) {
|
|
88
|
+
throw new Error(`UuidSerializer: unexpected {value_flag}=0x${value_flag.toString(16)}`);
|
|
106
89
|
}
|
|
90
|
+
return this.deserializeValue(reader, value_flag, type_code);
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
93
|
exports.default = UuidSerializer;
|
|
@@ -3,12 +3,17 @@ export default class UuidSerializer {
|
|
|
3
3
|
ioc: any;
|
|
4
4
|
canBeUsedFor(value: any): void;
|
|
5
5
|
serialize(item: any, fullyQualifiedFormat?: boolean): Buffer<ArrayBuffer>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {StreamReader} reader
|
|
8
|
+
* @param {number} valueFlag
|
|
9
|
+
* @param {number} typeCode
|
|
10
|
+
* @returns {Promise<string>}
|
|
11
|
+
*/
|
|
12
|
+
deserializeValue(reader: StreamReader, valueFlag: number, typeCode: number): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* @param {StreamReader} reader
|
|
15
|
+
* @returns {Promise<string|null>}
|
|
16
|
+
*/
|
|
17
|
+
deserialize(reader: StreamReader): Promise<string | null>;
|
|
13
18
|
}
|
|
14
19
|
import { Buffer } from 'buffer';
|