node-opcua-data-model 2.63.1 → 2.64.1

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-data-model",
3
- "version": "2.63.1",
3
+ "version": "2.64.1",
4
4
  "description": "pure nodejs OPCUA SDK - module -data-model",
5
5
  "scripts": {
6
6
  "build": "tsc -b",
@@ -13,17 +13,17 @@
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "dependencies": {
16
- "node-opcua-assert": "2.63.0",
17
- "node-opcua-basic-types": "2.63.1",
18
- "node-opcua-binary-stream": "2.63.1",
19
- "node-opcua-enum": "2.63.1",
20
- "node-opcua-factory": "2.63.1",
21
- "node-opcua-nodeid": "2.63.1",
22
- "node-opcua-status-code": "2.63.1",
23
- "node-opcua-utils": "2.63.1"
16
+ "node-opcua-assert": "2.64.1",
17
+ "node-opcua-basic-types": "2.64.1",
18
+ "node-opcua-binary-stream": "2.64.1",
19
+ "node-opcua-enum": "2.64.1",
20
+ "node-opcua-factory": "2.64.1",
21
+ "node-opcua-nodeid": "2.64.1",
22
+ "node-opcua-status-code": "2.64.1",
23
+ "node-opcua-utils": "2.64.1"
24
24
  },
25
25
  "devDependencies": {
26
- "node-opcua-packet-analyzer": "2.63.1",
26
+ "node-opcua-packet-analyzer": "2.64.1",
27
27
  "should": "^13.2.3",
28
28
  "source-map-support": "^0.5.21"
29
29
  },
@@ -42,5 +42,5 @@
42
42
  "internet of things"
43
43
  ],
44
44
  "homepage": "http://node-opcua.github.io/",
45
- "gitHead": "d37385314fce703c1cc197104c592df03b2663fb"
45
+ "gitHead": "b65b8738603cd475d7d99a2b20b0ae9d32b4110c"
46
46
  }
@@ -140,6 +140,19 @@ export class DiagnosticInfo extends BaseUAObject {
140
140
  public decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void {
141
141
  decodeDebug_DiagnosticInfo(this, stream, options);
142
142
  }
143
+
144
+ public static filterForResponse(diagnostic: DiagnosticInfo, requestedDiagnostics: number, diagnosticInfoMask: DiagnosticInfo_Mask): DiagnosticInfo {
145
+ const options: DiagnosticInfoOptions = {
146
+ symbolicId: (requestedDiagnostics & diagnosticInfoMask.SymbolicId) ? diagnostic.symbolicId: undefined,
147
+ localizedText: (requestedDiagnostics & diagnosticInfoMask.LocalizedText) ? diagnostic.localizedText: undefined,
148
+ additionalInfo: (requestedDiagnostics & diagnosticInfoMask.AdditionalInfo) ? diagnostic.additionalInfo: undefined,
149
+ innerStatusCode: (requestedDiagnostics & diagnosticInfoMask.InnerStatusCode) ? diagnostic.innerStatusCode: undefined,
150
+ innerDiagnosticInfo: (requestedDiagnostics & diagnosticInfoMask.InnerDiagnostics) ? diagnostic.innerDiagnosticInfo : (
151
+ diagnostic.innerDiagnosticInfo ? DiagnosticInfo.filterForResponse(diagnostic.innerDiagnosticInfo, requestedDiagnostics, diagnosticInfoMask) : undefined
152
+ ),
153
+ }
154
+ return new DiagnosticInfo(options);
155
+ }
143
156
  }
144
157
 
145
158
  DiagnosticInfo.prototype.schema = DiagnosticInfo.schema;
@@ -155,6 +168,43 @@ export interface DiagnosticInfoOptions {
155
168
  innerDiagnosticInfo?: DiagnosticInfo;
156
169
  }
157
170
 
171
+ export enum DiagnosticInfo_ServiceLevelMask {
172
+ None = 0x00,
173
+ SymbolicId = 0x01,
174
+ LocalizedText = 0x02,
175
+ AdditionalInfo = 0x04,
176
+ InnerStatusCode = 0x08,
177
+ InnerDiagnostics = 0x10
178
+ }
179
+
180
+ export enum DiagnosticInfo_OperationLevelMask {
181
+ SymbolicId = 0x020,
182
+ LocalizedText = 0x040,
183
+ AdditionalInfo = 0x080,
184
+ InnerStatusCode = 0x0100,
185
+ InnerDiagnostics = 0x0200
186
+ }
187
+
188
+ type DiagnosticInfo_Mask = typeof DiagnosticInfo_ServiceLevelMask | typeof DiagnosticInfo_OperationLevelMask;
189
+
190
+ export const RESPONSE_DIAGNOSTICS_MASK_ALL = 0x3FF;
191
+
192
+ export function filterDiagnosticInfoLevel(returnDiagnostics: number, diagnostic: DiagnosticInfo | null, diagnosticInfoMask: DiagnosticInfo_Mask): DiagnosticInfo | null {
193
+ if (!diagnostic) {
194
+ return null;
195
+ }
196
+
197
+ return DiagnosticInfo.filterForResponse(diagnostic, returnDiagnostics, diagnosticInfoMask);
198
+ }
199
+
200
+ export function filterDiagnosticOperationLevel(returnDiagnostics: number, diagnostic: DiagnosticInfo | null): DiagnosticInfo | null {
201
+ return filterDiagnosticInfoLevel(returnDiagnostics, diagnostic, DiagnosticInfo_OperationLevelMask);
202
+ }
203
+
204
+ export function filterDiagnosticServiceLevel(returnDiagnostics: number, diagnostic: DiagnosticInfo | null): DiagnosticInfo | null {
205
+ return filterDiagnosticInfoLevel(returnDiagnostics, diagnostic, DiagnosticInfo_ServiceLevelMask);
206
+ }
207
+
158
208
  export enum DiagnosticInfo_EncodingByte {
159
209
  SymbolicId = 0x01,
160
210
  NamespaceURI = 0x02,