node-opcua-server 2.98.0 → 2.98.2

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 (92) hide show
  1. package/dist/base_server.d.ts +110 -0
  2. package/dist/base_server.js +491 -0
  3. package/dist/base_server.js.map +1 -0
  4. package/dist/factory.d.ts +12 -0
  5. package/dist/factory.js +24 -0
  6. package/dist/factory.js.map +1 -0
  7. package/dist/filter/check_where_clause_on_address_space.d.ts +3 -0
  8. package/dist/filter/check_where_clause_on_address_space.js +23 -0
  9. package/dist/filter/check_where_clause_on_address_space.js.map +1 -0
  10. package/dist/filter/extract_event_fields.d.ts +10 -0
  11. package/dist/filter/extract_event_fields.js +18 -0
  12. package/dist/filter/extract_event_fields.js.map +1 -0
  13. package/dist/helper.d.ts +10 -0
  14. package/dist/helper.js +76 -0
  15. package/dist/helper.js.map +1 -0
  16. package/dist/history_server_capabilities.d.ts +35 -0
  17. package/dist/history_server_capabilities.js +44 -0
  18. package/dist/history_server_capabilities.js.map +1 -0
  19. package/dist/i_channel_data.d.ts +13 -0
  20. package/dist/i_channel_data.js +3 -0
  21. package/dist/i_channel_data.js.map +1 -0
  22. package/dist/i_register_server_manager.d.ts +16 -0
  23. package/dist/i_register_server_manager.js +3 -0
  24. package/dist/i_register_server_manager.js.map +1 -0
  25. package/dist/i_server_side_publish_engine.d.ts +36 -0
  26. package/dist/i_server_side_publish_engine.js +50 -0
  27. package/dist/i_server_side_publish_engine.js.map +1 -0
  28. package/dist/i_socket_data.d.ts +11 -0
  29. package/dist/i_socket_data.js +3 -0
  30. package/dist/i_socket_data.js.map +1 -0
  31. package/dist/index.d.ts +16 -0
  32. package/dist/index.js +33 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/monitored_item.d.ts +188 -0
  35. package/dist/monitored_item.js +1113 -0
  36. package/dist/monitored_item.js.map +1 -0
  37. package/dist/node_sampler.d.ts +3 -0
  38. package/dist/node_sampler.js +80 -0
  39. package/dist/node_sampler.js.map +1 -0
  40. package/dist/opcua_server.d.ts +747 -0
  41. package/dist/opcua_server.js +2429 -0
  42. package/dist/opcua_server.js.map +1 -0
  43. package/dist/queue.d.ts +11 -0
  44. package/dist/queue.js +72 -0
  45. package/dist/queue.js.map +1 -0
  46. package/dist/register_server_manager.d.ts +96 -0
  47. package/dist/register_server_manager.js +585 -0
  48. package/dist/register_server_manager.js.map +1 -0
  49. package/dist/register_server_manager_hidden.d.ts +17 -0
  50. package/dist/register_server_manager_hidden.js +28 -0
  51. package/dist/register_server_manager_hidden.js.map +1 -0
  52. package/dist/register_server_manager_mdns_only.d.ts +22 -0
  53. package/dist/register_server_manager_mdns_only.js +56 -0
  54. package/dist/register_server_manager_mdns_only.js.map +1 -0
  55. package/dist/sampling_func.d.ts +3 -0
  56. package/dist/sampling_func.js +3 -0
  57. package/dist/sampling_func.js.map +1 -0
  58. package/dist/server_capabilities.d.ts +148 -0
  59. package/dist/server_capabilities.js +102 -0
  60. package/dist/server_capabilities.js.map +1 -0
  61. package/dist/server_end_point.d.ts +185 -0
  62. package/dist/server_end_point.js +841 -0
  63. package/dist/server_end_point.js.map +1 -0
  64. package/dist/server_engine.d.ts +318 -0
  65. package/dist/server_engine.js +1775 -0
  66. package/dist/server_engine.js.map +1 -0
  67. package/dist/server_publish_engine.d.ts +113 -0
  68. package/dist/server_publish_engine.js +542 -0
  69. package/dist/server_publish_engine.js.map +1 -0
  70. package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -0
  71. package/dist/server_publish_engine_for_orphan_subscriptions.js +52 -0
  72. package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -0
  73. package/dist/server_session.d.ts +185 -0
  74. package/dist/server_session.js +758 -0
  75. package/dist/server_session.js.map +1 -0
  76. package/dist/server_subscription.d.ts +421 -0
  77. package/dist/server_subscription.js +1348 -0
  78. package/dist/server_subscription.js.map +1 -0
  79. package/dist/sessions_compatible_for_transfer.d.ts +2 -0
  80. package/dist/sessions_compatible_for_transfer.js +40 -0
  81. package/dist/sessions_compatible_for_transfer.js.map +1 -0
  82. package/dist/user_manager.d.ts +32 -0
  83. package/dist/user_manager.js +99 -0
  84. package/dist/user_manager.js.map +1 -0
  85. package/dist/user_manager_ua.d.ts +3 -0
  86. package/dist/user_manager_ua.js +40 -0
  87. package/dist/user_manager_ua.js.map +1 -0
  88. package/dist/validate_filter.d.ts +5 -0
  89. package/dist/validate_filter.js +82 -0
  90. package/dist/validate_filter.js.map +1 -0
  91. package/package.json +51 -47
  92. package/test_helpers/create_certificates.js +0 -1
@@ -0,0 +1,188 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /**
4
+ * @module node-opcua-server
5
+ */
6
+ import { EventEmitter } from "events";
7
+ import { ISessionContext } from "node-opcua-address-space-base";
8
+ import { BaseNode, SessionContext } from "node-opcua-address-space";
9
+ import { UInt32 } from "node-opcua-basic-types";
10
+ import { NodeClass, QualifiedNameOptions } from "node-opcua-data-model";
11
+ import { AttributeIds } from "node-opcua-data-model";
12
+ import { DataValue } from "node-opcua-data-value";
13
+ import { ExtensionObject } from "node-opcua-extension-object";
14
+ import { NodeId } from "node-opcua-nodeid";
15
+ import { NumericRange } from "node-opcua-numeric-range";
16
+ import { ObjectRegistry } from "node-opcua-object-registry";
17
+ import { TimestampsToReturn } from "node-opcua-service-read";
18
+ import { MonitoredItemModifyResult, MonitoredItemNotification, MonitoringMode, MonitoringParameters } from "node-opcua-service-subscription";
19
+ import { StatusCode } from "node-opcua-status-code";
20
+ import { EventFieldList, MonitoringFilter, ReadValueIdOptions, SubscriptionDiagnosticsDataType } from "node-opcua-types";
21
+ import { SamplingFunc } from "./sampling_func";
22
+ export type QueueItem = MonitoredItemNotification | EventFieldList;
23
+ export interface MonitoredItemOptions extends MonitoringParameters {
24
+ monitoringMode: MonitoringMode;
25
+ /**
26
+ * the monitoredItem Id assigned by the server to this monitoredItem.
27
+ */
28
+ monitoredItemId: number;
29
+ itemToMonitor?: ReadValueIdOptions;
30
+ timestampsToReturn?: TimestampsToReturn;
31
+ filter: ExtensionObject | null;
32
+ /**
33
+ * if discardOldest === true, older items are removed from the queue when queue overflows
34
+ */
35
+ discardOldest: boolean;
36
+ /**
37
+ * the size of the queue.
38
+ */
39
+ queueSize: number;
40
+ /**
41
+ * the monitored item sampling interval ..
42
+ */
43
+ samplingInterval: number;
44
+ /**
45
+ * the client handle
46
+ */
47
+ clientHandle: number;
48
+ }
49
+ export interface BaseNode2 extends EventEmitter {
50
+ nodeId: NodeId;
51
+ browseName: QualifiedNameOptions;
52
+ nodeClass: NodeClass;
53
+ dataType: NodeId;
54
+ addressSpace: any;
55
+ readAttribute(context: SessionContext | null, attributeId: AttributeIds): DataValue;
56
+ }
57
+ type TimerKey = NodeJS.Timer;
58
+ export interface IServerSession2 {
59
+ sessionContext: ISessionContext;
60
+ }
61
+ export interface ISubscription {
62
+ $session?: IServerSession2;
63
+ subscriptionDiagnostics: SubscriptionDiagnosticsDataType;
64
+ getMonitoredItem(monitoredItemId: number): MonitoredItem | null;
65
+ }
66
+ /**
67
+ * a server side monitored item
68
+ *
69
+ * - Once created, the MonitoredItem will raised an "samplingEvent" event every "samplingInterval" millisecond
70
+ * until {{#crossLink "MonitoredItem/terminate:method"}}{{/crossLink}} is called.
71
+ *
72
+ * - It is up to the event receiver to call {{#crossLink "MonitoredItem/recordValue:method"}}{{/crossLink}}.
73
+ *
74
+ */
75
+ export declare class MonitoredItem extends EventEmitter {
76
+ get node(): BaseNode | null;
77
+ set node(someNode: BaseNode | null);
78
+ static registry: ObjectRegistry;
79
+ static minimumSamplingInterval: number;
80
+ static defaultSamplingInterval: number;
81
+ static maximumSamplingInterval: number;
82
+ samplingInterval: number;
83
+ monitoredItemId: number;
84
+ overflow: boolean;
85
+ oldDataValue?: DataValue;
86
+ monitoringMode: MonitoringMode;
87
+ timestampsToReturn: TimestampsToReturn;
88
+ itemToMonitor: any;
89
+ filter: MonitoringFilter | null;
90
+ discardOldest: boolean;
91
+ queueSize: number;
92
+ clientHandle: UInt32;
93
+ $subscription?: ISubscription;
94
+ _samplingId?: TimerKey | string;
95
+ samplingFunc: SamplingFunc | null;
96
+ private _node;
97
+ private queue;
98
+ private _semantic_version;
99
+ private _is_sampling;
100
+ private _on_opcua_event_received_callback;
101
+ private _attribute_changed_callback;
102
+ private _value_changed_callback;
103
+ private _semantic_changed_callback;
104
+ private _on_node_disposed_listener;
105
+ private _linkedItems?;
106
+ private _triggeredNotifications?;
107
+ constructor(options: MonitoredItemOptions);
108
+ setNode(node: BaseNode): void;
109
+ setMonitoringMode(monitoringMode: MonitoringMode): void;
110
+ /**
111
+ * Terminate the MonitoredItem.
112
+ * @method terminate
113
+ *
114
+ * This will stop the internal sampling timer.
115
+ */
116
+ terminate(): void;
117
+ dispose(): void;
118
+ get isSampling(): boolean;
119
+ toString(): string;
120
+ /**
121
+ * @param dataValue the whole dataValue
122
+ * @param skipChangeTest indicates whether recordValue should not check that dataValue is really
123
+ * different from previous one, ( by checking timestamps but also variant value)
124
+ * @private
125
+ *
126
+ * Notes:
127
+ * - recordValue can only be called within timer event
128
+ * - for performance reason, dataValue may be a shared value with the underlying node,
129
+ * therefore recordValue must clone the dataValue to make sure it retains a snapshot
130
+ * of the contain at the time recordValue was called.
131
+ *
132
+ * return true if the value has been recorded, false if not.
133
+ *
134
+ * Value will not be recorded :
135
+ * * if the range do not overlap
136
+ * * is !skipChangeTest and value is equal to previous value
137
+ *
138
+ */
139
+ recordValue(dataValue: DataValue, skipChangeTest: boolean, indexRange?: NumericRange): boolean;
140
+ hasLinkItem(linkedMonitoredItemId: number): boolean;
141
+ addLinkItem(linkedMonitoredItemId: number): StatusCode;
142
+ removeLinkItem(linkedMonitoredItemId: number): StatusCode;
143
+ /**
144
+ * @internals
145
+ */
146
+ private triggerLinkedItems;
147
+ get hasMonitoredItemNotifications(): boolean;
148
+ /**
149
+ * @internals
150
+ */
151
+ private trigger;
152
+ extractMonitoredItemNotifications(bForce?: boolean): QueueItem[];
153
+ modify(timestampsToReturn: TimestampsToReturn, monitoringParameters: MonitoringParameters): MonitoredItemModifyResult;
154
+ resendInitialValues(): Promise<void>;
155
+ private getSessionContext;
156
+ /**
157
+ * @method _on_sampling_timer
158
+ * @private
159
+ */
160
+ private _on_sampling_timer;
161
+ private _stop_sampling;
162
+ private _on_value_changed;
163
+ private _on_semantic_changed;
164
+ private _on_opcua_event;
165
+ private _getSession;
166
+ private _start_sampling;
167
+ private __acquireInitialValue;
168
+ private __start_sampling;
169
+ private _set_parameters;
170
+ private _setOverflowBit;
171
+ private _enqueue_notification;
172
+ private _makeDataChangeNotification;
173
+ /**
174
+ * @method _enqueue_value
175
+ * @param dataValue {DataValue} the dataValue to enqueue
176
+ * @private
177
+ */
178
+ private _enqueue_value;
179
+ private _makeEventFieldList;
180
+ private _enqueue_event;
181
+ private _empty_queue;
182
+ private _clear_timer;
183
+ private _set_timer;
184
+ private _adjust_queue_to_match_new_queue_size;
185
+ private _adjustSampling;
186
+ private _on_node_disposed;
187
+ }
188
+ export {};