node-opcua-json 0.19.1 → 2.182.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 +22 -0
- package/README.md +141 -4
- package/dist/decode_opcua_json.d.ts +31 -0
- package/dist/decode_opcua_json.js +61 -0
- package/dist/decode_opcua_json.js.map +1 -0
- package/dist/extension_object_constructor.d.ts +46 -0
- package/dist/extension_object_constructor.js +26 -0
- package/dist/extension_object_constructor.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/json_basic_encoding_body_functor.d.ts +34 -0
- package/dist/json_basic_encoding_body_functor.js +170 -0
- package/dist/json_basic_encoding_body_functor.js.map +1 -0
- package/dist/json_basic_encoding_decoding_byte_string.d.ts +27 -0
- package/dist/json_basic_encoding_decoding_byte_string.js +27 -0
- package/dist/json_basic_encoding_decoding_byte_string.js.map +1 -0
- package/dist/json_basic_encoding_decoding_data_value.d.ts +80 -0
- package/dist/json_basic_encoding_decoding_data_value.js +289 -0
- package/dist/json_basic_encoding_decoding_data_value.js.map +1 -0
- package/dist/json_basic_encoding_decoding_date_time.d.ts +26 -0
- package/dist/json_basic_encoding_decoding_date_time.js +43 -0
- package/dist/json_basic_encoding_decoding_date_time.js.map +1 -0
- package/dist/json_basic_encoding_decoding_extension_object.d.ts +65 -0
- package/dist/json_basic_encoding_decoding_extension_object.js +461 -0
- package/dist/json_basic_encoding_decoding_extension_object.js.map +1 -0
- package/dist/json_basic_encoding_decoding_int64.d.ts +30 -0
- package/dist/json_basic_encoding_decoding_int64.js +56 -0
- package/dist/json_basic_encoding_decoding_int64.js.map +1 -0
- package/dist/json_basic_encoding_decoding_localizedtext.d.ts +33 -0
- package/dist/json_basic_encoding_decoding_localizedtext.js +62 -0
- package/dist/json_basic_encoding_decoding_localizedtext.js.map +1 -0
- package/dist/json_basic_encoding_decoding_nodeid.d.ts +42 -0
- package/dist/json_basic_encoding_decoding_nodeid.js +298 -0
- package/dist/json_basic_encoding_decoding_nodeid.js.map +1 -0
- package/dist/json_basic_encoding_decoding_qualifiedname.d.ts +35 -0
- package/dist/json_basic_encoding_decoding_qualifiedname.js +126 -0
- package/dist/json_basic_encoding_decoding_qualifiedname.js.map +1 -0
- package/dist/json_basic_encoding_decoding_statuscode.d.ts +39 -0
- package/dist/json_basic_encoding_decoding_statuscode.js +139 -0
- package/dist/json_basic_encoding_decoding_statuscode.js.map +1 -0
- package/dist/json_basic_encoding_decoding_variant.d.ts +101 -0
- package/dist/json_basic_encoding_decoding_variant.js +234 -0
- package/dist/json_basic_encoding_decoding_variant.js.map +1 -0
- package/dist/json_encoding_scheme.d.ts +50 -0
- package/dist/json_encoding_scheme.js +117 -0
- package/dist/json_encoding_scheme.js.map +1 -0
- package/package.json +57 -37
- package/source/decode_opcua_json.ts +67 -0
- package/source/extension_object_constructor.ts +48 -0
- package/source/index.ts +59 -0
- package/source/json_basic_encoding_body_functor.ts +190 -0
- package/source/json_basic_encoding_decoding_byte_string.ts +52 -0
- package/source/json_basic_encoding_decoding_data_value.ts +392 -0
- package/source/json_basic_encoding_decoding_date_time.ts +42 -0
- package/source/json_basic_encoding_decoding_extension_object.ts +531 -0
- package/source/json_basic_encoding_decoding_int64.ts +74 -0
- package/source/json_basic_encoding_decoding_localizedtext.ts +69 -0
- package/source/json_basic_encoding_decoding_nodeid.ts +356 -0
- package/source/json_basic_encoding_decoding_qualifiedname.ts +144 -0
- package/source/json_basic_encoding_decoding_statuscode.ts +151 -0
- package/source/json_basic_encoding_decoding_variant.ts +339 -0
- package/source/json_encoding_scheme.ts +114 -0
- package/LICENSE.md +0 -40
- package/dist2/decode_opcua_json.d.ts +0 -12
- package/dist2/index.d.ts +0 -17
- package/dist2/index.js +0 -1
- package/dist2/json_basic_encoding_body_functor.d.ts +0 -15
- package/dist2/json_basic_encoding_decoding_byte_string.d.ts +0 -8
- package/dist2/json_basic_encoding_decoding_data_value.d.ts +0 -26
- package/dist2/json_basic_encoding_decoding_date_time.d.ts +0 -6
- package/dist2/json_basic_encoding_decoding_extension_object.d.ts +0 -32
- package/dist2/json_basic_encoding_decoding_int64.d.ts +0 -9
- package/dist2/json_basic_encoding_decoding_localizedtext.d.ts +0 -14
- package/dist2/json_basic_encoding_decoding_nodeid.d.ts +0 -33
- package/dist2/json_basic_encoding_decoding_qualifiedname.d.ts +0 -14
- package/dist2/json_basic_encoding_decoding_statuscode.d.ts +0 -16
- package/dist2/json_basic_encoding_decoding_variant.d.ts +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ==========================================================================
|
|
4
|
+
* Copyright (c) 2021-2026 Sterfive - etienne.rossignon@sterfive.com
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
|
14
|
+
* all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
17
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
19
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
22
|
+
* IN THE SOFTWARE.
|
|
23
|
+
* ==========================================================================
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.bodyEncodeFunctor = bodyEncodeFunctor;
|
|
27
|
+
exports.bodyDecodeFunctor = bodyDecodeFunctor;
|
|
28
|
+
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
29
|
+
const json_basic_encoding_decoding_byte_string_js_1 = require("./json_basic_encoding_decoding_byte_string.js");
|
|
30
|
+
const json_basic_encoding_decoding_data_value_js_1 = require("./json_basic_encoding_decoding_data_value.js");
|
|
31
|
+
const json_basic_encoding_decoding_date_time_js_1 = require("./json_basic_encoding_decoding_date_time.js");
|
|
32
|
+
const json_basic_encoding_decoding_extension_object_js_1 = require("./json_basic_encoding_decoding_extension_object.js");
|
|
33
|
+
const json_basic_encoding_decoding_int64_js_1 = require("./json_basic_encoding_decoding_int64.js");
|
|
34
|
+
const json_basic_encoding_decoding_localizedtext_js_1 = require("./json_basic_encoding_decoding_localizedtext.js");
|
|
35
|
+
const json_basic_encoding_decoding_nodeid_js_1 = require("./json_basic_encoding_decoding_nodeid.js");
|
|
36
|
+
const json_basic_encoding_decoding_qualifiedname_js_1 = require("./json_basic_encoding_decoding_qualifiedname.js");
|
|
37
|
+
const json_basic_encoding_decoding_statuscode_js_1 = require("./json_basic_encoding_decoding_statuscode.js");
|
|
38
|
+
const json_basic_encoding_decoding_variant_js_1 = require("./json_basic_encoding_decoding_variant.js");
|
|
39
|
+
const json_encoding_scheme_js_1 = require("./json_encoding_scheme.js");
|
|
40
|
+
function opcuaJsonEncodeString(a, scheme) {
|
|
41
|
+
switch (scheme) {
|
|
42
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
43
|
+
return a;
|
|
44
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
45
|
+
return a;
|
|
46
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
47
|
+
return a;
|
|
48
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact:
|
|
49
|
+
if (a === "" || a === undefined || a === null) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return a;
|
|
53
|
+
default:
|
|
54
|
+
throw new Error(`Unknown JsonEncodingScheme: ${scheme}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function opcuaJsonEncodeGuid(a, scheme) {
|
|
58
|
+
switch (scheme) {
|
|
59
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
60
|
+
return a.toLowerCase();
|
|
61
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
62
|
+
return a.toLowerCase();
|
|
63
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
64
|
+
return a.toLowerCase();
|
|
65
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact:
|
|
66
|
+
if (a === "00000000-0000-0000-0000-000000000000") {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
return a.toLowerCase();
|
|
70
|
+
default:
|
|
71
|
+
throw new Error(`Unknown JsonEncodingScheme: ${scheme}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function bodyEncodeFunctor(dataType) {
|
|
75
|
+
switch (dataType) {
|
|
76
|
+
case node_opcua_variant_1.DataType.Null:
|
|
77
|
+
return () => null;
|
|
78
|
+
case node_opcua_variant_1.DataType.Boolean:
|
|
79
|
+
case node_opcua_variant_1.DataType.Byte:
|
|
80
|
+
case node_opcua_variant_1.DataType.Double:
|
|
81
|
+
case node_opcua_variant_1.DataType.Float:
|
|
82
|
+
case node_opcua_variant_1.DataType.Int16:
|
|
83
|
+
case node_opcua_variant_1.DataType.Int32:
|
|
84
|
+
case node_opcua_variant_1.DataType.SByte:
|
|
85
|
+
case node_opcua_variant_1.DataType.UInt16:
|
|
86
|
+
case node_opcua_variant_1.DataType.UInt32:
|
|
87
|
+
return (a) => a;
|
|
88
|
+
case node_opcua_variant_1.DataType.Guid:
|
|
89
|
+
return opcuaJsonEncodeGuid;
|
|
90
|
+
case node_opcua_variant_1.DataType.String:
|
|
91
|
+
return opcuaJsonEncodeString;
|
|
92
|
+
case node_opcua_variant_1.DataType.ByteString:
|
|
93
|
+
return json_basic_encoding_decoding_byte_string_js_1.opcuaJsonEncodeByteString;
|
|
94
|
+
case node_opcua_variant_1.DataType.LocalizedText:
|
|
95
|
+
return json_basic_encoding_decoding_localizedtext_js_1.opcuaJsonEncodeLocalizedText;
|
|
96
|
+
case node_opcua_variant_1.DataType.NodeId:
|
|
97
|
+
return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeNodeId;
|
|
98
|
+
case node_opcua_variant_1.DataType.ExpandedNodeId:
|
|
99
|
+
return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeExpandedNodeId;
|
|
100
|
+
case node_opcua_variant_1.DataType.QualifiedName:
|
|
101
|
+
return json_basic_encoding_decoding_qualifiedname_js_1.opcuaJsonEncodeQualifiedName;
|
|
102
|
+
case node_opcua_variant_1.DataType.StatusCode:
|
|
103
|
+
return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode;
|
|
104
|
+
case node_opcua_variant_1.DataType.DateTime:
|
|
105
|
+
return json_basic_encoding_decoding_date_time_js_1.opcuaJsonEncodeDateTime;
|
|
106
|
+
case node_opcua_variant_1.DataType.ExtensionObject:
|
|
107
|
+
return json_basic_encoding_decoding_extension_object_js_1.opcuaJsonEncodeExtensionObject;
|
|
108
|
+
case node_opcua_variant_1.DataType.Variant:
|
|
109
|
+
return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant;
|
|
110
|
+
case node_opcua_variant_1.DataType.Int64:
|
|
111
|
+
return json_basic_encoding_decoding_int64_js_1.opcuaJsonEncodeInt64;
|
|
112
|
+
case node_opcua_variant_1.DataType.UInt64:
|
|
113
|
+
return json_basic_encoding_decoding_int64_js_1.opcuaJsonEncodeUInt64;
|
|
114
|
+
case node_opcua_variant_1.DataType.DataValue:
|
|
115
|
+
return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue;
|
|
116
|
+
case node_opcua_variant_1.DataType.DiagnosticInfo:
|
|
117
|
+
case node_opcua_variant_1.DataType.XmlElement:
|
|
118
|
+
throw new Error(`Unsupported yet ${node_opcua_variant_1.DataType[dataType]}`);
|
|
119
|
+
default:
|
|
120
|
+
return () => null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function bodyDecodeFunctor(dataType) {
|
|
124
|
+
switch (dataType) {
|
|
125
|
+
case node_opcua_variant_1.DataType.Null:
|
|
126
|
+
return () => null;
|
|
127
|
+
case node_opcua_variant_1.DataType.Boolean:
|
|
128
|
+
case node_opcua_variant_1.DataType.Byte:
|
|
129
|
+
case node_opcua_variant_1.DataType.Double:
|
|
130
|
+
case node_opcua_variant_1.DataType.Float:
|
|
131
|
+
case node_opcua_variant_1.DataType.Guid:
|
|
132
|
+
case node_opcua_variant_1.DataType.Int16:
|
|
133
|
+
case node_opcua_variant_1.DataType.Int32:
|
|
134
|
+
case node_opcua_variant_1.DataType.SByte:
|
|
135
|
+
case node_opcua_variant_1.DataType.String:
|
|
136
|
+
case node_opcua_variant_1.DataType.UInt16:
|
|
137
|
+
case node_opcua_variant_1.DataType.UInt32:
|
|
138
|
+
return ((a) => a);
|
|
139
|
+
case node_opcua_variant_1.DataType.ByteString:
|
|
140
|
+
return json_basic_encoding_decoding_byte_string_js_1.opcuaJsonDecodeByteString;
|
|
141
|
+
case node_opcua_variant_1.DataType.LocalizedText:
|
|
142
|
+
return json_basic_encoding_decoding_localizedtext_js_1.opcuaJsonDecodeLocalizedText;
|
|
143
|
+
case node_opcua_variant_1.DataType.NodeId:
|
|
144
|
+
return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeNodeId;
|
|
145
|
+
case node_opcua_variant_1.DataType.ExpandedNodeId:
|
|
146
|
+
return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeExpandedNodeId;
|
|
147
|
+
case node_opcua_variant_1.DataType.QualifiedName:
|
|
148
|
+
return json_basic_encoding_decoding_qualifiedname_js_1.opcuaJsonDecodeQualifiedName;
|
|
149
|
+
case node_opcua_variant_1.DataType.StatusCode:
|
|
150
|
+
return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonDecodeStatusCode;
|
|
151
|
+
case node_opcua_variant_1.DataType.DateTime:
|
|
152
|
+
return json_basic_encoding_decoding_date_time_js_1.opcuaJsonDecodeDateTime;
|
|
153
|
+
case node_opcua_variant_1.DataType.ExtensionObject:
|
|
154
|
+
return json_basic_encoding_decoding_extension_object_js_1.opcuaJsonDecodeExtensionObject;
|
|
155
|
+
case node_opcua_variant_1.DataType.Variant:
|
|
156
|
+
return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant;
|
|
157
|
+
case node_opcua_variant_1.DataType.Int64:
|
|
158
|
+
return json_basic_encoding_decoding_int64_js_1.opcuaJsonDecodeInt64;
|
|
159
|
+
case node_opcua_variant_1.DataType.UInt64:
|
|
160
|
+
return json_basic_encoding_decoding_int64_js_1.opcuaJsonDecodeUInt64;
|
|
161
|
+
case node_opcua_variant_1.DataType.DataValue:
|
|
162
|
+
return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue;
|
|
163
|
+
case node_opcua_variant_1.DataType.DiagnosticInfo:
|
|
164
|
+
case node_opcua_variant_1.DataType.XmlElement:
|
|
165
|
+
throw new Error(`Unsupported yet ${node_opcua_variant_1.DataType[dataType]}`);
|
|
166
|
+
default:
|
|
167
|
+
return () => null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=json_basic_encoding_body_functor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json_basic_encoding_body_functor.js","sourceRoot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AAO,4EAAoD,CAAC;QAChE,KAAK,6BAAQ,CAAC,MAAM;YAChB,OAAO,8DAA6C,CAAC;QACzD,KAAK,6BAAQ,CAAC,cAAc;YACxB,OAAO,sEAAqD,CAAC;QACjE,KAAK,6BAAQ,CAAC,aAAa;YACvB,OAAO,4EAAoD,CAAC;QAChE,KAAK,6BAAQ,CAAC,UAAU;YACpB,OAAO,sEAAiD,CAAC;QAC7D,KAAK,6BAAQ,CAAC,QAAQ;YAClB,OAAO,mEAA+C,CAAC;QAC3D,KAAK,6BAAQ,CAAC,eAAe;YACzB,OAAO,iFAAsD,CAAC;QAClE,KAAK,6BAAQ,CAAC,OAAO;YACjB,OAAO,gEAA8C,CAAC;QAC1D,KAAK,6BAAQ,CAAC,KAAK;YACf,OAAO,4DAA4C,CAAC;QACxD,KAAK,6BAAQ,CAAC,MAAM;YAChB,OAAO,6DAA6C,CAAC;QACzD,KAAK,6BAAQ,CAAC,SAAS;YACnB,OAAO,qEAAgD,CAAC;QAC5D,KAAK,6BAAQ,CAAC,cAAc,CAAC;QAC7B,KAAK,6BAAQ,CAAC,UAAU;YACpB,MAAM,IAAI,KAAK,CAAC,mBAAmB,6BAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7D;YACI,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IAC1B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ==========================================================================
|
|
3
|
+
* Copyright (c) 2021-2026 Sterfive - etienne.rossignon@sterfive.com
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
16
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
18
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
21
|
+
* IN THE SOFTWARE.
|
|
22
|
+
* ==========================================================================
|
|
23
|
+
*/
|
|
24
|
+
import type { ByteString } from "node-opcua-basic-types";
|
|
25
|
+
import { JsonEncodingScheme } from "./json_encoding_scheme.js";
|
|
26
|
+
export declare function opcuaJsonEncodeByteString(byteString: ByteString | null, scheme: JsonEncodingScheme, _namespaceArray?: string[]): string | null | undefined;
|
|
27
|
+
export declare function opcuaJsonDecodeByteString(pojo: string | null): Buffer | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opcuaJsonEncodeByteString = opcuaJsonEncodeByteString;
|
|
4
|
+
exports.opcuaJsonDecodeByteString = opcuaJsonDecodeByteString;
|
|
5
|
+
const json_encoding_scheme_js_1 = require("./json_encoding_scheme.js");
|
|
6
|
+
function opcuaJsonEncodeByteString(byteString, scheme, _namespaceArray) {
|
|
7
|
+
if (!byteString) {
|
|
8
|
+
if (scheme === json_encoding_scheme_js_1.JsonEncodingScheme.Compact) {
|
|
9
|
+
return undefined; // Compact encoding does not encode null values
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (scheme === json_encoding_scheme_js_1.JsonEncodingScheme.Compact && byteString.length === 0) {
|
|
14
|
+
return undefined; // Compact encoding does not encode empty ByteString
|
|
15
|
+
}
|
|
16
|
+
if (scheme === json_encoding_scheme_js_1.JsonEncodingScheme.Verbose && byteString.length === 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return byteString.toString("base64");
|
|
20
|
+
}
|
|
21
|
+
function opcuaJsonDecodeByteString(pojo) {
|
|
22
|
+
if (!pojo) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return Buffer.from(pojo, "base64");
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=json_basic_encoding_decoding_byte_string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json_basic_encoding_decoding_byte_string.js","sourceRoot":"","sources":["../source/json_basic_encoding_decoding_byte_string.ts"],"names":[],"mappings":";;AA0BA,8DAkBC;AAED,8DAKC;AA3BD,uEAA+D;AAE/D,SAAgB,yBAAyB,CACrC,UAA6B,EAC7B,MAA0B,EAC1B,eAA0B;IAE1B,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,IAAI,MAAM,KAAK,4CAAkB,CAAC,OAAO,EAAE,CAAC;YACxC,OAAO,SAAS,CAAC,CAAC,+CAA+C;QACrE,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,MAAM,KAAK,4CAAkB,CAAC,OAAO,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnE,OAAO,SAAS,CAAC,CAAC,oDAAoD;IAC1E,CAAC;IACD,IAAI,MAAM,KAAK,4CAAkB,CAAC,OAAO,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,yBAAyB,CAAC,IAAmB;IACzD,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ==========================================================================
|
|
3
|
+
* Copyright (c) 2021-2026 Sterfive - etienne.rossignon@sterfive.com
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
16
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
18
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
21
|
+
* IN THE SOFTWARE.
|
|
22
|
+
* ==========================================================================
|
|
23
|
+
*/
|
|
24
|
+
import type { UInt16 } from "node-opcua-basic-types";
|
|
25
|
+
import { DataValue } from "node-opcua-data-value";
|
|
26
|
+
import { DataSetFieldContentMask } from "node-opcua-types";
|
|
27
|
+
import type { ExtensionObjectBuilder } from "./json_basic_encoding_body_functor.js";
|
|
28
|
+
import { type StatusCodeJSON } from "./json_basic_encoding_decoding_statuscode.js";
|
|
29
|
+
import { type VariantJSON104, type VariantJSON105, type VariantJSONBody } from "./json_basic_encoding_decoding_variant.js";
|
|
30
|
+
import { JsonEncoderMode104, JsonEncoderMode105, JsonEncodingScheme } from "./json_encoding_scheme.js";
|
|
31
|
+
export interface DataValueStatusAndTimestamps {
|
|
32
|
+
StatusCode?: StatusCodeJSON | number;
|
|
33
|
+
/**
|
|
34
|
+
* The source timestamp associated with the value.
|
|
35
|
+
* Not encoded if the value is DateTime.MinValue.
|
|
36
|
+
*/
|
|
37
|
+
SourceTimestamp?: Date;
|
|
38
|
+
/**
|
|
39
|
+
* The number of 10 Picosecond intervals for the SourceTimestamp.
|
|
40
|
+
* Not encoded if the value is 0.
|
|
41
|
+
*/
|
|
42
|
+
SourcePicoseconds?: UInt16;
|
|
43
|
+
/**
|
|
44
|
+
* The server timestamp associated with the value.
|
|
45
|
+
* Not encoded if the value is DateTime.MinValue.
|
|
46
|
+
*/
|
|
47
|
+
ServerTimestamp?: Date;
|
|
48
|
+
/**
|
|
49
|
+
* The number of 10 Picosecond intervals for the ServerTimestamp.
|
|
50
|
+
* Not encoded if the value is 0.
|
|
51
|
+
*/
|
|
52
|
+
ServerPicoseconds?: UInt16;
|
|
53
|
+
}
|
|
54
|
+
export interface DataValueJSON104 extends DataValueStatusAndTimestamps {
|
|
55
|
+
Value?: VariantJSON104 | null;
|
|
56
|
+
}
|
|
57
|
+
export interface DataValueJSON105 extends VariantJSON105, DataValueStatusAndTimestamps {
|
|
58
|
+
}
|
|
59
|
+
export type DataValueJSON = DataValueJSON105;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param dataValue
|
|
63
|
+
* @param mask
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare function opcuaJsonEncodeDataValueMQTT(dataValue: DataValue, encoding: JsonEncodingScheme, mask: DataSetFieldContentMask, namespaceArray?: string[]): VariantJSONBody | VariantJSON105 | VariantJSON104 | DataValueJSON105 | DataValueJSON104 | null;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param dataValue
|
|
70
|
+
* @param mask
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
export declare function _opcuaJsonEncodeDataValueMQTT105(dataValue: DataValue, mode: JsonEncoderMode105, mask: DataSetFieldContentMask, namespaceArray?: string[]): VariantJSONBody | DataValueJSON105 | null;
|
|
74
|
+
export declare function opcuaJsonEncodeDataValue104(dataValue: DataValue, mode: JsonEncoderMode104, namespaceArray: string[]): DataValueJSON104;
|
|
75
|
+
export declare function opcuaJsonEncodeDataValue105(dataValue: DataValue, mode: JsonEncoderMode105, namespaceArray: string[]): DataValueJSON105;
|
|
76
|
+
export declare function opcuaJsonEncodeDataValue(dataValue: DataValue, mode: JsonEncodingScheme.Compact | JsonEncodingScheme.Verbose, namespaceArray: string[]): DataValueJSON105;
|
|
77
|
+
export declare function opcuaJsonEncodeDataValue(dataValue: DataValue, mode: JsonEncodingScheme.DeprecatedNonReversible | JsonEncodingScheme.DeprecatedReversible, namespaceArray: string[]): DataValueJSON104;
|
|
78
|
+
export declare function opcuaJsonDecodeDataValue104(pojo: DataValueJSON104 | null | undefined, builder: ExtensionObjectBuilder, namespaceArray: string[]): DataValue;
|
|
79
|
+
export declare function opcuaJsonDecodeDataValue105(pojo: DataValueJSON105 | null | undefined, builder: ExtensionObjectBuilder, namespaceArray: string[]): DataValue;
|
|
80
|
+
export declare function opcuaJsonDecodeDataValue(pojo: DataValueJSON104 | DataValueJSON105 | null | undefined, builder: ExtensionObjectBuilder, namespaceArray: string[]): DataValue;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ==========================================================================
|
|
4
|
+
* Copyright (c) 2021-2026 Sterfive - etienne.rossignon@sterfive.com
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
|
14
|
+
* all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
17
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
19
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
22
|
+
* IN THE SOFTWARE.
|
|
23
|
+
* ==========================================================================
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.opcuaJsonEncodeDataValueMQTT = opcuaJsonEncodeDataValueMQTT;
|
|
27
|
+
exports._opcuaJsonEncodeDataValueMQTT105 = _opcuaJsonEncodeDataValueMQTT105;
|
|
28
|
+
exports.opcuaJsonEncodeDataValue104 = opcuaJsonEncodeDataValue104;
|
|
29
|
+
exports.opcuaJsonEncodeDataValue105 = opcuaJsonEncodeDataValue105;
|
|
30
|
+
exports.opcuaJsonEncodeDataValue = opcuaJsonEncodeDataValue;
|
|
31
|
+
exports.opcuaJsonDecodeDataValue104 = opcuaJsonDecodeDataValue104;
|
|
32
|
+
exports.opcuaJsonDecodeDataValue105 = opcuaJsonDecodeDataValue105;
|
|
33
|
+
exports.opcuaJsonDecodeDataValue = opcuaJsonDecodeDataValue;
|
|
34
|
+
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
35
|
+
const node_opcua_types_1 = require("node-opcua-types");
|
|
36
|
+
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
37
|
+
const json_basic_encoding_decoding_statuscode_js_1 = require("./json_basic_encoding_decoding_statuscode.js");
|
|
38
|
+
const json_basic_encoding_decoding_variant_js_1 = require("./json_basic_encoding_decoding_variant.js");
|
|
39
|
+
const json_encoding_scheme_js_1 = require("./json_encoding_scheme.js");
|
|
40
|
+
function _setTimestampsAndStatusCode(pojo, dataValue, mask, mode) {
|
|
41
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.ServerPicoSeconds && dataValue.serverPicoseconds) {
|
|
42
|
+
pojo.ServerPicoseconds = dataValue.serverPicoseconds;
|
|
43
|
+
}
|
|
44
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.SourcePicoSeconds && dataValue.sourcePicoseconds) {
|
|
45
|
+
pojo.SourcePicoseconds = dataValue.sourcePicoseconds;
|
|
46
|
+
}
|
|
47
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.ServerTimestamp && dataValue.serverTimestamp) {
|
|
48
|
+
pojo.ServerTimestamp = dataValue.serverTimestamp;
|
|
49
|
+
}
|
|
50
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.SourceTimestamp && dataValue.sourceTimestamp) {
|
|
51
|
+
pojo.SourceTimestamp = dataValue.sourceTimestamp;
|
|
52
|
+
}
|
|
53
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.StatusCode && dataValue.statusCode.value !== 0) {
|
|
54
|
+
// statusCode is omitted if it is Good (0)
|
|
55
|
+
// https://reference.opcfoundation.org/Core/Part6/v105/docs/5.4
|
|
56
|
+
switch (mode) {
|
|
57
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
58
|
+
pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode104)(dataValue.statusCode, json_encoding_scheme_js_1.JsonEncoderMode104.NonReversible);
|
|
59
|
+
break;
|
|
60
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
61
|
+
pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode104)(dataValue.statusCode, json_encoding_scheme_js_1.JsonEncoderMode104.Reversible);
|
|
62
|
+
break;
|
|
63
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
64
|
+
pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode105)(dataValue.statusCode, json_encoding_scheme_js_1.JsonEncoderMode105.Verbose);
|
|
65
|
+
break;
|
|
66
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact:
|
|
67
|
+
pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode105)(dataValue.statusCode, json_encoding_scheme_js_1.JsonEncoderMode105.Compact);
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
throw new Error("Invalid JsonEncodingScheme");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function _decodeTimestampsAndStatusCodeJson(pojo, dataValueOpt) {
|
|
75
|
+
if (pojo.ServerPicoseconds) {
|
|
76
|
+
dataValueOpt.serverPicoseconds = pojo.ServerPicoseconds;
|
|
77
|
+
}
|
|
78
|
+
if (pojo.SourcePicoseconds) {
|
|
79
|
+
dataValueOpt.sourcePicoseconds = pojo.SourcePicoseconds;
|
|
80
|
+
}
|
|
81
|
+
if (pojo.ServerTimestamp) {
|
|
82
|
+
dataValueOpt.serverTimestamp = new Date(pojo.ServerTimestamp);
|
|
83
|
+
}
|
|
84
|
+
if (pojo.SourceTimestamp) {
|
|
85
|
+
dataValueOpt.sourceTimestamp = new Date(pojo.SourceTimestamp);
|
|
86
|
+
}
|
|
87
|
+
if (pojo.StatusCode) {
|
|
88
|
+
dataValueOpt.statusCode = (0, json_basic_encoding_decoding_statuscode_js_1.opcuaJsonDecodeStatusCode)(pojo.StatusCode);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param dataValue
|
|
94
|
+
* @param mask
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
function opcuaJsonEncodeDataValueMQTT(dataValue, encoding, mask, namespaceArray = []) {
|
|
98
|
+
switch (encoding) {
|
|
99
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
100
|
+
return _opcuaJsonEncodeDataValueMQTT104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.NonReversible, mask, namespaceArray);
|
|
101
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
102
|
+
return _opcuaJsonEncodeDataValueMQTT104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.Reversible, mask, namespaceArray);
|
|
103
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
104
|
+
return _opcuaJsonEncodeDataValueMQTT105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Verbose, mask, namespaceArray);
|
|
105
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact: {
|
|
106
|
+
return _opcuaJsonEncodeDataValueMQTT105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Compact, mask, namespaceArray);
|
|
107
|
+
}
|
|
108
|
+
default:
|
|
109
|
+
throw new Error("Invalid JsonEncodingScheme");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function _opcuaJsonEncodeDataValueMQTT104(dataValue, mode, mask, namespaceArray = []) {
|
|
113
|
+
/**
|
|
114
|
+
* All fields with a concrete DataType are encoded using VerboseEncoding if FieldEncoding1 is
|
|
115
|
+
* FALSE and CompactEncoding if FieldEncoding1 is TRUE.
|
|
116
|
+
*
|
|
117
|
+
* See the OPC UA JSON Data encodings defined in OPC 10000-6.
|
|
118
|
+
*
|
|
119
|
+
* The fields in the DataSetMessage are specified by the DataSetFieldContentMask in the
|
|
120
|
+
* DataSetWriter parameters.
|
|
121
|
+
*
|
|
122
|
+
* The format of the field values in the Payload depend on the setting of
|
|
123
|
+
* DataSetFieldContentMask, the FieldEncoding1 and the FieldEncoding2 flag in
|
|
124
|
+
* DataSetMessageContentMask. The resulting JSON encoding is defined in Table 111.
|
|
125
|
+
*
|
|
126
|
+
* FieldEncoding1 FieldEncoding2 Description
|
|
127
|
+
* False True The JSON VerboseEncoding is used for the DataSetMessage field encoding.
|
|
128
|
+
* True True The JSON CompactEncoding is used for the DataSetMessage field encoding.
|
|
129
|
+
* False False The deprecated JSON NonReversibleEncoding is used for the
|
|
130
|
+
* DataSetMessage field encoding.
|
|
131
|
+
* The RawData bit of the DataSetFieldContentMask shall be ignored.
|
|
132
|
+
* True False The deprecated JSON ReversibleFieldEncoding is used for the
|
|
133
|
+
* DataSetMessage field encoding.
|
|
134
|
+
* The RawData bit of the DataSetFieldContentMask shall be ignored.
|
|
135
|
+
*
|
|
136
|
+
* If the DataSetFieldContentMask is 0x0 or 0x20 (only the RawData flag is set), the
|
|
137
|
+
* DataSetMessage fields are encoded as Variant. Otherwise the fields are encoded as
|
|
138
|
+
* DataValue.
|
|
139
|
+
* If the KeyFrameCount is 0, the DataSetFieldContentMask shall be 0x0 or 0x20.
|
|
140
|
+
*
|
|
141
|
+
* If the FieldEncoding1 is FALSE in the DataSetMessageContentMask, the Variant at the top
|
|
142
|
+
* level of a field is encoded as a JSON value containing only the value of the Body field.
|
|
143
|
+
*
|
|
144
|
+
* If this Variant contains an ExtensionObject, the ExtensionObject shall be encoded as a Structure
|
|
145
|
+
* without the UaTypeId field.
|
|
146
|
+
* This also applies to the Variant in a DataValue at the top level of a field.
|
|
147
|
+
*
|
|
148
|
+
* If the RawData flag is set, the UaType fields of Variants and the UaTypeId fields of
|
|
149
|
+
* ExtensionObjects are always omitted.
|
|
150
|
+
*
|
|
151
|
+
* If the RawData flag ist set, it is not possible to reverse the data in a DataSetReader in the
|
|
152
|
+
* following cases.
|
|
153
|
+
*
|
|
154
|
+
* * DataSet fields have an abstract DataType in the DataSetMetaData.
|
|
155
|
+
* * DataSet field values do not match the DataType specified in the DataSetMetaData if
|
|
156
|
+
* they are Structure DataTypes
|
|
157
|
+
**/
|
|
158
|
+
if (mask === node_opcua_types_1.DataSetFieldContentMask.None) {
|
|
159
|
+
return (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant104)(dataValue.value, mode, namespaceArray);
|
|
160
|
+
}
|
|
161
|
+
const pojoVariant = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant104)(dataValue.value, mode, namespaceArray);
|
|
162
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.RawData) {
|
|
163
|
+
// RawData: the field value is a Variant encoded using the non-reversible OPC UA JSON Data Encoding defined in OPC 10000-6.
|
|
164
|
+
return pojoVariant;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* DataValue values shall be encoded as a JSON object with the fields below.
|
|
168
|
+
* JSON Object Definition for a DataValue
|
|
169
|
+
* Name DataType Description
|
|
170
|
+
* Value Variant The value.
|
|
171
|
+
* Status StatusCode The status associated with the value.
|
|
172
|
+
* SourceTimestamp DateTime The source timestamp associated with the value.
|
|
173
|
+
* SourcePicoSeconds UInt16 The number of 10 picosecond intervals for the SourceTimestamp.
|
|
174
|
+
* ServerTimestamp DateTime The Server timestamp associated with the value.
|
|
175
|
+
* ServerPicoSeconds UInt16 The number of 10 picosecond intervals for the ServerTimestamp.
|
|
176
|
+
*
|
|
177
|
+
* If a field has a null or default value it is omitted. Each field is encoded using the rules
|
|
178
|
+
* defined for the built-in type specified in the Data Type column.
|
|
179
|
+
*/
|
|
180
|
+
const pojo = {
|
|
181
|
+
Value: pojoVariant
|
|
182
|
+
};
|
|
183
|
+
_setTimestampsAndStatusCode(pojo, dataValue, mask, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
184
|
+
return pojo;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
*
|
|
188
|
+
* @param dataValue
|
|
189
|
+
* @param mask
|
|
190
|
+
* @returns
|
|
191
|
+
*/
|
|
192
|
+
function _opcuaJsonEncodeDataValueMQTT105(dataValue, mode, mask, namespaceArray = []) {
|
|
193
|
+
if (mask === node_opcua_types_1.DataSetFieldContentMask.None) {
|
|
194
|
+
if (mode === json_encoding_scheme_js_1.JsonEncoderMode105.Verbose) {
|
|
195
|
+
return (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const pojoVariant = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|
|
202
|
+
if (mask & node_opcua_types_1.DataSetFieldContentMask.RawData) {
|
|
203
|
+
// RawData: the field value is a Variant encoded using the non-reversible OPC UA JSON Data Encoding defined in OPC 10000-6.
|
|
204
|
+
return pojoVariant;
|
|
205
|
+
}
|
|
206
|
+
const pojo = pojoVariant;
|
|
207
|
+
_setTimestampsAndStatusCode(pojo, dataValue, mask, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
208
|
+
return pojo;
|
|
209
|
+
}
|
|
210
|
+
const DataSetFieldContentMaskAll = node_opcua_types_1.DataSetFieldContentMask.StatusCode |
|
|
211
|
+
node_opcua_types_1.DataSetFieldContentMask.SourceTimestamp |
|
|
212
|
+
node_opcua_types_1.DataSetFieldContentMask.SourcePicoSeconds |
|
|
213
|
+
node_opcua_types_1.DataSetFieldContentMask.ServerTimestamp |
|
|
214
|
+
node_opcua_types_1.DataSetFieldContentMask.ServerPicoSeconds;
|
|
215
|
+
function opcuaJsonEncodeDataValue104(dataValue, mode, namespaceArray) {
|
|
216
|
+
const pojoVariant = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant104)(dataValue.value, mode, namespaceArray);
|
|
217
|
+
if (mode === json_encoding_scheme_js_1.JsonEncoderMode104.Reversible) {
|
|
218
|
+
const pojo = {
|
|
219
|
+
Value: pojoVariant
|
|
220
|
+
};
|
|
221
|
+
_setTimestampsAndStatusCode(pojo, dataValue, DataSetFieldContentMaskAll, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
222
|
+
return pojo;
|
|
223
|
+
}
|
|
224
|
+
const pojo = {
|
|
225
|
+
Value: pojoVariant
|
|
226
|
+
};
|
|
227
|
+
_setTimestampsAndStatusCode(pojo, dataValue, DataSetFieldContentMaskAll, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
228
|
+
return pojo;
|
|
229
|
+
}
|
|
230
|
+
function opcuaJsonEncodeDataValue105(dataValue, mode, namespaceArray) {
|
|
231
|
+
if (mode === json_encoding_scheme_js_1.JsonEncoderMode105.Verbose) {
|
|
232
|
+
const pojoVariant = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|
|
233
|
+
const pojo = pojoVariant;
|
|
234
|
+
_setTimestampsAndStatusCode(pojo, dataValue, DataSetFieldContentMaskAll, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
235
|
+
return pojo;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
const pojoVariant = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|
|
239
|
+
const pojo = pojoVariant;
|
|
240
|
+
_setTimestampsAndStatusCode(pojo, dataValue, DataSetFieldContentMaskAll, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode));
|
|
241
|
+
return pojo;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function opcuaJsonEncodeDataValue(dataValue, mode, namespaceArray) {
|
|
245
|
+
switch (mode) {
|
|
246
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
247
|
+
return opcuaJsonEncodeDataValue104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.NonReversible, namespaceArray);
|
|
248
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
249
|
+
return opcuaJsonEncodeDataValue104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.Reversible, namespaceArray);
|
|
250
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
251
|
+
return opcuaJsonEncodeDataValue105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Verbose, namespaceArray);
|
|
252
|
+
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact:
|
|
253
|
+
return opcuaJsonEncodeDataValue105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Compact, namespaceArray);
|
|
254
|
+
default:
|
|
255
|
+
throw new Error("Invalid JsonEncodingScheme");
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function opcuaJsonDecodeDataValue104(pojo, builder, namespaceArray) {
|
|
259
|
+
if (!pojo) {
|
|
260
|
+
return new node_opcua_data_value_1.DataValue({ value: { dataType: node_opcua_variant_1.DataType.Null } });
|
|
261
|
+
}
|
|
262
|
+
const dataValueOpt = {};
|
|
263
|
+
_decodeTimestampsAndStatusCodeJson(pojo, dataValueOpt);
|
|
264
|
+
if (pojo.Value) {
|
|
265
|
+
dataValueOpt.value = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant104)(pojo.Value, builder, namespaceArray);
|
|
266
|
+
}
|
|
267
|
+
return new node_opcua_data_value_1.DataValue(dataValueOpt);
|
|
268
|
+
}
|
|
269
|
+
function opcuaJsonDecodeDataValue105(pojo, builder, namespaceArray) {
|
|
270
|
+
if (!pojo) {
|
|
271
|
+
return new node_opcua_data_value_1.DataValue({ value: { dataType: node_opcua_variant_1.DataType.Null } });
|
|
272
|
+
}
|
|
273
|
+
const dataValueOpt = {};
|
|
274
|
+
_decodeTimestampsAndStatusCodeJson(pojo, dataValueOpt);
|
|
275
|
+
if (pojo.Value) {
|
|
276
|
+
dataValueOpt.value = (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant105)(pojo, builder, namespaceArray);
|
|
277
|
+
}
|
|
278
|
+
return new node_opcua_data_value_1.DataValue(dataValueOpt);
|
|
279
|
+
}
|
|
280
|
+
function opcuaJsonDecodeDataValue(pojo, builder, namespaceArray) {
|
|
281
|
+
if (!pojo) {
|
|
282
|
+
return new node_opcua_data_value_1.DataValue({ value: { dataType: node_opcua_variant_1.DataType.Null } });
|
|
283
|
+
}
|
|
284
|
+
if ("UaType" in pojo) {
|
|
285
|
+
return opcuaJsonDecodeDataValue105(pojo, builder, namespaceArray);
|
|
286
|
+
}
|
|
287
|
+
return opcuaJsonDecodeDataValue104(pojo, builder, namespaceArray);
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=json_basic_encoding_decoding_data_value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json_basic_encoding_decoding_data_value.js","sourceRoot":"","sources":["../source/json_basic_encoding_decoding_data_value.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAwHH,oEAmBC;AAyFD,4EAsBC;AASD,kEAkBC;AACD,kEAgBC;AAYD,4DAiBC;AAED,kEAcC;AAED,kEAcC;AAED,4DAYC;AA9WD,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