node-opcua-address-space 2.131.0 → 2.132.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-address-space",
3
- "version": "2.131.0",
3
+ "version": "2.132.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",
@@ -22,35 +22,35 @@
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.131.0",
25
+ "node-opcua-address-space-base": "2.132.0",
26
26
  "node-opcua-assert": "2.120.0",
27
- "node-opcua-basic-types": "2.131.0",
27
+ "node-opcua-basic-types": "2.132.0",
28
28
  "node-opcua-binary-stream": "2.128.0",
29
- "node-opcua-client-dynamic-extension-object": "2.131.0",
29
+ "node-opcua-client-dynamic-extension-object": "2.132.0",
30
30
  "node-opcua-constants": "2.125.0",
31
31
  "node-opcua-crypto": "4.9.4",
32
- "node-opcua-data-access": "2.131.0",
33
- "node-opcua-data-model": "2.131.0",
34
- "node-opcua-data-value": "2.131.0",
35
- "node-opcua-date-time": "2.128.0",
32
+ "node-opcua-data-access": "2.132.0",
33
+ "node-opcua-data-model": "2.132.0",
34
+ "node-opcua-data-value": "2.132.0",
35
+ "node-opcua-date-time": "2.132.0",
36
36
  "node-opcua-debug": "2.128.0",
37
37
  "node-opcua-enum": "2.128.0",
38
- "node-opcua-extension-object": "2.131.0",
39
- "node-opcua-factory": "2.131.0",
38
+ "node-opcua-extension-object": "2.132.0",
39
+ "node-opcua-factory": "2.132.0",
40
40
  "node-opcua-nodeid": "2.128.0",
41
- "node-opcua-nodeset-ua": "2.131.0",
42
- "node-opcua-numeric-range": "2.131.0",
41
+ "node-opcua-nodeset-ua": "2.132.0",
42
+ "node-opcua-numeric-range": "2.132.0",
43
43
  "node-opcua-object-registry": "2.128.0",
44
- "node-opcua-pseudo-session": "2.131.0",
45
- "node-opcua-service-browse": "2.131.0",
46
- "node-opcua-service-call": "2.131.0",
47
- "node-opcua-service-history": "2.131.0",
48
- "node-opcua-service-translate-browse-path": "2.131.0",
49
- "node-opcua-service-write": "2.131.0",
44
+ "node-opcua-pseudo-session": "2.132.0",
45
+ "node-opcua-service-browse": "2.132.0",
46
+ "node-opcua-service-call": "2.132.0",
47
+ "node-opcua-service-history": "2.132.0",
48
+ "node-opcua-service-translate-browse-path": "2.132.0",
49
+ "node-opcua-service-write": "2.132.0",
50
50
  "node-opcua-status-code": "2.128.0",
51
- "node-opcua-types": "2.131.0",
51
+ "node-opcua-types": "2.132.0",
52
52
  "node-opcua-utils": "2.128.0",
53
- "node-opcua-variant": "2.131.0",
53
+ "node-opcua-variant": "2.132.0",
54
54
  "node-opcua-xml2json": "2.128.0",
55
55
  "semver": "^7.6.3",
56
56
  "set-prototype-of": "^1.0.0",
@@ -61,9 +61,9 @@
61
61
  "node-opcua-benchmarker": "2.128.0",
62
62
  "node-opcua-leak-detector": "2.128.0",
63
63
  "node-opcua-nodesets": "2.121.0",
64
- "node-opcua-packet-analyzer": "2.131.0",
65
- "node-opcua-service-filter": "2.131.0",
66
- "node-opcua-test-fixtures": "2.131.0",
64
+ "node-opcua-packet-analyzer": "2.132.0",
65
+ "node-opcua-service-filter": "2.132.0",
66
+ "node-opcua-test-fixtures": "2.132.0",
67
67
  "source-map-support": "^0.5.21"
68
68
  },
69
69
  "author": "Etienne Rossignon",
@@ -81,7 +81,7 @@
81
81
  "internet of things"
82
82
  ],
83
83
  "homepage": "http://node-opcua.github.io/",
84
- "gitHead": "80f430dd3044826c904f803af40297839dd809be",
84
+ "gitHead": "5fab0f1eac0e59abf94bab9034035aec44890456",
85
85
  "files": [
86
86
  "dist",
87
87
  "distHelpers",
@@ -2,7 +2,7 @@ import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
2
2
  import { CallbackT } from "node-opcua-status-code";
3
3
  import { IAddressSpace, RequiredModel } from "node-opcua-address-space-base";
4
4
  import { ReaderStateParserLike, Xml2Json } from "node-opcua-xml2json";
5
- import { minDate } from "node-opcua-date-time";
5
+ import { getMinOPCUADate } from "node-opcua-date-time";
6
6
  import { adjustNamespaceArray } from "../../src/nodeset_tools/adjust_namespace_array";
7
7
  import { NodeSetLoaderOptions } from "../interfaces/nodeset_loader_options";
8
8
  import { NamespacePrivate } from "../../src/namespace_private";
@@ -85,7 +85,7 @@ async function parseDependencies(xmlData: string): Promise<NodesetInfo> {
85
85
  models.push({
86
86
  modelUri: namespaceUris[0],
87
87
  version: "1",
88
- publicationDate: minDate,
88
+ publicationDate: getMinOPCUADate(),
89
89
  requiredModel: []
90
90
  });
91
91
  }
@@ -4,7 +4,7 @@
4
4
  require("set-prototype-of");
5
5
  import { assert } from "node-opcua-assert";
6
6
  import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
7
- import { minDate } from "node-opcua-basic-types";
7
+ import { getMinOPCUADate } from "node-opcua-basic-types";
8
8
  import { StatusCode, StatusCodes } from "node-opcua-status-code";
9
9
  import { ISetStateOptions } from "../../source/interfaces/i_set_state_options";
10
10
  import { ConditionSnapshotImpl } from "./condition_snapshot_impl";
@@ -30,7 +30,7 @@ export function _setAckedState(
30
30
  // tslint:disable:max-classes-per-file
31
31
  function prepare_date(sourceTimestamp: { value: Date } | null) {
32
32
  if (!sourceTimestamp || !sourceTimestamp.value) {
33
- return minDate;
33
+ return getMinOPCUADate();
34
34
  }
35
35
  assert(sourceTimestamp.value instanceof Date);
36
36
  return sourceTimestamp;
@@ -542,8 +542,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
542
542
  * @param time {Date} : UTCTime
543
543
  */
544
544
  public setReceiveTime(time: UtcTime): void {
545
- if (!(time instanceof Date)) { throw new Error("setReceiveTime expecting a Date")};
546
- return this._set_var("ReceiveTime", DataType.DateTime, time, { sourceTimestamp: time });
545
+ return this._set_var("ReceiveTime", DataType.DateTime, time, { sourceTimestamp: time || undefined });
547
546
  }
548
547
 
549
548
  /**
@@ -2,7 +2,7 @@
2
2
  * @module node-opcua-address-space.AlarmsAndConditions
3
3
  */
4
4
  import { Certificate, exploreCertificate, makeSHA1Thumbprint } from "node-opcua-crypto";
5
- import { DateTime, minOPCUADate, StatusCodes } from "node-opcua-basic-types";
5
+ import { DateTime, getMinOPCUADate, isMinDate, StatusCodes } from "node-opcua-basic-types";
6
6
  import { make_warningLog } from "node-opcua-debug";
7
7
  import { NodeId } from "node-opcua-nodeid";
8
8
  import { DataType, Variant, VariantOptions } from "node-opcua-variant";
@@ -97,7 +97,7 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
97
97
 
98
98
  const certificate = this.getCertificate();
99
99
 
100
- if (!expirationDate || (expirationDate === minOPCUADate && !certificate)) {
100
+ if (!expirationDate || (isMinDate(expirationDate) && !certificate)) {
101
101
  if (!this.currentBranch() || this.currentBranch().getActiveState()) {
102
102
  this.updateAlarmState2(true, 255, "certificate is missing");
103
103
  }
@@ -163,13 +163,13 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
163
163
  private _extractAndSetExpiryDate(certificate: Certificate | null): void {
164
164
  if (certificate && certificate.length > 0) {
165
165
  const info = exploreCertificate(certificate);
166
- if (info.tbsCertificate.validity.notAfter instanceof Date) {
166
+ if (info.tbsCertificate.validity.notAfter) {
167
167
  this.setExpirationDate(info.tbsCertificate.validity.notAfter);
168
168
  } else {
169
- this.setExpirationDate(minOPCUADate);
169
+ this.setExpirationDate(getMinOPCUADate());
170
170
  }
171
171
  } else {
172
- this.setExpirationDate(minOPCUADate);
172
+ this.setExpirationDate(getMinOPCUADate());
173
173
  }
174
174
  }
175
175
 
@@ -18,7 +18,7 @@ import {
18
18
  QualifiedName
19
19
  } from "node-opcua-data-model";
20
20
  import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
21
- import { minDate } from "node-opcua-basic-types";
21
+ import { getMinOPCUADate } from "node-opcua-basic-types";
22
22
  import { coerceNodeId, makeNodeId, NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
23
23
  import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
24
24
  import { CallMethodResultOptions, TimeZoneDataType } from "node-opcua-types";
@@ -997,8 +997,8 @@ function UACondition_instantiate(
997
997
  );
998
998
  branch0.setMessage("");
999
999
 
1000
- branch0.setReceiveTime(minDate);
1001
- branch0.setTime(minDate);
1000
+ branch0.setReceiveTime(getMinOPCUADate());
1001
+ branch0.setTime(getMinOPCUADate());
1002
1002
 
1003
1003
  return conditionNode;
1004
1004
  }
@@ -17,13 +17,12 @@ import {
17
17
  makeAccessLevelFlag,
18
18
  QualifiedName
19
19
  } from "node-opcua-data-model";
20
- import { ExpandedNodeId, NodeId, NodeIdType, resolveNodeId } from "node-opcua-nodeid";
20
+ import { NodeId, NodeIdType, resolveNodeId } from "node-opcua-nodeid";
21
21
  import { lowerFirstLetter, isNullOrUndefined } from "node-opcua-utils";
22
22
  import { Variant, VariantArrayType, DataType } from "node-opcua-variant";
23
23
  import {
24
24
  IAddressSpace,
25
25
  BaseNode,
26
- INamespace,
27
26
  UADataType,
28
27
  UAMethod,
29
28
  UAObject,
@@ -33,10 +32,10 @@ import {
33
32
  UAVariableType,
34
33
  UAView
35
34
  } from "node-opcua-address-space-base";
36
- import { AttributeIds, Int64, minOPCUADate, StatusCode, StatusCodes } from "node-opcua-basic-types";
35
+ import { AttributeIds, Int64, isMinDate, StatusCode } from "node-opcua-basic-types";
37
36
  import { BrowseDescription, EnumDefinition, StructureDefinition, StructureType } from "node-opcua-types";
38
37
 
39
- import { ITranslationTable, XmlWriter } from "../../source/xml_writer";
38
+ import { XmlWriter } from "../../source/xml_writer";
40
39
  import { ReferenceImpl } from "../reference_impl";
41
40
  import { BaseNodeImpl, getReferenceType } from "../base_node_impl";
42
41
  import { UAReferenceTypeImpl } from "../ua_reference_type_impl";
@@ -50,7 +49,7 @@ import { UAVariableTypeImpl } from "../ua_variable_type_impl";
50
49
  import { SessionContext } from "../index_current";
51
50
  import { UAViewImpl } from "../ua_view_impl";
52
51
 
53
- import { DefinitionMap2, TypeInfo } from "../../source/loader/make_xml_extension_object_parser";
52
+ import { DefinitionMap2 } from "../../source/loader/make_xml_extension_object_parser";
54
53
  import { makeDefinitionMap } from "../../source/loader/decode_xml_extension_object";
55
54
  import {
56
55
  _constructNamespaceTranslationTable,
@@ -558,7 +557,7 @@ function _isDefaultValue(value: Variant): boolean {
558
557
  }
559
558
  break;
560
559
  case DataType.DateTime:
561
- if (!value.value || value.value.getTime() === minOPCUADate) {
560
+ if (!value.value || isMinDate(value.value)) {
562
561
  return true;
563
562
  }
564
563
  break;