UNPKG

fleeta-api-lib

Version:

A comprehensive library for fleet management applications - API, Auth, Device management

191 lines 4.53 kB
/** * Type definitions for Live View API * Defines interfaces and types used for live streaming functionality */ export type LiveCameraChannel = '1' | '2' | '3' | '4'; export type LiveStreamStatus = 'free' | 'busy' | 'LiveStopped' | 'onLiveStreaming' | 'LiveClosing'; /** * Request parameters for PlayLiveView command */ export interface PlayLiveViewParams { email: string; user_token: string; psn: string; tokenType?: 'app' | 'web'; param1?: LiveCameraChannel; } /** * Response from PlayLiveView API */ export interface PlayLiveViewResponse { resultcode: string; message: string; status?: LiveStreamStatus; streamname?: string; } /** * Request parameters for StopLiveView command */ export interface StopLiveViewParams { email: string; user_token: string; psn: string; tokenType?: 'app' | 'web'; } /** * Response from StopLiveView API */ export interface StopLiveViewResponse { resultcode: string; message: string; status?: LiveStreamStatus; } /** * Request parameters for LiveDirection command */ export interface LiveDirectionParams { email: string; user_token: string; psn: string; tokenType?: 'app' | 'web'; param1: LiveCameraChannel; } /** * Response from LiveDirection API */ export interface LiveDirectionResponse { resultcode: string; message: string; status?: 'free' | 'busy'; direction?: LiveCameraChannel; streamname?: string; streamURL?: string; url?: string; channelARN?: string; iceServers?: any[]; } /** * Live stream connection state for UI management */ export interface LiveStreamState { psn: string; channel: LiveCameraChannel; status: LiveStreamStatus; streamname?: string; isConnecting: boolean; error?: string; lastUpdated: Date; } /** * Live view error codes mapping */ export declare const LIVE_VIEW_ERROR_MESSAGES: { readonly BC_ERR_AUTHENTICATION: "Authentication failed. Please check your credentials."; readonly BC_ERR_INVALID_PARAMETER: "Invalid parameters provided."; readonly BC_ERR_SERVER: "Internal server error occurred."; readonly BC_ERR_UNAVAILABLE: "Device is not available for live streaming."; readonly BC_ERR_BUSY: "Device is currently busy with another live stream."; readonly BC_ERR_UNPLUGED: "Device is unplugged and cannot stream video."; }; /** * Camera channel display names */ export declare const CAMERA_CHANNEL_NAMES: Record<LiveCameraChannel, string>; /** * WebRTC role types for live streaming */ export type WebRTCRole = 'VIEWER' | 'MASTER'; /** * Request parameters for Live presigned URL */ export interface LivePresignURLParams { streamName: string; role: WebRTCRole; psn: string; } /** * ICE server configuration for WebRTC */ export interface ICEServer { urls: string[]; username?: string; credential?: string; } /** * WebRTC endpoints by protocol */ export interface EndpointsByProtocol { HTTPS: string; WSS: string; } /** * Response from Live presigned URL API */ export interface LivePresignURLResponse { resultcode: string; message: string; region: string; channelARN: string; url: string; iceServers: ICEServer[]; endpointsByProtocol: EndpointsByProtocol; } /** * Complete WebRTC configuration for live streaming */ export interface WebRTCConfig { region: string; channelARN: string; url: string; iceServers: ICEServer[]; endpointsByProtocol: EndpointsByProtocol; role: WebRTCRole; clientId: string; } /** * Live streaming workflow result */ export interface LiveStreamingWorkflow { webrtcConfig: WebRTCConfig; streamName: string; status: LiveStreamStatus; } /** * Two-way audio communication status */ export type TwoWayStatus = 'free' | 'busy'; /** * Request parameters for TwoWayStart command */ export interface TwoWayStartParams { email: string; user_token: string; psn: string; tokenType?: 'app' | 'web'; } /** * Response from TwoWayStart API */ export interface TwoWayStartResponse { resultcode: string; message: string; status?: TwoWayStatus; } /** * Request parameters for TwoWayStop command */ export interface TwoWayStopParams { email: string; user_token: string; psn: string; tokenType?: 'app' | 'web'; } /** * Response from TwoWayStop API */ export interface TwoWayStopResponse { resultcode: string; message: string; status?: TwoWayStatus; } //# sourceMappingURL=types.d.ts.map