UNPKG

onvif-rx

Version:

Interact with ONVIF cameras and devices using RXJS

62 lines (61 loc) 4.48 kB
import { IResult } from 'typescript-monads'; import { IDeviceConfig, ITransportPayoad } from '../config/interfaces'; import { Observable } from 'rxjs'; export interface IResultStructure<T> { readonly json: T; readonly xml: string; } export declare type IOnvifResult = IResult<IXmlContainer, ITransportPayoad>; export declare enum XMLNS { S11 = "xmlns:S11=\"http://www.w3.org/2003/05/soap-envelope\"", wsse = "xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"", wsu = "xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"", tt = "xmlns:tt=\"http://www.onvif.org/ver10/schema\"", tds = "xmlns:tds=\"http://www.onvif.org/ver10/device/wsdl\"", trt = "xmlns:trt=\"http://www.onvif.org/ver10/media/wsdl\"", xsi = "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"", xsd = "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"", ns1 = "xmlns:ns1=\"http://www.onvif.org/ver10/accesscontrol/wsdl\"", ns3 = "xmlns:ns3=\"http://www.onvif.org/ver10/actionengine/wsdl\"", tad = "xmlns:tad=\"http://www.onvif.org/ver10/analyticsdevice/wsdl\"", timg = "xmlns:timg=\"http://www.onvif.org/ver20/imaging/wsdl\"", tptz = "xmlns:tptz=\"http://www.onvif.org/ver20/ptz/wsdl\"", trc = "xmlns:trc=\"http://www.onvif.org/ver10/recording/wsdl\"", trv = "xmlns:trv=\"http://www.onvif.org/ver10/receiver/wsdl\"", tse = "xmlns:tse=\"http://www.onvif.org/ver10/search/wsdl\"", vifsvr = "xmlns:vifsvr=\"http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding\"", vifsvr10 = "xmlns:vifsvr10=\"http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding\"", vifsvr2 = "xmlns:vifsvr2=\"http://www.onvif.org/ver10/events/wsdl/EventBinding\"", tev = "xmlns:tev=\"http://www.onvif.org/ver10/events/wsdl\"", vifsvr3 = "xmlns:vifsvr3=\"http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding\"", vifsvr4 = "xmlns:vifsvr4=\"http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding\"", vifsvr5 = "xmlns:vifsvr5=\"http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding\"", vifsvr6 = "xmlns:vifsvr6=\"http://www.onvif.org/ver10/events/wsdl/PullPointBinding\"", vifsvr7 = "xmlns:vifsvr7=\"http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding\"", vifsvr8 = "xmlns:vifsvr8=\"http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding\"", wsnt = "xmlns:wsnt=\"http://docs.oasis-open.org/wsn/b-2\"", vifsvr9 = "xmlns:vifsvr9=\"http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding\"", tan = "xmlns:tan=\"http://www.onvif.org/ver20/analytics/wsdl\"", ter = "xmlns:ter=\"http://www.onvif.org/ver10/error\"", tns1 = "xmlns:tns1=\"http://www.onvif.org/ver10/topics\"", ns2 = "xmlns:ns2=\"http://www.onvif.org/ver10/pacs\"", wsa5 = "xmlns:wsa5=\"http://www.w3.org/2005/08/addressing\"" } export declare enum SOAP_NODE { Header = "S11:Header", Envelope = "S11:Envelope", Body = "S11:Body" } export declare const soapShell: (rawBody: string) => (rawHeader?: string | undefined) => string; export declare const mapResponseXmlToJson: <T>(node: string) => (source: Observable<IOnvifResult>) => Observable<IResult<IResultStructure<T>, ITransportPayoad>>; export declare const mapResponseObsToProperty: <A, B, E>(propSelectFn: (sel: A) => B) => (source: Observable<IResult<A, E>>) => Observable<IResult<B, E>>; export interface IXmlContainer { readonly xmlString: string; readonly xmlDocument: Document; } export declare const generateRequestElements: (reqNode: string) => (params: any) => string; export declare const createStandardRequestBody: (body: string) => import("typescript-monads").IReader<IDeviceConfig, Observable<IOnvifResult>>; export declare const createStandardRequestBodyFromString: (body: string) => import("typescript-monads").IReader<IDeviceConfig, Observable<IOnvifResult>>; export declare const createSimpleRequestBodyFromString: (key: string) => import("typescript-monads").IReader<IDeviceConfig, Observable<IOnvifResult>>; export declare const createDeviceRequestBodyFromString: (key: string) => import("typescript-monads").IReader<IDeviceConfig, Observable<IOnvifResult>>; export declare const createMediaRequestBodyFromString: (key: string) => import("typescript-monads").IReader<IDeviceConfig, Observable<IOnvifResult>>;