Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// to do when spec is clear about what goes here!
// spec 1.04 says (in Part 4 7.33 SignedSoftwareCertificate
// Note: Details on SoftwareCertificates need to be defined in a future version.
this.serverCapabilities.softwareCertificates = [
// new SignedSoftwareCertificate({})
];
// make sure minSupportedSampleRate matches MonitoredItem.minimumSamplingInterval
(this.serverCapabilities as any).__defineGetter__("minSupportedSampleRate", () => {
return MonitoredItem.minimumSamplingInterval;
});
this.historyServerCapabilities = new HistoryServerCapabilities(options.historyServerCapabilities);
// --------------------------------------------------- serverDiagnosticsSummary extension Object
this.serverDiagnosticsSummary = new ServerDiagnosticsSummaryDataType();
assert(this.serverDiagnosticsSummary.hasOwnProperty("currentSessionCount"));
// note spelling is different for serverDiagnosticsSummary.currentSubscriptionCount
// and sessionDiagnostics.currentSubscriptionsCount ( with an s)
assert(this.serverDiagnosticsSummary.hasOwnProperty("currentSubscriptionCount"));
(this.serverDiagnosticsSummary as any).__defineGetter__("currentSubscriptionCount", () => {
// currentSubscriptionCount returns the total number of subscriptions
// that are currently active on all sessions
let counter = 0;
_.values(this._sessions).forEach((session: ServerSession) => {
counter += session.currentSubscriptionCount;
});
return counter;
});