You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

node-opcua-service-filter

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-service-filter - npm Package Compare versions

Comparing version

to
2.6.1

3

dist/imports.d.ts

@@ -0,1 +1,4 @@

/**
* @module node-opcua-service-filter
*/
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";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module node-opcua-service-filter
*/
var node_opcua_types_1 = require("node-opcua-types");

@@ -4,0 +7,0 @@ Object.defineProperty(exports, "FilterOperator", { enumerable: true, get: function () { return node_opcua_types_1.FilterOperator; } });

@@ -0,2 +1,5 @@

/**
* @module node-opcua-service-filter
*/
export * from "./imports";
export * from "./tools_event_filter";

@@ -13,4 +13,39 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module node-opcua-service-filter
*/
__exportStar(require("./imports"), exports);
__exportStar(require("./tools_event_filter"), exports);
// The SimpleAttributeOperand is a simplified form of the AttributeOperand and all of the rules that
// apply to the AttributeOperand also apply to the SimpleAttributeOperand. The examples provided in
// B.1 only use AttributeOperand, however, the AttributeOperand can be replaced by a
// SimpleAttributeOperand whenever all ReferenceTypes in the RelativePath are subtypes of
// HierarchicalReferences and the targets are Object or Variable Nodes and an Alias is not required
// typeDefinitionId
// This parameter restricts the operand to instances of the TypeDefinitionNode or
// one of its subtypes.
// { name: "typeDefinitionId", fieldType:"NodeId",documentation:"NodeId of a TypeDefinitionNode."},
// browsePath
// A relative path to a Node.
// This parameter specifies a relative path using a list of BrowseNames instead of
// the RelativePath structure used in the AttributeOperand. The list of
// BrowseNames is equivalent to a RelativePath that specifies forward references
// which are subtypes of the HierarchicalReferences ReferenceType.
// All Nodes followed by the browsePath shall be of the NodeClass Object or
// Variable.
// If this list is empty the Node is the instance of the TypeDefinition.
// { name: "browsePath", isArray:true, fieldType:"QualifiedName"},
// Id of the Attribute. The IntegerId is defined in 7.13.
// The Value Attribute shall be supported by all Servers. The support of other
// Attributes depends on requirements set in Profiles or other parts of this
// specification.
// { name: "attributeId", fieldType:"IntegerId"},
// This parameter is used to identify a single element of an array, or a single range
// of indexes for an array. The first element is identified by index 0 (zero).
// This parameter is ignored if the selected Node is not a Variable or the Value of a
// Variable is not an array.
// The parameter is null if not specified.
// All values in the array are used if this parameter is not specified.
// The NumericRange type is defined in 7.21.
// { name: "indexRange", fieldType:"NumericRange"}
//# sourceMappingURL=index.js.map
import { NodeId } from "node-opcua-nodeid";
import { EventFilter, SimpleAttributeOperand } from "./imports";
/**
* helper to construct event filters:
* construct a simple event filter
*
*
* @example
*
* constructEventFilter(["SourceName","Message","ReceiveTime"]);
*
* constructEventFilter(["SourceName",{namespaceIndex:2 , "MyData"}]);
* constructEventFilter(["SourceName","2:MyData" ]);
*
* constructEventFilter(["SourceName" ,["EnabledState","EffectiveDisplayName"] ]);
* constructEventFilter(["SourceName" ,"EnabledState.EffectiveDisplayName" ]);
*
*/
export declare function constructEventFilter(arrayOfNames: string[] | string, conditionTypes?: NodeId[] | NodeId): EventFilter;
/**
* @class SimpleAttributeOperand
* @method toShortString
* @return {String}
*
* @example:
*
*
*/
export declare function simpleAttributeOperandToShortString(self: SimpleAttributeOperand, addressSpace: any): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.simpleAttributeOperandToShortString = exports.constructEventFilter = void 0;
/**
* @module node-opcua-service-filter
*/
// tslint:disable:object-literal-shorthand
// tslint:disable:only-arrow-functions
// tslint:disable:max-line-length
const _ = require("underscore");

@@ -12,2 +18,18 @@ const node_opcua_constants_1 = require("node-opcua-constants");

const doDebug = node_opcua_debug_1.checkDebugFlag(__filename);
/**
* helper to construct event filters:
* construct a simple event filter
*
*
* @example
*
* constructEventFilter(["SourceName","Message","ReceiveTime"]);
*
* constructEventFilter(["SourceName",{namespaceIndex:2 , "MyData"}]);
* constructEventFilter(["SourceName","2:MyData" ]);
*
* constructEventFilter(["SourceName" ,["EnabledState","EffectiveDisplayName"] ]);
* constructEventFilter(["SourceName" ,"EnabledState.EffectiveDisplayName" ]);
*
*/
function constructEventFilter(arrayOfNames, conditionTypes) {

@@ -20,5 +42,7 @@ if (!_.isArray(arrayOfNames)) {

}
// istanbul ignore next
if (!(arrayOfNames instanceof Array)) {
throw new Error("internal error");
}
// replace "string" element in the form A.B.C into [ "A","B","C"]
const arrayOfNames2 = arrayOfNames.map((path) => {

@@ -36,8 +60,17 @@ if (typeof path !== "string") {

});
// replace "string" elements in arrayOfName with QualifiedName in namespace 0
const arrayOfNames4 = arrayOfNames3.map((s) => {
return (typeof s === "string") ? node_opcua_data_model_1.stringToQualifiedName(s) : s;
});
// construct browse paths array
const browsePaths = arrayOfNames4.map((s) => {
return _.isArray(s) ? s : [s];
});
// Part 4 page 127:
// In some cases the same BrowsePath will apply to multiple EventTypes. If the Client specifies the BaseEventType
// in the SimpleAttributeOperand then the Server shall evaluate the BrowsePath without considering the Type.
// [..]
// The SimpleAttributeOperand structure allows the Client to specify any Attribute, however, the Server is only
// required to support the Value Attribute for Variable Nodes and the NodeId Attribute for Object Nodes.
// That said, profiles defined in Part 7 may make support for additional Attributes mandatory.
let selectClauses = browsePaths.map((browsePath) => {

@@ -48,3 +81,3 @@ return new imports_1.SimpleAttributeOperand({

indexRange: undefined,
typeDefinitionId: node_opcua_nodeid_1.makeNodeId(node_opcua_constants_1.ObjectTypeIds.BaseEventType)
typeDefinitionId: node_opcua_nodeid_1.makeNodeId(node_opcua_constants_1.ObjectTypeIds.BaseEventType) // i=2041
});

@@ -58,3 +91,3 @@ });

indexRange: undefined,
typeDefinitionId: nodeId
typeDefinitionId: nodeId // conditionType for instance
});

@@ -67,3 +100,21 @@ });

whereClause: {
elements: []
elements: [
// ContentFilterElement
// {
// filterOperator: FilterOperator.IsNull,
// filterOperands: [ //
// new ElementOperand({
// index: 123
// }),
// new AttributeOperand({
// nodeId: "i=10",
// alias: "someText",
// browsePath: { //RelativePath
//
// },
// attributeId: AttributeIds.Value
// })
// ]
// }
]
}

@@ -74,2 +125,11 @@ });

exports.constructEventFilter = constructEventFilter;
/**
* @class SimpleAttributeOperand
* @method toPath
* @return {String}
*
* @example:
*
*
*/
function simpleAttributeOperandToPath(self) {

@@ -83,3 +143,13 @@ if (!self.browsePath) {

}
function simpleAttributeOperandToShortString(self, addressSpace) {
/**
* @class SimpleAttributeOperand
* @method toShortString
* @return {String}
*
* @example:
*
*
*/
function simpleAttributeOperandToShortString(self, addressSpace // Address Space
) {
let str = "";

@@ -86,0 +156,0 @@ if (addressSpace) {

34

package.json
{
"name": "node-opcua-service-filter",
"version": "2.6.0-alpha.7",
"version": "2.6.1",
"description": "pure nodejs OPCUA SDK - module -service-filter",

@@ -13,20 +13,20 @@ "main": "./dist/index.js",

"dependencies": {
"node-opcua-assert": "^2.6.0-alpha.1",
"node-opcua-basic-types": "^2.6.0-alpha.1",
"node-opcua-binary-stream": "^2.6.0-alpha.1",
"node-opcua-constants": "^2.6.0-alpha.1",
"node-opcua-data-model": "^2.6.0-alpha.7",
"node-opcua-debug": "^2.6.0-alpha.1",
"node-opcua-factory": "^2.6.0-alpha.7",
"node-opcua-nodeid": "^2.6.0-alpha.1",
"node-opcua-numeric-range": "^2.6.0-alpha.7",
"node-opcua-service-translate-browse-path": "^2.6.0-alpha.7",
"node-opcua-status-code": "^2.6.0-alpha.1",
"node-opcua-types": "^2.6.0-alpha.7",
"node-opcua-variant": "^2.6.0-alpha.7",
"node-opcua-assert": "^2.6.1",
"node-opcua-basic-types": "^2.6.1",
"node-opcua-binary-stream": "^2.6.1",
"node-opcua-constants": "^2.6.1",
"node-opcua-data-model": "^2.6.1",
"node-opcua-debug": "^2.6.1",
"node-opcua-factory": "^2.6.1",
"node-opcua-nodeid": "^2.6.1",
"node-opcua-numeric-range": "^2.6.1",
"node-opcua-service-translate-browse-path": "^2.6.1",
"node-opcua-status-code": "^2.6.1",
"node-opcua-types": "^2.6.1",
"node-opcua-variant": "^2.6.1",
"underscore": "^1.10.2"
},
"devDependencies": {
"node-opcua-generator": "^2.6.0-alpha.7",
"node-opcua-service-secure-channel": "^2.6.0-alpha.7",
"node-opcua-generator": "^2.6.1",
"node-opcua-service-secure-channel": "^2.6.1",
"should": "^13.2.3"

@@ -49,3 +49,3 @@ },

"homepage": "http://node-opcua.github.io/",
"gitHead": "6af0c6f183dcb96ddc5a2befc98851d0960c5fd0"
"gitHead": "15f0c0f83232fc63310dc04fea187048c7a01e4b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet