node-opcua-client-dynamic-extension-object 2.70.1 → 2.71.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.
Files changed (34) hide show
  1. package/dist/client_dynamic_extension_object.d.ts +22 -0
  2. package/dist/client_dynamic_extension_object.js +1012 -0
  3. package/dist/client_dynamic_extension_object.js.map +1 -0
  4. package/dist/convert_data_type_definition_to_structuretype_schema.d.ts +12 -12
  5. package/dist/convert_data_type_definition_to_structuretype_schema.js +343 -331
  6. package/dist/convert_data_type_definition_to_structuretype_schema.js.map +1 -1
  7. package/dist/extra_data_type_manager.d.ts +16 -16
  8. package/dist/extra_data_type_manager.js +75 -75
  9. package/dist/get_extension_object_constructor.d.ts +7 -7
  10. package/dist/get_extension_object_constructor.js +37 -37
  11. package/dist/get_extra_data_type_manager.d.ts +3 -3
  12. package/dist/get_extra_data_type_manager.js +51 -51
  13. package/dist/index.d.ts +12 -12
  14. package/dist/index.js +28 -28
  15. package/dist/populate_data_type_manager.d.ts +3 -3
  16. package/dist/populate_data_type_manager.js +25 -25
  17. package/dist/private/find_encodings.d.ts +4 -4
  18. package/dist/private/find_encodings.js +55 -55
  19. package/dist/private/populate_data_type_manager_103.d.ts +9 -9
  20. package/dist/private/populate_data_type_manager_103.js +601 -601
  21. package/dist/private/populate_data_type_manager_104.d.ts +9 -9
  22. package/dist/private/populate_data_type_manager_104.js +182 -182
  23. package/dist/private/populate_data_type_manager_104.js.map +1 -1
  24. package/dist/promote_opaque_structure.d.ts +6 -6
  25. package/dist/promote_opaque_structure.js +41 -41
  26. package/dist/promote_opaque_structure_in_notification_data.d.ts +3 -3
  27. package/dist/promote_opaque_structure_in_notification_data.js +51 -51
  28. package/dist/resolve_dynamic_extension_object.d.ts +4 -4
  29. package/dist/resolve_dynamic_extension_object.js +105 -105
  30. package/dist/resolve_dynamic_extension_object.js.map +1 -1
  31. package/package.json +16 -16
  32. package/source/convert_data_type_definition_to_structuretype_schema.ts +43 -30
  33. package/source/private/populate_data_type_manager_104.ts +1 -0
  34. package/source/resolve_dynamic_extension_object.ts +13 -10
@@ -1,56 +1,56 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports._findEncodings = void 0;
13
- const node_opcua_data_model_1 = require("node-opcua-data-model");
14
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
15
- const node_opcua_pseudo_session_1 = require("node-opcua-pseudo-session");
16
- function _findEncodings(session, dataTypeNodeId) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const nodeToBrowse = {
19
- browseDirection: node_opcua_data_model_1.BrowseDirection.Forward,
20
- includeSubtypes: true,
21
- nodeClassMask: (0, node_opcua_data_model_1.makeNodeClassMask)("Object"),
22
- nodeId: dataTypeNodeId,
23
- referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasEncoding"),
24
- resultMask: (0, node_opcua_data_model_1.makeResultMask)("ReferenceType | IsForward | BrowseName | NodeClass | TypeDefinition")
25
- };
26
- const result = yield (0, node_opcua_pseudo_session_1.browseAll)(session, nodeToBrowse);
27
- const references = result.references || [];
28
- if (references.length === 0) {
29
- // xx throw new Error("Cannot find encodings on type " + dataTypeNodeId.toString() + " statusCode " + result.statusCode.toString());
30
- }
31
- const encodings = {
32
- dataTypeNodeId,
33
- binaryEncodingNodeId: new node_opcua_nodeid_1.NodeId(),
34
- jsonEncodingNodeId: new node_opcua_nodeid_1.NodeId(),
35
- xmlEncodingNodeId: new node_opcua_nodeid_1.NodeId()
36
- };
37
- for (const ref of references) {
38
- switch (ref.browseName.name) {
39
- case "Default Binary":
40
- encodings.binaryEncodingNodeId = ref.nodeId;
41
- break;
42
- case "Default XML":
43
- encodings.xmlEncodingNodeId = ref.nodeId;
44
- break;
45
- case "Default JSON":
46
- encodings.jsonEncodingNodeId = ref.nodeId;
47
- break;
48
- default:
49
- console.log(" ignoring encoding ", ref.browseName.toString());
50
- }
51
- }
52
- return encodings;
53
- });
54
- }
55
- exports._findEncodings = _findEncodings;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports._findEncodings = void 0;
13
+ const node_opcua_data_model_1 = require("node-opcua-data-model");
14
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
15
+ const node_opcua_pseudo_session_1 = require("node-opcua-pseudo-session");
16
+ function _findEncodings(session, dataTypeNodeId) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const nodeToBrowse = {
19
+ browseDirection: node_opcua_data_model_1.BrowseDirection.Forward,
20
+ includeSubtypes: true,
21
+ nodeClassMask: (0, node_opcua_data_model_1.makeNodeClassMask)("Object"),
22
+ nodeId: dataTypeNodeId,
23
+ referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasEncoding"),
24
+ resultMask: (0, node_opcua_data_model_1.makeResultMask)("ReferenceType | IsForward | BrowseName | NodeClass | TypeDefinition")
25
+ };
26
+ const result = yield (0, node_opcua_pseudo_session_1.browseAll)(session, nodeToBrowse);
27
+ const references = result.references || [];
28
+ if (references.length === 0) {
29
+ // xx throw new Error("Cannot find encodings on type " + dataTypeNodeId.toString() + " statusCode " + result.statusCode.toString());
30
+ }
31
+ const encodings = {
32
+ dataTypeNodeId,
33
+ binaryEncodingNodeId: new node_opcua_nodeid_1.NodeId(),
34
+ jsonEncodingNodeId: new node_opcua_nodeid_1.NodeId(),
35
+ xmlEncodingNodeId: new node_opcua_nodeid_1.NodeId()
36
+ };
37
+ for (const ref of references) {
38
+ switch (ref.browseName.name) {
39
+ case "Default Binary":
40
+ encodings.binaryEncodingNodeId = ref.nodeId;
41
+ break;
42
+ case "Default XML":
43
+ encodings.xmlEncodingNodeId = ref.nodeId;
44
+ break;
45
+ case "Default JSON":
46
+ encodings.jsonEncodingNodeId = ref.nodeId;
47
+ break;
48
+ default:
49
+ console.log(" ignoring encoding ", ref.browseName.toString());
50
+ }
51
+ }
52
+ return encodings;
53
+ });
54
+ }
55
+ exports._findEncodings = _findEncodings;
56
56
  //# sourceMappingURL=find_encodings.js.map
@@ -1,9 +1,9 @@
1
- import { IBasicSession } from "node-opcua-pseudo-session";
2
- import { ExtraDataTypeManager } from "../extra_data_type_manager";
3
- /**
4
- * Extract all custom dataType
5
- * @param session
6
- * @param dataTypeManager
7
- * @async
8
- */
9
- export declare function populateDataTypeManager103(session: IBasicSession, dataTypeManager: ExtraDataTypeManager): Promise<void>;
1
+ import { IBasicSession } from "node-opcua-pseudo-session";
2
+ import { ExtraDataTypeManager } from "../extra_data_type_manager";
3
+ /**
4
+ * Extract all custom dataType
5
+ * @param session
6
+ * @param dataTypeManager
7
+ * @async
8
+ */
9
+ export declare function populateDataTypeManager103(session: IBasicSession, dataTypeManager: ExtraDataTypeManager): Promise<void>;