node-opcua-modeler 2.56.0 → 2.59.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/.mocharc.js CHANGED
@@ -1,13 +1,13 @@
1
- module.exports = {
2
- recursive: true,
3
- diff: true,
4
- extension: [".ts", ".js"],
5
- spec: ["test/*.ts"],
6
- bail: true,
7
- timeout: 20000,
8
- require: [
9
- "../../node_modules/should",
10
- "../../node_modules/ts-node/register",
11
- "../../node_modules/source-map-support/register"
12
- ]
13
- };
1
+ module.exports = {
2
+ recursive: true,
3
+ diff: true,
4
+ extension: [".ts", ".js"],
5
+ spec: ["test/*.ts"],
6
+ bail: true,
7
+ timeout: 20000,
8
+ require: [
9
+ "should",
10
+ "ts-node/register",
11
+ "source-map-support/register"
12
+ ]
13
+ };
package/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014-2021 Etienne Rossignon
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2021 Etienne Rossignon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/MyModelIds.csv CHANGED
@@ -1,151 +1,151 @@
1
- BoilerType,1008,ObjectType
2
- BoilerType_DeviceHealth,1009,Variable
3
- BoilerType_ParameterSet,1010,Object
4
- BoilerType_ParameterSet_ParameterIdentifier>,1011,Variable
5
- BoilerType_ParameterSet_HumiditySetpoint,1012,Variable
6
- BoilerType_ParameterSet_TemperatureSetpoint,1013,Variable
7
- BoilerType_ParameterSet_ParameterIdentifier,1014,Variable
8
- NewBoilerType,1015,ObjectType
9
- NewBoilerType_DeviceHealth,1016,Variable
10
- NewBoilerType_ParameterSet,1017,Object
11
- NewBoilerType_ParameterSet_ParameterIdentifier,1018,Variable
12
- NewBoilerType_ParameterSet_HumiditySetpoint,1019,Variable
13
- NewBoilerType_ParameterSet_TemperatureSetpoint,1020,Variable
14
- FlowTo,1021,ReferenceType
15
- HotFlowTo,1022,ReferenceType
16
- SignalTo,1023,ReferenceType
17
- BoilerHaltedEventType,1024,ObjectType
18
- CustomControllerType,1025,ObjectType
19
- CustomControllerType_Input1,1026,Variable
20
- CustomControllerType_Input2,1027,Variable
21
- CustomControllerType_Input3,1028,Variable
22
- CustomControllerType_ControlOut,1029,Variable
23
- CustomControllerType_Description,1030,Variable
24
- GenericSensorType,1031,ObjectType
25
- GenericSensorType_Output,1032,Variable
26
- GenericSensorType_Output_EURange,1033,Variable
27
- GenericControllerType,1034,ObjectType
28
- GenericControllerType_ControlOut,1035,Variable
29
- GenericControllerType_Measurement,1036,Variable
30
- GenericControllerType_SetPoint,1037,Variable
31
- FlowControllerType,1038,ObjectType
32
- LevelControllerType,1039,ObjectType
33
- FlowTransmitterType,1040,ObjectType
34
- LevelIndicatorType,1041,ObjectType
35
- GenericActuatorType,1042,ObjectType
36
- GenericActuatorType_Input,1043,Variable
37
- GenericActuatorType_Input_EURange,1044,Variable
38
- ValveType,1045,ObjectType
39
- BoilerInputPipeType,1046,ObjectType
40
- BoilerInputPipeType_FTX001,1047,Object
41
- BoilerInputPipeType_FTX001_Output,1048,Variable
42
- BoilerInputPipeType_FTX001_Output_EURange,1049,Variable
43
- BoilerInputPipeType_ValveX001,1050,Object
44
- BoilerInputPipeType_ValveX001_Input,1051,Variable
45
- BoilerInputPipeType_ValveX001_Input_EURange,1052,Variable
46
- BoilerOutputPipeType,1053,ObjectType
47
- BoilerOutputPipeType_FTX002,1054,Object
48
- BoilerOutputPipeType_FTX002_Output,1055,Variable
49
- BoilerOutputPipeType_FTX002_Output_EURange,1056,Variable
50
- BoilerDrumType,1057,ObjectType
51
- BoilerDrumType_LIX001,1058,Object
52
- BoilerDrumType_LIX001_Output,1059,Variable
53
- BoilerDrumType_LIX001_Output_EURange,1060,Variable
54
- BoilerStateMachineType,1061,ObjectType
55
- BoilerStateMachineType_Halt,1062,Method
56
- BoilerStateMachineType_Reset,1063,Method
57
- BoilerStateMachineType_Start,1064,Method
58
- BoilerStateMachineType_Suspend,1065,Method
59
- BoilerStateMachineType_Resume,1066,Method
60
- BoilerType_CCX001,1067,Object
61
- BoilerType_CCX001_Input1,1068,Variable
62
- BoilerType_CCX001_Input2,1069,Variable
63
- BoilerType_CCX001_Input3,1070,Variable
64
- BoilerType_CCX001_ControlOut,1071,Variable
65
- BoilerType_CCX001_Description,1072,Variable
66
- BoilerType_FCX001,1073,Object
67
- BoilerType_FCX001_ControlOut,1074,Variable
68
- BoilerType_FCX001_Measurement,1075,Variable
69
- BoilerType_FCX001_SetPoint,1076,Variable
70
- BoilerType_LCX001,1077,Object
71
- BoilerType_LCX001_ControlOut,1078,Variable
72
- BoilerType_LCX001_Measurement,1079,Variable
73
- BoilerType_LCX001_SetPoint,1080,Variable
74
- BoilerType_PipeX001,1081,Object
75
- BoilerType_PipeX001_FTX001,1082,Object
76
- BoilerType_PipeX001_FTX001_Output,1083,Variable
77
- BoilerType_PipeX001_FTX001_Output_EURange,1084,Variable
78
- BoilerType_PipeX001_ValveX001,1085,Object
79
- BoilerType_PipeX001_ValveX001_Input,1086,Variable
80
- BoilerType_PipeX001_ValveX001_Input_EURange,1087,Variable
81
- BoilerType_DrumX001,1088,Object
82
- BoilerType_DrumX001_LIX001,1089,Object
83
- BoilerType_DrumX001_LIX001_Output,1090,Variable
84
- BoilerType_DrumX001_LIX001_Output_EURange,1091,Variable
85
- BoilerType_PipeX002,1092,Object
86
- BoilerType_PipeX002_FTX002,1093,Object
87
- BoilerType_PipeX002_FTX002_Output,1094,Variable
88
- BoilerType_PipeX002_FTX002_Output_EURange,1095,Variable
89
- BoilerType_Simulation,1096,Object
90
- BoilerType_Simulation_Halt,1097,Method
91
- BoilerType_Simulation_Reset,1098,Method
92
- BoilerType_Simulation_Start,1099,Method
93
- BoilerType_Simulation_Suspend,1100,Method
94
- BoilerType_Simulation_Resume,1101,Method
95
- BoilerType_Simulation_CurrentState,1102,Variable
96
- BoilerType_Simulation_CurrentState_Id,1103,Variable
97
- BoilerType_Simulation_CurrentState_Number,1104,Variable
98
- BoilerType_Simulation_LastTransition,1105,Variable
99
- BoilerType_Simulation_LastTransition_Id,1106,Variable
100
- BoilerType_Simulation_LastTransition_Number,1107,Variable
101
- BoilerType_Simulation_LastTransition_TransitionTime,1108,Variable
102
- BoilerType_Simulation_Deletable,1109,Variable
103
- BoilerType_Simulation_AutoDelete,1110,Variable
104
- BoilerType_Simulation_RecycleCount,1111,Variable
105
- BoilerDeviceType,1112,ObjectType
106
- BoilerDeviceType_DeviceHealth,1113,Variable
107
- BoilerDeviceType_ParameterSet,1114,Object
108
- BoilerDeviceType_ParameterSet_ParameterIdentifier,1115,Variable
109
- BoilerDeviceType_ParameterSet_HumiditySetpoint,1116,Variable
110
- BoilerDeviceType_ParameterSet_TemperatureSetpoint,1117,Variable
111
- BoilerInputPipeType_FlowTransmitter,1118,Object
112
- BoilerInputPipeType_FlowTransmitter_Output,1119,Variable
113
- BoilerInputPipeType_FlowTransmitter_Output_EURange,1120,Variable
114
- BoilerInputPipeType_Valve,1121,Object
115
- BoilerInputPipeType_Valve_Input,1122,Variable
116
- BoilerInputPipeType_Valve_Input_EURange,1123,Variable
117
- BoilerOutputPipeType_FlowTransmitter,1124,Object
118
- BoilerOutputPipeType_FlowTransmitter_Output,1125,Variable
119
- BoilerOutputPipeType_FlowTransmitter_Output_EURange,1126,Variable
120
- BoilerDrumType_LevelIndicator,1127,Object
121
- BoilerDrumType_LevelIndicator_Output,1128,Variable
122
- BoilerDrumType_LevelIndicator_Output_EURange,1129,Variable
123
- BoilerType_CustomController,1130,Object
124
- BoilerType_CustomController_Input1,1131,Variable
125
- BoilerType_CustomController_Input2,1132,Variable
126
- BoilerType_CustomController_Input3,1133,Variable
127
- BoilerType_CustomController_ControlOut,1134,Variable
128
- BoilerType_CustomController_Description,1135,Variable
129
- BoilerType_FlowController,1136,Object
130
- BoilerType_FlowController_ControlOut,1137,Variable
131
- BoilerType_FlowController_Measurement,1138,Variable
132
- BoilerType_FlowController_SetPoint,1139,Variable
133
- BoilerType_LevelController,1140,Object
134
- BoilerType_LevelController_ControlOut,1141,Variable
135
- BoilerType_LevelController_Measurement,1142,Variable
136
- BoilerType_LevelController_SetPoint,1143,Variable
137
- BoilerType_InputPipe,1144,Object
138
- BoilerType_InputPipe_FlowTransmitter,1145,Object
139
- BoilerType_InputPipe_FlowTransmitter_Output,1146,Variable
140
- BoilerType_InputPipe_FlowTransmitter_Output_EURange,1147,Variable
141
- BoilerType_InputPipe_Valve,1148,Object
142
- BoilerType_InputPipe_Valve_Input,1149,Variable
143
- BoilerType_InputPipe_Valve_Input_EURange,1150,Variable
144
- BoilerType_BoilerDrum,1151,Object
145
- BoilerType_BoilerDrum_LevelIndicator,1152,Object
146
- BoilerType_BoilerDrum_LevelIndicator_Output,1153,Variable
147
- BoilerType_BoilerDrum_LevelIndicator_Output_EURange,1154,Variable
148
- BoilerType_OutputPipe,1155,Object
149
- BoilerType_OutputPipe_FlowTransmitter,1156,Object
150
- BoilerType_OutputPipe_FlowTransmitter_Output,1157,Variable
1
+ BoilerType,1008,ObjectType
2
+ BoilerType_DeviceHealth,1009,Variable
3
+ BoilerType_ParameterSet,1010,Object
4
+ BoilerType_ParameterSet_ParameterIdentifier>,1011,Variable
5
+ BoilerType_ParameterSet_HumiditySetpoint,1012,Variable
6
+ BoilerType_ParameterSet_TemperatureSetpoint,1013,Variable
7
+ BoilerType_ParameterSet_ParameterIdentifier,1014,Variable
8
+ NewBoilerType,1015,ObjectType
9
+ NewBoilerType_DeviceHealth,1016,Variable
10
+ NewBoilerType_ParameterSet,1017,Object
11
+ NewBoilerType_ParameterSet_ParameterIdentifier,1018,Variable
12
+ NewBoilerType_ParameterSet_HumiditySetpoint,1019,Variable
13
+ NewBoilerType_ParameterSet_TemperatureSetpoint,1020,Variable
14
+ FlowTo,1021,ReferenceType
15
+ HotFlowTo,1022,ReferenceType
16
+ SignalTo,1023,ReferenceType
17
+ BoilerHaltedEventType,1024,ObjectType
18
+ CustomControllerType,1025,ObjectType
19
+ CustomControllerType_Input1,1026,Variable
20
+ CustomControllerType_Input2,1027,Variable
21
+ CustomControllerType_Input3,1028,Variable
22
+ CustomControllerType_ControlOut,1029,Variable
23
+ CustomControllerType_Description,1030,Variable
24
+ GenericSensorType,1031,ObjectType
25
+ GenericSensorType_Output,1032,Variable
26
+ GenericSensorType_Output_EURange,1033,Variable
27
+ GenericControllerType,1034,ObjectType
28
+ GenericControllerType_ControlOut,1035,Variable
29
+ GenericControllerType_Measurement,1036,Variable
30
+ GenericControllerType_SetPoint,1037,Variable
31
+ FlowControllerType,1038,ObjectType
32
+ LevelControllerType,1039,ObjectType
33
+ FlowTransmitterType,1040,ObjectType
34
+ LevelIndicatorType,1041,ObjectType
35
+ GenericActuatorType,1042,ObjectType
36
+ GenericActuatorType_Input,1043,Variable
37
+ GenericActuatorType_Input_EURange,1044,Variable
38
+ ValveType,1045,ObjectType
39
+ BoilerInputPipeType,1046,ObjectType
40
+ BoilerInputPipeType_FTX001,1047,Object
41
+ BoilerInputPipeType_FTX001_Output,1048,Variable
42
+ BoilerInputPipeType_FTX001_Output_EURange,1049,Variable
43
+ BoilerInputPipeType_ValveX001,1050,Object
44
+ BoilerInputPipeType_ValveX001_Input,1051,Variable
45
+ BoilerInputPipeType_ValveX001_Input_EURange,1052,Variable
46
+ BoilerOutputPipeType,1053,ObjectType
47
+ BoilerOutputPipeType_FTX002,1054,Object
48
+ BoilerOutputPipeType_FTX002_Output,1055,Variable
49
+ BoilerOutputPipeType_FTX002_Output_EURange,1056,Variable
50
+ BoilerDrumType,1057,ObjectType
51
+ BoilerDrumType_LIX001,1058,Object
52
+ BoilerDrumType_LIX001_Output,1059,Variable
53
+ BoilerDrumType_LIX001_Output_EURange,1060,Variable
54
+ BoilerStateMachineType,1061,ObjectType
55
+ BoilerStateMachineType_Halt,1062,Method
56
+ BoilerStateMachineType_Reset,1063,Method
57
+ BoilerStateMachineType_Start,1064,Method
58
+ BoilerStateMachineType_Suspend,1065,Method
59
+ BoilerStateMachineType_Resume,1066,Method
60
+ BoilerType_CCX001,1067,Object
61
+ BoilerType_CCX001_Input1,1068,Variable
62
+ BoilerType_CCX001_Input2,1069,Variable
63
+ BoilerType_CCX001_Input3,1070,Variable
64
+ BoilerType_CCX001_ControlOut,1071,Variable
65
+ BoilerType_CCX001_Description,1072,Variable
66
+ BoilerType_FCX001,1073,Object
67
+ BoilerType_FCX001_ControlOut,1074,Variable
68
+ BoilerType_FCX001_Measurement,1075,Variable
69
+ BoilerType_FCX001_SetPoint,1076,Variable
70
+ BoilerType_LCX001,1077,Object
71
+ BoilerType_LCX001_ControlOut,1078,Variable
72
+ BoilerType_LCX001_Measurement,1079,Variable
73
+ BoilerType_LCX001_SetPoint,1080,Variable
74
+ BoilerType_PipeX001,1081,Object
75
+ BoilerType_PipeX001_FTX001,1082,Object
76
+ BoilerType_PipeX001_FTX001_Output,1083,Variable
77
+ BoilerType_PipeX001_FTX001_Output_EURange,1084,Variable
78
+ BoilerType_PipeX001_ValveX001,1085,Object
79
+ BoilerType_PipeX001_ValveX001_Input,1086,Variable
80
+ BoilerType_PipeX001_ValveX001_Input_EURange,1087,Variable
81
+ BoilerType_DrumX001,1088,Object
82
+ BoilerType_DrumX001_LIX001,1089,Object
83
+ BoilerType_DrumX001_LIX001_Output,1090,Variable
84
+ BoilerType_DrumX001_LIX001_Output_EURange,1091,Variable
85
+ BoilerType_PipeX002,1092,Object
86
+ BoilerType_PipeX002_FTX002,1093,Object
87
+ BoilerType_PipeX002_FTX002_Output,1094,Variable
88
+ BoilerType_PipeX002_FTX002_Output_EURange,1095,Variable
89
+ BoilerType_Simulation,1096,Object
90
+ BoilerType_Simulation_Halt,1097,Method
91
+ BoilerType_Simulation_Reset,1098,Method
92
+ BoilerType_Simulation_Start,1099,Method
93
+ BoilerType_Simulation_Suspend,1100,Method
94
+ BoilerType_Simulation_Resume,1101,Method
95
+ BoilerType_Simulation_CurrentState,1102,Variable
96
+ BoilerType_Simulation_CurrentState_Id,1103,Variable
97
+ BoilerType_Simulation_CurrentState_Number,1104,Variable
98
+ BoilerType_Simulation_LastTransition,1105,Variable
99
+ BoilerType_Simulation_LastTransition_Id,1106,Variable
100
+ BoilerType_Simulation_LastTransition_Number,1107,Variable
101
+ BoilerType_Simulation_LastTransition_TransitionTime,1108,Variable
102
+ BoilerType_Simulation_Deletable,1109,Variable
103
+ BoilerType_Simulation_AutoDelete,1110,Variable
104
+ BoilerType_Simulation_RecycleCount,1111,Variable
105
+ BoilerDeviceType,1112,ObjectType
106
+ BoilerDeviceType_DeviceHealth,1113,Variable
107
+ BoilerDeviceType_ParameterSet,1114,Object
108
+ BoilerDeviceType_ParameterSet_ParameterIdentifier,1115,Variable
109
+ BoilerDeviceType_ParameterSet_HumiditySetpoint,1116,Variable
110
+ BoilerDeviceType_ParameterSet_TemperatureSetpoint,1117,Variable
111
+ BoilerInputPipeType_FlowTransmitter,1118,Object
112
+ BoilerInputPipeType_FlowTransmitter_Output,1119,Variable
113
+ BoilerInputPipeType_FlowTransmitter_Output_EURange,1120,Variable
114
+ BoilerInputPipeType_Valve,1121,Object
115
+ BoilerInputPipeType_Valve_Input,1122,Variable
116
+ BoilerInputPipeType_Valve_Input_EURange,1123,Variable
117
+ BoilerOutputPipeType_FlowTransmitter,1124,Object
118
+ BoilerOutputPipeType_FlowTransmitter_Output,1125,Variable
119
+ BoilerOutputPipeType_FlowTransmitter_Output_EURange,1126,Variable
120
+ BoilerDrumType_LevelIndicator,1127,Object
121
+ BoilerDrumType_LevelIndicator_Output,1128,Variable
122
+ BoilerDrumType_LevelIndicator_Output_EURange,1129,Variable
123
+ BoilerType_CustomController,1130,Object
124
+ BoilerType_CustomController_Input1,1131,Variable
125
+ BoilerType_CustomController_Input2,1132,Variable
126
+ BoilerType_CustomController_Input3,1133,Variable
127
+ BoilerType_CustomController_ControlOut,1134,Variable
128
+ BoilerType_CustomController_Description,1135,Variable
129
+ BoilerType_FlowController,1136,Object
130
+ BoilerType_FlowController_ControlOut,1137,Variable
131
+ BoilerType_FlowController_Measurement,1138,Variable
132
+ BoilerType_FlowController_SetPoint,1139,Variable
133
+ BoilerType_LevelController,1140,Object
134
+ BoilerType_LevelController_ControlOut,1141,Variable
135
+ BoilerType_LevelController_Measurement,1142,Variable
136
+ BoilerType_LevelController_SetPoint,1143,Variable
137
+ BoilerType_InputPipe,1144,Object
138
+ BoilerType_InputPipe_FlowTransmitter,1145,Object
139
+ BoilerType_InputPipe_FlowTransmitter_Output,1146,Variable
140
+ BoilerType_InputPipe_FlowTransmitter_Output_EURange,1147,Variable
141
+ BoilerType_InputPipe_Valve,1148,Object
142
+ BoilerType_InputPipe_Valve_Input,1149,Variable
143
+ BoilerType_InputPipe_Valve_Input_EURange,1150,Variable
144
+ BoilerType_BoilerDrum,1151,Object
145
+ BoilerType_BoilerDrum_LevelIndicator,1152,Object
146
+ BoilerType_BoilerDrum_LevelIndicator_Output,1153,Variable
147
+ BoilerType_BoilerDrum_LevelIndicator_Output_EURange,1154,Variable
148
+ BoilerType_OutputPipe,1155,Object
149
+ BoilerType_OutputPipe_FlowTransmitter,1156,Object
150
+ BoilerType_OutputPipe_FlowTransmitter_Output,1157,Variable
151
151
  BoilerType_OutputPipe_FlowTransmitter_Output_EURange,1158,Variable
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
- import { Namespace, UADataType, UAObject, UAVariable, UAVariableType, UADataTypeDictionary } from "node-opcua-address-space";
1
+ import { Namespace, UADataType, UAObject, UAVariableType } from "node-opcua-address-space";
3
2
  import { LocalizedTextLike, QualifiedNameLike } from "node-opcua-data-model";
4
3
  import { NodeId } from "node-opcua-nodeid";
5
4
  import { StructureDefinitionOptions } from "node-opcua-types";
@@ -8,8 +7,6 @@ import { StructureDefinitionOptions } from "node-opcua-types";
8
7
  * used up to version 1.03
9
8
  */
10
9
  export declare function getOrCreateDataTypeSystem(namespace: Namespace): UAObject;
11
- export declare function getDataTypeDictionary(namespace: Namespace): UADataTypeDictionary<Buffer>;
12
- export declare function addDataTypeDescription(namespace: Namespace, dataType: UADataType): UAVariable;
13
10
  export interface ExtensionObjectDefinition {
14
11
  browseName: QualifiedNameLike;
15
12
  description: LocalizedTextLike;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.addVariableTypeForDataType = exports.addExtensionObjectDataType = exports.addDataTypeDescription = exports.getDataTypeDictionary = exports.getOrCreateDataTypeSystem = void 0;
12
+ exports.addVariableTypeForDataType = exports.addExtensionObjectDataType = exports.getOrCreateDataTypeSystem = void 0;
13
13
  const node_opcua_address_space_1 = require("node-opcua-address-space");
14
14
  const node_opcua_assert_1 = require("node-opcua-assert");
15
15
  const node_opcua_client_dynamic_extension_object_1 = require("node-opcua-client-dynamic-extension-object");
@@ -17,7 +17,6 @@ const node_opcua_data_model_1 = require("node-opcua-data-model");
17
17
  const node_opcua_nodeid_1 = require("node-opcua-nodeid");
18
18
  const node_opcua_schemas_1 = require("node-opcua-schemas");
19
19
  const node_opcua_types_1 = require("node-opcua-types");
20
- const node_opcua_variant_1 = require("node-opcua-variant");
21
20
  /**
22
21
  * create the deprecated DataTypeDictionary node that was
23
22
  * used up to version 1.03
@@ -34,66 +33,6 @@ function getOrCreateDataTypeSystem(namespace) {
34
33
  return opcBinaryTypeSystem;
35
34
  }
36
35
  exports.getOrCreateDataTypeSystem = getOrCreateDataTypeSystem;
37
- function getDataTypeDictionary(namespace) {
38
- const addressSpace = namespace.addressSpace;
39
- const opcBinaryTypeSystem = getOrCreateDataTypeSystem(namespace);
40
- (0, node_opcua_assert_1.default)(opcBinaryTypeSystem.nodeId.toString() === "ns=0;i=93");
41
- const name = namespace.namespaceUri.replace(/.*:/, "");
42
- const node = opcBinaryTypeSystem.getComponentByName(name);
43
- if (node) {
44
- (0, node_opcua_assert_1.default)(node.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
45
- // already exits ....
46
- return node;
47
- }
48
- const dataTypeDictionaryType = addressSpace.findVariableType("DataTypeDictionaryType");
49
- /* istanbul ignore next */
50
- if (!dataTypeDictionaryType) {
51
- throw new Error("Cannot find DataTypeDictionaryType");
52
- }
53
- const dataTypeDictionary = dataTypeDictionaryType.instantiate({
54
- browseName: name,
55
- description: `Collects the data type descriptions of ${namespace.namespaceUri}`,
56
- componentOf: opcBinaryTypeSystem,
57
- optionals: ["Deprecated", "DataTypeVersion", "NamespaceUri"]
58
- });
59
- dataTypeDictionary.bindVariable({
60
- get: () => {
61
- const bsd = (0, node_opcua_address_space_1.dumpToBSD)(namespace);
62
- return new node_opcua_variant_1.Variant({
63
- dataType: node_opcua_variant_1.DataType.ByteString,
64
- value: Buffer.from(bsd, "utf-8")
65
- });
66
- }
67
- });
68
- const namespaceUriProp = dataTypeDictionary.getPropertyByName("NamespaceUri");
69
- if (namespaceUriProp) {
70
- namespaceUriProp.setValueFromSource({ dataType: node_opcua_variant_1.DataType.String, value: namespace.namespaceUri });
71
- }
72
- const deprecatedProp = dataTypeDictionary.getPropertyByName("Deprecated");
73
- if (deprecatedProp) {
74
- deprecatedProp.setValueFromSource({ dataType: node_opcua_variant_1.DataType.Boolean, value: true });
75
- }
76
- return dataTypeDictionary;
77
- }
78
- exports.getDataTypeDictionary = getDataTypeDictionary;
79
- function addDataTypeDescription(namespace, dataType) {
80
- const addressSpace = namespace.addressSpace;
81
- const dataTypeDictionary = getDataTypeDictionary(namespace);
82
- const dataTypeDescriptionType = addressSpace.findVariableType("DataTypeDescriptionType");
83
- if (!dataTypeDescriptionType) {
84
- throw new Error("Cannot find DataTypeDescriptionType");
85
- }
86
- const dataTypeDescription = dataTypeDescriptionType.instantiate({
87
- browseName: dataType.browseName.name,
88
- componentOf: dataTypeDictionary
89
- });
90
- dataTypeDescription.setValueFromSource({
91
- dataType: node_opcua_variant_1.DataType.String,
92
- value: dataType.browseName.name
93
- });
94
- return dataTypeDescription;
95
- }
96
- exports.addDataTypeDescription = addDataTypeDescription;
97
36
  function addExtensionObjectDataType(namespace, options) {
98
37
  return __awaiter(this, void 0, void 0, function* () {
99
38
  const addressSpace = namespace.addressSpace;
@@ -127,14 +66,6 @@ function addExtensionObjectDataType(namespace, options) {
127
66
  (0, node_opcua_assert_1.default)(defaultBinary.browseName.toString() === "Default Binary");
128
67
  dataType.$definition = new node_opcua_types_1.StructureDefinition(structureDefinition);
129
68
  (0, node_opcua_assert_1.default)(!node_opcua_nodeid_1.NodeId.sameNodeId(dataType.$definition.baseDataType, node_opcua_nodeid_1.NodeId.nullNodeId));
130
- const dataTypeDescription = addDataTypeDescription(namespace, dataType);
131
- defaultBinary.addReference({
132
- isForward: true,
133
- nodeId: dataTypeDescription,
134
- referenceType: "HasDescription"
135
- });
136
- const v = dataType.getEncodingNode("Default Binary");
137
- (0, node_opcua_assert_1.default)((v === null || v === void 0 ? void 0 : v.browseName.toString()) === "Default Binary");
138
69
  /// --------------- Create constructor
139
70
  const dataTypeManager = addressSpace.$$extraDataTypeManager;
140
71
  const dataTypeFactory = dataTypeManager.getDataTypeFactory(namespace.index);
@@ -1 +1 @@
1
- {"version":3,"file":"addExtensionObjectDataType.js","sourceRoot":"","sources":["../source/addExtensionObjectDataType.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAYkC;AAClC,yDAAuC;AACvC,2GAAkI;AAClI,iEAA6G;AAE7G,yDAA0D;AAC1D,2DAAoE;AACpE,uDAAmF;AACnF,2DAAuD;AAEvD;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,SAAoB;IAC1D,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;IAE5C,MAAM,mBAAmB,GAAG,YAAY,CAAC,QAAQ,CAAC,4BAA4B,CAAa,CAAC;IAC5F,0BAA0B;IAC1B,IAAI,CAAC,mBAAmB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC7D;IACD,IAAA,2BAAM,EAAC,mBAAm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CAAC,CAAC;YAChE,cAAc,GAAG,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAE,CAAC;YAChF,MAAM,IAAI,GAAG,cAAc,CAAC,WAAW,CAAC;gBACpC,UAAU,EAAE,KAAK,CAAC,IAAK;gBACvB,WAAW,EAAE,YAAY;gBACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,aAAa,EAAE,WAAW;gBAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS;aAClE,CAAC,CAAC;SACN;aAAM;YACH,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC;gBAC/B,UAAU,EAAE,KAAK,CAAC,IAAK;gBACvB,WAAW,EAAE,YAAY;gBACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,aAAa,EAAE,WAAW;gBAC1B,cAAc;gBACd,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS;aAClE,CAAC,CAAC;SACN;KACJ;IACD,OAAO,YAAY,CAAC;AACxB,CAAC;AA/CD,gEA+CC"}
@@ -1,5 +1,5 @@
1
1
  export * from "./symbol_cvs";
2
2
  export * from "./build_model";
3
3
  export * from "./build_documentation_to_file";
4
- export * from "../dist";
4
+ export * from "../source/index";
5
5
  export { generateAddressSpace } from "node-opcua-address-space/nodeJS";
@@ -14,7 +14,7 @@ exports.generateAddressSpace = void 0;
14
14
  __exportStar(require("./symbol_cvs"), exports);
15
15
  __exportStar(require("./build_model"), exports);
16
16
  __exportStar(require("./build_documentation_to_file"), exports);
17
- __exportStar(require("../dist"), exports);
17
+ __exportStar(require("../source/index"), exports);
18
18
  var nodeJS_1 = require("node-opcua-address-space/nodeJS");
19
19
  Object.defineProperty(exports, "generateAddressSpace", { enumerable: true, get: function () { return nodeJS_1.generateAddressSpace; } });
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../source_nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,gDAA8B;AAC9B,gEAA8C;AAC9C,0CAAwB;AACxB,0DAAsE;AAA7D,8GAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../source_nodejs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,gDAA8B;AAC9B,gEAA8C;AAC9C,kDAAgC;AAChC,0DAAsE;AAA7D,8GAAA,oBAAoB,OAAA"}
package/nodeJS.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./distNodeJS";
1
+ export * from "./distNodeJS";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-modeler",
3
- "version": "2.56.0",
3
+ "version": "2.59.0",
4
4
  "description": "pure nodejs OPCUA SDK - module - model",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,22 +15,22 @@
15
15
  "chalk": "4.1.2",
16
16
  "cli-table3": "^0.6.0",
17
17
  "csv-parse": "4.16.3",
18
- "node-opcua-address-space": "2.56.0",
18
+ "node-opcua-address-space": "2.59.0",
19
19
  "node-opcua-assert": "2.55.0",
20
- "node-opcua-basic-types": "2.56.0",
21
- "node-opcua-client-dynamic-extension-object": "2.56.0",
20
+ "node-opcua-basic-types": "2.57.0",
21
+ "node-opcua-client-dynamic-extension-object": "2.59.0",
22
22
  "node-opcua-constants": "2.52.0",
23
- "node-opcua-data-model": "2.56.0",
24
- "node-opcua-factory": "2.56.0",
23
+ "node-opcua-data-model": "2.57.0",
24
+ "node-opcua-factory": "2.57.0",
25
25
  "node-opcua-nodeid": "2.55.0",
26
- "node-opcua-nodesets": "2.51.0",
27
- "node-opcua-numeric-range": "2.56.0",
28
- "node-opcua-schemas": "2.56.0",
29
- "node-opcua-service-translate-browse-path": "2.56.0",
26
+ "node-opcua-nodesets": "2.57.0",
27
+ "node-opcua-numeric-range": "2.57.0",
28
+ "node-opcua-schemas": "2.59.0",
29
+ "node-opcua-service-translate-browse-path": "2.59.0",
30
30
  "node-opcua-status-code": "2.56.0",
31
- "node-opcua-types": "2.56.0",
32
- "node-opcua-variant": "2.56.0",
33
- "node-opcua-xml2json": "2.56.0"
31
+ "node-opcua-types": "2.59.0",
32
+ "node-opcua-variant": "2.59.0",
33
+ "node-opcua-xml2json": "2.57.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "node-opcua-leak-detector": "2.56.0",
@@ -49,5 +49,5 @@
49
49
  "internet of things"
50
50
  ],
51
51
  "homepage": "http://node-opcua.github.io/",
52
- "gitHead": "9f6eac1c658c0d182fbe03cf58f799af468615eb"
52
+ "gitHead": "ea10265745d3d4b8af249a4e13288ad71232706f"
53
53
  }
package/readme.md CHANGED
@@ -1,43 +1,43 @@
1
- ## Node-OPCUA Modeler
2
-
3
- Node-opcua-modeler provides a programatic way to conveniently create OPCUA model and nodeset files.
4
-
5
- ```typescript
6
- import {
7
- AddressSpace,
8
- buildModel,
9
- nodesets
10
- } from "node-opcua-modeler";
11
- import * as fs from "fs";
12
-
13
- // the namespaceUri
14
- const namespaceUri = "http://acme.com/Boiler/V0";
15
- const version= "1.0.0";
16
-
17
- // the nodeset file required by your model
18
- const xmlFiles: string[] = [
19
- nodesets.standard,
20
- nodesets.di
21
- ];
22
-
23
- async function createModel(addressSpace: AddressSpace): Promise<void> {
24
- // create your model here !
25
- }
26
-
27
- (async () => {
28
- try {
29
- const { markdown, xmlModel, symbols } = await buildModel({
30
- namespaceUri,
31
- version,
32
- xmlFiles,
33
- createModel
34
- });
35
- // save model to a file
36
- const nodesetFiename = "./MyModel.NodeSet2.xml";
37
- await fs.promises.writeFile(nodesetFiename, xmlModel, "utf-8");
38
-
39
- } catch (err) {
40
- console.log("Error", err);
41
- }
42
- })();
43
- ```
1
+ ## Node-OPCUA Modeler
2
+
3
+ Node-opcua-modeler provides a programatic way to conveniently create OPCUA model and nodeset files.
4
+
5
+ ```typescript
6
+ import {
7
+ AddressSpace,
8
+ buildModel,
9
+ nodesets
10
+ } from "node-opcua-modeler";
11
+ import * as fs from "fs";
12
+
13
+ // the namespaceUri
14
+ const namespaceUri = "http://acme.com/Boiler/V0";
15
+ const version= "1.0.0";
16
+
17
+ // the nodeset file required by your model
18
+ const xmlFiles: string[] = [
19
+ nodesets.standard,
20
+ nodesets.di
21
+ ];
22
+
23
+ async function createModel(addressSpace: AddressSpace): Promise<void> {
24
+ // create your model here !
25
+ }
26
+
27
+ (async () => {
28
+ try {
29
+ const { markdown, xmlModel, symbols } = await buildModel({
30
+ namespaceUri,
31
+ version,
32
+ xmlFiles,
33
+ createModel
34
+ });
35
+ // save model to a file
36
+ const nodesetFiename = "./MyModel.NodeSet2.xml";
37
+ await fs.promises.writeFile(nodesetFiename, xmlModel, "utf-8");
38
+
39
+ } catch (err) {
40
+ console.log("Error", err);
41
+ }
42
+ })();
43
+ ```
@@ -7,7 +7,6 @@ import {
7
7
  UAVariableT,
8
8
  UAVariableType,
9
9
  dumpToBSD,
10
- UADataTypeDictionary,
11
10
  DTDataTypeDefinition,
12
11
  UAProperty
13
12
  } from "node-opcua-address-space";
@@ -37,78 +36,6 @@ export function getOrCreateDataTypeSystem(namespace: Namespace): UAObject {
37
36
 
38
37
  return opcBinaryTypeSystem;
39
38
  }
40
-
41
- export function getDataTypeDictionary(namespace: Namespace): UADataTypeDictionary<Buffer> {
42
- const addressSpace = namespace.addressSpace;
43
-
44
- const opcBinaryTypeSystem = getOrCreateDataTypeSystem(namespace);
45
- assert(opcBinaryTypeSystem.nodeId.toString() === "ns=0;i=93");
46
-
47
- const name = namespace.namespaceUri.replace(/.*:/, "");
48
-
49
- const node: UAVariable = opcBinaryTypeSystem.getComponentByName(name) as UAVariable;
50
- if (node) {
51
- assert(node.nodeClass === NodeClass.Variable);
52
- // already exits ....
53
- return node as UADataTypeDictionary<Buffer>;
54
- }
55
-
56
- const dataTypeDictionaryType = addressSpace.findVariableType("DataTypeDictionaryType");
57
- /* istanbul ignore next */
58
- if (!dataTypeDictionaryType) {
59
- throw new Error("Cannot find DataTypeDictionaryType");
60
- }
61
- const dataTypeDictionary = dataTypeDictionaryType.instantiate({
62
- browseName: name!,
63
- description: `Collects the data type descriptions of ${namespace.namespaceUri}`,
64
-
65
- componentOf: opcBinaryTypeSystem,
66
-
67
- optionals: ["Deprecated", "DataTypeVersion", "NamespaceUri"]
68
- }) as UADataTypeDictionary<Buffer>;
69
-
70
- dataTypeDictionary.bindVariable({
71
- get: () => {
72
- const bsd = dumpToBSD(namespace);
73
- return new Variant({
74
- dataType: DataType.ByteString,
75
- value: Buffer.from(bsd, "utf-8")
76
- });
77
- }
78
- });
79
-
80
- const namespaceUriProp = dataTypeDictionary.getPropertyByName("NamespaceUri");
81
- if (namespaceUriProp) {
82
- namespaceUriProp.setValueFromSource({ dataType: DataType.String, value: namespace.namespaceUri });
83
- }
84
- const deprecatedProp = dataTypeDictionary.getPropertyByName("Deprecated");
85
- if (deprecatedProp) {
86
- deprecatedProp.setValueFromSource({ dataType: DataType.Boolean, value: true });
87
- }
88
- return dataTypeDictionary;
89
- }
90
-
91
- export function addDataTypeDescription(namespace: Namespace, dataType: UADataType) {
92
- const addressSpace = namespace.addressSpace;
93
-
94
- const dataTypeDictionary = getDataTypeDictionary(namespace);
95
-
96
- const dataTypeDescriptionType = addressSpace.findVariableType("DataTypeDescriptionType");
97
- if (!dataTypeDescriptionType) {
98
- throw new Error("Cannot find DataTypeDescriptionType");
99
- }
100
-
101
- const dataTypeDescription = dataTypeDescriptionType.instantiate({
102
- browseName: dataType.browseName.name!,
103
- componentOf: dataTypeDictionary
104
- });
105
- dataTypeDescription.setValueFromSource({
106
- dataType: DataType.String,
107
- value: dataType.browseName.name!
108
- });
109
-
110
- return dataTypeDescription;
111
- }
112
39
  export interface ExtensionObjectDefinition {
113
40
  browseName: QualifiedNameLike;
114
41
  description: LocalizedTextLike;
@@ -162,15 +89,6 @@ export async function addExtensionObjectDataType(namespace: Namespace, options:
162
89
  (dataType as any).$definition = new StructureDefinition(structureDefinition);
163
90
  assert(!NodeId.sameNodeId((dataType as any).$definition.baseDataType, NodeId.nullNodeId));
164
91
 
165
- const dataTypeDescription = addDataTypeDescription(namespace, dataType);
166
- defaultBinary.addReference({
167
- isForward: true,
168
- nodeId: dataTypeDescription,
169
- referenceType: "HasDescription"
170
- });
171
- const v = dataType.getEncodingNode("Default Binary")!;
172
- assert(v?.browseName.toString() === "Default Binary");
173
-
174
92
  /// --------------- Create constructor
175
93
  const dataTypeManager = (addressSpace as any).$$extraDataTypeManager as ExtraDataTypeManager;
176
94
  const dataTypeFactory = dataTypeManager.getDataTypeFactory(namespace.index);
@@ -200,9 +118,9 @@ export function addVariableTypeForDataType(namespace: Namespace, dataType: UADat
200
118
  throw new Error("dataType is not a structure");
201
119
  }
202
120
 
203
- const variableTypeName = dataType.browseName.name?.replace("DataType", "Type")!;
121
+ const variableTypeName = dataType.browseName.name?.replace("DataType", "Type");
204
122
  const variableType = namespace.addVariableType({
205
- browseName: variableTypeName,
123
+ browseName: variableTypeName!,
206
124
  dataType: dataType.nodeId
207
125
  });
208
126
 
package/source/symbol.ts CHANGED
@@ -1 +1 @@
1
- export type Symbols = [string, number, string][];
1
+ export type Symbols = [string, number, string][];
package/source/to_cvs.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Symbols } from "./symbol";
2
-
3
- export function toCSV(arr: Symbols) {
4
- const line: string[] = [];
5
- for (const [name, value, nodeClass] of arr) {
6
- line.push([name, value, nodeClass].join(","));
7
- }
8
- return line.join("\n");
9
- }
1
+ import { Symbols } from "./symbol";
2
+
3
+ export function toCSV(arr: Symbols) {
4
+ const line: string[] = [];
5
+ for (const [name, value, nodeClass] of arr) {
6
+ line.push([name, value, nodeClass].join(","));
7
+ }
8
+ return line.join("\n");
9
+ }
@@ -1,13 +1,13 @@
1
- import * as fs from "fs";
2
- import { Namespace } from "node-opcua-address-space";
3
- import { buildDocumentationToString } from "..";
4
-
5
- export async function buildDocumentationToFile(namespace: Namespace, filename: string) {
6
- const str = await buildDocumentationToString(namespace);
7
- const stream = fs.createWriteStream("documentation.md");
8
- stream.write(str);
9
- await new Promise((resolve) => {
10
- stream.on("finish", resolve);
11
- stream.end();
12
- });
13
- }
1
+ import * as fs from "fs";
2
+ import { Namespace } from "node-opcua-address-space";
3
+ import { buildDocumentationToString } from "..";
4
+
5
+ export async function buildDocumentationToFile(namespace: Namespace, filename: string) {
6
+ const str = await buildDocumentationToString(namespace);
7
+ const stream = fs.createWriteStream("documentation.md");
8
+ stream.write(str);
9
+ await new Promise((resolve) => {
10
+ stream.on("finish", resolve);
11
+ stream.end();
12
+ });
13
+ }
@@ -1,12 +1,12 @@
1
- import { readNodeSet2XmlFile } from "node-opcua-address-space/nodeJS";
2
-
3
- import { buildModelInner, BuildModelOptionsBase } from "..";
4
- import { Symbols } from "..";
5
-
6
- export async function buildModel(data: BuildModelOptionsBase): Promise<{ markdown: string; xmlModel: string; symbols: Symbols }> {
7
- const option1 = {
8
- ...data,
9
- xmlLoader: readNodeSet2XmlFile
10
- };
11
- return buildModelInner(option1);
12
- }
1
+ import { readNodeSet2XmlFile } from "node-opcua-address-space/nodeJS";
2
+
3
+ import { buildModelInner, BuildModelOptionsBase } from "..";
4
+ import { Symbols } from "..";
5
+
6
+ export async function buildModel(data: BuildModelOptionsBase): Promise<{ markdown: string; xmlModel: string; symbols: Symbols }> {
7
+ const option1 = {
8
+ ...data,
9
+ xmlLoader: readNodeSet2XmlFile
10
+ };
11
+ return buildModelInner(option1);
12
+ }
@@ -1,5 +1,5 @@
1
1
  export * from "./symbol_cvs";
2
2
  export * from "./build_model";
3
3
  export * from "./build_documentation_to_file";
4
- export * from "../dist";
4
+ export * from "../source/index";
5
5
  export { generateAddressSpace } from "node-opcua-address-space/nodeJS"