node-opcua-json 2.182.0 → 2.183.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/README.md +29 -2
- package/dist/104/index.d.ts +57 -0
- package/dist/104/index.js +94 -0
- package/dist/104/index.js.map +1 -0
- package/dist/105/index.d.ts +56 -0
- package/dist/105/index.js +96 -0
- package/dist/105/index.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +37 -2
- package/dist/index.js.map +1 -1
- package/dist/json_basic_encoding_body_functor.js +6 -4
- package/dist/json_basic_encoding_body_functor.js.map +1 -1
- package/dist/json_basic_encoding_decoding_data_value.d.ts +2 -1
- package/dist/json_basic_encoding_decoding_data_value.js +8 -7
- package/dist/json_basic_encoding_decoding_data_value.js.map +1 -1
- package/dist/json_basic_encoding_decoding_diagnosticinfo.d.ts +51 -0
- package/dist/json_basic_encoding_decoding_diagnosticinfo.js +89 -0
- package/dist/json_basic_encoding_decoding_diagnosticinfo.js.map +1 -0
- package/dist/json_basic_encoding_decoding_extension_object.js +5 -5
- package/dist/json_basic_encoding_decoding_extension_object.js.map +1 -1
- package/dist/json_basic_encoding_decoding_nodeid.d.ts +32 -1
- package/dist/json_basic_encoding_decoding_nodeid.js +21 -5
- package/dist/json_basic_encoding_decoding_nodeid.js.map +1 -1
- package/dist/json_basic_encoding_decoding_variant.js +1 -0
- package/dist/json_basic_encoding_decoding_variant.js.map +1 -1
- package/package.json +53 -17
- package/source/104/index.ts +118 -0
- package/source/105/index.ts +119 -0
- package/source/index.ts +15 -2
- package/source/json_basic_encoding_body_functor.ts +6 -4
- package/source/json_basic_encoding_decoding_data_value.ts +6 -6
- package/source/json_basic_encoding_decoding_diagnosticinfo.ts +129 -0
- package/source/json_basic_encoding_decoding_extension_object.ts +5 -5
- package/source/json_basic_encoding_decoding_nodeid.ts +29 -10
- package/source/json_basic_encoding_decoding_variant.ts +1 -0
package/README.md
CHANGED
|
@@ -72,6 +72,32 @@ When a PubSub subscriber has to work out which scheme it is being sent,
|
|
|
72
72
|
`JsonDataSetMessageContentMaskToJsonEncodingScheme` reads the two `FieldEncoding` bits of
|
|
73
73
|
OPC 10000-14 Table 112, and `JsonEncodingSchemeToJsonDataSetMessageContentMask` writes them.
|
|
74
74
|
|
|
75
|
+
## One edition only: `node-opcua-json/104` and `node-opcua-json/105`
|
|
76
|
+
|
|
77
|
+
The root entry point is deliberately flexible: it takes a `JsonEncodingScheme` and dispatches
|
|
78
|
+
to whichever edition it names. Code that speaks a single edition, such as a PubSub publisher
|
|
79
|
+
pinned to 1.05 or a bridge to a 1.04-only stack, is better off importing that edition directly.
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { opcuaJsonEncodeDataValue, JsonEncoderMode, type DataValueJSON } from "node-opcua-json/105";
|
|
83
|
+
|
|
84
|
+
const pojo: DataValueJSON = opcuaJsonEncodeDataValue(dataValue, JsonEncoderMode.Compact, namespaceArray);
|
|
85
|
+
// { UaType: 11, Value: 3.5, ... } and nothing else can come out
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Each subpath exposes the whole API under **version-free names**: `opcuaJsonEncodeDataValue`,
|
|
89
|
+
`opcuaJsonDecodeVariant`, `opcuaJsonEncodeStatusCode`, `opcuaJsonEncodeNodeId`,
|
|
90
|
+
`opcuaJsonEncodeExtensionObject`, the `DataValueJSON` / `VariantJSON` / `NodeIdJSON` /
|
|
91
|
+
`ExtensionObjectJSON` types and a `JsonEncoderMode` enum, every one bound to that edition alone.
|
|
92
|
+
The mode parameter is the edition's own two-value enum, so a 1.04 mode is a type error in the
|
|
93
|
+
1.05 realm and vice versa, and the JSON types are the edition's exact shapes rather than a union.
|
|
94
|
+
Version-agnostic scalars (`Int64`, `ByteString`, `DateTime`, ...) are the same functions in both.
|
|
95
|
+
|
|
96
|
+
Switching an existing file from one edition to the other is a one-line change of the import
|
|
97
|
+
path. The root package keeps the suffixed names (`opcuaJsonEncodeDataValue104`,
|
|
98
|
+
`opcuaJsonEncodeVariant105`, ...) and also exposes both realms as the `v104` and `v105`
|
|
99
|
+
namespaces for code that has to handle both in one place.
|
|
100
|
+
|
|
75
101
|
## Decoding structures
|
|
76
102
|
|
|
77
103
|
Decoding a `Variant` that contains a structure means constructing that structure, and only the
|
|
@@ -114,9 +140,10 @@ scheme, so one call site serves all four.
|
|
|
114
140
|
| area | exports |
|
|
115
141
|
|---|---|
|
|
116
142
|
| Variant | `opcuaJsonEncodeVariant`, `opcuaJsonDecodeVariant`, the `104` / `105` pairs, `VariantJSON`, `VariantJSON104`, `VariantJSON105` |
|
|
117
|
-
| DataValue | `opcuaJsonEncodeDataValue`, `opcuaJsonDecodeDataValue`, `opcuaJsonEncodeDataValueMQTT`, `DataValueJSON105` |
|
|
143
|
+
| DataValue | `opcuaJsonEncodeDataValue`, `opcuaJsonDecodeDataValue`, `opcuaJsonEncodeDataValueMQTT`, the `104` / `105` variants of all three, `DataValueJSON`, `DataValueJSON104`, `DataValueJSON105` |
|
|
118
144
|
| ExtensionObject | `opcuaJsonEncodeExtensionObject`, `opcuaJsonDecodeExtensionObject`, the `...Body` pair, `makeBody`, `ExtensionObjectJSON104`, `ExtensionObjectJSON105` |
|
|
119
|
-
| NodeId | `opcuaJsonEncodeNodeId`, `opcuaJsonDecodeNodeId`, the `ExpandedNodeId` pair, `opcuaJsonEncodeNodeIdAsString` |
|
|
145
|
+
| NodeId | `opcuaJsonEncodeNodeId`, `opcuaJsonDecodeNodeId`, the `ExpandedNodeId` pair, the `104` / `105` encoders, `opcuaJsonEncodeNodeIdAsString` |
|
|
146
|
+
| realms | `node-opcua-json/104`, `node-opcua-json/105`, and the `v104` / `v105` namespaces on the root |
|
|
120
147
|
| scalars | `Int64`, `UInt64`, `ByteString`, `DateTime`, `LocalizedText`, `QualifiedName`, `StatusCode` |
|
|
121
148
|
| structures | `decodeOPCUA_JSON`, `decodeOPCUA_JSONOld` |
|
|
122
149
|
| schemes | `JsonEncodingScheme`, `JsonEncoderMode104`, `JsonEncoderMode105`, `toJsonEncodingScheme`, `makeDataValueEncodingEnum`, the two `JsonDataSetMessageContentMask` converters |
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* The OPC UA 1.04 JSON encoding (Part 6, "reversible" and "non-reversible" forms), exposed
|
|
26
|
+
* under version-free names: `import { opcuaJsonEncodeDataValue } from "node-opcua-json/104"`.
|
|
27
|
+
*
|
|
28
|
+
* Everything here is locked to 1.04: the encoders take a JsonEncoderMode (Reversible or
|
|
29
|
+
* NonReversible) and the JSON types are the 1.04 shapes (Type/Body, TypeId/Body, NodeId objects).
|
|
30
|
+
* The root "node-opcua-json" entry point dispatches on JsonEncodingScheme and accepts either edition.
|
|
31
|
+
*/
|
|
32
|
+
import type { ExtensionObject } from "node-opcua-extension-object";
|
|
33
|
+
import type { Pojo } from "../decode_opcua_json.js";
|
|
34
|
+
import type { ExtensionObjectBuilder } from "../json_basic_encoding_body_functor.js";
|
|
35
|
+
import { type ExtensionObjectJSON104 } from "../json_basic_encoding_decoding_extension_object.js";
|
|
36
|
+
import { type JsonEncoderMode104 } from "../json_encoding_scheme.js";
|
|
37
|
+
export * from "../decode_opcua_json.js";
|
|
38
|
+
export type { ExtensionObjectConstructorFuncWithSchema } from "../extension_object_constructor.js";
|
|
39
|
+
export * from "../json_basic_encoding_body_functor.js";
|
|
40
|
+
export * from "../json_basic_encoding_decoding_byte_string.js";
|
|
41
|
+
export { type DataValueJSON104 as DataValueJSON, type DataValueStatusAndTimestamps, opcuaJsonDecodeDataValue104 as opcuaJsonDecodeDataValue, opcuaJsonEncodeDataValue104 as opcuaJsonEncodeDataValue, opcuaJsonEncodeDataValueMQTT104 as opcuaJsonEncodeDataValueMQTT } from "../json_basic_encoding_decoding_data_value.js";
|
|
42
|
+
export * from "../json_basic_encoding_decoding_date_time.js";
|
|
43
|
+
export * from "../json_basic_encoding_decoding_diagnosticinfo.js";
|
|
44
|
+
export { type ExtensionObjectJSON104 as ExtensionObjectJSON, makeBody, opcuaJsonDecodeExtensionObjectBody, opcuaJsonEncodeExtensionObjectBody } from "../json_basic_encoding_decoding_extension_object.js";
|
|
45
|
+
export * from "../json_basic_encoding_decoding_int64.js";
|
|
46
|
+
export * from "../json_basic_encoding_decoding_localizedtext.js";
|
|
47
|
+
export { type NodeIdJSON104 as NodeIdJSON, opcuaDecodeURIComponent, opcuaEncodeURIComponent, opcuaJsonDecodeExpandedNodeId, opcuaJsonDecodeNodeId, opcuaJsonEncodeExpandedNodeId104 as opcuaJsonEncodeExpandedNodeId, opcuaJsonEncodeNodeId104 as opcuaJsonEncodeNodeId } from "../json_basic_encoding_decoding_nodeid.js";
|
|
48
|
+
export * from "../json_basic_encoding_decoding_qualifiedname.js";
|
|
49
|
+
export { opcuaJsonDecodeStatusCode, opcuaJsonEncodeStatusCode104 as opcuaJsonEncodeStatusCode, type StatusCodeJSON } from "../json_basic_encoding_decoding_statuscode.js";
|
|
50
|
+
export { opcuaJsonDecodeVariant104 as opcuaJsonDecodeVariant, opcuaJsonEncodeVariant104 as opcuaJsonEncodeVariant, type VariantJSON104 as VariantJSON, type VariantJSONBody, type VariantJSONBodyScalar } from "../json_basic_encoding_decoding_variant.js";
|
|
51
|
+
export { JsonEncoderMode104 as JsonEncoderMode, JsonEncodingScheme, toJsonEncodingScheme } from "../json_encoding_scheme.js";
|
|
52
|
+
/**
|
|
53
|
+
* encode an ExtensionObject with the 1.04 rules: Reversible yields { TypeId, Body },
|
|
54
|
+
* NonReversible yields the bare body.
|
|
55
|
+
*/
|
|
56
|
+
export declare function opcuaJsonEncodeExtensionObject(extensionObject: ExtensionObject | ExtensionObject[] | null, mode: JsonEncoderMode104, namespaceArray?: string[]): ExtensionObjectJSON104 | Pojo | (ExtensionObjectJSON104 | Pojo)[] | null;
|
|
57
|
+
export declare function opcuaJsonDecodeExtensionObject(pojo: ExtensionObjectJSON104, builder: ExtensionObjectBuilder, namespaceArray: string[]): ExtensionObject | ExtensionObject[] | null;
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
28
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
29
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(o, k2, desc);
|
|
32
|
+
}) : (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
o[k2] = m[k];
|
|
35
|
+
}));
|
|
36
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.toJsonEncodingScheme = exports.JsonEncodingScheme = exports.JsonEncoderMode = exports.opcuaJsonEncodeVariant = exports.opcuaJsonDecodeVariant = exports.opcuaJsonEncodeStatusCode = exports.opcuaJsonDecodeStatusCode = exports.opcuaJsonEncodeNodeId = exports.opcuaJsonEncodeExpandedNodeId = exports.opcuaJsonDecodeNodeId = exports.opcuaJsonDecodeExpandedNodeId = exports.opcuaEncodeURIComponent = exports.opcuaDecodeURIComponent = exports.opcuaJsonEncodeExtensionObjectBody = exports.opcuaJsonDecodeExtensionObjectBody = exports.makeBody = exports.opcuaJsonEncodeDataValueMQTT = exports.opcuaJsonEncodeDataValue = exports.opcuaJsonDecodeDataValue = void 0;
|
|
41
|
+
exports.opcuaJsonEncodeExtensionObject = opcuaJsonEncodeExtensionObject;
|
|
42
|
+
exports.opcuaJsonDecodeExtensionObject = opcuaJsonDecodeExtensionObject;
|
|
43
|
+
const json_basic_encoding_decoding_extension_object_js_1 = require("../json_basic_encoding_decoding_extension_object.js");
|
|
44
|
+
const json_encoding_scheme_js_1 = require("../json_encoding_scheme.js");
|
|
45
|
+
// version-agnostic parts, shared with the root entry point
|
|
46
|
+
__exportStar(require("../decode_opcua_json.js"), exports);
|
|
47
|
+
__exportStar(require("../json_basic_encoding_body_functor.js"), exports);
|
|
48
|
+
__exportStar(require("../json_basic_encoding_decoding_byte_string.js"), exports);
|
|
49
|
+
// DataValue
|
|
50
|
+
var json_basic_encoding_decoding_data_value_js_1 = require("../json_basic_encoding_decoding_data_value.js");
|
|
51
|
+
Object.defineProperty(exports, "opcuaJsonDecodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue104; } });
|
|
52
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue104; } });
|
|
53
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValueMQTT104; } });
|
|
54
|
+
__exportStar(require("../json_basic_encoding_decoding_date_time.js"), exports);
|
|
55
|
+
__exportStar(require("../json_basic_encoding_decoding_diagnosticinfo.js"), exports);
|
|
56
|
+
// ExtensionObject
|
|
57
|
+
var json_basic_encoding_decoding_extension_object_js_2 = require("../json_basic_encoding_decoding_extension_object.js");
|
|
58
|
+
Object.defineProperty(exports, "makeBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.makeBody; } });
|
|
59
|
+
Object.defineProperty(exports, "opcuaJsonDecodeExtensionObjectBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.opcuaJsonDecodeExtensionObjectBody; } });
|
|
60
|
+
Object.defineProperty(exports, "opcuaJsonEncodeExtensionObjectBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.opcuaJsonEncodeExtensionObjectBody; } });
|
|
61
|
+
__exportStar(require("../json_basic_encoding_decoding_int64.js"), exports);
|
|
62
|
+
__exportStar(require("../json_basic_encoding_decoding_localizedtext.js"), exports);
|
|
63
|
+
// NodeId
|
|
64
|
+
var json_basic_encoding_decoding_nodeid_js_1 = require("../json_basic_encoding_decoding_nodeid.js");
|
|
65
|
+
Object.defineProperty(exports, "opcuaDecodeURIComponent", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaDecodeURIComponent; } });
|
|
66
|
+
Object.defineProperty(exports, "opcuaEncodeURIComponent", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaEncodeURIComponent; } });
|
|
67
|
+
Object.defineProperty(exports, "opcuaJsonDecodeExpandedNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeExpandedNodeId; } });
|
|
68
|
+
Object.defineProperty(exports, "opcuaJsonDecodeNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeNodeId; } });
|
|
69
|
+
Object.defineProperty(exports, "opcuaJsonEncodeExpandedNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeExpandedNodeId104; } });
|
|
70
|
+
Object.defineProperty(exports, "opcuaJsonEncodeNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeNodeId104; } });
|
|
71
|
+
__exportStar(require("../json_basic_encoding_decoding_qualifiedname.js"), exports);
|
|
72
|
+
// StatusCode
|
|
73
|
+
var json_basic_encoding_decoding_statuscode_js_1 = require("../json_basic_encoding_decoding_statuscode.js");
|
|
74
|
+
Object.defineProperty(exports, "opcuaJsonDecodeStatusCode", { enumerable: true, get: function () { return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonDecodeStatusCode; } });
|
|
75
|
+
Object.defineProperty(exports, "opcuaJsonEncodeStatusCode", { enumerable: true, get: function () { return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode104; } });
|
|
76
|
+
// Variant
|
|
77
|
+
var json_basic_encoding_decoding_variant_js_1 = require("../json_basic_encoding_decoding_variant.js");
|
|
78
|
+
Object.defineProperty(exports, "opcuaJsonDecodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant104; } });
|
|
79
|
+
Object.defineProperty(exports, "opcuaJsonEncodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant104; } });
|
|
80
|
+
var json_encoding_scheme_js_2 = require("../json_encoding_scheme.js");
|
|
81
|
+
Object.defineProperty(exports, "JsonEncoderMode", { enumerable: true, get: function () { return json_encoding_scheme_js_2.JsonEncoderMode104; } });
|
|
82
|
+
Object.defineProperty(exports, "JsonEncodingScheme", { enumerable: true, get: function () { return json_encoding_scheme_js_2.JsonEncodingScheme; } });
|
|
83
|
+
Object.defineProperty(exports, "toJsonEncodingScheme", { enumerable: true, get: function () { return json_encoding_scheme_js_2.toJsonEncodingScheme; } });
|
|
84
|
+
/**
|
|
85
|
+
* encode an ExtensionObject with the 1.04 rules: Reversible yields { TypeId, Body },
|
|
86
|
+
* NonReversible yields the bare body.
|
|
87
|
+
*/
|
|
88
|
+
function opcuaJsonEncodeExtensionObject(extensionObject, mode, namespaceArray) {
|
|
89
|
+
return (0, json_basic_encoding_decoding_extension_object_js_1.opcuaJsonEncodeExtensionObject)(extensionObject, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode), namespaceArray);
|
|
90
|
+
}
|
|
91
|
+
function opcuaJsonDecodeExtensionObject(pojo, builder, namespaceArray) {
|
|
92
|
+
return (0, json_basic_encoding_decoding_extension_object_js_1.opcuaJsonDecodeExtensionObject)(pojo, builder, namespaceArray);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/104/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;AA6EH,wEAUC;AAED,wEAMC;AAjFD,0HAI6D;AAC7D,wEAA2F;AAE3F,2DAA2D;AAC3D,0DAAwC;AAExC,yEAAuD;AACvD,iFAA+D;AAC/D,YAAY;AACZ,4GAMuD;AAHnD,sJAAA,2BAA2B,OAA4B;AACvD,sJAAA,2BAA2B,OAA4B;AACvD,0JAAA,+BAA+B,OAAgC;AAEnE,+EAA6D;AAC7D,oFAAkE;AAClE,kBAAkB;AAClB,wHAK6D;AAHzD,4IAAA,QAAQ,OAAA;AACR,sKAAA,kCAAkC,OAAA;AAClC,sKAAA,kCAAkC,OAAA;AAEtC,2EAAyD;AACzD,mFAAiE;AACjE,SAAS;AACT,oGAQmD;AAN/C,iJAAA,uBAAuB,OAAA;AACvB,iJAAA,uBAAuB,OAAA;AACvB,uJAAA,6BAA6B,OAAA;AAC7B,+IAAA,qBAAqB,OAAA;AACrB,uJAAA,gCAAgC,OAAiC;AACjE,+IAAA,wBAAwB,OAAyB;AAErD,mFAAiE;AAEjE,aAAa;AACb,4GAIuD;AAHnD,uJAAA,yBAAyB,OAAA;AACzB,uJAAA,4BAA4B,OAA6B;AAG7D,UAAU;AACV,sGAMoD;AALhD,iJAAA,yBAAyB,OAA0B;AACnD,iJAAA,yBAAyB,OAA0B;AAKvD,sEAA6H;AAApH,0HAAA,kBAAkB,OAAmB;AAAE,6HAAA,kBAAkB,OAAA;AAAE,+HAAA,oBAAoB,OAAA;AAExF;;;GAGG;AACH,SAAgB,8BAA8B,CAC1C,eAA2D,EAC3D,IAAwB,EACxB,cAAyB;IAEzB,OAAO,IAAA,iFAAiC,EAAC,eAAe,EAAE,IAAA,8CAAoB,EAAC,IAAI,CAAC,EAAE,cAAc,CAI1F,CAAC;AACf,CAAC;AAED,SAAgB,8BAA8B,CAC1C,IAA4B,EAC5B,OAA+B,EAC/B,cAAwB;IAExB,OAAO,IAAA,iFAAiC,EAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* The OPC UA 1.05 JSON encoding (Part 6, "Compact" and "Verbose" forms), exposed under
|
|
26
|
+
* version-free names: `import { opcuaJsonEncodeDataValue } from "node-opcua-json/105"`.
|
|
27
|
+
*
|
|
28
|
+
* Everything here is locked to 1.05: the encoders take a JsonEncoderMode (Compact or Verbose)
|
|
29
|
+
* and the JSON types are the 1.05 shapes (UaType/Value, UaTypeId/UaBody, NodeId strings).
|
|
30
|
+
* The root "node-opcua-json" entry point dispatches on JsonEncodingScheme and accepts either edition.
|
|
31
|
+
*/
|
|
32
|
+
import type { ExtensionObject } from "node-opcua-extension-object";
|
|
33
|
+
import type { ExtensionObjectBuilder } from "../json_basic_encoding_body_functor.js";
|
|
34
|
+
import { type ExtensionObjectJSON105 } from "../json_basic_encoding_decoding_extension_object.js";
|
|
35
|
+
import { type JsonEncoderMode105 } from "../json_encoding_scheme.js";
|
|
36
|
+
export * from "../decode_opcua_json.js";
|
|
37
|
+
export type { ExtensionObjectConstructorFuncWithSchema } from "../extension_object_constructor.js";
|
|
38
|
+
export * from "../json_basic_encoding_body_functor.js";
|
|
39
|
+
export * from "../json_basic_encoding_decoding_byte_string.js";
|
|
40
|
+
export { type DataValueJSON105 as DataValueJSON, type DataValueStatusAndTimestamps, opcuaJsonDecodeDataValue105 as opcuaJsonDecodeDataValue, opcuaJsonEncodeDataValue105 as opcuaJsonEncodeDataValue, opcuaJsonEncodeDataValueMQTT105 as opcuaJsonEncodeDataValueMQTT } from "../json_basic_encoding_decoding_data_value.js";
|
|
41
|
+
export * from "../json_basic_encoding_decoding_date_time.js";
|
|
42
|
+
export * from "../json_basic_encoding_decoding_diagnosticinfo.js";
|
|
43
|
+
export { type ExtensionObjectJSON105 as ExtensionObjectJSON, makeBody, opcuaJsonDecodeExtensionObjectBody, opcuaJsonEncodeExtensionObjectBody } from "../json_basic_encoding_decoding_extension_object.js";
|
|
44
|
+
export * from "../json_basic_encoding_decoding_int64.js";
|
|
45
|
+
export * from "../json_basic_encoding_decoding_localizedtext.js";
|
|
46
|
+
export { type NodeIdJSON105 as NodeIdJSON, opcuaDecodeURIComponent, opcuaEncodeURIComponent, opcuaJsonDecodeExpandedNodeId, opcuaJsonDecodeNodeId, opcuaJsonEncodeExpandedNodeId105 as opcuaJsonEncodeExpandedNodeId, opcuaJsonEncodeExpandedNodeIdAsString, opcuaJsonEncodeNodeId105 as opcuaJsonEncodeNodeId, opcuaJsonEncodeNodeIdAsString } from "../json_basic_encoding_decoding_nodeid.js";
|
|
47
|
+
export * from "../json_basic_encoding_decoding_qualifiedname.js";
|
|
48
|
+
export { opcuaJsonDecodeStatusCode, opcuaJsonEncodeStatusCode105 as opcuaJsonEncodeStatusCode, type StatusCodeJSON } from "../json_basic_encoding_decoding_statuscode.js";
|
|
49
|
+
export { opcuaJsonDecodeVariant105 as opcuaJsonDecodeVariant, opcuaJsonEncodeVariant105 as opcuaJsonEncodeVariant, type VariantJSON105 as VariantJSON, type VariantJSONBody, type VariantJSONBodyScalar } from "../json_basic_encoding_decoding_variant.js";
|
|
50
|
+
export { JsonEncoderMode105 as JsonEncoderMode, JsonEncodingScheme, toJsonEncodingScheme } from "../json_encoding_scheme.js";
|
|
51
|
+
/**
|
|
52
|
+
* encode an ExtensionObject with the 1.05 rules: { UaTypeId, UaBody }, UaBody omitted in
|
|
53
|
+
* Compact mode when empty; a null ExtensionObject is omitted (undefined) in Compact mode.
|
|
54
|
+
*/
|
|
55
|
+
export declare function opcuaJsonEncodeExtensionObject(extensionObject: ExtensionObject | ExtensionObject[] | null, mode: JsonEncoderMode105, namespaceArray?: string[]): ExtensionObjectJSON105 | ExtensionObjectJSON105[] | null | undefined;
|
|
56
|
+
export declare function opcuaJsonDecodeExtensionObject(pojo: ExtensionObjectJSON105, builder: ExtensionObjectBuilder, namespaceArray: string[]): ExtensionObject | ExtensionObject[] | null;
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
28
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
29
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(o, k2, desc);
|
|
32
|
+
}) : (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
o[k2] = m[k];
|
|
35
|
+
}));
|
|
36
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.toJsonEncodingScheme = exports.JsonEncodingScheme = exports.JsonEncoderMode = exports.opcuaJsonEncodeVariant = exports.opcuaJsonDecodeVariant = exports.opcuaJsonEncodeStatusCode = exports.opcuaJsonDecodeStatusCode = exports.opcuaJsonEncodeNodeIdAsString = exports.opcuaJsonEncodeNodeId = exports.opcuaJsonEncodeExpandedNodeIdAsString = exports.opcuaJsonEncodeExpandedNodeId = exports.opcuaJsonDecodeNodeId = exports.opcuaJsonDecodeExpandedNodeId = exports.opcuaEncodeURIComponent = exports.opcuaDecodeURIComponent = exports.opcuaJsonEncodeExtensionObjectBody = exports.opcuaJsonDecodeExtensionObjectBody = exports.makeBody = exports.opcuaJsonEncodeDataValueMQTT = exports.opcuaJsonEncodeDataValue = exports.opcuaJsonDecodeDataValue = void 0;
|
|
41
|
+
exports.opcuaJsonEncodeExtensionObject = opcuaJsonEncodeExtensionObject;
|
|
42
|
+
exports.opcuaJsonDecodeExtensionObject = opcuaJsonDecodeExtensionObject;
|
|
43
|
+
const json_basic_encoding_decoding_extension_object_js_1 = require("../json_basic_encoding_decoding_extension_object.js");
|
|
44
|
+
const json_encoding_scheme_js_1 = require("../json_encoding_scheme.js");
|
|
45
|
+
// version-agnostic parts, shared with the root entry point
|
|
46
|
+
__exportStar(require("../decode_opcua_json.js"), exports);
|
|
47
|
+
__exportStar(require("../json_basic_encoding_body_functor.js"), exports);
|
|
48
|
+
__exportStar(require("../json_basic_encoding_decoding_byte_string.js"), exports);
|
|
49
|
+
// DataValue
|
|
50
|
+
var json_basic_encoding_decoding_data_value_js_1 = require("../json_basic_encoding_decoding_data_value.js");
|
|
51
|
+
Object.defineProperty(exports, "opcuaJsonDecodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue105; } });
|
|
52
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue105; } });
|
|
53
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValueMQTT105; } });
|
|
54
|
+
__exportStar(require("../json_basic_encoding_decoding_date_time.js"), exports);
|
|
55
|
+
__exportStar(require("../json_basic_encoding_decoding_diagnosticinfo.js"), exports);
|
|
56
|
+
// ExtensionObject
|
|
57
|
+
var json_basic_encoding_decoding_extension_object_js_2 = require("../json_basic_encoding_decoding_extension_object.js");
|
|
58
|
+
Object.defineProperty(exports, "makeBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.makeBody; } });
|
|
59
|
+
Object.defineProperty(exports, "opcuaJsonDecodeExtensionObjectBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.opcuaJsonDecodeExtensionObjectBody; } });
|
|
60
|
+
Object.defineProperty(exports, "opcuaJsonEncodeExtensionObjectBody", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_2.opcuaJsonEncodeExtensionObjectBody; } });
|
|
61
|
+
__exportStar(require("../json_basic_encoding_decoding_int64.js"), exports);
|
|
62
|
+
__exportStar(require("../json_basic_encoding_decoding_localizedtext.js"), exports);
|
|
63
|
+
// NodeId
|
|
64
|
+
var json_basic_encoding_decoding_nodeid_js_1 = require("../json_basic_encoding_decoding_nodeid.js");
|
|
65
|
+
Object.defineProperty(exports, "opcuaDecodeURIComponent", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaDecodeURIComponent; } });
|
|
66
|
+
Object.defineProperty(exports, "opcuaEncodeURIComponent", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaEncodeURIComponent; } });
|
|
67
|
+
Object.defineProperty(exports, "opcuaJsonDecodeExpandedNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeExpandedNodeId; } });
|
|
68
|
+
Object.defineProperty(exports, "opcuaJsonDecodeNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonDecodeNodeId; } });
|
|
69
|
+
Object.defineProperty(exports, "opcuaJsonEncodeExpandedNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeExpandedNodeId105; } });
|
|
70
|
+
Object.defineProperty(exports, "opcuaJsonEncodeExpandedNodeIdAsString", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeExpandedNodeIdAsString; } });
|
|
71
|
+
Object.defineProperty(exports, "opcuaJsonEncodeNodeId", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeNodeId105; } });
|
|
72
|
+
Object.defineProperty(exports, "opcuaJsonEncodeNodeIdAsString", { enumerable: true, get: function () { return json_basic_encoding_decoding_nodeid_js_1.opcuaJsonEncodeNodeIdAsString; } });
|
|
73
|
+
__exportStar(require("../json_basic_encoding_decoding_qualifiedname.js"), exports);
|
|
74
|
+
// StatusCode
|
|
75
|
+
var json_basic_encoding_decoding_statuscode_js_1 = require("../json_basic_encoding_decoding_statuscode.js");
|
|
76
|
+
Object.defineProperty(exports, "opcuaJsonDecodeStatusCode", { enumerable: true, get: function () { return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonDecodeStatusCode; } });
|
|
77
|
+
Object.defineProperty(exports, "opcuaJsonEncodeStatusCode", { enumerable: true, get: function () { return json_basic_encoding_decoding_statuscode_js_1.opcuaJsonEncodeStatusCode105; } });
|
|
78
|
+
// Variant
|
|
79
|
+
var json_basic_encoding_decoding_variant_js_1 = require("../json_basic_encoding_decoding_variant.js");
|
|
80
|
+
Object.defineProperty(exports, "opcuaJsonDecodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant105; } });
|
|
81
|
+
Object.defineProperty(exports, "opcuaJsonEncodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105; } });
|
|
82
|
+
var json_encoding_scheme_js_2 = require("../json_encoding_scheme.js");
|
|
83
|
+
Object.defineProperty(exports, "JsonEncoderMode", { enumerable: true, get: function () { return json_encoding_scheme_js_2.JsonEncoderMode105; } });
|
|
84
|
+
Object.defineProperty(exports, "JsonEncodingScheme", { enumerable: true, get: function () { return json_encoding_scheme_js_2.JsonEncodingScheme; } });
|
|
85
|
+
Object.defineProperty(exports, "toJsonEncodingScheme", { enumerable: true, get: function () { return json_encoding_scheme_js_2.toJsonEncodingScheme; } });
|
|
86
|
+
/**
|
|
87
|
+
* encode an ExtensionObject with the 1.05 rules: { UaTypeId, UaBody }, UaBody omitted in
|
|
88
|
+
* Compact mode when empty; a null ExtensionObject is omitted (undefined) in Compact mode.
|
|
89
|
+
*/
|
|
90
|
+
function opcuaJsonEncodeExtensionObject(extensionObject, mode, namespaceArray) {
|
|
91
|
+
return (0, json_basic_encoding_decoding_extension_object_js_1.opcuaJsonEncodeExtensionObject)(extensionObject, (0, json_encoding_scheme_js_1.toJsonEncodingScheme)(mode), namespaceArray);
|
|
92
|
+
}
|
|
93
|
+
function opcuaJsonDecodeExtensionObject(pojo, builder, namespaceArray) {
|
|
94
|
+
return (0, json_basic_encoding_decoding_extension_object_js_1.opcuaJsonDecodeExtensionObject)(pojo, builder, namespaceArray);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/105/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;AA8EH,wEAUC;AAED,wEAMC;AAnFD,0HAI6D;AAC7D,wEAA2F;AAE3F,2DAA2D;AAC3D,0DAAwC;AAExC,yEAAuD;AACvD,iFAA+D;AAC/D,YAAY;AACZ,4GAMuD;AAHnD,sJAAA,2BAA2B,OAA4B;AACvD,sJAAA,2BAA2B,OAA4B;AACvD,0JAAA,+BAA+B,OAAgC;AAEnE,+EAA6D;AAC7D,oFAAkE;AAClE,kBAAkB;AAClB,wHAK6D;AAHzD,4IAAA,QAAQ,OAAA;AACR,sKAAA,kCAAkC,OAAA;AAClC,sKAAA,kCAAkC,OAAA;AAEtC,2EAAyD;AACzD,mFAAiE;AACjE,SAAS;AACT,oGAUmD;AAR/C,iJAAA,uBAAuB,OAAA;AACvB,iJAAA,uBAAuB,OAAA;AACvB,uJAAA,6BAA6B,OAAA;AAC7B,+IAAA,qBAAqB,OAAA;AACrB,uJAAA,gCAAgC,OAAiC;AACjE,+JAAA,qCAAqC,OAAA;AACrC,+IAAA,wBAAwB,OAAyB;AACjD,uJAAA,6BAA6B,OAAA;AAEjC,mFAAiE;AAEjE,aAAa;AACb,4GAIuD;AAHnD,uJAAA,yBAAyB,OAAA;AACzB,uJAAA,4BAA4B,OAA6B;AAG7D,UAAU;AACV,sGAMoD;AALhD,iJAAA,yBAAyB,OAA0B;AACnD,iJAAA,yBAAyB,OAA0B;AAKvD,sEAA6H;AAApH,0HAAA,kBAAkB,OAAmB;AAAE,6HAAA,kBAAkB,OAAA;AAAE,+HAAA,oBAAoB,OAAA;AAExF;;;GAGG;AACH,SAAgB,8BAA8B,CAC1C,eAA2D,EAC3D,IAAwB,EACxB,cAAyB;IAEzB,OAAO,IAAA,iFAAiC,EAAC,eAAe,EAAE,IAAA,8CAAoB,EAAC,IAAI,CAAC,EAAE,cAAc,CAIrF,CAAC;AACpB,CAAC;AAED,SAAgB,8BAA8B,CAC1C,IAA4B,EAC5B,OAA+B,EAC/B,cAAwB;IAExB,OAAO,IAAA,iFAAiC,EAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,11 +21,14 @@
|
|
|
21
21
|
* IN THE SOFTWARE.
|
|
22
22
|
* ==========================================================================
|
|
23
23
|
*/
|
|
24
|
+
export * as v104 from "./104/index.js";
|
|
25
|
+
export * as v105 from "./105/index.js";
|
|
24
26
|
export * from "./decode_opcua_json.js";
|
|
25
27
|
export type { ExtensionObjectConstructorFuncWithSchema } from "./extension_object_constructor.js";
|
|
26
28
|
export * from "./json_basic_encoding_body_functor.js";
|
|
27
29
|
export * from "./json_basic_encoding_decoding_byte_string.js";
|
|
28
|
-
export { type DataValueJSON, type DataValueJSON104, type DataValueJSON105, opcuaJsonDecodeDataValue, opcuaJsonEncodeDataValue, opcuaJsonEncodeDataValueMQTT } from "./json_basic_encoding_decoding_data_value.js";
|
|
30
|
+
export { type DataValueJSON, type DataValueJSON104, type DataValueJSON105, opcuaJsonDecodeDataValue, opcuaJsonDecodeDataValue104, opcuaJsonDecodeDataValue105, opcuaJsonEncodeDataValue, opcuaJsonEncodeDataValue104, opcuaJsonEncodeDataValue105, opcuaJsonEncodeDataValueMQTT, opcuaJsonEncodeDataValueMQTT104, opcuaJsonEncodeDataValueMQTT105 } from "./json_basic_encoding_decoding_data_value.js";
|
|
31
|
+
export * from "./json_basic_encoding_decoding_diagnosticinfo.js";
|
|
29
32
|
export * from "./json_basic_encoding_decoding_extension_object.js";
|
|
30
33
|
export { opcuaJsonDecodeExtensionObject, opcuaJsonEncodeExtensionObject } from "./json_basic_encoding_decoding_extension_object.js";
|
|
31
34
|
export * from "./json_basic_encoding_decoding_int64.js";
|
|
@@ -33,6 +36,5 @@ export * from "./json_basic_encoding_decoding_localizedtext.js";
|
|
|
33
36
|
export * from "./json_basic_encoding_decoding_nodeid.js";
|
|
34
37
|
export * from "./json_basic_encoding_decoding_qualifiedname.js";
|
|
35
38
|
export * from "./json_basic_encoding_decoding_statuscode.js";
|
|
36
|
-
export
|
|
37
|
-
export { opcuaJsonDecodeVariant, opcuaJsonDecodeVariant105, opcuaJsonEncodeVariant, opcuaJsonEncodeVariant105, type VariantJSON, type VariantJSON104, type VariantJSON105 } from "./json_basic_encoding_decoding_variant.js";
|
|
39
|
+
export { opcuaJsonDecodeVariant, opcuaJsonDecodeVariant104, opcuaJsonDecodeVariant105, opcuaJsonEncodeVariant, opcuaJsonEncodeVariant104, opcuaJsonEncodeVariant105, type VariantJSON, type VariantJSON104, type VariantJSON105 } from "./json_basic_encoding_decoding_variant.js";
|
|
38
40
|
export * from "./json_encoding_scheme.js";
|
package/dist/index.js
CHANGED
|
@@ -33,18 +33,52 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
33
33
|
if (k2 === undefined) k2 = k;
|
|
34
34
|
o[k2] = m[k];
|
|
35
35
|
}));
|
|
36
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
37
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
38
|
+
}) : function(o, v) {
|
|
39
|
+
o["default"] = v;
|
|
40
|
+
});
|
|
41
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
42
|
+
var ownKeys = function(o) {
|
|
43
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
44
|
+
var ar = [];
|
|
45
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
46
|
+
return ar;
|
|
47
|
+
};
|
|
48
|
+
return ownKeys(o);
|
|
49
|
+
};
|
|
50
|
+
return function (mod) {
|
|
51
|
+
if (mod && mod.__esModule) return mod;
|
|
52
|
+
var result = {};
|
|
53
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
54
|
+
__setModuleDefault(result, mod);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
})();
|
|
36
58
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
59
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
60
|
};
|
|
39
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.opcuaJsonEncodeVariant105 = exports.opcuaJsonEncodeVariant = exports.opcuaJsonDecodeVariant105 = exports.opcuaJsonDecodeVariant = exports.opcuaJsonEncodeExtensionObject = exports.opcuaJsonDecodeExtensionObject = exports.opcuaJsonEncodeDataValueMQTT = exports.opcuaJsonEncodeDataValue = exports.opcuaJsonDecodeDataValue = void 0;
|
|
62
|
+
exports.opcuaJsonEncodeVariant105 = exports.opcuaJsonEncodeVariant104 = exports.opcuaJsonEncodeVariant = exports.opcuaJsonDecodeVariant105 = exports.opcuaJsonDecodeVariant104 = exports.opcuaJsonDecodeVariant = exports.opcuaJsonEncodeExtensionObject = exports.opcuaJsonDecodeExtensionObject = exports.opcuaJsonEncodeDataValueMQTT105 = exports.opcuaJsonEncodeDataValueMQTT104 = exports.opcuaJsonEncodeDataValueMQTT = exports.opcuaJsonEncodeDataValue105 = exports.opcuaJsonEncodeDataValue104 = exports.opcuaJsonEncodeDataValue = exports.opcuaJsonDecodeDataValue105 = exports.opcuaJsonDecodeDataValue104 = exports.opcuaJsonDecodeDataValue = exports.v105 = exports.v104 = void 0;
|
|
63
|
+
// version-locked realms: `node-opcua-json/104` and `node-opcua-json/105` expose the same
|
|
64
|
+
// API under version-free names (opcuaJsonEncodeDataValue, DataValueJSON, ...) bound to a
|
|
65
|
+
// single edition of Part 6, whereas this root entry point dispatches on JsonEncodingScheme.
|
|
66
|
+
exports.v104 = __importStar(require("./104/index.js"));
|
|
67
|
+
exports.v105 = __importStar(require("./105/index.js"));
|
|
41
68
|
__exportStar(require("./decode_opcua_json.js"), exports);
|
|
42
69
|
__exportStar(require("./json_basic_encoding_body_functor.js"), exports);
|
|
43
70
|
__exportStar(require("./json_basic_encoding_decoding_byte_string.js"), exports);
|
|
44
71
|
var json_basic_encoding_decoding_data_value_js_1 = require("./json_basic_encoding_decoding_data_value.js");
|
|
45
72
|
Object.defineProperty(exports, "opcuaJsonDecodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue; } });
|
|
73
|
+
Object.defineProperty(exports, "opcuaJsonDecodeDataValue104", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue104; } });
|
|
74
|
+
Object.defineProperty(exports, "opcuaJsonDecodeDataValue105", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue105; } });
|
|
46
75
|
Object.defineProperty(exports, "opcuaJsonEncodeDataValue", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue; } });
|
|
76
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValue104", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue104; } });
|
|
77
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValue105", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue105; } });
|
|
47
78
|
Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValueMQTT; } });
|
|
79
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT104", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValueMQTT104; } });
|
|
80
|
+
Object.defineProperty(exports, "opcuaJsonEncodeDataValueMQTT105", { enumerable: true, get: function () { return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValueMQTT105; } });
|
|
81
|
+
__exportStar(require("./json_basic_encoding_decoding_diagnosticinfo.js"), exports);
|
|
48
82
|
__exportStar(require("./json_basic_encoding_decoding_extension_object.js"), exports);
|
|
49
83
|
var json_basic_encoding_decoding_extension_object_js_1 = require("./json_basic_encoding_decoding_extension_object.js");
|
|
50
84
|
Object.defineProperty(exports, "opcuaJsonDecodeExtensionObject", { enumerable: true, get: function () { return json_basic_encoding_decoding_extension_object_js_1.opcuaJsonDecodeExtensionObject; } });
|
|
@@ -54,13 +88,14 @@ __exportStar(require("./json_basic_encoding_decoding_localizedtext.js"), exports
|
|
|
54
88
|
__exportStar(require("./json_basic_encoding_decoding_nodeid.js"), exports);
|
|
55
89
|
__exportStar(require("./json_basic_encoding_decoding_qualifiedname.js"), exports);
|
|
56
90
|
__exportStar(require("./json_basic_encoding_decoding_statuscode.js"), exports);
|
|
57
|
-
__exportStar(require("./json_basic_encoding_decoding_statuscode.js"), exports);
|
|
58
91
|
var json_basic_encoding_decoding_variant_js_1 = require("./json_basic_encoding_decoding_variant.js");
|
|
59
92
|
Object.defineProperty(exports, "opcuaJsonDecodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant; } });
|
|
93
|
+
Object.defineProperty(exports, "opcuaJsonDecodeVariant104", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant104; } });
|
|
60
94
|
// the explicit 1.05 entry points: the dispatcher above overloads Compact and Verbose together
|
|
61
95
|
// and so cannot return the 1.05 object shape for Verbose alone
|
|
62
96
|
Object.defineProperty(exports, "opcuaJsonDecodeVariant105", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonDecodeVariant105; } });
|
|
63
97
|
Object.defineProperty(exports, "opcuaJsonEncodeVariant", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant; } });
|
|
98
|
+
Object.defineProperty(exports, "opcuaJsonEncodeVariant104", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant104; } });
|
|
64
99
|
Object.defineProperty(exports, "opcuaJsonEncodeVariant105", { enumerable: true, get: function () { return json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105; } });
|
|
65
100
|
__exportStar(require("./json_encoding_scheme.js"), exports);
|
|
66
101
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yFAAyF;AACzF,yFAAyF;AACzF,4FAA4F;AAC5F,uDAAuC;AACvC,uDAAuC;AACvC,yDAAuC;AAEvC,wEAAsD;AACtD,gFAA8D;AAC9D,2GAasD;AATlD,sJAAA,wBAAwB,OAAA;AACxB,yJAAA,2BAA2B,OAAA;AAC3B,yJAAA,2BAA2B,OAAA;AAC3B,sJAAA,wBAAwB,OAAA;AACxB,yJAAA,2BAA2B,OAAA;AAC3B,yJAAA,2BAA2B,OAAA;AAC3B,0JAAA,4BAA4B,OAAA;AAC5B,6JAAA,+BAA+B,OAAA;AAC/B,6JAAA,+BAA+B,OAAA;AAEnC,mFAAiE;AACjE,qFAAmE;AACnE,uHAG4D;AAFxD,kKAAA,8BAA8B,OAAA;AAC9B,kKAAA,8BAA8B,OAAA;AAElC,0EAAwD;AACxD,kFAAgE;AAChE,2EAAyD;AACzD,kFAAgE;AAChE,+EAA6D;AAC7D,qGAYmD;AAX/C,iJAAA,sBAAsB,OAAA;AACtB,oJAAA,yBAAyB,OAAA;AACzB,8FAA8F;AAC9F,+DAA+D;AAC/D,oJAAA,yBAAyB,OAAA;AACzB,iJAAA,sBAAsB,OAAA;AACtB,oJAAA,yBAAyB,OAAA;AACzB,oJAAA,yBAAyB,OAAA;AAK7B,4DAA0C"}
|
|
@@ -29,6 +29,7 @@ const node_opcua_variant_1 = require("node-opcua-variant");
|
|
|
29
29
|
const json_basic_encoding_decoding_byte_string_js_1 = require("./json_basic_encoding_decoding_byte_string.js");
|
|
30
30
|
const json_basic_encoding_decoding_data_value_js_1 = require("./json_basic_encoding_decoding_data_value.js");
|
|
31
31
|
const json_basic_encoding_decoding_date_time_js_1 = require("./json_basic_encoding_decoding_date_time.js");
|
|
32
|
+
const json_basic_encoding_decoding_diagnosticinfo_js_1 = require("./json_basic_encoding_decoding_diagnosticinfo.js");
|
|
32
33
|
const json_basic_encoding_decoding_extension_object_js_1 = require("./json_basic_encoding_decoding_extension_object.js");
|
|
33
34
|
const json_basic_encoding_decoding_int64_js_1 = require("./json_basic_encoding_decoding_int64.js");
|
|
34
35
|
const json_basic_encoding_decoding_localizedtext_js_1 = require("./json_basic_encoding_decoding_localizedtext.js");
|
|
@@ -88,6 +89,8 @@ function bodyEncodeFunctor(dataType) {
|
|
|
88
89
|
case node_opcua_variant_1.DataType.Guid:
|
|
89
90
|
return opcuaJsonEncodeGuid;
|
|
90
91
|
case node_opcua_variant_1.DataType.String:
|
|
92
|
+
case node_opcua_variant_1.DataType.XmlElement:
|
|
93
|
+
// XmlElement values are encoded as a JSON string holding the XML text (Part 6, 5.4.2.9)
|
|
91
94
|
return opcuaJsonEncodeString;
|
|
92
95
|
case node_opcua_variant_1.DataType.ByteString:
|
|
93
96
|
return json_basic_encoding_decoding_byte_string_js_1.opcuaJsonEncodeByteString;
|
|
@@ -114,8 +117,7 @@ function bodyEncodeFunctor(dataType) {
|
|
|
114
117
|
case node_opcua_variant_1.DataType.DataValue:
|
|
115
118
|
return json_basic_encoding_decoding_data_value_js_1.opcuaJsonEncodeDataValue;
|
|
116
119
|
case node_opcua_variant_1.DataType.DiagnosticInfo:
|
|
117
|
-
|
|
118
|
-
throw new Error(`Unsupported yet ${node_opcua_variant_1.DataType[dataType]}`);
|
|
120
|
+
return json_basic_encoding_decoding_diagnosticinfo_js_1.opcuaJsonEncodeDiagnosticInfo;
|
|
119
121
|
default:
|
|
120
122
|
return () => null;
|
|
121
123
|
}
|
|
@@ -135,6 +137,7 @@ function bodyDecodeFunctor(dataType) {
|
|
|
135
137
|
case node_opcua_variant_1.DataType.String:
|
|
136
138
|
case node_opcua_variant_1.DataType.UInt16:
|
|
137
139
|
case node_opcua_variant_1.DataType.UInt32:
|
|
140
|
+
case node_opcua_variant_1.DataType.XmlElement:
|
|
138
141
|
return ((a) => a);
|
|
139
142
|
case node_opcua_variant_1.DataType.ByteString:
|
|
140
143
|
return json_basic_encoding_decoding_byte_string_js_1.opcuaJsonDecodeByteString;
|
|
@@ -161,8 +164,7 @@ function bodyDecodeFunctor(dataType) {
|
|
|
161
164
|
case node_opcua_variant_1.DataType.DataValue:
|
|
162
165
|
return json_basic_encoding_decoding_data_value_js_1.opcuaJsonDecodeDataValue;
|
|
163
166
|
case node_opcua_variant_1.DataType.DiagnosticInfo:
|
|
164
|
-
|
|
165
|
-
throw new Error(`Unsupported yet ${node_opcua_variant_1.DataType[dataType]}`);
|
|
167
|
+
return json_basic_encoding_decoding_diagnosticinfo_js_1.opcuaJsonDecodeDiagnosticInfo;
|
|
166
168
|
default:
|
|
167
169
|
return () => null;
|
|
168
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json_basic_encoding_body_functor.js","sourceRoot":"","sources":["../source/json_basic_encoding_body_functor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;
|
|
1
|
+
{"version":3,"file":"json_basic_encoding_body_functor.js","sourceRoot":"","sources":["../source/json_basic_encoding_body_functor.ts"],"names":[],"mappings":"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"}
|
|
@@ -64,13 +64,14 @@ export type DataValueJSON = DataValueJSON105;
|
|
|
64
64
|
* @returns
|
|
65
65
|
*/
|
|
66
66
|
export declare function opcuaJsonEncodeDataValueMQTT(dataValue: DataValue, encoding: JsonEncodingScheme, mask: DataSetFieldContentMask, namespaceArray?: string[]): VariantJSONBody | VariantJSON105 | VariantJSON104 | DataValueJSON105 | DataValueJSON104 | null;
|
|
67
|
+
export declare function opcuaJsonEncodeDataValueMQTT104(dataValue: DataValue, mode: JsonEncoderMode104, mask: DataSetFieldContentMask, namespaceArray?: string[]): VariantJSONBody | VariantJSON104 | DataValueJSON104 | null;
|
|
67
68
|
/**
|
|
68
69
|
*
|
|
69
70
|
* @param dataValue
|
|
70
71
|
* @param mask
|
|
71
72
|
* @returns
|
|
72
73
|
*/
|
|
73
|
-
export declare function
|
|
74
|
+
export declare function opcuaJsonEncodeDataValueMQTT105(dataValue: DataValue, mode: JsonEncoderMode105, mask: DataSetFieldContentMask, namespaceArray?: string[]): VariantJSONBody | DataValueJSON105 | null;
|
|
74
75
|
export declare function opcuaJsonEncodeDataValue104(dataValue: DataValue, mode: JsonEncoderMode104, namespaceArray: string[]): DataValueJSON104;
|
|
75
76
|
export declare function opcuaJsonEncodeDataValue105(dataValue: DataValue, mode: JsonEncoderMode105, namespaceArray: string[]): DataValueJSON105;
|
|
76
77
|
export declare function opcuaJsonEncodeDataValue(dataValue: DataValue, mode: JsonEncodingScheme.Compact | JsonEncodingScheme.Verbose, namespaceArray: string[]): DataValueJSON105;
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
*/
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.opcuaJsonEncodeDataValueMQTT = opcuaJsonEncodeDataValueMQTT;
|
|
27
|
-
exports.
|
|
27
|
+
exports.opcuaJsonEncodeDataValueMQTT104 = opcuaJsonEncodeDataValueMQTT104;
|
|
28
|
+
exports.opcuaJsonEncodeDataValueMQTT105 = opcuaJsonEncodeDataValueMQTT105;
|
|
28
29
|
exports.opcuaJsonEncodeDataValue104 = opcuaJsonEncodeDataValue104;
|
|
29
30
|
exports.opcuaJsonEncodeDataValue105 = opcuaJsonEncodeDataValue105;
|
|
30
31
|
exports.opcuaJsonEncodeDataValue = opcuaJsonEncodeDataValue;
|
|
@@ -97,19 +98,19 @@ function _decodeTimestampsAndStatusCodeJson(pojo, dataValueOpt) {
|
|
|
97
98
|
function opcuaJsonEncodeDataValueMQTT(dataValue, encoding, mask, namespaceArray = []) {
|
|
98
99
|
switch (encoding) {
|
|
99
100
|
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedNonReversible:
|
|
100
|
-
return
|
|
101
|
+
return opcuaJsonEncodeDataValueMQTT104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.NonReversible, mask, namespaceArray);
|
|
101
102
|
case json_encoding_scheme_js_1.JsonEncodingScheme.DeprecatedReversible:
|
|
102
|
-
return
|
|
103
|
+
return opcuaJsonEncodeDataValueMQTT104(dataValue, json_encoding_scheme_js_1.JsonEncoderMode104.Reversible, mask, namespaceArray);
|
|
103
104
|
case json_encoding_scheme_js_1.JsonEncodingScheme.Verbose:
|
|
104
|
-
return
|
|
105
|
+
return opcuaJsonEncodeDataValueMQTT105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Verbose, mask, namespaceArray);
|
|
105
106
|
case json_encoding_scheme_js_1.JsonEncodingScheme.Compact: {
|
|
106
|
-
return
|
|
107
|
+
return opcuaJsonEncodeDataValueMQTT105(dataValue, json_encoding_scheme_js_1.JsonEncoderMode105.Compact, mask, namespaceArray);
|
|
107
108
|
}
|
|
108
109
|
default:
|
|
109
110
|
throw new Error("Invalid JsonEncodingScheme");
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function opcuaJsonEncodeDataValueMQTT104(dataValue, mode, mask, namespaceArray = []) {
|
|
113
114
|
/**
|
|
114
115
|
* All fields with a concrete DataType are encoded using VerboseEncoding if FieldEncoding1 is
|
|
115
116
|
* FALSE and CompactEncoding if FieldEncoding1 is TRUE.
|
|
@@ -189,7 +190,7 @@ function _opcuaJsonEncodeDataValueMQTT104(dataValue, mode, mask, namespaceArray
|
|
|
189
190
|
* @param mask
|
|
190
191
|
* @returns
|
|
191
192
|
*/
|
|
192
|
-
function
|
|
193
|
+
function opcuaJsonEncodeDataValueMQTT105(dataValue, mode, mask, namespaceArray = []) {
|
|
193
194
|
if (mask === node_opcua_types_1.DataSetFieldContentMask.None) {
|
|
194
195
|
if (mode === json_encoding_scheme_js_1.JsonEncoderMode105.Verbose) {
|
|
195
196
|
return (0, json_basic_encoding_decoding_variant_js_1.opcuaJsonEncodeVariant105)(dataValue.value, mode, namespaceArray);
|