node-opcua-extension-object 2.55.0 → 2.61.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/LICENSE +20 -20
- package/dist/extension_object.d.ts +1 -1
- package/dist/extension_object.js +3 -2
- package/dist/extension_object.js.map +1 -1
- package/package.json +8 -7
- package/source/extension_object.ts +6 -6
- package/source/index.ts +4 -4
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -4,7 +4,7 @@ import { BaseUAObject, StructuredTypeSchema } from "node-opcua-factory";
|
|
|
4
4
|
import { NodeId } from "node-opcua-nodeid";
|
|
5
5
|
export declare class ExtensionObject extends BaseUAObject {
|
|
6
6
|
static schema: StructuredTypeSchema;
|
|
7
|
-
constructor(options
|
|
7
|
+
constructor(options?: null | Record<string, any>);
|
|
8
8
|
}
|
|
9
9
|
export declare function encodeExtensionObject(object: BaseUAObject | null, stream: OutputBinaryStream): void;
|
|
10
10
|
export declare class OpaqueStructure extends ExtensionObject {
|
package/dist/extension_object.js
CHANGED
|
@@ -9,6 +9,7 @@ const node_opcua_debug_1 = require("node-opcua-debug");
|
|
|
9
9
|
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
10
10
|
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
11
11
|
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
12
|
+
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
12
13
|
const chalk = require("chalk");
|
|
13
14
|
/* tslint:disable:no-empty */
|
|
14
15
|
class ExtensionObject extends node_opcua_factory_1.BaseUAObject {
|
|
@@ -101,7 +102,7 @@ exports.encodeExtensionObject = encodeExtensionObject;
|
|
|
101
102
|
// tslint:disable:max-classes-per-file
|
|
102
103
|
class OpaqueStructure extends ExtensionObject {
|
|
103
104
|
constructor(nodeId, buffer) {
|
|
104
|
-
super(
|
|
105
|
+
super();
|
|
105
106
|
this.nodeId = nodeId;
|
|
106
107
|
this.buffer = buffer;
|
|
107
108
|
}
|
|
@@ -165,7 +166,7 @@ function decodeExtensionObject(stream, _value) {
|
|
|
165
166
|
// causing 2 extra member to be added.
|
|
166
167
|
debugLog(chalk.bgWhiteBright.red("========================================="));
|
|
167
168
|
// tslint:disable-next-line:no-console
|
|
168
|
-
|
|
169
|
+
warningLog("WARNING => Extension object decoding error on ", object.constructor.name, " expected size was", length, "but only this amount of bytes have been read :", stream.length - streamLengthBefore);
|
|
169
170
|
stream.length = streamLengthBefore + length;
|
|
170
171
|
}
|
|
171
172
|
return object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_object.js","sourceRoot":"","sources":["../source/extension_object.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAoE;AAEpE,
|
|
1
|
+
{"version":3,"file":"extension_object.js","sourceRoot":"","sources":["../source/extension_object.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAoE;AAEpE,uDAA2F;AAC3F,2DAA8H;AAC9H,yDAAuE;AAEvE,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA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,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,EAAE;IAEX,MAAM,EAAE,qBAAqB;IAE7B,MAAM,EAAE,qBAAqB;IAE7B,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI;CAC3B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-extension-object",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -extension-object",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
9
|
-
"lint": "eslint source
|
|
9
|
+
"lint": "eslint source",
|
|
10
|
+
"format": "prettier --write source",
|
|
10
11
|
"clean": "node -e \"require('rimraf').sync('dist');\"",
|
|
11
12
|
"test": "echo no test"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
15
|
"chalk": "4.1.2",
|
|
15
16
|
"node-opcua-assert": "2.55.0",
|
|
16
|
-
"node-opcua-basic-types": "2.
|
|
17
|
+
"node-opcua-basic-types": "2.61.0",
|
|
17
18
|
"node-opcua-binary-stream": "2.55.0",
|
|
18
|
-
"node-opcua-debug": "2.
|
|
19
|
-
"node-opcua-factory": "2.
|
|
20
|
-
"node-opcua-nodeid": "2.
|
|
19
|
+
"node-opcua-debug": "2.61.0",
|
|
20
|
+
"node-opcua-factory": "2.61.0",
|
|
21
|
+
"node-opcua-nodeid": "2.61.0"
|
|
21
22
|
},
|
|
22
23
|
"author": "Etienne Rossignon",
|
|
23
24
|
"license": "MIT",
|
|
@@ -34,5 +35,5 @@
|
|
|
34
35
|
"internet of things"
|
|
35
36
|
],
|
|
36
37
|
"homepage": "http://node-opcua.github.io/",
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "dd8776f047686ca791989f27e11ee48bfd8b61b7"
|
|
38
39
|
}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { decodeNodeId, encodeNodeId } from "node-opcua-basic-types";
|
|
5
5
|
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
6
|
-
import { checkDebugFlag, hexDump, make_debugLog } from "node-opcua-debug";
|
|
6
|
+
import { checkDebugFlag, hexDump, make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
7
7
|
import { BaseUAObject, constructObject, is_internal_id, registerBuiltInType, StructuredTypeSchema } from "node-opcua-factory";
|
|
8
8
|
import { ExpandedNodeId, makeNodeId, NodeId } from "node-opcua-nodeid";
|
|
9
9
|
|
|
10
10
|
const debugLog = make_debugLog(__filename);
|
|
11
|
+
const warningLog = make_warningLog(__filename);
|
|
11
12
|
|
|
12
13
|
import * as chalk from "chalk";
|
|
13
14
|
|
|
@@ -20,7 +21,7 @@ export class ExtensionObject extends BaseUAObject {
|
|
|
20
21
|
name: "ExtensionObject"
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
constructor(options
|
|
24
|
+
constructor(options?: null | Record<string, any>) {
|
|
24
25
|
super();
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -110,14 +111,13 @@ export function encodeExtensionObject(object: BaseUAObject | null, stream: Outpu
|
|
|
110
111
|
|
|
111
112
|
// tslint:disable:max-classes-per-file
|
|
112
113
|
export class OpaqueStructure extends ExtensionObject {
|
|
113
|
-
|
|
114
114
|
// the nodeId is the same as the encodingDefaultBinary
|
|
115
115
|
public nodeId: NodeId;
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
public buffer: Buffer;
|
|
118
118
|
|
|
119
119
|
constructor(nodeId: NodeId, buffer: Buffer) {
|
|
120
|
-
super(
|
|
120
|
+
super();
|
|
121
121
|
this.nodeId = nodeId;
|
|
122
122
|
this.buffer = buffer;
|
|
123
123
|
}
|
|
@@ -187,7 +187,7 @@ export function decodeExtensionObject(stream: BinaryStream, _value?: ExtensionOb
|
|
|
187
187
|
debugLog(chalk.bgWhiteBright.red("========================================="));
|
|
188
188
|
|
|
189
189
|
// tslint:disable-next-line:no-console
|
|
190
|
-
|
|
190
|
+
warningLog(
|
|
191
191
|
"WARNING => Extension object decoding error on ",
|
|
192
192
|
object.constructor.name,
|
|
193
193
|
" expected size was",
|
package/source/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-extension-object
|
|
3
|
-
*/
|
|
4
|
-
export * from "./extension_object";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-extension-object
|
|
3
|
+
*/
|
|
4
|
+
export * from "./extension_object";
|