node-opcua-json 0.16.0 → 0.17.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.md CHANGED
@@ -1,7 +1,25 @@
1
1
 
2
- the MIT License (MIT)
2
+ ---------------------------------------------------------------------------------------------
3
+ Copyright (c) Sterfive 2020-2022
4
+ ---------------------------------------------------------------------------------------------
5
+ This module is available under a DUAL license scheme.
3
6
 
4
- Copyright (c) Sterfive 2020-2021
7
+ The minified version of this module is available under the terms of the MIT license (see below)
8
+
9
+ For full access to source code, you need to subscribe to a license from Sterfive.
10
+ The full version includes :
11
+ - access to full source code repository, with access to the un-minified source code,
12
+ typescript source, full unit test, documentation, examples
13
+ - access to a private registry to access un-minified modules
14
+ - the right to integrate new versions of the un-minified source code into your application
15
+ - and access to technical support.
16
+
17
+ Contact sterfive at contact@sterfive.com to subscribe.
18
+
19
+ -------------------------------------------------------------------------------------------
20
+ the MIT License (MIT)
21
+
22
+ Copyright (c) Sterfive 2020-2022
5
23
 
6
24
  Permission is hereby granted, free of charge, to any person obtaining a copy of
7
25
  this software and associated documentation files (the "Software"), to deal in
@@ -20,4 +38,3 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
38
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
39
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
40
 
23
-
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { NodeIdLike } from "node-opcua-nodeid";
26
6
  import { ConstructorFuncWithSchema } from "node-opcua-factory";
27
7
  import { ExtensionObject } from "node-opcua-extension-object";
package/dist2/index.d.ts CHANGED
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  export { opcuaJsonEncodeVariant, opcuaJsonDecodeVariant, VariantJSON } from "./json_basic_encoding_decoding_variant";
26
6
  export { opcuaJsonEncodeDataValue, opcuaJsonDecodeDataValue, opcuaJsonEncodeDataValueMQTT, DataValueJSON, } from "./json_basic_encoding_decoding_data_value";
27
7
  export * from "./decode_opcua_json";
package/dist2/index.js CHANGED
@@ -1,715 +1 @@
1
- (() => {
2
- "use strict";
3
- var __webpack_modules__ = {
4
- 449: (__unused_webpack_module, exports, __nccwpck_require__) => {
5
- Object.defineProperty(exports, "__esModule", { value: !0 }),
6
- (exports.decodeOPCUA_JSON = exports.decodeOPCUA_JSONOld = void 0);
7
- const node_opcua_nodeid_1 = __nccwpck_require__(791),
8
- node_opcua_factory_1 = __nccwpck_require__(745),
9
- json_basic_encoding_decoding_extension_object_1 = __nccwpck_require__(822);
10
- (exports.decodeOPCUA_JSONOld = function (dataType, pojo) {
11
- const Constructor = (0, node_opcua_factory_1.getStandardDataTypeFactory)().findConstructorForDataType(
12
- (0, node_opcua_nodeid_1.resolveNodeId)(dataType)
13
- );
14
- return Constructor
15
- ? new Constructor(
16
- (0, json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObjectBody)(Constructor.schema, pojo)
17
- )
18
- : null;
19
- }),
20
- (exports.decodeOPCUA_JSON = function (Constructor, pojo) {
21
- return new Constructor(
22
- (0, json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObjectBody)(Constructor.schema, pojo)
23
- );
24
- });
25
- },
26
- 629: function (__unused_webpack_module, exports, __nccwpck_require__) {
27
- var __createBinding =
28
- (this && this.__createBinding) ||
29
- (Object.create
30
- ? function (o, m, k, k2) {
31
- void 0 === k2 && (k2 = k),
32
- Object.defineProperty(o, k2, {
33
- enumerable: !0,
34
- get: function () {
35
- return m[k];
36
- },
37
- });
38
- }
39
- : function (o, m, k, k2) {
40
- void 0 === k2 && (k2 = k), (o[k2] = m[k]);
41
- }),
42
- __exportStar =
43
- (this && this.__exportStar) ||
44
- function (m, exports) {
45
- for (var p in m)
46
- "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
47
- };
48
- Object.defineProperty(exports, "__esModule", { value: !0 }),
49
- (exports.opcuaJsonDecodeExtensionObject =
50
- exports.opcuaJsonEncodeExtensionObject =
51
- exports.opcuaJsonEncodeDataValueMQTT =
52
- exports.opcuaJsonDecodeDataValue =
53
- exports.opcuaJsonEncodeDataValue =
54
- exports.opcuaJsonDecodeVariant =
55
- exports.opcuaJsonEncodeVariant =
56
- void 0);
57
- var json_basic_encoding_decoding_variant_1 = __nccwpck_require__(768);
58
- Object.defineProperty(exports, "opcuaJsonEncodeVariant", {
59
- enumerable: !0,
60
- get: function () {
61
- return json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant;
62
- },
63
- }),
64
- Object.defineProperty(exports, "opcuaJsonDecodeVariant", {
65
- enumerable: !0,
66
- get: function () {
67
- return json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant;
68
- },
69
- });
70
- var json_basic_encoding_decoding_data_value_1 = __nccwpck_require__(466);
71
- Object.defineProperty(exports, "opcuaJsonEncodeDataValue", {
72
- enumerable: !0,
73
- get: function () {
74
- return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValue;
75
- },
76
- }),
77
- Object.defineProperty(exports, "opcuaJsonDecodeDataValue", {
78
- enumerable: !0,
79
- get: function () {
80
- return json_basic_encoding_decoding_data_value_1.opcuaJsonDecodeDataValue;
81
- },
82
- }),
83
- Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT", {
84
- enumerable: !0,
85
- get: function () {
86
- return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValueMQTT;
87
- },
88
- }),
89
- __exportStar(__nccwpck_require__(449), exports),
90
- __exportStar(__nccwpck_require__(797), exports),
91
- __exportStar(__nccwpck_require__(393), exports),
92
- __exportStar(__nccwpck_require__(550), exports),
93
- __exportStar(__nccwpck_require__(800), exports),
94
- __exportStar(__nccwpck_require__(456), exports),
95
- __exportStar(__nccwpck_require__(219), exports),
96
- __exportStar(__nccwpck_require__(797), exports),
97
- __exportStar(__nccwpck_require__(822), exports),
98
- __exportStar(__nccwpck_require__(932), exports);
99
- var json_basic_encoding_decoding_extension_object_1 = __nccwpck_require__(822);
100
- Object.defineProperty(exports, "opcuaJsonEncodeExtensionObject", {
101
- enumerable: !0,
102
- get: function () {
103
- return json_basic_encoding_decoding_extension_object_1.opcuaJsonEncodeExtensionObject;
104
- },
105
- }),
106
- Object.defineProperty(exports, "opcuaJsonDecodeExtensionObject", {
107
- enumerable: !0,
108
- get: function () {
109
- return json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObject;
110
- },
111
- });
112
- },
113
- 932: (__unused_webpack_module, exports, __nccwpck_require__) => {
114
- Object.defineProperty(exports, "__esModule", { value: !0 }),
115
- (exports.bodyDecodeFunctor = exports.bodyEncodeFunctor = void 0);
116
- const node_opcua_variant_1 = __nccwpck_require__(298),
117
- json_basic_encoding_decoding_byte_string_1 = __nccwpck_require__(393),
118
- json_basic_encoding_decoding_data_value_1 = __nccwpck_require__(466),
119
- json_basic_encoding_decoding_date_time_1 = __nccwpck_require__(888),
120
- json_basic_encoding_decoding_extension_object_1 = __nccwpck_require__(822),
121
- json_basic_encoding_decoding_int64_1 = __nccwpck_require__(456),
122
- json_basic_encoding_decoding_localizedtext_1 = __nccwpck_require__(550),
123
- json_basic_encoding_decoding_nodeid_1 = __nccwpck_require__(219),
124
- json_basic_encoding_decoding_qualifiedname_1 = __nccwpck_require__(800),
125
- json_basic_encoding_decoding_statuscode_1 = __nccwpck_require__(797),
126
- json_basic_encoding_decoding_variant_1 = __nccwpck_require__(768);
127
- (exports.bodyEncodeFunctor = function (dataType) {
128
- switch (dataType) {
129
- case node_opcua_variant_1.DataType.Null:
130
- return () => null;
131
- case node_opcua_variant_1.DataType.Boolean:
132
- case node_opcua_variant_1.DataType.Byte:
133
- case node_opcua_variant_1.DataType.Double:
134
- case node_opcua_variant_1.DataType.Float:
135
- case node_opcua_variant_1.DataType.Guid:
136
- case node_opcua_variant_1.DataType.Int16:
137
- case node_opcua_variant_1.DataType.Int32:
138
- case node_opcua_variant_1.DataType.SByte:
139
- case node_opcua_variant_1.DataType.String:
140
- case node_opcua_variant_1.DataType.UInt16:
141
- case node_opcua_variant_1.DataType.UInt32:
142
- return (a) => a;
143
- case node_opcua_variant_1.DataType.ByteString:
144
- return json_basic_encoding_decoding_byte_string_1.opcuaJsonEncodeByteString;
145
- case node_opcua_variant_1.DataType.LocalizedText:
146
- return json_basic_encoding_decoding_localizedtext_1.opcuaJsonEncodeLocalizedText;
147
- case node_opcua_variant_1.DataType.NodeId:
148
- return json_basic_encoding_decoding_nodeid_1.opcuaJsonEncodeNodeId;
149
- case node_opcua_variant_1.DataType.QualifiedName:
150
- return json_basic_encoding_decoding_qualifiedname_1.opcuaJsonEncodeQualifiedName;
151
- case node_opcua_variant_1.DataType.StatusCode:
152
- return json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode;
153
- case node_opcua_variant_1.DataType.DateTime:
154
- return json_basic_encoding_decoding_date_time_1.opcuaJsonEncodeDateTime;
155
- case node_opcua_variant_1.DataType.ExtensionObject:
156
- return json_basic_encoding_decoding_extension_object_1.opcuaJsonEncodeExtensionObject;
157
- case node_opcua_variant_1.DataType.Variant:
158
- return json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant;
159
- case node_opcua_variant_1.DataType.Int64:
160
- return json_basic_encoding_decoding_int64_1.opcuaJsonEncodeInt64;
161
- case node_opcua_variant_1.DataType.UInt64:
162
- return json_basic_encoding_decoding_int64_1.opcuaJsonEncodeUInt64;
163
- case node_opcua_variant_1.DataType.DataValue:
164
- return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValue;
165
- case node_opcua_variant_1.DataType.DiagnosticInfo:
166
- case node_opcua_variant_1.DataType.ExpandedNodeId:
167
- case node_opcua_variant_1.DataType.XmlElement:
168
- throw new Error("Unsupported yet " + node_opcua_variant_1.DataType[dataType]);
169
- }
170
- }),
171
- (exports.bodyDecodeFunctor = function (dataType) {
172
- switch (dataType) {
173
- case node_opcua_variant_1.DataType.Null:
174
- return () => null;
175
- case node_opcua_variant_1.DataType.Boolean:
176
- case node_opcua_variant_1.DataType.Byte:
177
- case node_opcua_variant_1.DataType.Double:
178
- case node_opcua_variant_1.DataType.Float:
179
- case node_opcua_variant_1.DataType.Guid:
180
- case node_opcua_variant_1.DataType.Int16:
181
- case node_opcua_variant_1.DataType.Int32:
182
- case node_opcua_variant_1.DataType.SByte:
183
- case node_opcua_variant_1.DataType.String:
184
- case node_opcua_variant_1.DataType.UInt16:
185
- case node_opcua_variant_1.DataType.UInt32:
186
- return (a) => a;
187
- case node_opcua_variant_1.DataType.ByteString:
188
- return json_basic_encoding_decoding_byte_string_1.opcuaJsonDecodeByteString;
189
- case node_opcua_variant_1.DataType.LocalizedText:
190
- return json_basic_encoding_decoding_localizedtext_1.opcuaJsonDecodeLocalizedText;
191
- case node_opcua_variant_1.DataType.NodeId:
192
- return json_basic_encoding_decoding_nodeid_1.opcuaJsonDecodeNodeId;
193
- case node_opcua_variant_1.DataType.QualifiedName:
194
- return json_basic_encoding_decoding_qualifiedname_1.opcuaJsonDecodeQualifiedName;
195
- case node_opcua_variant_1.DataType.StatusCode:
196
- return json_basic_encoding_decoding_statuscode_1.opcuaJsonDecodeStatusCode;
197
- case node_opcua_variant_1.DataType.DateTime:
198
- return json_basic_encoding_decoding_date_time_1.opcuaJsonDecodeDateTime;
199
- case node_opcua_variant_1.DataType.ExtensionObject:
200
- return json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObject;
201
- case node_opcua_variant_1.DataType.Variant:
202
- return json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant;
203
- case node_opcua_variant_1.DataType.Int64:
204
- return json_basic_encoding_decoding_int64_1.opcuaJsonDecodeInt64;
205
- case node_opcua_variant_1.DataType.UInt64:
206
- return json_basic_encoding_decoding_int64_1.opcuaJsonDecodeUInt64;
207
- case node_opcua_variant_1.DataType.DataValue:
208
- return json_basic_encoding_decoding_data_value_1.opcuaJsonDecodeDataValue;
209
- case node_opcua_variant_1.DataType.DiagnosticInfo:
210
- case node_opcua_variant_1.DataType.ExpandedNodeId:
211
- case node_opcua_variant_1.DataType.XmlElement:
212
- throw new Error("Unsupported yet " + node_opcua_variant_1.DataType[dataType]);
213
- }
214
- });
215
- },
216
- 393: (__unused_webpack_module, exports) => {
217
- Object.defineProperty(exports, "__esModule", { value: !0 }),
218
- (exports.opcuaJsonDecodeByteString = exports.opcuaJsonEncodeByteString = void 0),
219
- (exports.opcuaJsonEncodeByteString = function (byteString, reversible = !1, namespaceArray) {
220
- return byteString ? byteString.toString("base64") : null;
221
- }),
222
- (exports.opcuaJsonDecodeByteString = function (pojo) {
223
- return pojo ? Buffer.from(pojo, "base64") : null;
224
- });
225
- },
226
- 466: (__unused_webpack_module, exports, __nccwpck_require__) => {
227
- Object.defineProperty(exports, "__esModule", { value: !0 }),
228
- (exports.opcuaJsonDecodeDataValue = exports.opcuaJsonEncodeDataValue = exports.opcuaJsonEncodeDataValueMQTT = void 0);
229
- const node_opcua_data_value_1 = __nccwpck_require__(146),
230
- node_opcua_variant_1 = __nccwpck_require__(298),
231
- node_opcua_types_1 = __nccwpck_require__(196),
232
- json_basic_encoding_decoding_variant_1 = __nccwpck_require__(768),
233
- json_basic_encoding_decoding_statuscode_1 = __nccwpck_require__(797);
234
- (exports.opcuaJsonEncodeDataValueMQTT = function (dataValue, mask) {
235
- if (mask === node_opcua_types_1.DataSetFieldContentMask.None)
236
- return (0, json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value, !0);
237
- const pojoVariant = (0, json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value, !1);
238
- if (mask & node_opcua_types_1.DataSetFieldContentMask.RawData) return pojoVariant;
239
- const pojo = { Value: pojoVariant };
240
- return (
241
- mask & node_opcua_types_1.DataSetFieldContentMask.ServerPicoSeconds &&
242
- dataValue.serverPicoseconds &&
243
- (pojo.ServerPicoseconds = dataValue.serverPicoseconds),
244
- mask & node_opcua_types_1.DataSetFieldContentMask.SourcePicoSeconds &&
245
- dataValue.sourcePicoseconds &&
246
- (pojo.SourcePicoseconds = dataValue.sourcePicoseconds),
247
- mask & node_opcua_types_1.DataSetFieldContentMask.ServerTimestamp &&
248
- dataValue.serverTimestamp &&
249
- (pojo.ServerTimestamp = dataValue.serverTimestamp),
250
- mask & node_opcua_types_1.DataSetFieldContentMask.SourceTimestamp &&
251
- dataValue.sourceTimestamp &&
252
- (pojo.SourceTimestamp = dataValue.sourceTimestamp),
253
- mask & node_opcua_types_1.DataSetFieldContentMask.StatusCode &&
254
- 0 !== dataValue.statusCode.value &&
255
- (pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode)(
256
- dataValue.statusCode,
257
- !1
258
- )),
259
- pojo
260
- );
261
- }),
262
- (exports.opcuaJsonEncodeDataValue = function (dataValue, reversible) {
263
- const pojo = { Value: (0, json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value, reversible) };
264
- return (
265
- dataValue.serverPicoseconds && (pojo.ServerPicoseconds = dataValue.serverPicoseconds),
266
- dataValue.sourcePicoseconds && (pojo.SourcePicoseconds = dataValue.sourcePicoseconds),
267
- dataValue.serverTimestamp && (pojo.ServerTimestamp = dataValue.serverTimestamp),
268
- dataValue.sourceTimestamp && (pojo.SourceTimestamp = dataValue.sourceTimestamp),
269
- 0 !== dataValue.statusCode.value &&
270
- (pojo.StatusCode = (0, json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode)(
271
- dataValue.statusCode,
272
- reversible
273
- )),
274
- pojo
275
- );
276
- }),
277
- (exports.opcuaJsonDecodeDataValue = function (pojo, builder) {
278
- if (!pojo) return new node_opcua_data_value_1.DataValue({ value: { dataType: node_opcua_variant_1.DataType.Null } });
279
- const dataValueOpt = {};
280
- return (
281
- pojo.ServerPicoseconds && (dataValueOpt.serverPicoseconds = pojo.ServerPicoseconds),
282
- pojo.SourcePicoseconds && (dataValueOpt.sourcePicoseconds = pojo.SourcePicoseconds),
283
- pojo.ServerTimestamp && (dataValueOpt.serverTimestamp = new Date(pojo.ServerTimestamp)),
284
- pojo.SourceTimestamp && (dataValueOpt.sourceTimestamp = new Date(pojo.SourceTimestamp)),
285
- pojo.StatusCode &&
286
- (dataValueOpt.statusCode = (0, json_basic_encoding_decoding_statuscode_1.opcuaJsonDecodeStatusCode)(
287
- pojo.StatusCode
288
- )),
289
- pojo.Value &&
290
- (dataValueOpt.value = (0, json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant)(pojo.Value, builder)),
291
- new node_opcua_data_value_1.DataValue(dataValueOpt)
292
- );
293
- });
294
- },
295
- 888: (__unused_webpack_module, exports) => {
296
- Object.defineProperty(exports, "__esModule", { value: !0 }),
297
- (exports.opcuaJsonDecodeDateTime = exports.opcuaJsonEncodeDateTime = void 0),
298
- (exports.opcuaJsonEncodeDateTime = function (date, reversible = !1, namespaceArray) {
299
- return date;
300
- }),
301
- (exports.opcuaJsonDecodeDateTime = function (pojo) {
302
- return "string" == typeof pojo ? new Date(pojo) : pojo;
303
- });
304
- },
305
- 822: (__unused_webpack_module, exports, __nccwpck_require__) => {
306
- Object.defineProperty(exports, "__esModule", { value: !0 }),
307
- (exports.opcuaJsonDecodeExtensionObject =
308
- exports.opcuaJsonEncodeExtensionObject =
309
- exports.opcuaJsonEncodeExtensionObjectBody =
310
- exports.opcuaJsonDecodeExtensionObjectBody =
311
- exports.makeBody =
312
- void 0);
313
- const node_opcua_variant_1 = __nccwpck_require__(298),
314
- node_opcua_numeric_range_1 = __nccwpck_require__(138),
315
- node_opcua_debug_1 = __nccwpck_require__(647),
316
- node_opcua_factory_1 = __nccwpck_require__(745),
317
- json_basic_encoding_body_functor_1 = __nccwpck_require__(932),
318
- json_basic_encoding_decoding_nodeid_1 = __nccwpck_require__(219),
319
- errorLog = (0, node_opcua_debug_1.make_errorLog)("JSON");
320
- function originalName(name) {
321
- return name[0].toUpperCase() + name.slice(1);
322
- }
323
- const g_DataType = node_opcua_variant_1.DataType;
324
- function toDataType(field) {
325
- let dataType = g_DataType[field.fieldType];
326
- return (
327
- void 0 === dataType &&
328
- (field.schema instanceof node_opcua_factory_1.BasicTypeSchema
329
- ? (dataType = g_DataType[field.schema.subType || field.schema.name])
330
- : ((dataType = g_DataType[field.schema.name]), dataType || g_DataType[field.schema.subType])),
331
- dataType
332
- );
333
- }
334
- function findEncoder(field) {
335
- const dataType = toDataType(field);
336
- if (!dataType) {
337
- if ("NumericRange" === field.fieldType) return (numericRange) => numericRange.toString();
338
- if ("UAString" === field.fieldType) return (str, reversible, namespaceArray) => str;
339
- }
340
- const encoderFunc = (() => {
341
- switch (field.category) {
342
- case "complex":
343
- return "ExtensionObject" === field.fieldType ? opcuaJsonEncodeExtensionObject : opcuaJsonEncodeExtensionObjectBody;
344
- case "basic":
345
- return (0, json_basic_encoding_body_functor_1.bodyEncodeFunctor)(dataType);
346
- default:
347
- return (a) => a;
348
- }
349
- })();
350
- return (
351
- encoderFunc ||
352
- (errorLog("findEncoder: Cannot find encoderFunc for ", node_opcua_variant_1.DataType[dataType], field), null)
353
- );
354
- }
355
- function findDecoder(field) {
356
- const dataType = toDataType(field);
357
- if (!dataType) {
358
- if ("NumericRange" === field.fieldType)
359
- return (numericRange) => new node_opcua_numeric_range_1.NumericRange(numericRange);
360
- if ("UAString" === field.fieldType) return (str) => str;
361
- }
362
- const decoderFunc = (() => {
363
- switch (field.category) {
364
- case "complex":
365
- if ("ExtensionObject" === field.fieldType) return opcuaJsonDecodeExtensionObject;
366
- if (field.schema) return opcuaJsonDecodeExtensionObjectBody.bind(null, field.schema);
367
- {
368
- const schema = (0, node_opcua_factory_1.getStandardDataTypeFactory)().getStructuredTypeSchema(field.fieldType);
369
- return opcuaJsonDecodeExtensionObjectBody.bind(null, schema);
370
- }
371
- case "basic":
372
- return (0, json_basic_encoding_body_functor_1.bodyDecodeFunctor)(dataType);
373
- default:
374
- return (a) => a;
375
- }
376
- })();
377
- return (
378
- decoderFunc ||
379
- (errorLog("findEncoder: Cannot find decoderFunc for ", node_opcua_variant_1.DataType[dataType], field), null)
380
- );
381
- }
382
- function makeBody(extensionObject, reversible = !1) {
383
- const pojo = {};
384
- for (const field of extensionObject.schema.fields) {
385
- const name = originalName(field.name),
386
- value = extensionObject[field.name],
387
- encoder = findEncoder(field);
388
- if (encoder)
389
- if (field.isArray)
390
- if (value)
391
- if ("object" == typeof value && value && 0 === value.length) pojo[name] = [];
392
- else {
393
- const valueAsArray = value;
394
- pojo[name] = valueAsArray.map((a) => (a ? encoder(a, reversible) : null));
395
- }
396
- else;
397
- else void 0 !== value && (pojo[name] = encoder(value, reversible));
398
- else errorLog("cannot find encoder for field", field);
399
- }
400
- return pojo;
401
- }
402
- function adaptBody(body, schema, builder) {
403
- const pojo = {};
404
- for (const field of schema.fields) {
405
- const value = body[originalName(field.name)];
406
- if (void 0 === value) continue;
407
- const decoder = findDecoder(field);
408
- if (decoder)
409
- if (field.isArray)
410
- if (value)
411
- if ("object" == typeof value && value && 0 === value.length) pojo[field.name] = [];
412
- else {
413
- const valueAsArray = value;
414
- pojo[field.name] = valueAsArray.map((a) => (a ? decoder(a, builder) : void 0));
415
- }
416
- else pojo[field.name] = [];
417
- else null != value ? (pojo[field.name] = decoder(value, builder)) : null === value && (pojo[field.name] = null);
418
- else errorLog("Cannot find decoder for", field);
419
- }
420
- return pojo;
421
- }
422
- function opcuaJsonDecodeExtensionObjectBody(schema, body, builder) {
423
- return adaptBody(body, schema, builder);
424
- }
425
- function opcuaJsonEncodeExtensionObjectBody(extensionObject, reversible = !1, namespaceArray) {
426
- return extensionObject ? makeBody(extensionObject, reversible) : null;
427
- }
428
- function opcuaJsonEncodeExtensionObject(extensionObject, reversible = !1, namespaceArray) {
429
- if (!extensionObject) return null;
430
- const body = opcuaJsonEncodeExtensionObjectBody(extensionObject, reversible);
431
- return reversible
432
- ? {
433
- TypeId: (0, json_basic_encoding_decoding_nodeid_1.opcuaJsonEncodeNodeId)(extensionObject.schema.dataTypeNodeId),
434
- Body: body,
435
- }
436
- : body;
437
- }
438
- function opcuaJsonDecodeExtensionObject(_pojo, builder) {
439
- if (!_pojo) return null;
440
- const typeId = (0, json_basic_encoding_decoding_nodeid_1.opcuaJsonDecodeNodeId)(_pojo.TypeId),
441
- body = _pojo.Body;
442
- if (0 === typeId.namespace) {
443
- const Constructor = (0, node_opcua_factory_1.getStandardDataTypeFactory)().findConstructorForDataType(typeId);
444
- return new Constructor(adaptBody(body, Constructor.schema));
445
- }
446
- {
447
- if (!builder) throw new Error("Expecting a extension object builder for non-0 namespace extension objects");
448
- const Constructor = builder.getExtensionObjectConstructor(typeId);
449
- return new Constructor(adaptBody(body, Constructor.schema, builder));
450
- }
451
- }
452
- (exports.makeBody = makeBody),
453
- (exports.opcuaJsonDecodeExtensionObjectBody = opcuaJsonDecodeExtensionObjectBody),
454
- (exports.opcuaJsonEncodeExtensionObjectBody = opcuaJsonEncodeExtensionObjectBody),
455
- (exports.opcuaJsonEncodeExtensionObject = opcuaJsonEncodeExtensionObject),
456
- (exports.opcuaJsonDecodeExtensionObject = opcuaJsonDecodeExtensionObject);
457
- },
458
- 456: (__unused_webpack_module, exports) => {
459
- Object.defineProperty(exports, "__esModule", { value: !0 }),
460
- (exports.opcuaJsonDecodeUInt64 =
461
- exports.opcuaJsonDecodeInt64 =
462
- exports.opcuaJsonEncodeUInt64 =
463
- exports.opcuaJsonEncodeInt64 =
464
- void 0);
465
- const signMask = 1n << 31n,
466
- shiftHigh = 1n << 32n;
467
- (exports.opcuaJsonEncodeInt64 = function (value, reversible = !1) {
468
- const h = BigInt(value[0]),
469
- l = BigInt(value[1]);
470
- if ((h & signMask) === signMask) {
471
- return ((h & ~signMask) * shiftHigh + l - 0x8000000000000000n).toString();
472
- }
473
- return (h * shiftHigh + l).toString();
474
- }),
475
- (exports.opcuaJsonEncodeUInt64 = function (value, reversible = !1) {
476
- const h = BigInt(value[0]),
477
- l = BigInt(value[1]);
478
- return (h * shiftHigh + l).toString();
479
- }),
480
- (exports.opcuaJsonDecodeInt64 = function (value) {
481
- const r = BigInt(value);
482
- if (r >= 0) return [Number(r / shiftHigh), Number(r % shiftHigh)];
483
- const v = 0x8000000000000000n + r;
484
- return [Number((v / shiftHigh) | signMask), Number(v % shiftHigh)];
485
- }),
486
- (exports.opcuaJsonDecodeUInt64 = function (value) {
487
- const r = BigInt(value);
488
- return [Number(r / shiftHigh), Number(r % shiftHigh)];
489
- });
490
- },
491
- 550: (__unused_webpack_module, exports, __nccwpck_require__) => {
492
- Object.defineProperty(exports, "__esModule", { value: !0 }),
493
- (exports.opcuaJsonDecodeLocalizedText = exports.opcuaJsonEncodeLocalizedText = void 0);
494
- const node_opcua_data_model_1 = __nccwpck_require__(626);
495
- (exports.opcuaJsonEncodeLocalizedText = function (localizedText, reversible = !1, namespaceArray) {
496
- if (!localizedText) return null;
497
- if (!reversible) return localizedText.text || null;
498
- const pojo = { Text: localizedText.text || null };
499
- return localizedText.locale && (pojo.Locale = localizedText.locale), pojo;
500
- }),
501
- (exports.opcuaJsonDecodeLocalizedText = function (pojo) {
502
- return pojo
503
- ? "string" == typeof pojo
504
- ? new node_opcua_data_model_1.LocalizedText({ text: pojo })
505
- : new node_opcua_data_model_1.LocalizedText({ text: pojo.Text, locale: pojo.Locale })
506
- : new node_opcua_data_model_1.LocalizedText();
507
- });
508
- },
509
- 219: (__unused_webpack_module, exports, __nccwpck_require__) => {
510
- Object.defineProperty(exports, "__esModule", { value: !0 }),
511
- (exports.opcuaJsonDecodeNodeId = exports.opcuaJsonEncodeNodeId = void 0);
512
- const node_opcua_nodeid_1 = __nccwpck_require__(791);
513
- (exports.opcuaJsonEncodeNodeId = function (value, reversible = !1, namespaceArray) {
514
- const IdType = (() => {
515
- switch (value.identifierType) {
516
- case node_opcua_nodeid_1.NodeIdType.NUMERIC:
517
- return 0;
518
- case node_opcua_nodeid_1.NodeIdType.STRING:
519
- return 1;
520
- case node_opcua_nodeid_1.NodeIdType.GUID:
521
- return 2;
522
- default:
523
- return 3;
524
- }
525
- })(),
526
- pojo = {
527
- Id: (() => {
528
- switch (value.identifierType) {
529
- case node_opcua_nodeid_1.NodeIdType.NUMERIC:
530
- case node_opcua_nodeid_1.NodeIdType.STRING:
531
- case node_opcua_nodeid_1.NodeIdType.GUID:
532
- return value.value;
533
- case node_opcua_nodeid_1.NodeIdType.BYTESTRING:
534
- return value.value.toString("base64");
535
- }
536
- })(),
537
- };
538
- return (
539
- 0 !== IdType && (pojo.IdType = IdType),
540
- 0 === value.namespace
541
- ? pojo
542
- : 1 === value.namespace || reversible || !namespaceArray
543
- ? ((pojo.Namespace = value.namespace), pojo)
544
- : ((pojo.Namespace = namespaceArray[value.namespace]), pojo)
545
- );
546
- }),
547
- (exports.opcuaJsonDecodeNodeId = function (pojo, namespaceArray) {
548
- const identifierType = (() => {
549
- if (!pojo.IdType) return node_opcua_nodeid_1.NodeIdType.NUMERIC;
550
- switch (pojo.IdType) {
551
- case 2:
552
- return node_opcua_nodeid_1.NodeIdType.GUID;
553
- case 3:
554
- return node_opcua_nodeid_1.NodeIdType.BYTESTRING;
555
- default:
556
- return node_opcua_nodeid_1.NodeIdType.STRING;
557
- }
558
- })(),
559
- namespace = (() => {
560
- if (!pojo.Namespace) return 0;
561
- if ("number" == typeof pojo.Namespace) return pojo.Namespace;
562
- if (!namespaceArray) return 65535;
563
- const index = namespaceArray.indexOf(pojo.Namespace);
564
- return index < 0 ? 65535 : index;
565
- })(),
566
- value = (() => {
567
- switch (identifierType) {
568
- case node_opcua_nodeid_1.NodeIdType.NUMERIC:
569
- return "string" == typeof pojo.Id ? parseInt(pojo.Id, 10) : pojo.Id;
570
- case node_opcua_nodeid_1.NodeIdType.BYTESTRING:
571
- return Buffer.from(pojo.Id, "base64");
572
- case node_opcua_nodeid_1.NodeIdType.GUID:
573
- case node_opcua_nodeid_1.NodeIdType.STRING:
574
- default:
575
- return pojo.Id;
576
- }
577
- })();
578
- return new node_opcua_nodeid_1.NodeId(identifierType, value, namespace);
579
- });
580
- },
581
- 800: (__unused_webpack_module, exports, __nccwpck_require__) => {
582
- Object.defineProperty(exports, "__esModule", { value: !0 }),
583
- (exports.opcuaJsonDecodeQualifiedName = exports.opcuaJsonEncodeQualifiedName = void 0);
584
- const node_opcua_data_model_1 = __nccwpck_require__(626);
585
- (exports.opcuaJsonEncodeQualifiedName = function (qualifiedName, reversible = !1, namespaceArray) {
586
- const pojo = { Name: qualifiedName.name || "" };
587
- return 0 === qualifiedName.namespaceIndex
588
- ? pojo
589
- : reversible || !namespaceArray || 1 === qualifiedName.namespaceIndex
590
- ? ((pojo.Uri = qualifiedName.namespaceIndex), pojo)
591
- : ((pojo.Uri = namespaceArray[qualifiedName.namespaceIndex]), pojo);
592
- }),
593
- (exports.opcuaJsonDecodeQualifiedName = function (pojo) {
594
- if (!pojo) return new node_opcua_data_model_1.QualifiedName();
595
- if ("string" == typeof pojo) return new node_opcua_data_model_1.QualifiedName({ name: pojo });
596
- const namespaceIndex = pojo.Uri && "number" == typeof pojo.Uri ? pojo.Uri : 0;
597
- return new node_opcua_data_model_1.QualifiedName({ name: pojo.Name, namespaceIndex: namespaceIndex });
598
- });
599
- },
600
- 797: (__unused_webpack_module, exports, __nccwpck_require__) => {
601
- Object.defineProperty(exports, "__esModule", { value: !0 }),
602
- (exports.opcuaJsonDecodeStatusCode = exports.opcuaJsonEncodeStatusCode = void 0);
603
- const node_opcua_status_code_1 = __nccwpck_require__(912);
604
- (exports.opcuaJsonEncodeStatusCode = function (statusCode, reversible = !1) {
605
- if (reversible) return statusCode.value;
606
- if (0 === statusCode.value) return;
607
- const pojo = {};
608
- return (pojo.Code = statusCode.value), (pojo.Symbol = statusCode.name), pojo;
609
- }),
610
- (exports.opcuaJsonDecodeStatusCode = function (pojo) {
611
- return pojo
612
- ? "number" == typeof pojo
613
- ? (0, node_opcua_status_code_1.coerceStatusCode)(pojo)
614
- : (pojo.Code, (0, node_opcua_status_code_1.coerceStatusCode)(pojo.Code))
615
- : node_opcua_status_code_1.StatusCodes.Good;
616
- });
617
- },
618
- 768: (__unused_webpack_module, exports, __nccwpck_require__) => {
619
- Object.defineProperty(exports, "__esModule", { value: !0 }),
620
- (exports.opcuaJsonDecodeVariant = exports.opcuaJsonEncodeVariant = void 0);
621
- const node_opcua_variant_1 = __nccwpck_require__(298),
622
- json_basic_encoding_body_functor_1 = __nccwpck_require__(932);
623
- function body(variant, reversible, namespaceArray) {
624
- const f = (0, json_basic_encoding_body_functor_1.bodyEncodeFunctor)(variant.dataType);
625
- if (variant.arrayType === node_opcua_variant_1.VariantArrayType.Scalar)
626
- return f(variant.value, reversible, namespaceArray);
627
- {
628
- const array = [];
629
- for (const e of variant.value) array.push(f(e, reversible, namespaceArray));
630
- return array;
631
- }
632
- }
633
- (exports.opcuaJsonEncodeVariant = function (variant, reversible = !1, namespaceArray) {
634
- if (variant.dataType === node_opcua_variant_1.DataType.Null) return null;
635
- if (!reversible && variant.arrayType !== node_opcua_variant_1.VariantArrayType.Matrix)
636
- return body(variant, reversible, namespaceArray);
637
- const pojo = { Type: variant.dataType, Body: body(variant, reversible, namespaceArray) };
638
- return (
639
- variant.arrayType === node_opcua_variant_1.VariantArrayType.Matrix &&
640
- variant.dimensions &&
641
- (pojo.Dimensions = [...variant.dimensions]),
642
- pojo
643
- );
644
- }),
645
- (exports.opcuaJsonDecodeVariant = function (pojo, builder) {
646
- if (!pojo) return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.Null });
647
- const dataType = pojo.Type,
648
- f = (0, json_basic_encoding_body_functor_1.bodyDecodeFunctor)(dataType);
649
- if (Array.isArray(pojo.Body)) {
650
- const value = pojo.Body.map((a) => f(a, builder));
651
- return pojo.Dimensions
652
- ? new node_opcua_variant_1.Variant({
653
- arrayType: node_opcua_variant_1.VariantArrayType.Matrix,
654
- dimensions: pojo.Dimensions,
655
- dataType: dataType,
656
- value: value,
657
- })
658
- : new node_opcua_variant_1.Variant({
659
- arrayType: node_opcua_variant_1.VariantArrayType.Array,
660
- dataType: dataType,
661
- value: value,
662
- });
663
- }
664
- return new node_opcua_variant_1.Variant({
665
- dataType: dataType,
666
- arrayType: node_opcua_variant_1.VariantArrayType.Scalar,
667
- value: f(pojo.Body, builder),
668
- });
669
- });
670
- },
671
- 626: (module) => {
672
- module.exports = require("node-opcua-data-model");
673
- },
674
- 146: (module) => {
675
- module.exports = require("node-opcua-data-value");
676
- },
677
- 647: (module) => {
678
- module.exports = require("node-opcua-debug");
679
- },
680
- 745: (module) => {
681
- module.exports = require("node-opcua-factory");
682
- },
683
- 791: (module) => {
684
- module.exports = require("node-opcua-nodeid");
685
- },
686
- 138: (module) => {
687
- module.exports = require("node-opcua-numeric-range");
688
- },
689
- 912: (module) => {
690
- module.exports = require("node-opcua-status-code");
691
- },
692
- 196: (module) => {
693
- module.exports = require("node-opcua-types");
694
- },
695
- 298: (module) => {
696
- module.exports = require("node-opcua-variant");
697
- },
698
- },
699
- __webpack_module_cache__ = {};
700
- function __nccwpck_require__(moduleId) {
701
- var cachedModule = __webpack_module_cache__[moduleId];
702
- if (void 0 !== cachedModule) return cachedModule.exports;
703
- var module = (__webpack_module_cache__[moduleId] = { exports: {} }),
704
- threw = !0;
705
- try {
706
- __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__), (threw = !1);
707
- } finally {
708
- threw && delete __webpack_module_cache__[moduleId];
709
- }
710
- return module.exports;
711
- }
712
- __nccwpck_require__.ab = __dirname + "/";
713
- var __webpack_exports__ = __nccwpck_require__(629);
714
- module.exports = __webpack_exports__;
715
- })();
1
+ (()=>{"use strict";var __webpack_modules__={538:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.decodeOPCUA_JSON=exports.decodeOPCUA_JSONOld=void 0;const node_opcua_nodeid_1=__nccwpck_require__(597),node_opcua_factory_1=__nccwpck_require__(217),json_basic_encoding_decoding_extension_object_1=__nccwpck_require__(611);exports.decodeOPCUA_JSONOld=function(dataType,pojo){const Constructor=(0,node_opcua_factory_1.getStandardDataTypeFactory)().findConstructorForDataType((0,node_opcua_nodeid_1.resolveNodeId)(dataType));return Constructor?new Constructor((0,json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObjectBody)(Constructor.schema,pojo)):null},exports.decodeOPCUA_JSON=function(Constructor,pojo){return new Constructor((0,json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObjectBody)(Constructor.schema,pojo))}},552:function(__unused_webpack_module,exports,__nccwpck_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)"default"===p||Object.prototype.hasOwnProperty.call(exports,p)||__createBinding(exports,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeExtensionObject=exports.opcuaJsonEncodeExtensionObject=exports.opcuaJsonEncodeDataValueMQTT=exports.opcuaJsonDecodeDataValue=exports.opcuaJsonEncodeDataValue=exports.opcuaJsonDecodeVariant=exports.opcuaJsonEncodeVariant=void 0;var json_basic_encoding_decoding_variant_1=__nccwpck_require__(155);Object.defineProperty(exports,"opcuaJsonEncodeVariant",{enumerable:!0,get:function(){return json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant}}),Object.defineProperty(exports,"opcuaJsonDecodeVariant",{enumerable:!0,get:function(){return json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant}});var json_basic_encoding_decoding_data_value_1=__nccwpck_require__(831);Object.defineProperty(exports,"opcuaJsonEncodeDataValue",{enumerable:!0,get:function(){return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValue}}),Object.defineProperty(exports,"opcuaJsonDecodeDataValue",{enumerable:!0,get:function(){return json_basic_encoding_decoding_data_value_1.opcuaJsonDecodeDataValue}}),Object.defineProperty(exports,"opcuaJsonEncodeDataValueMQTT",{enumerable:!0,get:function(){return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValueMQTT}}),__exportStar(__nccwpck_require__(538),exports),__exportStar(__nccwpck_require__(452),exports),__exportStar(__nccwpck_require__(214),exports),__exportStar(__nccwpck_require__(686),exports),__exportStar(__nccwpck_require__(522),exports),__exportStar(__nccwpck_require__(548),exports),__exportStar(__nccwpck_require__(87),exports),__exportStar(__nccwpck_require__(452),exports),__exportStar(__nccwpck_require__(611),exports),__exportStar(__nccwpck_require__(562),exports);var json_basic_encoding_decoding_extension_object_1=__nccwpck_require__(611);Object.defineProperty(exports,"opcuaJsonEncodeExtensionObject",{enumerable:!0,get:function(){return json_basic_encoding_decoding_extension_object_1.opcuaJsonEncodeExtensionObject}}),Object.defineProperty(exports,"opcuaJsonDecodeExtensionObject",{enumerable:!0,get:function(){return json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObject}})},562:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.bodyDecodeFunctor=exports.bodyEncodeFunctor=void 0;const node_opcua_variant_1=__nccwpck_require__(567),json_basic_encoding_decoding_byte_string_1=__nccwpck_require__(214),json_basic_encoding_decoding_data_value_1=__nccwpck_require__(831),json_basic_encoding_decoding_date_time_1=__nccwpck_require__(227),json_basic_encoding_decoding_extension_object_1=__nccwpck_require__(611),json_basic_encoding_decoding_int64_1=__nccwpck_require__(548),json_basic_encoding_decoding_localizedtext_1=__nccwpck_require__(686),json_basic_encoding_decoding_nodeid_1=__nccwpck_require__(87),json_basic_encoding_decoding_qualifiedname_1=__nccwpck_require__(522),json_basic_encoding_decoding_statuscode_1=__nccwpck_require__(452),json_basic_encoding_decoding_variant_1=__nccwpck_require__(155);exports.bodyEncodeFunctor=function(dataType){switch(dataType){case node_opcua_variant_1.DataType.Null:return()=>null;case node_opcua_variant_1.DataType.Boolean:case node_opcua_variant_1.DataType.Byte:case node_opcua_variant_1.DataType.Double:case node_opcua_variant_1.DataType.Float:case node_opcua_variant_1.DataType.Guid:case node_opcua_variant_1.DataType.Int16:case node_opcua_variant_1.DataType.Int32:case node_opcua_variant_1.DataType.SByte:case node_opcua_variant_1.DataType.String:case node_opcua_variant_1.DataType.UInt16:case node_opcua_variant_1.DataType.UInt32:return a=>a;case node_opcua_variant_1.DataType.ByteString:return json_basic_encoding_decoding_byte_string_1.opcuaJsonEncodeByteString;case node_opcua_variant_1.DataType.LocalizedText:return json_basic_encoding_decoding_localizedtext_1.opcuaJsonEncodeLocalizedText;case node_opcua_variant_1.DataType.NodeId:return json_basic_encoding_decoding_nodeid_1.opcuaJsonEncodeNodeId;case node_opcua_variant_1.DataType.QualifiedName:return json_basic_encoding_decoding_qualifiedname_1.opcuaJsonEncodeQualifiedName;case node_opcua_variant_1.DataType.StatusCode:return json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode;case node_opcua_variant_1.DataType.DateTime:return json_basic_encoding_decoding_date_time_1.opcuaJsonEncodeDateTime;case node_opcua_variant_1.DataType.ExtensionObject:return json_basic_encoding_decoding_extension_object_1.opcuaJsonEncodeExtensionObject;case node_opcua_variant_1.DataType.Variant:return json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant;case node_opcua_variant_1.DataType.Int64:return json_basic_encoding_decoding_int64_1.opcuaJsonEncodeInt64;case node_opcua_variant_1.DataType.UInt64:return json_basic_encoding_decoding_int64_1.opcuaJsonEncodeUInt64;case node_opcua_variant_1.DataType.DataValue:return json_basic_encoding_decoding_data_value_1.opcuaJsonEncodeDataValue;case node_opcua_variant_1.DataType.DiagnosticInfo:case node_opcua_variant_1.DataType.ExpandedNodeId:case node_opcua_variant_1.DataType.XmlElement:throw new Error("Unsupported yet "+node_opcua_variant_1.DataType[dataType])}},exports.bodyDecodeFunctor=function(dataType){switch(dataType){case node_opcua_variant_1.DataType.Null:return()=>null;case node_opcua_variant_1.DataType.Boolean:case node_opcua_variant_1.DataType.Byte:case node_opcua_variant_1.DataType.Double:case node_opcua_variant_1.DataType.Float:case node_opcua_variant_1.DataType.Guid:case node_opcua_variant_1.DataType.Int16:case node_opcua_variant_1.DataType.Int32:case node_opcua_variant_1.DataType.SByte:case node_opcua_variant_1.DataType.String:case node_opcua_variant_1.DataType.UInt16:case node_opcua_variant_1.DataType.UInt32:return a=>a;case node_opcua_variant_1.DataType.ByteString:return json_basic_encoding_decoding_byte_string_1.opcuaJsonDecodeByteString;case node_opcua_variant_1.DataType.LocalizedText:return json_basic_encoding_decoding_localizedtext_1.opcuaJsonDecodeLocalizedText;case node_opcua_variant_1.DataType.NodeId:return json_basic_encoding_decoding_nodeid_1.opcuaJsonDecodeNodeId;case node_opcua_variant_1.DataType.QualifiedName:return json_basic_encoding_decoding_qualifiedname_1.opcuaJsonDecodeQualifiedName;case node_opcua_variant_1.DataType.StatusCode:return json_basic_encoding_decoding_statuscode_1.opcuaJsonDecodeStatusCode;case node_opcua_variant_1.DataType.DateTime:return json_basic_encoding_decoding_date_time_1.opcuaJsonDecodeDateTime;case node_opcua_variant_1.DataType.ExtensionObject:return json_basic_encoding_decoding_extension_object_1.opcuaJsonDecodeExtensionObject;case node_opcua_variant_1.DataType.Variant:return json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant;case node_opcua_variant_1.DataType.Int64:return json_basic_encoding_decoding_int64_1.opcuaJsonDecodeInt64;case node_opcua_variant_1.DataType.UInt64:return json_basic_encoding_decoding_int64_1.opcuaJsonDecodeUInt64;case node_opcua_variant_1.DataType.DataValue:return json_basic_encoding_decoding_data_value_1.opcuaJsonDecodeDataValue;case node_opcua_variant_1.DataType.DiagnosticInfo:case node_opcua_variant_1.DataType.ExpandedNodeId:case node_opcua_variant_1.DataType.XmlElement:throw new Error("Unsupported yet "+node_opcua_variant_1.DataType[dataType])}}},214:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeByteString=exports.opcuaJsonEncodeByteString=void 0,exports.opcuaJsonEncodeByteString=function(byteString,reversible=!1,namespaceArray){return byteString?byteString.toString("base64"):null},exports.opcuaJsonDecodeByteString=function(pojo){return pojo?Buffer.from(pojo,"base64"):null}},831:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeDataValue=exports.opcuaJsonEncodeDataValue=exports.opcuaJsonEncodeDataValueMQTT=void 0;const node_opcua_data_value_1=__nccwpck_require__(169),node_opcua_variant_1=__nccwpck_require__(567),node_opcua_types_1=__nccwpck_require__(67),json_basic_encoding_decoding_variant_1=__nccwpck_require__(155),json_basic_encoding_decoding_statuscode_1=__nccwpck_require__(452);exports.opcuaJsonEncodeDataValueMQTT=function(dataValue,mask){if(mask===node_opcua_types_1.DataSetFieldContentMask.None)return(0,json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value,!0);const pojoVariant=(0,json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value,!1);if(mask&node_opcua_types_1.DataSetFieldContentMask.RawData)return pojoVariant;const pojo={Value:pojoVariant};return mask&node_opcua_types_1.DataSetFieldContentMask.ServerPicoSeconds&&dataValue.serverPicoseconds&&(pojo.ServerPicoseconds=dataValue.serverPicoseconds),mask&node_opcua_types_1.DataSetFieldContentMask.SourcePicoSeconds&&dataValue.sourcePicoseconds&&(pojo.SourcePicoseconds=dataValue.sourcePicoseconds),mask&node_opcua_types_1.DataSetFieldContentMask.ServerTimestamp&&dataValue.serverTimestamp&&(pojo.ServerTimestamp=dataValue.serverTimestamp),mask&node_opcua_types_1.DataSetFieldContentMask.SourceTimestamp&&dataValue.sourceTimestamp&&(pojo.SourceTimestamp=dataValue.sourceTimestamp),mask&node_opcua_types_1.DataSetFieldContentMask.StatusCode&&0!==dataValue.statusCode.value&&(pojo.StatusCode=(0,json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode)(dataValue.statusCode,!1)),pojo},exports.opcuaJsonEncodeDataValue=function(dataValue,reversible){const pojo={Value:(0,json_basic_encoding_decoding_variant_1.opcuaJsonEncodeVariant)(dataValue.value,reversible)};return dataValue.serverPicoseconds&&(pojo.ServerPicoseconds=dataValue.serverPicoseconds),dataValue.sourcePicoseconds&&(pojo.SourcePicoseconds=dataValue.sourcePicoseconds),dataValue.serverTimestamp&&(pojo.ServerTimestamp=dataValue.serverTimestamp),dataValue.sourceTimestamp&&(pojo.SourceTimestamp=dataValue.sourceTimestamp),0!==dataValue.statusCode.value&&(pojo.StatusCode=(0,json_basic_encoding_decoding_statuscode_1.opcuaJsonEncodeStatusCode)(dataValue.statusCode,reversible)),pojo},exports.opcuaJsonDecodeDataValue=function(pojo,builder){if(!pojo)return new node_opcua_data_value_1.DataValue({value:{dataType:node_opcua_variant_1.DataType.Null}});const dataValueOpt={};return pojo.ServerPicoseconds&&(dataValueOpt.serverPicoseconds=pojo.ServerPicoseconds),pojo.SourcePicoseconds&&(dataValueOpt.sourcePicoseconds=pojo.SourcePicoseconds),pojo.ServerTimestamp&&(dataValueOpt.serverTimestamp=new Date(pojo.ServerTimestamp)),pojo.SourceTimestamp&&(dataValueOpt.sourceTimestamp=new Date(pojo.SourceTimestamp)),pojo.StatusCode&&(dataValueOpt.statusCode=(0,json_basic_encoding_decoding_statuscode_1.opcuaJsonDecodeStatusCode)(pojo.StatusCode)),pojo.Value&&(dataValueOpt.value=(0,json_basic_encoding_decoding_variant_1.opcuaJsonDecodeVariant)(pojo.Value,builder)),new node_opcua_data_value_1.DataValue(dataValueOpt)}},227:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeDateTime=exports.opcuaJsonEncodeDateTime=void 0,exports.opcuaJsonEncodeDateTime=function(date,reversible=!1,namespaceArray){return date},exports.opcuaJsonDecodeDateTime=function(pojo){return"string"==typeof pojo?new Date(pojo):pojo}},611:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeExtensionObject=exports.opcuaJsonEncodeExtensionObject=exports.opcuaJsonEncodeExtensionObjectBody=exports.opcuaJsonDecodeExtensionObjectBody=exports.makeBody=void 0;const node_opcua_variant_1=__nccwpck_require__(567),node_opcua_numeric_range_1=__nccwpck_require__(654),node_opcua_debug_1=__nccwpck_require__(543),node_opcua_factory_1=__nccwpck_require__(217),json_basic_encoding_body_functor_1=__nccwpck_require__(562),json_basic_encoding_decoding_nodeid_1=__nccwpck_require__(87),errorLog=(0,node_opcua_debug_1.make_errorLog)("JSON");function originalName(name){return name[0].toUpperCase()+name.slice(1)}const g_DataType=node_opcua_variant_1.DataType;function toDataType(field){let dataType=g_DataType[field.fieldType];return void 0===dataType&&(field.schema instanceof node_opcua_factory_1.BasicTypeSchema?dataType=g_DataType[field.schema.subType||field.schema.name]:(dataType=g_DataType[field.schema.name],dataType||g_DataType[field.schema.subType])),dataType}function findEncoder(field){const dataType=toDataType(field);if(!dataType){if("NumericRange"===field.fieldType)return numericRange=>numericRange.toString();if("UAString"===field.fieldType)return(str,reversible,namespaceArray)=>str}const encoderFunc=(()=>{switch(field.category){case"complex":return"ExtensionObject"===field.fieldType?opcuaJsonEncodeExtensionObject:opcuaJsonEncodeExtensionObjectBody;case"basic":return(0,json_basic_encoding_body_functor_1.bodyEncodeFunctor)(dataType);default:return a=>a}})();return encoderFunc||(errorLog("findEncoder: Cannot find encoderFunc for ",node_opcua_variant_1.DataType[dataType],field),null)}function findDecoder(field){const dataType=toDataType(field);if(!dataType){if("NumericRange"===field.fieldType)return numericRange=>new node_opcua_numeric_range_1.NumericRange(numericRange);if("UAString"===field.fieldType)return str=>str}const decoderFunc=(()=>{switch(field.category){case"complex":if("ExtensionObject"===field.fieldType)return opcuaJsonDecodeExtensionObject;if(field.schema)return opcuaJsonDecodeExtensionObjectBody.bind(null,field.schema);{const schema=(0,node_opcua_factory_1.getStandardDataTypeFactory)().getStructuredTypeSchema(field.fieldType);return opcuaJsonDecodeExtensionObjectBody.bind(null,schema)}case"basic":return(0,json_basic_encoding_body_functor_1.bodyDecodeFunctor)(dataType);default:return a=>a}})();return decoderFunc||(errorLog("findEncoder: Cannot find decoderFunc for ",node_opcua_variant_1.DataType[dataType],field),null)}function makeBody(extensionObject,reversible=!1){const pojo={};for(const field of extensionObject.schema.fields){const name=originalName(field.name),value=extensionObject[field.name],encoder=findEncoder(field);if(encoder)if(field.isArray)if(value)if("object"==typeof value&&value&&0===value.length)pojo[name]=[];else{const valueAsArray=value;pojo[name]=valueAsArray.map((a=>a?encoder(a,reversible):null))}else;else void 0!==value&&(pojo[name]=encoder(value,reversible));else errorLog("cannot find encoder for field",field)}return pojo}function adaptBody(body,schema,builder){const pojo={};for(const field of schema.fields){const value=body[originalName(field.name)];if(void 0===value)continue;const decoder=findDecoder(field);if(decoder)if(field.isArray)if(value)if("object"==typeof value&&value&&0===value.length)pojo[field.name]=[];else{const valueAsArray=value;pojo[field.name]=valueAsArray.map((a=>a?decoder(a,builder):void 0))}else pojo[field.name]=[];else null!=value?pojo[field.name]=decoder(value,builder):null===value&&(pojo[field.name]=null);else errorLog("Cannot find decoder for",field)}return pojo}function opcuaJsonDecodeExtensionObjectBody(schema,body,builder){return adaptBody(body,schema,builder)}function opcuaJsonEncodeExtensionObjectBody(extensionObject,reversible=!1,namespaceArray){return extensionObject?makeBody(extensionObject,reversible):null}function opcuaJsonEncodeExtensionObject(extensionObject,reversible=!1,namespaceArray){if(!extensionObject)return null;const body=opcuaJsonEncodeExtensionObjectBody(extensionObject,reversible);return reversible?{TypeId:(0,json_basic_encoding_decoding_nodeid_1.opcuaJsonEncodeNodeId)(extensionObject.schema.dataTypeNodeId),Body:body}:body}function opcuaJsonDecodeExtensionObject(_pojo,builder){if(!_pojo)return null;const typeId=(0,json_basic_encoding_decoding_nodeid_1.opcuaJsonDecodeNodeId)(_pojo.TypeId),body=_pojo.Body;if(0===typeId.namespace){const Constructor=(0,node_opcua_factory_1.getStandardDataTypeFactory)().findConstructorForDataType(typeId);return new Constructor(adaptBody(body,Constructor.schema))}{if(!builder)throw new Error("Expecting a extension object builder for non-0 namespace extension objects");const Constructor=builder.getExtensionObjectConstructor(typeId);return new Constructor(adaptBody(body,Constructor.schema,builder))}}exports.makeBody=makeBody,exports.opcuaJsonDecodeExtensionObjectBody=opcuaJsonDecodeExtensionObjectBody,exports.opcuaJsonEncodeExtensionObjectBody=opcuaJsonEncodeExtensionObjectBody,exports.opcuaJsonEncodeExtensionObject=opcuaJsonEncodeExtensionObject,exports.opcuaJsonDecodeExtensionObject=opcuaJsonDecodeExtensionObject},548:(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeUInt64=exports.opcuaJsonDecodeInt64=exports.opcuaJsonEncodeUInt64=exports.opcuaJsonEncodeInt64=void 0;const signMask=1n<<31n,shiftHigh=1n<<32n;exports.opcuaJsonEncodeInt64=function(value,reversible=!1){const h=BigInt(value[0]),l=BigInt(value[1]);if((h&signMask)===signMask){return((h&~signMask)*shiftHigh+l-0x8000000000000000n).toString()}return(h*shiftHigh+l).toString()},exports.opcuaJsonEncodeUInt64=function(value,reversible=!1){const h=BigInt(value[0]),l=BigInt(value[1]);return(h*shiftHigh+l).toString()},exports.opcuaJsonDecodeInt64=function(value){const r=BigInt(value);if(r>=0)return[Number(r/shiftHigh),Number(r%shiftHigh)];const v=0x8000000000000000n+r;return[Number(v/shiftHigh|signMask),Number(v%shiftHigh)]},exports.opcuaJsonDecodeUInt64=function(value){const r=BigInt(value);return[Number(r/shiftHigh),Number(r%shiftHigh)]}},686:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeLocalizedText=exports.opcuaJsonEncodeLocalizedText=void 0;const node_opcua_data_model_1=__nccwpck_require__(730);exports.opcuaJsonEncodeLocalizedText=function(localizedText,reversible=!1,namespaceArray){if(!localizedText)return null;if(!reversible)return localizedText.text||null;const pojo={Text:localizedText.text||null};return localizedText.locale&&(pojo.Locale=localizedText.locale),pojo},exports.opcuaJsonDecodeLocalizedText=function(pojo){return pojo?"string"==typeof pojo?new node_opcua_data_model_1.LocalizedText({text:pojo}):new node_opcua_data_model_1.LocalizedText({text:pojo.Text,locale:pojo.Locale}):new node_opcua_data_model_1.LocalizedText}},87:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeNodeId=exports.opcuaJsonEncodeNodeId=void 0;const node_opcua_nodeid_1=__nccwpck_require__(597);exports.opcuaJsonEncodeNodeId=function(value,reversible=!1,namespaceArray){const IdType=(()=>{switch(value.identifierType){case node_opcua_nodeid_1.NodeIdType.NUMERIC:return 0;case node_opcua_nodeid_1.NodeIdType.STRING:return 1;case node_opcua_nodeid_1.NodeIdType.GUID:return 2;default:return 3}})(),pojo={Id:(()=>{switch(value.identifierType){case node_opcua_nodeid_1.NodeIdType.NUMERIC:case node_opcua_nodeid_1.NodeIdType.STRING:case node_opcua_nodeid_1.NodeIdType.GUID:return value.value;case node_opcua_nodeid_1.NodeIdType.BYTESTRING:return value.value.toString("base64")}})()};return 0!==IdType&&(pojo.IdType=IdType),0===value.namespace?pojo:1===value.namespace||reversible||!namespaceArray?(pojo.Namespace=value.namespace,pojo):(pojo.Namespace=namespaceArray[value.namespace],pojo)},exports.opcuaJsonDecodeNodeId=function(pojo,namespaceArray){const identifierType=(()=>{if(!pojo.IdType)return node_opcua_nodeid_1.NodeIdType.NUMERIC;switch(pojo.IdType){case 2:return node_opcua_nodeid_1.NodeIdType.GUID;case 3:return node_opcua_nodeid_1.NodeIdType.BYTESTRING;default:return node_opcua_nodeid_1.NodeIdType.STRING}})(),namespace=(()=>{if(!pojo.Namespace)return 0;if("number"==typeof pojo.Namespace)return pojo.Namespace;if(!namespaceArray)return 65535;const index=namespaceArray.indexOf(pojo.Namespace);return index<0?65535:index})(),value=(()=>{switch(identifierType){case node_opcua_nodeid_1.NodeIdType.NUMERIC:return"string"==typeof pojo.Id?parseInt(pojo.Id,10):pojo.Id;case node_opcua_nodeid_1.NodeIdType.BYTESTRING:return Buffer.from(pojo.Id,"base64");case node_opcua_nodeid_1.NodeIdType.GUID:case node_opcua_nodeid_1.NodeIdType.STRING:default:return pojo.Id}})();return new node_opcua_nodeid_1.NodeId(identifierType,value,namespace)}},522:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeQualifiedName=exports.opcuaJsonEncodeQualifiedName=void 0;const node_opcua_data_model_1=__nccwpck_require__(730);exports.opcuaJsonEncodeQualifiedName=function(qualifiedName,reversible=!1,namespaceArray){const pojo={Name:qualifiedName.name||""};return 0===qualifiedName.namespaceIndex?pojo:reversible||!namespaceArray||1===qualifiedName.namespaceIndex?(pojo.Uri=qualifiedName.namespaceIndex,pojo):(pojo.Uri=namespaceArray[qualifiedName.namespaceIndex],pojo)},exports.opcuaJsonDecodeQualifiedName=function(pojo){if(!pojo)return new node_opcua_data_model_1.QualifiedName;if("string"==typeof pojo)return new node_opcua_data_model_1.QualifiedName({name:pojo});const namespaceIndex=pojo.Uri&&"number"==typeof pojo.Uri?pojo.Uri:0;return new node_opcua_data_model_1.QualifiedName({name:pojo.Name,namespaceIndex:namespaceIndex})}},452:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeStatusCode=exports.opcuaJsonEncodeStatusCode=void 0;const node_opcua_status_code_1=__nccwpck_require__(8);exports.opcuaJsonEncodeStatusCode=function(statusCode,reversible=!1){if(reversible)return statusCode.value;if(0===statusCode.value)return;const pojo={};return pojo.Code=statusCode.value,pojo.Symbol=statusCode.name,pojo},exports.opcuaJsonDecodeStatusCode=function(pojo){return pojo?"number"==typeof pojo?(0,node_opcua_status_code_1.coerceStatusCode)(pojo):(pojo.Code,(0,node_opcua_status_code_1.coerceStatusCode)(pojo.Code)):node_opcua_status_code_1.StatusCodes.Good}},155:(__unused_webpack_module,exports,__nccwpck_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.opcuaJsonDecodeVariant=exports.opcuaJsonEncodeVariant=void 0;const node_opcua_variant_1=__nccwpck_require__(567),json_basic_encoding_body_functor_1=__nccwpck_require__(562);function body(variant,reversible,namespaceArray){const f=(0,json_basic_encoding_body_functor_1.bodyEncodeFunctor)(variant.dataType);if(variant.arrayType===node_opcua_variant_1.VariantArrayType.Scalar)return f(variant.value,reversible,namespaceArray);{const array=[];for(const e of variant.value)array.push(f(e,reversible,namespaceArray));return array}}exports.opcuaJsonEncodeVariant=function(variant,reversible=!1,namespaceArray){if(variant.dataType===node_opcua_variant_1.DataType.Null)return null;if(!reversible&&variant.arrayType!==node_opcua_variant_1.VariantArrayType.Matrix)return body(variant,reversible,namespaceArray);const pojo={Type:variant.dataType,Body:body(variant,reversible,namespaceArray)};return variant.arrayType===node_opcua_variant_1.VariantArrayType.Matrix&&variant.dimensions&&(pojo.Dimensions=[...variant.dimensions]),pojo},exports.opcuaJsonDecodeVariant=function(pojo,builder){if(!pojo)return new node_opcua_variant_1.Variant({dataType:node_opcua_variant_1.DataType.Null});const dataType=pojo.Type,f=(0,json_basic_encoding_body_functor_1.bodyDecodeFunctor)(dataType);if(Array.isArray(pojo.Body)){const value=pojo.Body.map((a=>f(a,builder)));return pojo.Dimensions?new node_opcua_variant_1.Variant({arrayType:node_opcua_variant_1.VariantArrayType.Matrix,dimensions:pojo.Dimensions,dataType:dataType,value:value}):new node_opcua_variant_1.Variant({arrayType:node_opcua_variant_1.VariantArrayType.Array,dataType:dataType,value:value})}return new node_opcua_variant_1.Variant({dataType:dataType,arrayType:node_opcua_variant_1.VariantArrayType.Scalar,value:f(pojo.Body,builder)})}},730:module=>{module.exports=require("node-opcua-data-model")},169:module=>{module.exports=require("node-opcua-data-value")},543:module=>{module.exports=require("node-opcua-debug")},217:module=>{module.exports=require("node-opcua-factory")},597:module=>{module.exports=require("node-opcua-nodeid")},654:module=>{module.exports=require("node-opcua-numeric-range")},8:module=>{module.exports=require("node-opcua-status-code")},67:module=>{module.exports=require("node-opcua-types")},567:module=>{module.exports=require("node-opcua-variant")}},__webpack_module_cache__={};function __nccwpck_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={exports:{}},threw=!0;try{__webpack_modules__[moduleId].call(module.exports,module,module.exports,__nccwpck_require__),threw=!1}finally{threw&&delete __webpack_module_cache__[moduleId]}return module.exports}__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(552);module.exports=__webpack_exports__})();
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { NodeId } from "node-opcua-nodeid";
26
6
  import { DataType } from "node-opcua-variant";
27
7
  import { ExtensionObjectConstructorFuncWithSchema } from "node-opcua-address-space/dist/src/ua_data_type_impl";
@@ -1,28 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  /**
3
- * the MIT License (MIT)
4
- *
5
- * Copyright (c) Sterfive 2020-2021
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
8
- * this software and associated documentation files (the "Software"), to deal in
9
- * the Software without restriction, including without limitation the rights to
10
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11
- * the Software, and to permit persons to whom the Software is furnished to do so,
12
- * subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- *
3
+ * Copyright Sterfive 2020-2022
24
4
  */
25
-
5
+
26
6
  import { ByteString } from "node-opcua-basic-types";
27
7
  export declare function opcuaJsonEncodeByteString(byteString: ByteString | null, reversible?: boolean, namespaceArray?: string[]): string | null;
28
8
  export declare function opcuaJsonDecodeByteString(pojo: string | null): Buffer | null;
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { DataValue } from "node-opcua-data-value";
26
6
  import { DataSetFieldContentMask } from "node-opcua-types";
27
7
  import { VariantJSON, VariantJSONBody } from "./json_basic_encoding_decoding_variant";
@@ -1,26 +1,6 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  export declare function opcuaJsonEncodeDateTime(date: Date, reversible?: boolean, namespaceArray?: string[]): Date;
26
6
  export declare function opcuaJsonDecodeDateTime(pojo: Date | string): Date;
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { Int64, UInt64 } from "node-opcua-basic-types";
26
6
  export declare function opcuaJsonEncodeInt64(value: Int64, reversible?: boolean): string;
27
7
  export declare function opcuaJsonEncodeUInt64(value: UInt64, reversible?: boolean): string;
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { LocalizedText } from "node-opcua-data-model";
26
6
  interface LocalizedTextJSON {
27
7
  /** The Text portion of LocalizedText values shall be encoded as a JSON string. */
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { NodeId } from "node-opcua-nodeid";
26
6
  export interface NodeIdJSON {
27
7
  IdType?: 0 | 1 | 2 | 3;
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { QualifiedName } from "node-opcua-data-model";
26
6
  interface QualifiedNameJSON {
27
7
  /** The Name component of the QualifiedName. */
@@ -1,27 +1,7 @@
1
1
  /**
2
- * the MIT License (MIT)
3
- *
4
- * Copyright (c) Sterfive 2020-2021
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- * this software and associated documentation files (the "Software"), to deal in
8
- * the Software without restriction, including without limitation the rights to
9
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- * the Software, and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- *
2
+ * Copyright Sterfive 2020-2022
23
3
  */
24
-
4
+
25
5
  import { StatusCode, StatusCodes } from "node-opcua-status-code";
26
6
  export interface StatusCodeJSON {
27
7
  Code?: number | keyof StatusCodes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-json",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "OPCUA JSON encoder/decoder for node-opcua",
5
5
  "author": "Etienne Rossignon <etienne.rossignon@sterfive.com>",
6
6
  "homepage": "https://support.sterfive.com",