node-opcua-address-space 2.138.0 → 2.139.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.138.0",
3
+ "version": "2.139.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",
@@ -12,7 +12,7 @@
12
12
  "test": "mocha",
13
13
  "lint": "eslint source test src source_nodejs test_helpers",
14
14
  "format": "prettier --write source test src source_nodejs test_helpers",
15
- "clean": "npx rimraf node_modules dist *.tsbuildinfo",
15
+ "clean": "npx rimraf -g node_modules dist *.tsbuildinfo",
16
16
  "c": "mocha --version"
17
17
  },
18
18
  "dependencies": {
@@ -22,48 +22,48 @@
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.138.0",
26
- "node-opcua-assert": "2.120.0",
27
- "node-opcua-basic-types": "2.134.0",
28
- "node-opcua-binary-stream": "2.133.0",
29
- "node-opcua-client-dynamic-extension-object": "2.138.0",
30
- "node-opcua-constants": "2.125.0",
31
- "node-opcua-crypto": "4.12.0",
32
- "node-opcua-data-access": "2.137.0",
33
- "node-opcua-data-model": "2.137.0",
34
- "node-opcua-data-value": "2.137.0",
35
- "node-opcua-date-time": "2.134.0",
36
- "node-opcua-debug": "2.133.0",
37
- "node-opcua-enum": "2.133.0",
38
- "node-opcua-extension-object": "2.137.0",
39
- "node-opcua-factory": "2.137.0",
40
- "node-opcua-nodeid": "2.133.0",
41
- "node-opcua-nodeset-ua": "2.138.0",
42
- "node-opcua-numeric-range": "2.137.0",
43
- "node-opcua-object-registry": "2.133.0",
44
- "node-opcua-pseudo-session": "2.138.0",
45
- "node-opcua-service-browse": "2.137.0",
46
- "node-opcua-service-call": "2.137.0",
47
- "node-opcua-service-history": "2.137.0",
48
- "node-opcua-service-translate-browse-path": "2.137.0",
49
- "node-opcua-service-write": "2.137.0",
50
- "node-opcua-status-code": "2.133.0",
51
- "node-opcua-types": "2.137.0",
52
- "node-opcua-utils": "2.133.0",
53
- "node-opcua-variant": "2.137.0",
54
- "node-opcua-xml2json": "2.137.0",
25
+ "node-opcua-address-space-base": "2.139.0",
26
+ "node-opcua-assert": "2.139.0",
27
+ "node-opcua-basic-types": "2.139.0",
28
+ "node-opcua-binary-stream": "2.139.0",
29
+ "node-opcua-client-dynamic-extension-object": "2.139.0",
30
+ "node-opcua-constants": "2.139.0",
31
+ "node-opcua-crypto": "4.15.0",
32
+ "node-opcua-data-access": "2.139.0",
33
+ "node-opcua-data-model": "2.139.0",
34
+ "node-opcua-data-value": "2.139.0",
35
+ "node-opcua-date-time": "2.139.0",
36
+ "node-opcua-debug": "2.139.0",
37
+ "node-opcua-enum": "2.139.0",
38
+ "node-opcua-extension-object": "2.139.0",
39
+ "node-opcua-factory": "2.139.0",
40
+ "node-opcua-nodeid": "2.139.0",
41
+ "node-opcua-nodeset-ua": "2.139.0",
42
+ "node-opcua-numeric-range": "2.139.0",
43
+ "node-opcua-object-registry": "2.139.0",
44
+ "node-opcua-pseudo-session": "2.139.0",
45
+ "node-opcua-service-browse": "2.139.0",
46
+ "node-opcua-service-call": "2.139.0",
47
+ "node-opcua-service-history": "2.139.0",
48
+ "node-opcua-service-translate-browse-path": "2.139.0",
49
+ "node-opcua-service-write": "2.139.0",
50
+ "node-opcua-status-code": "2.139.0",
51
+ "node-opcua-types": "2.139.0",
52
+ "node-opcua-utils": "2.139.0",
53
+ "node-opcua-variant": "2.139.0",
54
+ "node-opcua-xml2json": "2.139.0",
55
55
  "semver": "^7.6.3",
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
- "node-opcua-benchmarker": "2.133.0",
62
- "node-opcua-leak-detector": "2.133.0",
63
- "node-opcua-nodesets": "2.137.0",
64
- "node-opcua-packet-analyzer": "2.137.0",
65
- "node-opcua-service-filter": "2.138.0",
66
- "node-opcua-test-fixtures": "2.137.0",
61
+ "node-opcua-benchmarker": "2.139.0",
62
+ "node-opcua-leak-detector": "2.139.0",
63
+ "node-opcua-nodesets": "2.139.0",
64
+ "node-opcua-packet-analyzer": "2.139.0",
65
+ "node-opcua-service-filter": "2.139.0",
66
+ "node-opcua-test-fixtures": "2.139.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": "383bbe814f9261b2bc01a5d0fe476813153bb110",
84
+ "gitHead": "b7a01d31c7602d323e60a5f4a54428199a266f29",
85
85
  "files": [
86
86
  "dist",
87
87
  "distHelpers",
@@ -263,7 +263,7 @@ export class PseudoSession implements IBasicSession {
263
263
  }
264
264
  innerBrowseNext(
265
265
  { continuationPointManager: this.continuationPointManager },
266
- continuationPoints,
266
+ continuationPoints as Buffer[],
267
267
  releaseContinuationPoints,
268
268
  callback
269
269
  );
@@ -20,50 +20,27 @@ function isValidNodeClass(nodeClass: NodeClass) {
20
20
 
21
21
  const regExp1 = /^(s|i|b|g)=/;
22
22
  const regExp2 = /^ns=[0-9]+;(s|i|b|g)=/;
23
- const hasPropertyRefId = resolveNodeId("HasProperty");
24
- const hasComponentRefId = resolveNodeId("HasComponent");
25
- const hasOrderedComponentRefId = resolveNodeId("HasOrderedComponent");
26
- const hasAddIn = resolveNodeId("HasAddIn");
27
23
  const hasEncoding = resolveNodeId("HasEncoding");
28
24
 
29
25
  type Suffix = string;
30
26
 
31
- // function _identifyParentInReference(references: UAReference[]): [NodeId, Suffix] | null {
32
- // const candidates = references.filter((r: UAReference) => {
33
- // return (
34
- // !r.isForward &&
35
- // (sameNodeId(r.referenceType, hasComponentRefId) ||
36
- // sameNodeId(r.referenceType, hasOrderedComponentRefId) ||
37
- // sameNodeId(r.referenceType, hasPropertyRefId) ||
38
- // sameNodeId(r.referenceType, hasEncoding) ||
39
- // sameNodeId(r.referenceType, hasAddIn))
40
- // );
41
- // });
42
- // assert(candidates.length <= 1);
43
- // if (candidates.length === 0) {
44
- // return null;
45
- // }
46
- // const ref = candidates[0];
47
- // if (sameNodeId(ref.referenceType, hasEncoding)) {
48
- // return [ref.nodeId, "_Encoding"];
49
- // }
50
- // return [ref.nodeId, ""];
51
- // }
52
-
53
- function checkAggregate(addressSpace: AddressSpacePartial, reference: UAReference, refType: UAReferenceType): boolean {
54
- const r = resolveReferenceType(addressSpace, reference);
55
- if (!r) {
56
- return false;
57
- }
58
- return r.isSubtypeOf(refType)
59
- }
60
27
  function _filterAggregates(addressSpace: AddressSpacePartial, references: UAReference[]): [NodeId, Suffix] | null {
61
28
 
62
- const aggregates = addressSpace.findNode(resolveNodeId("Aggregates")) as UAReferenceType;
63
-
64
- const candidates = references.filter((r: UAReference) =>
65
- !r.isForward && checkAggregate(addressSpace, r, aggregates)
66
- );
29
+ const aggregatesRefType = addressSpace.findNode(resolveNodeId("Aggregates")) as UAReferenceType;
30
+ const hasEncodinRefType = addressSpace.findNode(resolveNodeId("HasEncoding")) as UAReferenceType;
31
+
32
+ const checkAggregate = (
33
+ reference: UAReference,
34
+ ): boolean => {
35
+ if (reference.isForward) return false;
36
+ const r = resolveReferenceType(addressSpace, reference);
37
+ if (!r) {
38
+ return false;
39
+ }
40
+ return r.isSubtypeOf(aggregatesRefType) || r.isSubtypeOf(hasEncodinRefType)
41
+ }
42
+
43
+ const candidates = references.filter(checkAggregate);
67
44
 
68
45
  assert(candidates.length <= 1, "a node shall not have more than one parent (link to a parent with a reference derived from 'Aggregates')");
69
46
  if (candidates.length === 0) {
@@ -1,11 +0,0 @@
1
- import { ModellingRuleType, UAObject, UAObjectType, UAVariableT } from "node-opcua-address-space-base";
2
- import { DataType } from "node-opcua-basic-types";
3
- import { QualifiedName, QualifiedNameLike } from "node-opcua-data-model";
4
- export interface InstantiateAddInOptions {
5
- defaultName?: QualifiedNameLike;
6
- modellingRule?: ModellingRuleType;
7
- addInOf: UAObject | UAObjectType;
8
- copyAlsoModellingRules?: boolean;
9
- }
10
- export declare function instantiateAddIn(objectType: UAObjectType, options: InstantiateAddInOptions): UAObject;
11
- export declare function addDefaultInstanceBrowseName(objectType: UAObjectType): UAVariableT<QualifiedName, DataType.QualifiedName>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDefaultInstanceBrowseName = exports.instantiateAddIn = void 0;
4
- const node_opcua_basic_types_1 = require("node-opcua-basic-types");
5
- const node_opcua_data_model_1 = require("node-opcua-data-model");
6
- function instantiateAddIn(objectType, options) {
7
- let defaultName = options.defaultName;
8
- // check that objectType has he shape of an addInd
9
- const defaultInstanceBrowseName = objectType.getPropertyByName("DefaultInstanceBrowseName");
10
- if (!defaultInstanceBrowseName) {
11
- throw new Error("objectType must have a DefaultInstanceBrowseName property");
12
- }
13
- const browseName = (0, node_opcua_data_model_1.coerceQualifiedName)(defaultName || defaultInstanceBrowseName.readValue().value.value);
14
- const addIn = objectType.instantiate({
15
- browseName: browseName,
16
- modellingRule: options.modellingRule,
17
- namespace: objectType.namespace,
18
- copyAlsoModellingRules: options.copyAlsoModellingRules,
19
- });
20
- options.addInOf.addReference({
21
- referenceType: "HasAddIn",
22
- nodeId: addIn.nodeId
23
- });
24
- return addIn;
25
- }
26
- exports.instantiateAddIn = instantiateAddIn;
27
- function addDefaultInstanceBrowseName(objectType) {
28
- const namespace1 = objectType.namespace;
29
- const uaVaraible = namespace1.addVariable({
30
- browseName: (0, node_opcua_data_model_1.coerceQualifiedName)({ name: "DefaultInstanceBrowseName", namespaceIndex: 0 }),
31
- propertyOf: objectType,
32
- typeDefinition: "PropertyType",
33
- dataType: node_opcua_basic_types_1.DataType.QualifiedName,
34
- value: {
35
- dataType: node_opcua_basic_types_1.DataType.QualifiedName,
36
- value: { namespaceIndex: namespace1.index, name: "JobManager" }
37
- },
38
- modellingRule: null
39
- });
40
- return uaVaraible;
41
- }
42
- exports.addDefaultInstanceBrowseName = addDefaultInstanceBrowseName;
43
- //# sourceMappingURL=ua_addin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_addin.js","sourceRoot":"","sources":["../../src/ua_addin.ts"],"names":[],"mappings":";;;AACA,mEAAkD;AAClD,iEAA8F;AAS9F,SAAgB,gBAAgB,CAAC,UAAwB,EAAE,OAAgC;IAEvF,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACtC,kDAAkD;IAClD,MAAM,yBAAyB,GAAG,UAAU,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;IAC5F,IAAI,CAAC,yBAAyB,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;KAChF;IAED,MAAM,UAAU,GAAG,IAAA,2CAAmB,EAAC,WAAW,IAAI,yBAAyB,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,KAAsB,CAAC,CAAC;IAC1H,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC;QACjC,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;KACzD,CAAC,CAAC;IACH,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;QACzB,aAAa,EAAE,UAAU;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;KACvB,CAAC,CAAA;IACF,OAAO,KAAK,CAAC;AACjB,CAAC;AArBD,4CAqBC;AAED,SAAgB,4BAA4B,CAAC,UAAwB;IAEjE,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC;IACxC,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC;QACtC,UAAU,EAAE,IAAA,2CAAmB,EAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC;QACzF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,cAAc;QAC9B,QAAQ,EAAE,iCAAQ,CAAC,aAAa;QAChC,KAAK,EAAE;YACH,QAAQ,EAAE,iCAAQ,CAAC,aAAa;YAChC,KAAK,EAAE,EAAE,cAAc,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE;SAClE;QACD,aAAa,EAAE,IAAI;KACtB,CAAC,CAAC;IACH,OAAO,UAAgE,CAAC;AAE5E,CAAC;AAhBD,oEAgBC"}