node-opcua-address-space 2.184.0 → 2.184.2

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.
@@ -6,6 +6,7 @@ import chalk from "chalk";
6
6
  import type {
7
7
  AddReferenceOpts,
8
8
  BaseNode,
9
+ ConditionRefreshScope,
9
10
  IEventData,
10
11
  IHistoricalDataNodeOptions,
11
12
  ISessionContext,
@@ -226,6 +227,11 @@ export class AddressSpaceImpl implements AddressSpacePrivate {
226
227
  }
227
228
  public historizingNodes: Set<UAVariable> = new Set();
228
229
  public _condition_refresh_in_progress = false;
230
+ /**
231
+ * the Subscription (and, for ConditionRefresh2, the MonitoredItem) the refresh in progress
232
+ * was asked for; `null` outside a refresh. See ConditionRefreshScope.
233
+ */
234
+ public _condition_refresh_scope: ConditionRefreshScope | null = null;
229
235
 
230
236
  public readonly isNodeIdString = isNodeIdString;
231
237
  private readonly _private_namespaceIndex: number;
@@ -5,6 +5,7 @@
5
5
  import type {
6
6
  AddReferenceOpts,
7
7
  BaseNode,
8
+ ConditionRefreshScope,
8
9
  IAddressSpace,
9
10
  MethodCallInterceptor,
10
11
  UADataType,
@@ -36,6 +37,9 @@ export interface AddressSpacePrivate extends IAddressSpace {
36
37
 
37
38
  _condition_refresh_in_progress: boolean;
38
39
 
40
+ /** what the refresh in progress was asked for; `null` outside a refresh */
41
+ _condition_refresh_scope: ConditionRefreshScope | null;
42
+
39
43
  $$extraDataTypeManager?: ExtraDataTypeManager;
40
44
 
41
45
  _coerceNode(node: string | BaseNode | NodeIdLike): BaseNode | null;
@@ -4,6 +4,7 @@
4
4
  import chalk from "chalk";
5
5
  import {
6
6
  type BaseNode,
7
+ type ConditionRefreshScope,
7
8
  fullPath2,
8
9
  type INamespace,
9
10
  type ISessionContext,
@@ -1122,7 +1123,27 @@ function _condition_refresh_method(
1122
1123
  });
1123
1124
  }
1124
1125
 
1125
- function _perform_condition_refresh(addressSpace: AddressSpacePrivate, _inputArguments: VariantLike[], context: ISessionContext) {
1126
+ /**
1127
+ * OPC 10000-9 4.5: the RefreshStart/RefreshEnd bracket "ignore[s] the Event content filtering
1128
+ * associated with a Subscription and will always be delivered to the Client". The address space
1129
+ * cannot apply that itself - it does not evaluate where clauses, the MonitoredItem does - so it
1130
+ * says which Subscription the refresh is for and the server side bypasses the where clause for
1131
+ * those two EventTypes, for that Subscription only.
1132
+ *
1133
+ * `null` when there is no Session behind the call (a PseudoSession, an in-process caller, a unit
1134
+ * test): nothing is named, so nothing is bypassed.
1135
+ */
1136
+ function _refresh_scope(inputArguments: VariantLike[], context: ISessionContext): ConditionRefreshScope | null {
1137
+ const subscription = context.session?.getSubscription?.(inputArguments[0]?.value);
1138
+ if (!subscription) {
1139
+ return null;
1140
+ }
1141
+ // ConditionRefresh2 names one MonitoredItem (5.5.8); ConditionRefresh names none (5.5.7)
1142
+ const monitoredItemId = inputArguments.length > 1 ? (inputArguments[1]?.value as number) : undefined;
1143
+ return { subscription, monitoredItemId };
1144
+ }
1145
+
1146
+ function _perform_condition_refresh(addressSpace: AddressSpacePrivate, inputArguments: VariantLike[], context: ISessionContext) {
1126
1147
  // --- possible StatusCodes:
1127
1148
  //
1128
1149
  // Bad_SubscriptionIdInvalid See Part 4 for the description of this result code
@@ -1149,6 +1170,7 @@ function _perform_condition_refresh(addressSpace: AddressSpacePrivate, _inputArg
1149
1170
  }
1150
1171
 
1151
1172
  addressSpace._condition_refresh_in_progress = true;
1173
+ addressSpace._condition_refresh_scope = _refresh_scope(inputArguments, context);
1152
1174
  try {
1153
1175
  server?.raiseEvent(refreshStartEventType, {});
1154
1176
 
@@ -1160,8 +1182,10 @@ function _perform_condition_refresh(addressSpace: AddressSpacePrivate, _inputArg
1160
1182
  server?.raiseEvent(refreshEndEventType, {});
1161
1183
  } finally {
1162
1184
  // whatever a condition's event handler throws, the next refresh must not be
1163
- // answered Bad_RefreshInProgress for ever
1185
+ // answered Bad_RefreshInProgress for ever, and no later event must be taken
1186
+ // for part of a refresh
1164
1187
  addressSpace._condition_refresh_in_progress = false;
1188
+ addressSpace._condition_refresh_scope = null;
1165
1189
  }
1166
1190
 
1167
1191
  return StatusCodes.Good;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-opcua-address-space",
3
3
  "type": "module",
4
- "version": "2.184.0",
4
+ "version": "2.184.2",
5
5
  "description": "pure nodejs OPCUA SDK - module address-space",
6
6
  "main": "./dist/api/index.js",
7
7
  "types": "./dist/api/index.d.ts",
@@ -23,48 +23,48 @@
23
23
  "@types/semver": "7.8.0",
24
24
  "chalk": "4.1.2",
25
25
  "dequeue": "^1.0.5",
26
- "node-opcua-address-space-base": "2.184.0",
26
+ "node-opcua-address-space-base": "2.184.2",
27
27
  "node-opcua-assert": "2.184.0",
28
- "node-opcua-basic-types": "2.184.0",
29
- "node-opcua-binary-stream": "2.184.0",
30
- "node-opcua-client-dynamic-extension-object": "2.184.0",
28
+ "node-opcua-basic-types": "2.184.1",
29
+ "node-opcua-binary-stream": "2.184.1",
30
+ "node-opcua-client-dynamic-extension-object": "2.184.1",
31
31
  "node-opcua-constants": "2.184.0",
32
32
  "node-opcua-crypto": "5.10.1",
33
- "node-opcua-data-access": "2.184.0",
34
- "node-opcua-data-model": "2.184.0",
35
- "node-opcua-data-value": "2.184.0",
36
- "node-opcua-date-time": "2.184.0",
33
+ "node-opcua-data-access": "2.184.1",
34
+ "node-opcua-data-model": "2.184.1",
35
+ "node-opcua-data-value": "2.184.1",
36
+ "node-opcua-date-time": "2.184.1",
37
37
  "node-opcua-debug": "2.184.0",
38
- "node-opcua-enum": "2.184.0",
39
- "node-opcua-extension-object": "2.184.0",
40
- "node-opcua-factory": "2.184.0",
41
- "node-opcua-nodeid": "2.184.0",
42
- "node-opcua-nodeset-ua": "2.184.0",
43
- "node-opcua-numeric-range": "2.184.0",
38
+ "node-opcua-enum": "2.184.1",
39
+ "node-opcua-extension-object": "2.184.1",
40
+ "node-opcua-factory": "2.184.1",
41
+ "node-opcua-nodeid": "2.184.1",
42
+ "node-opcua-nodeset-ua": "2.184.2",
43
+ "node-opcua-numeric-range": "2.184.1",
44
44
  "node-opcua-object-registry": "2.184.0",
45
- "node-opcua-pseudo-session": "2.184.0",
46
- "node-opcua-service-browse": "2.184.0",
47
- "node-opcua-service-call": "2.184.0",
48
- "node-opcua-service-history": "2.184.0",
49
- "node-opcua-service-translate-browse-path": "2.184.0",
50
- "node-opcua-service-write": "2.184.0",
51
- "node-opcua-status-code": "2.184.0",
52
- "node-opcua-types": "2.184.0",
53
- "node-opcua-utils": "2.184.0",
54
- "node-opcua-variant": "2.184.0",
55
- "node-opcua-xml2json": "2.184.0",
45
+ "node-opcua-pseudo-session": "2.184.1",
46
+ "node-opcua-service-browse": "2.184.1",
47
+ "node-opcua-service-call": "2.184.1",
48
+ "node-opcua-service-history": "2.184.1",
49
+ "node-opcua-service-translate-browse-path": "2.184.1",
50
+ "node-opcua-service-write": "2.184.1",
51
+ "node-opcua-status-code": "2.184.1",
52
+ "node-opcua-types": "2.184.1",
53
+ "node-opcua-utils": "2.184.1",
54
+ "node-opcua-variant": "2.184.1",
55
+ "node-opcua-xml2json": "2.184.1",
56
56
  "semver": "^7.8.5",
57
57
  "thenify-ex": "4.4.0",
58
58
  "xml-writer": "^1.7.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "humanize": "0.0.9",
62
- "node-opcua-benchmarker": "2.184.0",
63
- "node-opcua-leak-detector": "2.184.0",
62
+ "node-opcua-benchmarker": "2.184.1",
63
+ "node-opcua-leak-detector": "2.184.1",
64
64
  "node-opcua-nodesets": "2.184.0",
65
- "node-opcua-packet-analyzer": "2.184.0",
66
- "node-opcua-schemas": "2.184.0",
67
- "node-opcua-service-filter": "2.184.0",
65
+ "node-opcua-packet-analyzer": "2.184.1",
66
+ "node-opcua-schemas": "2.184.1",
67
+ "node-opcua-service-filter": "2.184.2",
68
68
  "node-opcua-test-fixtures": "2.184.0",
69
69
  "node-opcua-test-helpers": "2.184.0"
70
70
  },
@@ -83,7 +83,7 @@
83
83
  "internet of things"
84
84
  ],
85
85
  "homepage": "http://node-opcua.github.io/",
86
- "gitHead": "441a5c63e3a4202eb8de8597acac77a3a49248b7",
86
+ "gitHead": "cd22145fbd019c2b80faa1b3b493b497e07e28ed",
87
87
  "files": [
88
88
  "dist",
89
89
  "distHelpers",