node-opcua-address-space-base 2.167.0 → 2.169.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/namespace.d.ts +20 -20
- package/dist/session_context.d.ts +20 -12
- package/dist/session_context.js.map +1 -1
- package/package.json +15 -15
- package/source/namespace.ts +28 -33
- package/source/session_context.ts +23 -14
package/dist/namespace.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { IAddressSpace } from "./address_space";
|
|
8
|
-
import { AddReferenceOpts, BaseNode, ConstructNodeIdOptions } from "./base_node";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import type { UInt32 } from "node-opcua-basic-types";
|
|
2
|
+
import type { AccessRestrictionsFlag, LocalizedTextLike, NodeClass, QualifiedNameLike } from "node-opcua-data-model";
|
|
3
|
+
import type { DataValueOptions } from "node-opcua-data-value";
|
|
4
|
+
import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
+
import type { ArgumentOptions, AxisInformationOptions, AxisScaleEnumeration, EnumFieldOptions, EUInformationOptions, RangeOptions, RolePermissionType, RolePermissionTypeOptions, StructureFieldOptions } from "node-opcua-types";
|
|
6
|
+
import type { VariantLike } from "node-opcua-variant";
|
|
7
|
+
import type { IAddressSpace } from "./address_space";
|
|
8
|
+
import type { AddReferenceOpts, BaseNode, ConstructNodeIdOptions } from "./base_node";
|
|
9
|
+
import type { BindVariableOptions } from "./bind_variable";
|
|
10
|
+
import type { ModellingRuleType } from "./modelling_rule_type";
|
|
11
|
+
import type { UADataType } from "./ua_data_type";
|
|
12
|
+
import type { UAEventType } from "./ua_event_type";
|
|
13
|
+
import type { UAMethod } from "./ua_method";
|
|
14
|
+
import type { UAObject } from "./ua_object";
|
|
15
|
+
import type { UAObjectType } from "./ua_object_type";
|
|
16
|
+
import type { UAReferenceType } from "./ua_reference_type";
|
|
17
|
+
import type { UAVariable } from "./ua_variable";
|
|
18
|
+
import type { UAVariableType } from "./ua_variable_type";
|
|
19
|
+
import type { UAView } from "./ua_view";
|
|
20
20
|
export interface CreateNodeOptions {
|
|
21
21
|
addressSpace?: IAddressSpace;
|
|
22
22
|
browseName: QualifiedNameLike;
|
|
@@ -258,7 +258,7 @@ export declare interface INamespace {
|
|
|
258
258
|
addVariable(options: AddVariableOptions): UAVariable;
|
|
259
259
|
addObject(options: AddObjectOptions): UAObject;
|
|
260
260
|
addView(options: AddViewOptions): UAView;
|
|
261
|
-
addFolder(parentFolder: NodeIdLike | UAObject, options:
|
|
261
|
+
addFolder(parentFolder: NodeIdLike | UAObject, options: AddBaseNodeOptions | string): UAObject;
|
|
262
262
|
createNode(options: CreateNodeOptions): BaseNode;
|
|
263
263
|
/** @private */
|
|
264
264
|
internalCreateNode(options: CreateNodeOptions): BaseNode;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Certificate } from "node-opcua-crypto/web";
|
|
2
|
-
import { DataValue } from "node-opcua-data-value";
|
|
3
|
-
import { PreciseClock } from "node-opcua-date-time";
|
|
4
|
-
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { UAObject } from "./ua_object";
|
|
10
|
-
import { UAObjectType } from "./ua_object_type";
|
|
1
|
+
import type { Certificate } from "node-opcua-crypto/web";
|
|
2
|
+
import type { DataValue } from "node-opcua-data-value";
|
|
3
|
+
import type { PreciseClock } from "node-opcua-date-time";
|
|
4
|
+
import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
+
import type { StatusCode } from "node-opcua-status-code";
|
|
6
|
+
import type { MessageSecurityMode, PermissionType, ReferenceDescription, UserIdentityToken } from "node-opcua-types";
|
|
7
|
+
import type { BaseNode } from "./base_node";
|
|
8
|
+
import type { ContinuationPoint } from "./continuation_point";
|
|
9
|
+
import type { UAObject } from "./ua_object";
|
|
10
|
+
import type { UAObjectType } from "./ua_object_type";
|
|
11
11
|
export declare function getContextMaxMessageSize(context: ISessionContext): number;
|
|
12
12
|
export interface ITransportSettings {
|
|
13
13
|
maxMessageSize: number;
|
|
@@ -46,6 +46,8 @@ export interface ContinuationPointData {
|
|
|
46
46
|
export interface ISessionContext {
|
|
47
47
|
/** The underlying OPC UA session, if available. */
|
|
48
48
|
readonly session?: ISessionBase;
|
|
49
|
+
/** Returns the user name of the current user. */
|
|
50
|
+
getUserName(): string;
|
|
49
51
|
/** Returns the NodeIds of all roles assigned to the current user. */
|
|
50
52
|
getCurrentUserRoles(): NodeId[];
|
|
51
53
|
/** Check whether the current user has the given permission on a node. */
|
|
@@ -60,8 +62,6 @@ export interface ISessionContext {
|
|
|
60
62
|
object?: UAObject | UAObjectType;
|
|
61
63
|
/** Server timestamp at the time the request was received. */
|
|
62
64
|
currentTime?: PreciseClock;
|
|
63
|
-
/** Display name of the authenticated user (e.g. "anonymous"). */
|
|
64
|
-
readonly userIdentity?: string;
|
|
65
65
|
/**
|
|
66
66
|
* The client's application-instance certificate,
|
|
67
67
|
* or `null` if no secure channel is available.
|
|
@@ -73,4 +73,12 @@ export interface ISessionContext {
|
|
|
73
73
|
* unavailable.
|
|
74
74
|
*/
|
|
75
75
|
readonly clientApplicationUri: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Returns a JSON representation of the context
|
|
78
|
+
*/
|
|
79
|
+
toJSON(): Record<string, string | null>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a string representation of the context
|
|
82
|
+
*/
|
|
83
|
+
toString(): string;
|
|
76
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_context.js","sourceRoot":"","sources":["../source/session_context.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"session_context.js","sourceRoot":"","sources":["../source/session_context.ts"],"names":[],"mappings":";;AAWA,4DAIC;AAJD,SAAgB,wBAAwB,CAAC,OAAwB;IAC7D,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB;QAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAC3D,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space-base",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.169.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.169.0",
|
|
22
22
|
"node-opcua-constants": "2.157.0",
|
|
23
|
-
"node-opcua-crypto": "5.3.
|
|
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.
|
|
23
|
+
"node-opcua-crypto": "5.3.5",
|
|
24
|
+
"node-opcua-data-model": "2.169.0",
|
|
25
|
+
"node-opcua-data-value": "2.169.0",
|
|
26
|
+
"node-opcua-date-time": "2.169.0",
|
|
27
|
+
"node-opcua-debug": "2.168.0",
|
|
28
|
+
"node-opcua-extension-object": "2.169.0",
|
|
29
|
+
"node-opcua-nodeid": "2.169.0",
|
|
30
|
+
"node-opcua-numeric-range": "2.169.0",
|
|
31
|
+
"node-opcua-schemas": "2.169.0",
|
|
32
|
+
"node-opcua-status-code": "2.169.0",
|
|
33
|
+
"node-opcua-types": "2.169.0",
|
|
34
|
+
"node-opcua-variant": "2.169.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": "82d570d3e95bea689cbbe30096279885c5282245",
|
|
52
52
|
"files": [
|
|
53
53
|
"dist",
|
|
54
54
|
"source"
|
package/source/namespace.ts
CHANGED
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { UInt32 } from "node-opcua-basic-types";
|
|
2
|
+
import type { AccessRestrictionsFlag, LocalizedTextLike, NodeClass, QualifiedNameLike } from "node-opcua-data-model";
|
|
3
|
+
import type { DataValueOptions } from "node-opcua-data-value";
|
|
4
|
+
import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
+
import type {
|
|
4
6
|
ArgumentOptions,
|
|
5
7
|
AxisInformationOptions,
|
|
6
8
|
AxisScaleEnumeration,
|
|
7
9
|
EnumFieldOptions,
|
|
8
|
-
EUInformation,
|
|
9
10
|
EUInformationOptions,
|
|
10
11
|
RangeOptions,
|
|
11
12
|
RolePermissionType,
|
|
12
13
|
RolePermissionTypeOptions,
|
|
13
14
|
StructureFieldOptions
|
|
14
15
|
} from "node-opcua-types";
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { UAView } from "./ua_view";
|
|
30
|
-
import { UAEventType } from "./ua_event_type";
|
|
31
|
-
import { UAMethod } from "./ua_method";
|
|
32
|
-
|
|
16
|
+
import type { VariantLike } from "node-opcua-variant";
|
|
17
|
+
|
|
18
|
+
import type { IAddressSpace } from "./address_space";
|
|
19
|
+
import type { AddReferenceOpts, BaseNode, ConstructNodeIdOptions } from "./base_node";
|
|
20
|
+
import type { BindVariableOptions } from "./bind_variable";
|
|
21
|
+
import type { ModellingRuleType } from "./modelling_rule_type";
|
|
22
|
+
import type { UADataType } from "./ua_data_type";
|
|
23
|
+
import type { UAEventType } from "./ua_event_type";
|
|
24
|
+
import type { UAMethod } from "./ua_method";
|
|
25
|
+
import type { UAObject } from "./ua_object";
|
|
26
|
+
import type { UAObjectType } from "./ua_object_type";
|
|
27
|
+
import type { UAReferenceType } from "./ua_reference_type";
|
|
28
|
+
import type { UAVariable } from "./ua_variable";
|
|
29
|
+
import type { UAVariableType } from "./ua_variable_type";
|
|
30
|
+
import type { UAView } from "./ua_view";
|
|
33
31
|
|
|
34
32
|
export interface CreateNodeOptions {
|
|
35
|
-
|
|
36
33
|
addressSpace?: IAddressSpace;
|
|
37
|
-
browseName:
|
|
38
|
-
nodeId
|
|
34
|
+
browseName: QualifiedNameLike;
|
|
35
|
+
nodeId?: NodeIdLike | BaseNode | null;
|
|
39
36
|
nodeClass?: NodeClass;
|
|
40
37
|
|
|
41
38
|
displayName?: LocalizedTextLike | LocalizedTextLike[] | null;
|
|
42
|
-
description?: LocalizedTextLike |
|
|
39
|
+
description?: LocalizedTextLike | null;
|
|
43
40
|
|
|
44
41
|
rolePermissions?: RolePermissionTypeOptions[];
|
|
45
42
|
|
|
@@ -51,8 +48,8 @@ export interface CreateNodeOptions {
|
|
|
51
48
|
notifierOf?: NodeIdLike | BaseNode | null;
|
|
52
49
|
organizedBy?: NodeIdLike | BaseNode | null;
|
|
53
50
|
propertyOf?: NodeIdLike | BaseNode | null;
|
|
54
|
-
|
|
55
|
-
subtypeOf?: NodeIdLike | string | BaseNode |null;
|
|
51
|
+
|
|
52
|
+
subtypeOf?: NodeIdLike | string | BaseNode | null;
|
|
56
53
|
|
|
57
54
|
isAbstract?: boolean;
|
|
58
55
|
|
|
@@ -61,8 +58,8 @@ export interface CreateNodeOptions {
|
|
|
61
58
|
modellingRule?: ModellingRuleType;
|
|
62
59
|
eventNotifier?: number;
|
|
63
60
|
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
62
|
postInstantiateFunc?: (instance: BaseNode, tpyeNode: BaseNode, opts?: any) => void;
|
|
65
|
-
|
|
66
63
|
}
|
|
67
64
|
export interface AddBaseNodeOptions {
|
|
68
65
|
browseName: QualifiedNameLike;
|
|
@@ -232,7 +229,7 @@ export interface VariableStuff {
|
|
|
232
229
|
dataValue?: DataValueOptions;
|
|
233
230
|
}
|
|
234
231
|
|
|
235
|
-
export interface AddVariableOptionsWithoutValue extends AddBaseNodeOptions, VariableStuff {}
|
|
232
|
+
export interface AddVariableOptionsWithoutValue extends AddBaseNodeOptions, VariableStuff { }
|
|
236
233
|
export interface AddVariableOptions extends AddVariableOptionsWithoutValue {
|
|
237
234
|
// default value is "BaseVariableType";
|
|
238
235
|
typeDefinition?: string | NodeId | UAVariableType;
|
|
@@ -283,8 +280,6 @@ export interface AddYArrayItemOptions extends AddVariableOptions {
|
|
|
283
280
|
xAxisDefinition?: AxisInformationOptions;
|
|
284
281
|
}
|
|
285
282
|
|
|
286
|
-
|
|
287
|
-
|
|
288
283
|
export interface RequiredModel {
|
|
289
284
|
modelUri: string;
|
|
290
285
|
version: string;
|
|
@@ -339,7 +334,7 @@ export declare interface INamespace {
|
|
|
339
334
|
|
|
340
335
|
addView(options: AddViewOptions): UAView;
|
|
341
336
|
|
|
342
|
-
addFolder(parentFolder: NodeIdLike | UAObject, options:
|
|
337
|
+
addFolder(parentFolder: NodeIdLike | UAObject, options: AddBaseNodeOptions | string): UAObject;
|
|
343
338
|
|
|
344
339
|
createNode(options: CreateNodeOptions): BaseNode;
|
|
345
340
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Certificate } from "node-opcua-crypto/web";
|
|
2
|
-
import { DataValue } from "node-opcua-data-value";
|
|
3
|
-
import { PreciseClock } from "node-opcua-date-time";
|
|
4
|
-
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { ContinuationPoint } from "./continuation_point";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { UAObjectType } from "./ua_object_type";
|
|
1
|
+
import type { Certificate } from "node-opcua-crypto/web";
|
|
2
|
+
import type { DataValue } from "node-opcua-data-value";
|
|
3
|
+
import type { PreciseClock } from "node-opcua-date-time";
|
|
4
|
+
import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
+
import type { StatusCode } from "node-opcua-status-code";
|
|
6
|
+
import type { MessageSecurityMode, PermissionType, ReferenceDescription, UserIdentityToken } from "node-opcua-types";
|
|
7
|
+
import type { BaseNode } from "./base_node";
|
|
8
|
+
import type { ContinuationPoint } from "./continuation_point";
|
|
9
|
+
import type { UAObject } from "./ua_object";
|
|
10
|
+
import type { UAObjectType } from "./ua_object_type";
|
|
12
11
|
|
|
13
12
|
export function getContextMaxMessageSize(context: ISessionContext): number {
|
|
14
13
|
if (!context.session?.channel?.getTransportSettings) return 0;
|
|
@@ -67,6 +66,9 @@ export interface ISessionContext {
|
|
|
67
66
|
/** The underlying OPC UA session, if available. */
|
|
68
67
|
readonly session?: ISessionBase;
|
|
69
68
|
|
|
69
|
+
/** Returns the user name of the current user. */
|
|
70
|
+
getUserName(): string;
|
|
71
|
+
|
|
70
72
|
/** Returns the NodeIds of all roles assigned to the current user. */
|
|
71
73
|
getCurrentUserRoles(): NodeId[];
|
|
72
74
|
|
|
@@ -88,9 +90,6 @@ export interface ISessionContext {
|
|
|
88
90
|
/** Server timestamp at the time the request was received. */
|
|
89
91
|
currentTime?: PreciseClock;
|
|
90
92
|
|
|
91
|
-
/** Display name of the authenticated user (e.g. "anonymous"). */
|
|
92
|
-
readonly userIdentity?: string;
|
|
93
|
-
|
|
94
93
|
/**
|
|
95
94
|
* The client's application-instance certificate,
|
|
96
95
|
* or `null` if no secure channel is available.
|
|
@@ -103,4 +102,14 @@ export interface ISessionContext {
|
|
|
103
102
|
* unavailable.
|
|
104
103
|
*/
|
|
105
104
|
readonly clientApplicationUri: string | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Returns a JSON representation of the context
|
|
108
|
+
*/
|
|
109
|
+
toJSON(): Record<string, string | null>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns a string representation of the context
|
|
113
|
+
*/
|
|
114
|
+
toString(): string;
|
|
106
115
|
}
|