node-opcua-address-space 2.107.0 → 2.109.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 (30) hide show
  1. package/dist/source/helpers/coerce_enum_value.js +5 -4
  2. package/dist/source/helpers/coerce_enum_value.js.map +1 -1
  3. package/dist/source/loader/load_nodeset2.js +1 -1
  4. package/dist/source/loader/load_nodeset2.js.map +1 -1
  5. package/dist/src/_clone_helpers.d.ts +0 -0
  6. package/dist/src/_clone_helpers.js +2 -0
  7. package/dist/src/_clone_helpers.js.map +1 -0
  8. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +4 -0
  9. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  10. package/dist/src/base_node_impl.d.ts +2 -2
  11. package/dist/src/base_node_impl.js +3 -0
  12. package/dist/src/base_node_impl.js.map +1 -1
  13. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
  14. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
  15. package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
  16. package/dist/src/extension_object_array_node.js +2 -1
  17. package/dist/src/extension_object_array_node.js.map +1 -1
  18. package/dist/src/historical_access/address_space_historical_data_node.js +6 -1
  19. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
  20. package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +1 -1
  21. package/dist/src/ua_reference_type_impl.d.ts +1 -1
  22. package/dist/tsconfig_common.tsbuildinfo +1 -1
  23. package/package.json +39 -39
  24. package/source/helpers/coerce_enum_value.ts +5 -5
  25. package/source/loader/load_nodeset2.ts +1 -1
  26. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +1 -1
  27. package/src/base_node_impl.ts +6 -3
  28. package/src/extension_object_array_node.ts +4 -3
  29. package/src/historical_access/address_space_historical_data_node.ts +14 -3
  30. package/src/state_machine/ua_shelving_state_machine_ex.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-address-space",
3
- "version": "2.107.0",
3
+ "version": "2.109.0",
4
4
  "description": "pure nodejs OPCUA SDK - module address-space",
5
5
  "main": "./dist/src/index_current.js",
6
6
  "types": "./dist/source/index.d.ts",
@@ -16,57 +16,57 @@
16
16
  "c": "mocha --version"
17
17
  },
18
18
  "dependencies": {
19
- "@types/lodash": "4.14.195",
19
+ "@types/lodash": "4.14.197",
20
20
  "@types/semver": "^7.5.0",
21
21
  "async": "^3.2.4",
22
22
  "chalk": "4.1.2",
23
23
  "dequeue": "^1.0.5",
24
24
  "lodash": "4.17.21",
25
- "node-opcua-address-space-base": "2.107.0",
25
+ "node-opcua-address-space-base": "2.109.0",
26
26
  "node-opcua-assert": "2.105.0",
27
- "node-opcua-basic-types": "2.105.0",
28
- "node-opcua-binary-stream": "2.105.0",
29
- "node-opcua-client-dynamic-extension-object": "2.107.0",
27
+ "node-opcua-basic-types": "2.109.0",
28
+ "node-opcua-binary-stream": "2.109.0",
29
+ "node-opcua-client-dynamic-extension-object": "2.109.0",
30
30
  "node-opcua-constants": "2.98.1",
31
- "node-opcua-crypto": "3.0.6",
32
- "node-opcua-data-access": "2.107.0",
33
- "node-opcua-data-model": "2.105.0",
34
- "node-opcua-data-value": "2.105.0",
35
- "node-opcua-date-time": "2.105.0",
36
- "node-opcua-debug": "2.105.0",
37
- "node-opcua-enum": "2.105.0",
38
- "node-opcua-extension-object": "2.105.0",
39
- "node-opcua-factory": "2.105.0",
40
- "node-opcua-nodeid": "2.105.0",
41
- "node-opcua-nodeset-ua": "2.107.0",
42
- "node-opcua-numeric-range": "2.105.0",
43
- "node-opcua-object-registry": "2.105.0",
44
- "node-opcua-pseudo-session": "2.107.0",
45
- "node-opcua-service-browse": "2.107.0",
46
- "node-opcua-service-call": "2.107.0",
47
- "node-opcua-service-history": "2.107.0",
48
- "node-opcua-service-translate-browse-path": "2.107.0",
49
- "node-opcua-service-write": "2.107.0",
50
- "node-opcua-status-code": "2.105.0",
51
- "node-opcua-types": "2.107.0",
52
- "node-opcua-utils": "2.105.0",
53
- "node-opcua-variant": "2.105.0",
54
- "node-opcua-xml2json": "2.107.0",
55
- "semver": "^7.5.1",
31
+ "node-opcua-crypto": "4.1.0",
32
+ "node-opcua-data-access": "2.109.0",
33
+ "node-opcua-data-model": "2.109.0",
34
+ "node-opcua-data-value": "2.109.0",
35
+ "node-opcua-date-time": "2.109.0",
36
+ "node-opcua-debug": "2.109.0",
37
+ "node-opcua-enum": "2.109.0",
38
+ "node-opcua-extension-object": "2.109.0",
39
+ "node-opcua-factory": "2.109.0",
40
+ "node-opcua-nodeid": "2.109.0",
41
+ "node-opcua-nodeset-ua": "2.109.0",
42
+ "node-opcua-numeric-range": "2.109.0",
43
+ "node-opcua-object-registry": "2.109.0",
44
+ "node-opcua-pseudo-session": "2.109.0",
45
+ "node-opcua-service-browse": "2.109.0",
46
+ "node-opcua-service-call": "2.109.0",
47
+ "node-opcua-service-history": "2.109.0",
48
+ "node-opcua-service-translate-browse-path": "2.109.0",
49
+ "node-opcua-service-write": "2.109.0",
50
+ "node-opcua-status-code": "2.109.0",
51
+ "node-opcua-types": "2.109.0",
52
+ "node-opcua-utils": "2.109.0",
53
+ "node-opcua-variant": "2.109.0",
54
+ "node-opcua-xml2json": "2.109.0",
55
+ "semver": "^7.5.4",
56
56
  "set-prototype-of": "^1.0.0",
57
57
  "thenify": "^3.3.1",
58
58
  "xml-writer": "^1.7.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "mocha": "^10.2.0",
62
- "node-opcua-benchmarker": "2.105.0",
63
- "node-opcua-leak-detector": "2.105.0",
64
- "node-opcua-nodesets": "2.107.0",
65
- "node-opcua-packet-analyzer": "2.105.0",
66
- "node-opcua-service-filter": "2.107.0",
67
- "node-opcua-test-fixtures": "2.107.0",
62
+ "node-opcua-benchmarker": "2.109.0",
63
+ "node-opcua-leak-detector": "2.109.0",
64
+ "node-opcua-nodesets": "2.109.0",
65
+ "node-opcua-packet-analyzer": "2.109.0",
66
+ "node-opcua-service-filter": "2.109.0",
67
+ "node-opcua-test-fixtures": "2.109.0",
68
68
  "should": "^13.2.3",
69
- "sinon": "^15.1.0",
69
+ "sinon": "^15.2.0",
70
70
  "source-map-support": "^0.5.21"
71
71
  },
72
72
  "author": "Etienne Rossignon",
@@ -84,7 +84,7 @@
84
84
  "internet of things"
85
85
  ],
86
86
  "homepage": "http://node-opcua.github.io/",
87
- "gitHead": "df5c9168eea0d1a521603d181fa66ace7649e79e",
87
+ "gitHead": "50cfa07779d4c07b299176ac9c27527fcd97d079",
88
88
  "files": [
89
89
  "dist",
90
90
  "distHelpers",
@@ -2,7 +2,7 @@
2
2
  * @module node-opcua-address-space
3
3
  */
4
4
  import { assert } from "node-opcua-assert";
5
- import { Int64 } from "node-opcua-basic-types";
5
+ import { Int64, coerceInt64 } from "node-opcua-basic-types";
6
6
  import { coerceLocalizedText } from "node-opcua-data-model";
7
7
  import { EnumValueType } from "node-opcua-types";
8
8
  import { EnumValueTypeOptionsLike } from "../address_space_ts";
@@ -15,17 +15,17 @@ export function coerceEnumValues(enumValues: EnumValueTypeOptionsLike[] | { [key
15
15
  assert(Object.prototype.hasOwnProperty.call(en, "displayName"));
16
16
  return new EnumValueType({
17
17
  displayName: coerceLocalizedText(en.displayName),
18
- value: en.value
18
+ value: coerceInt64(en.value)
19
19
  });
20
20
  });
21
21
  } else {
22
22
  return coerceEnumValues(
23
- Object.entries(enumValues as { [key: string]: Int64 }).map((entrie: [string, Int64]) => {
24
- const [key, value] = entrie;
23
+ Object.entries(enumValues as { [key: string]: Int64 }).map((entry: [string, Int64]) => {
24
+ const [key, value] = entry;
25
25
  return new EnumValueType({
26
26
  description: coerceLocalizedText(key),
27
27
  displayName: coerceLocalizedText(key),
28
- value
28
+ value: coerceInt64(value)
29
29
  });
30
30
  })
31
31
  );
@@ -648,7 +648,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
648
648
  Value: {
649
649
  finish(this: any) {
650
650
  // Low part
651
- this.parent.enumValueType.value[1] = parseInt(this.text, 10);
651
+ this.parent.enumValueType.value = coerceInt64(parseInt(this.text, 10));
652
652
  }
653
653
  },
654
654
 
@@ -49,7 +49,7 @@ export const TwoWeeksDuration = OneDayDuration * 2 * 7;
49
49
  * of expiration. This alarm automatically returns to normal when the certificate is updated.
50
50
  */
51
51
  class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implements UACertificateExpirationAlarmEx {
52
- private timer: any;
52
+ private timer: NodeJS.Timeout | null = null;
53
53
 
54
54
  public static instantiate(
55
55
  namespace: INamespace,
@@ -178,7 +178,11 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
178
178
  return _private._displayName;
179
179
  }
180
180
 
181
- public setDisplayName(value: LocalizedText[]): void {
181
+
182
+ public setDisplayName(value: LocalizedTextLike[] | LocalizedTextLike): void {
183
+ if (!Array.isArray(value)) {
184
+ return this.setDisplayName([value]);
185
+ }
182
186
  this._setDisplayName(value);
183
187
  /**
184
188
  * fires when the displayName is changed.
@@ -193,8 +197,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
193
197
  return _private._description!;
194
198
  }
195
199
 
196
- public setDescription(value: LocalizedTextLike): void {
197
-
200
+ public setDescription(value: LocalizedTextLike| null): void {
198
201
  this._setDescription(value);
199
202
  /**
200
203
  * fires when the description attribute is changed.
@@ -4,7 +4,7 @@
4
4
  import { assert } from "node-opcua-assert";
5
5
 
6
6
  import { BrowseDirection, NodeClass } from "node-opcua-data-model";
7
- import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
7
+ import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
8
8
  import { NodeId } from "node-opcua-nodeid";
9
9
  import { Variant } from "node-opcua-variant";
10
10
  import { DataType } from "node-opcua-variant";
@@ -13,11 +13,12 @@ import { VariantArrayType } from "node-opcua-variant";
13
13
  import { ExtensionObject } from "node-opcua-extension-object";
14
14
  import { UADataType, UADynamicVariableArray, UAObject, UAReferenceType, UAVariable } from "node-opcua-address-space-base";
15
15
  import { UAVariableImpl } from "./ua_variable_impl";
16
- import { getProxyTarget } from "./ua_variable_impl_ext_obj";
17
16
 
18
17
  const doDebug = checkDebugFlag(__filename);
19
18
  const debugLog = make_debugLog(__filename);
20
19
  const errorLog = make_errorLog(__filename);
20
+ const warningLog= make_warningLog(__filename);
21
+
21
22
  /*
22
23
  * define a complex Variable containing a array of extension objects
23
24
  * each element of the array is also accessible as a component variable.
@@ -129,7 +130,7 @@ function _getElementBrowseName<T extends ExtensionObject>
129
130
  const indexPropertyName1 = this.$$indexPropertyName;
130
131
 
131
132
  if (!Object.prototype.hasOwnProperty.call(extObj, indexPropertyName1)) {
132
- console.log(" extension object do not have ", indexPropertyName1, extObj);
133
+ warningLog(" extension object does not have ", indexPropertyName1, extObj);
133
134
  }
134
135
  // assert(extObj.constructor === addressSpace.constructExtensionObject(dataType));
135
136
  assert(Object.prototype.hasOwnProperty.call(extObj, indexPropertyName1));
@@ -30,12 +30,15 @@ import {
30
30
  UAVariable,
31
31
  ContinuationData
32
32
  } from "node-opcua-address-space-base";
33
+ import { make_warningLog } from "node-opcua-debug";
33
34
  import { ISessionContext } from "node-opcua-address-space-base";
34
35
 
35
36
  import { UAVariableImpl } from "../ua_variable_impl";
36
37
  import { AddressSpace } from "../../source/address_space_ts";
37
38
  import { AddressSpacePrivate } from "../address_space_private";
38
39
 
40
+ const warningLog = make_warningLog(__filename);
41
+
39
42
  // tslint:disable:no-var-requires
40
43
  const Dequeue = require("dequeue");
41
44
 
@@ -138,12 +141,20 @@ export class VariableHistorian implements IVariableHistorian {
138
141
  // ensure that values are set with date increasing
139
142
  if (sourceTime.getTime() <= this.lastDate.getTime()) {
140
143
  if (!(sourceTime.getTime() === this.lastDate.getTime() && sourcePicoSeconds > this.lastDatePicoSeconds)) {
141
- console.log(
144
+ warningLog(
142
145
  chalk.red("Warning date not increasing "),
146
+ chalk.cyan("\n node: ", this.node.browseName.toString(), this.node.nodeId.toString()),
147
+ "\n new value = ",
143
148
  newDataValue.toString(),
144
- " last known date = ",
145
- this.lastDate
149
+ "\n last known date = ",
150
+ this.lastDate,
151
+ "\n last known picoSeconds = ",
152
+ this.lastDatePicoSeconds,
153
+ "\n lastValue = ",
154
+ this._timeline[this._timeline.length - 1]?.toString()
146
155
  );
156
+ // artificially increment date by one 100 picoseconds
157
+ newDataValue.sourcePicoseconds++;
147
158
  }
148
159
  }
149
160
 
@@ -26,14 +26,14 @@ const debugLog = make_debugLog(__filename);
26
26
  const doDebug = checkDebugFlag(__filename);
27
27
 
28
28
  export interface UAShelvedStateMachineHelper {
29
- _timer: NodeJS.Timer | null;
29
+ _timer: NodeJS.Timeout | null;
30
30
  _sheveldTime: Date;
31
31
  _unshelvedTime: Date;
32
32
  _duration: number;
33
33
  }
34
34
 
35
35
  export interface UAShelvedStateMachineExImpl extends UAShelvedStateMachineHelper {
36
- unshelveTime: UAProperty<number, /*z*/ DataType.Double>;
36
+ unshelveTime: UAProperty<number, /*z*/ DataType.Double>;
37
37
  unshelved: UAState;
38
38
  timedShelved: UAState;
39
39
  oneShotShelved: UAState;