node-opcua-server 2.71.0 → 2.72.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 (65) hide show
  1. package/dist/base_server.d.ts +110 -110
  2. package/dist/base_server.js +473 -473
  3. package/dist/factory.d.ts +12 -12
  4. package/dist/factory.js +23 -23
  5. package/dist/history_server_capabilities.d.ts +35 -35
  6. package/dist/history_server_capabilities.js +43 -43
  7. package/dist/i_channel_data.d.ts +13 -13
  8. package/dist/i_channel_data.js +2 -2
  9. package/dist/i_register_server_manager.d.ts +16 -16
  10. package/dist/i_register_server_manager.js +2 -2
  11. package/dist/i_server_side_publish_engine.d.ts +36 -36
  12. package/dist/i_server_side_publish_engine.js +49 -49
  13. package/dist/i_socket_data.d.ts +11 -11
  14. package/dist/i_socket_data.js +2 -2
  15. package/dist/index.d.ts +15 -15
  16. package/dist/index.js +31 -31
  17. package/dist/monitored_item.d.ts +177 -177
  18. package/dist/monitored_item.js +998 -998
  19. package/dist/node_sampler.d.ts +3 -3
  20. package/dist/node_sampler.js +75 -75
  21. package/dist/opcua_server.d.ts +650 -647
  22. package/dist/opcua_server.js +2392 -2385
  23. package/dist/opcua_server.js.map +1 -1
  24. package/dist/queue.d.ts +11 -11
  25. package/dist/queue.js +71 -71
  26. package/dist/register_server_manager.d.ts +96 -96
  27. package/dist/register_server_manager.js +584 -584
  28. package/dist/register_server_manager_hidden.d.ts +17 -17
  29. package/dist/register_server_manager_hidden.js +27 -27
  30. package/dist/register_server_manager_mdns_only.d.ts +22 -22
  31. package/dist/register_server_manager_mdns_only.js +55 -55
  32. package/dist/server_capabilities.d.ts +148 -61
  33. package/dist/server_capabilities.js +91 -108
  34. package/dist/server_capabilities.js.map +1 -1
  35. package/dist/server_end_point.d.ts +183 -183
  36. package/dist/server_end_point.js +817 -816
  37. package/dist/server_end_point.js.map +1 -1
  38. package/dist/server_engine.d.ts +317 -316
  39. package/dist/server_engine.js +1716 -1688
  40. package/dist/server_engine.js.map +1 -1
  41. package/dist/server_publish_engine.d.ts +112 -112
  42. package/dist/server_publish_engine.js +530 -530
  43. package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -16
  44. package/dist/server_publish_engine_for_orphan_subscriptions.js +49 -49
  45. package/dist/server_session.d.ts +181 -181
  46. package/dist/server_session.js +738 -738
  47. package/dist/server_session.js.map +1 -1
  48. package/dist/server_subscription.d.ts +415 -395
  49. package/dist/server_subscription.js +1334 -1316
  50. package/dist/server_subscription.js.map +1 -1
  51. package/dist/sessions_compatible_for_transfer.d.ts +2 -2
  52. package/dist/sessions_compatible_for_transfer.js +36 -36
  53. package/dist/user_manager.d.ts +32 -32
  54. package/dist/user_manager.js +74 -74
  55. package/dist/user_manager_ua.d.ts +3 -3
  56. package/dist/user_manager_ua.js +39 -39
  57. package/dist/validate_filter.d.ts +5 -5
  58. package/dist/validate_filter.js +60 -60
  59. package/package.json +26 -26
  60. package/source/opcua_server.ts +27 -16
  61. package/source/server_capabilities.ts +178 -91
  62. package/source/server_end_point.ts +9 -8
  63. package/source/server_engine.ts +30 -1
  64. package/source/server_session.ts +1 -0
  65. package/source/server_subscription.ts +46 -5
@@ -1,316 +1,317 @@
1
- /// <reference types="node" />
2
- /**
3
- * @module node-opcua-server
4
- */
5
- import { EventEmitter } from "events";
6
- import { AddressSpace, ISessionContext, ContinuationData } from "node-opcua-address-space";
7
- import { DataValue } from "node-opcua-data-value";
8
- import { ServerDiagnosticsSummaryDataType, ServerState, ServerStatusDataType } from "node-opcua-common";
9
- import { AttributeIds, LocalizedTextLike } from "node-opcua-data-model";
10
- import { NodeId, NodeIdLike } from "node-opcua-nodeid";
11
- import { BrowseResult } from "node-opcua-service-browse";
12
- import { ReadRequest, TimestampsToReturn } from "node-opcua-service-read";
13
- import { CreateSubscriptionRequestLike } from "node-opcua-client";
14
- import { ObjectRegistry } from "node-opcua-object-registry";
15
- import { TransferResult } from "node-opcua-service-subscription";
16
- import { ApplicationDescription } from "node-opcua-service-endpoints";
17
- import { HistoryReadRequest, HistoryReadResult, HistoryReadValueId } from "node-opcua-service-history";
18
- import { StatusCode } from "node-opcua-status-code";
19
- import { BrowseDescription, BrowsePath, BrowsePathResult, BuildInfo, BuildInfoOptions, ReadAtTimeDetails, ReadEventDetails, ReadProcessedDetails, ReadRawModifiedDetails, WriteValue, ReadValueId } from "node-opcua-types";
20
- import { HistoryServerCapabilities, HistoryServerCapabilitiesOptions } from "./history_server_capabilities";
21
- import { ServerCapabilities, ServerCapabilitiesOptions } from "./server_capabilities";
22
- import { ServerSession } from "./server_session";
23
- import { Subscription } from "./server_subscription";
24
- import { OPCUAServerOptions } from "./opcua_server";
25
- export declare type StringGetter = () => string;
26
- export interface ServerEngineOptions {
27
- applicationUri: string | StringGetter;
28
- buildInfo?: BuildInfoOptions;
29
- isAuditing?: boolean;
30
- /**
31
- * set to true to enable serverDiagnostics
32
- */
33
- serverDiagnosticsEnabled?: boolean;
34
- serverCapabilities?: ServerCapabilitiesOptions;
35
- historyServerCapabilities?: HistoryServerCapabilitiesOptions;
36
- }
37
- export interface CreateSessionOption {
38
- clientDescription?: ApplicationDescription;
39
- sessionTimeout?: number;
40
- }
41
- export declare type ClosingReason = "Timeout" | "Terminated" | "CloseSession" | "Forcing";
42
- export declare type ShutdownTask = (this: ServerEngine) => void | Promise<void>;
43
- /**
44
- *
45
- */
46
- export declare class ServerEngine extends EventEmitter {
47
- static readonly registry: ObjectRegistry;
48
- isAuditing: boolean;
49
- serverDiagnosticsSummary: ServerDiagnosticsSummaryDataType;
50
- serverDiagnosticsEnabled: boolean;
51
- serverCapabilities: ServerCapabilities;
52
- historyServerCapabilities: HistoryServerCapabilities;
53
- clientDescription?: ApplicationDescription;
54
- addressSpace: AddressSpace | null;
55
- _internalState: "creating" | "initializing" | "initialized" | "shutdown" | "disposed";
56
- private _sessions;
57
- private _closedSessions;
58
- private _orphanPublishEngine?;
59
- private _shutdownTasks;
60
- private _applicationUri;
61
- private _expectedShutdownTime;
62
- private _serverStatus;
63
- constructor(options: ServerEngineOptions);
64
- isStarted(): boolean;
65
- dispose(): void;
66
- get startTime(): Date;
67
- get currentTime(): Date;
68
- get buildInfo(): BuildInfo;
69
- /**
70
- * register a function that will be called when the server will perform its shut down.
71
- * @method registerShutdownTask
72
- */
73
- registerShutdownTask(task: (this: ServerEngine) => void): void;
74
- /**
75
- * @method shutdown
76
- */
77
- shutdown(): Promise<void>;
78
- /**
79
- * the number of active sessions
80
- */
81
- get currentSessionCount(): number;
82
- /**
83
- * the cumulated number of sessions that have been opened since this object exists
84
- */
85
- get cumulatedSessionCount(): number;
86
- /**
87
- * the number of active subscriptions.
88
- */
89
- get currentSubscriptionCount(): number;
90
- /**
91
- * the cumulated number of subscriptions that have been created since this object exists
92
- */
93
- get cumulatedSubscriptionCount(): number;
94
- get rejectedSessionCount(): number;
95
- get rejectedRequestsCount(): number;
96
- get sessionAbortCount(): number;
97
- get sessionTimeoutCount(): number;
98
- get publishingIntervalCount(): number;
99
- incrementSessionTimeoutCount(): void;
100
- incrementSessionAbortCount(): void;
101
- incrementRejectedRequestsCount(): void;
102
- /**
103
- * increment rejected session count (also increment rejected requests count)
104
- */
105
- incrementRejectedSessionCount(): void;
106
- incrementSecurityRejectedRequestsCount(): void;
107
- /**
108
- * increment rejected session count (also increment rejected requests count)
109
- */
110
- incrementSecurityRejectedSessionCount(): void;
111
- setShutdownTime(date: Date): void;
112
- setShutdownReason(reason: LocalizedTextLike): void;
113
- /**
114
- * @method secondsTillShutdown
115
- * @return the approximate number of seconds until the server will be shut down. The
116
- * value is only relevant once the state changes into SHUTDOWN.
117
- */
118
- secondsTillShutdown(): number;
119
- /**
120
- * the name of the server
121
- */
122
- get serverName(): string;
123
- /**
124
- * the server urn
125
- */
126
- get serverNameUrn(): string;
127
- /**
128
- * the urn of the server namespace
129
- */
130
- get serverNamespaceUrn(): string;
131
- get serverStatus(): ServerStatusDataType;
132
- setServerState(serverState: ServerState): void;
133
- getServerDiagnosticsEnabledFlag(): boolean;
134
- /**
135
- * @method initialize
136
- * @async
137
- *
138
- * @param options {Object}
139
- * @param options.nodeset_filename {String} - [option](default : 'mini.Node.Set2.xml' )
140
- * @param callback
141
- */
142
- initialize(options: OPCUAServerOptions, callback: () => void): void;
143
- /**
144
- *
145
- * @method browseSingleNode
146
- * @param nodeId {NodeId|String} : the nodeid of the element to browse
147
- * @param browseDescription
148
- * @param browseDescription.browseDirection {BrowseDirection} :
149
- * @param browseDescription.referenceTypeId {String|NodeId}
150
- * @param [context]
151
- * @return the browse result
152
- */
153
- browseSingleNode(nodeId: NodeIdLike, browseDescription: BrowseDescription, context?: ISessionContext): BrowseResult;
154
- browseWithAutomaticExpansion(nodesToBrowse: BrowseDescription[], context?: ISessionContext): Promise<BrowseResult[]>;
155
- /**
156
- *
157
- */
158
- browse(nodesToBrowse: BrowseDescription[], context?: ISessionContext): BrowseResult[];
159
- /**
160
- *
161
- * @method readSingleNode
162
- * @param context
163
- * @param nodeId
164
- * @param attributeId
165
- * @param [timestampsToReturn=TimestampsToReturn.Neither]
166
- * @return DataValue
167
- */
168
- readSingleNode(context: ISessionContext, nodeId: NodeId | string, attributeId: AttributeIds, timestampsToReturn?: TimestampsToReturn): DataValue;
169
- /**
170
- *
171
- *
172
- * Maximum age of the value to be read in milliseconds. The age of the value is based on the difference between
173
- * the ServerTimestamp and the time when the Server starts processing the request. For example if the Client
174
- * specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing
175
- * the request, the age of the returned value could be 600 milliseconds prior to the time it was requested.
176
- * If the Server has one or more values of an Attribute that are within the maximum age, it can return any one
177
- * of the values or it can read a new value from the data source. The number of values of an Attribute that
178
- * a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case,
179
- * the Client can make no assumption about which copy of the data will be returned.
180
- * If the Server does not have a value that is within the maximum age, it shall attempt to read a new value
181
- * from the data source.
182
- * If the Server cannot meet the requested maxAge, it returns its 'best effort' value rather than rejecting the
183
- * request.
184
- * This may occur when the time it takes the Server to process and return the new data value after it has been
185
- * accessed is greater than the specified maximum age.
186
- * If maxAge is set to 0, the Server shall attempt to read a new value from the data source.
187
- * If maxAge is set to the max Int32 value or greater, the Server shall attempt to get a cached value.
188
- * Negative values are invalid for maxAge.
189
- *
190
- * @return an array of DataValue
191
- */
192
- read(context: ISessionContext, readRequest: ReadRequest): DataValue[];
193
- /**
194
- *
195
- * @method writeSingleNode
196
- * @param context
197
- * @param writeValue
198
- * @param callback
199
- * @param callback.err
200
- * @param callback.statusCode
201
- * @async
202
- */
203
- writeSingleNode(context: ISessionContext, writeValue: WriteValue, callback: (err: Error | null, statusCode?: StatusCode) => void): void;
204
- /**
205
- * write a collection of nodes
206
- * @method write
207
- * @param context
208
- * @param nodesToWrite
209
- * @param callback
210
- * @param callback.err
211
- * @param callback.results
212
- * @async
213
- */
214
- write(context: ISessionContext, nodesToWrite: WriteValue[], callback: (err: Error | null, statusCodes?: StatusCode[]) => void): void;
215
- /**
216
- *
217
- */
218
- historyReadSingleNode(context: ISessionContext, nodeId: NodeId, attributeId: AttributeIds, historyReadDetails: ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, timestampsToReturn: TimestampsToReturn, continuationData: ContinuationData, callback: (err: Error | null, results?: HistoryReadResult) => void): void;
219
- /**
220
- *
221
- * @method historyRead
222
- * @param context {SessionContext}
223
- * @param historyReadRequest {HistoryReadRequest}
224
- * @param historyReadRequest.requestHeader {RequestHeader}
225
- * @param historyReadRequest.historyReadDetails {HistoryReadDetails}
226
- * @param historyReadRequest.timestampsToReturn {TimestampsToReturn}
227
- * @param historyReadRequest.releaseContinuationPoints {Boolean}
228
- * @param historyReadRequest.nodesToRead {HistoryReadValueId[]}
229
- * @param callback
230
- * @param callback.err
231
- * @param callback.results {HistoryReadResult[]}
232
- */
233
- historyRead(context: ISessionContext, historyReadRequest: HistoryReadRequest, callback: (err: Error | null, results: HistoryReadResult[]) => void): void;
234
- getOldestUnactivatedSession(): ServerSession | null;
235
- /**
236
- * create a new server session object.
237
- * @class ServerEngine
238
- * @method createSession
239
- * @param [options] {Object}
240
- * @param [options.sessionTimeout = 1000] {Number} sessionTimeout
241
- * @param [options.clientDescription] {ApplicationDescription}
242
- * @return {ServerSession}
243
- */
244
- createSession(options: CreateSessionOption): ServerSession;
245
- /**
246
- * @method closeSession
247
- * @param authenticationToken
248
- * @param deleteSubscriptions {Boolean} : true if session's subscription shall be deleted
249
- * @param {String} [reason = "CloseSession"] the reason for closing the session (
250
- * shall be "Timeout", "Terminated" or "CloseSession")
251
- *
252
- *
253
- * what the specs say:
254
- * -------------------
255
- *
256
- * If a Client invokes the CloseSession Service then all Subscriptions associated with the Session are also deleted
257
- * if the deleteSubscriptions flag is set to TRUE. If a Server terminates a Session for any other reason,
258
- * Subscriptions associated with the Session, are not deleted. Each Subscription has its own lifetime to protect
259
- * against data loss in the case of a Session termination. In these cases, the Subscription can be reassigned to
260
- * another Client before its lifetime expires.
261
- */
262
- closeSession(authenticationToken: NodeId, deleteSubscriptions: boolean, reason: ClosingReason): void;
263
- findSubscription(subscriptionId: number): Subscription | null;
264
- findOrphanSubscription(subscriptionId: number): Subscription | null;
265
- deleteOrphanSubscription(subscription: Subscription): StatusCode;
266
- /**
267
- * @method transferSubscription
268
- * @param session {ServerSession} - the new session that will own the subscription
269
- * @param subscriptionId {IntegerId} - the subscription Id to transfer
270
- * @param sendInitialValues {Boolean} - true if initial values will be resent.
271
- * @return {TransferResult}
272
- */
273
- transferSubscription(session: ServerSession, subscriptionId: number, sendInitialValues: boolean): Promise<TransferResult>;
274
- /**
275
- * retrieve a session by its authenticationToken.
276
- *
277
- * @method getSession
278
- * @param authenticationToken
279
- * @param activeOnly
280
- * @return {ServerSession}
281
- */
282
- getSession(authenticationToken: NodeId, activeOnly?: boolean): ServerSession | null;
283
- /**
284
- */
285
- browsePath(browsePath: BrowsePath): BrowsePathResult;
286
- /**
287
- *
288
- * performs a call to ```asyncRefresh``` on all variable nodes that provide an async refresh func.
289
- *
290
- * @method refreshValues
291
- * @param nodesToRefresh {Array<Object>} an array containing the node to consider
292
- * Each element of the array shall be of the form { nodeId: <xxx>, attributeIds: <value> }.
293
- * @param callback
294
- * @param callback.err
295
- * @param callback.data an array containing value read
296
- * The array length matches the number of nodeIds that are candidate for an async refresh (i.e: nodes that
297
- * are of type Variable with asyncRefresh func }
298
- *
299
- * @async
300
- */
301
- refreshValues(nodesToRefresh: ReadValueId[] | HistoryReadValueId[], maxAge: number, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
302
- private _exposeSubscriptionDiagnostics;
303
- protected _unexposeSubscriptionDiagnostics(subscription: Subscription): void;
304
- /**
305
- * create a new subscription
306
- * @return {Subscription}
307
- */
308
- _createSubscriptionOnSession(session: ServerSession, request: CreateSubscriptionRequestLike): Subscription;
309
- private __findNode;
310
- private _readSingleNode;
311
- private _historyReadSingleNode;
312
- /**
313
- */
314
- private __internal_bindMethod;
315
- private _getServerSubscriptionDiagnosticsArrayNode;
316
- }
1
+ /// <reference types="node" />
2
+ /**
3
+ * @module node-opcua-server
4
+ */
5
+ import { EventEmitter } from "events";
6
+ import { AddressSpace, ISessionContext, ContinuationData } from "node-opcua-address-space";
7
+ import { DataValue } from "node-opcua-data-value";
8
+ import { ServerDiagnosticsSummaryDataType, ServerState, ServerStatusDataType } from "node-opcua-common";
9
+ import { AttributeIds, LocalizedTextLike } from "node-opcua-data-model";
10
+ import { NodeId, NodeIdLike } from "node-opcua-nodeid";
11
+ import { BrowseResult } from "node-opcua-service-browse";
12
+ import { ReadRequest, TimestampsToReturn } from "node-opcua-service-read";
13
+ import { CreateSubscriptionRequestLike } from "node-opcua-client";
14
+ import { ObjectRegistry } from "node-opcua-object-registry";
15
+ import { TransferResult } from "node-opcua-service-subscription";
16
+ import { ApplicationDescription } from "node-opcua-service-endpoints";
17
+ import { HistoryReadRequest, HistoryReadResult, HistoryReadValueId } from "node-opcua-service-history";
18
+ import { StatusCode } from "node-opcua-status-code";
19
+ import { BrowseDescription, BrowsePath, BrowsePathResult, BuildInfo, BuildInfoOptions, ReadAtTimeDetails, ReadEventDetails, ReadProcessedDetails, ReadRawModifiedDetails, WriteValue, ReadValueId } from "node-opcua-types";
20
+ import { HistoryServerCapabilities, HistoryServerCapabilitiesOptions } from "./history_server_capabilities";
21
+ import { ServerCapabilities, ServerCapabilitiesOptions } from "./server_capabilities";
22
+ import { ServerSession } from "./server_session";
23
+ import { Subscription } from "./server_subscription";
24
+ import { OPCUAServerOptions } from "./opcua_server";
25
+ export declare type StringGetter = () => string;
26
+ export interface ServerEngineOptions {
27
+ applicationUri: string | StringGetter;
28
+ buildInfo?: BuildInfoOptions;
29
+ isAuditing?: boolean;
30
+ /**
31
+ * set to true to enable serverDiagnostics
32
+ */
33
+ serverDiagnosticsEnabled?: boolean;
34
+ serverCapabilities?: ServerCapabilitiesOptions;
35
+ historyServerCapabilities?: HistoryServerCapabilitiesOptions;
36
+ }
37
+ export interface CreateSessionOption {
38
+ clientDescription?: ApplicationDescription;
39
+ sessionTimeout?: number;
40
+ }
41
+ export declare type ClosingReason = "Timeout" | "Terminated" | "CloseSession" | "Forcing";
42
+ export declare type ShutdownTask = (this: ServerEngine) => void | Promise<void>;
43
+ /**
44
+ *
45
+ */
46
+ export declare class ServerEngine extends EventEmitter {
47
+ static readonly registry: ObjectRegistry;
48
+ isAuditing: boolean;
49
+ serverDiagnosticsSummary: ServerDiagnosticsSummaryDataType;
50
+ serverDiagnosticsEnabled: boolean;
51
+ serverCapabilities: ServerCapabilities;
52
+ historyServerCapabilities: HistoryServerCapabilities;
53
+ clientDescription?: ApplicationDescription;
54
+ addressSpace: AddressSpace | null;
55
+ _internalState: "creating" | "initializing" | "initialized" | "shutdown" | "disposed";
56
+ private _sessions;
57
+ private _closedSessions;
58
+ private _orphanPublishEngine?;
59
+ private _shutdownTasks;
60
+ private _applicationUri;
61
+ private _expectedShutdownTime;
62
+ private _serverStatus;
63
+ private _globalCounter;
64
+ constructor(options: ServerEngineOptions);
65
+ isStarted(): boolean;
66
+ dispose(): void;
67
+ get startTime(): Date;
68
+ get currentTime(): Date;
69
+ get buildInfo(): BuildInfo;
70
+ /**
71
+ * register a function that will be called when the server will perform its shut down.
72
+ * @method registerShutdownTask
73
+ */
74
+ registerShutdownTask(task: (this: ServerEngine) => void): void;
75
+ /**
76
+ * @method shutdown
77
+ */
78
+ shutdown(): Promise<void>;
79
+ /**
80
+ * the number of active sessions
81
+ */
82
+ get currentSessionCount(): number;
83
+ /**
84
+ * the cumulated number of sessions that have been opened since this object exists
85
+ */
86
+ get cumulatedSessionCount(): number;
87
+ /**
88
+ * the number of active subscriptions.
89
+ */
90
+ get currentSubscriptionCount(): number;
91
+ /**
92
+ * the cumulated number of subscriptions that have been created since this object exists
93
+ */
94
+ get cumulatedSubscriptionCount(): number;
95
+ get rejectedSessionCount(): number;
96
+ get rejectedRequestsCount(): number;
97
+ get sessionAbortCount(): number;
98
+ get sessionTimeoutCount(): number;
99
+ get publishingIntervalCount(): number;
100
+ incrementSessionTimeoutCount(): void;
101
+ incrementSessionAbortCount(): void;
102
+ incrementRejectedRequestsCount(): void;
103
+ /**
104
+ * increment rejected session count (also increment rejected requests count)
105
+ */
106
+ incrementRejectedSessionCount(): void;
107
+ incrementSecurityRejectedRequestsCount(): void;
108
+ /**
109
+ * increment rejected session count (also increment rejected requests count)
110
+ */
111
+ incrementSecurityRejectedSessionCount(): void;
112
+ setShutdownTime(date: Date): void;
113
+ setShutdownReason(reason: LocalizedTextLike): void;
114
+ /**
115
+ * @method secondsTillShutdown
116
+ * @return the approximate number of seconds until the server will be shut down. The
117
+ * value is only relevant once the state changes into SHUTDOWN.
118
+ */
119
+ secondsTillShutdown(): number;
120
+ /**
121
+ * the name of the server
122
+ */
123
+ get serverName(): string;
124
+ /**
125
+ * the server urn
126
+ */
127
+ get serverNameUrn(): string;
128
+ /**
129
+ * the urn of the server namespace
130
+ */
131
+ get serverNamespaceUrn(): string;
132
+ get serverStatus(): ServerStatusDataType;
133
+ setServerState(serverState: ServerState): void;
134
+ getServerDiagnosticsEnabledFlag(): boolean;
135
+ /**
136
+ * @method initialize
137
+ * @async
138
+ *
139
+ * @param options {Object}
140
+ * @param options.nodeset_filename {String} - [option](default : 'mini.Node.Set2.xml' )
141
+ * @param callback
142
+ */
143
+ initialize(options: OPCUAServerOptions, callback: () => void): void;
144
+ /**
145
+ *
146
+ * @method browseSingleNode
147
+ * @param nodeId {NodeId|String} : the nodeid of the element to browse
148
+ * @param browseDescription
149
+ * @param browseDescription.browseDirection {BrowseDirection} :
150
+ * @param browseDescription.referenceTypeId {String|NodeId}
151
+ * @param [context]
152
+ * @return the browse result
153
+ */
154
+ browseSingleNode(nodeId: NodeIdLike, browseDescription: BrowseDescription, context?: ISessionContext): BrowseResult;
155
+ browseWithAutomaticExpansion(nodesToBrowse: BrowseDescription[], context?: ISessionContext): Promise<BrowseResult[]>;
156
+ /**
157
+ *
158
+ */
159
+ browse(nodesToBrowse: BrowseDescription[], context?: ISessionContext): BrowseResult[];
160
+ /**
161
+ *
162
+ * @method readSingleNode
163
+ * @param context
164
+ * @param nodeId
165
+ * @param attributeId
166
+ * @param [timestampsToReturn=TimestampsToReturn.Neither]
167
+ * @return DataValue
168
+ */
169
+ readSingleNode(context: ISessionContext, nodeId: NodeId | string, attributeId: AttributeIds, timestampsToReturn?: TimestampsToReturn): DataValue;
170
+ /**
171
+ *
172
+ *
173
+ * Maximum age of the value to be read in milliseconds. The age of the value is based on the difference between
174
+ * the ServerTimestamp and the time when the Server starts processing the request. For example if the Client
175
+ * specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing
176
+ * the request, the age of the returned value could be 600 milliseconds prior to the time it was requested.
177
+ * If the Server has one or more values of an Attribute that are within the maximum age, it can return any one
178
+ * of the values or it can read a new value from the data source. The number of values of an Attribute that
179
+ * a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case,
180
+ * the Client can make no assumption about which copy of the data will be returned.
181
+ * If the Server does not have a value that is within the maximum age, it shall attempt to read a new value
182
+ * from the data source.
183
+ * If the Server cannot meet the requested maxAge, it returns its 'best effort' value rather than rejecting the
184
+ * request.
185
+ * This may occur when the time it takes the Server to process and return the new data value after it has been
186
+ * accessed is greater than the specified maximum age.
187
+ * If maxAge is set to 0, the Server shall attempt to read a new value from the data source.
188
+ * If maxAge is set to the max Int32 value or greater, the Server shall attempt to get a cached value.
189
+ * Negative values are invalid for maxAge.
190
+ *
191
+ * @return an array of DataValue
192
+ */
193
+ read(context: ISessionContext, readRequest: ReadRequest): DataValue[];
194
+ /**
195
+ *
196
+ * @method writeSingleNode
197
+ * @param context
198
+ * @param writeValue
199
+ * @param callback
200
+ * @param callback.err
201
+ * @param callback.statusCode
202
+ * @async
203
+ */
204
+ writeSingleNode(context: ISessionContext, writeValue: WriteValue, callback: (err: Error | null, statusCode?: StatusCode) => void): void;
205
+ /**
206
+ * write a collection of nodes
207
+ * @method write
208
+ * @param context
209
+ * @param nodesToWrite
210
+ * @param callback
211
+ * @param callback.err
212
+ * @param callback.results
213
+ * @async
214
+ */
215
+ write(context: ISessionContext, nodesToWrite: WriteValue[], callback: (err: Error | null, statusCodes?: StatusCode[]) => void): void;
216
+ /**
217
+ *
218
+ */
219
+ historyReadSingleNode(context: ISessionContext, nodeId: NodeId, attributeId: AttributeIds, historyReadDetails: ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, timestampsToReturn: TimestampsToReturn, continuationData: ContinuationData, callback: (err: Error | null, results?: HistoryReadResult) => void): void;
220
+ /**
221
+ *
222
+ * @method historyRead
223
+ * @param context {SessionContext}
224
+ * @param historyReadRequest {HistoryReadRequest}
225
+ * @param historyReadRequest.requestHeader {RequestHeader}
226
+ * @param historyReadRequest.historyReadDetails {HistoryReadDetails}
227
+ * @param historyReadRequest.timestampsToReturn {TimestampsToReturn}
228
+ * @param historyReadRequest.releaseContinuationPoints {Boolean}
229
+ * @param historyReadRequest.nodesToRead {HistoryReadValueId[]}
230
+ * @param callback
231
+ * @param callback.err
232
+ * @param callback.results {HistoryReadResult[]}
233
+ */
234
+ historyRead(context: ISessionContext, historyReadRequest: HistoryReadRequest, callback: (err: Error | null, results: HistoryReadResult[]) => void): void;
235
+ getOldestUnactivatedSession(): ServerSession | null;
236
+ /**
237
+ * create a new server session object.
238
+ * @class ServerEngine
239
+ * @method createSession
240
+ * @param [options] {Object}
241
+ * @param [options.sessionTimeout = 1000] {Number} sessionTimeout
242
+ * @param [options.clientDescription] {ApplicationDescription}
243
+ * @return {ServerSession}
244
+ */
245
+ createSession(options: CreateSessionOption): ServerSession;
246
+ /**
247
+ * @method closeSession
248
+ * @param authenticationToken
249
+ * @param deleteSubscriptions {Boolean} : true if session's subscription shall be deleted
250
+ * @param {String} [reason = "CloseSession"] the reason for closing the session (
251
+ * shall be "Timeout", "Terminated" or "CloseSession")
252
+ *
253
+ *
254
+ * what the specs say:
255
+ * -------------------
256
+ *
257
+ * If a Client invokes the CloseSession Service then all Subscriptions associated with the Session are also deleted
258
+ * if the deleteSubscriptions flag is set to TRUE. If a Server terminates a Session for any other reason,
259
+ * Subscriptions associated with the Session, are not deleted. Each Subscription has its own lifetime to protect
260
+ * against data loss in the case of a Session termination. In these cases, the Subscription can be reassigned to
261
+ * another Client before its lifetime expires.
262
+ */
263
+ closeSession(authenticationToken: NodeId, deleteSubscriptions: boolean, reason: ClosingReason): void;
264
+ findSubscription(subscriptionId: number): Subscription | null;
265
+ findOrphanSubscription(subscriptionId: number): Subscription | null;
266
+ deleteOrphanSubscription(subscription: Subscription): StatusCode;
267
+ /**
268
+ * @method transferSubscription
269
+ * @param session {ServerSession} - the new session that will own the subscription
270
+ * @param subscriptionId {IntegerId} - the subscription Id to transfer
271
+ * @param sendInitialValues {Boolean} - true if initial values will be resent.
272
+ * @return {TransferResult}
273
+ */
274
+ transferSubscription(session: ServerSession, subscriptionId: number, sendInitialValues: boolean): Promise<TransferResult>;
275
+ /**
276
+ * retrieve a session by its authenticationToken.
277
+ *
278
+ * @method getSession
279
+ * @param authenticationToken
280
+ * @param activeOnly
281
+ * @return {ServerSession}
282
+ */
283
+ getSession(authenticationToken: NodeId, activeOnly?: boolean): ServerSession | null;
284
+ /**
285
+ */
286
+ browsePath(browsePath: BrowsePath): BrowsePathResult;
287
+ /**
288
+ *
289
+ * performs a call to ```asyncRefresh``` on all variable nodes that provide an async refresh func.
290
+ *
291
+ * @method refreshValues
292
+ * @param nodesToRefresh {Array<Object>} an array containing the node to consider
293
+ * Each element of the array shall be of the form { nodeId: <xxx>, attributeIds: <value> }.
294
+ * @param callback
295
+ * @param callback.err
296
+ * @param callback.data an array containing value read
297
+ * The array length matches the number of nodeIds that are candidate for an async refresh (i.e: nodes that
298
+ * are of type Variable with asyncRefresh func }
299
+ *
300
+ * @async
301
+ */
302
+ refreshValues(nodesToRefresh: ReadValueId[] | HistoryReadValueId[], maxAge: number, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
303
+ private _exposeSubscriptionDiagnostics;
304
+ protected _unexposeSubscriptionDiagnostics(subscription: Subscription): void;
305
+ /**
306
+ * create a new subscription
307
+ * @return {Subscription}
308
+ */
309
+ _createSubscriptionOnSession(session: ServerSession, request: CreateSubscriptionRequestLike): Subscription;
310
+ private __findNode;
311
+ private _readSingleNode;
312
+ private _historyReadSingleNode;
313
+ /**
314
+ */
315
+ private __internal_bindMethod;
316
+ private _getServerSubscriptionDiagnosticsArrayNode;
317
+ }