node-opcua-service-filter 2.96.0 → 2.98.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 (37) hide show
  1. package/package.json +15 -15
  2. package/dist/check_event_clause.d.ts +0 -17
  3. package/dist/check_event_clause.js +0 -52
  4. package/dist/check_event_clause.js.map +0 -1
  5. package/dist/check_where_clause.d.ts +0 -3
  6. package/dist/check_where_clause.js +0 -250
  7. package/dist/check_where_clause.js.map +0 -1
  8. package/dist/extract_event_field.d.ts +0 -9
  9. package/dist/extract_event_field.js +0 -53
  10. package/dist/extract_event_field.js.map +0 -1
  11. package/dist/filter_context.d.ts +0 -11
  12. package/dist/filter_context.js +0 -3
  13. package/dist/filter_context.js.map +0 -1
  14. package/dist/imports.d.ts +0 -4
  15. package/dist/imports.js +0 -19
  16. package/dist/imports.js.map +0 -1
  17. package/dist/index.d.ts +0 -13
  18. package/dist/index.js +0 -62
  19. package/dist/index.js.map +0 -1
  20. package/dist/make_content_filter.d.ts +0 -22
  21. package/dist/make_content_filter.js +0 -121
  22. package/dist/make_content_filter.js.map +0 -1
  23. package/dist/on_address_space/extract_event_fields.d.ts +0 -10
  24. package/dist/on_address_space/extract_event_fields.js +0 -18
  25. package/dist/on_address_space/extract_event_fields.js.map +0 -1
  26. package/dist/on_address_space/filter_context_on_address_space.d.ts +0 -19
  27. package/dist/on_address_space/filter_context_on_address_space.js +0 -108
  28. package/dist/on_address_space/filter_context_on_address_space.js.map +0 -1
  29. package/dist/on_address_space/index.d.ts +0 -2
  30. package/dist/on_address_space/index.js +0 -19
  31. package/dist/on_address_space/index.js.map +0 -1
  32. package/dist/resolve_operand.d.ts +0 -4
  33. package/dist/resolve_operand.js +0 -45
  34. package/dist/resolve_operand.js.map +0 -1
  35. package/dist/tools_event_filter.d.ts +0 -20
  36. package/dist/tools_event_filter.js +0 -90
  37. package/dist/tools_event_filter.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-service-filter",
3
- "version": "2.96.0",
3
+ "version": "2.98.0",
4
4
  "description": "pure nodejs OPCUA SDK - module -service-filter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,23 +10,23 @@
10
10
  "build": "tsc -b"
11
11
  },
12
12
  "dependencies": {
13
- "node-opcua-address-space-base": "2.96.0",
13
+ "node-opcua-address-space-base": "2.98.0",
14
14
  "node-opcua-assert": "2.88.0",
15
- "node-opcua-basic-types": "2.92.0",
15
+ "node-opcua-basic-types": "2.98.0",
16
16
  "node-opcua-constants": "2.88.0",
17
- "node-opcua-data-model": "2.95.0",
18
- "node-opcua-data-value": "2.95.0",
19
- "node-opcua-debug": "2.90.1",
20
- "node-opcua-extension-object": "2.95.0",
21
- "node-opcua-nodeid": "2.90.1",
22
- "node-opcua-service-translate-browse-path": "2.96.0",
23
- "node-opcua-status-code": "2.90.1",
24
- "node-opcua-types": "2.96.0",
25
- "node-opcua-variant": "2.95.0"
17
+ "node-opcua-data-model": "2.98.0",
18
+ "node-opcua-data-value": "2.98.0",
19
+ "node-opcua-debug": "2.98.0",
20
+ "node-opcua-extension-object": "2.98.0",
21
+ "node-opcua-nodeid": "2.98.0",
22
+ "node-opcua-service-translate-browse-path": "2.98.0",
23
+ "node-opcua-status-code": "2.98.0",
24
+ "node-opcua-types": "2.98.0",
25
+ "node-opcua-variant": "2.98.0"
26
26
  },
27
27
  "devDependencies": {
28
- "node-opcua-numeric-range": "2.95.0",
29
- "node-opcua-packet-analyzer": "2.95.0",
28
+ "node-opcua-numeric-range": "2.98.0",
29
+ "node-opcua-packet-analyzer": "2.98.0",
30
30
  "should": "^13.2.3"
31
31
  },
32
32
  "author": "Etienne Rossignon",
@@ -44,5 +44,5 @@
44
44
  "internet of things"
45
45
  ],
46
46
  "homepage": "http://node-opcua.github.io/",
47
- "gitHead": "43642e4aaa1ca2a3938b044cc2237544dfff764a"
47
+ "gitHead": "07dcdd8e8c7f2b55544c6e23023093e35674829c"
48
48
  }
@@ -1,17 +0,0 @@
1
- import { SimpleAttributeOperand } from "node-opcua-types";
2
- import { StatusCode } from "node-opcua-status-code";
3
- import { BaseNode, UAObjectType } from "node-opcua-address-space-base";
4
- /**
5
- * @method checkSelectClause
6
- * @param parentNode
7
- * @param selectClause
8
- * @return {Array<StatusCode>}
9
- */
10
- export declare function checkSelectClause(parentNode: BaseNode, selectClause: SimpleAttributeOperand): StatusCode;
11
- /**
12
- * @method checkSelectClauses
13
- * @param eventTypeNode
14
- * @param selectClauses
15
- * @return an array of StatusCode
16
- */
17
- export declare function checkSelectClauses(eventTypeNode: UAObjectType, selectClauses: SimpleAttributeOperand[]): StatusCode[];
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkSelectClauses = exports.checkSelectClause = void 0;
4
- /**
5
- * @module node-opcua-address-space
6
- */
7
- const node_opcua_data_model_1 = require("node-opcua-data-model");
8
- const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
9
- const node_opcua_status_code_1 = require("node-opcua-status-code");
10
- /**
11
- * @method checkSelectClause
12
- * @param parentNode
13
- * @param selectClause
14
- * @return {Array<StatusCode>}
15
- */
16
- function checkSelectClause(parentNode, selectClause) {
17
- //
18
- const addressSpace = parentNode.addressSpace;
19
- // istanbul ignore next
20
- if (selectClause.typeDefinitionId.isEmpty()) {
21
- return node_opcua_status_code_1.StatusCodes.Good;
22
- }
23
- const eventTypeNode = addressSpace.findEventType(selectClause.typeDefinitionId);
24
- if (!eventTypeNode || !(eventTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType)) {
25
- // xx console.log("eventTypeNode = ",selectClause.typeDefinitionId.toString());
26
- // xx console.log("eventTypeNode = ",eventTypeNode);
27
- // istanbul ignore next
28
- if (eventTypeNode) {
29
- console.log(eventTypeNode.toString());
30
- }
31
- }
32
- // istanbul ignore next
33
- if (eventTypeNode.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
34
- return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
35
- }
36
- // navigate to the innerNode specified by the browsePath [ QualifiedName]
37
- const browsePath = (0, node_opcua_service_translate_browse_path_1.constructBrowsePathFromQualifiedName)(eventTypeNode, selectClause.browsePath);
38
- const browsePathResult = addressSpace.browsePath(browsePath);
39
- return browsePathResult.statusCode;
40
- }
41
- exports.checkSelectClause = checkSelectClause;
42
- /**
43
- * @method checkSelectClauses
44
- * @param eventTypeNode
45
- * @param selectClauses
46
- * @return an array of StatusCode
47
- */
48
- function checkSelectClauses(eventTypeNode, selectClauses) {
49
- return selectClauses.map(checkSelectClause.bind(null, eventTypeNode));
50
- }
51
- exports.checkSelectClauses = checkSelectClauses;
52
- //# sourceMappingURL=check_event_clause.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check_event_clause.js","sourceRoot":"","sources":["../source/check_event_clause.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,iEAAkD;AAElD,uGAAgG;AAChG,mEAAiE;AAGjE;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,UAAoB,EAAE,YAAoC;IACxF,EAAE;IACF,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAE7C,uBAAuB;IACvB,IAAI,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE;QACzC,OAAO,oCAAW,CAAC,IAAI,CAAC;KAC3B;IACD,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAC;IAEjF,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,iCAAS,CAAC,UAAU,CAAC,EAAE;QACvE,+EAA+E;QAC/E,oDAAoD;QACpD,uBAAuB;QACvB,IAAI,aAAa,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;SACzC;KACJ;IAED,uBAAuB;IACvB,IAAI,aAAa,CAAC,SAAS,KAAK,iCAAS,CAAC,UAAU,EAAE;QAClD,OAAO,oCAAW,CAAC,eAAe,CAAC;KACtC;IAED,yEAAyE;IACzE,MAAM,UAAU,GAAG,IAAA,+EAAoC,EAAC,aAAa,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAChG,MAAM,gBAAgB,GAAG,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7D,OAAO,gBAAgB,CAAC,UAAU,CAAC;AACvC,CAAC;AA5BD,8CA4BC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,aAA2B,EAAE,aAAuC;IACnG,OAAO,aAAa,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,gDAEC"}
@@ -1,3 +0,0 @@
1
- import { ContentFilter } from "node-opcua-types";
2
- import { FilterContext } from "./filter_context";
3
- export declare function checkFilter(filterContext: FilterContext, contentFilter: ContentFilter): boolean;
@@ -1,250 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkFilter = void 0;
4
- const node_opcua_types_1 = require("node-opcua-types");
5
- const node_opcua_variant_1 = require("node-opcua-variant");
6
- const node_opcua_data_model_1 = require("node-opcua-data-model");
7
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
8
- const node_opcua_debug_1 = require("node-opcua-debug");
9
- const resolve_operand_1 = require("./resolve_operand");
10
- const warningLog = (0, node_opcua_debug_1.make_warningLog)("Filter");
11
- function _coerceToBoolean(value) {
12
- if (value instanceof node_opcua_variant_1.Variant) {
13
- return _coerceToBoolean(value.value);
14
- }
15
- return !!value;
16
- }
17
- function _coerceToNumber(value) {
18
- if (value instanceof node_opcua_variant_1.Variant) {
19
- return _coerceToNumber(value.value);
20
- }
21
- if (typeof value === "string") {
22
- return parseInt(value, 10);
23
- }
24
- if (typeof value === "boolean") {
25
- return value ? 1 : 0;
26
- }
27
- if (typeof value === "number") {
28
- return value;
29
- }
30
- return 0;
31
- }
32
- function evaluateOperand(filterContext, filter, operand, coerce) {
33
- if (operand instanceof node_opcua_types_1.AttributeOperand) {
34
- return coerce((0, resolve_operand_1.resolveOperand)(filterContext, operand));
35
- }
36
- else if (operand instanceof node_opcua_types_1.SimpleAttributeOperand) {
37
- return coerce((0, resolve_operand_1.resolveOperand)(filterContext, operand));
38
- }
39
- else if (operand instanceof node_opcua_types_1.LiteralOperand) {
40
- return coerce(operand.value);
41
- }
42
- else if (operand instanceof node_opcua_types_1.ElementOperand) {
43
- const index = operand.index;
44
- return coerce(checkFilterAtIndex(filterContext, filter, index));
45
- }
46
- // istanbul ignore
47
- return coerce(null);
48
- }
49
- function checkOfType(filterContext, ofType) {
50
- // istanbul ignore next
51
- if (!ofType || !(ofType instanceof node_opcua_types_1.LiteralOperand)) {
52
- warningLog("checkOfType : unsupported case ! ofType is not a LiteralOperand , ofType = ", ofType === null || ofType === void 0 ? void 0 : ofType.toString());
53
- return false;
54
- }
55
- // istanbul ignore next
56
- if (ofType.value.dataType !== node_opcua_variant_1.DataType.NodeId) {
57
- warningLog("invalid operand type (expecting NodeId); got " + node_opcua_variant_1.DataType[ofType.value.dataType]);
58
- return false;
59
- }
60
- const ofTypeNode = ofType.value.value;
61
- // istanbul ignore next
62
- if (!ofTypeNode) {
63
- return false; // the ofType node is not known, we don't know what to do
64
- }
65
- const ofTypeNodeNodeClass = filterContext.getNodeClass(ofTypeNode);
66
- // istanbul ignore next
67
- if (ofTypeNodeNodeClass !== node_opcua_data_model_1.NodeClass.ObjectType &&
68
- ofTypeNodeNodeClass !== node_opcua_data_model_1.NodeClass.VariableType &&
69
- ofTypeNodeNodeClass !== node_opcua_data_model_1.NodeClass.DataType &&
70
- ofTypeNodeNodeClass !== node_opcua_data_model_1.NodeClass.ReferenceType) {
71
- warningLog("operand should be a ObjectType " + ofTypeNode.toString());
72
- return false;
73
- }
74
- if (!filterContext.eventSource || filterContext.eventSource.isEmpty()) {
75
- return false;
76
- }
77
- let sourceTypeDefinition = filterContext.eventSource;
78
- const sourceNodeClass = filterContext.getNodeClass(filterContext.eventSource);
79
- if (sourceNodeClass === node_opcua_data_model_1.NodeClass.Object || sourceNodeClass === node_opcua_data_model_1.NodeClass.Variable) {
80
- sourceTypeDefinition = filterContext.getTypeDefinition(filterContext.eventSource);
81
- if (!sourceTypeDefinition) {
82
- return false;
83
- }
84
- }
85
- return filterContext.isSubtypeOf(sourceTypeDefinition, ofTypeNode);
86
- }
87
- function checkNot(filterContext, filter, filteredOperands) {
88
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToBoolean);
89
- return !operandA;
90
- }
91
- function checkOr(filterContext, filter, filteredOperands) {
92
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToBoolean);
93
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToBoolean);
94
- return operandA || operandB;
95
- }
96
- /**
97
- *
98
- * TRUE if operand[0] and operand[1] are TRUE.
99
- * The following restrictions apply to the operands:
100
- * [0]: Any operand that resolves to a Boolean.
101
- *
102
- * [1]: Any operand that resolves to a Boolean.
103
- * If any operand cannot be resolved to a Boolean it is considered a NULL. See below for a discussion on the handling of NULL.
104
- */
105
- function checkAnd(filterContext, filter, filteredOperands) {
106
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToBoolean);
107
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToBoolean);
108
- return operandA && operandB;
109
- }
110
- function checkLessThan(filterContext, filter, filteredOperands) {
111
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
112
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
113
- return operandA < operandB;
114
- }
115
- function checkLessThanOrEqual(filterContext, filter, filteredOperands) {
116
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
117
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
118
- return operandA <= operandB;
119
- }
120
- function checkGreaterThan(filterContext, filter, filteredOperands) {
121
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
122
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
123
- return operandA > operandB;
124
- }
125
- function checkGreaterThanOrEqual(filterContext, filter, filteredOperands) {
126
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
127
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
128
- return operandA >= operandB;
129
- }
130
- function checkEquals(filterContext, filter, filteredOperands) {
131
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
132
- const operandB = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
133
- return operandA === operandB;
134
- }
135
- /**
136
- *
137
- * TRUE if operand[0] is greater or equal to operand[1] and less than or equal to operand[2].
138
- * The following restrictions apply to the operands:
139
- * [0]: Any operand that resolves to an ordered value.
140
- * [1]: Any operand that resolves to an ordered value.
141
- * [2]: Any operand that resolves to an ordered value.
142
- * If the operands are of different types, the system shall perform any implicit conversion to match
143
- * all operands to a common type. If no implicit conversion is available and the operands are of different
144
- * types, the particular result is FALSE. See the discussion on data type precedence in Table 123
145
- * for more information how to convert operands of different types.
146
- */
147
- function checkBetween(filterContext, filter, filteredOperands) {
148
- const operandA = evaluateOperand(filterContext, filter, filteredOperands[0], _coerceToNumber);
149
- const operandLow = evaluateOperand(filterContext, filter, filteredOperands[1], _coerceToNumber);
150
- const operandHigh = evaluateOperand(filterContext, filter, filteredOperands[2], _coerceToNumber);
151
- return operandA >= operandLow && operandA <= operandHigh;
152
- }
153
- /**
154
- *
155
- * InList
156
- * TRUE if operand[0] is equal to one or more of the remaining operands.
157
- * The Equals Operator is evaluated for operand[0] and each remaining operand in the
158
- * list. If any Equals evaluation is TRUE, InList returns TRUE
159
- x*/
160
- function checkInList(context, filterOperands) {
161
- const operand0 = filterOperands[0];
162
- // istanbul ignore next
163
- if (!(operand0 instanceof node_opcua_types_1.SimpleAttributeOperand)) {
164
- // unsupported case
165
- warningLog("FilterOperator.InList operand0 is not a SimpleAttributeOperand " + operand0.constructor.name);
166
- return false;
167
- }
168
- const value = (0, resolve_operand_1.resolveOperand)(context, operand0);
169
- // istanbul ignore next
170
- if (value.dataType !== node_opcua_variant_1.DataType.NodeId) {
171
- return false;
172
- }
173
- const nodeId = value.value;
174
- // istanbul ignore next
175
- if (!nodeId) {
176
- return false;
177
- }
178
- function _is(nodeId1, operandX) {
179
- if (operandX.value.dataType !== node_opcua_variant_1.DataType.NodeId) {
180
- return false;
181
- }
182
- const nodeId2 = operandX.value.value;
183
- const nodeClass = context.getNodeClass(nodeId2);
184
- if (nodeClass === node_opcua_data_model_1.NodeClass.Unspecified) {
185
- return false;
186
- }
187
- return (0, node_opcua_nodeid_1.sameNodeId)(nodeId1, nodeId2);
188
- }
189
- for (let i = 1; i < filterOperands.length; i++) {
190
- const filterOperand = filterOperands[i];
191
- if (filterOperand instanceof node_opcua_types_1.LiteralOperand && _is(nodeId, filterOperand)) {
192
- return true;
193
- }
194
- }
195
- return false;
196
- }
197
- // eslint-disable-next-line complexity
198
- function checkFilterAtIndex(filterContext, filter, index) {
199
- if (!filter.elements || filter.elements.length === 0) {
200
- return true;
201
- }
202
- const element = filter.elements[index];
203
- // istanbul ignore next
204
- if (!element) {
205
- return true;
206
- }
207
- const filterOperands = element.filterOperands || [];
208
- switch (element.filterOperator) {
209
- case node_opcua_types_1.FilterOperator.Equals:
210
- return checkEquals(filterContext, filter, filterOperands);
211
- case node_opcua_types_1.FilterOperator.LessThan:
212
- return checkLessThan(filterContext, filter, filterOperands);
213
- case node_opcua_types_1.FilterOperator.LessThanOrEqual:
214
- return checkLessThanOrEqual(filterContext, filter, filterOperands);
215
- case node_opcua_types_1.FilterOperator.GreaterThan:
216
- return checkGreaterThan(filterContext, filter, filterOperands);
217
- case node_opcua_types_1.FilterOperator.GreaterThanOrEqual:
218
- return checkGreaterThanOrEqual(filterContext, filter, filterOperands);
219
- case node_opcua_types_1.FilterOperator.Between:
220
- return checkBetween(filterContext, filter, filterOperands);
221
- case node_opcua_types_1.FilterOperator.And:
222
- return checkAnd(filterContext, filter, filterOperands);
223
- case node_opcua_types_1.FilterOperator.Or:
224
- return checkOr(filterContext, filter, filterOperands);
225
- case node_opcua_types_1.FilterOperator.Not:
226
- return checkNot(filterContext, filter, filterOperands);
227
- case node_opcua_types_1.FilterOperator.OfType:
228
- return checkOfType(filterContext, element.filterOperands[0]);
229
- case node_opcua_types_1.FilterOperator.InList:
230
- return checkInList(filterContext, filterOperands);
231
- case node_opcua_types_1.FilterOperator.RelatedTo:
232
- case node_opcua_types_1.FilterOperator.Like:
233
- case node_opcua_types_1.FilterOperator.BitwiseAnd:
234
- case node_opcua_types_1.FilterOperator.BitwiseOr:
235
- case node_opcua_types_1.FilterOperator.Cast:
236
- case node_opcua_types_1.FilterOperator.InView:
237
- case node_opcua_types_1.FilterOperator.IsNull:
238
- default:
239
- // from Spec OPC Unified Architecture, Part 4 133 Release 1.04
240
- // Any basic FilterOperator in Table 119 may be used in the whereClause, however, only the
241
- // OfType_14 FilterOperator from Table 120 is permitted.
242
- warningLog(`checkFilter: operator ${node_opcua_types_1.FilterOperator[element.filterOperator]} is currently not supported in filter`);
243
- return false;
244
- }
245
- }
246
- function checkFilter(filterContext, contentFilter) {
247
- return checkFilterAtIndex(filterContext, contentFilter, 0);
248
- }
249
- exports.checkFilter = checkFilter;
250
- //# sourceMappingURL=check_where_clause.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check_where_clause.js","sourceRoot":"","sources":["../source/check_where_clause.ts"],"names":[],"mappings":";;;AAAA,uDAQ0B;AAE1B,2DAAuD;AACvD,iEAAkD;AAClD,yDAAuD;AACvD,uDAAmD;AAGnD,uDAAmD;AAEnD,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,QAAQ,CAAC,CAAC;AAE7C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K,iCAAc,CAAC,MAAM;YACtB,OAAO,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,cAAe,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,KAAK,iCAAc,CAAC,MAAM;YACtB,OAAO,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAEtD,KAAK,iCAAc,CAAC,SAAS,CAAC;QAC9B,KAAK,iCAAc,CAAC,IAAI,CAAC;QACzB,KAAK,iCAAc,CAAC,UAAU,CAAC;QAC/B,KAAK,iCAAc,CAAC,SAAS,CAAC;QAC9B,KAAK,iCAAc,CAAC,IAAI,CAAC;QACzB,KAAK,iCAAc,CAAC,MAAM,CAAC;QAC3B,KAAK,iCAAc,CAAC,MAAM,CAAC;QAC3B;YACI,+DAA+D;YAC/D,2FAA2F;YAC3F,yDAAyD;YACzD,UAAU,CAAC,yBAAyB,iCAAc,CAAC,OAAO,CAAC,cAAc,CAAC,uCAAuC,CAAC,CAAC;YACnH,OAAO,KAAK,CAAC;KACpB;AACL,CAAC;AAED,SAAgB,WAAW,CAAC,aAA4B,EAAE,aAA4B;IAClF,OAAO,kBAAkB,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAFD,kCAEC"}
@@ -1,9 +0,0 @@
1
- import { SimpleAttributeOperand } from "node-opcua-types";
2
- import { Variant } from "node-opcua-variant";
3
- import { FilterContext } from "./filter_context";
4
- /**
5
- *
6
- * extract a eventField from a event node, matching the given selectClause
7
- */
8
- export declare function extractEventField(context: FilterContext, operand: SimpleAttributeOperand): Variant;
9
- export declare function extractEventFieldsBase(context: FilterContext, selectClauses: SimpleAttributeOperand[]): Variant[];
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractEventFieldsBase = exports.extractEventField = void 0;
4
- const node_opcua_assert_1 = require("node-opcua-assert");
5
- const node_opcua_data_model_1 = require("node-opcua-data-model");
6
- const node_opcua_debug_1 = require("node-opcua-debug");
7
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
8
- const node_opcua_types_1 = require("node-opcua-types");
9
- const node_opcua_variant_1 = require("node-opcua-variant");
10
- const resolve_operand_1 = require("./resolve_operand");
11
- const warningLog = (0, node_opcua_debug_1.make_warningLog)("FILTER");
12
- const conditionTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("ConditionType");
13
- /**
14
- *
15
- * extract a eventField from a event node, matching the given selectClause
16
- */
17
- function extractEventField(context, operand) {
18
- (0, node_opcua_assert_1.assert)(operand instanceof node_opcua_types_1.SimpleAttributeOperand);
19
- operand.browsePath = operand.browsePath || [];
20
- if (operand.browsePath.length === 0 && operand.attributeId === node_opcua_data_model_1.AttributeIds.NodeId) {
21
- // "ns=0;i=2782" => ConditionType
22
- // "ns=0;i=2041" => BaseEventType
23
- if (!(0, node_opcua_nodeid_1.sameNodeId)(operand.typeDefinitionId, conditionTypeNodeId)) {
24
- // not a ConditionType
25
- // but could be on of its derived type. for instance ns=0;i=2881 => AcknowledgeableConditionType
26
- if (!context.isSubtypeOf(operand.typeDefinitionId, conditionTypeNodeId)) {
27
- warningLog(" ", operand.typeDefinitionId.toString());
28
- warningLog("this case is not handled yet : selectClause.typeDefinitionId = " + operand.typeDefinitionId.toString());
29
- warningLog(operand.toString());
30
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.NodeId, value: context.eventSource });
31
- }
32
- }
33
- const eventSourceTypeDefinition = context.getTypeDefinition(context.eventSource);
34
- if (!eventSourceTypeDefinition) {
35
- // eventSource is a EventType class
36
- return new node_opcua_variant_1.Variant();
37
- }
38
- if (!context.isSubtypeOf(eventSourceTypeDefinition, conditionTypeNodeId)) {
39
- return new node_opcua_variant_1.Variant();
40
- }
41
- // Yeh : our EventType is a Condition Type !
42
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.NodeId, value: context.eventSource });
43
- }
44
- return (0, resolve_operand_1.resolveOperand)(context, operand);
45
- }
46
- exports.extractEventField = extractEventField;
47
- function extractEventFieldsBase(context, selectClauses) {
48
- (0, node_opcua_assert_1.assert)(Array.isArray(selectClauses));
49
- (0, node_opcua_assert_1.assert)(selectClauses.length === 0 || selectClauses[0] instanceof node_opcua_types_1.SimpleAttributeOperand);
50
- return selectClauses.map(extractEventField.bind(null, context));
51
- }
52
- exports.extractEventFieldsBase = extractEventFieldsBase;
53
- //# sourceMappingURL=extract_event_field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract_event_field.js","sourceRoot":"","sources":["../source/extract_event_field.ts"],"names":[],"mappings":";;;AAAA,yDAA2C;AAC3C,iEAAqD;AACrD,uDAAmD;AACnD,yDAAsE;AACtE,uDAA0D;AAC1D,2DAAuD;AAEvD,uDAAmD;AAEnD,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,mBAAmB,GAAG,IAAA,iCAAa,EAAC,eAAe,CAAC,CAAC;AAE3D;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,OAAsB,EAAE,OAA+B;IACrF,IAAA,0BAAM,EAAC,OAAO,YAAY,yCAAsB,CAAC,CAAC;IAElD,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;IAE9C,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,WAAW,KAAK,oCAAY,CAAC,MAAM,EAAE;QAChF,iCAAiC;QACjC,iCAAiC;QACjC,IAAI,CAAC,IAAA,8BAAU,EAAC,OAAO,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,EAAE;YAC5D,sBAAsB;YACtB,gGAAgG;YAChG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,EAAE;gBACrE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACrD,UAAU,CA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"node-opcua-types";
3
- import { Variant } from "node-opcua-variant";
4
- export interface FilterContext {
5
- readonly eventSource: NodeId;
6
- isSubtypeOf(nodeId: NodeId, baseType: NodeId): boolean;
7
- getTypeDefinition(nodeId: NodeId): NodeId | null;
8
- readNodeValue(nodeId: NodeIdLike): Variant;
9
- getNodeClass(nodeId: NodeId): NodeClass;
10
- browsePath(browsePath: BrowsePath): NodeId | null;
11
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=filter_context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filter_context.js","sourceRoot":"","sources":["../source/filter_context.ts"],"names":[],"mappings":""}
package/dist/imports.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * @module node-opcua-service-filter
3
- */
4
- export { FilterOperator, AttributeOperand, ElementOperand, FilterOperand, LiteralOperand, SimpleAttributeOperand, MonitoringFilter, ContentFilterElement, ContentFilter, EventFilter, DataChangeFilter, AttributeOperandOptions, ElementOperandOptions, FilterOperandOptions, LiteralOperandOptions, SimpleAttributeOperandOptions, MonitoringFilterOptions, ContentFilterElementOptions, ContentFilterOptions, EventFilterOptions } from "node-opcua-types";
package/dist/imports.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataChangeFilter = exports.EventFilter = exports.ContentFilter = exports.ContentFilterElement = exports.MonitoringFilter = exports.SimpleAttributeOperand = exports.LiteralOperand = exports.FilterOperand = exports.ElementOperand = exports.AttributeOperand = exports.FilterOperator = void 0;
4
- /**
5
- * @module node-opcua-service-filter
6
- */
7
- var node_opcua_types_1 = require("node-opcua-types");
8
- Object.defineProperty(exports, "FilterOperator", { enumerable: true, get: function () { return node_opcua_types_1.FilterOperator; } });
9
- Object.defineProperty(exports, "AttributeOperand", { enumerable: true, get: function () { return node_opcua_types_1.AttributeOperand; } });
10
- Object.defineProperty(exports, "ElementOperand", { enumerable: true, get: function () { return node_opcua_types_1.ElementOperand; } });
11
- Object.defineProperty(exports, "FilterOperand", { enumerable: true, get: function () { return node_opcua_types_1.FilterOperand; } });
12
- Object.defineProperty(exports, "LiteralOperand", { enumerable: true, get: function () { return node_opcua_types_1.LiteralOperand; } });
13
- Object.defineProperty(exports, "SimpleAttributeOperand", { enumerable: true, get: function () { return node_opcua_types_1.SimpleAttributeOperand; } });
14
- Object.defineProperty(exports, "MonitoringFilter", { enumerable: true, get: function () { return node_opcua_types_1.MonitoringFilter; } });
15
- Object.defineProperty(exports, "ContentFilterElement", { enumerable: true, get: function () { return node_opcua_types_1.ContentFilterElement; } });
16
- Object.defineProperty(exports, "ContentFilter", { enumerable: true, get: function () { return node_opcua_types_1.ContentFilter; } });
17
- Object.defineProperty(exports, "EventFilter", { enumerable: true, get: function () { return node_opcua_types_1.EventFilter; } });
18
- Object.defineProperty(exports, "DataChangeFilter", { enumerable: true, get: function () { return node_opcua_types_1.DataChangeFilter; } });
19
- //# sourceMappingURL=imports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imports.js","sourceRoot":"","sources":["../source/imports.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qDA6B0B;AA3BtB,kHAAA,cAAc,OAAA;AAEd,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,iHAAA,aAAa,OAAA;AACb,kHAAA,cAAc,OAAA;AACd,0HAAA,sBAAsB,OAAA;AAEtB,oHAAA,gBAAgB,OAAA;AAEhB,wHAAA,oBAAoB,OAAA;AACpB,iHAAA,aAAa,OAAA;AACb,+GAAA,WAAW,OAAA;AACX,oHAAA,gBAAgB,OAAA"}
package/dist/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * @module node-opcua-service-filter
3
- */
4
- export * from "./check_event_clause";
5
- export * from "./check_where_clause";
6
- export * from "./extract_event_field";
7
- export * from "./filter_context";
8
- export * from "./imports";
9
- export * from "./make_content_filter";
10
- export * from "./on_address_space/extract_event_fields";
11
- export * from "./resolve_operand";
12
- export * from "./tools_event_filter";
13
- export * from "./on_address_space/filter_context_on_address_space";
package/dist/index.js DELETED
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * @module node-opcua-service-filter
19
- */
20
- __exportStar(require("./check_event_clause"), exports);
21
- __exportStar(require("./check_where_clause"), exports);
22
- __exportStar(require("./extract_event_field"), exports);
23
- __exportStar(require("./filter_context"), exports);
24
- __exportStar(require("./imports"), exports);
25
- __exportStar(require("./make_content_filter"), exports);
26
- __exportStar(require("./on_address_space/extract_event_fields"), exports);
27
- __exportStar(require("./resolve_operand"), exports);
28
- __exportStar(require("./tools_event_filter"), exports);
29
- __exportStar(require("./on_address_space/filter_context_on_address_space"), exports);
30
- // The SimpleAttributeOperand is a simplified form of the AttributeOperand and all of the rules that
31
- // apply to the AttributeOperand also apply to the SimpleAttributeOperand. The examples provided in
32
- // B.1 only use AttributeOperand, however, the AttributeOperand can be replaced by a
33
- // SimpleAttributeOperand whenever all ReferenceTypes in the RelativePath are subtypes of
34
- // HierarchicalReferences and the targets are Object or Variable Nodes and an Alias is not required
35
- // typeDefinitionId
36
- // This parameter restricts the operand to instances of the TypeDefinitionNode or
37
- // one of its subtypes.
38
- // { name: "typeDefinitionId", fieldType:"NodeId",documentation:"NodeId of a TypeDefinitionNode."},
39
- // browsePath
40
- // A relative path to a Node.
41
- // This parameter specifies a relative path using a list of BrowseNames instead of
42
- // the RelativePath structure used in the AttributeOperand. The list of
43
- // BrowseNames is equivalent to a RelativePath that specifies forward references
44
- // which are subtypes of the HierarchicalReferences ReferenceType.
45
- // All Nodes followed by the browsePath shall be of the NodeClass Object or
46
- // Variable.
47
- // If this list is empty the Node is the instance of the TypeDefinition.
48
- // { name: "browsePath", isArray:true, fieldType:"QualifiedName"},
49
- // Id of the Attribute. The IntegerId is defined in 7.13.
50
- // The Value Attribute shall be supported by all Servers. The support of other
51
- // Attributes depends on requirements set in Profiles or other parts of this
52
- // specification.
53
- // { name: "attributeId", fieldType:"IntegerId"},
54
- // This parameter is used to identify a single element of an array, or a single range
55
- // of indexes for an array. The first element is identified by index 0 (zero).
56
- // This parameter is ignored if the selected Node is not a Variable or the Value of a
57
- // Variable is not an array.
58
- // The parameter is null if not specified.
59
- // All values in the array are used if this parameter is not specified.
60
- // The NumericRange type is defined in 7.21.
61
- // { name: "indexRange", fieldType:"NumericRange"}
62
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,uDAAqC;AACrC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,4CAA0B;AAC1B,wDAAsC;AACtC,0EAAwD;AACxD,oDAAkC;AAClC,uDAAqC;AACrC,qFAAmE;AAEnE,oGAAoG;AACpG,mGAAmG;AACnG,oFAAoF;AACpF,yFAAyF;AACzF,mGAAmG;AAEnG,mBAAmB;AACnB,iFAAiF;AACjF,uBAAuB;AACvB,mGAAmG;AAEnG,aAAa;AACb,6BAA6B;AAC7B,kFAAkF;AAClF,uEAAuE;AACvE,gFAAgF;AAChF,kEAAkE;AAClE,2EAA2E;AAC3E,YAAY;AACZ,wEAAwE;AACxE,mEAAmE;AAEnE,yDAAyD;AACzD,8EAA8E;AAC9E,4EAA4E;AAC5E,iBAAiB;AACjB,iDAAiD;AAEjD,qFAAqF;AACrF,8EAA8E;AAC9E,qFAAqF;AACrF,4BAA4B;AAC5B,0CAA0C;AAC1C,uEAAuE;AACvE,4CAA4C;AAC5C,kDAAkD"}
@@ -1,22 +0,0 @@
1
- /**
2
- * @module node-opcua-service-filter
3
- */
4
- import { DataType } from "node-opcua-basic-types";
5
- import { AttributeIds } from "node-opcua-data-model";
6
- import { NodeIdLike } from "node-opcua-nodeid";
7
- import { AttributeOperand, ContentFilter, ContentFilterElement, ContentFilterElementOptions, LiteralOperand, SimpleAttributeOperand } from "./imports";
8
- export declare function ofType(nodeId: NodeIdLike): ContentFilterElement;
9
- export declare function l(dataType: DataType, value: any): LiteralOperand;
10
- export declare function n(n: NodeIdLike): LiteralOperand;
11
- export declare function s(attributeId: AttributeIds, path: string): SimpleAttributeOperand;
12
- declare type A = LiteralOperand | SimpleAttributeOperand | AttributeOperand | ContentFilterElement;
13
- export declare function or(a: A, b: A): ContentFilterElement;
14
- export declare function and(a: A, b: A): ContentFilterElement;
15
- export declare function lessThan(a: A, b: A): ContentFilterElement;
16
- export declare function LessThanOrEqual(a: A, b: A): ContentFilterElement;
17
- export declare function greaterThanOrEqual(a: A, b: A): ContentFilterElement;
18
- export declare function greaterThan(a: A, b: A): ContentFilterElement;
19
- export declare function inList(a: A, l: A[]): ContentFilterElement;
20
- export declare function makeContentFilterElements(o: ContentFilterElement): ContentFilterElement[];
21
- export declare function makeContentFilter(o: ContentFilterElementOptions): ContentFilter;
22
- export {};
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeContentFilter = exports.makeContentFilterElements = exports.inList = exports.greaterThan = exports.greaterThanOrEqual = exports.LessThanOrEqual = exports.lessThan = exports.and = exports.or = exports.s = exports.n = exports.l = exports.ofType = void 0;
4
- /**
5
- * @module node-opcua-service-filter
6
- */
7
- const node_opcua_basic_types_1 = require("node-opcua-basic-types");
8
- const node_opcua_data_model_1 = require("node-opcua-data-model");
9
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
10
- const node_opcua_variant_1 = require("node-opcua-variant");
11
- const imports_1 = require("./imports");
12
- function ofType(nodeId) {
13
- const element = new imports_1.ContentFilterElement({
14
- filterOperator: imports_1.FilterOperator.OfType,
15
- filterOperands: [
16
- new imports_1.LiteralOperand({
17
- value: {
18
- dataType: node_opcua_basic_types_1.DataType.NodeId,
19
- value: (0, node_opcua_nodeid_1.resolveNodeId)(nodeId)
20
- }
21
- })
22
- ]
23
- });
24
- return element;
25
- }
26
- exports.ofType = ofType;
27
- function l(dataType, value) {
28
- switch (dataType) {
29
- case node_opcua_basic_types_1.DataType.NodeId:
30
- value = (0, node_opcua_nodeid_1.resolveNodeId)(value);
31
- }
32
- return new imports_1.LiteralOperand({ value: new node_opcua_variant_1.Variant({ dataType, value }) });
33
- }
34
- exports.l = l;
35
- function n(n) {
36
- return l(node_opcua_basic_types_1.DataType.NodeId, n);
37
- }
38
- exports.n = n;
39
- function s(attributeId, path) {
40
- return new imports_1.SimpleAttributeOperand({
41
- attributeId: attributeId,
42
- browsePath: path.split(".").map(node_opcua_data_model_1.coerceQualifiedName)
43
- });
44
- }
45
- exports.s = s;
46
- function or(a, b) {
47
- return new imports_1.ContentFilterElement({
48
- filterOperands: [a, b],
49
- filterOperator: imports_1.FilterOperator.Or
50
- });
51
- }
52
- exports.or = or;
53
- function and(a, b) {
54
- return new imports_1.ContentFilterElement({
55
- filterOperands: [a, b],
56
- filterOperator: imports_1.FilterOperator.And
57
- });
58
- }
59
- exports.and = and;
60
- function lessThan(a, b) {
61
- return new imports_1.ContentFilterElement({
62
- filterOperands: [a, b],
63
- filterOperator: imports_1.FilterOperator.LessThan
64
- });
65
- }
66
- exports.lessThan = lessThan;
67
- function LessThanOrEqual(a, b) {
68
- return new imports_1.ContentFilterElement({
69
- filterOperands: [a, b],
70
- filterOperator: imports_1.FilterOperator.LessThanOrEqual
71
- });
72
- }
73
- exports.LessThanOrEqual = LessThanOrEqual;
74
- function greaterThanOrEqual(a, b) {
75
- return new imports_1.ContentFilterElement({
76
- filterOperands: [a, b],
77
- filterOperator: imports_1.FilterOperator.GreaterThanOrEqual
78
- });
79
- }
80
- exports.greaterThanOrEqual = greaterThanOrEqual;
81
- function greaterThan(a, b) {
82
- return new imports_1.ContentFilterElement({
83
- filterOperands: [a, b],
84
- filterOperator: imports_1.FilterOperator.GreaterThan
85
- });
86
- }
87
- exports.greaterThan = greaterThan;
88
- function inList(a, l) {
89
- return new imports_1.ContentFilterElement({
90
- filterOperands: [a, ...l],
91
- filterOperator: imports_1.FilterOperator.InList
92
- });
93
- }
94
- exports.inList = inList;
95
- function makeContentFilterElements(o) {
96
- const elements = [];
97
- function pushElement(element) {
98
- elements.push(element);
99
- const thisIndex = elements.length - 1;
100
- if (element.filterOperands) {
101
- for (let i = 0; i < element.filterOperands.length; i++) {
102
- const op = element.filterOperands[i];
103
- if (op instanceof imports_1.ContentFilterElement) {
104
- const index = pushElement(op);
105
- element.filterOperands[i] = new imports_1.ElementOperand({ index });
106
- }
107
- }
108
- }
109
- return thisIndex;
110
- }
111
- pushElement(o);
112
- return elements;
113
- }
114
- exports.makeContentFilterElements = makeContentFilterElements;
115
- function makeContentFilter(o) {
116
- return new imports_1.ContentFilter({
117
- elements: makeContentFilterElements(o instanceof imports_1.ContentFilterElement ? o : new imports_1.ContentFilterElement(o))
118
- });
119
- }
120
- exports.makeContentFilter = makeContentFilter;
121
- //# sourceMappingURL=make_content_filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"make_content_filter.js","sourceRoot":"","sources":["../source/make_content_filter.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAkD;AAElD,iEAAgH;AAChH,yDAA8D;AAE9D,2DAA6C;AAE7C,uCAWmB;AAEnB,SAAgB,MAAM,CAAC,MAAkB;IACrC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M,QAAQ,GAA2B,EAAE,CAAC;IAE5C,SAAS,WAAW,CAAC,OAA6B;QAC9C,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACtC,IAAI,OAAO,CAAC,cAAc,EAAE;YACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpD,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;gBACrC,IAAI,EAAE,YAAY,8BAAoB,EAAE;oBACpC,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;oBAC9B,OAAO,CAAC,cAAe,CAAC,CAAC,CAAC,GAAG,IAAI,wBAAc,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;iBAC9D;aACJ;SACJ;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,WAAW,CAAC,CAAC,CAAC,CAAC;IAEf,OAAO,QAAQ,CAAC;AACpB,CAAC;AApBD,8DAoBC;AAED,SAAgB,iBAAiB,CAAC,CAA8B;IAC5D,OAAO,IAAI,uBAAa,CAAC;QACrB,QAAQ,EAAE,yBAAyB,CAAC,CAAC,YAAY,8BAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,8BAAoB,CAAC,CAAC,CAAC,CAAC;KAC3G,CAAC,CAAC;AACP,CAAC;AAJD,8CAIC"}
@@ -1,10 +0,0 @@
1
- import { IEventData, ISessionContext } from "node-opcua-address-space-base";
2
- import { SimpleAttributeOperand } from "node-opcua-types";
3
- import { Variant } from "node-opcua-variant";
4
- /**
5
- * @method extractEventFields
6
- * extract a array of eventFields from a event node, matching the selectClauses
7
- * @param selectClauses
8
- * @param eventData : a pseudo Node that provides a browse Method and a readValue(nodeId)
9
- */
10
- export declare function extractEventFields(sessionContext: ISessionContext, selectClauses: SimpleAttributeOperand[], eventData: IEventData): Variant[];
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractEventFields = void 0;
4
- //
5
- const extract_event_field_1 = require("../extract_event_field");
6
- const filter_context_on_address_space_1 = require("./filter_context_on_address_space");
7
- /**
8
- * @method extractEventFields
9
- * extract a array of eventFields from a event node, matching the selectClauses
10
- * @param selectClauses
11
- * @param eventData : a pseudo Node that provides a browse Method and a readValue(nodeId)
12
- */
13
- function extractEventFields(sessionContext, selectClauses, eventData) {
14
- const context = new filter_context_on_address_space_1.FilterContextOnAddressSpace(sessionContext, eventData);
15
- return (0, extract_event_field_1.extractEventFieldsBase)(context, selectClauses);
16
- }
17
- exports.extractEventFields = extractEventFields;
18
- //# sourceMappingURL=extract_event_fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract_event_fields.js","sourceRoot":"","sources":["../../source/on_address_space/extract_event_fields.ts"],"names":[],"mappings":";;;AAKA,EAAE;AACF,gEAAgE;AAChE,uFAAgF;AAGhF;;;;;GAKG;AACH,SAAgB,kBAAkB,CAC9B,cAA+B,EAC/B,aAAuC,EACvC,SAAqB;IAErB,MAAM,OAAO,GAAG,IAAI,6DAA2B,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC3E,OAAO,IAAA,4CAAsB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC1D,CAAC;AAPD,gDAOC"}
@@ -1,19 +0,0 @@
1
- import { BaseNode, IEventData, ISessionContext } from "node-opcua-address-space-base";
2
- import { NodeClass } from "node-opcua-data-model";
3
- import { NodeId, NodeIdLike } from "node-opcua-nodeid";
4
- import { BrowsePath } from "node-opcua-types";
5
- import { Variant } from "node-opcua-variant";
6
- import { FilterContext } from "../filter_context";
7
- export declare class FilterContextOnAddressSpace implements FilterContext {
8
- private sessionContext;
9
- private eventData;
10
- eventSource: NodeId;
11
- constructor(sessionContext: ISessionContext, eventData: IEventData);
12
- getNodeClass(nodeId: NodeId): NodeClass;
13
- isSubtypeOf(nodeId: NodeId, baseType: NodeId): boolean;
14
- getTypeDefinition(nodeId: NodeId): NodeId | null;
15
- readNodeValue(nodeId: NodeIdLike): Variant;
16
- private getAddressSpace;
17
- browsePath(browsePath: BrowsePath): NodeId | null;
18
- setEventSource(eventSource: BaseNode | null): void;
19
- }
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FilterContextOnAddressSpace = void 0;
4
- const node_opcua_data_model_1 = require("node-opcua-data-model");
5
- const node_opcua_debug_1 = require("node-opcua-debug");
6
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
7
- const node_opcua_variant_1 = require("node-opcua-variant");
8
- const warningLog = (0, node_opcua_debug_1.make_warningLog)("Filter");
9
- class FilterContextOnAddressSpace {
10
- constructor(sessionContext, eventData) {
11
- var _a;
12
- this.sessionContext = sessionContext;
13
- this.eventData = eventData;
14
- this.eventSource = ((_a = this.eventData.$eventDataSource) === null || _a === void 0 ? void 0 : _a.nodeId) || node_opcua_nodeid_1.NodeId.nullNodeId;
15
- }
16
- getNodeClass(nodeId) {
17
- const addressSpace = this.getAddressSpace();
18
- const node = addressSpace.findNode(nodeId);
19
- return node ? node.nodeClass : node_opcua_data_model_1.NodeClass.Unspecified;
20
- }
21
- isSubtypeOf(nodeId, baseType) {
22
- const addressSpace = this.getAddressSpace();
23
- const node = addressSpace.findNode(nodeId);
24
- const baseTypeNode = addressSpace.findNode(baseType);
25
- if (!node || !baseTypeNode) {
26
- warningLog("invalid node - must be specifed ");
27
- return false;
28
- }
29
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType && baseTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType) {
30
- return node.isSubtypeOf(baseTypeNode);
31
- }
32
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.VariableType && baseTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.VariableType) {
33
- return node.isSubtypeOf(baseTypeNode);
34
- }
35
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.ReferenceType && baseTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.ReferenceType) {
36
- return node.isSubtypeOf(baseTypeNode);
37
- }
38
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.DataType && baseTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.DataType) {
39
- return node.isSubtypeOf(baseTypeNode);
40
- }
41
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.Object && baseTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType) {
42
- const obj = node;
43
- return obj.typeDefinitionObj.isSubtypeOf(baseTypeNode);
44
- }
45
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.Variable && baseTypeNode.nodeClass !== node_opcua_data_model_1.NodeClass.VariableType) {
46
- const obj = node;
47
- return obj.typeDefinitionObj.isSubtypeOf(baseTypeNode);
48
- }
49
- return false;
50
- }
51
- getTypeDefinition(nodeId) {
52
- const addressSpace = this.getAddressSpace();
53
- const node = addressSpace.findNode(nodeId);
54
- if (!node)
55
- return null;
56
- if (node.nodeClass === node_opcua_data_model_1.NodeClass.Object || node.nodeClass === node_opcua_data_model_1.NodeClass.Variable) {
57
- return node.typeDefinition;
58
- }
59
- return null;
60
- }
61
- readNodeValue(nodeId) {
62
- nodeId = (0, node_opcua_nodeid_1.coerceNodeId)(nodeId);
63
- // use cache/snapshot if available
64
- const value = this.eventData._readValue(nodeId);
65
- if (value) {
66
- return value;
67
- }
68
- const addressSpace = this.getAddressSpace();
69
- const node = addressSpace.findNode(nodeId);
70
- if (!node || node.nodeClass !== node_opcua_data_model_1.NodeClass.Variable) {
71
- return new node_opcua_variant_1.Variant();
72
- }
73
- return prepare(node.readValue(this.sessionContext));
74
- }
75
- getAddressSpace() {
76
- return this.eventData.$eventDataSource.addressSpace;
77
- }
78
- browsePath(browsePath) {
79
- // delegate to eventData if appropriate
80
- if ((0, node_opcua_nodeid_1.sameNodeId)(browsePath.startingNode, this.eventSource)) {
81
- const browseResult = this.eventData._browse(browsePath);
82
- if (browseResult &&
83
- browseResult.statusCode.isGood() &&
84
- browseResult.targets &&
85
- browseResult.targets.length === 1) {
86
- return browseResult.targets[0].targetId;
87
- }
88
- }
89
- // fallback to addressSpace otherwise
90
- const addressSpace = this.getAddressSpace();
91
- const browseResult = addressSpace.browsePath(browsePath);
92
- if (browseResult.statusCode.isNotGood() || !browseResult.targets || browseResult.targets.length !== 1) {
93
- return null;
94
- }
95
- return browseResult.targets[0].targetId;
96
- }
97
- setEventSource(eventSource) {
98
- this.eventSource = eventSource ? eventSource.nodeId : node_opcua_nodeid_1.NodeId.nullNodeId;
99
- }
100
- }
101
- exports.FilterContextOnAddressSpace = FilterContextOnAddressSpace;
102
- function prepare(dataValue) {
103
- if (dataValue.statusCode.isGood()) {
104
- return dataValue.value;
105
- }
106
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.StatusCode, value: dataValue.statusCode });
107
- }
108
- //# sourceMappingURL=filter_context_on_address_space.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filter_context_on_address_space.js","sourceRoot":"","sources":["../../source/on_address_space/filter_context_on_address_space.ts"],"names":[],"mappings":";;;AAYA,iEAAgE;AAChE,uDAAmD;AACnD,yDAAiF;AAGjF,2DAAuD;AAKvD,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,QAAQ,CAAC,CAAC;AAE7C,MAAa,2BAA2B;IAGpC,YAAoB,cAA+B,EAAU,SAAqB;;QAA9D,mBAAc,GAAd,cAAc,CAAiB;QAAU,cAAS,GAAT,SAAS,CAAY;QAC9E,IAAI,CAAC,WAAW,GAAG,CAAA,MAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,0CAAE,MAAM,KAAI,0BAAM,CAAC,UAAU,CAAC;IACpF,CAAC;IAED,YAAY,CAAC,MAAc;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC5C,MAA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E,CAAC;CACJ;AAtGD,kEAsGC;AAED,SAAS,OAAO,CAAC,SAAoB;IACjC,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE;QAC/B,OAAO,SAAS,CAAC,KAAK,CAAC;KAC1B;IACD,OAAO,IAAI,4BAAO,CAAC,EAAE,QAAQ,EAAE,6BAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;AACvF,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./filter_context_on_address_space";
2
- export * from "./extract_event_fields";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./filter_context_on_address_space"), exports);
18
- __exportStar(require("./extract_event_fields"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/on_address_space/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,oEAAkD;AAClD,yDAAuC"}
@@ -1,4 +0,0 @@
1
- import { SimpleAttributeOperand, AttributeOperand } from "node-opcua-types";
2
- import { Variant } from "node-opcua-variant";
3
- import { FilterContext } from "./filter_context";
4
- export declare function resolveOperand(context: FilterContext, operand: SimpleAttributeOperand | AttributeOperand): Variant;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveOperand = void 0;
4
- const node_opcua_data_model_1 = require("node-opcua-data-model");
5
- const node_opcua_debug_1 = require("node-opcua-debug");
6
- const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
7
- const node_opcua_status_code_1 = require("node-opcua-status-code");
8
- const node_opcua_types_1 = require("node-opcua-types");
9
- const node_opcua_variant_1 = require("node-opcua-variant");
10
- const warningLog = (0, node_opcua_debug_1.make_warningLog)("FILTER");
11
- // export function readOperand(context: FilterContext, operand: SimpleAttributeOperand): Variant {
12
- // // navigate to the innerNode specified by the browsePath [ QualifiedName]
13
- // const browsePath = constructBrowsePathFromQualifiedName({ nodeId: context.eventSource }, operand.browsePath);
14
- // const targetNode = context.browsePath(browsePath);
15
- // if (!targetNode) {
16
- // return new Variant({ dataType: DataType.Null });
17
- // }
18
- // return context.readNodeValue(targetNode);
19
- // }
20
- function resolveOperand(context, operand) {
21
- if (operand instanceof node_opcua_types_1.SimpleAttributeOperand) {
22
- const browsePath = (0, node_opcua_service_translate_browse_path_1.constructBrowsePathFromQualifiedName)({ nodeId: context.eventSource }, operand.browsePath);
23
- const target = context.browsePath(browsePath);
24
- if (!target) {
25
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.Null });
26
- // return new Variant({ dataType: DataType.StatusCode, value: StatusCodes.BadNodeIdUnknown });
27
- }
28
- const nodeClass = context.getNodeClass(target);
29
- if (nodeClass !== node_opcua_data_model_1.NodeClass.Variable) {
30
- warningLog("resolveOperand: cannot find variable here but got nodeClass", node_opcua_data_model_1.NodeClass[nodeClass], browsePath.toString());
31
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.StatusCode, value: node_opcua_status_code_1.StatusCodes.BadNodeClassInvalid });
32
- }
33
- const value = context.readNodeValue(target);
34
- return value;
35
- }
36
- else {
37
- if (!(operand instanceof node_opcua_types_1.AttributeOperand)) {
38
- throw new Error("expecting an AttributeOperand");
39
- }
40
- warningLog("AttributeOperand is not yet implemented");
41
- return new node_opcua_variant_1.Variant({ dataType: node_opcua_variant_1.DataType.Null });
42
- }
43
- }
44
- exports.resolveOperand = resolveOperand;
45
- //# sourceMappingURL=resolve_operand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve_operand.js","sourceRoot":"","sources":["../source/resolve_operand.ts"],"names":[],"mappings":";;;AAAA,iEAAkD;AAClD,uDAAmD;AAEnD,uGAAgH;AAChH,mEAAqD;AACrD,uDAAgG;AAChG,2DAAuD;AAGvD,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,QAAQ,CAAC,CAAC;AAE7C,kGAAkG;AAClG,gFAAgF;AAChF,oHAAoH;AACpH,yDAAyD;AACzD,yBAAyB;AACzB,2DAA2D;AAC3D,QAAQ;AACR,gDAAgD;AAChD,IAAI;AAEJ,SAAgB,cAAc,CAAC,OAAsB,EAAE,OAAkD;IACrG,IAAI,OAAO,YAAY,yCAAsB,EAAE;QAC3C,MAAM,UAAU,GAAG,IAAA,+EAAoC,EAAC,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAE7G,MAAM,MAAM,GAAkB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,IAAI,4BAAO,CAAC,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAChD,8FAA8F;SACjG;QACD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,SAAS,KAAK,iCAAS,CAAC,QAAQ,EAAE;YAClC,UAAU,CAAC,6DAA6D,EAAE,iCAAS,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvH,OAAO,IAAI,4BAAO,CAAC,EAAE,QAAQ,EAAE,6BAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,oCAAW,CAAC,mBAAmB,EAAE,CAAC,CAAC;SACjG;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO,KAAK,CAAC;KAChB;SAAM;QACH,IAAI,CAAC,CAAC,OAAO,YAAY,mCAAgB,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SACpD;QACD,UAAU,CAAC,yCAAyC,CAAC,CAAC;QACtD,OAAO,IAAI,4BAAO,CAAC,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;KACnD;AACL,CAAC;AAvBD,wCAuBC"}
@@ -1,20 +0,0 @@
1
- import { ContentFilterElement, ContentFilterOptions, EventFilter, SimpleAttributeOperand } from "./imports";
2
- export declare function constructSelectClause(arrayOfNames: string | string[]): SimpleAttributeOperand[];
3
- /**
4
- * helper to construct event filters:
5
- * construct a simple event filter
6
- *
7
- * "ConditionId" in the arrayOfNames has a special meaning
8
- *
9
- * @example
10
- *
11
- * constructEventFilter(["SourceName","Message","ReceiveTime"]);
12
- *
13
- * constructEventFilter(["SourceName",{namespaceIndex:2 , "MyData"}]);
14
- * constructEventFilter(["SourceName","2:MyData" ]);
15
- *
16
- * constructEventFilter(["SourceName" ,["EnabledState","EffectiveDisplayName"] ]);
17
- * constructEventFilter(["SourceName" ,"EnabledState.EffectiveDisplayName" ]);
18
- *
19
- */
20
- export declare function constructEventFilter(arrayOfNames: string[] | string, whereClause?: ContentFilterOptions | ContentFilterElement): EventFilter;
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.constructEventFilter = exports.constructSelectClause = void 0;
4
- /**
5
- * @module node-opcua-service-filter
6
- */
7
- const node_opcua_constants_1 = require("node-opcua-constants");
8
- const node_opcua_data_model_1 = require("node-opcua-data-model");
9
- const imports_1 = require("./imports");
10
- function constructSelectClause(arrayOfNames) {
11
- if (!Array.isArray(arrayOfNames)) {
12
- return constructSelectClause([arrayOfNames]);
13
- }
14
- // replace "string" element in the form A.B.C into [ "A","B","C"]
15
- const arrayOfNames2 = arrayOfNames.map((path) => (typeof path !== "string" ? path : path.split(".")));
16
- const arrayOfNames3 = arrayOfNames2.map((path) => (Array.isArray(path) ? path.map(node_opcua_data_model_1.stringToQualifiedName) : path));
17
- // replace "string" elements in arrayOfName with QualifiedName in namespace 0
18
- const arrayOfNames4 = arrayOfNames3.map((s) => (typeof s === "string" ? (0, node_opcua_data_model_1.stringToQualifiedName)(s) : s));
19
- // construct browse paths array
20
- const browsePaths = arrayOfNames4.map((s) => (Array.isArray(s) ? s : [s]));
21
- // Part 4 page 127:
22
- // In some cases the same BrowsePath will apply to multiple EventTypes. If the Client specifies the BaseEventType
23
- // in the SimpleAttributeOperand then the Server shall evaluate the BrowsePath without considering the Type.
24
- const isBrowsePathForConditionId = (browsePath) => browsePath.length === 1 && browsePath[0].namespaceIndex === 0 && browsePath[0].name === "ConditionId";
25
- // [..]
26
- // The SimpleAttributeOperand structure allows the Client to specify any Attribute, however, the Server is only
27
- // required to support the Value Attribute for Variable Nodes and the NodeId Attribute for Object Nodes.
28
- // That said, profiles defined in Part 7 may make support for additional Attributes mandatory.
29
- const selectClauses = browsePaths.map((browsePath) => {
30
- if (isBrowsePathForConditionId(browsePath)) {
31
- // special case
32
- //
33
- // The NodeId of the Condition instance is used as ConditionId. It is not explicitly modelled as a
34
- // component of the ConditionType. However, it can be requested with the following
35
- // SimpleAttributeOperand (see Table 10) in the SelectClause of the EventFilter:
36
- //
37
- // SimpleAttributeOperand
38
- // Name Type Description
39
- // typeId NodeId NodeId of the ConditionType Node
40
- // browsePath[] QualifiedName empty
41
- // attributeId IntegerId Id of the NodeId Attribute
42
- //
43
- return new imports_1.SimpleAttributeOperand({
44
- attributeId: node_opcua_data_model_1.AttributeIds.NodeId,
45
- browsePath: null,
46
- indexRange: undefined,
47
- typeDefinitionId: node_opcua_constants_1.ObjectTypeIds.ConditionType // i=2782
48
- });
49
- }
50
- else
51
- return new imports_1.SimpleAttributeOperand({
52
- attributeId: node_opcua_data_model_1.AttributeIds.Value,
53
- browsePath,
54
- indexRange: undefined,
55
- typeDefinitionId: node_opcua_constants_1.ObjectTypeIds.BaseEventType // i=2041
56
- });
57
- });
58
- return selectClauses;
59
- }
60
- exports.constructSelectClause = constructSelectClause;
61
- /**
62
- * helper to construct event filters:
63
- * construct a simple event filter
64
- *
65
- * "ConditionId" in the arrayOfNames has a special meaning
66
- *
67
- * @example
68
- *
69
- * constructEventFilter(["SourceName","Message","ReceiveTime"]);
70
- *
71
- * constructEventFilter(["SourceName",{namespaceIndex:2 , "MyData"}]);
72
- * constructEventFilter(["SourceName","2:MyData" ]);
73
- *
74
- * constructEventFilter(["SourceName" ,["EnabledState","EffectiveDisplayName"] ]);
75
- * constructEventFilter(["SourceName" ,"EnabledState.EffectiveDisplayName" ]);
76
- *
77
- */
78
- function constructEventFilter(arrayOfNames, whereClause) {
79
- const selectClauses = constructSelectClause(arrayOfNames);
80
- if (whereClause instanceof imports_1.ContentFilterElement) {
81
- whereClause = new imports_1.ContentFilter({ elements: [whereClause] });
82
- }
83
- const filter = new imports_1.EventFilter({
84
- selectClauses,
85
- whereClause
86
- });
87
- return filter;
88
- }
89
- exports.constructEventFilter = constructEventFilter;
90
- //# sourceMappingURL=tools_event_filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools_event_filter.js","sourceRoot":"","sources":["../source/tools_event_filter.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAqD;AACrD,iEAA2F;AAG3F,uCAA2I;AAI3I,SAAgB,qBAAqB,CAAC,YAA+B;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC9B,OAAO,qBAAqB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;KAChD;IAED,iEAAiE;IACjE,MAA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