onvif-rx
Version:
Interact with ONVIF cameras and devices using RXJS
8,111 lines • 458 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var typescriptMonads = require('typescript-monads');
var rxjs = require('rxjs');
var operators = require('rxjs/operators');
var xmlJs = require('xml-js');
var xmldom = require('xmldom');
var crypto$1 = require('crypto');
var rxHttpRequest = require('@akanass/rx-http-request');
var buffer = require('buffer');
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
var onvifDigest = function (dateIsoString) {
return typescriptMonads.reader(function (config) { return config.user
.map(function (user) {
var nonce = config.system.nonce();
return config.system.digestSha1(nonce + dateIsoString + user.password).then(function (hash) {
var digest64 = config.system.buffer.from(hash, 'hex').toString('base64');
var nonceBase64 = config.system.buffer.from(nonce).toString('base64');
return {
dateIsoString: dateIsoString,
nonceBase64: nonceBase64,
digest64: digest64,
username: user.username
};
});
}); });
};
var TOKENS = {
s: 'wsse:Security',
unt: 'wsse:UsernameToken',
un: 'wsse:Username',
pw: 'wsse:Password',
nc: 'wsse:Nonce',
cr: 'wsu:Created',
};
var createUserToken = function (timeDifference) {
if (timeDifference === void 0) { timeDifference = 0; }
return onvifDigest((new Date(Date.now() + timeDifference)).toISOString())
.map(function (obj) { return obj.map(function (prom) { return prom.then(function (securityInfo) {
return "<" + TOKENS.s + " S11:mustUnderstand=\"1\">\n <" + TOKENS.unt + ">\n <" + TOKENS.un + ">" + securityInfo.username + "</" + TOKENS.un + ">\n <" + TOKENS.pw + " Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">" + securityInfo.digest64 + "</" + TOKENS.pw + ">\n <" + TOKENS.nc + " EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">" + securityInfo.nonceBase64 + "</" + TOKENS.nc + ">\n <" + TOKENS.cr + ">" + securityInfo.dateIsoString + "</" + TOKENS.cr + ">\n </" + TOKENS.unt + ">\n </" + TOKENS.s + ">";
}); }); });
};
var XMLNS;
(function (XMLNS) {
XMLNS["S11"] = "xmlns:S11=\"http://www.w3.org/2003/05/soap-envelope\"";
XMLNS["wsse"] = "xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"";
XMLNS["wsu"] = "xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"";
XMLNS["tt"] = "xmlns:tt=\"http://www.onvif.org/ver10/schema\"";
XMLNS["tds"] = "xmlns:tds=\"http://www.onvif.org/ver10/device/wsdl\"";
XMLNS["trt"] = "xmlns:trt=\"http://www.onvif.org/ver10/media/wsdl\"";
XMLNS["xsi"] = "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
XMLNS["xsd"] = "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"";
XMLNS["ns1"] = "xmlns:ns1=\"http://www.onvif.org/ver10/accesscontrol/wsdl\"";
XMLNS["ns3"] = "xmlns:ns3=\"http://www.onvif.org/ver10/actionengine/wsdl\"";
XMLNS["tad"] = "xmlns:tad=\"http://www.onvif.org/ver10/analyticsdevice/wsdl\"";
XMLNS["timg"] = "xmlns:timg=\"http://www.onvif.org/ver20/imaging/wsdl\"";
XMLNS["tptz"] = "xmlns:tptz=\"http://www.onvif.org/ver20/ptz/wsdl\"";
XMLNS["trc"] = "xmlns:trc=\"http://www.onvif.org/ver10/recording/wsdl\"";
XMLNS["trv"] = "xmlns:trv=\"http://www.onvif.org/ver10/receiver/wsdl\"";
XMLNS["tse"] = "xmlns:tse=\"http://www.onvif.org/ver10/search/wsdl\"";
XMLNS["vifsvr"] = "xmlns:vifsvr=\"http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding\"";
XMLNS["vifsvr10"] = "xmlns:vifsvr10=\"http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding\"";
XMLNS["vifsvr2"] = "xmlns:vifsvr2=\"http://www.onvif.org/ver10/events/wsdl/EventBinding\"";
XMLNS["tev"] = "xmlns:tev=\"http://www.onvif.org/ver10/events/wsdl\"";
XMLNS["vifsvr3"] = "xmlns:vifsvr3=\"http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding\"";
XMLNS["vifsvr4"] = "xmlns:vifsvr4=\"http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding\"";
XMLNS["vifsvr5"] = "xmlns:vifsvr5=\"http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding\"";
XMLNS["vifsvr6"] = "xmlns:vifsvr6=\"http://www.onvif.org/ver10/events/wsdl/PullPointBinding\"";
XMLNS["vifsvr7"] = "xmlns:vifsvr7=\"http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding\"";
XMLNS["vifsvr8"] = "xmlns:vifsvr8=\"http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding\"";
XMLNS["wsnt"] = "xmlns:wsnt=\"http://docs.oasis-open.org/wsn/b-2\"";
XMLNS["vifsvr9"] = "xmlns:vifsvr9=\"http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding\"";
XMLNS["tan"] = "xmlns:tan=\"http://www.onvif.org/ver20/analytics/wsdl\"";
XMLNS["ter"] = "xmlns:ter=\"http://www.onvif.org/ver10/error\"";
XMLNS["tns1"] = "xmlns:tns1=\"http://www.onvif.org/ver10/topics\"";
XMLNS["ns2"] = "xmlns:ns2=\"http://www.onvif.org/ver10/pacs\"";
XMLNS["wsa5"] = "xmlns:wsa5=\"http://www.w3.org/2005/08/addressing\"";
})(XMLNS || (XMLNS = {}));
var parseXml = function (parser) {
return function (xmlString) {
return parser.parseFromString(xmlString, 'text/xml');
};
};
var nsstr = function () { return Object.keys(XMLNS).map(function (k) { return XMLNS[k]; }); };
var SOAP_NODE;
(function (SOAP_NODE) {
SOAP_NODE["Header"] = "S11:Header";
SOAP_NODE["Envelope"] = "S11:Envelope";
SOAP_NODE["Body"] = "S11:Body";
})(SOAP_NODE || (SOAP_NODE = {}));
var soapShell = function (rawBody) {
return function (rawHeader) {
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <" + SOAP_NODE.Envelope + " " + nsstr().join(' ') + ">\n <" + SOAP_NODE.Header + ">" + (rawHeader || '') + "</" + SOAP_NODE.Header + ">\n <" + SOAP_NODE.Body + ">" + rawBody + "</" + SOAP_NODE.Body + ">\n </" + SOAP_NODE.Envelope + ">";
};
};
var stringIsBool = function (str) { return str.toLowerCase() === 'true' || str.toLowerCase() === 'false'; };
var stringToBool = function (str) { return str.toLowerCase() === 'true' ? true : false; };
var typeConversion = function (str) { return stringIsBool(str) ? stringToBool(str) : str; };
var mapResponseXmlToJson = function (node) {
return function (source) {
return source.pipe(operators.map(function (a) { return a.map(function (b) {
var split = node.split(':');
var nodeKey = typescriptMonads.maybe(split[1]).valueOr(node);
var soapNsPrefix = b.xmlDocument.documentElement.lookupPrefix(b.xmlDocument.documentElement.namespaceURI);
var parsed = JSON.parse(xmlJs.xml2json(b.xmlString, {
compact: true,
spaces: 2,
textFn: function (value, parentElement) {
try {
var keyNo = Object.keys(parentElement._parent).length;
var keyName = Object.keys(parentElement._parent)[keyNo - 1];
// tslint:disable-next-line:no-object-mutation
parentElement._parent[keyName] = typeConversion(value);
}
catch (e) { }
},
elementNameFn: function (d) { return typescriptMonads.maybe(d.split(':')[1]).valueOr(d); }
}));
var json = parsed['Envelope']
? parsed['Envelope']['Body'][nodeKey]
: parsed[soapNsPrefix + ":Envelope"][soapNsPrefix + ":Body"][nodeKey];
return {
json: json,
xml: b.xmlString
};
}); }));
};
};
var generateRequestElements = function (reqNode) { return function (params) {
var _a;
var cleanedParams = Object
.keys(params)
.reduce(function (acc, curr) {
var _a;
return params[curr] === undefined ? acc : __assign(__assign({}, acc), (_a = {}, _a[curr] = params[curr], _a));
}, {});
return xmlJs.js2xml((_a = {}, _a[reqNode.replace(':', '_')] = cleanedParams, _a), {
compact: true,
elementNameFn: function (value) { return value.indexOf('_') > 0 ? value.replace('_', ':') : 'tt:' + value; }
});
}; };
var createStandardRequestBody = function (body) {
return typescriptMonads.reader(function (config) {
var gen = function (body) { return config.system.transport(body)(config.deviceUrl)
.pipe(operators.map(function (response) {
var xmlDocument = parseXml(config.system.parser)(response.body);
var tmp = (XMLNS.S11.split('=').pop() || '').replace(/"/g, '');
var subcode = typescriptMonads.maybe(xmlDocument.getElementsByTagNameNS(tmp, 'Subcode').item(0)).flatMapAuto(function (a) { return a.textContent; });
var reason = typescriptMonads.maybe(xmlDocument.getElementsByTagNameNS(tmp, 'Reason').item(0)).flatMapAuto(function (a) { return a.textContent; });
return response.status === 200 && !reason.valueOrUndefined()
? typescriptMonads.ok({ xmlString: response.body, xmlDocument: xmlDocument })
: typescriptMonads.fail(__assign(__assign({}, response), { statusMessage: (reason.valueOrUndefined() || subcode.valueOr(JSON.stringify(response.statusMessage))).trim() }));
})); };
return createUserToken().map(function (maybeUserToken) {
return maybeUserToken.map(function (tokenPromise) {
return rxjs.from(tokenPromise).pipe(operators.flatMap(function (token) { return gen(body.replace("<" + SOAP_NODE.Header + "></" + SOAP_NODE.Header + ">", "<" + SOAP_NODE.Header + ">" + token + "</" + SOAP_NODE.Header + ">")); }));
}).valueOr(gen(body));
}).run(config);
});
};
var createStandardRequestBodyFromString = function (body) {
return createStandardRequestBody(soapShell(body)());
};
var ONVIFEvent = /** @class */ (function () {
function ONVIFEvent(config) {
this.config = config;
}
/**
* Returns the capabilities of the event service. The result is returned in a typed answer.
*/
ONVIFEvent.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tev:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tev:GetServiceCapabilitiesResponse'));
};
/**
* This method returns a PullPointSubscription that can be polled using PullMessages.
* This message contains the same elements as the SubscriptionRequest of the WS-BaseNotification without the ConsumerReference.
* If no Filter is specified the pullpoint notifies all occurring events to the client.
* This method is mandatory.
*/
ONVIFEvent.CreatePullPointSubscription = function (Filter, InitialTerminationTime, SubscriptionPolicy) {
return createStandardRequestBodyFromString(generateRequestElements('tev:CreatePullPointSubscription')({ tev_Filter: Filter, tev_InitialTerminationTime: InitialTerminationTime, tev_SubscriptionPolicy: SubscriptionPolicy }))
.map(mapResponseXmlToJson('tev:CreatePullPointSubscriptionResponse'));
};
/**
* The WS-BaseNotification specification defines a set of OPTIONAL WS-ResouceProperties.
* This specification does not require the implementation of the WS-ResourceProperty interface.
* Instead, the subsequent direct interface shall be implemented by an ONVIF compliant device
* in order to provide information about the FilterDialects, Schema files and topics supported by
* the device.
*/
ONVIFEvent.GetEventProperties = function () {
return createStandardRequestBodyFromString(generateRequestElements('tev:GetEventProperties')({}))
.map(mapResponseXmlToJson('tev:GetEventPropertiesResponse'));
};
/**
* The AddEventBroker command allows an ONVIF client to add an event broker configuration to device to enable ONVIF events to be transferred to an event broker. If an existing event broker configuration already exists with the same Address, the existing configuration shall be modified.
*/
ONVIFEvent.AddEventBroker = function (EventBroker) {
return createStandardRequestBodyFromString(generateRequestElements('tev:AddEventBroker')({ tev_EventBroker: EventBroker }))
.map(mapResponseXmlToJson('tev:AddEventBrokerResponse'));
};
/**
* The DeleteEventBroker allows an ONVIF client to delete an event broker configuration from an ONVIF device.
*/
ONVIFEvent.DeleteEventBroker = function (Address) {
return createStandardRequestBodyFromString(generateRequestElements('tev:DeleteEventBroker')({ tev_Address: Address }))
.map(mapResponseXmlToJson('tev:DeleteEventBrokerResponse'));
};
/**
* The GetEventBrokers command lets a client retrieve event broker configurations from the device.
*/
ONVIFEvent.GetEventBrokers = function (Address) {
return createStandardRequestBodyFromString(generateRequestElements('tev:GetEventBrokers')({ tev_Address: Address }))
.map(mapResponseXmlToJson('tev:GetEventBrokersResponse'));
};
/**
*
* This method pulls one or more messages from a PullPoint.
* The device shall provide the following PullMessages command for all SubscriptionManager
* endpoints returned by the CreatePullPointSubscription command. This method shall not wait until
* the requested number of messages is available but return as soon as at least one message is available.
* The command shall at least support a Timeout of one minute. In case a device supports retrieval of less messages
* than requested it shall return these without generating a fault.
*/
ONVIFEvent.PullMessages = function (Timeout, MessageLimit) {
return createStandardRequestBodyFromString(generateRequestElements('tev:PullMessages')({ tev_Timeout: Timeout, tev_MessageLimit: MessageLimit }))
.map(mapResponseXmlToJson('tev:PullMessagesResponse'));
};
/**
*
* This method readjusts the pull pointer into the past.
* A device supporting persistent notification storage shall provide the
* following Seek command for all SubscriptionManager endpoints returned by
* the CreatePullPointSubscription command. The optional Reverse argument can
* be used to reverse the pull direction of the PullMessages command.
* The UtcTime argument will be matched against the UtcTime attribute on a
* NotificationMessage.
*
*/
ONVIFEvent.Seek = function (UtcTime, Reverse) {
return createStandardRequestBodyFromString(generateRequestElements('tev:Seek')({ tev_UtcTime: UtcTime, tev_Reverse: Reverse }))
.map(mapResponseXmlToJson('tev:SeekResponse'));
};
/**
* Properties inform a client about property creation, changes and
* deletion in a uniform way. When a client wants to synchronize its properties with the
* properties of the device, it can request a synchronization point which repeats the current
* status of all properties to which a client has subscribed. The PropertyOperation of all
* produced notifications is set to “Initialized”. The Synchronization Point is
* requested directly from the SubscriptionManager which was returned in either the
* SubscriptionResponse or in the CreatePullPointSubscriptionResponse. The property update is
* transmitted via the notification transportation of the notification interface. This method is mandatory.
*
*/
ONVIFEvent.SetSynchronizationPoint = function () {
return createStandardRequestBodyFromString(generateRequestElements('tev:SetSynchronizationPoint')({}))
.map(mapResponseXmlToJson('tev:SetSynchronizationPointResponse'));
};
/**
* The device shall provide the following Unsubscribe command for all SubscriptionManager endpoints returned by the CreatePullPointSubscription command.
* This command shall terminate the lifetime of a pull point.
*
*/
ONVIFEvent.Unsubscribe = function () {
return createStandardRequestBodyFromString(generateRequestElements('')({}))
.map(mapResponseXmlToJson('wsntw:UnsubscribeResponse'));
};
/**
* Returns the capabilities of the event service. The result is returned in a typed answer.
*/
ONVIFEvent.prototype.GetServiceCapabilities = function () {
return ONVIFEvent.GetServiceCapabilities().run(this.config);
};
/**
* This method returns a PullPointSubscription that can be polled using PullMessages.
* This message contains the same elements as the SubscriptionRequest of the WS-BaseNotification without the ConsumerReference.
* If no Filter is specified the pullpoint notifies all occurring events to the client.
* This method is mandatory.
*/
ONVIFEvent.prototype.CreatePullPointSubscription = function (Filter, InitialTerminationTime, SubscriptionPolicy) {
return ONVIFEvent.CreatePullPointSubscription(Filter, InitialTerminationTime, SubscriptionPolicy).run(this.config);
};
/**
* The WS-BaseNotification specification defines a set of OPTIONAL WS-ResouceProperties.
* This specification does not require the implementation of the WS-ResourceProperty interface.
* Instead, the subsequent direct interface shall be implemented by an ONVIF compliant device
* in order to provide information about the FilterDialects, Schema files and topics supported by
* the device.
*/
ONVIFEvent.prototype.GetEventProperties = function () {
return ONVIFEvent.GetEventProperties().run(this.config);
};
/**
* The AddEventBroker command allows an ONVIF client to add an event broker configuration to device to enable ONVIF events to be transferred to an event broker. If an existing event broker configuration already exists with the same Address, the existing configuration shall be modified.
*/
ONVIFEvent.prototype.AddEventBroker = function (EventBroker) {
return ONVIFEvent.AddEventBroker(EventBroker).run(this.config);
};
/**
* The DeleteEventBroker allows an ONVIF client to delete an event broker configuration from an ONVIF device.
*/
ONVIFEvent.prototype.DeleteEventBroker = function (Address) {
return ONVIFEvent.DeleteEventBroker(Address).run(this.config);
};
/**
* The GetEventBrokers command lets a client retrieve event broker configurations from the device.
*/
ONVIFEvent.prototype.GetEventBrokers = function (Address) {
return ONVIFEvent.GetEventBrokers(Address).run(this.config);
};
/**
*
* This method pulls one or more messages from a PullPoint.
* The device shall provide the following PullMessages command for all SubscriptionManager
* endpoints returned by the CreatePullPointSubscription command. This method shall not wait until
* the requested number of messages is available but return as soon as at least one message is available.
* The command shall at least support a Timeout of one minute. In case a device supports retrieval of less messages
* than requested it shall return these without generating a fault.
*/
ONVIFEvent.prototype.PullMessages = function (Timeout, MessageLimit) {
return ONVIFEvent.PullMessages(Timeout, MessageLimit).run(this.config);
};
/**
*
* This method readjusts the pull pointer into the past.
* A device supporting persistent notification storage shall provide the
* following Seek command for all SubscriptionManager endpoints returned by
* the CreatePullPointSubscription command. The optional Reverse argument can
* be used to reverse the pull direction of the PullMessages command.
* The UtcTime argument will be matched against the UtcTime attribute on a
* NotificationMessage.
*
*/
ONVIFEvent.prototype.Seek = function (UtcTime, Reverse) {
return ONVIFEvent.Seek(UtcTime, Reverse).run(this.config);
};
/**
* Properties inform a client about property creation, changes and
* deletion in a uniform way. When a client wants to synchronize its properties with the
* properties of the device, it can request a synchronization point which repeats the current
* status of all properties to which a client has subscribed. The PropertyOperation of all
* produced notifications is set to “Initialized”. The Synchronization Point is
* requested directly from the SubscriptionManager which was returned in either the
* SubscriptionResponse or in the CreatePullPointSubscriptionResponse. The property update is
* transmitted via the notification transportation of the notification interface. This method is mandatory.
*
*/
ONVIFEvent.prototype.SetSynchronizationPoint = function () {
return ONVIFEvent.SetSynchronizationPoint().run(this.config);
};
/**
* The device shall provide the following Unsubscribe command for all SubscriptionManager endpoints returned by the CreatePullPointSubscription command.
* This command shall terminate the lifetime of a pull point.
*
*/
ONVIFEvent.prototype.Unsubscribe = function () {
return ONVIFEvent.Unsubscribe().run(this.config);
};
return ONVIFEvent;
}());
var ONVIFDevice = /** @class */ (function () {
function ONVIFDevice(config) {
this.config = config;
}
/**
* Returns information about services on the device.
*/
ONVIFDevice.GetServices = function (IncludeCapability) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetServices')({ tds_IncludeCapability: IncludeCapability }))
.map(mapResponseXmlToJson('tds:GetServicesResponse'));
};
/**
* Returns the capabilities of the device service. The result is returned in a typed answer.
*/
ONVIFDevice.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tds:GetServiceCapabilitiesResponse'));
};
/**
* This operation gets basic device information from the device.
*/
ONVIFDevice.GetDeviceInformation = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDeviceInformation')({}))
.map(mapResponseXmlToJson('tds:GetDeviceInformationResponse'));
};
/**
* This operation sets the device system date and time. The device shall support the
* configuration of the daylight saving setting and of the manual system date and time (if
* applicable) or indication of NTP time (if applicable) through the SetSystemDateAndTime
* command.
* If system time and date are set manually, the client shall include UTCDateTime in the request.
* A TimeZone token which is not formed according to the rules of IEEE 1003.1 section 8.3 is considered as invalid timezone.
* The DayLightSavings flag should be set to true to activate any DST settings of the TimeZone string.
* Clear the DayLightSavings flag if the DST portion of the TimeZone settings should be ignored.
*
*/
ONVIFDevice.SetSystemDateAndTime = function (DateTimeType, DaylightSavings, TimeZone, UTCDateTime) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetSystemDateAndTime')({ tds_DateTimeType: DateTimeType, tds_DaylightSavings: DaylightSavings, tds_TimeZone: TimeZone, tds_UTCDateTime: UTCDateTime }))
.map(mapResponseXmlToJson('tds:SetSystemDateAndTimeResponse'));
};
/**
* This operation gets the device system date and time. The device shall support the return of
* the daylight saving setting and of the manual system date and time (if applicable) or indication
* of NTP time (if applicable) through the GetSystemDateAndTime command.
* A device shall provide the UTCDateTime information.
*/
ONVIFDevice.GetSystemDateAndTime = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetSystemDateAndTime')({}))
.map(mapResponseXmlToJson('tds:GetSystemDateAndTimeResponse'));
};
/**
* This operation reloads the parameters on the device to their factory default values.
*/
ONVIFDevice.SetSystemFactoryDefault = function (FactoryDefault) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetSystemFactoryDefault')({ tds_FactoryDefault: FactoryDefault }))
.map(mapResponseXmlToJson('tds:SetSystemFactoryDefaultResponse'));
};
/**
* This operation upgrades a device firmware version. After a successful upgrade the response
* message is sent before the device reboots. The device should support firmware upgrade
* through the UpgradeSystemFirmware command. The exact format of the firmware data is
* outside the scope of this standard.
*/
ONVIFDevice.UpgradeSystemFirmware = function (Firmware) {
return createStandardRequestBodyFromString(generateRequestElements('tds:UpgradeSystemFirmware')({ tds_Firmware: Firmware }))
.map(mapResponseXmlToJson('tds:UpgradeSystemFirmwareResponse'));
};
/**
* This operation reboots the device.
*/
ONVIFDevice.SystemReboot = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:SystemReboot')({}))
.map(mapResponseXmlToJson('tds:SystemRebootResponse'));
};
/**
* This operation restores the system backup configuration files(s) previously retrieved from a
* device. The device should support restore of backup configuration file(s) through the
* RestoreSystem command. The exact format of the backup configuration file(s) is outside the
* scope of this standard. If the command is supported, it shall accept backup files returned by
* the GetSystemBackup command.
*/
ONVIFDevice.RestoreSystem = function (BackupFiles) {
return createStandardRequestBodyFromString(generateRequestElements('tds:RestoreSystem')({ tds_BackupFiles: BackupFiles }))
.map(mapResponseXmlToJson('tds:RestoreSystemResponse'));
};
/**
* This operation is retrieves system backup configuration file(s) from a device. The device
* should support return of back up configuration file(s) through the GetSystemBackup command.
* The backup is returned with reference to a name and mime-type together with binary data.
* The exact format of the backup configuration files is outside the scope of this standard.
*/
ONVIFDevice.GetSystemBackup = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetSystemBackup')({}))
.map(mapResponseXmlToJson('tds:GetSystemBackupResponse'));
};
/**
* This operation gets a system log from the device. The exact format of the system logs is outside the scope of this standard.
*/
ONVIFDevice.GetSystemLog = function (LogType) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetSystemLog')({ tds_LogType: LogType }))
.map(mapResponseXmlToJson('tds:GetSystemLogResponse'));
};
/**
* This operation gets arbitary device diagnostics information from the device.
*/
ONVIFDevice.GetSystemSupportInformation = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetSystemSupportInformation')({}))
.map(mapResponseXmlToJson('tds:GetSystemSupportInformationResponse'));
};
/**
* This operation requests the scope parameters of a device. The scope parameters are used in
* the device discovery to match a probe message, see Section 7. The Scope parameters are of
* two different types:
* Fixed
* Configurable
*
* Fixed scope parameters are permanent device characteristics and cannot be removed through the device management interface.
* The scope type is indicated in the scope list returned in the get scope parameters response. A device shall support
* retrieval of discovery scope parameters through the GetScopes command. As some scope parameters are mandatory,
* the device shall return a non-empty scope list in the response.
*/
ONVIFDevice.GetScopes = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetScopes')({}))
.map(mapResponseXmlToJson('tds:GetScopesResponse'));
};
/**
* This operation sets the scope parameters of a device. The scope parameters are used in the
* device discovery to match a probe message.
* This operation replaces all existing configurable scope parameters (not fixed parameters). If
* this shall be avoided, one should use the scope add command instead. The device shall
* support configuration of discovery scope parameters through the SetScopes command.
*/
ONVIFDevice.SetScopes = function (Scopes) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetScopes')({ tds_Scopes: Scopes }))
.map(mapResponseXmlToJson('tds:SetScopesResponse'));
};
/**
* This operation adds new configurable scope parameters to a device. The scope parameters
* are used in the device discovery to match a probe message. The device shall
* support addition of discovery scope parameters through the AddScopes command.
*/
ONVIFDevice.AddScopes = function (ScopeItem) {
return createStandardRequestBodyFromString(generateRequestElements('tds:AddScopes')({ tds_ScopeItem: ScopeItem }))
.map(mapResponseXmlToJson('tds:AddScopesResponse'));
};
/**
* This operation deletes scope-configurable scope parameters from a device. The scope
* parameters are used in the device discovery to match a probe message, see Section 7. The
* device shall support deletion of discovery scope parameters through the RemoveScopes
* command.
* Table
*/
ONVIFDevice.RemoveScopes = function (ScopeItem) {
return createStandardRequestBodyFromString(generateRequestElements('tds:RemoveScopes')({ tds_ScopeItem: ScopeItem }))
.map(mapResponseXmlToJson('tds:RemoveScopesResponse'));
};
/**
* This operation gets the discovery mode of a device. See Section 7.2 for the definition of the
* different device discovery modes. The device shall support retrieval of the discovery mode
* setting through the GetDiscoveryMode command.
*/
ONVIFDevice.GetDiscoveryMode = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDiscoveryMode')({}))
.map(mapResponseXmlToJson('tds:GetDiscoveryModeResponse'));
};
/**
* This operation sets the discovery mode operation of a device. See Section 7.2 for the
* definition of the different device discovery modes. The device shall support configuration of
* the discovery mode setting through the SetDiscoveryMode command.
*/
ONVIFDevice.SetDiscoveryMode = function (DiscoveryMode) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetDiscoveryMode')({ tds_DiscoveryMode: DiscoveryMode }))
.map(mapResponseXmlToJson('tds:SetDiscoveryModeResponse'));
};
/**
* This operation gets the remote discovery mode of a device. See Section 7.4 for the definition
* of remote discovery extensions. A device that supports remote discovery shall support
* retrieval of the remote discovery mode setting through the GetRemoteDiscoveryMode
* command.
*/
ONVIFDevice.GetRemoteDiscoveryMode = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetRemoteDiscoveryMode')({}))
.map(mapResponseXmlToJson('tds:GetRemoteDiscoveryModeResponse'));
};
/**
* This operation sets the remote discovery mode of operation of a device. See Section 7.4 for
* the definition of remote discovery remote extensions. A device that supports remote discovery
* shall support configuration of the discovery mode setting through the
* SetRemoteDiscoveryMode command.
*/
ONVIFDevice.SetRemoteDiscoveryMode = function (RemoteDiscoveryMode) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetRemoteDiscoveryMode')({ tds_RemoteDiscoveryMode: RemoteDiscoveryMode }))
.map(mapResponseXmlToJson('tds:SetRemoteDiscoveryModeResponse'));
};
/**
* This operation gets the remote DP address or addresses from a device. If the device supports
* remote discovery, as specified in Section 7.4, the device shall support retrieval of the remote
* DP address(es) through the GetDPAddresses command.
*/
ONVIFDevice.GetDPAddresses = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDPAddresses')({}))
.map(mapResponseXmlToJson('tds:GetDPAddressesResponse'));
};
/**
* This operation sets the remote DP address or addresses on a device. If the device supports
* remote discovery, as specified in Section 7.4, the device shall support configuration of the
* remote DP address(es) through the SetDPAddresses command.
*/
ONVIFDevice.SetDPAddresses = function (DPAddress) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetDPAddresses')({ tds_DPAddress: DPAddress }))
.map(mapResponseXmlToJson('tds:SetDPAddressesResponse'));
};
/**
* A client can ask for the device service endpoint reference address property that can be used
* to derive the password equivalent for remote user operation. The device shall support the
* GetEndpointReference command returning the address property of the device service
* endpoint reference.
*/
ONVIFDevice.GetEndpointReference = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetEndpointReference')({}))
.map(mapResponseXmlToJson('tds:GetEndpointReferenceResponse'));
};
/**
* This operation returns the configured remote user (if any). A device supporting remote user
* handling shall support this operation. The user is only valid for the WS-UserToken profile or
* as a HTTP / RTSP user.
* The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
*/
ONVIFDevice.GetRemoteUser = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetRemoteUser')({}))
.map(mapResponseXmlToJson('tds:GetRemoteUserResponse'));
};
/**
* This operation sets the remote user. A device supporting remote user handling shall support this
* operation. The user is only valid for the WS-UserToken profile or as a HTTP / RTSP user.
* The password that is set shall always be the original (not derived) password.
* If UseDerivedPassword is set password derivation shall be done by the device when connecting to a
* remote device.The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
* To remove the remote user SetRemoteUser should be called without the RemoteUser parameter.
*/
ONVIFDevice.SetRemoteUser = function (RemoteUser) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetRemoteUser')({ tds_RemoteUser: RemoteUser }))
.map(mapResponseXmlToJson('tds:SetRemoteUserResponse'));
};
/**
* This operation lists the registered users and corresponding credentials on a device. The
* device shall support retrieval of registered device users and their credentials for the user
* token through the GetUsers command.
*/
ONVIFDevice.GetUsers = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetUsers')({}))
.map(mapResponseXmlToJson('tds:GetUsersResponse'));
};
/**
* This operation creates new device users and corresponding credentials on a device for authentication purposes.
* The device shall support creation of device users and their credentials through the CreateUsers
* command. Either all users are created successfully or a fault message shall be returned
* without creating any user.
* ONVIF compliant devices are recommended to support password length of at least 28 bytes,
* as clients may follow the password derivation mechanism which results in 'password
* equivalent' of length 28 bytes, as described in section 3.1.2 of the ONVIF security white paper.
*/
ONVIFDevice.CreateUsers = function (User) {
return createStandardRequestBodyFromString(generateRequestElements('tds:CreateUsers')({ tds_User: User }))
.map(mapResponseXmlToJson('tds:CreateUsersResponse'));
};
/**
* This operation deletes users on a device. The device shall support deletion of device users and their credentials
* through the DeleteUsers command. A device may have one or more fixed users
* that cannot be deleted to ensure access to the unit. Either all users are deleted successfully or a
* fault message shall be returned and no users be deleted.
*/
ONVIFDevice.DeleteUsers = function (Username) {
return createStandardRequestBodyFromString(generateRequestElements('tds:DeleteUsers')({ tds_Username: Username }))
.map(mapResponseXmlToJson('tds:DeleteUsersResponse'));
};
/**
* This operation updates the settings for one or several users on a device for authentication purposes.
* The device shall support update of device users and their credentials through the SetUser command.
* Either all change requests are processed successfully or a fault message shall be returned and no change requests be processed.
*/
ONVIFDevice.SetUser = function (User) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetUser')({ tds_User: User }))
.map(mapResponseXmlToJson('tds:SetUserResponse'));
};
/**
* This method allows to provide a URL where product specific WSDL and schema definitions can be retrieved. This method is deprecated.
*/
ONVIFDevice.GetWsdlUrl = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetWsdlUrl')({}))
.map(mapResponseXmlToJson('tds:GetWsdlUrlResponse'));
};
/**
* This method has been replaced by the more generic GetServices method.
* For capabilities of individual services refer to the GetServiceCapabilities methods.
*/
ONVIFDevice.GetCapabilities = function (Category) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetCapabilities')({ tds_Category: Category }))
.map(mapResponseXmlToJson('tds:GetCapabilitiesResponse'));
};
/**
* This operation is used by an endpoint to get the hostname from a device. The device shall
* return its hostname configurations through the GetHostname command.
*/
ONVIFDevice.GetHostname = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetHostname')({}))
.map(mapResponseXmlToJson('tds:GetHostnameResponse'));
};
/**
* This operation sets the hostname on a device. It shall be possible to set the device hostname
* configurations through the SetHostname command.
* A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
* other string shall be considered as invalid strings.
*
*/
ONVIFDevice.SetHostname = function (Name) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetHostname')({ tds_Name: Name }))
.map(mapResponseXmlToJson('tds:SetHostnameResponse'));
};
/**
* This operation controls whether the hostname is set manually or retrieved via DHCP.
*/
ONVIFDevice.SetHostnameFromDHCP = function (FromDHCP) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetHostnameFromDHCP')({ tds_FromDHCP: FromDHCP }))
.map(mapResponseXmlToJson('tds:SetHostnameFromDHCPResponse'));
};
/**
* This operation gets the DNS settings from a device. The device shall return its DNS
* configurations through the GetDNS command.
*/
ONVIFDevice.GetDNS = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDNS')({}))
.map(mapResponseXmlToJson('tds:GetDNSResponse'));
};
/**
* This operation sets the DNS settings on a device. It shall be possible to set the device DNS
* configurations through the SetDNS command.
*/
ONVIFDevice.SetDNS = function (FromDHCP, SearchDomain, DNSManual) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetDNS')({ tds_FromDHCP: FromDHCP, tds_SearchDomain: SearchDomain, tds_DNSManual: DNSManual }))
.map(mapResponseXmlToJson('tds:SetDNSResponse'));
};
/**
* This operation gets the NTP settings from a device. If the device supports NTP, it shall be
* possible to get the NTP server settings through the GetNTP command.
*/
ONVIFDevice.GetNTP = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetNTP')({}))
.map(mapResponseXmlToJson('tds:GetNTPResponse'));
};
/**
* This operation sets the NTP settings on a device. If the device supports NTP, it shall be
* possible to set the NTP server settings through the SetNTP command.
* A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
* other string shall be considered as invalid strings.
* Changes to the NTP server list will not affect the clock mode DateTimeType. Use SetSystemDateAndTime to activate NTP operation.
*
*/
ONVIFDevice.SetNTP = function (FromDHCP, NTPManual) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetNTP')({ tds_FromDHCP: FromDHCP, tds_NTPManual: NTPManual }))
.map(mapResponseXmlToJson('tds:SetNTPResponse'));
};
/**
* This operation gets the dynamic DNS settings from a device. If the device supports dynamic
* DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to get the type, name
* and TTL through the GetDynamicDNS command.
*/
ONVIFDevice.GetDynamicDNS = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDynamicDNS')({}))
.map(mapResponseXmlToJson('tds:GetDynamicDNSResponse'));
};
/**
* This operation sets the dynamic DNS settings on a device. If the device supports dynamic
* DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to set the type, name
* and TTL through the SetDynamicDNS command.
*/
ONVIFDevice.SetDynamicDNS = function (Type, Name, TTL) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetDynamicDNS')({ tds_Type: Type, tds_Name: Name, tds_TTL: TTL }))
.map(mapResponseXmlToJson('tds:SetDynamicDNSResponse'));
};
/**
* This operation gets the network interface configuration from a device. The device shall
* support return of network interface configuration settings as defined by the NetworkInterface
* type through the GetNetworkInterfaces command.
*/
ONVIFDevice.GetNetworkInterfaces = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetNetworkInterfaces')({}))
.map(mapResponseXmlToJson('tds:GetNetworkInterfacesResponse'));
};
/**
* This operation sets the network interface configuration on a device. The device shall support
* network configuration of supported network interfaces through the SetNetworkInterfaces
* command.
* For interoperability with a client unaware of the IEEE 802.11 extension a device shall retain
* its IEEE 802.11 configuration if the IEEE 802.11 configuration element isn’t present in the
* request.
*/
ONVIFDevice.SetNetworkInterfaces = function (InterfaceToken, NetworkInterface) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetNetworkInterfaces')({ tds_InterfaceToken: InterfaceToken, tds_NetworkInterface: NetworkInterface }))
.map(mapResponseXmlToJson('tds:SetNetworkInterfacesResponse'));
};
/**
* This operation gets defined network protocols from a device. The device shall support the
* GetNetworkProtocols command returning configured network protocols.
*/
ONVIFDevice.GetNetworkProtocols = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetNetworkProtocols')({}))
.map(mapResponseXmlToJson('tds:GetNetworkProtocolsResponse'));
};
/**
* This operation configures defined network protocols on a device. The device shall support
* configuration of defined network protocols through the SetNetworkProtocols command.
*/
ONVIFDevice.SetNetworkProtocols = function (NetworkProtocols) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetNetworkProtocols')({ tds_NetworkProtocols: NetworkProtocols }))
.map(mapResponseXmlToJson('tds:SetNetworkProtocolsResponse'));
};
/**
* This operation gets the default gateway settings from a device. The device shall support the
* GetNetworkDefaultGateway command returning configured default gateway address(es).
*/
ONVIFDevice.GetNetworkDefaultGateway = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetNetworkDefaultGateway')({}))
.map(mapResponseXmlToJson('tds:GetNetworkDefaultGatewayResponse'));
};
/**
* This operation sets the default gateway settings on a device. The device shall support
* configuration of default gateway through the SetNetworkDefaultGateway command.
*/
ONVIFDevice.SetNetworkDefaultGateway = function (IPv4Address, IPv6Address) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetNetworkDefaultGateway')({ tds_IPv4Address: IPv4Address, tds_IPv6Address: IPv6Address }))
.map(mapResponseXmlToJson('tds:SetNetworkDefaultGatewayResponse'));
};
/**
* This operation gets the zero-configuration from a device. If the device supports dynamic IP
* configuration according to [RFC3927], it shall support the return of IPv4 zero configuration
* address and status through the GetZeroConfiguration command.
* Devices supporting zero configuration on more than one interface shall use the extension to list the additional interface settings.
*/
ONVIFDevice.GetZeroConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetZeroConfiguration')({}))
.map(mapResponseXmlToJson('tds:GetZeroConfigurationResponse'));
};
/**
* This operation sets the zero-configuration. Use GetCapalities to get if zero-zero-configuration is supported or not.
*/
ONVIFDevice.SetZeroConfiguration = function (InterfaceToken, Enabled) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetZeroConfiguration')({ tds_InterfaceToken: InterfaceToken, tds_Enabled: Enabled }))
.map(mapResponseXmlToJson('tds:SetZeroConfigurationResponse'));
};
/**
* This operation gets the IP address filter settings from a device. If the device supports device
* access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
* device shall support the GetIPAddressFilter command.
*/
ONVIFDevice.GetIPAddressFilter = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetIPAddressFilter')({}))
.map(mapResponseXmlToJson('tds:GetIPAddressFilterResponse'));
};
/**
* This operation sets the IP address filter settings on a device. If the device supports device
* access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
* device shall support configuration of IP filtering rules through the SetIPAddressFilter
* command.
*/
ONVIFDevice.SetIPAddressFilter = function (IPAddressFilter) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetIPAddressFilter')({ tds_IPAddressFilter: IPAddressFilter }))
.map(mapResponseXmlToJson('tds:SetIPAddressFilterResponse'));
};
/**
* This operation adds an IP filter address to a device. If the device supports device access
* control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
* shall support adding of IP filtering addresses through the AddIPAddressFilter command.
*/
ONVIFDevice.AddIPAddressFilter = function (IPAddressFilter) {
return createStandardRequestBodyFromString(generateRequestElements('tds:AddIPAddressFilter')({ tds_IPAddressFilter: IPAddressFilter }))
.map(mapResponseXmlToJson('tds:AddIPAddressFilterResponse'));
};
/**
* This operation deletes an IP filter address from a device. If the device supports device access
* control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
* shall support deletion of IP filtering addresses through the RemoveIPAddressFilter command.
*/
ONVIFDevice.RemoveIPAddressFilter = function (IPAddressFilter) {
return createStandardRequestBodyFromString(generateRequestElements('tds:RemoveIPAddressFilter')({ tds_IPAddressFilter: IPAddressFilter }))
.map(mapResponseXmlToJson('tds:RemoveIPAddressFilterResponse'));
};
/**
* Access to different services and sub-sets of services should be subject to access control. The
* WS-Security framework gives the prerequisite for end-point authentication. Authorization
* decisions can then be taken using an access security policy. This standard does not mandate
* any particular policy description format or security policy but this is up to the device
* manufacturer or system provider to choose policy and policy description format of choice.
* However, an access policy (in arbitrary format) can be requested using this command. If the
* device supports access policy settings based on WS-Security authentication, then the device
* shall support this command.
*/
ONVIFDevice.GetAccessPolicy = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetAccessPolicy')({}))
.map(mapResponseXmlToJson('tds:GetAccessPolicyResponse'));
};
/**
* This command sets the device access security policy (for more details on the access security
* policy see the Get command). If the device supports access policy settings
* based on WS-Security authentication, then the device shall support this command.
*/
ONVIFDevice.SetAccessPolicy = function (PolicyFile) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetAccessPolicy')({ tds_PolicyFile: PolicyFile }))
.map(mapResponseXmlToJson('tds:SetAccessPolicyResponse'));
};
/**
* This operation gets a list of all available relay outputs and their settings.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.GetRelayOutputs = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetRelayOutputs')({}))
.map(mapResponseXmlToJson('tds:GetRelayOutputsResponse'));
};
/**
* This operation sets the settings of a relay output.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.SetRelayOutputSettings = function (RelayOutputToken, Properties) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetRelayOutputSettings')({ tds_RelayOutputToken: RelayOutputToken, tds_Properties: Properties }))
.map(mapResponseXmlToJson('tds:SetRelayOutputSettingsResponse'));
};
/**
* This operation sets the state of a relay output.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.SetRelayOutputState = function (RelayOutputToken, LogicalState) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetRelayOutputState')({ tds_RelayOutputToken: RelayOutputToken, tds_LogicalState: LogicalState }))
.map(mapResponseXmlToJson('tds:SetRelayOutputStateResponse'));
};
/**
* Manage auxiliary commands supported by a device, such as controlling an Infrared (IR) lamp,
* a heater or a wiper or a thermometer that is connected to the device.
* The supported commands can be retrieved via the AuxiliaryCommands capability.
* Although the name of the auxiliary commands can be freely defined, commands starting with the prefix tt: are
* reserved to define frequently used commands and these reserved commands shall all share the "tt:command|parameter" syntax.
*
* tt:Wiper|On – Request to start the wiper.
* tt:Wiper|Off – Request to stop the wiper.
* tt:Washer|On – Request to start the washer.
* tt:Washer|Off – Request to stop the washer.
* tt:WashingProcedure|On – Request to start the washing procedure.
* tt: WashingProcedure |Off – Request to stop the washing procedure.
* tt:IRLamp|On – Request to turn ON an IR illuminator attached to the unit.
* tt:IRLamp|Off – Request to turn OFF an IR illuminator attached to the unit.
* tt:IRLamp|Auto – Request to configure an IR illuminator attached to the unit so that it automatically turns ON and OFF.
*
* A device that indicates auxiliary service capability shall support this command.
*/
ONVIFDevice.SendAuxiliaryCommand = function (AuxiliaryCommand) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SendAuxiliaryCommand')({ tds_AuxiliaryCommand: AuxiliaryCommand }))
.map(mapResponseXmlToJson('tds:SendAuxiliaryCommandResponse'));
};
/**
* This operation returns the IEEE802.11 capabilities. The device shall support
* this operation.
*/
ONVIFDevice.GetDot11Capabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDot11Capabilities')({}))
.map(mapResponseXmlToJson('tds:GetDot11CapabilitiesResponse'));
};
/**
* This operation returns the status of a wireless network interface. The device shall support this
* command.
*/
ONVIFDevice.GetDot11Status = function (InterfaceToken) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDot11Status')({ tds_InterfaceToken: InterfaceToken }))
.map(mapResponseXmlToJson('tds:GetDot11StatusResponse'));
};
/**
* This operation returns a lists of the wireless networks in range of the device. A device should
* support this operation.
*/
ONVIFDevice.ScanAvailableDot11Networks = function (InterfaceToken) {
return createStandardRequestBodyFromString(generateRequestElements('tds:ScanAvailableDot11Networks')({ tds_InterfaceToken: InterfaceToken }))
.map(mapResponseXmlToJson('tds:ScanAvailableDot11NetworksResponse'));
};
/**
* This operation is used to retrieve URIs from which system information may be downloaded
* using HTTP. URIs may be returned for the following system information:
* System Logs. Multiple system logs may be returned, of different types. The exact format of
* the system logs is outside the scope of this specification.
* Support Information. This consists of arbitrary device diagnostics information from a device.
* The exact format of the diagnostic information is outside the scope of this specification.
* System Backup. The received file is a backup file that can be used to restore the current
* device configuration at a later date. The exact format of the backup configuration file is
* outside the scope of this specification.
* If the device allows retrieval of system logs, support information or system backup data, it
* should make them available via HTTP GET. If it does, it shall support the GetSystemUris
* command.
*/
ONVIFDevice.GetSystemUris = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetSystemUris')({}))
.map(mapResponseXmlToJson('tds:GetSystemUrisResponse'));
};
/**
* This operation initiates a firmware upgrade using the HTTP POST mechanism. The response
* to the command includes an HTTP URL to which the upgrade file may be uploaded. The
* actual upgrade takes place as soon as the HTTP POST operation has completed. The device
* should support firmware upgrade through the StartFirmwareUpgrade command. The exact
* format of the firmware data is outside the scope of this specification.
* Firmware upgrade over HTTP may be achieved using the following steps:
* Client calls StartFirmwareUpgrade.
* Server responds with upload URI and optional delay value.
* Client waits for delay duration if specified by server.
* Client transmits the firmware image to the upload URI using HTTP POST.
* Server reprograms itself using the uploaded image, then reboots.
*
* If the firmware upgrade fails because the upgrade file was invalid, the HTTP POST response
* shall be “415 Unsupported Media Type”. If the firmware upgrade fails due to an error at the
* device, the HTTP POST response shall be “500 Internal Server Error”.
* The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
*/
ONVIFDevice.StartFirmwareUpgrade = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:StartFirmwareUpgrade')({}))
.map(mapResponseXmlToJson('tds:StartFirmwareUpgradeResponse'));
};
/**
* This operation initiates a system restore from backed up configuration data using the HTTP
* POST mechanism. The response to the command includes an HTTP URL to which the backup
* file may be uploaded. The actual restore takes place as soon as the HTTP POST operation
* has completed. Devices should support system restore through the StartSystemRestore
* command. The exact format of the backup configuration data is outside the scope of this
* specification.
* System restore over HTTP may be achieved using the following steps:
* Client calls StartSystemRestore.
* Server responds with upload URI.
* Client transmits the configuration data to the upload URI using HTTP POST.
* Server applies the uploaded configuration, then reboots if necessary.
*
* If the system restore fails because the uploaded file was invalid, the HTTP POST response
* shall be “415 Unsupported Media Type”. If the system restore fails due to an error at the
* device, the HTTP POST response shall be “500 Internal Server Error”.
* The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
*/
ONVIFDevice.StartSystemRestore = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:StartSystemRestore')({}))
.map(mapResponseXmlToJson('tds:StartSystemRestoreResponse'));
};
/**
*
* This operation lists all existing storage configurations for the device.
*
*/
ONVIFDevice.GetStorageConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetStorageConfigurations')({}))
.map(mapResponseXmlToJson('tds:GetStorageConfigurationsResponse'));
};
/**
*
* This operation creates a new storage configuration.
* The configuration data shall be created in the device and shall be persistent (remain after reboot).
*
*/
ONVIFDevice.CreateStorageConfiguration = function (StorageConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tds:CreateStorageConfiguration')({ tds_StorageConfiguration: StorageConfiguration }))
.map(mapResponseXmlToJson('tds:CreateStorageConfigurationResponse'));
};
/**
*
* This operation retrieves the Storage configuration associated with the given storage configuration token.
*
*/
ONVIFDevice.GetStorageConfiguration = function (Token) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetStorageConfiguration')({ tds_Token: Token }))
.map(mapResponseXmlToJson('tds:GetStorageConfigurationResponse'));
};
/**
*
* This operation modifies an existing Storage configuration.
*
*/
ONVIFDevice.SetStorageConfiguration = function (StorageConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetStorageConfiguration')({ tds_StorageConfiguration: StorageConfiguration }))
.map(mapResponseXmlToJson('tds:SetStorageConfigurationResponse'));
};
/**
*
* This operation deletes the given storage configuration and configuration change shall always be persistent.
*
*/
ONVIFDevice.DeleteStorageConfiguration = function (Token) {
return createStandardRequestBodyFromString(generateRequestElements('tds:DeleteStorageConfiguration')({ tds_Token: Token }))
.map(mapResponseXmlToJson('tds:DeleteStorageConfigurationResponse'));
};
/**
*
* This operation lists all existing geo location configurations for the device.
*
*/
ONVIFDevice.GetGeoLocation = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetGeoLocation')({}))
.map(mapResponseXmlToJson('tds:GetGeoLocationResponse'));
};
/**
*
* This operation allows to modify one or more geo configuration entries.
*
*/
ONVIFDevice.SetGeoLocation = function (Location) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetGeoLocation')({ tds_Location: Location }))
.map(mapResponseXmlToJson('tds:SetGeoLocationResponse'));
};
/**
*
* This operation deletes the given geo location entries.
*
*/
ONVIFDevice.DeleteGeoLocation = function (Location) {
return createStandardRequestBodyFromString(generateRequestElements('tds:DeleteGeoLocation')({ tds_Location: Location }))
.map(mapResponseXmlToJson('tds:DeleteGeoLocationResponse'));
};
/**
*
*/
ONVIFDevice.CreateCertificate = function (CertificateID, Subject, ValidNotBefore, ValidNotAfter) {
return createStandardRequestBodyFromString(generateRequestElements('tds:CreateCertificate')({ tds_CertificateID: CertificateID, tds_Subject: Subject, tds_ValidNotBefore: ValidNotBefore, tds_ValidNotAfter: ValidNotAfter }))
.map(mapResponseXmlToJson('tds:CreateCertificateResponse'));
};
/**
*
*/
ONVIFDevice.GetCertificates = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetCertificates')({}))
.map(mapResponseXmlToJson('tds:GetCertificatesResponse'));
};
/**
*
*/
ONVIFDevice.GetCertificatesStatus = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetCertificatesStatus')({}))
.map(mapResponseXmlToJson('tds:GetCertificatesStatusResponse'));
};
/**
*
*/
ONVIFDevice.SetCertificatesStatus = function (CertificateStatus) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetCertificatesStatus')({ tds_CertificateStatus: CertificateStatus }))
.map(mapResponseXmlToJson('tds:SetCertificatesStatusResponse'));
};
/**
*
*/
ONVIFDevice.DeleteCertificates = function (CertificateID) {
return createStandardRequestBodyFromString(generateRequestElements('tds:DeleteCertificates')({ tds_CertificateID: CertificateID }))
.map(mapResponseXmlToJson('tds:DeleteCertificatesResponse'));
};
/**
*
*/
ONVIFDevice.GetPkcs10Request = function (CertificateID, Subject, Attributes) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetPkcs10Request')({ tds_CertificateID: CertificateID, tds_Subject: Subject, tds_Attributes: Attributes }))
.map(mapResponseXmlToJson('tds:GetPkcs10RequestResponse'));
};
/**
*
*/
ONVIFDevice.LoadCertificates = function (NVTCertificate) {
return createStandardRequestBodyFromString(generateRequestElements('tds:LoadCertificates')({ tds_NVTCertificate: NVTCertificate }))
.map(mapResponseXmlToJson('tds:LoadCertificatesResponse'));
};
/**
*
*/
ONVIFDevice.GetClientCertificateMode = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetClientCertificateMode')({}))
.map(mapResponseXmlToJson('tds:GetClientCertificateModeResponse'));
};
/**
*
*/
ONVIFDevice.SetClientCertificateMode = function (Enabled) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetClientCertificateMode')({ tds_Enabled: Enabled }))
.map(mapResponseXmlToJson('tds:SetClientCertificateModeResponse'));
};
/**
*
*/
ONVIFDevice.GetCACertificates = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetCACertificates')({}))
.map(mapResponseXmlToJson('tds:GetCACertificatesResponse'));
};
/**
*
*/
ONVIFDevice.LoadCertificateWithPrivateKey = function (CertificateWithPrivateKey) {
return createStandardRequestBodyFromString(generateRequestElements('tds:LoadCertificateWithPrivateKey')({ tds_CertificateWithPrivateKey: CertificateWithPrivateKey }))
.map(mapResponseXmlToJson('tds:LoadCertificateWithPrivateKeyResponse'));
};
/**
*
*/
ONVIFDevice.GetCertificateInformation = function (CertificateID) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetCertificateInformation')({ tds_CertificateID: CertificateID }))
.map(mapResponseXmlToJson('tds:GetCertificateInformationResponse'));
};
/**
*
*/
ONVIFDevice.LoadCACertificates = function (CACertificate) {
return createStandardRequestBodyFromString(generateRequestElements('tds:LoadCACertificates')({ tds_CACertificate: CACertificate }))
.map(mapResponseXmlToJson('tds:LoadCACertificatesResponse'));
};
/**
*
*/
ONVIFDevice.CreateDot1XConfiguration = function (Dot1XConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tds:CreateDot1XConfiguration')({ tds_Dot1XConfiguration: Dot1XConfiguration }))
.map(mapResponseXmlToJson('tds:CreateDot1XConfigurationResponse'));
};
/**
*
*/
ONVIFDevice.SetDot1XConfiguration = function (Dot1XConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tds:SetDot1XConfiguration')({ tds_Dot1XConfiguration: Dot1XConfiguration }))
.map(mapResponseXmlToJson('tds:SetDot1XConfigurationResponse'));
};
/**
*
*/
ONVIFDevice.GetDot1XConfiguration = function (Dot1XConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDot1XConfiguration')({ tds_Dot1XConfigurationToken: Dot1XConfigurationToken }))
.map(mapResponseXmlToJson('tds:GetDot1XConfigurationResponse'));
};
/**
*
*/
ONVIFDevice.GetDot1XConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('tds:GetDot1XConfigurations')({}))
.map(mapResponseXmlToJson('tds:GetDot1XConfigurationsResponse'));
};
/**
*
*/
ONVIFDevice.DeleteDot1XConfiguration = function (Dot1XConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tds:DeleteDot1XConfiguration')({ tds_Dot1XConfigurationToken: Dot1XConfigurationToken }))
.map(mapResponseXmlToJson('tds:DeleteDot1XConfigurationResponse'));
};
/**
* Returns information about services on the device.
*/
ONVIFDevice.prototype.GetServices = function (IncludeCapability) {
return ONVIFDevice.GetServices(IncludeCapability).run(this.config);
};
/**
* Returns the capabilities of the device service. The result is returned in a typed answer.
*/
ONVIFDevice.prototype.GetServiceCapabilities = function () {
return ONVIFDevice.GetServiceCapabilities().run(this.config);
};
/**
* This operation gets basic device information from the device.
*/
ONVIFDevice.prototype.GetDeviceInformation = function () {
return ONVIFDevice.GetDeviceInformation().run(this.config);
};
/**
* This operation sets the device system date and time. The device shall support the
* configuration of the daylight saving setting and of the manual system date and time (if
* applicable) or indication of NTP time (if applicable) through the SetSystemDateAndTime
* command.
* If system time and date are set manually, the client shall include UTCDateTime in the request.
* A TimeZone token which is not formed according to the rules of IEEE 1003.1 section 8.3 is considered as invalid timezone.
* The DayLightSavings flag should be set to true to activate any DST settings of the TimeZone string.
* Clear the DayLightSavings flag if the DST portion of the TimeZone settings should be ignored.
*
*/
ONVIFDevice.prototype.SetSystemDateAndTime = function (DateTimeType, DaylightSavings, TimeZone, UTCDateTime) {
return ONVIFDevice.SetSystemDateAndTime(DateTimeType, DaylightSavings, TimeZone, UTCDateTime).run(this.config);
};
/**
* This operation gets the device system date and time. The device shall support the return of
* the daylight saving setting and of the manual system date and time (if applicable) or indication
* of NTP time (if applicable) through the GetSystemDateAndTime command.
* A device shall provide the UTCDateTime information.
*/
ONVIFDevice.prototype.GetSystemDateAndTime = function () {
return ONVIFDevice.GetSystemDateAndTime().run(this.config);
};
/**
* This operation reloads the parameters on the device to their factory default values.
*/
ONVIFDevice.prototype.SetSystemFactoryDefault = function (FactoryDefault) {
return ONVIFDevice.SetSystemFactoryDefault(FactoryDefault).run(this.config);
};
/**
* This operation upgrades a device firmware version. After a successful upgrade the response
* message is sent before the device reboots. The device should support firmware upgrade
* through the UpgradeSystemFirmware command. The exact format of the firmware data is
* outside the scope of this standard.
*/
ONVIFDevice.prototype.UpgradeSystemFirmware = function (Firmware) {
return ONVIFDevice.UpgradeSystemFirmware(Firmware).run(this.config);
};
/**
* This operation reboots the device.
*/
ONVIFDevice.prototype.SystemReboot = function () {
return ONVIFDevice.SystemReboot().run(this.config);
};
/**
* This operation restores the system backup configuration files(s) previously retrieved from a
* device. The device should support restore of backup configuration file(s) through the
* RestoreSystem command. The exact format of the backup configuration file(s) is outside the
* scope of this standard. If the command is supported, it shall accept backup files returned by
* the GetSystemBackup command.
*/
ONVIFDevice.prototype.RestoreSystem = function (BackupFiles) {
return ONVIFDevice.RestoreSystem(BackupFiles).run(this.config);
};
/**
* This operation is retrieves system backup configuration file(s) from a device. The device
* should support return of back up configuration file(s) through the GetSystemBackup command.
* The backup is returned with reference to a name and mime-type together with binary data.
* The exact format of the backup configuration files is outside the scope of this standard.
*/
ONVIFDevice.prototype.GetSystemBackup = function () {
return ONVIFDevice.GetSystemBackup().run(this.config);
};
/**
* This operation gets a system log from the device. The exact format of the system logs is outside the scope of this standard.
*/
ONVIFDevice.prototype.GetSystemLog = function (LogType) {
return ONVIFDevice.GetSystemLog(LogType).run(this.config);
};
/**
* This operation gets arbitary device diagnostics information from the device.
*/
ONVIFDevice.prototype.GetSystemSupportInformation = function () {
return ONVIFDevice.GetSystemSupportInformation().run(this.config);
};
/**
* This operation requests the scope parameters of a device. The scope parameters are used in
* the device discovery to match a probe message, see Section 7. The Scope parameters are of
* two different types:
* Fixed
* Configurable
*
* Fixed scope parameters are permanent device characteristics and cannot be removed through the device management interface.
* The scope type is indicated in the scope list returned in the get scope parameters response. A device shall support
* retrieval of discovery scope parameters through the GetScopes command. As some scope parameters are mandatory,
* the device shall return a non-empty scope list in the response.
*/
ONVIFDevice.prototype.GetScopes = function () {
return ONVIFDevice.GetScopes().run(this.config);
};
/**
* This operation sets the scope parameters of a device. The scope parameters are used in the
* device discovery to match a probe message.
* This operation replaces all existing configurable scope parameters (not fixed parameters). If
* this shall be avoided, one should use the scope add command instead. The device shall
* support configuration of discovery scope parameters through the SetScopes command.
*/
ONVIFDevice.prototype.SetScopes = function (Scopes) {
return ONVIFDevice.SetScopes(Scopes).run(this.config);
};
/**
* This operation adds new configurable scope parameters to a device. The scope parameters
* are used in the device discovery to match a probe message. The device shall
* support addition of discovery scope parameters through the AddScopes command.
*/
ONVIFDevice.prototype.AddScopes = function (ScopeItem) {
return ONVIFDevice.AddScopes(ScopeItem).run(this.config);
};
/**
* This operation deletes scope-configurable scope parameters from a device. The scope
* parameters are used in the device discovery to match a probe message, see Section 7. The
* device shall support deletion of discovery scope parameters through the RemoveScopes
* command.
* Table
*/
ONVIFDevice.prototype.RemoveScopes = function (ScopeItem) {
return ONVIFDevice.RemoveScopes(ScopeItem).run(this.config);
};
/**
* This operation gets the discovery mode of a device. See Section 7.2 for the definition of the
* different device discovery modes. The device shall support retrieval of the discovery mode
* setting through the GetDiscoveryMode command.
*/
ONVIFDevice.prototype.GetDiscoveryMode = function () {
return ONVIFDevice.GetDiscoveryMode().run(this.config);
};
/**
* This operation sets the discovery mode operation of a device. See Section 7.2 for the
* definition of the different device discovery modes. The device shall support configuration of
* the discovery mode setting through the SetDiscoveryMode command.
*/
ONVIFDevice.prototype.SetDiscoveryMode = function (DiscoveryMode) {
return ONVIFDevice.SetDiscoveryMode(DiscoveryMode).run(this.config);
};
/**
* This operation gets the remote discovery mode of a device. See Section 7.4 for the definition
* of remote discovery extensions. A device that supports remote discovery shall support
* retrieval of the remote discovery mode setting through the GetRemoteDiscoveryMode
* command.
*/
ONVIFDevice.prototype.GetRemoteDiscoveryMode = function () {
return ONVIFDevice.GetRemoteDiscoveryMode().run(this.config);
};
/**
* This operation sets the remote discovery mode of operation of a device. See Section 7.4 for
* the definition of remote discovery remote extensions. A device that supports remote discovery
* shall support configuration of the discovery mode setting through the
* SetRemoteDiscoveryMode command.
*/
ONVIFDevice.prototype.SetRemoteDiscoveryMode = function (RemoteDiscoveryMode) {
return ONVIFDevice.SetRemoteDiscoveryMode(RemoteDiscoveryMode).run(this.config);
};
/**
* This operation gets the remote DP address or addresses from a device. If the device supports
* remote discovery, as specified in Section 7.4, the device shall support retrieval of the remote
* DP address(es) through the GetDPAddresses command.
*/
ONVIFDevice.prototype.GetDPAddresses = function () {
return ONVIFDevice.GetDPAddresses().run(this.config);
};
/**
* This operation sets the remote DP address or addresses on a device. If the device supports
* remote discovery, as specified in Section 7.4, the device shall support configuration of the
* remote DP address(es) through the SetDPAddresses command.
*/
ONVIFDevice.prototype.SetDPAddresses = function (DPAddress) {
return ONVIFDevice.SetDPAddresses(DPAddress).run(this.config);
};
/**
* A client can ask for the device service endpoint reference address property that can be used
* to derive the password equivalent for remote user operation. The device shall support the
* GetEndpointReference command returning the address property of the device service
* endpoint reference.
*/
ONVIFDevice.prototype.GetEndpointReference = function () {
return ONVIFDevice.GetEndpointReference().run(this.config);
};
/**
* This operation returns the configured remote user (if any). A device supporting remote user
* handling shall support this operation. The user is only valid for the WS-UserToken profile or
* as a HTTP / RTSP user.
* The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
*/
ONVIFDevice.prototype.GetRemoteUser = function () {
return ONVIFDevice.GetRemoteUser().run(this.config);
};
/**
* This operation sets the remote user. A device supporting remote user handling shall support this
* operation. The user is only valid for the WS-UserToken profile or as a HTTP / RTSP user.
* The password that is set shall always be the original (not derived) password.
* If UseDerivedPassword is set password derivation shall be done by the device when connecting to a
* remote device.The algorithm to use for deriving the password is described in section 5.12.2.1 of the core specification.
* To remove the remote user SetRemoteUser should be called without the RemoteUser parameter.
*/
ONVIFDevice.prototype.SetRemoteUser = function (RemoteUser) {
return ONVIFDevice.SetRemoteUser(RemoteUser).run(this.config);
};
/**
* This operation lists the registered users and corresponding credentials on a device. The
* device shall support retrieval of registered device users and their credentials for the user
* token through the GetUsers command.
*/
ONVIFDevice.prototype.GetUsers = function () {
return ONVIFDevice.GetUsers().run(this.config);
};
/**
* This operation creates new device users and corresponding credentials on a device for authentication purposes.
* The device shall support creation of device users and their credentials through the CreateUsers
* command. Either all users are created successfully or a fault message shall be returned
* without creating any user.
* ONVIF compliant devices are recommended to support password length of at least 28 bytes,
* as clients may follow the password derivation mechanism which results in 'password
* equivalent' of length 28 bytes, as described in section 3.1.2 of the ONVIF security white paper.
*/
ONVIFDevice.prototype.CreateUsers = function (User) {
return ONVIFDevice.CreateUsers(User).run(this.config);
};
/**
* This operation deletes users on a device. The device shall support deletion of device users and their credentials
* through the DeleteUsers command. A device may have one or more fixed users
* that cannot be deleted to ensure access to the unit. Either all users are deleted successfully or a
* fault message shall be returned and no users be deleted.
*/
ONVIFDevice.prototype.DeleteUsers = function (Username) {
return ONVIFDevice.DeleteUsers(Username).run(this.config);
};
/**
* This operation updates the settings for one or several users on a device for authentication purposes.
* The device shall support update of device users and their credentials through the SetUser command.
* Either all change requests are processed successfully or a fault message shall be returned and no change requests be processed.
*/
ONVIFDevice.prototype.SetUser = function (User) {
return ONVIFDevice.SetUser(User).run(this.config);
};
/**
* This method allows to provide a URL where product specific WSDL and schema definitions can be retrieved. This method is deprecated.
*/
ONVIFDevice.prototype.GetWsdlUrl = function () {
return ONVIFDevice.GetWsdlUrl().run(this.config);
};
/**
* This method has been replaced by the more generic GetServices method.
* For capabilities of individual services refer to the GetServiceCapabilities methods.
*/
ONVIFDevice.prototype.GetCapabilities = function (Category) {
return ONVIFDevice.GetCapabilities(Category).run(this.config);
};
/**
* This operation is used by an endpoint to get the hostname from a device. The device shall
* return its hostname configurations through the GetHostname command.
*/
ONVIFDevice.prototype.GetHostname = function () {
return ONVIFDevice.GetHostname().run(this.config);
};
/**
* This operation sets the hostname on a device. It shall be possible to set the device hostname
* configurations through the SetHostname command.
* A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
* other string shall be considered as invalid strings.
*
*/
ONVIFDevice.prototype.SetHostname = function (Name) {
return ONVIFDevice.SetHostname(Name).run(this.config);
};
/**
* This operation controls whether the hostname is set manually or retrieved via DHCP.
*/
ONVIFDevice.prototype.SetHostnameFromDHCP = function (FromDHCP) {
return ONVIFDevice.SetHostnameFromDHCP(FromDHCP).run(this.config);
};
/**
* This operation gets the DNS settings from a device. The device shall return its DNS
* configurations through the GetDNS command.
*/
ONVIFDevice.prototype.GetDNS = function () {
return ONVIFDevice.GetDNS().run(this.config);
};
/**
* This operation sets the DNS settings on a device. It shall be possible to set the device DNS
* configurations through the SetDNS command.
*/
ONVIFDevice.prototype.SetDNS = function (FromDHCP, SearchDomain, DNSManual) {
return ONVIFDevice.SetDNS(FromDHCP, SearchDomain, DNSManual).run(this.config);
};
/**
* This operation gets the NTP settings from a device. If the device supports NTP, it shall be
* possible to get the NTP server settings through the GetNTP command.
*/
ONVIFDevice.prototype.GetNTP = function () {
return ONVIFDevice.GetNTP().run(this.config);
};
/**
* This operation sets the NTP settings on a device. If the device supports NTP, it shall be
* possible to set the NTP server settings through the SetNTP command.
* A device shall accept string formated according to RFC 1123 section 2.1 or alternatively to RFC 952,
* other string shall be considered as invalid strings.
* Changes to the NTP server list will not affect the clock mode DateTimeType. Use SetSystemDateAndTime to activate NTP operation.
*
*/
ONVIFDevice.prototype.SetNTP = function (FromDHCP, NTPManual) {
return ONVIFDevice.SetNTP(FromDHCP, NTPManual).run(this.config);
};
/**
* This operation gets the dynamic DNS settings from a device. If the device supports dynamic
* DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to get the type, name
* and TTL through the GetDynamicDNS command.
*/
ONVIFDevice.prototype.GetDynamicDNS = function () {
return ONVIFDevice.GetDynamicDNS().run(this.config);
};
/**
* This operation sets the dynamic DNS settings on a device. If the device supports dynamic
* DNS as specified in [RFC 2136] and [RFC 4702], it shall be possible to set the type, name
* and TTL through the SetDynamicDNS command.
*/
ONVIFDevice.prototype.SetDynamicDNS = function (Type, Name, TTL) {
return ONVIFDevice.SetDynamicDNS(Type, Name, TTL).run(this.config);
};
/**
* This operation gets the network interface configuration from a device. The device shall
* support return of network interface configuration settings as defined by the NetworkInterface
* type through the GetNetworkInterfaces command.
*/
ONVIFDevice.prototype.GetNetworkInterfaces = function () {
return ONVIFDevice.GetNetworkInterfaces().run(this.config);
};
/**
* This operation sets the network interface configuration on a device. The device shall support
* network configuration of supported network interfaces through the SetNetworkInterfaces
* command.
* For interoperability with a client unaware of the IEEE 802.11 extension a device shall retain
* its IEEE 802.11 configuration if the IEEE 802.11 configuration element isn’t present in the
* request.
*/
ONVIFDevice.prototype.SetNetworkInterfaces = function (InterfaceToken, NetworkInterface) {
return ONVIFDevice.SetNetworkInterfaces(InterfaceToken, NetworkInterface).run(this.config);
};
/**
* This operation gets defined network protocols from a device. The device shall support the
* GetNetworkProtocols command returning configured network protocols.
*/
ONVIFDevice.prototype.GetNetworkProtocols = function () {
return ONVIFDevice.GetNetworkProtocols().run(this.config);
};
/**
* This operation configures defined network protocols on a device. The device shall support
* configuration of defined network protocols through the SetNetworkProtocols command.
*/
ONVIFDevice.prototype.SetNetworkProtocols = function (NetworkProtocols) {
return ONVIFDevice.SetNetworkProtocols(NetworkProtocols).run(this.config);
};
/**
* This operation gets the default gateway settings from a device. The device shall support the
* GetNetworkDefaultGateway command returning configured default gateway address(es).
*/
ONVIFDevice.prototype.GetNetworkDefaultGateway = function () {
return ONVIFDevice.GetNetworkDefaultGateway().run(this.config);
};
/**
* This operation sets the default gateway settings on a device. The device shall support
* configuration of default gateway through the SetNetworkDefaultGateway command.
*/
ONVIFDevice.prototype.SetNetworkDefaultGateway = function (IPv4Address, IPv6Address) {
return ONVIFDevice.SetNetworkDefaultGateway(IPv4Address, IPv6Address).run(this.config);
};
/**
* This operation gets the zero-configuration from a device. If the device supports dynamic IP
* configuration according to [RFC3927], it shall support the return of IPv4 zero configuration
* address and status through the GetZeroConfiguration command.
* Devices supporting zero configuration on more than one interface shall use the extension to list the additional interface settings.
*/
ONVIFDevice.prototype.GetZeroConfiguration = function () {
return ONVIFDevice.GetZeroConfiguration().run(this.config);
};
/**
* This operation sets the zero-configuration. Use GetCapalities to get if zero-zero-configuration is supported or not.
*/
ONVIFDevice.prototype.SetZeroConfiguration = function (InterfaceToken, Enabled) {
return ONVIFDevice.SetZeroConfiguration(InterfaceToken, Enabled).run(this.config);
};
/**
* This operation gets the IP address filter settings from a device. If the device supports device
* access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
* device shall support the GetIPAddressFilter command.
*/
ONVIFDevice.prototype.GetIPAddressFilter = function () {
return ONVIFDevice.GetIPAddressFilter().run(this.config);
};
/**
* This operation sets the IP address filter settings on a device. If the device supports device
* access control based on IP filtering rules (denied or accepted ranges of IP addresses), the
* device shall support configuration of IP filtering rules through the SetIPAddressFilter
* command.
*/
ONVIFDevice.prototype.SetIPAddressFilter = function (IPAddressFilter) {
return ONVIFDevice.SetIPAddressFilter(IPAddressFilter).run(this.config);
};
/**
* This operation adds an IP filter address to a device. If the device supports device access
* control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
* shall support adding of IP filtering addresses through the AddIPAddressFilter command.
*/
ONVIFDevice.prototype.AddIPAddressFilter = function (IPAddressFilter) {
return ONVIFDevice.AddIPAddressFilter(IPAddressFilter).run(this.config);
};
/**
* This operation deletes an IP filter address from a device. If the device supports device access
* control based on IP filtering rules (denied or accepted ranges of IP addresses), the device
* shall support deletion of IP filtering addresses through the RemoveIPAddressFilter command.
*/
ONVIFDevice.prototype.RemoveIPAddressFilter = function (IPAddressFilter) {
return ONVIFDevice.RemoveIPAddressFilter(IPAddressFilter).run(this.config);
};
/**
* Access to different services and sub-sets of services should be subject to access control. The
* WS-Security framework gives the prerequisite for end-point authentication. Authorization
* decisions can then be taken using an access security policy. This standard does not mandate
* any particular policy description format or security policy but this is up to the device
* manufacturer or system provider to choose policy and policy description format of choice.
* However, an access policy (in arbitrary format) can be requested using this command. If the
* device supports access policy settings based on WS-Security authentication, then the device
* shall support this command.
*/
ONVIFDevice.prototype.GetAccessPolicy = function () {
return ONVIFDevice.GetAccessPolicy().run(this.config);
};
/**
* This command sets the device access security policy (for more details on the access security
* policy see the Get command). If the device supports access policy settings
* based on WS-Security authentication, then the device shall support this command.
*/
ONVIFDevice.prototype.SetAccessPolicy = function (PolicyFile) {
return ONVIFDevice.SetAccessPolicy(PolicyFile).run(this.config);
};
/**
* This operation gets a list of all available relay outputs and their settings.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.prototype.GetRelayOutputs = function () {
return ONVIFDevice.GetRelayOutputs().run(this.config);
};
/**
* This operation sets the settings of a relay output.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.prototype.SetRelayOutputSettings = function (RelayOutputToken, Properties) {
return ONVIFDevice.SetRelayOutputSettings(RelayOutputToken, Properties).run(this.config);
};
/**
* This operation sets the state of a relay output.
* This method has been depricated with version 2.0. Refer to the DeviceIO service.
*/
ONVIFDevice.prototype.SetRelayOutputState = function (RelayOutputToken, LogicalState) {
return ONVIFDevice.SetRelayOutputState(RelayOutputToken, LogicalState).run(this.config);
};
/**
* Manage auxiliary commands supported by a device, such as controlling an Infrared (IR) lamp,
* a heater or a wiper or a thermometer that is connected to the device.
* The supported commands can be retrieved via the AuxiliaryCommands capability.
* Although the name of the auxiliary commands can be freely defined, commands starting with the prefix tt: are
* reserved to define frequently used commands and these reserved commands shall all share the "tt:command|parameter" syntax.
*
* tt:Wiper|On – Request to start the wiper.
* tt:Wiper|Off – Request to stop the wiper.
* tt:Washer|On – Request to start the washer.
* tt:Washer|Off – Request to stop the washer.
* tt:WashingProcedure|On – Request to start the washing procedure.
* tt: WashingProcedure |Off – Request to stop the washing procedure.
* tt:IRLamp|On – Request to turn ON an IR illuminator attached to the unit.
* tt:IRLamp|Off – Request to turn OFF an IR illuminator attached to the unit.
* tt:IRLamp|Auto – Request to configure an IR illuminator attached to the unit so that it automatically turns ON and OFF.
*
* A device that indicates auxiliary service capability shall support this command.
*/
ONVIFDevice.prototype.SendAuxiliaryCommand = function (AuxiliaryCommand) {
return ONVIFDevice.SendAuxiliaryCommand(AuxiliaryCommand).run(this.config);
};
/**
* This operation returns the IEEE802.11 capabilities. The device shall support
* this operation.
*/
ONVIFDevice.prototype.GetDot11Capabilities = function () {
return ONVIFDevice.GetDot11Capabilities().run(this.config);
};
/**
* This operation returns the status of a wireless network interface. The device shall support this
* command.
*/
ONVIFDevice.prototype.GetDot11Status = function (InterfaceToken) {
return ONVIFDevice.GetDot11Status(InterfaceToken).run(this.config);
};
/**
* This operation returns a lists of the wireless networks in range of the device. A device should
* support this operation.
*/
ONVIFDevice.prototype.ScanAvailableDot11Networks = function (InterfaceToken) {
return ONVIFDevice.ScanAvailableDot11Networks(InterfaceToken).run(this.config);
};
/**
* This operation is used to retrieve URIs from which system information may be downloaded
* using HTTP. URIs may be returned for the following system information:
* System Logs. Multiple system logs may be returned, of different types. The exact format of
* the system logs is outside the scope of this specification.
* Support Information. This consists of arbitrary device diagnostics information from a device.
* The exact format of the diagnostic information is outside the scope of this specification.
* System Backup. The received file is a backup file that can be used to restore the current
* device configuration at a later date. The exact format of the backup configuration file is
* outside the scope of this specification.
* If the device allows retrieval of system logs, support information or system backup data, it
* should make them available via HTTP GET. If it does, it shall support the GetSystemUris
* command.
*/
ONVIFDevice.prototype.GetSystemUris = function () {
return ONVIFDevice.GetSystemUris().run(this.config);
};
/**
* This operation initiates a firmware upgrade using the HTTP POST mechanism. The response
* to the command includes an HTTP URL to which the upgrade file may be uploaded. The
* actual upgrade takes place as soon as the HTTP POST operation has completed. The device
* should support firmware upgrade through the StartFirmwareUpgrade command. The exact
* format of the firmware data is outside the scope of this specification.
* Firmware upgrade over HTTP may be achieved using the following steps:
* Client calls StartFirmwareUpgrade.
* Server responds with upload URI and optional delay value.
* Client waits for delay duration if specified by server.
* Client transmits the firmware image to the upload URI using HTTP POST.
* Server reprograms itself using the uploaded image, then reboots.
*
* If the firmware upgrade fails because the upgrade file was invalid, the HTTP POST response
* shall be “415 Unsupported Media Type”. If the firmware upgrade fails due to an error at the
* device, the HTTP POST response shall be “500 Internal Server Error”.
* The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
*/
ONVIFDevice.prototype.StartFirmwareUpgrade = function () {
return ONVIFDevice.StartFirmwareUpgrade().run(this.config);
};
/**
* This operation initiates a system restore from backed up configuration data using the HTTP
* POST mechanism. The response to the command includes an HTTP URL to which the backup
* file may be uploaded. The actual restore takes place as soon as the HTTP POST operation
* has completed. Devices should support system restore through the StartSystemRestore
* command. The exact format of the backup configuration data is outside the scope of this
* specification.
* System restore over HTTP may be achieved using the following steps:
* Client calls StartSystemRestore.
* Server responds with upload URI.
* Client transmits the configuration data to the upload URI using HTTP POST.
* Server applies the uploaded configuration, then reboots if necessary.
*
* If the system restore fails because the uploaded file was invalid, the HTTP POST response
* shall be “415 Unsupported Media Type”. If the system restore fails due to an error at the
* device, the HTTP POST response shall be “500 Internal Server Error”.
* The value of the Content-Type header in the HTTP POST request shall be “application/octetstream”.
*/
ONVIFDevice.prototype.StartSystemRestore = function () {
return ONVIFDevice.StartSystemRestore().run(this.config);
};
/**
*
* This operation lists all existing storage configurations for the device.
*
*/
ONVIFDevice.prototype.GetStorageConfigurations = function () {
return ONVIFDevice.GetStorageConfigurations().run(this.config);
};
/**
*
* This operation creates a new storage configuration.
* The configuration data shall be created in the device and shall be persistent (remain after reboot).
*
*/
ONVIFDevice.prototype.CreateStorageConfiguration = function (StorageConfiguration) {
return ONVIFDevice.CreateStorageConfiguration(StorageConfiguration).run(this.config);
};
/**
*
* This operation retrieves the Storage configuration associated with the given storage configuration token.
*
*/
ONVIFDevice.prototype.GetStorageConfiguration = function (Token) {
return ONVIFDevice.GetStorageConfiguration(Token).run(this.config);
};
/**
*
* This operation modifies an existing Storage configuration.
*
*/
ONVIFDevice.prototype.SetStorageConfiguration = function (StorageConfiguration) {
return ONVIFDevice.SetStorageConfiguration(StorageConfiguration).run(this.config);
};
/**
*
* This operation deletes the given storage configuration and configuration change shall always be persistent.
*
*/
ONVIFDevice.prototype.DeleteStorageConfiguration = function (Token) {
return ONVIFDevice.DeleteStorageConfiguration(Token).run(this.config);
};
/**
*
* This operation lists all existing geo location configurations for the device.
*
*/
ONVIFDevice.prototype.GetGeoLocation = function () {
return ONVIFDevice.GetGeoLocation().run(this.config);
};
/**
*
* This operation allows to modify one or more geo configuration entries.
*
*/
ONVIFDevice.prototype.SetGeoLocation = function (Location) {
return ONVIFDevice.SetGeoLocation(Location).run(this.config);
};
/**
*
* This operation deletes the given geo location entries.
*
*/
ONVIFDevice.prototype.DeleteGeoLocation = function (Location) {
return ONVIFDevice.DeleteGeoLocation(Location).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.CreateCertificate = function (CertificateID, Subject, ValidNotBefore, ValidNotAfter) {
return ONVIFDevice.CreateCertificate(CertificateID, Subject, ValidNotBefore, ValidNotAfter).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetCertificates = function () {
return ONVIFDevice.GetCertificates().run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetCertificatesStatus = function () {
return ONVIFDevice.GetCertificatesStatus().run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.SetCertificatesStatus = function (CertificateStatus) {
return ONVIFDevice.SetCertificatesStatus(CertificateStatus).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.DeleteCertificates = function (CertificateID) {
return ONVIFDevice.DeleteCertificates(CertificateID).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetPkcs10Request = function (CertificateID, Subject, Attributes) {
return ONVIFDevice.GetPkcs10Request(CertificateID, Subject, Attributes).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.LoadCertificates = function (NVTCertificate) {
return ONVIFDevice.LoadCertificates(NVTCertificate).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetClientCertificateMode = function () {
return ONVIFDevice.GetClientCertificateMode().run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.SetClientCertificateMode = function (Enabled) {
return ONVIFDevice.SetClientCertificateMode(Enabled).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetCACertificates = function () {
return ONVIFDevice.GetCACertificates().run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.LoadCertificateWithPrivateKey = function (CertificateWithPrivateKey) {
return ONVIFDevice.LoadCertificateWithPrivateKey(CertificateWithPrivateKey).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetCertificateInformation = function (CertificateID) {
return ONVIFDevice.GetCertificateInformation(CertificateID).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.LoadCACertificates = function (CACertificate) {
return ONVIFDevice.LoadCACertificates(CACertificate).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.CreateDot1XConfiguration = function (Dot1XConfiguration) {
return ONVIFDevice.CreateDot1XConfiguration(Dot1XConfiguration).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.SetDot1XConfiguration = function (Dot1XConfiguration) {
return ONVIFDevice.SetDot1XConfiguration(Dot1XConfiguration).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetDot1XConfiguration = function (Dot1XConfigurationToken) {
return ONVIFDevice.GetDot1XConfiguration(Dot1XConfigurationToken).run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.GetDot1XConfigurations = function () {
return ONVIFDevice.GetDot1XConfigurations().run(this.config);
};
/**
*
*/
ONVIFDevice.prototype.DeleteDot1XConfiguration = function (Dot1XConfigurationToken) {
return ONVIFDevice.DeleteDot1XConfiguration(Dot1XConfigurationToken).run(this.config);
};
return ONVIFDevice;
}());
var ONVIFMedia = /** @class */ (function () {
function ONVIFMedia(config) {
this.config = config;
}
/**
* Returns the capabilities of the media service. The result is returned in a typed answer.
*/
ONVIFMedia.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('trt:GetServiceCapabilitiesResponse'));
};
/**
* This command lists all available physical video inputs of the device.
*/
ONVIFMedia.GetVideoSources = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoSources')({}))
.map(mapResponseXmlToJson('trt:GetVideoSourcesResponse'));
};
/**
* This command lists all available physical audio inputs of the device.
*/
ONVIFMedia.GetAudioSources = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioSources')({}))
.map(mapResponseXmlToJson('trt:GetAudioSourcesResponse'));
};
/**
* This command lists all available physical audio outputs of the device.
*/
ONVIFMedia.GetAudioOutputs = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioOutputs')({}))
.map(mapResponseXmlToJson('trt:GetAudioOutputsResponse'));
};
/**
* This operation creates a new empty media profile. The media profile shall be created in the
* device and shall be persistent (remain after reboot). A created profile shall be deletable and a device shall set the “fixed” attribute to false in the
* returned Profile.
*/
ONVIFMedia.CreateProfile = function (Name, Token) {
return createStandardRequestBodyFromString(generateRequestElements('trt:CreateProfile')({ trt_Name: Name, trt_Token: Token }))
.map(mapResponseXmlToJson('trt:CreateProfileResponse'));
};
/**
* If the profile token is already known, a profile can be fetched through the GetProfile command.
*/
ONVIFMedia.GetProfile = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetProfile')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetProfileResponse'));
};
/**
* Any endpoint can ask for the existing media profiles of a device using the GetProfiles
* command. Pre-configured or dynamically configured profiles can be retrieved using this
* command. This command lists all configured profiles in a device. The client does not need to
* know the media profile in order to use the command.
*/
ONVIFMedia.GetProfiles = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetProfiles')({}))
.map(mapResponseXmlToJson('trt:GetProfilesResponse'));
};
/**
* This operation adds a VideoEncoderConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
* support adding a compatible VideoEncoderConfiguration to a Profile containing a VideoSourceConfiguration and shall
* support streaming video data of such a profile.
*
*/
ONVIFMedia.AddVideoEncoderConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddVideoEncoderConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddVideoEncoderConfigurationResponse'));
};
/**
* This operation removes a VideoEncoderConfiguration from an existing media profile. If the
* media profile does not contain a VideoEncoderConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.RemoveVideoEncoderConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveVideoEncoderConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveVideoEncoderConfigurationResponse'));
};
/**
* This operation adds a VideoSourceConfiguration to an existing media profile. If such a
* configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.AddVideoSourceConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddVideoSourceConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddVideoSourceConfigurationResponse'));
};
/**
* This operation removes a VideoSourceConfiguration from an existing media profile. If the
* media profile does not contain a VideoSourceConfiguration, the operation has no effect. The removal shall be persistent. Video source configurations should only be removed after removing a
* VideoEncoderConfiguration from the media profile.
*/
ONVIFMedia.RemoveVideoSourceConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveVideoSourceConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveVideoSourceConfigurationResponse'));
};
/**
* This operation adds an AudioEncoderConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
* support adding a compatible AudioEncoderConfiguration to a profile containing an AudioSourceConfiguration and shall
* support streaming audio data of such a profile.
*
*/
ONVIFMedia.AddAudioEncoderConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddAudioEncoderConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddAudioEncoderConfigurationResponse'));
};
/**
* This operation removes an AudioEncoderConfiguration from an existing media profile. If the
* media profile does not contain an AudioEncoderConfiguration, the operation has no effect.
* The removal shall be persistent.
*/
ONVIFMedia.RemoveAudioEncoderConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveAudioEncoderConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveAudioEncoderConfigurationResponse'));
};
/**
* This operation adds an AudioSourceConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.AddAudioSourceConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddAudioSourceConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddAudioSourceConfigurationResponse'));
};
/**
* This operation removes an AudioSourceConfiguration from an existing media profile. If the
* media profile does not contain an AudioSourceConfiguration, the operation has no effect. The
* removal shall be persistent. Audio source configurations should only be removed after removing an
* AudioEncoderConfiguration from the media profile.
*/
ONVIFMedia.RemoveAudioSourceConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveAudioSourceConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveAudioSourceConfigurationResponse'));
};
/**
* This operation adds a PTZConfiguration to an existing media profile. If a configuration exists
* in the media profile, it will be replaced. The change shall be persistent. Adding a PTZConfiguration to a media profile means that streams using that media profile can
* contain PTZ status (in the metadata), and that the media profile can be used for controlling
* PTZ movement.
*/
ONVIFMedia.AddPTZConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddPTZConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddPTZConfigurationResponse'));
};
/**
* This operation removes a PTZConfiguration from an existing media profile. If the media profile
* does not contain a PTZConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.RemovePTZConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemovePTZConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemovePTZConfigurationResponse'));
};
/**
* This operation adds a VideoAnalytics configuration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a VideoAnalyticsConfiguration to a media profile means that streams using that media
* profile can contain video analytics data (in the metadata) as defined by the submitted configuration reference. A profile containing only a video analytics configuration but no video source configuration is incomplete. Therefore, a client should first add a video source configuration to a profile before adding a video analytics configuration. The device can deny adding of a video analytics
* configuration before a video source configuration.
*/
ONVIFMedia.AddVideoAnalyticsConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddVideoAnalyticsConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddVideoAnalyticsConfigurationResponse'));
};
/**
* This operation removes a VideoAnalyticsConfiguration from an existing media profile. If the media profile does not contain a VideoAnalyticsConfiguration, the operation has no effect.
* The removal shall be persistent.
*/
ONVIFMedia.RemoveVideoAnalyticsConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveVideoAnalyticsConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveVideoAnalyticsConfigurationResponse'));
};
/**
* This operation adds a Metadata configuration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a MetadataConfiguration to a Profile means that streams using that profile contain metadata. Metadata can consist of events, PTZ status, and/or video analytics data.
*/
ONVIFMedia.AddMetadataConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddMetadataConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddMetadataConfigurationResponse'));
};
/**
* This operation removes a MetadataConfiguration from an existing media profile. If the media profile does not contain a MetadataConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.RemoveMetadataConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveMetadataConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveMetadataConfigurationResponse'));
};
/**
* This operation adds an AudioOutputConfiguration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.AddAudioOutputConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddAudioOutputConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddAudioOutputConfigurationResponse'));
};
/**
* This operation removes an AudioOutputConfiguration from an existing media profile. If the media profile does not contain an AudioOutputConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.RemoveAudioOutputConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveAudioOutputConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveAudioOutputConfigurationResponse'));
};
/**
* This operation adds an AudioDecoderConfiguration to an existing media profile. If a configuration exists in the media profile, it shall be replaced. The change shall be persistent.
*/
ONVIFMedia.AddAudioDecoderConfiguration = function (ProfileToken, ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:AddAudioDecoderConfiguration')({ trt_ProfileToken: ProfileToken, trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:AddAudioDecoderConfigurationResponse'));
};
/**
* This operation removes an AudioDecoderConfiguration from an existing media profile. If the media profile does not contain an AudioDecoderConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.RemoveAudioDecoderConfiguration = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:RemoveAudioDecoderConfiguration')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:RemoveAudioDecoderConfigurationResponse'));
};
/**
* This operation deletes a profile. This change shall always be persistent. Deletion of a profile is only possible for non-fixed profiles
*/
ONVIFMedia.DeleteProfile = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:DeleteProfile')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:DeleteProfileResponse'));
};
/**
* This operation lists all existing video source configurations for a device. The client need not know anything about the video source configurations in order to use the command.
*/
ONVIFMedia.GetVideoSourceConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoSourceConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetVideoSourceConfigurationsResponse'));
};
/**
* This operation lists all existing video encoder configurations of a device. This command lists all configured video encoder configurations in a device. The client need not know anything apriori about the video encoder configurations in order to use the command.
*/
ONVIFMedia.GetVideoEncoderConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoEncoderConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetVideoEncoderConfigurationsResponse'));
};
/**
* This operation lists all existing audio source configurations of a device. This command lists all audio source configurations in a device. The client need not know anything apriori about the audio source configurations in order to use the command.
*/
ONVIFMedia.GetAudioSourceConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioSourceConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetAudioSourceConfigurationsResponse'));
};
/**
* This operation lists all existing device audio encoder configurations. The client need not know anything apriori about the audio encoder configurations in order to use the command.
*/
ONVIFMedia.GetAudioEncoderConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioEncoderConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetAudioEncoderConfigurationsResponse'));
};
/**
* This operation lists all video analytics configurations of a device. This command lists all configured video analytics in a device. The client need not know anything apriori about the video analytics in order to use the command.
*/
ONVIFMedia.GetVideoAnalyticsConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoAnalyticsConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetVideoAnalyticsConfigurationsResponse'));
};
/**
* This operation lists all existing metadata configurations. The client need not know anything apriori about the metadata in order to use the command.
*/
ONVIFMedia.GetMetadataConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetMetadataConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetMetadataConfigurationsResponse'));
};
/**
* This command lists all existing AudioOutputConfigurations of a device. The NVC need not know anything apriori about the audio configurations to use this command.
*/
ONVIFMedia.GetAudioOutputConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioOutputConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetAudioOutputConfigurationsResponse'));
};
/**
* This command lists all existing AudioDecoderConfigurations of a device. The NVC need not know anything apriori about the audio decoder configurations in order to
* use this command.
*/
ONVIFMedia.GetAudioDecoderConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioDecoderConfigurations')({}))
.map(mapResponseXmlToJson('trt:GetAudioDecoderConfigurationsResponse'));
};
/**
* If the video source configuration token is already known, the video source configuration can be fetched through the GetVideoSourceConfiguration command.
*/
ONVIFMedia.GetVideoSourceConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoSourceConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetVideoSourceConfigurationResponse'));
};
/**
* If the video encoder configuration token is already known, the encoder configuration can be fetched through the GetVideoEncoderConfiguration command.
*/
ONVIFMedia.GetVideoEncoderConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoEncoderConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetVideoEncoderConfigurationResponse'));
};
/**
* The GetAudioSourceConfiguration command fetches the audio source configurations if the audio source configuration token is already known. An
*/
ONVIFMedia.GetAudioSourceConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioSourceConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetAudioSourceConfigurationResponse'));
};
/**
* The GetAudioEncoderConfiguration command fetches the encoder configuration if the audio encoder configuration token is known.
*/
ONVIFMedia.GetAudioEncoderConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioEncoderConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetAudioEncoderConfigurationResponse'));
};
/**
* The GetVideoAnalyticsConfiguration command fetches the video analytics configuration if the video analytics token is known.
*/
ONVIFMedia.GetVideoAnalyticsConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoAnalyticsConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetVideoAnalyticsConfigurationResponse'));
};
/**
* The GetMetadataConfiguration command fetches the metadata configuration if the metadata token is known.
*/
ONVIFMedia.GetMetadataConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetMetadataConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetMetadataConfigurationResponse'));
};
/**
* If the audio output configuration token is already known, the output configuration can be fetched through the GetAudioOutputConfiguration command.
*/
ONVIFMedia.GetAudioOutputConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioOutputConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetAudioOutputConfigurationResponse'));
};
/**
* If the audio decoder configuration token is already known, the decoder configuration can be fetched through the GetAudioDecoderConfiguration command.
*/
ONVIFMedia.GetAudioDecoderConfiguration = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioDecoderConfiguration')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetAudioDecoderConfigurationResponse'));
};
/**
* This operation lists all the video encoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoEncoderConfiguration command on the media profile. The result will vary depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleVideoEncoderConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleVideoEncoderConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleVideoEncoderConfigurationsResponse'));
};
/**
* This operation requests all the video source configurations of the device that are compatible
* with a certain media profile. Each of the returned configurations shall be a valid input
* parameter for the AddVideoSourceConfiguration command on the media profile. The result
* will vary depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleVideoSourceConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleVideoSourceConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleVideoSourceConfigurationsResponse'));
};
/**
* This operation requests all audio encoder configurations of a device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioSourceConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleAudioEncoderConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleAudioEncoderConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleAudioEncoderConfigurationsResponse'));
};
/**
* This operation requests all audio source configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioEncoderConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleAudioSourceConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleAudioSourceConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleAudioSourceConfigurationsResponse'));
};
/**
* This operation requests all video analytic configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoAnalyticsConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleVideoAnalyticsConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleVideoAnalyticsConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleVideoAnalyticsConfigurationsResponse'));
};
/**
* This operation requests all the metadata configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddMetadataConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.GetCompatibleMetadataConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleMetadataConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleMetadataConfigurationsResponse'));
};
/**
* This command lists all audio output configurations of a device that are compatible with a certain media profile. Each returned configuration shall be a valid input for the
* AddAudioOutputConfiguration command.
*/
ONVIFMedia.GetCompatibleAudioOutputConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleAudioOutputConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleAudioOutputConfigurationsResponse'));
};
/**
* This operation lists all the audio decoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioDecoderConfiguration command on the media profile.
*/
ONVIFMedia.GetCompatibleAudioDecoderConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetCompatibleAudioDecoderConfigurations')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetCompatibleAudioDecoderConfigurationsResponse'));
};
/**
* This operation modifies a video source configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification.
*/
ONVIFMedia.SetVideoSourceConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetVideoSourceConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetVideoSourceConfigurationResponse'));
};
/**
* This operation modifies a video encoder configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Changes in the Multicast settings shall always be persistent. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification. SessionTimeout is provided as a hint for keeping rtsp session by a device. If necessary the device may adapt parameter values for SessionTimeout elements without returning an error. For the time between keep alive calls the client shall adhere to the timeout value signaled via RTSP.
*/
ONVIFMedia.SetVideoEncoderConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetVideoEncoderConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetVideoEncoderConfigurationResponse'));
};
/**
* This operation modifies an audio source configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device. Running streams using this configuration
* may be immediately updated according to the new settings. The changes are not guaranteed
* to take effect unless the client requests a new stream URI and restarts any affected stream
* NVC methods for changing a running stream are out of scope for this specification.
*/
ONVIFMedia.SetAudioSourceConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetAudioSourceConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetAudioSourceConfigurationResponse'));
};
/**
* This operation modifies an audio encoder configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated
* according to the new settings. The changes are not guaranteed to take effect unless the client
* requests a new stream URI and restarts any affected streams. NVC methods for changing a
* running stream are out of scope for this specification.
*/
ONVIFMedia.SetAudioEncoderConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetAudioEncoderConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetAudioEncoderConfigurationResponse'));
};
/**
* A video analytics configuration is modified using this command. The ForcePersistence flag
* indicates if the changes shall remain after reboot of the device or not. Running streams using
* this configuration shall be immediately updated according to the new settings. Otherwise
* inconsistencies can occur between the scene description processed by the rule engine and
* the notifications produced by analytics engine and rule engine which reference the very same
* video analytics configuration token.
*/
ONVIFMedia.SetVideoAnalyticsConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetVideoAnalyticsConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetVideoAnalyticsConfigurationResponse'));
};
/**
* This operation modifies a metadata configuration. The ForcePersistence flag indicates if the
* changes shall remain after reboot of the device. Changes in the Multicast settings shall
* always be persistent. Running streams using this configuration may be updated immediately
* according to the new settings. The changes are not guaranteed to take effect unless the client
* requests a new stream URI and restarts any affected streams. NVC methods for changing a
* running stream are out of scope for this specification.
*/
ONVIFMedia.SetMetadataConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetMetadataConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetMetadataConfigurationResponse'));
};
/**
* This operation modifies an audio output configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device.
*/
ONVIFMedia.SetAudioOutputConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetAudioOutputConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetAudioOutputConfigurationResponse'));
};
/**
* This operation modifies an audio decoder configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device.
*/
ONVIFMedia.SetAudioDecoderConfiguration = function (Configuration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetAudioDecoderConfiguration')({ trt_Configuration: Configuration, trt_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('trt:SetAudioDecoderConfigurationResponse'));
};
/**
* This operation returns the available options (supported values and ranges for video source configuration parameters) when the video source parameters are
* reconfigured If a video source configuration is specified, the options shall concern that
* particular configuration. If a media profile is specified, the options shall be compatible with
* that media profile.
*/
ONVIFMedia.GetVideoSourceConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoSourceConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetVideoSourceConfigurationOptionsResponse'));
};
/**
* This operation returns the available options (supported values and ranges for video encoder
* configuration parameters) when the video encoder parameters are reconfigured.
* For JPEG, MPEG4 and H264 extension elements have been defined that provide additional information. A device must provide the
* XxxOption information for all encodings supported and should additionally provide the corresponding XxxOption2 information.
* This response contains the available video encoder configuration options. If a video encoder configuration is specified,
* the options shall concern that particular configuration. If a media profile is specified, the options shall be
* compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
*
*/
ONVIFMedia.GetVideoEncoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoEncoderConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetVideoEncoderConfigurationOptionsResponse'));
};
/**
* This operation returns the available options (supported values and ranges for audio source configuration parameters) when the audio source parameters are
* reconfigured. If an audio source configuration is specified, the options shall concern that
* particular configuration. If a media profile is specified, the options shall be compatible with
* that media profile.
*/
ONVIFMedia.GetAudioSourceConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioSourceConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetAudioSourceConfigurationOptionsResponse'));
};
/**
* This operation returns the available options (supported values and ranges for audio encoder configuration parameters) when the audio encoder parameters are
* reconfigured.
*/
ONVIFMedia.GetAudioEncoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioEncoderConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetAudioEncoderConfigurationOptionsResponse'));
};
/**
* This operation returns the available options (supported values and ranges for metadata configuration parameters) for changing the metadata configuration.
*/
ONVIFMedia.GetMetadataConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetMetadataConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetMetadataConfigurationOptionsResponse'));
};
/**
* This operation returns the available options (supported values and ranges for audio output configuration parameters) for configuring an audio output.
*/
ONVIFMedia.GetAudioOutputConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioOutputConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetAudioOutputConfigurationOptionsResponse'));
};
/**
* This command list the audio decoding capabilities for a given profile and configuration of a
* device.
*/
ONVIFMedia.GetAudioDecoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetAudioDecoderConfigurationOptions')({ trt_ConfigurationToken: ConfigurationToken, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetAudioDecoderConfigurationOptionsResponse'));
};
/**
* The GetGuaranteedNumberOfVideoEncoderInstances command can be used to request the
* minimum number of guaranteed video encoder instances (applications) per Video Source
* Configuration.
*/
ONVIFMedia.GetGuaranteedNumberOfVideoEncoderInstances = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetGuaranteedNumberOfVideoEncoderInstances')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetGuaranteedNumberOfVideoEncoderInstancesResponse'));
};
/**
* This operation requests a URI that can be used to initiate a live media stream using RTSP as
* the control protocol. The returned URI shall remain valid indefinitely even if the profile is
* changed. The ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set
* accordingly (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S).
* The correct syntax for the StreamSetup element for these media stream setups defined in 5.1.1 of the streaming specification are as follows:
*
* RTP unicast over UDP: StreamType = "RTP_unicast", TransportProtocol = "UDP"
* RTP over RTSP over HTTP over TCP: StreamType = "RTP_unicast", TransportProtocol = "HTTP"
* RTP over RTSP over TCP: StreamType = "RTP_unicast", TransportProtocol = "RTSP"
*
*
* If a multicast stream is requested at least one of VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration shall have a valid multicast setting.
* For full compatibility with other ONVIF services a device should not generate Uris longer than
* 128 octets.
*/
ONVIFMedia.GetStreamUri = function (StreamSetup, ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetStreamUri')({ trt_StreamSetup: StreamSetup, trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetStreamUriResponse'));
};
/**
* This command starts multicast streaming using a specified media profile of a device.
* Streaming continues until StopMulticastStreaming is called for the same Profile. The
* streaming shall continue after a reboot of the device until a StopMulticastStreaming request is
* received. The multicast address, port and TTL are configured in the
* VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration
* respectively.
*/
ONVIFMedia.StartMulticastStreaming = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:StartMulticastStreaming')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:StartMulticastStreamingResponse'));
};
/**
* This command stop multicast streaming using a specified media profile of a device
*/
ONVIFMedia.StopMulticastStreaming = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:StopMulticastStreaming')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:StopMulticastStreamingResponse'));
};
/**
* Synchronization points allow clients to decode and correctly use all data after the
* synchronization point.
* For example, if a video stream is configured with a large I-frame distance and a client loses a
* single packet, the client does not display video until the next I-frame is transmitted. In such
* cases, the client can request a Synchronization Point which enforces the device to add an I-Frame as soon as possible. Clients can request Synchronization Points for profiles. The device
* shall add synchronization points for all streams associated with this profile.
* Similarly, a synchronization point is used to get an update on full PTZ or event status through
* the metadata stream.
* If a video stream is associated with the profile, an I-frame shall be added to this video stream.
* If a PTZ metadata stream is associated to the profile,
* the PTZ position shall be repeated within the metadata stream.
*/
ONVIFMedia.SetSynchronizationPoint = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetSynchronizationPoint')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:SetSynchronizationPointResponse'));
};
/**
* A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the
* device. The returned URI shall remain valid indefinitely even if the profile is changed. The
* ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set accordingly
* (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S). The URI can be used for
* acquiring a JPEG image through a HTTP GET operation. The image encoding will always be
* JPEG regardless of the encoding setting in the media profile. The Jpeg settings
* (like resolution or quality) may be taken from the profile if suitable. The provided
* image will be updated automatically and independent from calls to GetSnapshotUri.
*/
ONVIFMedia.GetSnapshotUri = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetSnapshotUri')({ trt_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('trt:GetSnapshotUriResponse'));
};
/**
* A device returns the information for current video source mode and settable video source modes of specified video source. A device that indicates a capability of VideoSourceModes shall support this command.
*/
ONVIFMedia.GetVideoSourceModes = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetVideoSourceModes')({ trt_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('trt:GetVideoSourceModesResponse'));
};
/**
* SetVideoSourceMode changes the media profile structure relating to video source for the specified video source mode. A device that indicates a capability of VideoSourceModes shall support this command. The behavior after changing the mode is not defined in this specification.
*/
ONVIFMedia.SetVideoSourceMode = function (VideoSourceToken, VideoSourceModeToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetVideoSourceMode')({ trt_VideoSourceToken: VideoSourceToken, trt_VideoSourceModeToken: VideoSourceModeToken }))
.map(mapResponseXmlToJson('trt:SetVideoSourceModeResponse'));
};
/**
* Get the OSDs.
*/
ONVIFMedia.GetOSDs = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetOSDs')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetOSDsResponse'));
};
/**
* Get the OSD.
*/
ONVIFMedia.GetOSD = function (OSDToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetOSD')({ trt_OSDToken: OSDToken }))
.map(mapResponseXmlToJson('trt:GetOSDResponse'));
};
/**
* Get the OSD Options.
*/
ONVIFMedia.GetOSDOptions = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:GetOSDOptions')({ trt_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('trt:GetOSDOptionsResponse'));
};
/**
* Set the OSD
*/
ONVIFMedia.SetOSD = function (OSD) {
return createStandardRequestBodyFromString(generateRequestElements('trt:SetOSD')({ trt_OSD: OSD }))
.map(mapResponseXmlToJson('trt:SetOSDResponse'));
};
/**
* Create the OSD.
*/
ONVIFMedia.CreateOSD = function (OSD) {
return createStandardRequestBodyFromString(generateRequestElements('trt:CreateOSD')({ trt_OSD: OSD }))
.map(mapResponseXmlToJson('trt:CreateOSDResponse'));
};
/**
* Delete the OSD.
*/
ONVIFMedia.DeleteOSD = function (OSDToken) {
return createStandardRequestBodyFromString(generateRequestElements('trt:DeleteOSD')({ trt_OSDToken: OSDToken }))
.map(mapResponseXmlToJson('trt:DeleteOSDResponse'));
};
/**
* Returns the capabilities of the media service. The result is returned in a typed answer.
*/
ONVIFMedia.prototype.GetServiceCapabilities = function () {
return ONVIFMedia.GetServiceCapabilities().run(this.config);
};
/**
* This command lists all available physical video inputs of the device.
*/
ONVIFMedia.prototype.GetVideoSources = function () {
return ONVIFMedia.GetVideoSources().run(this.config);
};
/**
* This command lists all available physical audio inputs of the device.
*/
ONVIFMedia.prototype.GetAudioSources = function () {
return ONVIFMedia.GetAudioSources().run(this.config);
};
/**
* This command lists all available physical audio outputs of the device.
*/
ONVIFMedia.prototype.GetAudioOutputs = function () {
return ONVIFMedia.GetAudioOutputs().run(this.config);
};
/**
* This operation creates a new empty media profile. The media profile shall be created in the
* device and shall be persistent (remain after reboot). A created profile shall be deletable and a device shall set the “fixed” attribute to false in the
* returned Profile.
*/
ONVIFMedia.prototype.CreateProfile = function (Name, Token) {
return ONVIFMedia.CreateProfile(Name, Token).run(this.config);
};
/**
* If the profile token is already known, a profile can be fetched through the GetProfile command.
*/
ONVIFMedia.prototype.GetProfile = function (ProfileToken) {
return ONVIFMedia.GetProfile(ProfileToken).run(this.config);
};
/**
* Any endpoint can ask for the existing media profiles of a device using the GetProfiles
* command. Pre-configured or dynamically configured profiles can be retrieved using this
* command. This command lists all configured profiles in a device. The client does not need to
* know the media profile in order to use the command.
*/
ONVIFMedia.prototype.GetProfiles = function () {
return ONVIFMedia.GetProfiles().run(this.config);
};
/**
* This operation adds a VideoEncoderConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
* support adding a compatible VideoEncoderConfiguration to a Profile containing a VideoSourceConfiguration and shall
* support streaming video data of such a profile.
*
*/
ONVIFMedia.prototype.AddVideoEncoderConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddVideoEncoderConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes a VideoEncoderConfiguration from an existing media profile. If the
* media profile does not contain a VideoEncoderConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveVideoEncoderConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveVideoEncoderConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds a VideoSourceConfiguration to an existing media profile. If such a
* configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.prototype.AddVideoSourceConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddVideoSourceConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes a VideoSourceConfiguration from an existing media profile. If the
* media profile does not contain a VideoSourceConfiguration, the operation has no effect. The removal shall be persistent. Video source configurations should only be removed after removing a
* VideoEncoderConfiguration from the media profile.
*/
ONVIFMedia.prototype.RemoveVideoSourceConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveVideoSourceConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds an AudioEncoderConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. A device shall
* support adding a compatible AudioEncoderConfiguration to a profile containing an AudioSourceConfiguration and shall
* support streaming audio data of such a profile.
*
*/
ONVIFMedia.prototype.AddAudioEncoderConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddAudioEncoderConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes an AudioEncoderConfiguration from an existing media profile. If the
* media profile does not contain an AudioEncoderConfiguration, the operation has no effect.
* The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveAudioEncoderConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveAudioEncoderConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds an AudioSourceConfiguration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.prototype.AddAudioSourceConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddAudioSourceConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes an AudioSourceConfiguration from an existing media profile. If the
* media profile does not contain an AudioSourceConfiguration, the operation has no effect. The
* removal shall be persistent. Audio source configurations should only be removed after removing an
* AudioEncoderConfiguration from the media profile.
*/
ONVIFMedia.prototype.RemoveAudioSourceConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveAudioSourceConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds a PTZConfiguration to an existing media profile. If a configuration exists
* in the media profile, it will be replaced. The change shall be persistent. Adding a PTZConfiguration to a media profile means that streams using that media profile can
* contain PTZ status (in the metadata), and that the media profile can be used for controlling
* PTZ movement.
*/
ONVIFMedia.prototype.AddPTZConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddPTZConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes a PTZConfiguration from an existing media profile. If the media profile
* does not contain a PTZConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.prototype.RemovePTZConfiguration = function (ProfileToken) {
return ONVIFMedia.RemovePTZConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds a VideoAnalytics configuration to an existing media profile. If a
* configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a VideoAnalyticsConfiguration to a media profile means that streams using that media
* profile can contain video analytics data (in the metadata) as defined by the submitted configuration reference. A profile containing only a video analytics configuration but no video source configuration is incomplete. Therefore, a client should first add a video source configuration to a profile before adding a video analytics configuration. The device can deny adding of a video analytics
* configuration before a video source configuration.
*/
ONVIFMedia.prototype.AddVideoAnalyticsConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddVideoAnalyticsConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes a VideoAnalyticsConfiguration from an existing media profile. If the media profile does not contain a VideoAnalyticsConfiguration, the operation has no effect.
* The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveVideoAnalyticsConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveVideoAnalyticsConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds a Metadata configuration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent. Adding a MetadataConfiguration to a Profile means that streams using that profile contain metadata. Metadata can consist of events, PTZ status, and/or video analytics data.
*/
ONVIFMedia.prototype.AddMetadataConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddMetadataConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes a MetadataConfiguration from an existing media profile. If the media profile does not contain a MetadataConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveMetadataConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveMetadataConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds an AudioOutputConfiguration to an existing media profile. If a configuration exists in the media profile, it will be replaced. The change shall be persistent.
*/
ONVIFMedia.prototype.AddAudioOutputConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddAudioOutputConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes an AudioOutputConfiguration from an existing media profile. If the media profile does not contain an AudioOutputConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveAudioOutputConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveAudioOutputConfiguration(ProfileToken).run(this.config);
};
/**
* This operation adds an AudioDecoderConfiguration to an existing media profile. If a configuration exists in the media profile, it shall be replaced. The change shall be persistent.
*/
ONVIFMedia.prototype.AddAudioDecoderConfiguration = function (ProfileToken, ConfigurationToken) {
return ONVIFMedia.AddAudioDecoderConfiguration(ProfileToken, ConfigurationToken).run(this.config);
};
/**
* This operation removes an AudioDecoderConfiguration from an existing media profile. If the media profile does not contain an AudioDecoderConfiguration, the operation has no effect. The removal shall be persistent.
*/
ONVIFMedia.prototype.RemoveAudioDecoderConfiguration = function (ProfileToken) {
return ONVIFMedia.RemoveAudioDecoderConfiguration(ProfileToken).run(this.config);
};
/**
* This operation deletes a profile. This change shall always be persistent. Deletion of a profile is only possible for non-fixed profiles
*/
ONVIFMedia.prototype.DeleteProfile = function (ProfileToken) {
return ONVIFMedia.DeleteProfile(ProfileToken).run(this.config);
};
/**
* This operation lists all existing video source configurations for a device. The client need not know anything about the video source configurations in order to use the command.
*/
ONVIFMedia.prototype.GetVideoSourceConfigurations = function () {
return ONVIFMedia.GetVideoSourceConfigurations().run(this.config);
};
/**
* This operation lists all existing video encoder configurations of a device. This command lists all configured video encoder configurations in a device. The client need not know anything apriori about the video encoder configurations in order to use the command.
*/
ONVIFMedia.prototype.GetVideoEncoderConfigurations = function () {
return ONVIFMedia.GetVideoEncoderConfigurations().run(this.config);
};
/**
* This operation lists all existing audio source configurations of a device. This command lists all audio source configurations in a device. The client need not know anything apriori about the audio source configurations in order to use the command.
*/
ONVIFMedia.prototype.GetAudioSourceConfigurations = function () {
return ONVIFMedia.GetAudioSourceConfigurations().run(this.config);
};
/**
* This operation lists all existing device audio encoder configurations. The client need not know anything apriori about the audio encoder configurations in order to use the command.
*/
ONVIFMedia.prototype.GetAudioEncoderConfigurations = function () {
return ONVIFMedia.GetAudioEncoderConfigurations().run(this.config);
};
/**
* This operation lists all video analytics configurations of a device. This command lists all configured video analytics in a device. The client need not know anything apriori about the video analytics in order to use the command.
*/
ONVIFMedia.prototype.GetVideoAnalyticsConfigurations = function () {
return ONVIFMedia.GetVideoAnalyticsConfigurations().run(this.config);
};
/**
* This operation lists all existing metadata configurations. The client need not know anything apriori about the metadata in order to use the command.
*/
ONVIFMedia.prototype.GetMetadataConfigurations = function () {
return ONVIFMedia.GetMetadataConfigurations().run(this.config);
};
/**
* This command lists all existing AudioOutputConfigurations of a device. The NVC need not know anything apriori about the audio configurations to use this command.
*/
ONVIFMedia.prototype.GetAudioOutputConfigurations = function () {
return ONVIFMedia.GetAudioOutputConfigurations().run(this.config);
};
/**
* This command lists all existing AudioDecoderConfigurations of a device. The NVC need not know anything apriori about the audio decoder configurations in order to
* use this command.
*/
ONVIFMedia.prototype.GetAudioDecoderConfigurations = function () {
return ONVIFMedia.GetAudioDecoderConfigurations().run(this.config);
};
/**
* If the video source configuration token is already known, the video source configuration can be fetched through the GetVideoSourceConfiguration command.
*/
ONVIFMedia.prototype.GetVideoSourceConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetVideoSourceConfiguration(ConfigurationToken).run(this.config);
};
/**
* If the video encoder configuration token is already known, the encoder configuration can be fetched through the GetVideoEncoderConfiguration command.
*/
ONVIFMedia.prototype.GetVideoEncoderConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetVideoEncoderConfiguration(ConfigurationToken).run(this.config);
};
/**
* The GetAudioSourceConfiguration command fetches the audio source configurations if the audio source configuration token is already known. An
*/
ONVIFMedia.prototype.GetAudioSourceConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetAudioSourceConfiguration(ConfigurationToken).run(this.config);
};
/**
* The GetAudioEncoderConfiguration command fetches the encoder configuration if the audio encoder configuration token is known.
*/
ONVIFMedia.prototype.GetAudioEncoderConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetAudioEncoderConfiguration(ConfigurationToken).run(this.config);
};
/**
* The GetVideoAnalyticsConfiguration command fetches the video analytics configuration if the video analytics token is known.
*/
ONVIFMedia.prototype.GetVideoAnalyticsConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetVideoAnalyticsConfiguration(ConfigurationToken).run(this.config);
};
/**
* The GetMetadataConfiguration command fetches the metadata configuration if the metadata token is known.
*/
ONVIFMedia.prototype.GetMetadataConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetMetadataConfiguration(ConfigurationToken).run(this.config);
};
/**
* If the audio output configuration token is already known, the output configuration can be fetched through the GetAudioOutputConfiguration command.
*/
ONVIFMedia.prototype.GetAudioOutputConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetAudioOutputConfiguration(ConfigurationToken).run(this.config);
};
/**
* If the audio decoder configuration token is already known, the decoder configuration can be fetched through the GetAudioDecoderConfiguration command.
*/
ONVIFMedia.prototype.GetAudioDecoderConfiguration = function (ConfigurationToken) {
return ONVIFMedia.GetAudioDecoderConfiguration(ConfigurationToken).run(this.config);
};
/**
* This operation lists all the video encoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoEncoderConfiguration command on the media profile. The result will vary depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleVideoEncoderConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleVideoEncoderConfigurations(ProfileToken).run(this.config);
};
/**
* This operation requests all the video source configurations of the device that are compatible
* with a certain media profile. Each of the returned configurations shall be a valid input
* parameter for the AddVideoSourceConfiguration command on the media profile. The result
* will vary depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleVideoSourceConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleVideoSourceConfigurations(ProfileToken).run(this.config);
};
/**
* This operation requests all audio encoder configurations of a device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioSourceConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleAudioEncoderConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleAudioEncoderConfigurations(ProfileToken).run(this.config);
};
/**
* This operation requests all audio source configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioEncoderConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleAudioSourceConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleAudioSourceConfigurations(ProfileToken).run(this.config);
};
/**
* This operation requests all video analytic configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddVideoAnalyticsConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleVideoAnalyticsConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleVideoAnalyticsConfigurations(ProfileToken).run(this.config);
};
/**
* This operation requests all the metadata configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddMetadataConfiguration command on the media profile. The result varies depending on the capabilities, configurations and settings in the device.
*/
ONVIFMedia.prototype.GetCompatibleMetadataConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleMetadataConfigurations(ProfileToken).run(this.config);
};
/**
* This command lists all audio output configurations of a device that are compatible with a certain media profile. Each returned configuration shall be a valid input for the
* AddAudioOutputConfiguration command.
*/
ONVIFMedia.prototype.GetCompatibleAudioOutputConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleAudioOutputConfigurations(ProfileToken).run(this.config);
};
/**
* This operation lists all the audio decoder configurations of the device that are compatible with a certain media profile. Each of the returned configurations shall be a valid input parameter for the AddAudioDecoderConfiguration command on the media profile.
*/
ONVIFMedia.prototype.GetCompatibleAudioDecoderConfigurations = function (ProfileToken) {
return ONVIFMedia.GetCompatibleAudioDecoderConfigurations(ProfileToken).run(this.config);
};
/**
* This operation modifies a video source configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification.
*/
ONVIFMedia.prototype.SetVideoSourceConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetVideoSourceConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies a video encoder configuration. The ForcePersistence flag indicates if the changes shall remain after reboot of the device. Changes in the Multicast settings shall always be persistent. Running streams using this configuration may be immediately updated according to the new settings. The changes are not guaranteed to take effect unless the client requests a new stream URI and restarts any affected stream. NVC methods for changing a running stream are out of scope for this specification. SessionTimeout is provided as a hint for keeping rtsp session by a device. If necessary the device may adapt parameter values for SessionTimeout elements without returning an error. For the time between keep alive calls the client shall adhere to the timeout value signaled via RTSP.
*/
ONVIFMedia.prototype.SetVideoEncoderConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetVideoEncoderConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies an audio source configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device. Running streams using this configuration
* may be immediately updated according to the new settings. The changes are not guaranteed
* to take effect unless the client requests a new stream URI and restarts any affected stream
* NVC methods for changing a running stream are out of scope for this specification.
*/
ONVIFMedia.prototype.SetAudioSourceConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetAudioSourceConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies an audio encoder configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device. Running streams using this configuration may be immediately updated
* according to the new settings. The changes are not guaranteed to take effect unless the client
* requests a new stream URI and restarts any affected streams. NVC methods for changing a
* running stream are out of scope for this specification.
*/
ONVIFMedia.prototype.SetAudioEncoderConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetAudioEncoderConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* A video analytics configuration is modified using this command. The ForcePersistence flag
* indicates if the changes shall remain after reboot of the device or not. Running streams using
* this configuration shall be immediately updated according to the new settings. Otherwise
* inconsistencies can occur between the scene description processed by the rule engine and
* the notifications produced by analytics engine and rule engine which reference the very same
* video analytics configuration token.
*/
ONVIFMedia.prototype.SetVideoAnalyticsConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetVideoAnalyticsConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies a metadata configuration. The ForcePersistence flag indicates if the
* changes shall remain after reboot of the device. Changes in the Multicast settings shall
* always be persistent. Running streams using this configuration may be updated immediately
* according to the new settings. The changes are not guaranteed to take effect unless the client
* requests a new stream URI and restarts any affected streams. NVC methods for changing a
* running stream are out of scope for this specification.
*/
ONVIFMedia.prototype.SetMetadataConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetMetadataConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies an audio output configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device.
*/
ONVIFMedia.prototype.SetAudioOutputConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetAudioOutputConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation modifies an audio decoder configuration. The ForcePersistence flag indicates if
* the changes shall remain after reboot of the device.
*/
ONVIFMedia.prototype.SetAudioDecoderConfiguration = function (Configuration, ForcePersistence) {
return ONVIFMedia.SetAudioDecoderConfiguration(Configuration, ForcePersistence).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for video source configuration parameters) when the video source parameters are
* reconfigured If a video source configuration is specified, the options shall concern that
* particular configuration. If a media profile is specified, the options shall be compatible with
* that media profile.
*/
ONVIFMedia.prototype.GetVideoSourceConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetVideoSourceConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for video encoder
* configuration parameters) when the video encoder parameters are reconfigured.
* For JPEG, MPEG4 and H264 extension elements have been defined that provide additional information. A device must provide the
* XxxOption information for all encodings supported and should additionally provide the corresponding XxxOption2 information.
* This response contains the available video encoder configuration options. If a video encoder configuration is specified,
* the options shall concern that particular configuration. If a media profile is specified, the options shall be
* compatible with that media profile. If no tokens are specified, the options shall be considered generic for the device.
*
*/
ONVIFMedia.prototype.GetVideoEncoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetVideoEncoderConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for audio source configuration parameters) when the audio source parameters are
* reconfigured. If an audio source configuration is specified, the options shall concern that
* particular configuration. If a media profile is specified, the options shall be compatible with
* that media profile.
*/
ONVIFMedia.prototype.GetAudioSourceConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetAudioSourceConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for audio encoder configuration parameters) when the audio encoder parameters are
* reconfigured.
*/
ONVIFMedia.prototype.GetAudioEncoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetAudioEncoderConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for metadata configuration parameters) for changing the metadata configuration.
*/
ONVIFMedia.prototype.GetMetadataConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetMetadataConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This operation returns the available options (supported values and ranges for audio output configuration parameters) for configuring an audio output.
*/
ONVIFMedia.prototype.GetAudioOutputConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetAudioOutputConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* This command list the audio decoding capabilities for a given profile and configuration of a
* device.
*/
ONVIFMedia.prototype.GetAudioDecoderConfigurationOptions = function (ConfigurationToken, ProfileToken) {
return ONVIFMedia.GetAudioDecoderConfigurationOptions(ConfigurationToken, ProfileToken).run(this.config);
};
/**
* The GetGuaranteedNumberOfVideoEncoderInstances command can be used to request the
* minimum number of guaranteed video encoder instances (applications) per Video Source
* Configuration.
*/
ONVIFMedia.prototype.GetGuaranteedNumberOfVideoEncoderInstances = function (ConfigurationToken) {
return ONVIFMedia.GetGuaranteedNumberOfVideoEncoderInstances(ConfigurationToken).run(this.config);
};
/**
* This operation requests a URI that can be used to initiate a live media stream using RTSP as
* the control protocol. The returned URI shall remain valid indefinitely even if the profile is
* changed. The ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set
* accordingly (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S).
* The correct syntax for the StreamSetup element for these media stream setups defined in 5.1.1 of the streaming specification are as follows:
*
* RTP unicast over UDP: StreamType = "RTP_unicast", TransportProtocol = "UDP"
* RTP over RTSP over HTTP over TCP: StreamType = "RTP_unicast", TransportProtocol = "HTTP"
* RTP over RTSP over TCP: StreamType = "RTP_unicast", TransportProtocol = "RTSP"
*
*
* If a multicast stream is requested at least one of VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration shall have a valid multicast setting.
* For full compatibility with other ONVIF services a device should not generate Uris longer than
* 128 octets.
*/
ONVIFMedia.prototype.GetStreamUri = function (StreamSetup, ProfileToken) {
return ONVIFMedia.GetStreamUri(StreamSetup, ProfileToken).run(this.config);
};
/**
* This command starts multicast streaming using a specified media profile of a device.
* Streaming continues until StopMulticastStreaming is called for the same Profile. The
* streaming shall continue after a reboot of the device until a StopMulticastStreaming request is
* received. The multicast address, port and TTL are configured in the
* VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration
* respectively.
*/
ONVIFMedia.prototype.StartMulticastStreaming = function (ProfileToken) {
return ONVIFMedia.StartMulticastStreaming(ProfileToken).run(this.config);
};
/**
* This command stop multicast streaming using a specified media profile of a device
*/
ONVIFMedia.prototype.StopMulticastStreaming = function (ProfileToken) {
return ONVIFMedia.StopMulticastStreaming(ProfileToken).run(this.config);
};
/**
* Synchronization points allow clients to decode and correctly use all data after the
* synchronization point.
* For example, if a video stream is configured with a large I-frame distance and a client loses a
* single packet, the client does not display video until the next I-frame is transmitted. In such
* cases, the client can request a Synchronization Point which enforces the device to add an I-Frame as soon as possible. Clients can request Synchronization Points for profiles. The device
* shall add synchronization points for all streams associated with this profile.
* Similarly, a synchronization point is used to get an update on full PTZ or event status through
* the metadata stream.
* If a video stream is associated with the profile, an I-frame shall be added to this video stream.
* If a PTZ metadata stream is associated to the profile,
* the PTZ position shall be repeated within the metadata stream.
*/
ONVIFMedia.prototype.SetSynchronizationPoint = function (ProfileToken) {
return ONVIFMedia.SetSynchronizationPoint(ProfileToken).run(this.config);
};
/**
* A client uses the GetSnapshotUri command to obtain a JPEG snapshot from the
* device. The returned URI shall remain valid indefinitely even if the profile is changed. The
* ValidUntilConnect, ValidUntilReboot and Timeout Parameter shall be set accordingly
* (ValidUntilConnect=false, ValidUntilReboot=false, timeout=PT0S). The URI can be used for
* acquiring a JPEG image through a HTTP GET operation. The image encoding will always be
* JPEG regardless of the encoding setting in the media profile. The Jpeg settings
* (like resolution or quality) may be taken from the profile if suitable. The provided
* image will be updated automatically and independent from calls to GetSnapshotUri.
*/
ONVIFMedia.prototype.GetSnapshotUri = function (ProfileToken) {
return ONVIFMedia.GetSnapshotUri(ProfileToken).run(this.config);
};
/**
* A device returns the information for current video source mode and settable video source modes of specified video source. A device that indicates a capability of VideoSourceModes shall support this command.
*/
ONVIFMedia.prototype.GetVideoSourceModes = function (VideoSourceToken) {
return ONVIFMedia.GetVideoSourceModes(VideoSourceToken).run(this.config);
};
/**
* SetVideoSourceMode changes the media profile structure relating to video source for the specified video source mode. A device that indicates a capability of VideoSourceModes shall support this command. The behavior after changing the mode is not defined in this specification.
*/
ONVIFMedia.prototype.SetVideoSourceMode = function (VideoSourceToken, VideoSourceModeToken) {
return ONVIFMedia.SetVideoSourceMode(VideoSourceToken, VideoSourceModeToken).run(this.config);
};
/**
* Get the OSDs.
*/
ONVIFMedia.prototype.GetOSDs = function (ConfigurationToken) {
return ONVIFMedia.GetOSDs(ConfigurationToken).run(this.config);
};
/**
* Get the OSD.
*/
ONVIFMedia.prototype.GetOSD = function (OSDToken) {
return ONVIFMedia.GetOSD(OSDToken).run(this.config);
};
/**
* Get the OSD Options.
*/
ONVIFMedia.prototype.GetOSDOptions = function (ConfigurationToken) {
return ONVIFMedia.GetOSDOptions(ConfigurationToken).run(this.config);
};
/**
* Set the OSD
*/
ONVIFMedia.prototype.SetOSD = function (OSD) {
return ONVIFMedia.SetOSD(OSD).run(this.config);
};
/**
* Create the OSD.
*/
ONVIFMedia.prototype.CreateOSD = function (OSD) {
return ONVIFMedia.CreateOSD(OSD).run(this.config);
};
/**
* Delete the OSD.
*/
ONVIFMedia.prototype.DeleteOSD = function (OSDToken) {
return ONVIFMedia.DeleteOSD(OSDToken).run(this.config);
};
return ONVIFMedia;
}());
var ONVIFAnalytics = /** @class */ (function () {
function ONVIFAnalytics(config) {
this.config = config;
}
/**
*
* List all rules that are supported by the given VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.GetSupportedRules = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetSupportedRules')({ tan_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('tan:GetSupportedRulesResponse'));
};
/**
*
* Add one or more rules to an existing VideoAnalyticsConfiguration.
* The available supported types can be retrieved via GetSupportedRules,
* where the Name of the supported rule correspond to the type of an rule instance.
* Pass unique module names which can be later used as reference.
* The Parameters of the rules must match those of the corresponding description.
*
* Although this method is mandatory a device implementation must not support adding rules.
* Instead it can provide a fixed set of predefined configurations via the media service function
* GetCompatibleVideoAnalyticsConfigurations.
*
*/
ONVIFAnalytics.CreateRules = function (ConfigurationToken, Rule) {
return createStandardRequestBodyFromString(generateRequestElements('tan:CreateRules')({ tan_ConfigurationToken: ConfigurationToken, tan_Rule: Rule }))
.map(mapResponseXmlToJson('tan:CreateRulesResponse'));
};
/**
*
* Remove one or more rules from a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.DeleteRules = function (ConfigurationToken, RuleName) {
return createStandardRequestBodyFromString(generateRequestElements('tan:DeleteRules')({ tan_ConfigurationToken: ConfigurationToken, tan_RuleName: RuleName }))
.map(mapResponseXmlToJson('tan:DeleteRulesResponse'));
};
/**
*
* List the currently assigned set of rules of a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.GetRules = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetRules')({ tan_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('tan:GetRulesResponse'));
};
/**
*
* Return the options for the supported rules that specify an Option attribute.
*
*/
ONVIFAnalytics.GetRuleOptions = function (ConfigurationToken, RuleType) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetRuleOptions')({ tan_ConfigurationToken: ConfigurationToken, tan_RuleType: RuleType }))
.map(mapResponseXmlToJson('tan:GetRuleOptionsResponse'));
};
/**
*
* Modify one or more rules of a VideoAnalyticsConfiguration. The rules are referenced by their names.
*
*/
ONVIFAnalytics.ModifyRules = function (ConfigurationToken, Rule) {
return createStandardRequestBodyFromString(generateRequestElements('tan:ModifyRules')({ tan_ConfigurationToken: ConfigurationToken, tan_Rule: Rule }))
.map(mapResponseXmlToJson('tan:ModifyRulesResponse'));
};
/**
* Returns the capabilities of the analytics service. The result is returned in a typed answer.
*/
ONVIFAnalytics.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tan:GetServiceCapabilitiesResponse'));
};
/**
*
* List all analytics modules that are supported by the given VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.GetSupportedAnalyticsModules = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetSupportedAnalyticsModules')({ tan_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('tan:GetSupportedAnalyticsModulesResponse'));
};
/**
*
* Return the options for the supported analytics modules that specify an Option attribute.
*
*/
ONVIFAnalytics.GetAnalyticsModuleOptions = function (ConfigurationToken, Type) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetAnalyticsModuleOptions')({ tan_ConfigurationToken: ConfigurationToken, tan_Type: Type }))
.map(mapResponseXmlToJson('tan:GetAnalyticsModuleOptionsResponse'));
};
/**
*
* Add one or more analytics modules to an existing VideoAnalyticsConfiguration.
* The available supported types can be retrieved via GetSupportedAnalyticsModules,
* where the Name of the supported AnalyticsModules correspond to the type of an AnalyticsModule instance.
* Pass unique module names which can be later used as reference. The Parameters of the analytics module must match those of the corresponding AnalyticsModuleDescription.
*
* Although this method is mandatory a device implementation may not support adding modules.
* Instead it can provide a fixed set of predefined configurations via the media service functions
* GetCompatibleVideoAnalyticsConfigurations and
* GetAnalyticsConfigurations.
*
* The device shall ensure that a corresponding analytics engine starts operation when a client
* subscribes directly or indirectly for events produced by the analytics or rule engine or when a
* client requests the corresponding scene description stream.
* An analytics module must be attached to a Video source using the media profiles before it can be used.
* In case differing analytics configurations are attached to the same profile it is undefined which
* of the analytics module configuration becomes active if no stream is activated or multiple streams
* with different profiles are activated at the same time.
*
*/
ONVIFAnalytics.CreateAnalyticsModules = function (ConfigurationToken, AnalyticsModule) {
return createStandardRequestBodyFromString(generateRequestElements('tan:CreateAnalyticsModules')({ tan_ConfigurationToken: ConfigurationToken, tan_AnalyticsModule: AnalyticsModule }))
.map(mapResponseXmlToJson('tan:CreateAnalyticsModulesResponse'));
};
/**
*
* Remove one or more analytics modules from a VideoAnalyticsConfiguration referenced by their names.
*
*/
ONVIFAnalytics.DeleteAnalyticsModules = function (ConfigurationToken, AnalyticsModuleName) {
return createStandardRequestBodyFromString(generateRequestElements('tan:DeleteAnalyticsModules')({ tan_ConfigurationToken: ConfigurationToken, tan_AnalyticsModuleName: AnalyticsModuleName }))
.map(mapResponseXmlToJson('tan:DeleteAnalyticsModulesResponse'));
};
/**
*
* List the currently assigned set of analytics modules of a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.GetAnalyticsModules = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetAnalyticsModules')({ tan_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('tan:GetAnalyticsModulesResponse'));
};
/**
*
* Modify the settings of one or more analytics modules of a VideoAnalyticsConfiguration. The modules are referenced by their names.
* It is allowed to pass only a subset to be modified.
*
*/
ONVIFAnalytics.ModifyAnalyticsModules = function (ConfigurationToken, AnalyticsModule) {
return createStandardRequestBodyFromString(generateRequestElements('tan:ModifyAnalyticsModules')({ tan_ConfigurationToken: ConfigurationToken, tan_AnalyticsModule: AnalyticsModule }))
.map(mapResponseXmlToJson('tan:ModifyAnalyticsModulesResponse'));
};
/**
*
* This method provides a computer readable description of the metadata that the selected analytics modules can generate.
* The type parameter allows to select a single analytics module. By default the output shall relate to all analytics modules that exist in the device.
* The response shall provide a sample XML frame.
* The sample frame shall include all potentially generated elements by the selected analytics modules.
* Note that this e.g. does not need to include all possible class type enumerations.
*
*/
ONVIFAnalytics.GetSupportedMetadata = function (Type) {
return createStandardRequestBodyFromString(generateRequestElements('tan:GetSupportedMetadata')({ tan_Type: Type }))
.map(mapResponseXmlToJson('tan:GetSupportedMetadataResponse'));
};
/**
*
* List all rules that are supported by the given VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.prototype.GetSupportedRules = function (ConfigurationToken) {
return ONVIFAnalytics.GetSupportedRules(ConfigurationToken).run(this.config);
};
/**
*
* Add one or more rules to an existing VideoAnalyticsConfiguration.
* The available supported types can be retrieved via GetSupportedRules,
* where the Name of the supported rule correspond to the type of an rule instance.
* Pass unique module names which can be later used as reference.
* The Parameters of the rules must match those of the corresponding description.
*
* Although this method is mandatory a device implementation must not support adding rules.
* Instead it can provide a fixed set of predefined configurations via the media service function
* GetCompatibleVideoAnalyticsConfigurations.
*
*/
ONVIFAnalytics.prototype.CreateRules = function (ConfigurationToken, Rule) {
return ONVIFAnalytics.CreateRules(ConfigurationToken, Rule).run(this.config);
};
/**
*
* Remove one or more rules from a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.prototype.DeleteRules = function (ConfigurationToken, RuleName) {
return ONVIFAnalytics.DeleteRules(ConfigurationToken, RuleName).run(this.config);
};
/**
*
* List the currently assigned set of rules of a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.prototype.GetRules = function (ConfigurationToken) {
return ONVIFAnalytics.GetRules(ConfigurationToken).run(this.config);
};
/**
*
* Return the options for the supported rules that specify an Option attribute.
*
*/
ONVIFAnalytics.prototype.GetRuleOptions = function (ConfigurationToken, RuleType) {
return ONVIFAnalytics.GetRuleOptions(ConfigurationToken, RuleType).run(this.config);
};
/**
*
* Modify one or more rules of a VideoAnalyticsConfiguration. The rules are referenced by their names.
*
*/
ONVIFAnalytics.prototype.ModifyRules = function (ConfigurationToken, Rule) {
return ONVIFAnalytics.ModifyRules(ConfigurationToken, Rule).run(this.config);
};
/**
* Returns the capabilities of the analytics service. The result is returned in a typed answer.
*/
ONVIFAnalytics.prototype.GetServiceCapabilities = function () {
return ONVIFAnalytics.GetServiceCapabilities().run(this.config);
};
/**
*
* List all analytics modules that are supported by the given VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.prototype.GetSupportedAnalyticsModules = function (ConfigurationToken) {
return ONVIFAnalytics.GetSupportedAnalyticsModules(ConfigurationToken).run(this.config);
};
/**
*
* Return the options for the supported analytics modules that specify an Option attribute.
*
*/
ONVIFAnalytics.prototype.GetAnalyticsModuleOptions = function (ConfigurationToken, Type) {
return ONVIFAnalytics.GetAnalyticsModuleOptions(ConfigurationToken, Type).run(this.config);
};
/**
*
* Add one or more analytics modules to an existing VideoAnalyticsConfiguration.
* The available supported types can be retrieved via GetSupportedAnalyticsModules,
* where the Name of the supported AnalyticsModules correspond to the type of an AnalyticsModule instance.
* Pass unique module names which can be later used as reference. The Parameters of the analytics module must match those of the corresponding AnalyticsModuleDescription.
*
* Although this method is mandatory a device implementation may not support adding modules.
* Instead it can provide a fixed set of predefined configurations via the media service functions
* GetCompatibleVideoAnalyticsConfigurations and
* GetAnalyticsConfigurations.
*
* The device shall ensure that a corresponding analytics engine starts operation when a client
* subscribes directly or indirectly for events produced by the analytics or rule engine or when a
* client requests the corresponding scene description stream.
* An analytics module must be attached to a Video source using the media profiles before it can be used.
* In case differing analytics configurations are attached to the same profile it is undefined which
* of the analytics module configuration becomes active if no stream is activated or multiple streams
* with different profiles are activated at the same time.
*
*/
ONVIFAnalytics.prototype.CreateAnalyticsModules = function (ConfigurationToken, AnalyticsModule) {
return ONVIFAnalytics.CreateAnalyticsModules(ConfigurationToken, AnalyticsModule).run(this.config);
};
/**
*
* Remove one or more analytics modules from a VideoAnalyticsConfiguration referenced by their names.
*
*/
ONVIFAnalytics.prototype.DeleteAnalyticsModules = function (ConfigurationToken, AnalyticsModuleName) {
return ONVIFAnalytics.DeleteAnalyticsModules(ConfigurationToken, AnalyticsModuleName).run(this.config);
};
/**
*
* List the currently assigned set of analytics modules of a VideoAnalyticsConfiguration.
*
*/
ONVIFAnalytics.prototype.GetAnalyticsModules = function (ConfigurationToken) {
return ONVIFAnalytics.GetAnalyticsModules(ConfigurationToken).run(this.config);
};
/**
*
* Modify the settings of one or more analytics modules of a VideoAnalyticsConfiguration. The modules are referenced by their names.
* It is allowed to pass only a subset to be modified.
*
*/
ONVIFAnalytics.prototype.ModifyAnalyticsModules = function (ConfigurationToken, AnalyticsModule) {
return ONVIFAnalytics.ModifyAnalyticsModules(ConfigurationToken, AnalyticsModule).run(this.config);
};
/**
*
* This method provides a computer readable description of the metadata that the selected analytics modules can generate.
* The type parameter allows to select a single analytics module. By default the output shall relate to all analytics modules that exist in the device.
* The response shall provide a sample XML frame.
* The sample frame shall include all potentially generated elements by the selected analytics modules.
* Note that this e.g. does not need to include all possible class type enumerations.
*
*/
ONVIFAnalytics.prototype.GetSupportedMetadata = function (Type) {
return ONVIFAnalytics.GetSupportedMetadata(Type).run(this.config);
};
return ONVIFAnalytics;
}());
var ONVIFDisplay = /** @class */ (function () {
function ONVIFDisplay(config) {
this.config = config;
}
/**
* Returns the capabilities of the display service. The result is returned in a typed answer.
*/
ONVIFDisplay.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tls:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tls:GetServiceCapabilitiesResponse'));
};
/**
* Return the current layout of a video output. The Layout assigns a pane configuration to a certain area of the display. The layout settings
* directly affect a specific video output. The layout consists of a list of PaneConfigurations and
* their associated display areas.
*/
ONVIFDisplay.GetLayout = function (VideoOutput) {
return createStandardRequestBodyFromString(generateRequestElements('tls:GetLayout')({ tls_VideoOutput: VideoOutput }))
.map(mapResponseXmlToJson('tls:GetLayoutResponse'));
};
/**
* Change the layout of a display (e.g. change from
* single view to split screen view).The Layout assigns a pane configuration to a certain area of the display. The layout settings
* directly affect a specific video output. The layout consists of a list of PaneConfigurations and
* their associated display areas.
* A device implementation shall be tolerant against rounding errors when matching a layout against its fixed set of layouts by accepting differences of at least one percent.
*
*/
ONVIFDisplay.SetLayout = function (VideoOutput, Layout) {
return createStandardRequestBodyFromString(generateRequestElements('tls:SetLayout')({ tls_VideoOutput: VideoOutput, tls_Layout: Layout }))
.map(mapResponseXmlToJson('tls:SetLayoutResponse'));
};
/**
* The Display Options contain the supported layouts (LayoutOptions) and the decoding and
* encoding capabilities (CodingCapabilities) of the device. The GetDisplayOptions command
* returns both, Layout and Coding Capabilities, of a VideoOutput.
*/
ONVIFDisplay.GetDisplayOptions = function (VideoOutput) {
return createStandardRequestBodyFromString(generateRequestElements('tls:GetDisplayOptions')({ tls_VideoOutput: VideoOutput }))
.map(mapResponseXmlToJson('tls:GetDisplayOptionsResponse'));
};
/**
* List all currently defined panes of a device for a specified video output
* (regardless if this pane is visible at a moment). A Pane is a display area on the monitor that is attached to a video output. A pane has a
* PaneConfiguration that describes which entities are associated with the pane. A client has to configure the pane according to the connection to be established by setting the
* AudioOutput and/or AudioSourceToken. If a Token is not set, the corresponding session will
* not be established.
*/
ONVIFDisplay.GetPaneConfigurations = function (VideoOutput) {
return createStandardRequestBodyFromString(generateRequestElements('tls:GetPaneConfigurations')({ tls_VideoOutput: VideoOutput }))
.map(mapResponseXmlToJson('tls:GetPaneConfigurationsResponse'));
};
/**
* Retrieve the pane configuration for a pane token.
*/
ONVIFDisplay.GetPaneConfiguration = function (VideoOutput, Pane) {
return createStandardRequestBodyFromString(generateRequestElements('tls:GetPaneConfiguration')({ tls_VideoOutput: VideoOutput, tls_Pane: Pane }))
.map(mapResponseXmlToJson('tls:GetPaneConfigurationResponse'));
};
/**
* Modify one or more configurations of the specified video output.
* This method will only modify the provided configurations and leave the others unchanged.
* Use DeletePaneConfiguration to remove pane configurations.
*/
ONVIFDisplay.SetPaneConfigurations = function (VideoOutput, PaneConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tls:SetPaneConfigurations')({ tls_VideoOutput: VideoOutput, tls_PaneConfiguration: PaneConfiguration }))
.map(mapResponseXmlToJson('tls:SetPaneConfigurationsResponse'));
};
/**
* This command changes the configuration of the specified pane (tbd)
*/
ONVIFDisplay.SetPaneConfiguration = function (VideoOutput, PaneConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tls:SetPaneConfiguration')({ tls_VideoOutput: VideoOutput, tls_PaneConfiguration: PaneConfiguration }))
.map(mapResponseXmlToJson('tls:SetPaneConfigurationResponse'));
};
/**
* Create a new pane configuration describing the streaming and coding settings for a display area.
* This optional method is only supported by devices that signal support of dynamic pane creation via their capabilities.
* The content of the Token field may be ignored by the device.
*
*/
ONVIFDisplay.CreatePaneConfiguration = function (VideoOutput, PaneConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('tls:CreatePaneConfiguration')({ tls_VideoOutput: VideoOutput, tls_PaneConfiguration: PaneConfiguration }))
.map(mapResponseXmlToJson('tls:CreatePaneConfigurationResponse'));
};
/**
* Delete a pane configuration. A service must respond with an error if the pane configuration
* is in use by the current layout.
* This optional method is only supported by devices that signal support of dynamic pane creation via their capabilities.
*
*/
ONVIFDisplay.DeletePaneConfiguration = function (VideoOutput, PaneToken) {
return createStandardRequestBodyFromString(generateRequestElements('tls:DeletePaneConfiguration')({ tls_VideoOutput: VideoOutput, tls_PaneToken: PaneToken }))
.map(mapResponseXmlToJson('tls:DeletePaneConfigurationResponse'));
};
/**
* Returns the capabilities of the display service. The result is returned in a typed answer.
*/
ONVIFDisplay.prototype.GetServiceCapabilities = function () {
return ONVIFDisplay.GetServiceCapabilities().run(this.config);
};
/**
* Return the current layout of a video output. The Layout assigns a pane configuration to a certain area of the display. The layout settings
* directly affect a specific video output. The layout consists of a list of PaneConfigurations and
* their associated display areas.
*/
ONVIFDisplay.prototype.GetLayout = function (VideoOutput) {
return ONVIFDisplay.GetLayout(VideoOutput).run(this.config);
};
/**
* Change the layout of a display (e.g. change from
* single view to split screen view).The Layout assigns a pane configuration to a certain area of the display. The layout settings
* directly affect a specific video output. The layout consists of a list of PaneConfigurations and
* their associated display areas.
* A device implementation shall be tolerant against rounding errors when matching a layout against its fixed set of layouts by accepting differences of at least one percent.
*
*/
ONVIFDisplay.prototype.SetLayout = function (VideoOutput, Layout) {
return ONVIFDisplay.SetLayout(VideoOutput, Layout).run(this.config);
};
/**
* The Display Options contain the supported layouts (LayoutOptions) and the decoding and
* encoding capabilities (CodingCapabilities) of the device. The GetDisplayOptions command
* returns both, Layout and Coding Capabilities, of a VideoOutput.
*/
ONVIFDisplay.prototype.GetDisplayOptions = function (VideoOutput) {
return ONVIFDisplay.GetDisplayOptions(VideoOutput).run(this.config);
};
/**
* List all currently defined panes of a device for a specified video output
* (regardless if this pane is visible at a moment). A Pane is a display area on the monitor that is attached to a video output. A pane has a
* PaneConfiguration that describes which entities are associated with the pane. A client has to configure the pane according to the connection to be established by setting the
* AudioOutput and/or AudioSourceToken. If a Token is not set, the corresponding session will
* not be established.
*/
ONVIFDisplay.prototype.GetPaneConfigurations = function (VideoOutput) {
return ONVIFDisplay.GetPaneConfigurations(VideoOutput).run(this.config);
};
/**
* Retrieve the pane configuration for a pane token.
*/
ONVIFDisplay.prototype.GetPaneConfiguration = function (VideoOutput, Pane) {
return ONVIFDisplay.GetPaneConfiguration(VideoOutput, Pane).run(this.config);
};
/**
* Modify one or more configurations of the specified video output.
* This method will only modify the provided configurations and leave the others unchanged.
* Use DeletePaneConfiguration to remove pane configurations.
*/
ONVIFDisplay.prototype.SetPaneConfigurations = function (VideoOutput, PaneConfiguration) {
return ONVIFDisplay.SetPaneConfigurations(VideoOutput, PaneConfiguration).run(this.config);
};
/**
* This command changes the configuration of the specified pane (tbd)
*/
ONVIFDisplay.prototype.SetPaneConfiguration = function (VideoOutput, PaneConfiguration) {
return ONVIFDisplay.SetPaneConfiguration(VideoOutput, PaneConfiguration).run(this.config);
};
/**
* Create a new pane configuration describing the streaming and coding settings for a display area.
* This optional method is only supported by devices that signal support of dynamic pane creation via their capabilities.
* The content of the Token field may be ignored by the device.
*
*/
ONVIFDisplay.prototype.CreatePaneConfiguration = function (VideoOutput, PaneConfiguration) {
return ONVIFDisplay.CreatePaneConfiguration(VideoOutput, PaneConfiguration).run(this.config);
};
/**
* Delete a pane configuration. A service must respond with an error if the pane configuration
* is in use by the current layout.
* This optional method is only supported by devices that signal support of dynamic pane creation via their capabilities.
*
*/
ONVIFDisplay.prototype.DeletePaneConfiguration = function (VideoOutput, PaneToken) {
return ONVIFDisplay.DeletePaneConfiguration(VideoOutput, PaneToken).run(this.config);
};
return ONVIFDisplay;
}());
var ONVIFImaging = /** @class */ (function () {
function ONVIFImaging(config) {
this.config = config;
}
/**
* Returns the capabilities of the imaging service. The result is returned in a typed answer.
*/
ONVIFImaging.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('timg:GetServiceCapabilitiesResponse'));
};
/**
* Get the ImagingConfiguration for the requested VideoSource.
*/
ONVIFImaging.GetImagingSettings = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetImagingSettings')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetImagingSettingsResponse'));
};
/**
* Set the ImagingConfiguration for the requested VideoSource.
*/
ONVIFImaging.SetImagingSettings = function (VideoSourceToken, ImagingSettings, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('timg:SetImagingSettings')({ timg_VideoSourceToken: VideoSourceToken, timg_ImagingSettings: ImagingSettings, timg_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('timg:SetImagingSettingsResponse'));
};
/**
* This operation gets the valid ranges for the imaging parameters that have device specific ranges.
* This command is mandatory for all device implementing the imaging service. The command returns all supported parameters and their ranges
* such that these can be applied to the SetImagingSettings command.
* For read-only parameters which cannot be modified via the SetImagingSettings command only a single option or identical Min and Max values
* is provided.
*/
ONVIFImaging.GetOptions = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetOptions')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetOptionsResponse'));
};
/**
* The Move command moves the focus lens in an absolute, a relative or in a continuous manner from its current position.
* The speed argument is optional for absolute and relative control, but required for continuous. If no speed argument is used, the default speed is used.
* Focus adjustments through this operation will turn off the autofocus. A device with support for remote focus control should support absolute,
* relative or continuous control through the Move operation. The supported MoveOpions are signalled via the GetMoveOptions command.
* At least one focus control capability is required for this operation to be functional.
* The move operation contains the following commands:
* Absolute – Requires position parameter and optionally takes a speed argument. A unitless type is used by default for focus positioning and speed. Optionally, if supported, the position may be requested in m-1 units.
* Relative – Requires distance parameter and optionally takes a speed argument. Negative distance means negative direction.
* Continuous – Requires a speed argument. Negative speed argument means negative direction.
*
*/
ONVIFImaging.Move = function (VideoSourceToken, Focus) {
return createStandardRequestBodyFromString(generateRequestElements('timg:Move')({ timg_VideoSourceToken: VideoSourceToken, timg_Focus: Focus }))
.map(mapResponseXmlToJson('timg:MoveResponse'));
};
/**
* Imaging move operation options supported for the Video source.
*/
ONVIFImaging.GetMoveOptions = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetMoveOptions')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetMoveOptionsResponse'));
};
/**
* The Stop command stops all ongoing focus movements of the lense. A device with support for remote focus control as signalled via
* the GetMoveOptions supports this command. The operation will not affect ongoing autofocus operation.
*/
ONVIFImaging.Stop = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:Stop')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:StopResponse'));
};
/**
* Via this command the current status of the Move operation can be requested. Supported for this command is available if the support for the Move operation is signalled via GetMoveOptions.
*/
ONVIFImaging.GetStatus = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetStatus')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetStatusResponse'));
};
/**
* Via this command the list of available Imaging Presets can be requested.
*/
ONVIFImaging.GetPresets = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetPresets')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetPresetsResponse'));
};
/**
* Via this command the last Imaging Preset applied can be requested.
* If the camera configuration does not match any of the existing Imaging Presets, the output of GetCurrentPreset shall be Empty.
* GetCurrentPreset shall return 0 if Imaging Presets are not supported by the Video Source.
*/
ONVIFImaging.GetCurrentPreset = function (VideoSourceToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:GetCurrentPreset')({ timg_VideoSourceToken: VideoSourceToken }))
.map(mapResponseXmlToJson('timg:GetCurrentPresetResponse'));
};
/**
* The SetCurrentPreset command shall request a given Imaging Preset to be applied to the specified Video Source.
* SetCurrentPreset shall only be available for Video Sources with Imaging Presets Capability.
* Imaging Presets are defined by the Manufacturer, and offered as a tool to simplify Imaging Settings adjustments for specific scene content.
* When the new Imaging Preset is applied by SetCurrentPreset, the Device shall adjust the Video Source settings to match those defined by the specified Imaging Preset.
*/
ONVIFImaging.SetCurrentPreset = function (VideoSourceToken, PresetToken) {
return createStandardRequestBodyFromString(generateRequestElements('timg:SetCurrentPreset')({ timg_VideoSourceToken: VideoSourceToken, timg_PresetToken: PresetToken }))
.map(mapResponseXmlToJson('timg:SetCurrentPresetResponse'));
};
/**
* Returns the capabilities of the imaging service. The result is returned in a typed answer.
*/
ONVIFImaging.prototype.GetServiceCapabilities = function () {
return ONVIFImaging.GetServiceCapabilities().run(this.config);
};
/**
* Get the ImagingConfiguration for the requested VideoSource.
*/
ONVIFImaging.prototype.GetImagingSettings = function (VideoSourceToken) {
return ONVIFImaging.GetImagingSettings(VideoSourceToken).run(this.config);
};
/**
* Set the ImagingConfiguration for the requested VideoSource.
*/
ONVIFImaging.prototype.SetImagingSettings = function (VideoSourceToken, ImagingSettings, ForcePersistence) {
return ONVIFImaging.SetImagingSettings(VideoSourceToken, ImagingSettings, ForcePersistence).run(this.config);
};
/**
* This operation gets the valid ranges for the imaging parameters that have device specific ranges.
* This command is mandatory for all device implementing the imaging service. The command returns all supported parameters and their ranges
* such that these can be applied to the SetImagingSettings command.
* For read-only parameters which cannot be modified via the SetImagingSettings command only a single option or identical Min and Max values
* is provided.
*/
ONVIFImaging.prototype.GetOptions = function (VideoSourceToken) {
return ONVIFImaging.GetOptions(VideoSourceToken).run(this.config);
};
/**
* The Move command moves the focus lens in an absolute, a relative or in a continuous manner from its current position.
* The speed argument is optional for absolute and relative control, but required for continuous. If no speed argument is used, the default speed is used.
* Focus adjustments through this operation will turn off the autofocus. A device with support for remote focus control should support absolute,
* relative or continuous control through the Move operation. The supported MoveOpions are signalled via the GetMoveOptions command.
* At least one focus control capability is required for this operation to be functional.
* The move operation contains the following commands:
* Absolute – Requires position parameter and optionally takes a speed argument. A unitless type is used by default for focus positioning and speed. Optionally, if supported, the position may be requested in m-1 units.
* Relative – Requires distance parameter and optionally takes a speed argument. Negative distance means negative direction.
* Continuous – Requires a speed argument. Negative speed argument means negative direction.
*
*/
ONVIFImaging.prototype.Move = function (VideoSourceToken, Focus) {
return ONVIFImaging.Move(VideoSourceToken, Focus).run(this.config);
};
/**
* Imaging move operation options supported for the Video source.
*/
ONVIFImaging.prototype.GetMoveOptions = function (VideoSourceToken) {
return ONVIFImaging.GetMoveOptions(VideoSourceToken).run(this.config);
};
/**
* The Stop command stops all ongoing focus movements of the lense. A device with support for remote focus control as signalled via
* the GetMoveOptions supports this command. The operation will not affect ongoing autofocus operation.
*/
ONVIFImaging.prototype.Stop = function (VideoSourceToken) {
return ONVIFImaging.Stop(VideoSourceToken).run(this.config);
};
/**
* Via this command the current status of the Move operation can be requested. Supported for this command is available if the support for the Move operation is signalled via GetMoveOptions.
*/
ONVIFImaging.prototype.GetStatus = function (VideoSourceToken) {
return ONVIFImaging.GetStatus(VideoSourceToken).run(this.config);
};
/**
* Via this command the list of available Imaging Presets can be requested.
*/
ONVIFImaging.prototype.GetPresets = function (VideoSourceToken) {
return ONVIFImaging.GetPresets(VideoSourceToken).run(this.config);
};
/**
* Via this command the last Imaging Preset applied can be requested.
* If the camera configuration does not match any of the existing Imaging Presets, the output of GetCurrentPreset shall be Empty.
* GetCurrentPreset shall return 0 if Imaging Presets are not supported by the Video Source.
*/
ONVIFImaging.prototype.GetCurrentPreset = function (VideoSourceToken) {
return ONVIFImaging.GetCurrentPreset(VideoSourceToken).run(this.config);
};
/**
* The SetCurrentPreset command shall request a given Imaging Preset to be applied to the specified Video Source.
* SetCurrentPreset shall only be available for Video Sources with Imaging Presets Capability.
* Imaging Presets are defined by the Manufacturer, and offered as a tool to simplify Imaging Settings adjustments for specific scene content.
* When the new Imaging Preset is applied by SetCurrentPreset, the Device shall adjust the Video Source settings to match those defined by the specified Imaging Preset.
*/
ONVIFImaging.prototype.SetCurrentPreset = function (VideoSourceToken, PresetToken) {
return ONVIFImaging.SetCurrentPreset(VideoSourceToken, PresetToken).run(this.config);
};
return ONVIFImaging;
}());
/**
*
*/
(function (MoveStatus) {
/**
*
*/
MoveStatus["IDLE"] = "IDLE";
/**
*
*/
MoveStatus["MOVING"] = "MOVING";
/**
*
*/
MoveStatus["UNKNOWN"] = "UNKNOWN";
})(exports.MoveStatus || (exports.MoveStatus = {}));
(function (Entity) {
/**
*
*/
Entity["Device"] = "Device";
/**
*
*/
Entity["VideoSource"] = "VideoSource";
/**
*
*/
Entity["AudioSource"] = "AudioSource";
})(exports.Entity || (exports.Entity = {}));
(function (RotateMode) {
/**
* Enable the Rotate feature. Degree of rotation is specified Degree parameter.
*/
RotateMode["OFF"] = "OFF";
/**
* Disable the Rotate feature.
*/
RotateMode["ON"] = "ON";
/**
* Rotate feature is automatically activated by the device.
*/
RotateMode["AUTO"] = "AUTO";
})(exports.RotateMode || (exports.RotateMode = {}));
(function (SceneOrientationMode) {
/**
*
*/
SceneOrientationMode["MANUAL"] = "MANUAL";
/**
*
*/
SceneOrientationMode["AUTO"] = "AUTO";
})(exports.SceneOrientationMode || (exports.SceneOrientationMode = {}));
(function (SceneOrientationOption) {
/**
*
*/
SceneOrientationOption["Below"] = "Below";
/**
*
*/
SceneOrientationOption["Horizon"] = "Horizon";
/**
*
*/
SceneOrientationOption["Above"] = "Above";
})(exports.SceneOrientationOption || (exports.SceneOrientationOption = {}));
(function (ViewModes) {
/**
* Undewarped viewmode from device supporting fisheye lens.
*/
ViewModes["Fisheye"] = "Fisheye";
/**
* 360 degree panoramic view.
*/
ViewModes["360Panorama"] = "360Panorama";
/**
* 180 degree panoramic view.
*/
ViewModes["180Panorama"] = "180Panorama";
/**
* View mode combining four streams in single Quad, eg., applicable for devices supporting four heads.
*/
ViewModes["Quad"] = "Quad";
/**
* Unaltered view from the sensor.
*/
ViewModes["Original"] = "Original";
/**
* Viewmode combining the left side sensors, applicable for devices supporting multiple sensors.
*/
ViewModes["LeftHalf"] = "LeftHalf";
/**
* Viewmode combining the right side sensors, applicable for devices supporting multiple sensors.
*/
ViewModes["RightHalf"] = "RightHalf";
/**
* Dewarped view mode for device supporting fisheye lens.
*/
ViewModes["Dewarp"] = "Dewarp";
})(exports.ViewModes || (exports.ViewModes = {}));
(function (VideoEncoding) {
/**
*
*/
VideoEncoding["JPEG"] = "JPEG";
/**
*
*/
VideoEncoding["MPEG4"] = "MPEG4";
/**
*
*/
VideoEncoding["H264"] = "H264";
})(exports.VideoEncoding || (exports.VideoEncoding = {}));
(function (Mpeg4Profile) {
/**
*
*/
Mpeg4Profile["SP"] = "SP";
/**
*
*/
Mpeg4Profile["ASP"] = "ASP";
})(exports.Mpeg4Profile || (exports.Mpeg4Profile = {}));
(function (H264Profile) {
/**
*
*/
H264Profile["Baseline"] = "Baseline";
/**
*
*/
H264Profile["Main"] = "Main";
/**
*
*/
H264Profile["Extended"] = "Extended";
/**
*
*/
H264Profile["High"] = "High";
})(exports.H264Profile || (exports.H264Profile = {}));
(function (VideoEncodingMimeNames) {
/**
*
*/
VideoEncodingMimeNames["JPEG"] = "JPEG";
/**
*
*/
VideoEncodingMimeNames["MPV4-ES"] = "MPV4-ES";
/**
*
*/
VideoEncodingMimeNames["H264"] = "H264";
/**
*
*/
VideoEncodingMimeNames["H265"] = "H265";
})(exports.VideoEncodingMimeNames || (exports.VideoEncodingMimeNames = {}));
(function (VideoEncodingProfiles) {
/**
*
*/
VideoEncodingProfiles["Simple"] = "Simple";
/**
*
*/
VideoEncodingProfiles["AdvancedSimple"] = "AdvancedSimple";
/**
*
*/
VideoEncodingProfiles["Baseline"] = "Baseline";
/**
*
*/
VideoEncodingProfiles["Main"] = "Main";
/**
*
*/
VideoEncodingProfiles["Main10"] = "Main10";
/**
*
*/
VideoEncodingProfiles["Extended"] = "Extended";
/**
*
*/
VideoEncodingProfiles["High"] = "High";
})(exports.VideoEncodingProfiles || (exports.VideoEncodingProfiles = {}));
(function (AudioEncoding) {
/**
*
*/
AudioEncoding["G711"] = "G711";
/**
*
*/
AudioEncoding["G726"] = "G726";
/**
*
*/
AudioEncoding["AAC"] = "AAC";
})(exports.AudioEncoding || (exports.AudioEncoding = {}));
(function (AudioEncodingMimeNames) {
/**
*
*/
AudioEncodingMimeNames["PCMU"] = "PCMU";
/**
*
*/
AudioEncodingMimeNames["G726"] = "G726";
/**
*
*/
AudioEncodingMimeNames["MP4A-LATM"] = "MP4A-LATM";
/**
*
*/
AudioEncodingMimeNames["mpeg4-generic"] = "mpeg4-generic";
})(exports.AudioEncodingMimeNames || (exports.AudioEncodingMimeNames = {}));
(function (MetadataCompressionType) {
/**
*
*/
MetadataCompressionType["None"] = "None";
/**
*
*/
MetadataCompressionType["GZIP"] = "GZIP";
/**
*
*/
MetadataCompressionType["EXI"] = "EXI";
})(exports.MetadataCompressionType || (exports.MetadataCompressionType = {}));
(function (StreamType) {
/**
*
*/
StreamType["RTP-Unicast"] = "RTP-Unicast";
/**
*
*/
StreamType["RTP-Multicast"] = "RTP-Multicast";
})(exports.StreamType || (exports.StreamType = {}));
(function (TransportProtocol) {
/**
*
*/
TransportProtocol["UDP"] = "UDP";
/**
* This value is deprecated.
*/
TransportProtocol["TCP"] = "TCP";
/**
*
*/
TransportProtocol["RTSP"] = "RTSP";
/**
*
*/
TransportProtocol["HTTP"] = "HTTP";
})(exports.TransportProtocol || (exports.TransportProtocol = {}));
(function (ScopeDefinition) {
/**
*
*/
ScopeDefinition["Fixed"] = "Fixed";
/**
*
*/
ScopeDefinition["Configurable"] = "Configurable";
})(exports.ScopeDefinition || (exports.ScopeDefinition = {}));
(function (DiscoveryMode) {
/**
*
*/
DiscoveryMode["Discoverable"] = "Discoverable";
/**
*
*/
DiscoveryMode["NonDiscoverable"] = "NonDiscoverable";
})(exports.DiscoveryMode || (exports.DiscoveryMode = {}));
(function (Duplex) {
/**
*
*/
Duplex["Full"] = "Full";
/**
*
*/
Duplex["Half"] = "Half";
})(exports.Duplex || (exports.Duplex = {}));
(function (IPv6DHCPConfiguration) {
/**
*
*/
IPv6DHCPConfiguration["Auto"] = "Auto";
/**
*
*/
IPv6DHCPConfiguration["Stateful"] = "Stateful";
/**
*
*/
IPv6DHCPConfiguration["Stateless"] = "Stateless";
/**
*
*/
IPv6DHCPConfiguration["Off"] = "Off";
})(exports.IPv6DHCPConfiguration || (exports.IPv6DHCPConfiguration = {}));
(function (NetworkProtocolType) {
/**
*
*/
NetworkProtocolType["HTTP"] = "HTTP";
/**
*
*/
NetworkProtocolType["HTTPS"] = "HTTPS";
/**
*
*/
NetworkProtocolType["RTSP"] = "RTSP";
})(exports.NetworkProtocolType || (exports.NetworkProtocolType = {}));
(function (NetworkHostType) {
/**
*
*/
NetworkHostType["IPv4"] = "IPv4";
/**
*
*/
NetworkHostType["IPv6"] = "IPv6";
/**
*
*/
NetworkHostType["DNS"] = "DNS";
})(exports.NetworkHostType || (exports.NetworkHostType = {}));
(function (IPType) {
/**
*
*/
IPType["IPv4"] = "IPv4";
/**
*
*/
IPType["IPv6"] = "IPv6";
})(exports.IPType || (exports.IPType = {}));
(function (IPAddressFilterType) {
/**
*
*/
IPAddressFilterType["Allow"] = "Allow";
/**
*
*/
IPAddressFilterType["Deny"] = "Deny";
})(exports.IPAddressFilterType || (exports.IPAddressFilterType = {}));
(function (DynamicDNSType) {
/**
*
*/
DynamicDNSType["NoUpdate"] = "NoUpdate";
/**
*
*/
DynamicDNSType["ClientUpdates"] = "ClientUpdates";
/**
*
*/
DynamicDNSType["ServerUpdates"] = "ServerUpdates";
})(exports.DynamicDNSType || (exports.DynamicDNSType = {}));
(function (Dot11StationMode) {
/**
*
*/
Dot11StationMode["Ad-hoc"] = "Ad-hoc";
/**
*
*/
Dot11StationMode["Infrastructure"] = "Infrastructure";
/**
*
*/
Dot11StationMode["Extended"] = "Extended";
})(exports.Dot11StationMode || (exports.Dot11StationMode = {}));
(function (Dot11SecurityMode) {
/**
*
*/
Dot11SecurityMode["None"] = "None";
/**
*
*/
Dot11SecurityMode["WEP"] = "WEP";
/**
*
*/
Dot11SecurityMode["PSK"] = "PSK";
/**
*
*/
Dot11SecurityMode["Dot1X"] = "Dot1X";
/**
*
*/
Dot11SecurityMode["Extended"] = "Extended";
})(exports.Dot11SecurityMode || (exports.Dot11SecurityMode = {}));
(function (Dot11Cipher) {
/**
*
*/
Dot11Cipher["CCMP"] = "CCMP";
/**
*
*/
Dot11Cipher["TKIP"] = "TKIP";
/**
*
*/
Dot11Cipher["Any"] = "Any";
/**
*
*/
Dot11Cipher["Extended"] = "Extended";
})(exports.Dot11Cipher || (exports.Dot11Cipher = {}));
(function (Dot11SignalStrength) {
/**
*
*/
Dot11SignalStrength["None"] = "None";
/**
*
*/
Dot11SignalStrength["Very Bad"] = "Very Bad";
/**
*
*/
Dot11SignalStrength["Bad"] = "Bad";
/**
*
*/
Dot11SignalStrength["Good"] = "Good";
/**
*
*/
Dot11SignalStrength["Very Good"] = "Very Good";
/**
*
*/
Dot11SignalStrength["Extended"] = "Extended";
})(exports.Dot11SignalStrength || (exports.Dot11SignalStrength = {}));
(function (Dot11AuthAndMangementSuite) {
/**
*
*/
Dot11AuthAndMangementSuite["None"] = "None";
/**
*
*/
Dot11AuthAndMangementSuite["Dot1X"] = "Dot1X";
/**
*
*/
Dot11AuthAndMangementSuite["PSK"] = "PSK";
/**
*
*/
Dot11AuthAndMangementSuite["Extended"] = "Extended";
})(exports.Dot11AuthAndMangementSuite || (exports.Dot11AuthAndMangementSuite = {}));
(function (CapabilityCategory) {
/**
*
*/
CapabilityCategory["All"] = "All";
/**
*
*/
CapabilityCategory["Analytics"] = "Analytics";
/**
*
*/
CapabilityCategory["Device"] = "Device";
/**
*
*/
CapabilityCategory["Events"] = "Events";
/**
*
*/
CapabilityCategory["Imaging"] = "Imaging";
/**
*
*/
CapabilityCategory["Media"] = "Media";
/**
*
*/
CapabilityCategory["PTZ"] = "PTZ";
})(exports.CapabilityCategory || (exports.CapabilityCategory = {}));
(function (SystemLogType) {
/**
* Indicates that a system log is requested.
*/
SystemLogType["System"] = "System";
/**
* Indicates that a access log is requested.
*/
SystemLogType["Access"] = "Access";
})(exports.SystemLogType || (exports.SystemLogType = {}));
(function (FactoryDefaultType) {
/**
* Indicates that a hard factory default is requested.
*/
FactoryDefaultType["Hard"] = "Hard";
/**
* Indicates that a soft factory default is requested.
*/
FactoryDefaultType["Soft"] = "Soft";
})(exports.FactoryDefaultType || (exports.FactoryDefaultType = {}));
(function (SetDateTimeType) {
/**
* Indicates that the date and time are set manually.
*/
SetDateTimeType["Manual"] = "Manual";
/**
* Indicates that the date and time are set through NTP
*/
SetDateTimeType["NTP"] = "NTP";
})(exports.SetDateTimeType || (exports.SetDateTimeType = {}));
(function (UserLevel) {
/**
*
*/
UserLevel["Administrator"] = "Administrator";
/**
*
*/
UserLevel["Operator"] = "Operator";
/**
*
*/
UserLevel["User"] = "User";
/**
*
*/
UserLevel["Anonymous"] = "Anonymous";
/**
*
*/
UserLevel["Extended"] = "Extended";
})(exports.UserLevel || (exports.UserLevel = {}));
(function (RelayLogicalState) {
/**
*
*/
RelayLogicalState["active"] = "active";
/**
*
*/
RelayLogicalState["inactive"] = "inactive";
})(exports.RelayLogicalState || (exports.RelayLogicalState = {}));
(function (RelayIdleState) {
/**
*
*/
RelayIdleState["closed"] = "closed";
/**
*
*/
RelayIdleState["open"] = "open";
})(exports.RelayIdleState || (exports.RelayIdleState = {}));
(function (RelayMode) {
/**
*
*/
RelayMode["Monostable"] = "Monostable";
/**
*
*/
RelayMode["Bistable"] = "Bistable";
})(exports.RelayMode || (exports.RelayMode = {}));
(function (DigitalIdleState) {
/**
*
*/
DigitalIdleState["closed"] = "closed";
/**
*
*/
DigitalIdleState["open"] = "open";
})(exports.DigitalIdleState || (exports.DigitalIdleState = {}));
(function (EFlipMode) {
/**
*
*/
EFlipMode["OFF"] = "OFF";
/**
*
*/
EFlipMode["ON"] = "ON";
/**
*
*/
EFlipMode["Extended"] = "Extended";
})(exports.EFlipMode || (exports.EFlipMode = {}));
(function (ReverseMode) {
/**
*
*/
ReverseMode["OFF"] = "OFF";
/**
*
*/
ReverseMode["ON"] = "ON";
/**
*
*/
ReverseMode["AUTO"] = "AUTO";
/**
*
*/
ReverseMode["Extended"] = "Extended";
})(exports.ReverseMode || (exports.ReverseMode = {}));
(function (PTZPresetTourState) {
/**
*
*/
PTZPresetTourState["Idle"] = "Idle";
/**
*
*/
PTZPresetTourState["Touring"] = "Touring";
/**
*
*/
PTZPresetTourState["Paused"] = "Paused";
/**
*
*/
PTZPresetTourState["Extended"] = "Extended";
})(exports.PTZPresetTourState || (exports.PTZPresetTourState = {}));
(function (PTZPresetTourDirection) {
/**
*
*/
PTZPresetTourDirection["Forward"] = "Forward";
/**
*
*/
PTZPresetTourDirection["Backward"] = "Backward";
/**
*
*/
PTZPresetTourDirection["Extended"] = "Extended";
})(exports.PTZPresetTourDirection || (exports.PTZPresetTourDirection = {}));
(function (PTZPresetTourOperation) {
/**
*
*/
PTZPresetTourOperation["Start"] = "Start";
/**
*
*/
PTZPresetTourOperation["Stop"] = "Stop";
/**
*
*/
PTZPresetTourOperation["Pause"] = "Pause";
/**
*
*/
PTZPresetTourOperation["Extended"] = "Extended";
})(exports.PTZPresetTourOperation || (exports.PTZPresetTourOperation = {}));
(function (MoveAndTrackMethod) {
/**
*
*/
MoveAndTrackMethod["PresetToken"] = "PresetToken";
/**
*
*/
MoveAndTrackMethod["GeoLocation"] = "GeoLocation";
/**
*
*/
MoveAndTrackMethod["PTZVector"] = "PTZVector";
/**
*
*/
MoveAndTrackMethod["ObjectID"] = "ObjectID";
})(exports.MoveAndTrackMethod || (exports.MoveAndTrackMethod = {}));
(function (AutoFocusMode) {
/**
*
*/
AutoFocusMode["AUTO"] = "AUTO";
/**
*
*/
AutoFocusMode["MANUAL"] = "MANUAL";
})(exports.AutoFocusMode || (exports.AutoFocusMode = {}));
(function (AFModes) {
/**
* Focus of a moving camera is updated only once after stopping a pan, tilt or zoom movement.
*/
AFModes["OnceAfterMove"] = "OnceAfterMove";
})(exports.AFModes || (exports.AFModes = {}));
(function (WideDynamicMode) {
/**
*
*/
WideDynamicMode["OFF"] = "OFF";
/**
*
*/
WideDynamicMode["ON"] = "ON";
})(exports.WideDynamicMode || (exports.WideDynamicMode = {}));
(function (BacklightCompensationMode) {
/**
* Backlight compensation is disabled.
*/
BacklightCompensationMode["OFF"] = "OFF";
/**
* Backlight compensation is enabled.
*/
BacklightCompensationMode["ON"] = "ON";
})(exports.BacklightCompensationMode || (exports.BacklightCompensationMode = {}));
(function (ExposurePriority) {
/**
*
*/
ExposurePriority["LowNoise"] = "LowNoise";
/**
*
*/
ExposurePriority["FrameRate"] = "FrameRate";
})(exports.ExposurePriority || (exports.ExposurePriority = {}));
(function (ExposureMode) {
/**
*
*/
ExposureMode["AUTO"] = "AUTO";
/**
*
*/
ExposureMode["MANUAL"] = "MANUAL";
})(exports.ExposureMode || (exports.ExposureMode = {}));
(function (Enabled) {
/**
*
*/
Enabled["ENABLED"] = "ENABLED";
/**
*
*/
Enabled["DISABLED"] = "DISABLED";
})(exports.Enabled || (exports.Enabled = {}));
(function (WhiteBalanceMode) {
/**
*
*/
WhiteBalanceMode["AUTO"] = "AUTO";
/**
*
*/
WhiteBalanceMode["MANUAL"] = "MANUAL";
})(exports.WhiteBalanceMode || (exports.WhiteBalanceMode = {}));
(function (IrCutFilterMode) {
/**
*
*/
IrCutFilterMode["ON"] = "ON";
/**
*
*/
IrCutFilterMode["OFF"] = "OFF";
/**
*
*/
IrCutFilterMode["AUTO"] = "AUTO";
})(exports.IrCutFilterMode || (exports.IrCutFilterMode = {}));
(function (ImageStabilizationMode) {
/**
*
*/
ImageStabilizationMode["OFF"] = "OFF";
/**
*
*/
ImageStabilizationMode["ON"] = "ON";
/**
*
*/
ImageStabilizationMode["AUTO"] = "AUTO";
/**
*
*/
ImageStabilizationMode["Extended"] = "Extended";
})(exports.ImageStabilizationMode || (exports.ImageStabilizationMode = {}));
(function (IrCutFilterAutoBoundaryType) {
/**
*
*/
IrCutFilterAutoBoundaryType["Common"] = "Common";
/**
*
*/
IrCutFilterAutoBoundaryType["ToOn"] = "ToOn";
/**
*
*/
IrCutFilterAutoBoundaryType["ToOff"] = "ToOff";
/**
*
*/
IrCutFilterAutoBoundaryType["Extended"] = "Extended";
})(exports.IrCutFilterAutoBoundaryType || (exports.IrCutFilterAutoBoundaryType = {}));
(function (ToneCompensationMode) {
/**
*
*/
ToneCompensationMode["OFF"] = "OFF";
/**
*
*/
ToneCompensationMode["ON"] = "ON";
/**
*
*/
ToneCompensationMode["AUTO"] = "AUTO";
})(exports.ToneCompensationMode || (exports.ToneCompensationMode = {}));
(function (DefoggingMode) {
/**
*
*/
DefoggingMode["OFF"] = "OFF";
/**
*
*/
DefoggingMode["ON"] = "ON";
/**
*
*/
DefoggingMode["AUTO"] = "AUTO";
})(exports.DefoggingMode || (exports.DefoggingMode = {}));
(function (ImageSendingType) {
/**
*
*/
ImageSendingType["Embedded"] = "Embedded";
/**
*
*/
ImageSendingType["LocalStorage"] = "LocalStorage";
/**
*
*/
ImageSendingType["RemoteStorage"] = "RemoteStorage";
})(exports.ImageSendingType || (exports.ImageSendingType = {}));
(function (PropertyOperation) {
/**
*
*/
PropertyOperation["Initialized"] = "Initialized";
/**
*
*/
PropertyOperation["Deleted"] = "Deleted";
/**
*
*/
PropertyOperation["Changed"] = "Changed";
})(exports.PropertyOperation || (exports.PropertyOperation = {}));
(function (Direction) {
/**
*
*/
Direction["Left"] = "Left";
/**
*
*/
Direction["Right"] = "Right";
/**
*
*/
Direction["Any"] = "Any";
})(exports.Direction || (exports.Direction = {}));
(function (ReceiverMode) {
/**
* The receiver connects on demand, as required by consumers of the media streams.
*/
ReceiverMode["AutoConnect"] = "AutoConnect";
/**
* The receiver attempts to maintain a persistent connection to the configured endpoint.
*/
ReceiverMode["AlwaysConnect"] = "AlwaysConnect";
/**
* The receiver does not attempt to connect.
*/
ReceiverMode["NeverConnect"] = "NeverConnect";
/**
* This case should never happen.
*/
ReceiverMode["Unknown"] = "Unknown";
})(exports.ReceiverMode || (exports.ReceiverMode = {}));
(function (ReceiverState) {
/**
* The receiver is not connected.
*/
ReceiverState["NotConnected"] = "NotConnected";
/**
* The receiver is attempting to connect.
*/
ReceiverState["Connecting"] = "Connecting";
/**
* The receiver is connected.
*/
ReceiverState["Connected"] = "Connected";
/**
* This case should never happen.
*/
ReceiverState["Unknown"] = "Unknown";
})(exports.ReceiverState || (exports.ReceiverState = {}));
(function (SearchState) {
/**
* The search is queued and not yet started.
*/
SearchState["Queued"] = "Queued";
/**
* The search is underway and not yet completed.
*/
SearchState["Searching"] = "Searching";
/**
* The search has been completed and no new results will be found.
*/
SearchState["Completed"] = "Completed";
/**
* The state of the search is unknown. (This is not a valid response from GetSearchState.)
*/
SearchState["Unknown"] = "Unknown";
})(exports.SearchState || (exports.SearchState = {}));
(function (RecordingStatus) {
/**
*
*/
RecordingStatus["Initiated"] = "Initiated";
/**
*
*/
RecordingStatus["Recording"] = "Recording";
/**
*
*/
RecordingStatus["Stopped"] = "Stopped";
/**
*
*/
RecordingStatus["Removing"] = "Removing";
/**
*
*/
RecordingStatus["Removed"] = "Removed";
/**
* This case should never happen.
*/
RecordingStatus["Unknown"] = "Unknown";
})(exports.RecordingStatus || (exports.RecordingStatus = {}));
(function (TrackType) {
/**
*
*/
TrackType["Video"] = "Video";
/**
*
*/
TrackType["Audio"] = "Audio";
/**
*
*/
TrackType["Metadata"] = "Metadata";
/**
* Placeholder for future extension.
*/
TrackType["Extended"] = "Extended";
})(exports.TrackType || (exports.TrackType = {}));
(function (ModeOfOperation) {
/**
*
*/
ModeOfOperation["Idle"] = "Idle";
/**
*
*/
ModeOfOperation["Active"] = "Active";
/**
* This case should never happen.
*/
ModeOfOperation["Unknown"] = "Unknown";
})(exports.ModeOfOperation || (exports.ModeOfOperation = {}));
(function (AudioClassType) {
/**
*
*/
AudioClassType["gun_shot"] = "gun_shot";
/**
*
*/
AudioClassType["scream"] = "scream";
/**
*
*/
AudioClassType["glass_breaking"] = "glass_breaking";
/**
*
*/
AudioClassType["tire_screech"] = "tire_screech";
})(exports.AudioClassType || (exports.AudioClassType = {}));
(function (OSDType) {
/**
*
*/
OSDType["Text"] = "Text";
/**
*
*/
OSDType["Image"] = "Image";
/**
*
*/
OSDType["Extended"] = "Extended";
})(exports.OSDType || (exports.OSDType = {}));
(function (EventBrokerProtocol) {
/**
*
*/
EventBrokerProtocol["mqtt"] = "mqtt";
/**
*
*/
EventBrokerProtocol["mqtts"] = "mqtts";
/**
*
*/
EventBrokerProtocol["ws"] = "ws";
/**
*
*/
EventBrokerProtocol["wss"] = "wss";
})(exports.EventBrokerProtocol || (exports.EventBrokerProtocol = {}));
(function (ConnectionStatus) {
/**
*
*/
ConnectionStatus["Offline"] = "Offline";
/**
*
*/
ConnectionStatus["Connecting"] = "Connecting";
/**
*
*/
ConnectionStatus["Connected"] = "Connected";
})(exports.ConnectionStatus || (exports.ConnectionStatus = {}));
(function (AutoGeoModes) {
/**
* Automatic adjustment of the device location.
*/
AutoGeoModes["Location"] = "Location";
/**
* Automatic adjustment of the device orientation relative to the compass also called yaw.
*/
AutoGeoModes["Heading"] = "Heading";
/**
* Automatic adjustment of the deviation from the horizon also called pitch and roll.
*/
AutoGeoModes["Leveling"] = "Leveling";
})(exports.AutoGeoModes || (exports.AutoGeoModes = {}));
(function (StorageType) {
/**
* NFS protocol
*/
StorageType["NFS"] = "NFS";
/**
* CIFS protocol
*/
StorageType["CIFS"] = "CIFS";
/**
* CDMI protocol
*/
StorageType["CDMI"] = "CDMI";
/**
* FTP protocol
*/
StorageType["FTP"] = "FTP";
})(exports.StorageType || (exports.StorageType = {}));
var ONVIFProvisioning = /** @class */ (function () {
function ONVIFProvisioning(config) {
this.config = config;
}
/**
* Returns the capabilities of the provisioning service.
*/
ONVIFProvisioning.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tpv:GetServiceCapabilitiesResponse'));
};
/**
* Moves device on the pan axis.
*/
ONVIFProvisioning.PanMove = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:PanMove')({}))
.map(mapResponseXmlToJson('tpv:PanMoveResponse'));
};
/**
* Moves device on the tilt axis.
*/
ONVIFProvisioning.TiltMove = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:TiltMove')({}))
.map(mapResponseXmlToJson('tpv:TiltMoveResponse'));
};
/**
* Moves device on the zoom axis.
*/
ONVIFProvisioning.ZoomMove = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:ZoomMove')({}))
.map(mapResponseXmlToJson('tpv:ZoomMoveResponse'));
};
/**
* Moves device on the roll axis.
*/
ONVIFProvisioning.RollMove = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:RollMove')({}))
.map(mapResponseXmlToJson('tpv:RollMoveResponse'));
};
/**
* Moves device on the focus axis.
*/
ONVIFProvisioning.FocusMove = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:FocusMove')({}))
.map(mapResponseXmlToJson('tpv:FocusMoveResponse'));
};
/**
* Stops device motion on all axes.
*/
ONVIFProvisioning.Stop = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:Stop')({}))
.map(mapResponseXmlToJson('tpv:StopResponse'));
};
/**
* Returns the lifetime move counts.
*/
ONVIFProvisioning.GetUsage = function () {
return createStandardRequestBodyFromString(generateRequestElements('tpv:GetUsage')({}))
.map(mapResponseXmlToJson('tpv:GetUsageResponse'));
};
/**
* Returns the capabilities of the provisioning service.
*/
ONVIFProvisioning.prototype.GetServiceCapabilities = function () {
return ONVIFProvisioning.GetServiceCapabilities().run(this.config);
};
/**
* Moves device on the pan axis.
*/
ONVIFProvisioning.prototype.PanMove = function () {
return ONVIFProvisioning.PanMove().run(this.config);
};
/**
* Moves device on the tilt axis.
*/
ONVIFProvisioning.prototype.TiltMove = function () {
return ONVIFProvisioning.TiltMove().run(this.config);
};
/**
* Moves device on the zoom axis.
*/
ONVIFProvisioning.prototype.ZoomMove = function () {
return ONVIFProvisioning.ZoomMove().run(this.config);
};
/**
* Moves device on the roll axis.
*/
ONVIFProvisioning.prototype.RollMove = function () {
return ONVIFProvisioning.RollMove().run(this.config);
};
/**
* Moves device on the focus axis.
*/
ONVIFProvisioning.prototype.FocusMove = function () {
return ONVIFProvisioning.FocusMove().run(this.config);
};
/**
* Stops device motion on all axes.
*/
ONVIFProvisioning.prototype.Stop = function () {
return ONVIFProvisioning.Stop().run(this.config);
};
/**
* Returns the lifetime move counts.
*/
ONVIFProvisioning.prototype.GetUsage = function () {
return ONVIFProvisioning.GetUsage().run(this.config);
};
return ONVIFProvisioning;
}());
var ONVIFPTZ = /** @class */ (function () {
function ONVIFPTZ(config) {
this.config = config;
}
/**
* Returns the capabilities of the PTZ service. The result is returned in a typed answer.
*/
ONVIFPTZ.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tptz:GetServiceCapabilitiesResponse'));
};
/**
*
* Get the descriptions of the available PTZ Nodes.
*
* A PTZ-capable device may have multiple PTZ Nodes. The PTZ Nodes may represent
* mechanical PTZ drivers, uploaded PTZ drivers or digital PTZ drivers. PTZ Nodes are the
* lowest level entities in the PTZ control API and reflect the supported PTZ capabilities. The
* PTZ Node is referenced either by its name or by its reference token.
*
*/
ONVIFPTZ.GetNodes = function () {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetNodes')({}))
.map(mapResponseXmlToJson('tptz:GetNodesResponse'));
};
/**
* Get a specific PTZ Node identified by a reference
* token or a name.
*
*/
ONVIFPTZ.GetNode = function (NodeToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetNode')({ tptz_NodeToken: NodeToken }))
.map(mapResponseXmlToJson('tptz:GetNodeResponse'));
};
/**
* Get a specific PTZconfiguration from the device, identified by its reference token or name.
*
* The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
* requests without the need to specify a certain coordinate system. The default Speeds are
* introduced to control the speed of move requests (absolute, relative, preset), where no
* explicit speed has been set.
* The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
* that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
* Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
* absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
* coordinate system for which the limits have been specified. That means that even if
* movements are specified in a different coordinate system, the requested movements shall be
* transformed to the coordinate system of the limits where the limits can be checked. When a
* relative or continuous movements is specified, which would leave the specified limits, the PTZ
* unit has to move along the specified limits. The Zoom Limits have to be interpreted
* accordingly.
*
*/
ONVIFPTZ.GetConfiguration = function (PTZConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetConfiguration')({ tptz_PTZConfigurationToken: PTZConfigurationToken }))
.map(mapResponseXmlToJson('tptz:GetConfigurationResponse'));
};
/**
*
* Get all the existing PTZConfigurations from the device.
*
* The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
* requests without the need to specify a certain coordinate system. The default Speeds are
* introduced to control the speed of move requests (absolute, relative, preset), where no
* explicit speed has been set.
* The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
* that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
* Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
* absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
* coordinate system for which the limits have been specified. That means that even if
* movements are specified in a different coordinate system, the requested movements shall be
* transformed to the coordinate system of the limits where the limits can be checked. When a
* relative or continuous movements is specified, which would leave the specified limits, the PTZ
* unit has to move along the specified limits. The Zoom Limits have to be interpreted
* accordingly.
*
*/
ONVIFPTZ.GetConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetConfigurations')({}))
.map(mapResponseXmlToJson('tptz:GetConfigurationsResponse'));
};
/**
*
* Set/update a existing PTZConfiguration on the device.
*
*/
ONVIFPTZ.SetConfiguration = function (PTZConfiguration, ForcePersistence) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:SetConfiguration')({ tptz_PTZConfiguration: PTZConfiguration, tptz_ForcePersistence: ForcePersistence }))
.map(mapResponseXmlToJson('tptz:SetConfigurationResponse'));
};
/**
*
* List supported coordinate systems including their range limitations. Therefore, the options
* MAY differ depending on whether the PTZ Configuration is assigned to a Profile containing a
* Video Source Configuration. In that case, the options may additionally contain coordinate
* systems referring to the image coordinate system described by the Video Source
* Configuration. If the PTZ Node supports continuous movements, it shall return a Timeout Range within
* which Timeouts are accepted by the PTZ Node.
*
*/
ONVIFPTZ.GetConfigurationOptions = function (ConfigurationToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetConfigurationOptions')({ tptz_ConfigurationToken: ConfigurationToken }))
.map(mapResponseXmlToJson('tptz:GetConfigurationOptionsResponse'));
};
/**
*
* Operation to send auxiliary commands to the PTZ device
* mapped by the PTZNode in the selected profile. The
* operation is supported
* if the AuxiliarySupported element of the PTZNode is true
*
*/
ONVIFPTZ.SendAuxiliaryCommand = function (ProfileToken, AuxiliaryData) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:SendAuxiliaryCommand')({ tptz_ProfileToken: ProfileToken, tptz_AuxiliaryData: AuxiliaryData }))
.map(mapResponseXmlToJson('tptz:SendAuxiliaryCommandResponse'));
};
/**
*
* Operation to request all PTZ presets for the PTZNode
* in the selected profile. The operation is supported if there is support
* for at least on PTZ preset by the PTZNode.
*/
ONVIFPTZ.GetPresets = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetPresets')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:GetPresetsResponse'));
};
/**
*
* The SetPreset command saves the current device position parameters so that the device can
* move to the saved preset position through the GotoPreset operation.
* In order to create a new preset, the SetPresetRequest contains no PresetToken. If creation is
* successful, the Response contains the PresetToken which uniquely identifies the Preset. An
* existing Preset can be overwritten by specifying the PresetToken of the corresponding Preset.
* In both cases (overwriting or creation) an optional PresetName can be specified. The
* operation fails if the PTZ device is moving during the SetPreset operation.
* The device MAY internally save additional states such as imaging properties in the PTZ
* Preset which then should be recalled in the GotoPreset operation.
*/
ONVIFPTZ.SetPreset = function (ProfileToken, PresetName, PresetToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:SetPreset')({ tptz_ProfileToken: ProfileToken, tptz_PresetName: PresetName, tptz_PresetToken: PresetToken }))
.map(mapResponseXmlToJson('tptz:SetPresetResponse'));
};
/**
*
* Operation to remove a PTZ preset for the Node in
* the
* selected profile. The operation is supported if the
* PresetPosition
* capability exists for teh Node in the
* selected profile.
*
*/
ONVIFPTZ.RemovePreset = function (ProfileToken, PresetToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:RemovePreset')({ tptz_ProfileToken: ProfileToken, tptz_PresetToken: PresetToken }))
.map(mapResponseXmlToJson('tptz:RemovePresetResponse'));
};
/**
*
* Operation to go to a saved preset position for the
* PTZNode in the selected profile. The operation is supported if there is
* support for at least on PTZ preset by the PTZNode.
*/
ONVIFPTZ.GotoPreset = function (ProfileToken, PresetToken, Speed) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GotoPreset')({ tptz_ProfileToken: ProfileToken, tptz_PresetToken: PresetToken, tptz_Speed: Speed }))
.map(mapResponseXmlToJson('tptz:GotoPresetResponse'));
};
/**
*
* Operation to move the PTZ device to it's "home" position. The operation is supported if the HomeSupported element in the PTZNode is true.
*/
ONVIFPTZ.GotoHomePosition = function (ProfileToken, Speed) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GotoHomePosition')({ tptz_ProfileToken: ProfileToken, tptz_Speed: Speed }))
.map(mapResponseXmlToJson('tptz:GotoHomePositionResponse'));
};
/**
* Operation to save current position as the home position.
* The SetHomePosition command returns with a failure if the “home” position is fixed and
* cannot be overwritten. If the SetHomePosition is successful, it is possible to recall the
* Home Position with the GotoHomePosition command.
*/
ONVIFPTZ.SetHomePosition = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:SetHomePosition')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:SetHomePositionResponse'));
};
/**
* Operation for continuous Pan/Tilt and Zoom movements. The operation is supported if the PTZNode supports at least one continuous Pan/Tilt or Zoom space. If the space argument is omitted, the default space set by the PTZConfiguration will be used.
*/
ONVIFPTZ.ContinuousMove = function (ProfileToken, Velocity, Timeout) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:ContinuousMove')({ tptz_ProfileToken: ProfileToken, tptz_Velocity: Velocity, tptz_Timeout: Timeout }))
.map(mapResponseXmlToJson('tptz:ContinuousMoveResponse'));
};
/**
* Operation for Relative Pan/Tilt and Zoom Move. The operation is supported if the PTZNode supports at least one relative Pan/Tilt or Zoom space.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
*
*/
ONVIFPTZ.RelativeMove = function (ProfileToken, Translation, Speed) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:RelativeMove')({ tptz_ProfileToken: ProfileToken, tptz_Translation: Translation, tptz_Speed: Speed }))
.map(mapResponseXmlToJson('tptz:RelativeMoveResponse'));
};
/**
*
* Operation to request PTZ status for the Node in the
* selected profile.
*/
ONVIFPTZ.GetStatus = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetStatus')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:GetStatusResponse'));
};
/**
* Operation to move pan,tilt or zoom to a absolute destination.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
*
*/
ONVIFPTZ.AbsoluteMove = function (ProfileToken, Position, Speed) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:AbsoluteMove')({ tptz_ProfileToken: ProfileToken, tptz_Position: Position, tptz_Speed: Speed }))
.map(mapResponseXmlToJson('tptz:AbsoluteMoveResponse'));
};
/**
* Operation to move pan,tilt or zoom to point to a destination based on the geolocation of the target.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
* The area height and area dwidth parameters are optional, they can be used independently and may be used
* by the device to automatically determine the best zoom level to show the target.
*
*/
ONVIFPTZ.GeoMove = function (ProfileToken, Target, Speed, AreaHeight, AreaWidth) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GeoMove')({ tptz_ProfileToken: ProfileToken, tptz_Target: Target, tptz_Speed: Speed, tptz_AreaHeight: AreaHeight, tptz_AreaWidth: AreaWidth }))
.map(mapResponseXmlToJson('tptz:GeoMoveResponse'));
};
/**
* Operation to stop ongoing pan, tilt and zoom movements of absolute relative and continuous type.
* If no stop argument for pan, tilt or zoom is set, the device will stop all ongoing pan, tilt and zoom movements.
*/
ONVIFPTZ.Stop = function (ProfileToken, PanTilt, Zoom) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:Stop')({ tptz_ProfileToken: ProfileToken, tptz_PanTilt: PanTilt, tptz_Zoom: Zoom }))
.map(mapResponseXmlToJson('tptz:StopResponse'));
};
/**
* Operation to request PTZ preset tours in the selected media profiles.
*/
ONVIFPTZ.GetPresetTours = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetPresetTours')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:GetPresetToursResponse'));
};
/**
* Operation to request a specific PTZ preset tour in the selected media profile.
*/
ONVIFPTZ.GetPresetTour = function (ProfileToken, PresetTourToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetPresetTour')({ tptz_ProfileToken: ProfileToken, tptz_PresetTourToken: PresetTourToken }))
.map(mapResponseXmlToJson('tptz:GetPresetTourResponse'));
};
/**
* Operation to request available options to configure PTZ preset tour.
*/
ONVIFPTZ.GetPresetTourOptions = function (ProfileToken, PresetTourToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetPresetTourOptions')({ tptz_ProfileToken: ProfileToken, tptz_PresetTourToken: PresetTourToken }))
.map(mapResponseXmlToJson('tptz:GetPresetTourOptionsResponse'));
};
/**
* Operation to create a preset tour for the selected media profile.
*/
ONVIFPTZ.CreatePresetTour = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:CreatePresetTour')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:CreatePresetTourResponse'));
};
/**
* Operation to modify a preset tour for the selected media profile.
*/
ONVIFPTZ.ModifyPresetTour = function (ProfileToken, PresetTour) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:ModifyPresetTour')({ tptz_ProfileToken: ProfileToken, tptz_PresetTour: PresetTour }))
.map(mapResponseXmlToJson('tptz:ModifyPresetTourResponse'));
};
/**
* Operation to perform specific operation on the preset tour in selected media profile.
*/
ONVIFPTZ.OperatePresetTour = function (ProfileToken, PresetTourToken, Operation) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:OperatePresetTour')({ tptz_ProfileToken: ProfileToken, tptz_PresetTourToken: PresetTourToken, tptz_Operation: Operation }))
.map(mapResponseXmlToJson('tptz:OperatePresetTourResponse'));
};
/**
* Operation to delete a specific preset tour from the media profile.
*/
ONVIFPTZ.RemovePresetTour = function (ProfileToken, PresetTourToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:RemovePresetTour')({ tptz_ProfileToken: ProfileToken, tptz_PresetTourToken: PresetTourToken }))
.map(mapResponseXmlToJson('tptz:RemovePresetTourResponse'));
};
/**
* Operation to get all available PTZConfigurations that can be added to the referenced media profile.
* A device providing more than one PTZConfiguration or more than one VideoSourceConfiguration or which has any other resource
* interdependency between PTZConfiguration entities and other resources listable in a media profile should implement this operation.
* PTZConfiguration entities returned by this operation shall not fail on adding them to the referenced media profile.
*
*/
ONVIFPTZ.GetCompatibleConfigurations = function (ProfileToken) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:GetCompatibleConfigurations')({ tptz_ProfileToken: ProfileToken }))
.map(mapResponseXmlToJson('tptz:GetCompatibleConfigurationsResponse'));
};
/**
* Operation to send an an atomic command to the device: move the camera to a wanted position and then delegate the PTZ control to the tracking algorithm.
* An existing Speed argument overrides DefaultSpeed of the corresponding PTZ configuration during movement to the requested position.
* If spaces are referenced within the Speed argument, they shall be speed spaces supported by the PTZ node.
* If the detection and the tracking are done in the same device, an ObjectID reference can be passed as an argument, in order to specify which object should be tracked.
* The operation shall fail if the requested absolute position is not reachable.
*
*/
ONVIFPTZ.MoveAndStartTracking = function (ProfileToken, PresetToken, GeoLocation, TargetPosition, Speed, ObjectID) {
return createStandardRequestBodyFromString(generateRequestElements('tptz:MoveAndStartTracking')({ tptz_ProfileToken: ProfileToken, tptz_PresetToken: PresetToken, tptz_GeoLocation: GeoLocation, tptz_TargetPosition: TargetPosition, tptz_Speed: Speed, tptz_ObjectID: ObjectID }))
.map(mapResponseXmlToJson('tptz:MoveAndStartTrackingResponse'));
};
/**
* Returns the capabilities of the PTZ service. The result is returned in a typed answer.
*/
ONVIFPTZ.prototype.GetServiceCapabilities = function () {
return ONVIFPTZ.GetServiceCapabilities().run(this.config);
};
/**
*
* Get the descriptions of the available PTZ Nodes.
*
* A PTZ-capable device may have multiple PTZ Nodes. The PTZ Nodes may represent
* mechanical PTZ drivers, uploaded PTZ drivers or digital PTZ drivers. PTZ Nodes are the
* lowest level entities in the PTZ control API and reflect the supported PTZ capabilities. The
* PTZ Node is referenced either by its name or by its reference token.
*
*/
ONVIFPTZ.prototype.GetNodes = function () {
return ONVIFPTZ.GetNodes().run(this.config);
};
/**
* Get a specific PTZ Node identified by a reference
* token or a name.
*
*/
ONVIFPTZ.prototype.GetNode = function (NodeToken) {
return ONVIFPTZ.GetNode(NodeToken).run(this.config);
};
/**
* Get a specific PTZconfiguration from the device, identified by its reference token or name.
*
* The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
* requests without the need to specify a certain coordinate system. The default Speeds are
* introduced to control the speed of move requests (absolute, relative, preset), where no
* explicit speed has been set.
* The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
* that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
* Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
* absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
* coordinate system for which the limits have been specified. That means that even if
* movements are specified in a different coordinate system, the requested movements shall be
* transformed to the coordinate system of the limits where the limits can be checked. When a
* relative or continuous movements is specified, which would leave the specified limits, the PTZ
* unit has to move along the specified limits. The Zoom Limits have to be interpreted
* accordingly.
*
*/
ONVIFPTZ.prototype.GetConfiguration = function (PTZConfigurationToken) {
return ONVIFPTZ.GetConfiguration(PTZConfigurationToken).run(this.config);
};
/**
*
* Get all the existing PTZConfigurations from the device.
*
* The default Position/Translation/Velocity Spaces are introduced to allow NVCs sending move
* requests without the need to specify a certain coordinate system. The default Speeds are
* introduced to control the speed of move requests (absolute, relative, preset), where no
* explicit speed has been set.
* The allowed pan and tilt range for Pan/Tilt Limits is defined by a two-dimensional space range
* that is mapped to a specific Absolute Pan/Tilt Position Space. At least one Pan/Tilt Position
* Space is required by the PTZNode to support Pan/Tilt limits. The limits apply to all supported
* absolute, relative and continuous Pan/Tilt movements. The limits shall be checked within the
* coordinate system for which the limits have been specified. That means that even if
* movements are specified in a different coordinate system, the requested movements shall be
* transformed to the coordinate system of the limits where the limits can be checked. When a
* relative or continuous movements is specified, which would leave the specified limits, the PTZ
* unit has to move along the specified limits. The Zoom Limits have to be interpreted
* accordingly.
*
*/
ONVIFPTZ.prototype.GetConfigurations = function () {
return ONVIFPTZ.GetConfigurations().run(this.config);
};
/**
*
* Set/update a existing PTZConfiguration on the device.
*
*/
ONVIFPTZ.prototype.SetConfiguration = function (PTZConfiguration, ForcePersistence) {
return ONVIFPTZ.SetConfiguration(PTZConfiguration, ForcePersistence).run(this.config);
};
/**
*
* List supported coordinate systems including their range limitations. Therefore, the options
* MAY differ depending on whether the PTZ Configuration is assigned to a Profile containing a
* Video Source Configuration. In that case, the options may additionally contain coordinate
* systems referring to the image coordinate system described by the Video Source
* Configuration. If the PTZ Node supports continuous movements, it shall return a Timeout Range within
* which Timeouts are accepted by the PTZ Node.
*
*/
ONVIFPTZ.prototype.GetConfigurationOptions = function (ConfigurationToken) {
return ONVIFPTZ.GetConfigurationOptions(ConfigurationToken).run(this.config);
};
/**
*
* Operation to send auxiliary commands to the PTZ device
* mapped by the PTZNode in the selected profile. The
* operation is supported
* if the AuxiliarySupported element of the PTZNode is true
*
*/
ONVIFPTZ.prototype.SendAuxiliaryCommand = function (ProfileToken, AuxiliaryData) {
return ONVIFPTZ.SendAuxiliaryCommand(ProfileToken, AuxiliaryData).run(this.config);
};
/**
*
* Operation to request all PTZ presets for the PTZNode
* in the selected profile. The operation is supported if there is support
* for at least on PTZ preset by the PTZNode.
*/
ONVIFPTZ.prototype.GetPresets = function (ProfileToken) {
return ONVIFPTZ.GetPresets(ProfileToken).run(this.config);
};
/**
*
* The SetPreset command saves the current device position parameters so that the device can
* move to the saved preset position through the GotoPreset operation.
* In order to create a new preset, the SetPresetRequest contains no PresetToken. If creation is
* successful, the Response contains the PresetToken which uniquely identifies the Preset. An
* existing Preset can be overwritten by specifying the PresetToken of the corresponding Preset.
* In both cases (overwriting or creation) an optional PresetName can be specified. The
* operation fails if the PTZ device is moving during the SetPreset operation.
* The device MAY internally save additional states such as imaging properties in the PTZ
* Preset which then should be recalled in the GotoPreset operation.
*/
ONVIFPTZ.prototype.SetPreset = function (ProfileToken, PresetName, PresetToken) {
return ONVIFPTZ.SetPreset(ProfileToken, PresetName, PresetToken).run(this.config);
};
/**
*
* Operation to remove a PTZ preset for the Node in
* the
* selected profile. The operation is supported if the
* PresetPosition
* capability exists for teh Node in the
* selected profile.
*
*/
ONVIFPTZ.prototype.RemovePreset = function (ProfileToken, PresetToken) {
return ONVIFPTZ.RemovePreset(ProfileToken, PresetToken).run(this.config);
};
/**
*
* Operation to go to a saved preset position for the
* PTZNode in the selected profile. The operation is supported if there is
* support for at least on PTZ preset by the PTZNode.
*/
ONVIFPTZ.prototype.GotoPreset = function (ProfileToken, PresetToken, Speed) {
return ONVIFPTZ.GotoPreset(ProfileToken, PresetToken, Speed).run(this.config);
};
/**
*
* Operation to move the PTZ device to it's "home" position. The operation is supported if the HomeSupported element in the PTZNode is true.
*/
ONVIFPTZ.prototype.GotoHomePosition = function (ProfileToken, Speed) {
return ONVIFPTZ.GotoHomePosition(ProfileToken, Speed).run(this.config);
};
/**
* Operation to save current position as the home position.
* The SetHomePosition command returns with a failure if the “home” position is fixed and
* cannot be overwritten. If the SetHomePosition is successful, it is possible to recall the
* Home Position with the GotoHomePosition command.
*/
ONVIFPTZ.prototype.SetHomePosition = function (ProfileToken) {
return ONVIFPTZ.SetHomePosition(ProfileToken).run(this.config);
};
/**
* Operation for continuous Pan/Tilt and Zoom movements. The operation is supported if the PTZNode supports at least one continuous Pan/Tilt or Zoom space. If the space argument is omitted, the default space set by the PTZConfiguration will be used.
*/
ONVIFPTZ.prototype.ContinuousMove = function (ProfileToken, Velocity, Timeout) {
return ONVIFPTZ.ContinuousMove(ProfileToken, Velocity, Timeout).run(this.config);
};
/**
* Operation for Relative Pan/Tilt and Zoom Move. The operation is supported if the PTZNode supports at least one relative Pan/Tilt or Zoom space.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
*
*/
ONVIFPTZ.prototype.RelativeMove = function (ProfileToken, Translation, Speed) {
return ONVIFPTZ.RelativeMove(ProfileToken, Translation, Speed).run(this.config);
};
/**
*
* Operation to request PTZ status for the Node in the
* selected profile.
*/
ONVIFPTZ.prototype.GetStatus = function (ProfileToken) {
return ONVIFPTZ.GetStatus(ProfileToken).run(this.config);
};
/**
* Operation to move pan,tilt or zoom to a absolute destination.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
*
*/
ONVIFPTZ.prototype.AbsoluteMove = function (ProfileToken, Position, Speed) {
return ONVIFPTZ.AbsoluteMove(ProfileToken, Position, Speed).run(this.config);
};
/**
* Operation to move pan,tilt or zoom to point to a destination based on the geolocation of the target.
* The speed argument is optional. If an x/y speed value is given it is up to the device to either use
* the x value as absolute resoluting speed vector or to map x and y to the component speed.
* If the speed argument is omitted, the default speed set by the PTZConfiguration will be used.
* The area height and area dwidth parameters are optional, they can be used independently and may be used
* by the device to automatically determine the best zoom level to show the target.
*
*/
ONVIFPTZ.prototype.GeoMove = function (ProfileToken, Target, Speed, AreaHeight, AreaWidth) {
return ONVIFPTZ.GeoMove(ProfileToken, Target, Speed, AreaHeight, AreaWidth).run(this.config);
};
/**
* Operation to stop ongoing pan, tilt and zoom movements of absolute relative and continuous type.
* If no stop argument for pan, tilt or zoom is set, the device will stop all ongoing pan, tilt and zoom movements.
*/
ONVIFPTZ.prototype.Stop = function (ProfileToken, PanTilt, Zoom) {
return ONVIFPTZ.Stop(ProfileToken, PanTilt, Zoom).run(this.config);
};
/**
* Operation to request PTZ preset tours in the selected media profiles.
*/
ONVIFPTZ.prototype.GetPresetTours = function (ProfileToken) {
return ONVIFPTZ.GetPresetTours(ProfileToken).run(this.config);
};
/**
* Operation to request a specific PTZ preset tour in the selected media profile.
*/
ONVIFPTZ.prototype.GetPresetTour = function (ProfileToken, PresetTourToken) {
return ONVIFPTZ.GetPresetTour(ProfileToken, PresetTourToken).run(this.config);
};
/**
* Operation to request available options to configure PTZ preset tour.
*/
ONVIFPTZ.prototype.GetPresetTourOptions = function (ProfileToken, PresetTourToken) {
return ONVIFPTZ.GetPresetTourOptions(ProfileToken, PresetTourToken).run(this.config);
};
/**
* Operation to create a preset tour for the selected media profile.
*/
ONVIFPTZ.prototype.CreatePresetTour = function (ProfileToken) {
return ONVIFPTZ.CreatePresetTour(ProfileToken).run(this.config);
};
/**
* Operation to modify a preset tour for the selected media profile.
*/
ONVIFPTZ.prototype.ModifyPresetTour = function (ProfileToken, PresetTour) {
return ONVIFPTZ.ModifyPresetTour(ProfileToken, PresetTour).run(this.config);
};
/**
* Operation to perform specific operation on the preset tour in selected media profile.
*/
ONVIFPTZ.prototype.OperatePresetTour = function (ProfileToken, PresetTourToken, Operation) {
return ONVIFPTZ.OperatePresetTour(ProfileToken, PresetTourToken, Operation).run(this.config);
};
/**
* Operation to delete a specific preset tour from the media profile.
*/
ONVIFPTZ.prototype.RemovePresetTour = function (ProfileToken, PresetTourToken) {
return ONVIFPTZ.RemovePresetTour(ProfileToken, PresetTourToken).run(this.config);
};
/**
* Operation to get all available PTZConfigurations that can be added to the referenced media profile.
* A device providing more than one PTZConfiguration or more than one VideoSourceConfiguration or which has any other resource
* interdependency between PTZConfiguration entities and other resources listable in a media profile should implement this operation.
* PTZConfiguration entities returned by this operation shall not fail on adding them to the referenced media profile.
*
*/
ONVIFPTZ.prototype.GetCompatibleConfigurations = function (ProfileToken) {
return ONVIFPTZ.GetCompatibleConfigurations(ProfileToken).run(this.config);
};
/**
* Operation to send an an atomic command to the device: move the camera to a wanted position and then delegate the PTZ control to the tracking algorithm.
* An existing Speed argument overrides DefaultSpeed of the corresponding PTZ configuration during movement to the requested position.
* If spaces are referenced within the Speed argument, they shall be speed spaces supported by the PTZ node.
* If the detection and the tracking are done in the same device, an ObjectID reference can be passed as an argument, in order to specify which object should be tracked.
* The operation shall fail if the requested absolute position is not reachable.
*
*/
ONVIFPTZ.prototype.MoveAndStartTracking = function (ProfileToken, PresetToken, GeoLocation, TargetPosition, Speed, ObjectID) {
return ONVIFPTZ.MoveAndStartTracking(ProfileToken, PresetToken, GeoLocation, TargetPosition, Speed, ObjectID).run(this.config);
};
return ONVIFPTZ;
}());
var ONVIFReceiver = /** @class */ (function () {
function ONVIFReceiver(config) {
this.config = config;
}
/**
* Returns the capabilities of the receiver service. The result is returned in a typed answer.
*/
ONVIFReceiver.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('trv:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('trv:GetServiceCapabilitiesResponse'));
};
/**
*
* Lists all receivers currently present on a device. This operation is mandatory.
*
*/
ONVIFReceiver.GetReceivers = function () {
return createStandardRequestBodyFromString(generateRequestElements('trv:GetReceivers')({}))
.map(mapResponseXmlToJson('trv:GetReceiversResponse'));
};
/**
*
* Retrieves the details of a specific receiver. This operation is mandatory.
*
*/
ONVIFReceiver.GetReceiver = function (ReceiverToken) {
return createStandardRequestBodyFromString(generateRequestElements('trv:GetReceiver')({ trv_ReceiverToken: ReceiverToken }))
.map(mapResponseXmlToJson('trv:GetReceiverResponse'));
};
/**
*
* Creates a new receiver. This operation is mandatory, although the service may
* raise a fault if the receiver cannot be created.
*
*/
ONVIFReceiver.CreateReceiver = function (Configuration) {
return createStandardRequestBodyFromString(generateRequestElements('trv:CreateReceiver')({ trv_Configuration: Configuration }))
.map(mapResponseXmlToJson('trv:CreateReceiverResponse'));
};
/**
*
* Deletes an existing receiver. A receiver may be deleted only if it is not
* currently in use; otherwise a fault shall be raised.
* This operation is mandatory.
*
*/
ONVIFReceiver.DeleteReceiver = function (ReceiverToken) {
return createStandardRequestBodyFromString(generateRequestElements('trv:DeleteReceiver')({ trv_ReceiverToken: ReceiverToken }))
.map(mapResponseXmlToJson('trv:DeleteReceiverResponse'));
};
/**
*
* Configures an existing receiver. This operation is mandatory.
*
*/
ONVIFReceiver.ConfigureReceiver = function (ReceiverToken, Configuration) {
return createStandardRequestBodyFromString(generateRequestElements('trv:ConfigureReceiver')({ trv_ReceiverToken: ReceiverToken, trv_Configuration: Configuration }))
.map(mapResponseXmlToJson('trv:ConfigureReceiverResponse'));
};
/**
*
* Sets the mode of the receiver without affecting the rest of its configuration.
* This operation is mandatory.
*
*/
ONVIFReceiver.SetReceiverMode = function (ReceiverToken, Mode) {
return createStandardRequestBodyFromString(generateRequestElements('trv:SetReceiverMode')({ trv_ReceiverToken: ReceiverToken, trv_Mode: Mode }))
.map(mapResponseXmlToJson('trv:SetReceiverModeResponse'));
};
/**
*
* Determines whether the receiver is currently disconnected, connected or
* attempting to connect.
* This operation is mandatory.
*
*/
ONVIFReceiver.GetReceiverState = function (ReceiverToken) {
return createStandardRequestBodyFromString(generateRequestElements('trv:GetReceiverState')({ trv_ReceiverToken: ReceiverToken }))
.map(mapResponseXmlToJson('trv:GetReceiverStateResponse'));
};
/**
* Returns the capabilities of the receiver service. The result is returned in a typed answer.
*/
ONVIFReceiver.prototype.GetServiceCapabilities = function () {
return ONVIFReceiver.GetServiceCapabilities().run(this.config);
};
/**
*
* Lists all receivers currently present on a device. This operation is mandatory.
*
*/
ONVIFReceiver.prototype.GetReceivers = function () {
return ONVIFReceiver.GetReceivers().run(this.config);
};
/**
*
* Retrieves the details of a specific receiver. This operation is mandatory.
*
*/
ONVIFReceiver.prototype.GetReceiver = function (ReceiverToken) {
return ONVIFReceiver.GetReceiver(ReceiverToken).run(this.config);
};
/**
*
* Creates a new receiver. This operation is mandatory, although the service may
* raise a fault if the receiver cannot be created.
*
*/
ONVIFReceiver.prototype.CreateReceiver = function (Configuration) {
return ONVIFReceiver.CreateReceiver(Configuration).run(this.config);
};
/**
*
* Deletes an existing receiver. A receiver may be deleted only if it is not
* currently in use; otherwise a fault shall be raised.
* This operation is mandatory.
*
*/
ONVIFReceiver.prototype.DeleteReceiver = function (ReceiverToken) {
return ONVIFReceiver.DeleteReceiver(ReceiverToken).run(this.config);
};
/**
*
* Configures an existing receiver. This operation is mandatory.
*
*/
ONVIFReceiver.prototype.ConfigureReceiver = function (ReceiverToken, Configuration) {
return ONVIFReceiver.ConfigureReceiver(ReceiverToken, Configuration).run(this.config);
};
/**
*
* Sets the mode of the receiver without affecting the rest of its configuration.
* This operation is mandatory.
*
*/
ONVIFReceiver.prototype.SetReceiverMode = function (ReceiverToken, Mode) {
return ONVIFReceiver.SetReceiverMode(ReceiverToken, Mode).run(this.config);
};
/**
*
* Determines whether the receiver is currently disconnected, connected or
* attempting to connect.
* This operation is mandatory.
*
*/
ONVIFReceiver.prototype.GetReceiverState = function (ReceiverToken) {
return ONVIFReceiver.GetReceiverState(ReceiverToken).run(this.config);
};
return ONVIFReceiver;
}());
var ONVIFRecording = /** @class */ (function () {
function ONVIFRecording(config) {
this.config = config;
}
/**
* Returns the capabilities of the recording service. The result is returned in a typed answer.
*/
ONVIFRecording.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('trc:GetServiceCapabilitiesResponse'));
};
/**
* CreateRecording shall create a new recording. The new recording shall be created with a track
* for each supported TrackType see Recording Control Spec.
* This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.
* When successfully completed, CreateRecording shall have created three tracks with the following configurations:
*
* TrackToken TrackType
*
* VIDEO001 Video
*
* AUDIO001 Audio
*
* META001 Metadata
*
* All TrackConfigurations shall have the MaximumRetentionTime set to 0 (unlimited), and the
* Description set to the empty string.
*
*/
ONVIFRecording.CreateRecording = function (RecordingConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:CreateRecording')({ trc_RecordingConfiguration: RecordingConfiguration }))
.map(mapResponseXmlToJson('trc:CreateRecordingResponse'));
};
/**
* DeleteRecording shall delete a recording object. Whenever a recording is deleted, the device
* shall delete all the tracks that are part of the recording, and it shall delete all the Recording
* Jobs that record into the recording. For each deleted recording job, the device shall also
* delete all the receiver objects associated with the recording job that are automatically created
* using the AutoCreateReceiver field of the recording job configuration structure and are not
* used in any other recording job.
* This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.
*
*/
ONVIFRecording.DeleteRecording = function (RecordingToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:DeleteRecording')({ trc_RecordingToken: RecordingToken }))
.map(mapResponseXmlToJson('trc:DeleteRecordingResponse'));
};
/**
* GetRecordings shall return a description of all the recordings in the device. This description
* shall include a list of all the tracks for each recording.
*/
ONVIFRecording.GetRecordings = function () {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordings')({}))
.map(mapResponseXmlToJson('trc:GetRecordingsResponse'));
};
/**
* SetRecordingConfiguration shall change the configuration of a recording.
*/
ONVIFRecording.SetRecordingConfiguration = function (RecordingToken, RecordingConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:SetRecordingConfiguration')({ trc_RecordingToken: RecordingToken, trc_RecordingConfiguration: RecordingConfiguration }))
.map(mapResponseXmlToJson('trc:SetRecordingConfigurationResponse'));
};
/**
* GetRecordingConfiguration shall retrieve the recording configuration for a recording.
*/
ONVIFRecording.GetRecordingConfiguration = function (RecordingToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordingConfiguration')({ trc_RecordingToken: RecordingToken }))
.map(mapResponseXmlToJson('trc:GetRecordingConfigurationResponse'));
};
/**
* GetRecordingOptions returns information for a recording identified by the RecordingToken. The information includes the number of additonal tracks as well as recording jobs that can be configured.
*/
ONVIFRecording.GetRecordingOptions = function (RecordingToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordingOptions')({ trc_RecordingToken: RecordingToken }))
.map(mapResponseXmlToJson('trc:GetRecordingOptionsResponse'));
};
/**
* This method shall create a new track within a recording.
* This method is optional. It shall be available if the Recording/DynamicTracks capability is TRUE.
* A TrackToken in itself does not uniquely identify a specific track. Tracks within different
* recordings may have the same TrackToken.
*
*/
ONVIFRecording.CreateTrack = function (RecordingToken, TrackConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:CreateTrack')({ trc_RecordingToken: RecordingToken, trc_TrackConfiguration: TrackConfiguration }))
.map(mapResponseXmlToJson('trc:CreateTrackResponse'));
};
/**
* DeleteTrack shall remove a track from a recording. All the data in the track shall be deleted.
* This method is optional. It shall be available if the Recording/DynamicTracks capability is
* TRUE.
*/
ONVIFRecording.DeleteTrack = function (RecordingToken, TrackToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:DeleteTrack')({ trc_RecordingToken: RecordingToken, trc_TrackToken: TrackToken }))
.map(mapResponseXmlToJson('trc:DeleteTrackResponse'));
};
/**
* GetTrackConfiguration shall retrieve the configuration for a specific track.
*/
ONVIFRecording.GetTrackConfiguration = function (RecordingToken, TrackToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetTrackConfiguration')({ trc_RecordingToken: RecordingToken, trc_TrackToken: TrackToken }))
.map(mapResponseXmlToJson('trc:GetTrackConfigurationResponse'));
};
/**
* SetTrackConfiguration shall change the configuration of a track.
*/
ONVIFRecording.SetTrackConfiguration = function (RecordingToken, TrackToken, TrackConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:SetTrackConfiguration')({ trc_RecordingToken: RecordingToken, trc_TrackToken: TrackToken, trc_TrackConfiguration: TrackConfiguration }))
.map(mapResponseXmlToJson('trc:SetTrackConfigurationResponse'));
};
/**
* CreateRecordingJob shall create a new recording job.
* The JobConfiguration returned from CreateRecordingJob shall be identical to the
* JobConfiguration passed into CreateRecordingJob, except for the ReceiverToken and the
* AutoCreateReceiver. In the returned structure, the ReceiverToken shall be present and valid
* and the AutoCreateReceiver field shall be omitted.
*
*/
ONVIFRecording.CreateRecordingJob = function (JobConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:CreateRecordingJob')({ trc_JobConfiguration: JobConfiguration }))
.map(mapResponseXmlToJson('trc:CreateRecordingJobResponse'));
};
/**
* DeleteRecordingJob removes a recording job. It shall also implicitly delete all the receiver
* objects associated with the recording job that are automatically created using the
* AutoCreateReceiver field of the recording job configuration structure and are not used in any
* other recording job.
*/
ONVIFRecording.DeleteRecordingJob = function (JobToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:DeleteRecordingJob')({ trc_JobToken: JobToken }))
.map(mapResponseXmlToJson('trc:DeleteRecordingJobResponse'));
};
/**
* GetRecordingJobs shall return a list of all the recording jobs in the device.
*/
ONVIFRecording.GetRecordingJobs = function () {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordingJobs')({}))
.map(mapResponseXmlToJson('trc:GetRecordingJobsResponse'));
};
/**
* SetRecordingJobConfiguration shall change the configuration for a recording job.
* SetRecordingJobConfiguration shall implicitly delete any receiver objects that were created
* automatically if they are no longer used as a result of changing the recording job configuration.
*
*/
ONVIFRecording.SetRecordingJobConfiguration = function (JobToken, JobConfiguration) {
return createStandardRequestBodyFromString(generateRequestElements('trc:SetRecordingJobConfiguration')({ trc_JobToken: JobToken, trc_JobConfiguration: JobConfiguration }))
.map(mapResponseXmlToJson('trc:SetRecordingJobConfigurationResponse'));
};
/**
* GetRecordingJobConfiguration shall return the current configuration for a recording job.
*/
ONVIFRecording.GetRecordingJobConfiguration = function (JobToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordingJobConfiguration')({ trc_JobToken: JobToken }))
.map(mapResponseXmlToJson('trc:GetRecordingJobConfigurationResponse'));
};
/**
* SetRecordingJobMode shall change the mode of the recording job. Using this method shall be
* equivalent to retrieving the recording job configuration, and writing it back with a different
* mode.
*/
ONVIFRecording.SetRecordingJobMode = function (JobToken, Mode) {
return createStandardRequestBodyFromString(generateRequestElements('trc:SetRecordingJobMode')({ trc_JobToken: JobToken, trc_Mode: Mode }))
.map(mapResponseXmlToJson('trc:SetRecordingJobModeResponse'));
};
/**
* GetRecordingJobState returns the state of a recording job. It includes an aggregated state,
* and state for each track of the recording job.
*/
ONVIFRecording.GetRecordingJobState = function (JobToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetRecordingJobState')({ trc_JobToken: JobToken }))
.map(mapResponseXmlToJson('trc:GetRecordingJobStateResponse'));
};
/**
*
* Exports the selected recordings (from existing recorded data) to the given storage target based on the requested file format.
*
*/
ONVIFRecording.ExportRecordedData = function (SearchScope, FileFormat, StorageDestination, StartPoint, EndPoint) {
return createStandardRequestBodyFromString(generateRequestElements('trc:ExportRecordedData')({ trc_SearchScope: SearchScope, trc_FileFormat: FileFormat, trc_StorageDestination: StorageDestination, trc_StartPoint: StartPoint, trc_EndPoint: EndPoint }))
.map(mapResponseXmlToJson('trc:ExportRecordedDataResponse'));
};
/**
*
* Stops the selected ExportRecordedData operation.
*
*/
ONVIFRecording.StopExportRecordedData = function (OperationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:StopExportRecordedData')({ trc_OperationToken: OperationToken }))
.map(mapResponseXmlToJson('trc:StopExportRecordedDataResponse'));
};
/**
*
* Retrieves the status of selected ExportRecordedData operation.
*
*/
ONVIFRecording.GetExportRecordedDataState = function (OperationToken) {
return createStandardRequestBodyFromString(generateRequestElements('trc:GetExportRecordedDataState')({ trc_OperationToken: OperationToken }))
.map(mapResponseXmlToJson('trc:GetExportRecordedDataStateResponse'));
};
/**
* Returns the capabilities of the recording service. The result is returned in a typed answer.
*/
ONVIFRecording.prototype.GetServiceCapabilities = function () {
return ONVIFRecording.GetServiceCapabilities().run(this.config);
};
/**
* CreateRecording shall create a new recording. The new recording shall be created with a track
* for each supported TrackType see Recording Control Spec.
* This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.
* When successfully completed, CreateRecording shall have created three tracks with the following configurations:
*
* TrackToken TrackType
*
* VIDEO001 Video
*
* AUDIO001 Audio
*
* META001 Metadata
*
* All TrackConfigurations shall have the MaximumRetentionTime set to 0 (unlimited), and the
* Description set to the empty string.
*
*/
ONVIFRecording.prototype.CreateRecording = function (RecordingConfiguration) {
return ONVIFRecording.CreateRecording(RecordingConfiguration).run(this.config);
};
/**
* DeleteRecording shall delete a recording object. Whenever a recording is deleted, the device
* shall delete all the tracks that are part of the recording, and it shall delete all the Recording
* Jobs that record into the recording. For each deleted recording job, the device shall also
* delete all the receiver objects associated with the recording job that are automatically created
* using the AutoCreateReceiver field of the recording job configuration structure and are not
* used in any other recording job.
* This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.
*
*/
ONVIFRecording.prototype.DeleteRecording = function (RecordingToken) {
return ONVIFRecording.DeleteRecording(RecordingToken).run(this.config);
};
/**
* GetRecordings shall return a description of all the recordings in the device. This description
* shall include a list of all the tracks for each recording.
*/
ONVIFRecording.prototype.GetRecordings = function () {
return ONVIFRecording.GetRecordings().run(this.config);
};
/**
* SetRecordingConfiguration shall change the configuration of a recording.
*/
ONVIFRecording.prototype.SetRecordingConfiguration = function (RecordingToken, RecordingConfiguration) {
return ONVIFRecording.SetRecordingConfiguration(RecordingToken, RecordingConfiguration).run(this.config);
};
/**
* GetRecordingConfiguration shall retrieve the recording configuration for a recording.
*/
ONVIFRecording.prototype.GetRecordingConfiguration = function (RecordingToken) {
return ONVIFRecording.GetRecordingConfiguration(RecordingToken).run(this.config);
};
/**
* GetRecordingOptions returns information for a recording identified by the RecordingToken. The information includes the number of additonal tracks as well as recording jobs that can be configured.
*/
ONVIFRecording.prototype.GetRecordingOptions = function (RecordingToken) {
return ONVIFRecording.GetRecordingOptions(RecordingToken).run(this.config);
};
/**
* This method shall create a new track within a recording.
* This method is optional. It shall be available if the Recording/DynamicTracks capability is TRUE.
* A TrackToken in itself does not uniquely identify a specific track. Tracks within different
* recordings may have the same TrackToken.
*
*/
ONVIFRecording.prototype.CreateTrack = function (RecordingToken, TrackConfiguration) {
return ONVIFRecording.CreateTrack(RecordingToken, TrackConfiguration).run(this.config);
};
/**
* DeleteTrack shall remove a track from a recording. All the data in the track shall be deleted.
* This method is optional. It shall be available if the Recording/DynamicTracks capability is
* TRUE.
*/
ONVIFRecording.prototype.DeleteTrack = function (RecordingToken, TrackToken) {
return ONVIFRecording.DeleteTrack(RecordingToken, TrackToken).run(this.config);
};
/**
* GetTrackConfiguration shall retrieve the configuration for a specific track.
*/
ONVIFRecording.prototype.GetTrackConfiguration = function (RecordingToken, TrackToken) {
return ONVIFRecording.GetTrackConfiguration(RecordingToken, TrackToken).run(this.config);
};
/**
* SetTrackConfiguration shall change the configuration of a track.
*/
ONVIFRecording.prototype.SetTrackConfiguration = function (RecordingToken, TrackToken, TrackConfiguration) {
return ONVIFRecording.SetTrackConfiguration(RecordingToken, TrackToken, TrackConfiguration).run(this.config);
};
/**
* CreateRecordingJob shall create a new recording job.
* The JobConfiguration returned from CreateRecordingJob shall be identical to the
* JobConfiguration passed into CreateRecordingJob, except for the ReceiverToken and the
* AutoCreateReceiver. In the returned structure, the ReceiverToken shall be present and valid
* and the AutoCreateReceiver field shall be omitted.
*
*/
ONVIFRecording.prototype.CreateRecordingJob = function (JobConfiguration) {
return ONVIFRecording.CreateRecordingJob(JobConfiguration).run(this.config);
};
/**
* DeleteRecordingJob removes a recording job. It shall also implicitly delete all the receiver
* objects associated with the recording job that are automatically created using the
* AutoCreateReceiver field of the recording job configuration structure and are not used in any
* other recording job.
*/
ONVIFRecording.prototype.DeleteRecordingJob = function (JobToken) {
return ONVIFRecording.DeleteRecordingJob(JobToken).run(this.config);
};
/**
* GetRecordingJobs shall return a list of all the recording jobs in the device.
*/
ONVIFRecording.prototype.GetRecordingJobs = function () {
return ONVIFRecording.GetRecordingJobs().run(this.config);
};
/**
* SetRecordingJobConfiguration shall change the configuration for a recording job.
* SetRecordingJobConfiguration shall implicitly delete any receiver objects that were created
* automatically if they are no longer used as a result of changing the recording job configuration.
*
*/
ONVIFRecording.prototype.SetRecordingJobConfiguration = function (JobToken, JobConfiguration) {
return ONVIFRecording.SetRecordingJobConfiguration(JobToken, JobConfiguration).run(this.config);
};
/**
* GetRecordingJobConfiguration shall return the current configuration for a recording job.
*/
ONVIFRecording.prototype.GetRecordingJobConfiguration = function (JobToken) {
return ONVIFRecording.GetRecordingJobConfiguration(JobToken).run(this.config);
};
/**
* SetRecordingJobMode shall change the mode of the recording job. Using this method shall be
* equivalent to retrieving the recording job configuration, and writing it back with a different
* mode.
*/
ONVIFRecording.prototype.SetRecordingJobMode = function (JobToken, Mode) {
return ONVIFRecording.SetRecordingJobMode(JobToken, Mode).run(this.config);
};
/**
* GetRecordingJobState returns the state of a recording job. It includes an aggregated state,
* and state for each track of the recording job.
*/
ONVIFRecording.prototype.GetRecordingJobState = function (JobToken) {
return ONVIFRecording.GetRecordingJobState(JobToken).run(this.config);
};
/**
*
* Exports the selected recordings (from existing recorded data) to the given storage target based on the requested file format.
*
*/
ONVIFRecording.prototype.ExportRecordedData = function (SearchScope, FileFormat, StorageDestination, StartPoint, EndPoint) {
return ONVIFRecording.ExportRecordedData(SearchScope, FileFormat, StorageDestination, StartPoint, EndPoint).run(this.config);
};
/**
*
* Stops the selected ExportRecordedData operation.
*
*/
ONVIFRecording.prototype.StopExportRecordedData = function (OperationToken) {
return ONVIFRecording.StopExportRecordedData(OperationToken).run(this.config);
};
/**
*
* Retrieves the status of selected ExportRecordedData operation.
*
*/
ONVIFRecording.prototype.GetExportRecordedDataState = function (OperationToken) {
return ONVIFRecording.GetExportRecordedDataState(OperationToken).run(this.config);
};
return ONVIFRecording;
}());
var ONVIFReplay = /** @class */ (function () {
function ONVIFReplay(config) {
this.config = config;
}
/**
* Returns the capabilities of the replay service. The result is returned in a typed answer.
*/
ONVIFReplay.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('trp:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('trp:GetServiceCapabilitiesResponse'));
};
/**
*
* Requests a URI that can be used to initiate playback of a recorded stream
* using RTSP as the control protocol. The URI is valid only as it is
* specified in the response.
* A device supporting the Replay Service shall support the GetReplayUri command.
*
*/
ONVIFReplay.GetReplayUri = function (StreamSetup, RecordingToken) {
return createStandardRequestBodyFromString(generateRequestElements('trp:GetReplayUri')({ trp_StreamSetup: StreamSetup, trp_RecordingToken: RecordingToken }))
.map(mapResponseXmlToJson('trp:GetReplayUriResponse'));
};
/**
*
* Returns the current configuration of the replay service.
* This operation is mandatory.
*
*/
ONVIFReplay.GetReplayConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('trp:GetReplayConfiguration')({}))
.map(mapResponseXmlToJson('trp:GetReplayConfigurationResponse'));
};
/**
*
* Changes the current configuration of the replay service.
* This operation is mandatory.
*
*/
ONVIFReplay.SetReplayConfiguration = function (Configuration) {
return createStandardRequestBodyFromString(generateRequestElements('trp:SetReplayConfiguration')({ trp_Configuration: Configuration }))
.map(mapResponseXmlToJson('trp:SetReplayConfigurationResponse'));
};
/**
* Returns the capabilities of the replay service. The result is returned in a typed answer.
*/
ONVIFReplay.prototype.GetServiceCapabilities = function () {
return ONVIFReplay.GetServiceCapabilities().run(this.config);
};
/**
*
* Requests a URI that can be used to initiate playback of a recorded stream
* using RTSP as the control protocol. The URI is valid only as it is
* specified in the response.
* A device supporting the Replay Service shall support the GetReplayUri command.
*
*/
ONVIFReplay.prototype.GetReplayUri = function (StreamSetup, RecordingToken) {
return ONVIFReplay.GetReplayUri(StreamSetup, RecordingToken).run(this.config);
};
/**
*
* Returns the current configuration of the replay service.
* This operation is mandatory.
*
*/
ONVIFReplay.prototype.GetReplayConfiguration = function () {
return ONVIFReplay.GetReplayConfiguration().run(this.config);
};
/**
*
* Changes the current configuration of the replay service.
* This operation is mandatory.
*
*/
ONVIFReplay.prototype.SetReplayConfiguration = function (Configuration) {
return ONVIFReplay.SetReplayConfiguration(Configuration).run(this.config);
};
return ONVIFReplay;
}());
var ONVIFSearch = /** @class */ (function () {
function ONVIFSearch(config) {
this.config = config;
}
/**
* Returns the capabilities of the search service. The result is returned in a typed answer.
*/
ONVIFSearch.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tse:GetServiceCapabilitiesResponse'));
};
/**
* GetRecordingSummary is used to get a summary description of all recorded data. This
* operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.GetRecordingSummary = function () {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetRecordingSummary')({}))
.map(mapResponseXmlToJson('tse:GetRecordingSummaryResponse'));
};
/**
* Returns information about a single Recording specified by a RecordingToken. This operation
* is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.GetRecordingInformation = function (RecordingToken) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetRecordingInformation')({ tse_RecordingToken: RecordingToken }))
.map(mapResponseXmlToJson('tse:GetRecordingInformationResponse'));
};
/**
* Returns a set of media attributes for all tracks of the specified recordings at a specified point
* in time. Clients using this operation shall be able to use it as a non blocking operation. A
* device shall set the starttime and endtime of the MediaAttributes structure to equal values if
* calculating this range would causes this operation to block. See MediaAttributes structure for
* more information. This operation is mandatory to support for a device implementing the
* recording search service.
*/
ONVIFSearch.GetMediaAttributes = function (Time, RecordingTokens) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetMediaAttributes')({ tse_Time: Time, tse_RecordingTokens: RecordingTokens }))
.map(mapResponseXmlToJson('tse:GetMediaAttributesResponse'));
};
/**
* FindRecordings starts a search session, looking for recordings that matches the scope (See
* 20.2.4) defined in the request. Results from the search are acquired using the
* GetRecordingSearchResults request, specifying the search token returned from this request.
* The device shall continue searching until one of the following occurs:
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* The order of the results is undefined, to allow the device to return results in any order they
* are found. This operation is mandatory to support for a device implementing the recording
* search service.
*/
ONVIFSearch.FindRecordings = function (Scope, KeepAliveTime, MaxMatches) {
return createStandardRequestBodyFromString(generateRequestElements('tse:FindRecordings')({ tse_Scope: Scope, tse_KeepAliveTime: KeepAliveTime, tse_MaxMatches: MaxMatches }))
.map(mapResponseXmlToJson('tse:FindRecordingsResponse'));
};
/**
* GetRecordingSearchResults acquires the results from a recording search session previously
* initiated by a FindRecordings operation. The response shall not include results already
* returned in previous requests for the same session. If MaxResults is specified, the response
* shall not contain more than MaxResults results. The number of results relates to the number of recordings.
* For viewing individual recorded data for a signal track use the FindEvents method.
* GetRecordingSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.GetRecordingSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetRecordingSearchResults')({ tse_SearchToken: SearchToken, tse_MinResults: MinResults, tse_MaxResults: MaxResults, tse_WaitTime: WaitTime }))
.map(mapResponseXmlToJson('tse:GetRecordingSearchResultsResponse'));
};
/**
* FindEvents starts a search session, looking for recording events (in the scope that
* matches the search filter defined in the request. Results from the search are
* acquired using the GetEventSearchResults request, specifying the search token returned from
* this request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* Results shall be ordered by time, ascending in case of forward search, or descending in case
* of backward search. This operation is mandatory to support for a device implementing the
* recording search service.
*/
ONVIFSearch.FindEvents = function (StartPoint, Scope, SearchFilter, IncludeStartState, KeepAliveTime, EndPoint, MaxMatches) {
return createStandardRequestBodyFromString(generateRequestElements('tse:FindEvents')({ tse_StartPoint: StartPoint, tse_Scope: Scope, tse_SearchFilter: SearchFilter, tse_IncludeStartState: IncludeStartState, tse_KeepAliveTime: KeepAliveTime, tse_EndPoint: EndPoint, tse_MaxMatches: MaxMatches }))
.map(mapResponseXmlToJson('tse:FindEventsResponse'));
};
/**
* GetEventSearchResults acquires the results from a recording event search session previously
* initiated by a FindEvents operation. The response shall not include results already returned in
* previous requests for the same session. If MaxResults is specified, the response shall not
* contain more than MaxResults results.
* GetEventSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.GetEventSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetEventSearchResults')({ tse_SearchToken: SearchToken, tse_MinResults: MinResults, tse_MaxResults: MaxResults, tse_WaitTime: WaitTime }))
.map(mapResponseXmlToJson('tse:GetEventSearchResultsResponse'));
};
/**
* FindPTZPosition starts a search session, looking for ptz positions in the scope (See 20.2.4)
* that matches the search filter defined in the request. Results from the search are acquired
* using the GetPTZPositionSearchResults request, specifying the search token returned from
* this request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* This operation is mandatory to support whenever CanContainPTZ is true for any metadata
* track in any recording on the device.
*/
ONVIFSearch.FindPTZPosition = function (StartPoint, Scope, SearchFilter, KeepAliveTime, EndPoint, MaxMatches) {
return createStandardRequestBodyFromString(generateRequestElements('tse:FindPTZPosition')({ tse_StartPoint: StartPoint, tse_Scope: Scope, tse_SearchFilter: SearchFilter, tse_KeepAliveTime: KeepAliveTime, tse_EndPoint: EndPoint, tse_MaxMatches: MaxMatches }))
.map(mapResponseXmlToJson('tse:FindPTZPositionResponse'));
};
/**
* GetPTZPositionSearchResults acquires the results from a ptz position search session
* previously initiated by a FindPTZPosition operation. The response shall not include results
* already returned in previous requests for the same session. If MaxResults is specified, the
* response shall not contain more than MaxResults results.
* GetPTZPositionSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support whenever CanContainPTZ is true for any metadata
* track in any recording on the device.
*/
ONVIFSearch.GetPTZPositionSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetPTZPositionSearchResults')({ tse_SearchToken: SearchToken, tse_MinResults: MinResults, tse_MaxResults: MaxResults, tse_WaitTime: WaitTime }))
.map(mapResponseXmlToJson('tse:GetPTZPositionSearchResultsResponse'));
};
/**
* GetSearchState returns the current state of the specified search session. This command is deprecated .
*/
ONVIFSearch.GetSearchState = function (SearchToken) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetSearchState')({ tse_SearchToken: SearchToken }))
.map(mapResponseXmlToJson('tse:GetSearchStateResponse'));
};
/**
* EndSearch stops and ongoing search session, causing any blocking result request to return
* and the SearchToken to become invalid. If the search was interrupted before completion, the
* point in time that the search had reached shall be returned. If the search had not yet begun,
* the StartPoint shall be returned. If the search was completed the original EndPoint supplied
* by the Find operation shall be returned. When issuing EndSearch on a FindRecordings request the
* EndPoint is undefined and shall not be used since the FindRecordings request doesn't have
* StartPoint/EndPoint. This operation is mandatory to support for a device implementing the
* recording search service.
*
*/
ONVIFSearch.EndSearch = function (SearchToken) {
return createStandardRequestBodyFromString(generateRequestElements('tse:EndSearch')({ tse_SearchToken: SearchToken }))
.map(mapResponseXmlToJson('tse:EndSearchResponse'));
};
/**
* FindMetadata starts a search session, looking for metadata in the scope (See 20.2.4) that
* matches the search filter defined in the request. Results from the search are acquired using
* the GetMetadataSearchResults request, specifying the search token returned from this
* request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* This operation is mandatory to support if the MetaDataSearch capability is set to true in the
* SearchCapabilities structure return by the GetCapabilities command in the Device service.
*/
ONVIFSearch.FindMetadata = function (StartPoint, Scope, MetadataFilter, KeepAliveTime, EndPoint, MaxMatches) {
return createStandardRequestBodyFromString(generateRequestElements('tse:FindMetadata')({ tse_StartPoint: StartPoint, tse_Scope: Scope, tse_MetadataFilter: MetadataFilter, tse_KeepAliveTime: KeepAliveTime, tse_EndPoint: EndPoint, tse_MaxMatches: MaxMatches }))
.map(mapResponseXmlToJson('tse:FindMetadataResponse'));
};
/**
* GetMetadataSearchResults acquires the results from a recording search session previously
* initiated by a FindMetadata operation. The response shall not include results already returned
* in previous requests for the same session. If MaxResults is specified, the response shall not
* contain more than MaxResults results.
* GetMetadataSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support if the MetaDataSearch capability is set to true in the
* SearchCapabilities structure return by the GetCapabilities command in the Device service.
*/
ONVIFSearch.GetMetadataSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return createStandardRequestBodyFromString(generateRequestElements('tse:GetMetadataSearchResults')({ tse_SearchToken: SearchToken, tse_MinResults: MinResults, tse_MaxResults: MaxResults, tse_WaitTime: WaitTime }))
.map(mapResponseXmlToJson('tse:GetMetadataSearchResultsResponse'));
};
/**
* Returns the capabilities of the search service. The result is returned in a typed answer.
*/
ONVIFSearch.prototype.GetServiceCapabilities = function () {
return ONVIFSearch.GetServiceCapabilities().run(this.config);
};
/**
* GetRecordingSummary is used to get a summary description of all recorded data. This
* operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.prototype.GetRecordingSummary = function () {
return ONVIFSearch.GetRecordingSummary().run(this.config);
};
/**
* Returns information about a single Recording specified by a RecordingToken. This operation
* is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.prototype.GetRecordingInformation = function (RecordingToken) {
return ONVIFSearch.GetRecordingInformation(RecordingToken).run(this.config);
};
/**
* Returns a set of media attributes for all tracks of the specified recordings at a specified point
* in time. Clients using this operation shall be able to use it as a non blocking operation. A
* device shall set the starttime and endtime of the MediaAttributes structure to equal values if
* calculating this range would causes this operation to block. See MediaAttributes structure for
* more information. This operation is mandatory to support for a device implementing the
* recording search service.
*/
ONVIFSearch.prototype.GetMediaAttributes = function (Time, RecordingTokens) {
return ONVIFSearch.GetMediaAttributes(Time, RecordingTokens).run(this.config);
};
/**
* FindRecordings starts a search session, looking for recordings that matches the scope (See
* 20.2.4) defined in the request. Results from the search are acquired using the
* GetRecordingSearchResults request, specifying the search token returned from this request.
* The device shall continue searching until one of the following occurs:
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* The order of the results is undefined, to allow the device to return results in any order they
* are found. This operation is mandatory to support for a device implementing the recording
* search service.
*/
ONVIFSearch.prototype.FindRecordings = function (Scope, KeepAliveTime, MaxMatches) {
return ONVIFSearch.FindRecordings(Scope, KeepAliveTime, MaxMatches).run(this.config);
};
/**
* GetRecordingSearchResults acquires the results from a recording search session previously
* initiated by a FindRecordings operation. The response shall not include results already
* returned in previous requests for the same session. If MaxResults is specified, the response
* shall not contain more than MaxResults results. The number of results relates to the number of recordings.
* For viewing individual recorded data for a signal track use the FindEvents method.
* GetRecordingSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.prototype.GetRecordingSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return ONVIFSearch.GetRecordingSearchResults(SearchToken, MinResults, MaxResults, WaitTime).run(this.config);
};
/**
* FindEvents starts a search session, looking for recording events (in the scope that
* matches the search filter defined in the request. Results from the search are
* acquired using the GetEventSearchResults request, specifying the search token returned from
* this request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* Results shall be ordered by time, ascending in case of forward search, or descending in case
* of backward search. This operation is mandatory to support for a device implementing the
* recording search service.
*/
ONVIFSearch.prototype.FindEvents = function (StartPoint, Scope, SearchFilter, IncludeStartState, KeepAliveTime, EndPoint, MaxMatches) {
return ONVIFSearch.FindEvents(StartPoint, Scope, SearchFilter, IncludeStartState, KeepAliveTime, EndPoint, MaxMatches).run(this.config);
};
/**
* GetEventSearchResults acquires the results from a recording event search session previously
* initiated by a FindEvents operation. The response shall not include results already returned in
* previous requests for the same session. If MaxResults is specified, the response shall not
* contain more than MaxResults results.
* GetEventSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support for a device implementing the recording search service.
*/
ONVIFSearch.prototype.GetEventSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return ONVIFSearch.GetEventSearchResults(SearchToken, MinResults, MaxResults, WaitTime).run(this.config);
};
/**
* FindPTZPosition starts a search session, looking for ptz positions in the scope (See 20.2.4)
* that matches the search filter defined in the request. Results from the search are acquired
* using the GetPTZPositionSearchResults request, specifying the search token returned from
* this request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* This operation is mandatory to support whenever CanContainPTZ is true for any metadata
* track in any recording on the device.
*/
ONVIFSearch.prototype.FindPTZPosition = function (StartPoint, Scope, SearchFilter, KeepAliveTime, EndPoint, MaxMatches) {
return ONVIFSearch.FindPTZPosition(StartPoint, Scope, SearchFilter, KeepAliveTime, EndPoint, MaxMatches).run(this.config);
};
/**
* GetPTZPositionSearchResults acquires the results from a ptz position search session
* previously initiated by a FindPTZPosition operation. The response shall not include results
* already returned in previous requests for the same session. If MaxResults is specified, the
* response shall not contain more than MaxResults results.
* GetPTZPositionSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support whenever CanContainPTZ is true for any metadata
* track in any recording on the device.
*/
ONVIFSearch.prototype.GetPTZPositionSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return ONVIFSearch.GetPTZPositionSearchResults(SearchToken, MinResults, MaxResults, WaitTime).run(this.config);
};
/**
* GetSearchState returns the current state of the specified search session. This command is deprecated .
*/
ONVIFSearch.prototype.GetSearchState = function (SearchToken) {
return ONVIFSearch.GetSearchState(SearchToken).run(this.config);
};
/**
* EndSearch stops and ongoing search session, causing any blocking result request to return
* and the SearchToken to become invalid. If the search was interrupted before completion, the
* point in time that the search had reached shall be returned. If the search had not yet begun,
* the StartPoint shall be returned. If the search was completed the original EndPoint supplied
* by the Find operation shall be returned. When issuing EndSearch on a FindRecordings request the
* EndPoint is undefined and shall not be used since the FindRecordings request doesn't have
* StartPoint/EndPoint. This operation is mandatory to support for a device implementing the
* recording search service.
*
*/
ONVIFSearch.prototype.EndSearch = function (SearchToken) {
return ONVIFSearch.EndSearch(SearchToken).run(this.config);
};
/**
* FindMetadata starts a search session, looking for metadata in the scope (See 20.2.4) that
* matches the search filter defined in the request. Results from the search are acquired using
* the GetMetadataSearchResults request, specifying the search token returned from this
* request.
* The device shall continue searching until one of the following occurs:
*
* The entire time range from StartPoint to EndPoint has been searched through.
* The total number of matches has been found, defined by the MaxMatches parameter.
* The session has been ended by a client EndSession request.
* The session has been ended because KeepAliveTime since the last request related to
* this session has expired.
*
* This operation is mandatory to support if the MetaDataSearch capability is set to true in the
* SearchCapabilities structure return by the GetCapabilities command in the Device service.
*/
ONVIFSearch.prototype.FindMetadata = function (StartPoint, Scope, MetadataFilter, KeepAliveTime, EndPoint, MaxMatches) {
return ONVIFSearch.FindMetadata(StartPoint, Scope, MetadataFilter, KeepAliveTime, EndPoint, MaxMatches).run(this.config);
};
/**
* GetMetadataSearchResults acquires the results from a recording search session previously
* initiated by a FindMetadata operation. The response shall not include results already returned
* in previous requests for the same session. If MaxResults is specified, the response shall not
* contain more than MaxResults results.
* GetMetadataSearchResults shall block until:
*
* MaxResults results are available for the response if MaxResults is specified.
* MinResults results are available for the response if MinResults is specified.
* WaitTime has expired.
* Search is completed or stopped.
*
* This operation is mandatory to support if the MetaDataSearch capability is set to true in the
* SearchCapabilities structure return by the GetCapabilities command in the Device service.
*/
ONVIFSearch.prototype.GetMetadataSearchResults = function (SearchToken, MinResults, MaxResults, WaitTime) {
return ONVIFSearch.GetMetadataSearchResults(SearchToken, MinResults, MaxResults, WaitTime).run(this.config);
};
return ONVIFSearch;
}());
var ONVIFAdvancedSecurity = /** @class */ (function () {
function ONVIFAdvancedSecurity(config) {
this.config = config;
}
/**
* Returns the capabilities of the security configuraiton service. The result is returned in a typed answer.
*/
ONVIFAdvancedSecurity.GetServiceCapabilities = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetServiceCapabilities')({}))
.map(mapResponseXmlToJson('tas:GetServiceCapabilitiesResponse'));
};
/**
*
* This operation triggers the asynchronous generation of an RSA key pair of a particular key length (specified as the number of bits) as specified in [RFC 3447], with a suitable key generation mechanism on the device.
* Keys, especially RSA key pairs, are uniquely identified using key IDs.
* If the device does not have not enough storage capacity for storing the key pair to be created, the maximum number of keys reached fault shall be produced and no key pair shall be generated.
* Otherwise, the operation generates a keyID for the new key and associates the generating status to it.
* Immediately after key generation has started, the device shall return the keyID to the client and continue to generate the key pair.
* The client may query the device with the GetKeyStatus operation whether the generation has finished.
* The client may also subscribe to Key Status events to be notified about key status changes.
* The device also returns a best-effort estimate of how much time it requires to create the key pair.
* A client may use this information as an indication how long to wait before querying the device whether key generation is completed.
* After the key has been successfully created, the device shall assign it the ok status. If the key generation fails, the device shall assign the key the corrupt status.
*
*/
ONVIFAdvancedSecurity.CreateRSAKeyPair = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:CreateRSAKeyPair')({}))
.map(mapResponseXmlToJson('tas:CreateRSAKeyPairResponse'));
};
/**
*
* This operation uploads a key pair in a PKCS#8 data structure as specified in [RFC 5958, RFC 5959].
* If an encryption passphrase ID is supplied in the request, the device shall assume that the KeyPair parameter contains an EncryptedPrivateKeyInfo ASN.1
* structure that is encrypted under the passphrase in the keystore that corresponds to the supplied ID, where the EncryptedPrivateKeyInfo structure contains
* both the private key and the corresponding public key. If no encryption passphrase ID is supplied, the device shall assume that the KeyPair parameter contains a
* OneAsymmetricKey ASN.1 structure which contains both the private key and the corresponding public key.
*
*/
ONVIFAdvancedSecurity.UploadKeyPairInPKCS8 = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:UploadKeyPairInPKCS8')({}))
.map(mapResponseXmlToJson('tas:UploadKeyPairInPKCS8Response'));
};
/**
*
* This operation uploads a certification path consisting of X.509 certificates as specified by [RFC 5280] in DER encoding along with a private key to a device’s keystore.
* Certificates and private key are supplied in the form of a PKCS#12 file as specified in [PKCS#12].
* The device shall support PKCS#12 files that contain the following safe bags:
* one or more instances of CertBag [PKCS#12, Sect. 4.2.3]
* either exactly one instance of KeyBag [PKCS#12, Sect. 4.3.1] or exactly one instance of PKCS8ShroudedKeyBag [PKCS#12, Sect. 4.2.2].
* If the IgnoreAdditionalCertificates parameter has the value true, the device shall behave as if the client had supplied only the first CertBag in the sequence of CertBag instances.
* The device shall support PKCS#12 passphrase integrity mode for integrity protection of the PKCS#12 PFX as specified in [PKCS#12, Sect. 4].
* The device shall support PKCS8ShroudedKeyBags that are encrypted with the same passphrase as the CertBag instances.
* If an integrity passphrase ID is supplied, the device shall use the corresponding passphrase in the keystore to check the integrity of the supplied PKCS#12 PFX.
* If an integrity passphrase ID is supplied, but the supplied PKCS#12 PFX has no integrity protection, the device shall produce a BadPKCS12File fault and shall
* not store the uploaded certificates nor the uploaded key pair in the keystore.
* If an encryption passphrase ID is supplied, the device shall use the corresponding passphrase in the keystore to decrypt the PKCS8ShroudedKeyBag and the CertBag instances.
* If an EncryptionPassphraseID is supplied, but a CertBag is not encrypted, the device shall ignore the supplied EncryptionPassphraseID when processing this CertBag.
* If an EncryptionPassphraseID is supplied, but a KeyBag is provided instead of a PKCS8ShroudedKeyBag, the device shall ignore the supplied EncryptionPassphraseID when processing the KeyBag.
*
*/
ONVIFAdvancedSecurity.UploadCertificateWithPrivateKeyInPKCS12 = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:UploadCertificateWithPrivateKeyInPKCS12')({}))
.map(mapResponseXmlToJson('tas:UploadCertificateWithPrivateKeyInPKCS12Response'));
};
/**
*
* This operation returns the status of a key.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore, an InvalidKeyID fault is produced.
* Otherwise, the status of the key is returned.
*
*/
ONVIFAdvancedSecurity.GetKeyStatus = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetKeyStatus')({}))
.map(mapResponseXmlToJson('tas:GetKeyStatusResponse'));
};
/**
*
* This operation returns whether a key pair contains a private key.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore or the key identified by the requested key ID does not identify a key pair,
* the device shall produce an InvalidKeyID fault.
* Otherwise, this operation returns true if the key pair identified by the key ID contains a private key, and false otherwise.
*
*/
ONVIFAdvancedSecurity.GetPrivateKeyStatus = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetPrivateKeyStatus')({}))
.map(mapResponseXmlToJson('tas:GetPrivateKeyStatusResponse'));
};
/**
*
* This operation returns information about all keys that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which keys are present on the device.
* If no key is stored on the device, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAllKeys = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllKeys')({}))
.map(mapResponseXmlToJson('tas:GetAllKeysResponse'));
};
/**
*
* This operation deletes a key from the device’s keystore.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore, a device shall produce an InvalidArgVal fault.
* If a reference exists for the specified key, a device shall produce the corresponding fault and shall not delete the key.
* If there is a key under the requested key ID stored in the keystore and the key could not be deleted, a device shall produce a KeyDeletion fault.
* If the key has the status generating, a device shall abort the generation of the key and delete from the keystore all data generated for this key.
* After a key is successfully deleted, the device may assign its former ID to other keys.
*
*/
ONVIFAdvancedSecurity.DeleteKey = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteKey')({}))
.map(mapResponseXmlToJson('tas:DeleteKeyResponse'));
};
/**
*
* This operation generates a DER-encoded PKCS#10 v1.7 certification request (sometimes also called certificate signing request or CSR) as specified in RFC 2986
* for a public key on the device.
* The key pair that contains the public key for which a certification request shall be produced is specified by its key ID.
* If no key is stored under the requested KeyID or the key specified by the requested KeyID is not an asymmetric key pair, an invalid key ID fault shall be produced and
* no CSR shall be generated.
*
* A device that supports this command shall as minimum support the sha-1WithRSAEncryption signature algorithm as specified in RFC 3279.
* If the specified signature algorithm is not supported by the device, an UnsupportedSignatureAlgorithm fault shall be produced and no CSR shall be generated.
*
* If the public key identified by the requested Key ID is an invalid input to the specified signature algorithm, a KeySignatureAlgorithmMismatch fault shall be produced
* and no CSR shall be generated.
* If the key pair does not have status ok, a device shall produce an InvalidKeyStatus fault and no CSR shall be generated.
*
*/
ONVIFAdvancedSecurity.CreatePKCS10CSR = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:CreatePKCS10CSR')({}))
.map(mapResponseXmlToJson('tas:CreatePKCS10CSRResponse'));
};
/**
*
* This operation generates for a public key on the device a self-signed X.509 certificate that complies to RFC 5280.
* The X509Version parameter specifies the version of X.509 that the generated certificate shall comply to.
* A device that supports this command shall support the generation of X.509v3 certificates as specified in RFC 5280 and may additionally be able to handle other X.509 certificate formats
* as indicated by the X.509Versions capability.
* The key pair that contains the public key for which a self-signed certificate shall be produced is specified by its key pair ID.
* The subject parameter describes the entity that the public key belongs to.
* If the key pair does not have status ok, a device shall produce an InvalidKeyStatus fault and no certificate shall be generated.
*
* The signature algorithm parameter determines which signature algorithm shall be used for signing the certification request with the public key specified by the key ID parameter.
* A device that supports this command shall as minimum support the sha-1WithRSAEncryption signature algorithm as specified in RFC 3279.
* The Extensions parameter specifies potential X509v3 extensions that shall be contained in the certificate.
* A device that supports this command shall support the extensions that are defined in [RFC 5280], Sect. 4.2] as mandatory for CAs that issue self-signed certificates.
*
* Certificates are uniquely identified using certificate IDs. If the command was successful, the device generates a new ID for the generated certificate and returns this ID.
* If the device does not have not enough storage capacity for storing the certificate to be created, the maximum number of certificates reached fault shall be produced and no certificate shall be generated.
*
*/
ONVIFAdvancedSecurity.CreateSelfSignedCertificate = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:CreateSelfSignedCertificate')({}))
.map(mapResponseXmlToJson('tas:CreateSelfSignedCertificateResponse'));
};
/**
*
* This operation uploads an X.509 certificate as specified by [RFC 5280] in DER encoding and the public key in the certificate to a device’s keystore.
* A device that supports this command shall be able to handle X.509v3 certificates as specified in RFC 5280 and may additionally be able to handle other X.509 certificate formats as indicated by the X.509Versions capability.
* A device that supports this command shall support sha1-WithRSAEncryption as certificate signature algorithm.
*
* Certificates are uniquely identified using certificate IDs, and key pairs are uniquely identified using key IDs.
* The device shall generate a new certificate ID for the uploaded certificate.
* Certain certificate usages, e.g. TLS server authentication, require the private key that corresponds to the public key in the certificate to be present in the keystore.
* In such cases, the client may indicate that it expects the device to produce a fault if the matching private key for
* the uploaded certificate is not present in the keystore by setting the PrivateKeyRequired argument in the upload request to true.
*
* The uploaded certificate has to be linked to a key pair in the keystore.
* If no private key is required for the public key in the certificate and a key pair exists in the keystore with a public key equal to the public key in the certificate,
* the uploaded certificate is linked to the key pair identified by the supplied key ID by adding a reference from the certificate to the key pair.
* If no private key is required for the public key in the certificate and no key pair exists with the public key equal to the public key in the certificate,
* a new key pair with status ok is created with the public key from the certificate, and this key pair is linked to the uploaded certificate by adding a reference from
* the certificate to the key pair.
* If a private key is required for the public key in the certificate, and a key pair exists in the keystore with a private key that matches the public key in the certificate,
* the uploaded certificate is linked to this keypair by adding a reference from the certificate to the key pair.
* If a private key is required for the public key and no such keypair exists in the keystore, the NoMatchingPrivateKey fault shall be produced and the certificate
* shall not be stored in the keystore.
* If the key pair that the certificate shall be linked to does not have status ok, an InvalidKeyID fault is produced, and the uploaded certificate is not stored in the keystore.
* If the device cannot process the uploaded certificate, a BadCertificate fault is produced and neither the uploaded certificate nor the public key are stored in the device’s keystore.
* The BadCertificate fault shall not be produced based on the mere fact that the device’s current time lies outside the interval defined by the notBefore and notAfter fields as specified by [RFC 5280], Sect. 4.1 .
* This operation shall not mark the uploaded certificate as trusted.
*
* If the device does not have not enough storage capacity for storing the certificate to be uploaded, the maximum number of certificates reached fault shall be produced
* and no certificate shall be uploaded.
* If the device does not have not enough storage capacity for storing the key pair that eventually has to be created, the device shall generate a maximum number of keys reached fault.
* Furthermore the device shall not generate a key pair and no certificate shall be stored.
*
*/
ONVIFAdvancedSecurity.UploadCertificate = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:UploadCertificate')({}))
.map(mapResponseXmlToJson('tas:UploadCertificateResponse'));
};
/**
*
* This operation returns a specific certificate from the device’s keystore.
* Certificates are uniquely identified using certificate IDs. If no certificate is stored under the requested certificate ID in the keystore, an InvalidArgVal fault is produced.
* It shall be noted that this command does not return the private key that is associated to the public key in the certificate.
*
*/
ONVIFAdvancedSecurity.GetCertificate = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetCertificate')({}))
.map(mapResponseXmlToJson('tas:GetCertificateResponse'));
};
/**
*
* This operation returns the IDs of all certificates that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which certificates are present on the device.
* If no certificate is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAllCertificates = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllCertificates')({}))
.map(mapResponseXmlToJson('tas:GetAllCertificatesResponse'));
};
/**
*
* This operation deletes a certificate from the device’s keystore.
* The operation shall not delete the public key that is contained in the certificate from the keystore.
* Certificates are uniquely identified using certificate IDs. If no certificate is stored under the requested certificate ID in the keystore, an InvalidArgVal fault is produced.
* If there is a certificate under the requested certificate ID stored in the keystore and the certificate could not be deleted, a CertificateDeletion fault is produced.
* If a reference exists for the specified certificate, the certificate shall not be deleted and the corresponding fault shall be produced.
* After a certificate has been successfully deleted, the device may assign its former ID to other certificates.
*
*/
ONVIFAdvancedSecurity.DeleteCertificate = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteCertificate')({}))
.map(mapResponseXmlToJson('tas:DeleteCertificateResponse'));
};
/**
*
* This operation creates a sequence of certificates that may be used, e.g., for certification path validation or for TLS server authentication.
* Certification paths are uniquely identified using certification path IDs. Certificates are uniquely identified using certificate IDs.
* A certification path contains a sequence of certificate IDs.
* If there is a certificate ID in the sequence of supplied certificate IDs for which no certificate exists in the device’s keystore, the corresponding fault shall be produced
* and no certification path shall be created.
*
* The signature of each certificate in the certification path except for the last one must be verifiable with the public key contained in the next certificate in the path.
* If there is a certificate ID in the request other than the last ID for which the corresponding certificate cannot be verified with the public key in the certificate identified
* by the next certificate ID, an InvalidCertificateChain fault shall be produced and no certification path shall be created.
*
*/
ONVIFAdvancedSecurity.CreateCertificationPath = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:CreateCertificationPath')({}))
.map(mapResponseXmlToJson('tas:CreateCertificationPathResponse'));
};
/**
*
* This operation returns a specific certification path from the device’s keystore.
* Certification paths are uniquely identified using certification path IDs.
* If no certification path is stored under the requested ID in the keystore, an InvalidArgVal fault is produced.
*
*/
ONVIFAdvancedSecurity.GetCertificationPath = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetCertificationPath')({}))
.map(mapResponseXmlToJson('tas:GetCertificationPathResponse'));
};
/**
*
* This operation returns the IDs of all certification paths that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which certificates are present on the device.
* If no certification path is stored on the device, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAllCertificationPaths = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllCertificationPaths')({}))
.map(mapResponseXmlToJson('tas:GetAllCertificationPathsResponse'));
};
/**
*
* This operation deletes a certification path from the device’s keystore.
* This operation shall not delete the certificates that are referenced by the certification path.
* Certification paths are uniquely identified using certification path IDs.
* If no certification path is stored under the requested certification path ID in the keystore, an InvalidArgVal fault is produced.
* If there is a certification path under the requested certification path ID stored in the keystore and the certification path could not be deleted,
* a CertificationPathDeletion fault is produced.
* If a reference exists for the specified certification path, the certification path shall not be deleted and the corresponding fault shall be produced.
* After a certification path is successfully deleted, the device may assign its former ID to other certification paths.
*
*/
ONVIFAdvancedSecurity.DeleteCertificationPath = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteCertificationPath')({}))
.map(mapResponseXmlToJson('tas:DeleteCertificationPathResponse'));
};
/**
*
* This operation uploads a passphrase to the keystore of the device.
*
*/
ONVIFAdvancedSecurity.UploadPassphrase = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:UploadPassphrase')({}))
.map(mapResponseXmlToJson('tas:UploadPassphraseResponse'));
};
/**
*
* This operation returns information about all passphrases that are stored in the keystore of the device.
* This operation may be used, e.g., if a client lost track of which passphrases are present on the device.
* If no passphrase is stored on the device, the device shall return an empty list.
*
*/
ONVIFAdvancedSecurity.GetAllPassphrases = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllPassphrases')({}))
.map(mapResponseXmlToJson('tas:GetAllPassphrasesResponse'));
};
/**
*
* This operation deletes a passphrase from the keystore of the device.
*
*/
ONVIFAdvancedSecurity.DeletePassphrase = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeletePassphrase')({}))
.map(mapResponseXmlToJson('tas:DeletePassphraseResponse'));
};
/**
*
* This operation uploads a certificate revocation list (CRL) as specified in [RFC 5280] to the keystore on the device.
* If the device does not have enough storage space to store the CRL to be uploaded, the device shall produce a MaximumNumberOfCRLsReached fault and shall not store the supplied CRL.
* If the device is not able to process the supplied CRL, the device shall produce a BadCRL fault and shall not store the supplied CRL.
* If the device does not support the signature algorithm that was used to sign the supplied CRL, the device shall produce an UnsupportedSignatureAlgorithm fault and shall not store the supplied CRL.
*
*/
ONVIFAdvancedSecurity.UploadCRL = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:UploadCRL')({}))
.map(mapResponseXmlToJson('tas:UploadCRLResponse'));
};
/**
*
* This operation returns a specific certificate revocation list (CRL) from the keystore on the device.
* Certification revocation lists are uniquely identified using CRLIDs. If no CRL is stored under the requested CRLID, the device shall produce a CRLID fault.
*
*/
ONVIFAdvancedSecurity.GetCRL = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetCRL')({}))
.map(mapResponseXmlToJson('tas:GetCRLResponse'));
};
/**
*
* This operation returns all certificate revocation lists (CRLs) that are stored in the keystore on the device.
* If no certificate revocation list is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAllCRLs = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllCRLs')({}))
.map(mapResponseXmlToJson('tas:GetAllCRLsResponse'));
};
/**
*
* This operation deletes a certificate revocation list (CRL) from the keystore on the device.
* Certification revocation lists are uniquely identified using CRLIDs. If no CRL is stored under the requested CRLID, the device shall produce a CRLID fault.
* If a reference exists for the specified CRL, the device shall produce a ReferenceExists fault and shall not delete the CRL.
* After a CRL has been successfully deleted, a device may assign its former ID to other CRLs.
*
*/
ONVIFAdvancedSecurity.DeleteCRL = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteCRL')({}))
.map(mapResponseXmlToJson('tas:DeleteCRLResponse'));
};
/**
*
* This operation creates a certification path validation policy.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. The device shall generate a new certification path validation policy ID for the created certification path validation policy.
* For the certification path validation parameters that are not represented in the certPathValidationParameters data type, the device shall use the default values specified in Sect. 3.
* If the device does not have enough storage capacity for storing the certification path validation policy to be created, the device shall produce a maximum number of certification path validation policies reached fault and shall not create a certification path validation policy.
* If there is at least one trust anchor certificate ID in the request for which there exists no certificate in the device’s keystore, the device shall produce a CertificateID fault and shall not create a certification path validation policy.
* If the device cannot process the supplied certification path validation parameters, the device shall produce a CertPathValidationParameters fault and shall not create a certification path validation policy.
*
*/
ONVIFAdvancedSecurity.CreateCertPathValidationPolicy = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:CreateCertPathValidationPolicy')({}))
.map(mapResponseXmlToJson('tas:CreateCertPathValidationPolicyResponse'));
};
/**
*
* This operation returns a certification path validation policy from the keystore on the device.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. If no certification path validation policy is stored under the requested certification path validation policy ID, the device shall produce a CertPathValidationPolicyID fault.
*
*/
ONVIFAdvancedSecurity.GetCertPathValidationPolicy = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetCertPathValidationPolicy')({}))
.map(mapResponseXmlToJson('tas:GetCertPathValidationPolicyResponse'));
};
/**
*
* This operation returns all certification path validation policies that are stored in the keystore on the device.
* If no certification path validation policy is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAllCertPathValidationPolicies = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllCertPathValidationPolicies')({}))
.map(mapResponseXmlToJson('tas:GetAllCertPathValidationPoliciesResponse'));
};
/**
*
* This operation deletes a certification path validation policy from the keystore on the device.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. If no certification path validation policy is stored under the requested certification path validation policy ID, the device shall produce an InvalidCertPathValidationPolicyID fault.
* If a reference exists for the requested certification path validation policy, the device shall produce a ReferenceExists fault and shall not delete the certification path validation policy.
* After the certification path validation policy has been deleted, the device may assign its former ID to other certification path validation policies.
*
*/
ONVIFAdvancedSecurity.DeleteCertPathValidationPolicy = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteCertPathValidationPolicy')({}))
.map(mapResponseXmlToJson('tas:DeleteCertPathValidationPolicyResponse'));
};
/**
*
* This operation assigns a key pair and certificate along with a certification path (certificate chain) to the TLS server on the device.
* The TLS server shall use this information for key exchange during the TLS handshake, particularly for constructing server certificate messages as specified in RFC 4346 and RFC 2246.
*
* Certification paths are identified by their certification path IDs in the keystore. The first certificate in the certification path must be the TLS server certificate.
* Since each certificate has exactly one associated key pair, a reference to the key pair that is associated with the server certificate is not supplied explicitly.
* Devices shall obtain the private key or results of operations under the private key by suitable internal interaction with the keystore.
* If a device chooses to perform a TLS key exchange based on the supplied certification path, it shall use the key pair that is associated with the server certificate for
* key exchange and transmit the certification path to TLS clients as-is, i.e., the device shall not check conformance of the certification path to RFC 4346 norRFC 2246.
* In order to use the server certificate during the TLS handshake, the corresponding private key is required.
* Therefore, if the key pair that is associated with the server certificate, i.e., the first certificate in the certification path, does not have an associated private key,
* the NoPrivateKey fault is produced and the certification path is not associated to the TLS server.
* A TLS server may present different certification paths to different clients during the TLS handshake instead of presenting the same certification path to all clients.
* Therefore more than one certification path may be assigned to the TLS server.
* If the maximum number of certification paths that may be assigned to the TLS server simultaneously is reached, the device shall generate a MaximumNumberOfCertificationPathsReached
* fault and the requested certification path shall not be assigned to the TLS server.
*
*/
ONVIFAdvancedSecurity.AddServerCertificateAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:AddServerCertificateAssignment')({}))
.map(mapResponseXmlToJson('tas:AddServerCertificateAssignmentResponse'));
};
/**
*
* This operation removes a key pair and certificate assignment (including certification path) to the TLS server on the device.
* Certification paths are identified using certification path IDs. If the supplied certification path ID is not associated to the TLS server, an InvalidArgVal fault is produced.
*
*/
ONVIFAdvancedSecurity.RemoveServerCertificateAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:RemoveServerCertificateAssignment')({}))
.map(mapResponseXmlToJson('tas:RemoveServerCertificateAssignmentResponse'));
};
/**
*
* This operation replaces an existing key pair and certificate assignment to the TLS server on the device by a new key pair and certificate assignment (including certification paths).
*
* After the replacement, the TLS server shall use the new certificate and certification path exactly in those cases in which it would have used the old certificate and certification path.
* Therefore, especially in the case that several server certificates are assigned to the TLS server, clients that wish to replace an old certificate assignment by a new assignment
* should use this operation instead of a combination of the Add TLS Server Certificate Assignment and the Remove TLS Server Certificate Assignment operations.
*
* Certification paths are identified using certification path IDs. If the supplied old certification path ID is not associated to the TLS server, or no certification path exists
* under the new certification path ID, the corresponding InvalidArgVal faults are produced and the associations are unchanged.
* The first certificate in the new certification path must be the TLS server certificate.
* Since each certificate has exactly one associated key pair, a reference to the key pair that is associated with the new server certificate is not supplied explicitly.
* Devices shall obtain the private key or results of operations under the private key by suitable internal interaction with the keystore.
* If a device chooses to perform a TLS key exchange based on the new certification path, it shall use the key pair that is associated with the server certificate
* for key exchange and transmit the certification path to TLS clients as-is, i.e., the device shall not check conformance of the certification path to RFC 4346 norRFC 2246.
* In order to use the server certificate during the TLS handshake, the corresponding private key is required.
* Therefore, if the key pair that is associated with the server certificate, i.e., the first certificate in the certification path, does not have an associated private key,
* the NoPrivateKey fault is produced and the certification path is not associated to the TLS server.
*
*/
ONVIFAdvancedSecurity.ReplaceServerCertificateAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:ReplaceServerCertificateAssignment')({}))
.map(mapResponseXmlToJson('tas:ReplaceServerCertificateAssignmentResponse'));
};
/**
*
* This operation sets the version(s) of TLS which the device shall use. Valid values are taken from the TLSServerSupported capability.
* A client initiates a TLS session by sending a ClientHello with the hightest TLS version it supports. This suggests to the server that the client can accept any TLS version up to and including that version.
* The server then chooses the TLS version to use. This is generally the highest TLS version the server supports that is within the range of the client. For example, if a ClientHello indicates TLS version 1.1, the server can proceed with TLS 1.0 or TLS 1.1.
* In the event that an ONVIF installation wishes to disable certain version(s) of TLS, it may do so with this operation. For example, to disable TLS 1.0 on a device signaling support for TLS versions 1.0, 1.1, and 1.2, the enabled version list may be set to "1.1 1.2", omitting 1.0. If a client then attempts to connect with a ClientHello containing TLS 1.0, the server shall send a "protocol_version" alert message and close the connection. This handshake indicates to the client that TLS 1.0 is not supported by the server. The client must try again with a higher TLS version suggestion.
* An empty list is not permitted. Disabling all versions of TLS is not the intent of this operation. See AddServerCertificateAssignment and RemoveServerCertificateAssignment.
*
*/
ONVIFAdvancedSecurity.SetEnabledTLSVersions = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:SetEnabledTLSVersions')({}))
.map(mapResponseXmlToJson('tas:SetEnabledTLSVersionsResponse'));
};
/**
*
* This operation retrieves the version(s) of TLS which are currently enabled on the device.
*
*/
ONVIFAdvancedSecurity.GetEnabledTLSVersions = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetEnabledTLSVersions')({}))
.map(mapResponseXmlToJson('tas:GetEnabledTLSVersionsResponse'));
};
/**
*
* This operation returns the IDs of all key pairs and certificates (including certification paths) that are assigned to the TLS server on the device.
* This operation may be used, e.g., if a client lost track of the certification path assignments on the device.
* If no certification path is assigned to the TLS server, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.GetAssignedServerCertificates = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAssignedServerCertificates')({}))
.map(mapResponseXmlToJson('tas:GetAssignedServerCertificatesResponse'));
};
/**
*
* This operation activates or deactivates TLS client authentication for the TLS server on the device.
* The TLS server on the device shall require client authentication if and only if clientAuthenticationRequired is set to true.
* If TLS client authentication is requested to be enabled and no certification path validation policy is assigned to the TLS server, the device shall return an EnablingTLSClientAuthenticationFailed fault and shall not enable TLS client authentication.
* The device shall execute this command regardless of the TLS enabled/disabled state configured in the ONVIF Device Management Service.
*
*/
ONVIFAdvancedSecurity.SetClientAuthenticationRequired = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:SetClientAuthenticationRequired')({}))
.map(mapResponseXmlToJson('tas:SetClientAuthenticationRequiredResponse'));
};
/**
*
* This operation returns whether TLS client authentication is active.
*
*/
ONVIFAdvancedSecurity.GetClientAuthenticationRequired = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetClientAuthenticationRequired')({}))
.map(mapResponseXmlToJson('tas:GetClientAuthenticationRequiredResponse'));
};
/**
*
* This operation enables or disables mapping of the Common Name present in the TLS client certificate to an existing user name in the device.
* The TLS server on the device shall perform mapping if parameter clientAuthenticationRequired is set to true.
*
*/
ONVIFAdvancedSecurity.SetCnMapsToUser = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:SetCnMapsToUser')({}))
.map(mapResponseXmlToJson('tas:SetCnMapsToUserResponse'));
};
/**
*
* This operation returns whether the Common Name Mapping to User is enabled.
*
*/
ONVIFAdvancedSecurity.GetCnMapsToUser = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetCnMapsToUser')({}))
.map(mapResponseXmlToJson('tas:GetCnMapsToUserResponse'));
};
/**
*
* This operation assigns a certification path validation policy to the TLS server on the device. The TLS server shall enforce the policy when authenticating TLS clients and consider a client authentic if and only if the algorithm returns valid.
* If no certification path validation policy is stored under the requested CertPathValidationPolicyID, the device shall produce a CertPathValidationPolicyID fault.
* A TLS server may use different certification path validation policies to authenticate clients. Therefore more than one certification path validation policy may be assigned to the TLS server. If the maximum number of certification path validation policies that may be assigned to the TLS server simultaneously is reached, the device shall produce a MaximumNumberOfTLSCertPathValidationPoliciesReached fault and shall not assign the requested certification path validation policy to the TLS server.
*
*/
ONVIFAdvancedSecurity.AddCertPathValidationPolicyAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:AddCertPathValidationPolicyAssignment')({}))
.map(mapResponseXmlToJson('tas:AddCertPathValidationPolicyAssignmentResponse'));
};
/**
*
* This operation removes a certification path validation policy assignment from the TLS server on the device.
* If the certification path validation policy identified by the requested CertPathValidationPolicyID is not associated to the TLS server, the device shall produce a CertPathValidationPolicy fault.
*
*/
ONVIFAdvancedSecurity.RemoveCertPathValidationPolicyAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:RemoveCertPathValidationPolicyAssignment')({}))
.map(mapResponseXmlToJson('tas:RemoveCertPathValidationPolicyAssignmentResponse'));
};
/**
*
* This operation replaces a certification path validation policy assignment to the TLS server on the device with another certification path validation policy assignment.
* If the certification path validation policy identified by the requested OldCertPathValidationPolicyID is not associated to the TLS server, the device shall produce an OldCertPathValidationPolicyID fault and shall not associate the certification path validation policy identified by the NewCertPathValidationPolicyID to the TLS server.
* If no certification path validation policy exists under the requested NewCertPathValidationPolicyID in the device’s keystore, the device shall produce a NewCertPathValidationPolicyID fault and shall not remove the association of the old certification path validation policy to the TLS server.
*
*/
ONVIFAdvancedSecurity.ReplaceCertPathValidationPolicyAssignment = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:ReplaceCertPathValidationPolicyAssignment')({}))
.map(mapResponseXmlToJson('tas:ReplaceCertPathValidationPolicyAssignmentResponse'));
};
/**
*
* This operation returns the IDs of all certification path validation policies that are assigned to the TLS server on the device.
*
*/
ONVIFAdvancedSecurity.GetAssignedCertPathValidationPolicies = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAssignedCertPathValidationPolicies')({}))
.map(mapResponseXmlToJson('tas:GetAssignedCertPathValidationPoliciesResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.AddDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:AddDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:AddDot1XConfigurationResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.GetAllDot1XConfigurations = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetAllDot1XConfigurations')({}))
.map(mapResponseXmlToJson('tas:GetAllDot1XConfigurationsResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.GetDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:GetDot1XConfigurationResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.DeleteDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:DeleteDot1XConfigurationResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.SetNetworkInterfaceDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:SetNetworkInterfaceDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:SetNetworkInterfaceDot1XConfigurationResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.GetNetworkInterfaceDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:GetNetworkInterfaceDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:GetNetworkInterfaceDot1XConfigurationResponse'));
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.DeleteNetworkInterfaceDot1XConfiguration = function () {
return createStandardRequestBodyFromString(generateRequestElements('tas:DeleteNetworkInterfaceDot1XConfiguration')({}))
.map(mapResponseXmlToJson('tas:DeleteNetworkInterfaceDot1XConfigurationResponse'));
};
/**
* Returns the capabilities of the security configuraiton service. The result is returned in a typed answer.
*/
ONVIFAdvancedSecurity.prototype.GetServiceCapabilities = function () {
return ONVIFAdvancedSecurity.GetServiceCapabilities().run(this.config);
};
/**
*
* This operation triggers the asynchronous generation of an RSA key pair of a particular key length (specified as the number of bits) as specified in [RFC 3447], with a suitable key generation mechanism on the device.
* Keys, especially RSA key pairs, are uniquely identified using key IDs.
* If the device does not have not enough storage capacity for storing the key pair to be created, the maximum number of keys reached fault shall be produced and no key pair shall be generated.
* Otherwise, the operation generates a keyID for the new key and associates the generating status to it.
* Immediately after key generation has started, the device shall return the keyID to the client and continue to generate the key pair.
* The client may query the device with the GetKeyStatus operation whether the generation has finished.
* The client may also subscribe to Key Status events to be notified about key status changes.
* The device also returns a best-effort estimate of how much time it requires to create the key pair.
* A client may use this information as an indication how long to wait before querying the device whether key generation is completed.
* After the key has been successfully created, the device shall assign it the ok status. If the key generation fails, the device shall assign the key the corrupt status.
*
*/
ONVIFAdvancedSecurity.prototype.CreateRSAKeyPair = function () {
return ONVIFAdvancedSecurity.CreateRSAKeyPair().run(this.config);
};
/**
*
* This operation uploads a key pair in a PKCS#8 data structure as specified in [RFC 5958, RFC 5959].
* If an encryption passphrase ID is supplied in the request, the device shall assume that the KeyPair parameter contains an EncryptedPrivateKeyInfo ASN.1
* structure that is encrypted under the passphrase in the keystore that corresponds to the supplied ID, where the EncryptedPrivateKeyInfo structure contains
* both the private key and the corresponding public key. If no encryption passphrase ID is supplied, the device shall assume that the KeyPair parameter contains a
* OneAsymmetricKey ASN.1 structure which contains both the private key and the corresponding public key.
*
*/
ONVIFAdvancedSecurity.prototype.UploadKeyPairInPKCS8 = function () {
return ONVIFAdvancedSecurity.UploadKeyPairInPKCS8().run(this.config);
};
/**
*
* This operation uploads a certification path consisting of X.509 certificates as specified by [RFC 5280] in DER encoding along with a private key to a device’s keystore.
* Certificates and private key are supplied in the form of a PKCS#12 file as specified in [PKCS#12].
* The device shall support PKCS#12 files that contain the following safe bags:
* one or more instances of CertBag [PKCS#12, Sect. 4.2.3]
* either exactly one instance of KeyBag [PKCS#12, Sect. 4.3.1] or exactly one instance of PKCS8ShroudedKeyBag [PKCS#12, Sect. 4.2.2].
* If the IgnoreAdditionalCertificates parameter has the value true, the device shall behave as if the client had supplied only the first CertBag in the sequence of CertBag instances.
* The device shall support PKCS#12 passphrase integrity mode for integrity protection of the PKCS#12 PFX as specified in [PKCS#12, Sect. 4].
* The device shall support PKCS8ShroudedKeyBags that are encrypted with the same passphrase as the CertBag instances.
* If an integrity passphrase ID is supplied, the device shall use the corresponding passphrase in the keystore to check the integrity of the supplied PKCS#12 PFX.
* If an integrity passphrase ID is supplied, but the supplied PKCS#12 PFX has no integrity protection, the device shall produce a BadPKCS12File fault and shall
* not store the uploaded certificates nor the uploaded key pair in the keystore.
* If an encryption passphrase ID is supplied, the device shall use the corresponding passphrase in the keystore to decrypt the PKCS8ShroudedKeyBag and the CertBag instances.
* If an EncryptionPassphraseID is supplied, but a CertBag is not encrypted, the device shall ignore the supplied EncryptionPassphraseID when processing this CertBag.
* If an EncryptionPassphraseID is supplied, but a KeyBag is provided instead of a PKCS8ShroudedKeyBag, the device shall ignore the supplied EncryptionPassphraseID when processing the KeyBag.
*
*/
ONVIFAdvancedSecurity.prototype.UploadCertificateWithPrivateKeyInPKCS12 = function () {
return ONVIFAdvancedSecurity.UploadCertificateWithPrivateKeyInPKCS12().run(this.config);
};
/**
*
* This operation returns the status of a key.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore, an InvalidKeyID fault is produced.
* Otherwise, the status of the key is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetKeyStatus = function () {
return ONVIFAdvancedSecurity.GetKeyStatus().run(this.config);
};
/**
*
* This operation returns whether a key pair contains a private key.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore or the key identified by the requested key ID does not identify a key pair,
* the device shall produce an InvalidKeyID fault.
* Otherwise, this operation returns true if the key pair identified by the key ID contains a private key, and false otherwise.
*
*/
ONVIFAdvancedSecurity.prototype.GetPrivateKeyStatus = function () {
return ONVIFAdvancedSecurity.GetPrivateKeyStatus().run(this.config);
};
/**
*
* This operation returns information about all keys that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which keys are present on the device.
* If no key is stored on the device, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllKeys = function () {
return ONVIFAdvancedSecurity.GetAllKeys().run(this.config);
};
/**
*
* This operation deletes a key from the device’s keystore.
* Keys are uniquely identified using key IDs. If no key is stored under the requested key ID in the keystore, a device shall produce an InvalidArgVal fault.
* If a reference exists for the specified key, a device shall produce the corresponding fault and shall not delete the key.
* If there is a key under the requested key ID stored in the keystore and the key could not be deleted, a device shall produce a KeyDeletion fault.
* If the key has the status generating, a device shall abort the generation of the key and delete from the keystore all data generated for this key.
* After a key is successfully deleted, the device may assign its former ID to other keys.
*
*/
ONVIFAdvancedSecurity.prototype.DeleteKey = function () {
return ONVIFAdvancedSecurity.DeleteKey().run(this.config);
};
/**
*
* This operation generates a DER-encoded PKCS#10 v1.7 certification request (sometimes also called certificate signing request or CSR) as specified in RFC 2986
* for a public key on the device.
* The key pair that contains the public key for which a certification request shall be produced is specified by its key ID.
* If no key is stored under the requested KeyID or the key specified by the requested KeyID is not an asymmetric key pair, an invalid key ID fault shall be produced and
* no CSR shall be generated.
*
* A device that supports this command shall as minimum support the sha-1WithRSAEncryption signature algorithm as specified in RFC 3279.
* If the specified signature algorithm is not supported by the device, an UnsupportedSignatureAlgorithm fault shall be produced and no CSR shall be generated.
*
* If the public key identified by the requested Key ID is an invalid input to the specified signature algorithm, a KeySignatureAlgorithmMismatch fault shall be produced
* and no CSR shall be generated.
* If the key pair does not have status ok, a device shall produce an InvalidKeyStatus fault and no CSR shall be generated.
*
*/
ONVIFAdvancedSecurity.prototype.CreatePKCS10CSR = function () {
return ONVIFAdvancedSecurity.CreatePKCS10CSR().run(this.config);
};
/**
*
* This operation generates for a public key on the device a self-signed X.509 certificate that complies to RFC 5280.
* The X509Version parameter specifies the version of X.509 that the generated certificate shall comply to.
* A device that supports this command shall support the generation of X.509v3 certificates as specified in RFC 5280 and may additionally be able to handle other X.509 certificate formats
* as indicated by the X.509Versions capability.
* The key pair that contains the public key for which a self-signed certificate shall be produced is specified by its key pair ID.
* The subject parameter describes the entity that the public key belongs to.
* If the key pair does not have status ok, a device shall produce an InvalidKeyStatus fault and no certificate shall be generated.
*
* The signature algorithm parameter determines which signature algorithm shall be used for signing the certification request with the public key specified by the key ID parameter.
* A device that supports this command shall as minimum support the sha-1WithRSAEncryption signature algorithm as specified in RFC 3279.
* The Extensions parameter specifies potential X509v3 extensions that shall be contained in the certificate.
* A device that supports this command shall support the extensions that are defined in [RFC 5280], Sect. 4.2] as mandatory for CAs that issue self-signed certificates.
*
* Certificates are uniquely identified using certificate IDs. If the command was successful, the device generates a new ID for the generated certificate and returns this ID.
* If the device does not have not enough storage capacity for storing the certificate to be created, the maximum number of certificates reached fault shall be produced and no certificate shall be generated.
*
*/
ONVIFAdvancedSecurity.prototype.CreateSelfSignedCertificate = function () {
return ONVIFAdvancedSecurity.CreateSelfSignedCertificate().run(this.config);
};
/**
*
* This operation uploads an X.509 certificate as specified by [RFC 5280] in DER encoding and the public key in the certificate to a device’s keystore.
* A device that supports this command shall be able to handle X.509v3 certificates as specified in RFC 5280 and may additionally be able to handle other X.509 certificate formats as indicated by the X.509Versions capability.
* A device that supports this command shall support sha1-WithRSAEncryption as certificate signature algorithm.
*
* Certificates are uniquely identified using certificate IDs, and key pairs are uniquely identified using key IDs.
* The device shall generate a new certificate ID for the uploaded certificate.
* Certain certificate usages, e.g. TLS server authentication, require the private key that corresponds to the public key in the certificate to be present in the keystore.
* In such cases, the client may indicate that it expects the device to produce a fault if the matching private key for
* the uploaded certificate is not present in the keystore by setting the PrivateKeyRequired argument in the upload request to true.
*
* The uploaded certificate has to be linked to a key pair in the keystore.
* If no private key is required for the public key in the certificate and a key pair exists in the keystore with a public key equal to the public key in the certificate,
* the uploaded certificate is linked to the key pair identified by the supplied key ID by adding a reference from the certificate to the key pair.
* If no private key is required for the public key in the certificate and no key pair exists with the public key equal to the public key in the certificate,
* a new key pair with status ok is created with the public key from the certificate, and this key pair is linked to the uploaded certificate by adding a reference from
* the certificate to the key pair.
* If a private key is required for the public key in the certificate, and a key pair exists in the keystore with a private key that matches the public key in the certificate,
* the uploaded certificate is linked to this keypair by adding a reference from the certificate to the key pair.
* If a private key is required for the public key and no such keypair exists in the keystore, the NoMatchingPrivateKey fault shall be produced and the certificate
* shall not be stored in the keystore.
* If the key pair that the certificate shall be linked to does not have status ok, an InvalidKeyID fault is produced, and the uploaded certificate is not stored in the keystore.
* If the device cannot process the uploaded certificate, a BadCertificate fault is produced and neither the uploaded certificate nor the public key are stored in the device’s keystore.
* The BadCertificate fault shall not be produced based on the mere fact that the device’s current time lies outside the interval defined by the notBefore and notAfter fields as specified by [RFC 5280], Sect. 4.1 .
* This operation shall not mark the uploaded certificate as trusted.
*
* If the device does not have not enough storage capacity for storing the certificate to be uploaded, the maximum number of certificates reached fault shall be produced
* and no certificate shall be uploaded.
* If the device does not have not enough storage capacity for storing the key pair that eventually has to be created, the device shall generate a maximum number of keys reached fault.
* Furthermore the device shall not generate a key pair and no certificate shall be stored.
*
*/
ONVIFAdvancedSecurity.prototype.UploadCertificate = function () {
return ONVIFAdvancedSecurity.UploadCertificate().run(this.config);
};
/**
*
* This operation returns a specific certificate from the device’s keystore.
* Certificates are uniquely identified using certificate IDs. If no certificate is stored under the requested certificate ID in the keystore, an InvalidArgVal fault is produced.
* It shall be noted that this command does not return the private key that is associated to the public key in the certificate.
*
*/
ONVIFAdvancedSecurity.prototype.GetCertificate = function () {
return ONVIFAdvancedSecurity.GetCertificate().run(this.config);
};
/**
*
* This operation returns the IDs of all certificates that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which certificates are present on the device.
* If no certificate is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllCertificates = function () {
return ONVIFAdvancedSecurity.GetAllCertificates().run(this.config);
};
/**
*
* This operation deletes a certificate from the device’s keystore.
* The operation shall not delete the public key that is contained in the certificate from the keystore.
* Certificates are uniquely identified using certificate IDs. If no certificate is stored under the requested certificate ID in the keystore, an InvalidArgVal fault is produced.
* If there is a certificate under the requested certificate ID stored in the keystore and the certificate could not be deleted, a CertificateDeletion fault is produced.
* If a reference exists for the specified certificate, the certificate shall not be deleted and the corresponding fault shall be produced.
* After a certificate has been successfully deleted, the device may assign its former ID to other certificates.
*
*/
ONVIFAdvancedSecurity.prototype.DeleteCertificate = function () {
return ONVIFAdvancedSecurity.DeleteCertificate().run(this.config);
};
/**
*
* This operation creates a sequence of certificates that may be used, e.g., for certification path validation or for TLS server authentication.
* Certification paths are uniquely identified using certification path IDs. Certificates are uniquely identified using certificate IDs.
* A certification path contains a sequence of certificate IDs.
* If there is a certificate ID in the sequence of supplied certificate IDs for which no certificate exists in the device’s keystore, the corresponding fault shall be produced
* and no certification path shall be created.
*
* The signature of each certificate in the certification path except for the last one must be verifiable with the public key contained in the next certificate in the path.
* If there is a certificate ID in the request other than the last ID for which the corresponding certificate cannot be verified with the public key in the certificate identified
* by the next certificate ID, an InvalidCertificateChain fault shall be produced and no certification path shall be created.
*
*/
ONVIFAdvancedSecurity.prototype.CreateCertificationPath = function () {
return ONVIFAdvancedSecurity.CreateCertificationPath().run(this.config);
};
/**
*
* This operation returns a specific certification path from the device’s keystore.
* Certification paths are uniquely identified using certification path IDs.
* If no certification path is stored under the requested ID in the keystore, an InvalidArgVal fault is produced.
*
*/
ONVIFAdvancedSecurity.prototype.GetCertificationPath = function () {
return ONVIFAdvancedSecurity.GetCertificationPath().run(this.config);
};
/**
*
* This operation returns the IDs of all certification paths that are stored in the device’s keystore.
* This operation may be used, e.g., if a client lost track of which certificates are present on the device.
* If no certification path is stored on the device, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllCertificationPaths = function () {
return ONVIFAdvancedSecurity.GetAllCertificationPaths().run(this.config);
};
/**
*
* This operation deletes a certification path from the device’s keystore.
* This operation shall not delete the certificates that are referenced by the certification path.
* Certification paths are uniquely identified using certification path IDs.
* If no certification path is stored under the requested certification path ID in the keystore, an InvalidArgVal fault is produced.
* If there is a certification path under the requested certification path ID stored in the keystore and the certification path could not be deleted,
* a CertificationPathDeletion fault is produced.
* If a reference exists for the specified certification path, the certification path shall not be deleted and the corresponding fault shall be produced.
* After a certification path is successfully deleted, the device may assign its former ID to other certification paths.
*
*/
ONVIFAdvancedSecurity.prototype.DeleteCertificationPath = function () {
return ONVIFAdvancedSecurity.DeleteCertificationPath().run(this.config);
};
/**
*
* This operation uploads a passphrase to the keystore of the device.
*
*/
ONVIFAdvancedSecurity.prototype.UploadPassphrase = function () {
return ONVIFAdvancedSecurity.UploadPassphrase().run(this.config);
};
/**
*
* This operation returns information about all passphrases that are stored in the keystore of the device.
* This operation may be used, e.g., if a client lost track of which passphrases are present on the device.
* If no passphrase is stored on the device, the device shall return an empty list.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllPassphrases = function () {
return ONVIFAdvancedSecurity.GetAllPassphrases().run(this.config);
};
/**
*
* This operation deletes a passphrase from the keystore of the device.
*
*/
ONVIFAdvancedSecurity.prototype.DeletePassphrase = function () {
return ONVIFAdvancedSecurity.DeletePassphrase().run(this.config);
};
/**
*
* This operation uploads a certificate revocation list (CRL) as specified in [RFC 5280] to the keystore on the device.
* If the device does not have enough storage space to store the CRL to be uploaded, the device shall produce a MaximumNumberOfCRLsReached fault and shall not store the supplied CRL.
* If the device is not able to process the supplied CRL, the device shall produce a BadCRL fault and shall not store the supplied CRL.
* If the device does not support the signature algorithm that was used to sign the supplied CRL, the device shall produce an UnsupportedSignatureAlgorithm fault and shall not store the supplied CRL.
*
*/
ONVIFAdvancedSecurity.prototype.UploadCRL = function () {
return ONVIFAdvancedSecurity.UploadCRL().run(this.config);
};
/**
*
* This operation returns a specific certificate revocation list (CRL) from the keystore on the device.
* Certification revocation lists are uniquely identified using CRLIDs. If no CRL is stored under the requested CRLID, the device shall produce a CRLID fault.
*
*/
ONVIFAdvancedSecurity.prototype.GetCRL = function () {
return ONVIFAdvancedSecurity.GetCRL().run(this.config);
};
/**
*
* This operation returns all certificate revocation lists (CRLs) that are stored in the keystore on the device.
* If no certificate revocation list is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllCRLs = function () {
return ONVIFAdvancedSecurity.GetAllCRLs().run(this.config);
};
/**
*
* This operation deletes a certificate revocation list (CRL) from the keystore on the device.
* Certification revocation lists are uniquely identified using CRLIDs. If no CRL is stored under the requested CRLID, the device shall produce a CRLID fault.
* If a reference exists for the specified CRL, the device shall produce a ReferenceExists fault and shall not delete the CRL.
* After a CRL has been successfully deleted, a device may assign its former ID to other CRLs.
*
*/
ONVIFAdvancedSecurity.prototype.DeleteCRL = function () {
return ONVIFAdvancedSecurity.DeleteCRL().run(this.config);
};
/**
*
* This operation creates a certification path validation policy.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. The device shall generate a new certification path validation policy ID for the created certification path validation policy.
* For the certification path validation parameters that are not represented in the certPathValidationParameters data type, the device shall use the default values specified in Sect. 3.
* If the device does not have enough storage capacity for storing the certification path validation policy to be created, the device shall produce a maximum number of certification path validation policies reached fault and shall not create a certification path validation policy.
* If there is at least one trust anchor certificate ID in the request for which there exists no certificate in the device’s keystore, the device shall produce a CertificateID fault and shall not create a certification path validation policy.
* If the device cannot process the supplied certification path validation parameters, the device shall produce a CertPathValidationParameters fault and shall not create a certification path validation policy.
*
*/
ONVIFAdvancedSecurity.prototype.CreateCertPathValidationPolicy = function () {
return ONVIFAdvancedSecurity.CreateCertPathValidationPolicy().run(this.config);
};
/**
*
* This operation returns a certification path validation policy from the keystore on the device.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. If no certification path validation policy is stored under the requested certification path validation policy ID, the device shall produce a CertPathValidationPolicyID fault.
*
*/
ONVIFAdvancedSecurity.prototype.GetCertPathValidationPolicy = function () {
return ONVIFAdvancedSecurity.GetCertPathValidationPolicy().run(this.config);
};
/**
*
* This operation returns all certification path validation policies that are stored in the keystore on the device.
* If no certification path validation policy is stored in the device’s keystore, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAllCertPathValidationPolicies = function () {
return ONVIFAdvancedSecurity.GetAllCertPathValidationPolicies().run(this.config);
};
/**
*
* This operation deletes a certification path validation policy from the keystore on the device.
* Certification path validation policies are uniquely identified using certification path validation policy IDs. If no certification path validation policy is stored under the requested certification path validation policy ID, the device shall produce an InvalidCertPathValidationPolicyID fault.
* If a reference exists for the requested certification path validation policy, the device shall produce a ReferenceExists fault and shall not delete the certification path validation policy.
* After the certification path validation policy has been deleted, the device may assign its former ID to other certification path validation policies.
*
*/
ONVIFAdvancedSecurity.prototype.DeleteCertPathValidationPolicy = function () {
return ONVIFAdvancedSecurity.DeleteCertPathValidationPolicy().run(this.config);
};
/**
*
* This operation assigns a key pair and certificate along with a certification path (certificate chain) to the TLS server on the device.
* The TLS server shall use this information for key exchange during the TLS handshake, particularly for constructing server certificate messages as specified in RFC 4346 and RFC 2246.
*
* Certification paths are identified by their certification path IDs in the keystore. The first certificate in the certification path must be the TLS server certificate.
* Since each certificate has exactly one associated key pair, a reference to the key pair that is associated with the server certificate is not supplied explicitly.
* Devices shall obtain the private key or results of operations under the private key by suitable internal interaction with the keystore.
* If a device chooses to perform a TLS key exchange based on the supplied certification path, it shall use the key pair that is associated with the server certificate for
* key exchange and transmit the certification path to TLS clients as-is, i.e., the device shall not check conformance of the certification path to RFC 4346 norRFC 2246.
* In order to use the server certificate during the TLS handshake, the corresponding private key is required.
* Therefore, if the key pair that is associated with the server certificate, i.e., the first certificate in the certification path, does not have an associated private key,
* the NoPrivateKey fault is produced and the certification path is not associated to the TLS server.
* A TLS server may present different certification paths to different clients during the TLS handshake instead of presenting the same certification path to all clients.
* Therefore more than one certification path may be assigned to the TLS server.
* If the maximum number of certification paths that may be assigned to the TLS server simultaneously is reached, the device shall generate a MaximumNumberOfCertificationPathsReached
* fault and the requested certification path shall not be assigned to the TLS server.
*
*/
ONVIFAdvancedSecurity.prototype.AddServerCertificateAssignment = function () {
return ONVIFAdvancedSecurity.AddServerCertificateAssignment().run(this.config);
};
/**
*
* This operation removes a key pair and certificate assignment (including certification path) to the TLS server on the device.
* Certification paths are identified using certification path IDs. If the supplied certification path ID is not associated to the TLS server, an InvalidArgVal fault is produced.
*
*/
ONVIFAdvancedSecurity.prototype.RemoveServerCertificateAssignment = function () {
return ONVIFAdvancedSecurity.RemoveServerCertificateAssignment().run(this.config);
};
/**
*
* This operation replaces an existing key pair and certificate assignment to the TLS server on the device by a new key pair and certificate assignment (including certification paths).
*
* After the replacement, the TLS server shall use the new certificate and certification path exactly in those cases in which it would have used the old certificate and certification path.
* Therefore, especially in the case that several server certificates are assigned to the TLS server, clients that wish to replace an old certificate assignment by a new assignment
* should use this operation instead of a combination of the Add TLS Server Certificate Assignment and the Remove TLS Server Certificate Assignment operations.
*
* Certification paths are identified using certification path IDs. If the supplied old certification path ID is not associated to the TLS server, or no certification path exists
* under the new certification path ID, the corresponding InvalidArgVal faults are produced and the associations are unchanged.
* The first certificate in the new certification path must be the TLS server certificate.
* Since each certificate has exactly one associated key pair, a reference to the key pair that is associated with the new server certificate is not supplied explicitly.
* Devices shall obtain the private key or results of operations under the private key by suitable internal interaction with the keystore.
* If a device chooses to perform a TLS key exchange based on the new certification path, it shall use the key pair that is associated with the server certificate
* for key exchange and transmit the certification path to TLS clients as-is, i.e., the device shall not check conformance of the certification path to RFC 4346 norRFC 2246.
* In order to use the server certificate during the TLS handshake, the corresponding private key is required.
* Therefore, if the key pair that is associated with the server certificate, i.e., the first certificate in the certification path, does not have an associated private key,
* the NoPrivateKey fault is produced and the certification path is not associated to the TLS server.
*
*/
ONVIFAdvancedSecurity.prototype.ReplaceServerCertificateAssignment = function () {
return ONVIFAdvancedSecurity.ReplaceServerCertificateAssignment().run(this.config);
};
/**
*
* This operation sets the version(s) of TLS which the device shall use. Valid values are taken from the TLSServerSupported capability.
* A client initiates a TLS session by sending a ClientHello with the hightest TLS version it supports. This suggests to the server that the client can accept any TLS version up to and including that version.
* The server then chooses the TLS version to use. This is generally the highest TLS version the server supports that is within the range of the client. For example, if a ClientHello indicates TLS version 1.1, the server can proceed with TLS 1.0 or TLS 1.1.
* In the event that an ONVIF installation wishes to disable certain version(s) of TLS, it may do so with this operation. For example, to disable TLS 1.0 on a device signaling support for TLS versions 1.0, 1.1, and 1.2, the enabled version list may be set to "1.1 1.2", omitting 1.0. If a client then attempts to connect with a ClientHello containing TLS 1.0, the server shall send a "protocol_version" alert message and close the connection. This handshake indicates to the client that TLS 1.0 is not supported by the server. The client must try again with a higher TLS version suggestion.
* An empty list is not permitted. Disabling all versions of TLS is not the intent of this operation. See AddServerCertificateAssignment and RemoveServerCertificateAssignment.
*
*/
ONVIFAdvancedSecurity.prototype.SetEnabledTLSVersions = function () {
return ONVIFAdvancedSecurity.SetEnabledTLSVersions().run(this.config);
};
/**
*
* This operation retrieves the version(s) of TLS which are currently enabled on the device.
*
*/
ONVIFAdvancedSecurity.prototype.GetEnabledTLSVersions = function () {
return ONVIFAdvancedSecurity.GetEnabledTLSVersions().run(this.config);
};
/**
*
* This operation returns the IDs of all key pairs and certificates (including certification paths) that are assigned to the TLS server on the device.
* This operation may be used, e.g., if a client lost track of the certification path assignments on the device.
* If no certification path is assigned to the TLS server, an empty list is returned.
*
*/
ONVIFAdvancedSecurity.prototype.GetAssignedServerCertificates = function () {
return ONVIFAdvancedSecurity.GetAssignedServerCertificates().run(this.config);
};
/**
*
* This operation activates or deactivates TLS client authentication for the TLS server on the device.
* The TLS server on the device shall require client authentication if and only if clientAuthenticationRequired is set to true.
* If TLS client authentication is requested to be enabled and no certification path validation policy is assigned to the TLS server, the device shall return an EnablingTLSClientAuthenticationFailed fault and shall not enable TLS client authentication.
* The device shall execute this command regardless of the TLS enabled/disabled state configured in the ONVIF Device Management Service.
*
*/
ONVIFAdvancedSecurity.prototype.SetClientAuthenticationRequired = function () {
return ONVIFAdvancedSecurity.SetClientAuthenticationRequired().run(this.config);
};
/**
*
* This operation returns whether TLS client authentication is active.
*
*/
ONVIFAdvancedSecurity.prototype.GetClientAuthenticationRequired = function () {
return ONVIFAdvancedSecurity.GetClientAuthenticationRequired().run(this.config);
};
/**
*
* This operation enables or disables mapping of the Common Name present in the TLS client certificate to an existing user name in the device.
* The TLS server on the device shall perform mapping if parameter clientAuthenticationRequired is set to true.
*
*/
ONVIFAdvancedSecurity.prototype.SetCnMapsToUser = function () {
return ONVIFAdvancedSecurity.SetCnMapsToUser().run(this.config);
};
/**
*
* This operation returns whether the Common Name Mapping to User is enabled.
*
*/
ONVIFAdvancedSecurity.prototype.GetCnMapsToUser = function () {
return ONVIFAdvancedSecurity.GetCnMapsToUser().run(this.config);
};
/**
*
* This operation assigns a certification path validation policy to the TLS server on the device. The TLS server shall enforce the policy when authenticating TLS clients and consider a client authentic if and only if the algorithm returns valid.
* If no certification path validation policy is stored under the requested CertPathValidationPolicyID, the device shall produce a CertPathValidationPolicyID fault.
* A TLS server may use different certification path validation policies to authenticate clients. Therefore more than one certification path validation policy may be assigned to the TLS server. If the maximum number of certification path validation policies that may be assigned to the TLS server simultaneously is reached, the device shall produce a MaximumNumberOfTLSCertPathValidationPoliciesReached fault and shall not assign the requested certification path validation policy to the TLS server.
*
*/
ONVIFAdvancedSecurity.prototype.AddCertPathValidationPolicyAssignment = function () {
return ONVIFAdvancedSecurity.AddCertPathValidationPolicyAssignment().run(this.config);
};
/**
*
* This operation removes a certification path validation policy assignment from the TLS server on the device.
* If the certification path validation policy identified by the requested CertPathValidationPolicyID is not associated to the TLS server, the device shall produce a CertPathValidationPolicy fault.
*
*/
ONVIFAdvancedSecurity.prototype.RemoveCertPathValidationPolicyAssignment = function () {
return ONVIFAdvancedSecurity.RemoveCertPathValidationPolicyAssignment().run(this.config);
};
/**
*
* This operation replaces a certification path validation policy assignment to the TLS server on the device with another certification path validation policy assignment.
* If the certification path validation policy identified by the requested OldCertPathValidationPolicyID is not associated to the TLS server, the device shall produce an OldCertPathValidationPolicyID fault and shall not associate the certification path validation policy identified by the NewCertPathValidationPolicyID to the TLS server.
* If no certification path validation policy exists under the requested NewCertPathValidationPolicyID in the device’s keystore, the device shall produce a NewCertPathValidationPolicyID fault and shall not remove the association of the old certification path validation policy to the TLS server.
*
*/
ONVIFAdvancedSecurity.prototype.ReplaceCertPathValidationPolicyAssignment = function () {
return ONVIFAdvancedSecurity.ReplaceCertPathValidationPolicyAssignment().run(this.config);
};
/**
*
* This operation returns the IDs of all certification path validation policies that are assigned to the TLS server on the device.
*
*/
ONVIFAdvancedSecurity.prototype.GetAssignedCertPathValidationPolicies = function () {
return ONVIFAdvancedSecurity.GetAssignedCertPathValidationPolicies().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.AddDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.AddDot1XConfiguration().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.GetAllDot1XConfigurations = function () {
return ONVIFAdvancedSecurity.GetAllDot1XConfigurations().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.GetDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.GetDot1XConfiguration().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.DeleteDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.DeleteDot1XConfiguration().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.SetNetworkInterfaceDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.SetNetworkInterfaceDot1XConfiguration().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.GetNetworkInterfaceDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.GetNetworkInterfaceDot1XConfiguration().run(this.config);
};
/**
*
* (to be written)
*
*/
ONVIFAdvancedSecurity.prototype.DeleteNetworkInterfaceDot1XConfiguration = function () {
return ONVIFAdvancedSecurity.DeleteNetworkInterfaceDot1XConfiguration().run(this.config);
};
return ONVIFAdvancedSecurity;
}());
var ManagedONVIFApi = /** @class */ (function () {
function ManagedONVIFApi(config) {
this.config = config;
this.Event = new ONVIFEvent(this.config);
this.Device = new ONVIFDevice(this.config);
this.Media = new ONVIFMedia(this.config);
this.Analytics = new ONVIFAnalytics(this.config);
this.Display = new ONVIFDisplay(this.config);
this.Imaging = new ONVIFImaging(this.config);
this.Provisioning = new ONVIFProvisioning(this.config);
this.PTZ = new ONVIFPTZ(this.config);
this.Receiver = new ONVIFReceiver(this.config);
this.Recording = new ONVIFRecording(this.config);
this.Replay = new ONVIFReplay(this.config);
this.Search = new ONVIFSearch(this.config);
this.AdvancedSecurity = new ONVIFAdvancedSecurity(this.config);
}
return ManagedONVIFApi;
}());
var createManagedDevice = function (config) { return typescriptMonads.reader(function (system) {
var innerRunConfig = {
system: system,
deviceUrl: config.deviceUrl,
user: config.username && config.password
? typescriptMonads.maybe({ username: config.username, password: config.password })
: typescriptMonads.maybe()
};
return {
api: new ManagedONVIFApi(innerRunConfig)
};
}); };
var REQUEST_HEADERS = { 'Content-Type': 'application/soap+xml; charset=utf-8;' };
var FETCH_CONFIG = function (body) { return ({ method: 'POST', body: body, headers: REQUEST_HEADERS }); };
var sharedFetchWrapper = function (fetchResponse) {
return rxjs.from(fetchResponse)
.pipe(operators.flatMap(function (a) { return a.text().then(function (body) {
return {
body: body,
status: a.status,
statusMessage: a.statusText
};
}); }));
};
var nonce = function (size) {
if (size === void 0) { size = 30; }
return Array.from(__spreadArrays(Array(size))).map(function () { return Math.random().toString(36)[3]; }).join('');
};
var soapFault = function (code, reason, detail) { return "<?xml version=\u201D1.0\u201D ?>\n<soapenv:Envelope xmlns:soapenv=\"http://www.w3.org/2003/05/soapenvelope\" \n xmlns:ter=\"http://www.onvif.org/ver10/error\" \n xmlns:xs=\"http://www.w3.org/2000/10/XMLSchema\">\n <soapenv:Body>\n <soapenv:Fault>\n <soapenv:Code>\n <soapenv:Value>" + code + "</soapenv:Value>\n <soapenv:Subcode>\n <soapenv:Value>ter:" + code + "</soapenv:Value>\n <soapenv:Subcode>\n <soapenv:Value>ter:" + code + "</soapenv:Value>\n </soapenv:Subcode>\n </soapenv:Subcode>\n </soapenv:Code>\n <soapenv:Reason>\n <soapenv:Text xml:lang=\"en\">" + reason + "</soapenv:Text>\n </soapenv:Reason>\n <soapenv:Node>http://www.w3.org/2003/05/soapenvelope/node/ultimateReceiver</soapenv:Node>\n <soapenv:Role>http://www.w3.org/2003/05/soapenvelope/role/ultimateReceiver</soapenv:Role>\n <soapenv:Detail>\n <soapenv:Text>" + detail + "</soapenv:Text>\n </soapenv:Detail>\n </soapenv:Fault>\n </soapenv:Body>\n</soapenv:Envelope>"; };
var digestSha1 = function (str) { return Promise.resolve(crypto$1.createHash('sha1').update(str).digest('hex')); };
var getContent = function (url, body) {
return rxHttpRequest.RxHR.post(url, {
body: body,
family: 4,
headers: {
'Content-Type': 'application/soap+xml; charset=utf-8;',
'Content-Length': body.length
}
})
.pipe(operators.catchError(function (err) {
var statusCode = 500;
var statusMessage = err.errno || err.status || err.message;
var body = soapFault(statusCode, statusMessage, statusMessage);
return rxjs.of({
body: body,
response: {
body: body,
statusMessage: statusMessage,
statusCode: statusCode
}
});
}));
};
var parser = new xmldom.DOMParser();
var transport = function (body) {
return function (uri) {
return sharedFetchWrapper(getContent(uri, body).pipe(operators.map(function (a) {
return {
text: function () { return Promise.resolve(a.body); },
status: a.response.statusCode,
statusText: a.response.statusMessage
};
})).toPromise());
};
};
var DEFAULT_NODE_ENV = {
parser: parser,
transport: transport,
nonce: nonce,
digestSha1: digestSha1,
buffer: Buffer
};
var digestSha1$1 = function (data) {
return crypto.subtle.digest('SHA-1', new TextEncoder().encode(data))
.then(function (hash) { return Array.from(new Uint8Array(hash)).map(function (b) { return b.toString(16).padStart(2, '0'); }).join(''); });
};
var transport$1 = function (body) {
return function (uri) {
return sharedFetchWrapper(fetch(uri, FETCH_CONFIG(body)));
};
};
var DEFAULT_BROWSER_ENV = {
parser: typeof DOMParser !== 'undefined' ? new DOMParser() : {},
nonce: nonce,
digestSha1: digestSha1$1,
transport: transport$1,
buffer: buffer.Buffer
};
var createManagedDeviceInBrowser = function (config) {
return createManagedDevice(config)
.run(DEFAULT_BROWSER_ENV);
};
var createManagedDeviceInNode = function (config) {
return createManagedDevice(config)
.run(DEFAULT_NODE_ENV);
};
exports.DEFAULT_BROWSER_ENV = DEFAULT_BROWSER_ENV;
exports.ManagedONVIFApi = ManagedONVIFApi;
exports.ONVIFAdvancedSecurity = ONVIFAdvancedSecurity;
exports.ONVIFAnalytics = ONVIFAnalytics;
exports.ONVIFDevice = ONVIFDevice;
exports.ONVIFDisplay = ONVIFDisplay;
exports.ONVIFEvent = ONVIFEvent;
exports.ONVIFImaging = ONVIFImaging;
exports.ONVIFMedia = ONVIFMedia;
exports.ONVIFPTZ = ONVIFPTZ;
exports.ONVIFProvisioning = ONVIFProvisioning;
exports.ONVIFReceiver = ONVIFReceiver;
exports.ONVIFRecording = ONVIFRecording;
exports.ONVIFReplay = ONVIFReplay;
exports.ONVIFSearch = ONVIFSearch;
exports.createManagedDevice = createManagedDevice;
exports.createManagedDeviceInBrowser = createManagedDeviceInBrowser;
exports.createManagedDeviceInNode = createManagedDeviceInNode;