node-opcua-packet-analyzer 2.165.0 → 2.168.0
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/dist/source/index.d.ts +2 -1
- package/dist/source/index.js +2 -2
- package/dist/source/index.js.map +1 -1
- package/dist/source/packet_analyzer/packet_analyzer.d.ts +17 -4
- package/dist/source/packet_analyzer/packet_analyzer.js +54 -46
- package/dist/source/packet_analyzer/packet_analyzer.js.map +1 -1
- package/dist/test_helpers/compare_obj_by_encoding.d.ts +2 -2
- package/dist/test_helpers/compare_obj_by_encoding.js +1 -1
- package/dist/test_helpers/compare_obj_by_encoding.js.map +1 -1
- package/dist/test_helpers/encode_decode_round_trip_test.d.ts +12 -16
- package/dist/test_helpers/encode_decode_round_trip_test.js +24 -20
- package/dist/test_helpers/encode_decode_round_trip_test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/source/index.ts +10 -1
- package/source/packet_analyzer/packet_analyzer.ts +107 -69
package/dist/source/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { analyzePacket, analyseExtensionObject,
|
|
1
|
+
export { analyze_object_binary_encoding, analyzePacket, analyseExtensionObject, } from "./packet_analyzer/packet_analyzer";
|
|
2
|
+
export type { AnalyzePacketOptions, ObjectMessage } from "./packet_analyzer/packet_analyzer";
|
package/dist/source/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.analyseExtensionObject = exports.analyzePacket = exports.analyze_object_binary_encoding = void 0;
|
|
4
4
|
var packet_analyzer_1 = require("./packet_analyzer/packet_analyzer");
|
|
5
|
+
Object.defineProperty(exports, "analyze_object_binary_encoding", { enumerable: true, get: function () { return packet_analyzer_1.analyze_object_binary_encoding; } });
|
|
5
6
|
Object.defineProperty(exports, "analyzePacket", { enumerable: true, get: function () { return packet_analyzer_1.analyzePacket; } });
|
|
6
7
|
Object.defineProperty(exports, "analyseExtensionObject", { enumerable: true, get: function () { return packet_analyzer_1.analyseExtensionObject; } });
|
|
7
|
-
Object.defineProperty(exports, "analyze_object_binary_encoding", { enumerable: true, get: function () { return packet_analyzer_1.analyze_object_binary_encoding; } });
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/source/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":";;;AAAA,qEAI2C;AAHvC,iIAAA,8BAA8B,OAAA;AAC9B,gHAAA,aAAa,OAAA;AACb,yHAAA,sBAAsB,OAAA"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { BinaryStream } from "node-opcua-binary-stream";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { type IBaseUAObject } from "node-opcua-factory";
|
|
3
|
+
/** Encoding info maps enum key names ↔ bitmask values */
|
|
4
|
+
type EncodingInfo = Record<string, number | string>;
|
|
5
|
+
type TraceOperation = "start" | "end" | "start_array" | "end_array" | "start_element" | "end_element" | "member";
|
|
6
|
+
interface TracerMethods {
|
|
7
|
+
dump: (title: string, value: unknown) => void;
|
|
8
|
+
encoding_byte: (encodingMask: number, valueEnum: EncodingInfo, start: number, end: number) => void;
|
|
9
|
+
trace: (operation: TraceOperation, name: string, value: unknown, start: number, end: number, fieldType: string) => void;
|
|
10
|
+
}
|
|
11
|
+
interface Tracer {
|
|
12
|
+
name?: string;
|
|
13
|
+
tracer: TracerMethods;
|
|
14
|
+
}
|
|
15
|
+
export interface AnalyzePacketOptions {
|
|
16
|
+
[key: string]: unknown;
|
|
4
17
|
}
|
|
5
18
|
export interface ObjectMessage {
|
|
6
19
|
encode(stream: BinaryStream): void;
|
|
7
20
|
decode(stream: BinaryStream): void;
|
|
8
|
-
decodeDebug(stream: BinaryStream, options:
|
|
21
|
+
decodeDebug(stream: BinaryStream, options: Tracer): void;
|
|
9
22
|
}
|
|
10
23
|
export declare function analyzePacket(buffer: Buffer, objMessage: ObjectMessage, padding: number, offset?: number, customOptions?: AnalyzePacketOptions): void;
|
|
11
24
|
export declare function analyseExtensionObject(buffer: Buffer, padding: number, offset: number, customOptions?: AnalyzePacketOptions): void;
|
|
12
|
-
export declare function analyze_object_binary_encoding(obj:
|
|
25
|
+
export declare function analyze_object_binary_encoding(obj: IBaseUAObject): void;
|
|
13
26
|
export {};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.analyzePacket = analyzePacket;
|
|
7
7
|
exports.analyseExtensionObject = analyseExtensionObject;
|
|
8
8
|
exports.analyze_object_binary_encoding = analyze_object_binary_encoding;
|
|
9
|
-
const
|
|
9
|
+
const node_util_1 = require("node:util");
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
11
|
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
12
12
|
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
@@ -14,14 +14,14 @@ const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
|
|
|
14
14
|
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
15
15
|
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
16
16
|
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return (
|
|
17
|
+
const displayWidth = 132;
|
|
18
|
+
const separator = "-".repeat(49);
|
|
19
|
+
function padNumber(n, width) {
|
|
20
|
+
return n.toString().padEnd(width);
|
|
21
21
|
}
|
|
22
22
|
function display_encoding_mask(padding, encodingMask, encodingInfo) {
|
|
23
23
|
for (const v in encodingInfo) {
|
|
24
|
-
if (!Object.
|
|
24
|
+
if (!Object.hasOwn(encodingInfo, v)) {
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
27
|
const enumKey = encodingInfo[v];
|
|
@@ -30,31 +30,40 @@ function display_encoding_mask(padding, encodingMask, encodingInfo) {
|
|
|
30
30
|
}
|
|
31
31
|
const mask = encodingInfo[enumKey];
|
|
32
32
|
const bit = Math.log(mask) / Math.log(2);
|
|
33
|
-
const bits =
|
|
33
|
+
const bits = Array(9).fill(".");
|
|
34
34
|
bits[bit] = (encodingMask & mask) === mask ? "Y" : "n";
|
|
35
|
-
console.log(padding
|
|
35
|
+
console.log(`${padding} ${bits.join("")}` + ` <- has ${enumKey} 0x${mask.toString(16)}`);
|
|
36
36
|
}
|
|
37
|
-
// DataValueEncodingByte
|
|
38
37
|
}
|
|
39
38
|
function hex_block(start, end, buffer) {
|
|
40
39
|
const n = end - start;
|
|
41
40
|
const strBuf = (0, node_opcua_utils_1.buffer_ellipsis)(buffer);
|
|
42
|
-
return (chalk_1.default.cyan("s:") +
|
|
41
|
+
return (chalk_1.default.cyan("s:") +
|
|
42
|
+
padNumber(start, 4) +
|
|
43
|
+
chalk_1.default.cyan(" e:") +
|
|
44
|
+
padNumber(end, 4) +
|
|
45
|
+
chalk_1.default.cyan(" n:") +
|
|
46
|
+
padNumber(n, 4) +
|
|
47
|
+
" " +
|
|
48
|
+
chalk_1.default.yellow(strBuf));
|
|
49
|
+
}
|
|
50
|
+
function isEncodeable(val) {
|
|
51
|
+
return val != null && typeof val.encode === "function";
|
|
43
52
|
}
|
|
44
53
|
function make_tracer(buffer, padding, offset) {
|
|
45
|
-
padding
|
|
46
|
-
offset
|
|
47
|
-
const pad = () => "
|
|
54
|
+
padding ??= 0;
|
|
55
|
+
offset ??= 0;
|
|
56
|
+
const pad = () => "".padEnd(padding);
|
|
48
57
|
function _display(str, hexInfo) {
|
|
49
|
-
hexInfo
|
|
58
|
+
hexInfo ??= "";
|
|
50
59
|
// account for ESC codes for colors
|
|
51
|
-
const nbColorAttributes =
|
|
60
|
+
const nbColorAttributes = str.split("").filter((c) => c === "\u001b").length;
|
|
52
61
|
const extra = nbColorAttributes * 5;
|
|
53
|
-
|
|
62
|
+
const line = (pad() + str).padEnd(displayWidth + extra);
|
|
63
|
+
console.log(`${line}|${hexInfo}`);
|
|
54
64
|
}
|
|
55
65
|
function display(str, hexInfo) {
|
|
56
|
-
const
|
|
57
|
-
for (const line of lines) {
|
|
66
|
+
for (const line of str.split("\n")) {
|
|
58
67
|
_display(line, hexInfo);
|
|
59
68
|
}
|
|
60
69
|
}
|
|
@@ -62,16 +71,16 @@ function make_tracer(buffer, padding, offset) {
|
|
|
62
71
|
const bufferExtract = buffer1.subarray(start, end);
|
|
63
72
|
const stream = new node_opcua_binary_stream_1.BinaryStream(bufferExtract);
|
|
64
73
|
const nodeId = (0, node_opcua_basic_types_1.decodeNodeId)(stream);
|
|
65
|
-
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
74
|
+
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
66
75
|
const length = (0, node_opcua_basic_types_1.decodeUInt32)(stream);
|
|
67
|
-
display(chalk_1.default.green(" ExpandedNodId =")
|
|
68
|
-
display(chalk_1.default.green(" encoding mask =")
|
|
69
|
-
display(chalk_1.default.green(" length =")
|
|
76
|
+
display(`${chalk_1.default.green(" ExpandedNodId =")} ${nodeId}`);
|
|
77
|
+
display(`${chalk_1.default.green(" encoding mask =")} ${encodingMask}`);
|
|
78
|
+
display(`${chalk_1.default.green(" length =")} ${length}`);
|
|
70
79
|
analyzePacket(bufferExtract.subarray(stream.length), value.encodingDefaultBinary, padding + 2, start + stream.length);
|
|
71
80
|
}
|
|
72
81
|
return {
|
|
73
82
|
tracer: {
|
|
74
|
-
dump: (title, value) => display(title
|
|
83
|
+
dump: (title, value) => display(`${title} ${chalk_1.default.green(String(value))}`),
|
|
75
84
|
encoding_byte: (encodingMask, valueEnum, start, end) => {
|
|
76
85
|
(0, node_opcua_assert_1.assert)(valueEnum);
|
|
77
86
|
const b = buffer.subarray(start, end);
|
|
@@ -80,52 +89,49 @@ function make_tracer(buffer, padding, offset) {
|
|
|
80
89
|
},
|
|
81
90
|
trace: (operation, name, value, start, end, fieldType) => {
|
|
82
91
|
const b = buffer.subarray(start, end);
|
|
83
|
-
let _hexDump = "";
|
|
84
92
|
switch (operation) {
|
|
85
93
|
case "start":
|
|
86
94
|
padding += 2;
|
|
87
|
-
display(name
|
|
95
|
+
display(name);
|
|
88
96
|
break;
|
|
89
97
|
case "end":
|
|
90
98
|
padding -= 2;
|
|
91
99
|
break;
|
|
92
100
|
case "start_array":
|
|
93
|
-
display(
|
|
101
|
+
display(`.${name} (length = ${value}) [`, hex_block(start, end, b));
|
|
94
102
|
padding += 2;
|
|
95
103
|
break;
|
|
96
104
|
case "end_array":
|
|
97
105
|
padding -= 2;
|
|
98
|
-
display(
|
|
106
|
+
display(`] // ${name}`);
|
|
99
107
|
break;
|
|
100
108
|
case "start_element":
|
|
101
|
-
display(
|
|
109
|
+
display(` #${value} {`);
|
|
102
110
|
padding += 2;
|
|
103
111
|
break;
|
|
104
112
|
case "end_element":
|
|
105
113
|
padding -= 2;
|
|
106
|
-
display(
|
|
114
|
+
display(` } // # ${value}`);
|
|
107
115
|
break;
|
|
108
|
-
case "member":
|
|
109
|
-
display(
|
|
110
|
-
_hexDump = "";
|
|
116
|
+
case "member": {
|
|
117
|
+
display(`.${name} : ${fieldType}`);
|
|
111
118
|
if (value instanceof Buffer) {
|
|
112
|
-
|
|
113
|
-
console.log(_hexDump);
|
|
119
|
+
console.log((0, node_opcua_debug_1.hexDump)(value));
|
|
114
120
|
value = "<BUFFER>";
|
|
115
121
|
}
|
|
116
|
-
if (value
|
|
122
|
+
if (isEncodeable(value)) {
|
|
117
123
|
if (fieldType === "ExtensionObject") {
|
|
118
124
|
display_encodeable(value, buffer, start, end);
|
|
119
125
|
}
|
|
120
126
|
else {
|
|
121
|
-
|
|
122
|
-
display(str);
|
|
127
|
+
display(String(value) || "<empty>");
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
130
|
else {
|
|
126
|
-
display(
|
|
131
|
+
display(` ${value}`, hex_block(start, end, b));
|
|
127
132
|
}
|
|
128
133
|
break;
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
}
|
|
@@ -146,15 +152,16 @@ function analyseExtensionObject(buffer, padding, offset, customOptions) {
|
|
|
146
152
|
catch (err) {
|
|
147
153
|
console.log(id);
|
|
148
154
|
console.log(err);
|
|
149
|
-
console.log("Cannot read decodeExpandedNodeId
|
|
155
|
+
console.log("Cannot read decodeExpandedNodeId on stream " + stream.buffer.toString("hex"));
|
|
150
156
|
}
|
|
151
157
|
_internalAnalyzePacket(buffer, stream, objMessage, padding, customOptions, offset);
|
|
152
158
|
}
|
|
153
159
|
function _internalAnalyzePacket(buffer, stream, objMessage, padding, customOptions, offset) {
|
|
154
160
|
let options = make_tracer(buffer, padding, offset);
|
|
155
161
|
options.name = "message";
|
|
156
|
-
if (customOptions)
|
|
162
|
+
if (customOptions) {
|
|
157
163
|
options = { ...options, ...customOptions };
|
|
164
|
+
}
|
|
158
165
|
try {
|
|
159
166
|
if (objMessage) {
|
|
160
167
|
objMessage.decodeDebug(stream, options);
|
|
@@ -165,26 +172,27 @@ function _internalAnalyzePacket(buffer, stream, objMessage, padding, customOptio
|
|
|
165
172
|
}
|
|
166
173
|
catch (err) {
|
|
167
174
|
console.log(" Error in ", err);
|
|
168
|
-
if (
|
|
175
|
+
if (err instanceof Error) {
|
|
169
176
|
console.log(" Error in ", err.stack);
|
|
170
177
|
}
|
|
171
|
-
console.log(" objMessage ", (0,
|
|
178
|
+
console.log(" objMessage ", (0, node_util_1.inspect)(objMessage, { colors: true }));
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
181
|
function analyze_object_binary_encoding(obj) {
|
|
175
182
|
(0, node_opcua_assert_1.assert)(obj);
|
|
176
183
|
const size = obj.binaryStoreSize();
|
|
177
|
-
console.log(
|
|
184
|
+
console.log(separator);
|
|
178
185
|
console.log(" size = ", size);
|
|
179
186
|
const stream = new node_opcua_binary_stream_1.BinaryStream(size);
|
|
180
187
|
obj.encode(stream);
|
|
181
188
|
stream.rewind();
|
|
182
|
-
console.log(
|
|
189
|
+
console.log(separator);
|
|
183
190
|
if (stream.buffer.length < 256) {
|
|
184
191
|
console.log((0, node_opcua_debug_1.hexDump)(stream.buffer));
|
|
185
|
-
console.log(
|
|
192
|
+
console.log(separator);
|
|
186
193
|
}
|
|
187
|
-
const
|
|
194
|
+
const Ctor = obj.constructor;
|
|
195
|
+
const reloadedObject = new Ctor();
|
|
188
196
|
analyzePacket(stream.buffer, reloadedObject, 0);
|
|
189
197
|
}
|
|
190
198
|
//# sourceMappingURL=packet_analyzer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packet_analyzer.js","sourceRoot":"","sources":["../../../source/packet_analyzer/packet_analyzer.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"packet_analyzer.js","sourceRoot":"","sources":["../../../source/packet_analyzer/packet_analyzer.ts"],"names":[],"mappings":";;;;;AA2MA,sCASC;AAED,wDAkBC;AA8BD,wEAmBC;AAzRD,yCAAoC;AACpC,kDAA0B;AAC1B,yDAA2C;AAE3C,mEAAsG;AACtG,uEAAwD;AACxD,uDAA2C;AAC3C,2DAA0G;AAE1G,uDAAmD;AAEnD,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEjC,SAAS,SAAS,CAAC,CAAS,EAAE,KAAa;IACvC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAKD,SAAS,qBAAqB,CAAC,OAAe,EAAE,YAAoB,EAAE,YAA0B;IAC5F,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,CAA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,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAI,uCAAY,CAAC,IAAI,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEnB,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,IAAA,0BAAO,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,WAA8B,CAAC;IAChD,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;IAClC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,cAA0C,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function compare_obj_by_encoding(obj1:
|
|
1
|
+
import type { IBaseUAObject } from "node-opcua-factory";
|
|
2
|
+
export declare function compare_obj_by_encoding(obj1: IBaseUAObject, obj2: IBaseUAObject): boolean;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.compare_obj_by_encoding = compare_obj_by_encoding;
|
|
7
7
|
const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
|
|
8
8
|
const should_1 = __importDefault(require("should"));
|
|
9
|
-
const
|
|
9
|
+
const _should = should_1.default; // keep should side-effect import alive
|
|
10
10
|
function compare_obj_by_encoding(obj1, obj2) {
|
|
11
11
|
function encoded(obj) {
|
|
12
12
|
const stream = new node_opcua_binary_stream_1.BinaryStream(obj.binaryStoreSize());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare_obj_by_encoding.js","sourceRoot":"","sources":["../../test_helpers/compare_obj_by_encoding.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"compare_obj_by_encoding.js","sourceRoot":"","sources":["../../test_helpers/compare_obj_by_encoding.ts"],"names":[],"mappings":";;;;;AAMA,0DAQC;AAdD,uEAAwD;AAExD,oDAA4B;AAE5B,MAAM,OAAO,GAAG,gBAAM,CAAC,CAAC,uCAAuC;AAE/D,SAAgB,uBAAuB,CAAC,IAAmB,EAAE,IAAmB;IAC5E,SAAS,OAAO,CAAC,GAAkB;QAC/B,MAAM,MAAM,GAAG,IAAI,uCAAY,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ExpandedNodeId } from "node-opcua-nodeid";
|
|
3
|
-
|
|
4
|
-
export interface IExtensionObject extends BaseUAObject {
|
|
5
|
-
binaryStoreSize(): number;
|
|
6
|
-
encode(stream: BinaryStream): void;
|
|
7
|
-
decode(stream: BinaryStream): void;
|
|
1
|
+
import { type IBaseUAObject } from "node-opcua-factory";
|
|
2
|
+
import type { ExpandedNodeId } from "node-opcua-nodeid";
|
|
3
|
+
export interface IExtensionObject extends IBaseUAObject {
|
|
8
4
|
encodingDefaultBinary?: ExpandedNodeId;
|
|
9
|
-
constructor: any;
|
|
10
5
|
}
|
|
11
|
-
type
|
|
6
|
+
type BufferInspectionCallback = (buffer: Buffer, encoding: ExpandedNodeId | undefined, options: Record<string, unknown>) => void;
|
|
12
7
|
/**
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
* @param callback_buffer
|
|
17
|
-
*
|
|
8
|
+
* @param obj - object to test (the object must provide
|
|
9
|
+
* binaryStoreSize, encode, decode methods)
|
|
10
|
+
* @param options - optional options or callback
|
|
11
|
+
* @param callback_buffer - optional callback to inspect
|
|
12
|
+
* the encoded buffer
|
|
13
|
+
* @returns the reloaded object after decode
|
|
18
14
|
*/
|
|
19
|
-
export declare function encode_decode_round_trip_test(obj: IExtensionObject, options?: unknown |
|
|
20
|
-
export declare function json_encode_decode_round_trip_test(obj:
|
|
15
|
+
export declare function encode_decode_round_trip_test(obj: IExtensionObject, options?: Record<string, unknown> | BufferInspectionCallback, callback_buffer?: BufferInspectionCallback): IBaseUAObject;
|
|
16
|
+
export declare function json_encode_decode_round_trip_test(obj: Record<string, unknown>, options?: Record<string, unknown> | BufferInspectionCallback, callbackBuffer?: BufferInspectionCallback): Record<string, unknown>;
|
|
21
17
|
export {};
|
|
@@ -14,24 +14,24 @@ const node_opcua_factory_1 = require("node-opcua-factory");
|
|
|
14
14
|
const node_opcua_test_helpers_1 = require("node-opcua-test-helpers");
|
|
15
15
|
const should_1 = __importDefault(require("should"));
|
|
16
16
|
const source_1 = require("../source");
|
|
17
|
-
function dump_block_in_debug_mode(buffer, id, options) {
|
|
18
|
-
if (process.env.DEBUG) {
|
|
19
|
-
console.log((0, node_opcua_debug_1.hexDump)(buffer));
|
|
20
|
-
(0, source_1.analyzePacket)(buffer, id, 0, 0, options);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
17
|
function isTypedArray(v) {
|
|
24
|
-
if (v
|
|
18
|
+
if (v?.buffer && v.buffer instanceof ArrayBuffer) {
|
|
25
19
|
return true;
|
|
26
20
|
}
|
|
27
21
|
return false;
|
|
28
22
|
}
|
|
29
23
|
function isArrayOrTypedArray(v) {
|
|
30
|
-
return isTypedArray(v) || v
|
|
24
|
+
return isTypedArray(v) || Array.isArray(v);
|
|
25
|
+
}
|
|
26
|
+
function dump_block_in_debug_mode(buffer, id, options) {
|
|
27
|
+
if (process.env.DEBUG) {
|
|
28
|
+
console.log((0, node_opcua_debug_1.hexDump)(buffer));
|
|
29
|
+
(0, source_1.analyzePacket)(buffer, id, 0, 0, options);
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
32
|
function compare(objReloaded, obj) {
|
|
33
33
|
function displayError(p, expected, actual) {
|
|
34
|
-
console.log(chalk_1.default.yellow(" ---------------------------------- error in encode_decode_round_trip_test"));
|
|
34
|
+
console.log(chalk_1.default.yellow(" ---------------------------------- error" + " in encode_decode_round_trip_test"));
|
|
35
35
|
console.log(chalk_1.default.red(" key "), p);
|
|
36
36
|
console.log(chalk_1.default.red(" expected "), JSON.stringify(expected));
|
|
37
37
|
console.log(chalk_1.default.cyan(" actual "), JSON.stringify(actual));
|
|
@@ -50,8 +50,8 @@ function compare(objReloaded, obj) {
|
|
|
50
50
|
}
|
|
51
51
|
catch (err) {
|
|
52
52
|
displayError(p, obj[p], objReloaded[p]);
|
|
53
|
-
console.log(obj
|
|
54
|
-
console.log(objReloaded
|
|
53
|
+
console.log(String(obj));
|
|
54
|
+
console.log(String(objReloaded));
|
|
55
55
|
// re throw exception
|
|
56
56
|
throw err;
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ function redirectToNull(functor) {
|
|
|
61
61
|
const old = console.log;
|
|
62
62
|
if (!process.env.DEBUG) {
|
|
63
63
|
// tslint:disable:no-empty
|
|
64
|
-
console.log = (...
|
|
64
|
+
console.log = (..._args) => {
|
|
65
65
|
/** */
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -73,11 +73,12 @@ function redirectToNull(functor) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
*
|
|
78
|
-
* @param
|
|
79
|
-
* @param callback_buffer
|
|
80
|
-
*
|
|
76
|
+
* @param obj - object to test (the object must provide
|
|
77
|
+
* binaryStoreSize, encode, decode methods)
|
|
78
|
+
* @param options - optional options or callback
|
|
79
|
+
* @param callback_buffer - optional callback to inspect
|
|
80
|
+
* the encoded buffer
|
|
81
|
+
* @returns the reloaded object after decode
|
|
81
82
|
*/
|
|
82
83
|
function encode_decode_round_trip_test(obj, options, callback_buffer) {
|
|
83
84
|
if (!callback_buffer && typeof options === "function") {
|
|
@@ -89,11 +90,14 @@ function encode_decode_round_trip_test(obj, options, callback_buffer) {
|
|
|
89
90
|
const size = obj.binaryStoreSize();
|
|
90
91
|
const stream = new node_opcua_binary_stream_1.BinaryStream(Buffer.alloc(size));
|
|
91
92
|
obj.encode(stream);
|
|
92
|
-
callback_buffer(stream.buffer, obj.encodingDefaultBinary, options);
|
|
93
|
+
callback_buffer(stream.buffer, obj.encodingDefaultBinary, (options ?? {}));
|
|
93
94
|
stream.rewind();
|
|
94
|
-
// reconstruct
|
|
95
|
+
// reconstruct an object (some objects may not have a
|
|
96
|
+
// default Binary encoding and should be recreated)
|
|
95
97
|
const expandedNodeId = obj.encodingDefaultBinary;
|
|
96
|
-
const objReloaded = expandedNodeId
|
|
98
|
+
const objReloaded = expandedNodeId
|
|
99
|
+
? (0, node_opcua_factory_1.getStandardDataTypeFactory)().constructObject(expandedNodeId)
|
|
100
|
+
: new obj.constructor();
|
|
97
101
|
objReloaded.decode(stream);
|
|
98
102
|
redirectToNull(() => (0, source_1.analyze_object_binary_encoding)(obj));
|
|
99
103
|
compare(objReloaded, obj);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode_decode_round_trip_test.js","sourceRoot":"","sources":["../../test_helpers/encode_decode_round_trip_test.ts"],"names":[],"mappings":";;;;;AA2FA,
|
|
1
|
+
{"version":3,"file":"encode_decode_round_trip_test.js","sourceRoot":"","sources":["../../test_helpers/encode_decode_round_trip_test.ts"],"names":[],"mappings":";;;;;AA2FA,sEAoCC;AAED,gFAoBC;AArJD,4BAA4B;AAC5B,YAAY;AACZ,kDAA0B;AAC1B,uEAAwD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