node-opcua-address-space-base 2.164.0 → 2.165.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/dist/address_space.d.ts +19 -1
- package/dist/session_context.d.ts +22 -2
- package/package.json +14 -14
- package/source/address_space.ts +28 -1
- package/source/session_context.ts +32 -2
package/dist/address_space.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
2
2
|
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
3
3
|
import { AnyConstructorFunc } from "node-opcua-schemas";
|
|
4
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
4
5
|
import { BrowseDescription, BrowsePath, BrowsePathResult, BrowseResult } from "node-opcua-types";
|
|
5
|
-
import { DataType, VariantByteString } from "node-opcua-variant";
|
|
6
|
+
import { DataType, Variant, VariantByteString } from "node-opcua-variant";
|
|
6
7
|
import { AddReferenceOpts, BaseNode } from "./base_node";
|
|
7
8
|
import { INamespace } from "./namespace";
|
|
8
9
|
import { ISessionContext } from "./session_context";
|
|
@@ -18,6 +19,12 @@ import { IHistoricalDataNodeOptions, UAVariable } from "./ua_variable";
|
|
|
18
19
|
import { UAVariableType } from "./ua_variable_type";
|
|
19
20
|
import { UAView } from "./ua_view";
|
|
20
21
|
export type ShutdownTask = ((this: IAddressSpace) => void) | ((this: IAddressSpace) => Promise<void>);
|
|
22
|
+
/**
|
|
23
|
+
* A method call interceptor is invoked before every UAMethod.execute() call.
|
|
24
|
+
* Return `StatusCodes.Good` to allow the call, or any other StatusCode to reject it.
|
|
25
|
+
* The interceptor may be synchronous or asynchronous.
|
|
26
|
+
*/
|
|
27
|
+
export type MethodCallInterceptor = (context: ISessionContext, object: UAObject | UAObjectType | null, method: UAMethod, inputArguments: Variant[]) => StatusCode | Promise<StatusCode>;
|
|
21
28
|
interface UARootFolder_Objects extends UAObject {
|
|
22
29
|
server: UAObject;
|
|
23
30
|
}
|
|
@@ -170,5 +177,16 @@ export interface IAddressSpace {
|
|
|
170
177
|
* EventId is generated by the Server to uniquely identify a particular Event Notification.
|
|
171
178
|
*/
|
|
172
179
|
generateEventId(): VariantByteString;
|
|
180
|
+
/**
|
|
181
|
+
* Register a method call interceptor.
|
|
182
|
+
* Interceptors are called sequentially before each UAMethod.execute().
|
|
183
|
+
* If any interceptor returns a non-Good StatusCode, the method call
|
|
184
|
+
* is rejected and subsequent interceptors are skipped.
|
|
185
|
+
*/
|
|
186
|
+
addMethodCallInterceptor(interceptor: MethodCallInterceptor): void;
|
|
187
|
+
/**
|
|
188
|
+
* Remove a previously registered method call interceptor.
|
|
189
|
+
*/
|
|
190
|
+
removeMethodCallInterceptor(interceptor: MethodCallInterceptor): void;
|
|
173
191
|
}
|
|
174
192
|
export {};
|
|
@@ -44,13 +44,33 @@ export interface ContinuationPointData {
|
|
|
44
44
|
dataValues: DataValue[];
|
|
45
45
|
}
|
|
46
46
|
export interface ISessionContext {
|
|
47
|
-
session
|
|
47
|
+
/** The underlying OPC UA session, if available. */
|
|
48
|
+
readonly session?: ISessionBase;
|
|
49
|
+
/** Returns the NodeIds of all roles assigned to the current user. */
|
|
48
50
|
getCurrentUserRoles(): NodeId[];
|
|
51
|
+
/** Check whether the current user has the given permission on a node. */
|
|
49
52
|
checkPermission(node: BaseNode, action: PermissionType): boolean;
|
|
53
|
+
/** Returns `true` if browsing the given node is restricted for the current user. */
|
|
50
54
|
isBrowseAccessRestricted(node: BaseNode): boolean;
|
|
55
|
+
/** Returns `true` if the current user has the given role. */
|
|
51
56
|
currentUserHasRole(role: NodeIdLike): boolean;
|
|
57
|
+
/** Returns `true` if access to the node is restricted by security settings. */
|
|
52
58
|
isAccessRestricted(node: BaseNode): boolean;
|
|
59
|
+
/** The object on which the current operation is being performed. */
|
|
53
60
|
object?: UAObject | UAObjectType;
|
|
61
|
+
/** Server timestamp at the time the request was received. */
|
|
54
62
|
currentTime?: PreciseClock;
|
|
55
|
-
|
|
63
|
+
/** Display name of the authenticated user (e.g. "anonymous"). */
|
|
64
|
+
readonly userIdentity?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The client's application-instance certificate,
|
|
67
|
+
* or `null` if no secure channel is available.
|
|
68
|
+
*/
|
|
69
|
+
readonly clientCertificate: Certificate | null;
|
|
70
|
+
/**
|
|
71
|
+
* The application URI extracted from the client
|
|
72
|
+
* certificate's SubjectAltName, or `null` if
|
|
73
|
+
* unavailable.
|
|
74
|
+
*/
|
|
75
|
+
readonly clientApplicationUri: string | null;
|
|
56
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space-base",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.165.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module address-space-base",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"node-opcua-assert": "2.164.0",
|
|
21
|
-
"node-opcua-basic-types": "2.
|
|
21
|
+
"node-opcua-basic-types": "2.165.0",
|
|
22
22
|
"node-opcua-constants": "2.157.0",
|
|
23
23
|
"node-opcua-crypto": "5.3.0",
|
|
24
|
-
"node-opcua-data-model": "2.
|
|
25
|
-
"node-opcua-data-value": "2.
|
|
26
|
-
"node-opcua-date-time": "2.
|
|
27
|
-
"node-opcua-debug": "2.
|
|
28
|
-
"node-opcua-extension-object": "2.
|
|
29
|
-
"node-opcua-nodeid": "2.
|
|
30
|
-
"node-opcua-numeric-range": "2.
|
|
31
|
-
"node-opcua-schemas": "2.
|
|
32
|
-
"node-opcua-status-code": "2.
|
|
33
|
-
"node-opcua-types": "2.
|
|
34
|
-
"node-opcua-variant": "2.
|
|
24
|
+
"node-opcua-data-model": "2.165.0",
|
|
25
|
+
"node-opcua-data-value": "2.165.0",
|
|
26
|
+
"node-opcua-date-time": "2.165.0",
|
|
27
|
+
"node-opcua-debug": "2.165.0",
|
|
28
|
+
"node-opcua-extension-object": "2.165.0",
|
|
29
|
+
"node-opcua-nodeid": "2.165.0",
|
|
30
|
+
"node-opcua-numeric-range": "2.165.0",
|
|
31
|
+
"node-opcua-schemas": "2.165.0",
|
|
32
|
+
"node-opcua-status-code": "2.165.0",
|
|
33
|
+
"node-opcua-types": "2.165.0",
|
|
34
|
+
"node-opcua-variant": "2.165.0"
|
|
35
35
|
},
|
|
36
36
|
"author": "Etienne Rossignon",
|
|
37
37
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"internet of things"
|
|
49
49
|
],
|
|
50
50
|
"homepage": "http://node-opcua.github.io/",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "fe53ac03427fcb223996446c991f7496635ba193",
|
|
52
52
|
"files": [
|
|
53
53
|
"dist",
|
|
54
54
|
"source"
|
package/source/address_space.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
2
2
|
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
3
3
|
import { AnyConstructorFunc } from "node-opcua-schemas";
|
|
4
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
4
5
|
import { BrowseDescription, BrowsePath, BrowsePathResult, BrowseResult } from "node-opcua-types";
|
|
5
|
-
import { DataType, VariantByteString } from "node-opcua-variant";
|
|
6
|
+
import { DataType, Variant, VariantByteString } from "node-opcua-variant";
|
|
6
7
|
//
|
|
7
8
|
import { AddReferenceOpts, BaseNode } from "./base_node";
|
|
8
9
|
import { INamespace } from "./namespace";
|
|
@@ -21,6 +22,18 @@ import { UAView } from "./ua_view";
|
|
|
21
22
|
|
|
22
23
|
export type ShutdownTask = ((this: IAddressSpace) => void) | ((this: IAddressSpace) => Promise<void>);
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* A method call interceptor is invoked before every UAMethod.execute() call.
|
|
27
|
+
* Return `StatusCodes.Good` to allow the call, or any other StatusCode to reject it.
|
|
28
|
+
* The interceptor may be synchronous or asynchronous.
|
|
29
|
+
*/
|
|
30
|
+
export type MethodCallInterceptor = (
|
|
31
|
+
context: ISessionContext,
|
|
32
|
+
object: UAObject | UAObjectType | null,
|
|
33
|
+
method: UAMethod,
|
|
34
|
+
inputArguments: Variant[]
|
|
35
|
+
) => StatusCode | Promise<StatusCode>;
|
|
36
|
+
|
|
24
37
|
interface UARootFolder_Objects extends UAObject {
|
|
25
38
|
server: UAObject;
|
|
26
39
|
}
|
|
@@ -208,4 +221,18 @@ export interface IAddressSpace {
|
|
|
208
221
|
* EventId is generated by the Server to uniquely identify a particular Event Notification.
|
|
209
222
|
*/
|
|
210
223
|
generateEventId(): VariantByteString;
|
|
224
|
+
|
|
225
|
+
// -------------- Method call interceptors
|
|
226
|
+
/**
|
|
227
|
+
* Register a method call interceptor.
|
|
228
|
+
* Interceptors are called sequentially before each UAMethod.execute().
|
|
229
|
+
* If any interceptor returns a non-Good StatusCode, the method call
|
|
230
|
+
* is rejected and subsequent interceptors are skipped.
|
|
231
|
+
*/
|
|
232
|
+
addMethodCallInterceptor(interceptor: MethodCallInterceptor): void;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Remove a previously registered method call interceptor.
|
|
236
|
+
*/
|
|
237
|
+
removeMethodCallInterceptor(interceptor: MethodCallInterceptor): void;
|
|
211
238
|
}
|
|
@@ -64,13 +64,43 @@ export interface ContinuationPointData {
|
|
|
64
64
|
dataValues: DataValue[];
|
|
65
65
|
}
|
|
66
66
|
export interface ISessionContext {
|
|
67
|
-
session
|
|
67
|
+
/** The underlying OPC UA session, if available. */
|
|
68
|
+
readonly session?: ISessionBase;
|
|
69
|
+
|
|
70
|
+
/** Returns the NodeIds of all roles assigned to the current user. */
|
|
68
71
|
getCurrentUserRoles(): NodeId[];
|
|
72
|
+
|
|
73
|
+
/** Check whether the current user has the given permission on a node. */
|
|
69
74
|
checkPermission(node: BaseNode, action: PermissionType): boolean;
|
|
75
|
+
|
|
76
|
+
/** Returns `true` if browsing the given node is restricted for the current user. */
|
|
70
77
|
isBrowseAccessRestricted(node: BaseNode): boolean;
|
|
78
|
+
|
|
79
|
+
/** Returns `true` if the current user has the given role. */
|
|
71
80
|
currentUserHasRole(role: NodeIdLike): boolean;
|
|
81
|
+
|
|
82
|
+
/** Returns `true` if access to the node is restricted by security settings. */
|
|
72
83
|
isAccessRestricted(node: BaseNode): boolean;
|
|
84
|
+
|
|
85
|
+
/** The object on which the current operation is being performed. */
|
|
73
86
|
object?: UAObject | UAObjectType;
|
|
87
|
+
|
|
88
|
+
/** Server timestamp at the time the request was received. */
|
|
74
89
|
currentTime?: PreciseClock;
|
|
75
|
-
|
|
90
|
+
|
|
91
|
+
/** Display name of the authenticated user (e.g. "anonymous"). */
|
|
92
|
+
readonly userIdentity?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The client's application-instance certificate,
|
|
96
|
+
* or `null` if no secure channel is available.
|
|
97
|
+
*/
|
|
98
|
+
readonly clientCertificate: Certificate | null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The application URI extracted from the client
|
|
102
|
+
* certificate's SubjectAltName, or `null` if
|
|
103
|
+
* unavailable.
|
|
104
|
+
*/
|
|
105
|
+
readonly clientApplicationUri: string | null;
|
|
76
106
|
}
|