UNPKG

spot-sdk-ts

Version:

TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics

379 lines 21.7 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VersionServiceClientImpl = exports.NetworkServiceClientImpl = exports.HealthServiceClientImpl = exports.AudioServiceClientImpl = exports.PtzServiceClientImpl = exports.MediaLogServiceClientImpl = exports.LightingServiceClientImpl = exports.PowerServiceClientImpl = exports.StreamQualityServiceClientImpl = exports.CompositorServiceClientImpl = exports.protobufPackage = void 0; /* eslint-disable */ const compositor_1 = require("./compositor"); const streamquality_1 = require("./streamquality"); const power_1 = require("./power"); const LED_1 = require("./LED"); const logging_1 = require("./logging"); const operators_1 = require("rxjs/operators"); const ptz_1 = require("./ptz"); const audio_1 = require("./audio"); const health_1 = require("./health"); const network_1 = require("./network"); const version_1 = require("./version"); const minimal_1 = __importDefault(require("protobufjs/minimal")); exports.protobufPackage = "bosdyn.api.spot_cam"; class CompositorServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetScreen = this.SetScreen.bind(this); this.GetScreen = this.GetScreen.bind(this); this.ListScreens = this.ListScreens.bind(this); this.GetVisibleCameras = this.GetVisibleCameras.bind(this); this.SetIrColormap = this.SetIrColormap.bind(this); this.GetIrColormap = this.GetIrColormap.bind(this); this.SetIrMeterOverlay = this.SetIrMeterOverlay.bind(this); } SetScreen(request) { const data = compositor_1.SetScreenRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "SetScreen", data); return promise.then((data) => compositor_1.SetScreenResponse.decode(new minimal_1.default.Reader(data))); } GetScreen(request) { const data = compositor_1.GetScreenRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "GetScreen", data); return promise.then((data) => compositor_1.GetScreenResponse.decode(new minimal_1.default.Reader(data))); } ListScreens(request) { const data = compositor_1.ListScreensRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "ListScreens", data); return promise.then((data) => compositor_1.ListScreensResponse.decode(new minimal_1.default.Reader(data))); } GetVisibleCameras(request) { const data = compositor_1.GetVisibleCamerasRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "GetVisibleCameras", data); return promise.then((data) => compositor_1.GetVisibleCamerasResponse.decode(new minimal_1.default.Reader(data))); } SetIrColormap(request) { const data = compositor_1.SetIrColormapRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "SetIrColormap", data); return promise.then((data) => compositor_1.SetIrColormapResponse.decode(new minimal_1.default.Reader(data))); } GetIrColormap(request) { const data = compositor_1.GetIrColormapRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "GetIrColormap", data); return promise.then((data) => compositor_1.GetIrColormapResponse.decode(new minimal_1.default.Reader(data))); } SetIrMeterOverlay(request) { const data = compositor_1.SetIrMeterOverlayRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.CompositorService", "SetIrMeterOverlay", data); return promise.then((data) => compositor_1.SetIrMeterOverlayResponse.decode(new minimal_1.default.Reader(data))); } } exports.CompositorServiceClientImpl = CompositorServiceClientImpl; class StreamQualityServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetStreamParams = this.SetStreamParams.bind(this); this.GetStreamParams = this.GetStreamParams.bind(this); this.EnableCongestionControl = this.EnableCongestionControl.bind(this); } SetStreamParams(request) { const data = streamquality_1.SetStreamParamsRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.StreamQualityService", "SetStreamParams", data); return promise.then((data) => streamquality_1.SetStreamParamsResponse.decode(new minimal_1.default.Reader(data))); } GetStreamParams(request) { const data = streamquality_1.GetStreamParamsRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.StreamQualityService", "GetStreamParams", data); return promise.then((data) => streamquality_1.GetStreamParamsResponse.decode(new minimal_1.default.Reader(data))); } EnableCongestionControl(request) { const data = streamquality_1.EnableCongestionControlRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.StreamQualityService", "EnableCongestionControl", data); return promise.then((data) => streamquality_1.EnableCongestionControlResponse.decode(new minimal_1.default.Reader(data))); } } exports.StreamQualityServiceClientImpl = StreamQualityServiceClientImpl; class PowerServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetPowerStatus = this.SetPowerStatus.bind(this); this.GetPowerStatus = this.GetPowerStatus.bind(this); this.CyclePower = this.CyclePower.bind(this); } SetPowerStatus(request) { const data = power_1.SetPowerStatusRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PowerService", "SetPowerStatus", data); return promise.then((data) => power_1.SetPowerStatusResponse.decode(new minimal_1.default.Reader(data))); } GetPowerStatus(request) { const data = power_1.GetPowerStatusRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PowerService", "GetPowerStatus", data); return promise.then((data) => power_1.GetPowerStatusResponse.decode(new minimal_1.default.Reader(data))); } CyclePower(request) { const data = power_1.CyclePowerRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PowerService", "CyclePower", data); return promise.then((data) => power_1.CyclePowerResponse.decode(new minimal_1.default.Reader(data))); } } exports.PowerServiceClientImpl = PowerServiceClientImpl; class LightingServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetLEDBrightness = this.SetLEDBrightness.bind(this); this.GetLEDBrightness = this.GetLEDBrightness.bind(this); } SetLEDBrightness(request) { const data = LED_1.SetLEDBrightnessRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.LightingService", "SetLEDBrightness", data); return promise.then((data) => LED_1.SetLEDBrightnessResponse.decode(new minimal_1.default.Reader(data))); } GetLEDBrightness(request) { const data = LED_1.GetLEDBrightnessRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.LightingService", "GetLEDBrightness", data); return promise.then((data) => LED_1.GetLEDBrightnessResponse.decode(new minimal_1.default.Reader(data))); } } exports.LightingServiceClientImpl = LightingServiceClientImpl; class MediaLogServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.Store = this.Store.bind(this); this.GetStatus = this.GetStatus.bind(this); this.Tag = this.Tag.bind(this); this.EnableDebug = this.EnableDebug.bind(this); this.ListCameras = this.ListCameras.bind(this); this.RetrieveRawData = this.RetrieveRawData.bind(this); this.Retrieve = this.Retrieve.bind(this); this.Delete = this.Delete.bind(this); this.ListLogpoints = this.ListLogpoints.bind(this); this.SetPassphrase = this.SetPassphrase.bind(this); } Store(request) { const data = logging_1.StoreRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "Store", data); return promise.then((data) => logging_1.StoreResponse.decode(new minimal_1.default.Reader(data))); } GetStatus(request) { const data = logging_1.GetStatusRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "GetStatus", data); return promise.then((data) => logging_1.GetStatusResponse.decode(new minimal_1.default.Reader(data))); } Tag(request) { const data = logging_1.TagRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "Tag", data); return promise.then((data) => logging_1.TagResponse.decode(new minimal_1.default.Reader(data))); } EnableDebug(request) { const data = logging_1.DebugRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "EnableDebug", data); return promise.then((data) => logging_1.DebugResponse.decode(new minimal_1.default.Reader(data))); } ListCameras(request) { const data = logging_1.ListCamerasRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "ListCameras", data); return promise.then((data) => logging_1.ListCamerasResponse.decode(new minimal_1.default.Reader(data))); } RetrieveRawData(request) { const data = logging_1.RetrieveRawDataRequest.encode(request).finish(); const result = this.rpc.serverStreamingRequest("bosdyn.api.spot_cam.MediaLogService", "RetrieveRawData", data); return result.pipe((0, operators_1.map)((data) => logging_1.RetrieveRawDataResponse.decode(new minimal_1.default.Reader(data)))); } Retrieve(request) { const data = logging_1.RetrieveRequest.encode(request).finish(); const result = this.rpc.serverStreamingRequest("bosdyn.api.spot_cam.MediaLogService", "Retrieve", data); return result.pipe((0, operators_1.map)((data) => logging_1.RetrieveResponse.decode(new minimal_1.default.Reader(data)))); } Delete(request) { const data = logging_1.DeleteRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "Delete", data); return promise.then((data) => logging_1.DeleteResponse.decode(new minimal_1.default.Reader(data))); } ListLogpoints(request) { const data = logging_1.ListLogpointsRequest.encode(request).finish(); const result = this.rpc.serverStreamingRequest("bosdyn.api.spot_cam.MediaLogService", "ListLogpoints", data); return result.pipe((0, operators_1.map)((data) => logging_1.ListLogpointsResponse.decode(new minimal_1.default.Reader(data)))); } SetPassphrase(request) { const data = logging_1.SetPassphraseRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.MediaLogService", "SetPassphrase", data); return promise.then((data) => logging_1.SetPassphraseResponse.decode(new minimal_1.default.Reader(data))); } } exports.MediaLogServiceClientImpl = MediaLogServiceClientImpl; class PtzServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetPtzPosition = this.SetPtzPosition.bind(this); this.GetPtzPosition = this.GetPtzPosition.bind(this); this.SetPtzVelocity = this.SetPtzVelocity.bind(this); this.GetPtzVelocity = this.GetPtzVelocity.bind(this); this.ListPtz = this.ListPtz.bind(this); this.InitializeLens = this.InitializeLens.bind(this); } SetPtzPosition(request) { const data = ptz_1.SetPtzPositionRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "SetPtzPosition", data); return promise.then((data) => ptz_1.SetPtzPositionResponse.decode(new minimal_1.default.Reader(data))); } GetPtzPosition(request) { const data = ptz_1.GetPtzPositionRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "GetPtzPosition", data); return promise.then((data) => ptz_1.GetPtzPositionResponse.decode(new minimal_1.default.Reader(data))); } SetPtzVelocity(request) { const data = ptz_1.SetPtzVelocityRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "SetPtzVelocity", data); return promise.then((data) => ptz_1.SetPtzVelocityResponse.decode(new minimal_1.default.Reader(data))); } GetPtzVelocity(request) { const data = ptz_1.GetPtzVelocityRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "GetPtzVelocity", data); return promise.then((data) => ptz_1.GetPtzVelocityResponse.decode(new minimal_1.default.Reader(data))); } ListPtz(request) { const data = ptz_1.ListPtzRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "ListPtz", data); return promise.then((data) => ptz_1.ListPtzResponse.decode(new minimal_1.default.Reader(data))); } InitializeLens(request) { const data = ptz_1.InitializeLensRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.PtzService", "InitializeLens", data); return promise.then((data) => ptz_1.InitializeLensResponse.decode(new minimal_1.default.Reader(data))); } } exports.PtzServiceClientImpl = PtzServiceClientImpl; class AudioServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.PlaySound = this.PlaySound.bind(this); this.LoadSound = this.LoadSound.bind(this); this.DeleteSound = this.DeleteSound.bind(this); this.ListSounds = this.ListSounds.bind(this); this.SetVolume = this.SetVolume.bind(this); this.GetVolume = this.GetVolume.bind(this); this.SetAudioCaptureChannel = this.SetAudioCaptureChannel.bind(this); this.GetAudioCaptureChannel = this.GetAudioCaptureChannel.bind(this); this.SetAudioCaptureGain = this.SetAudioCaptureGain.bind(this); this.GetAudioCaptureGain = this.GetAudioCaptureGain.bind(this); } PlaySound(request) { const data = audio_1.PlaySoundRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "PlaySound", data); return promise.then((data) => audio_1.PlaySoundResponse.decode(new minimal_1.default.Reader(data))); } LoadSound(request) { const data = request.pipe((0, operators_1.map)((request) => audio_1.LoadSoundRequest.encode(request).finish())); const promise = this.rpc.clientStreamingRequest("bosdyn.api.spot_cam.AudioService", "LoadSound", data); return promise.then((data) => audio_1.LoadSoundResponse.decode(new minimal_1.default.Reader(data))); } DeleteSound(request) { const data = audio_1.DeleteSoundRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "DeleteSound", data); return promise.then((data) => audio_1.DeleteSoundResponse.decode(new minimal_1.default.Reader(data))); } ListSounds(request) { const data = audio_1.ListSoundsRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "ListSounds", data); return promise.then((data) => audio_1.ListSoundsResponse.decode(new minimal_1.default.Reader(data))); } SetVolume(request) { const data = audio_1.SetVolumeRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "SetVolume", data); return promise.then((data) => audio_1.SetVolumeResponse.decode(new minimal_1.default.Reader(data))); } GetVolume(request) { const data = audio_1.GetVolumeRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "GetVolume", data); return promise.then((data) => audio_1.GetVolumeResponse.decode(new minimal_1.default.Reader(data))); } SetAudioCaptureChannel(request) { const data = audio_1.SetAudioCaptureChannelRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "SetAudioCaptureChannel", data); return promise.then((data) => audio_1.SetAudioCaptureChannelResponse.decode(new minimal_1.default.Reader(data))); } GetAudioCaptureChannel(request) { const data = audio_1.GetAudioCaptureChannelRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "GetAudioCaptureChannel", data); return promise.then((data) => audio_1.GetAudioCaptureChannelResponse.decode(new minimal_1.default.Reader(data))); } SetAudioCaptureGain(request) { const data = audio_1.SetAudioCaptureGainRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "SetAudioCaptureGain", data); return promise.then((data) => audio_1.SetAudioCaptureGainResponse.decode(new minimal_1.default.Reader(data))); } GetAudioCaptureGain(request) { const data = audio_1.GetAudioCaptureGainRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.AudioService", "GetAudioCaptureGain", data); return promise.then((data) => audio_1.GetAudioCaptureGainResponse.decode(new minimal_1.default.Reader(data))); } } exports.AudioServiceClientImpl = AudioServiceClientImpl; class HealthServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.GetTemperature = this.GetTemperature.bind(this); this.GetBITStatus = this.GetBITStatus.bind(this); this.ClearBITEvents = this.ClearBITEvents.bind(this); this.GetSystemLog = this.GetSystemLog.bind(this); } GetTemperature(request) { const data = health_1.GetTemperatureRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.HealthService", "GetTemperature", data); return promise.then((data) => health_1.GetTemperatureResponse.decode(new minimal_1.default.Reader(data))); } GetBITStatus(request) { const data = health_1.GetBITStatusRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.HealthService", "GetBITStatus", data); return promise.then((data) => health_1.GetBITStatusResponse.decode(new minimal_1.default.Reader(data))); } ClearBITEvents(request) { const data = health_1.ClearBITEventsRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.HealthService", "ClearBITEvents", data); return promise.then((data) => health_1.ClearBITEventsResponse.decode(new minimal_1.default.Reader(data))); } GetSystemLog(request) { const data = health_1.GetSystemLogRequest.encode(request).finish(); const result = this.rpc.serverStreamingRequest("bosdyn.api.spot_cam.HealthService", "GetSystemLog", data); return result.pipe((0, operators_1.map)((data) => health_1.GetSystemLogResponse.decode(new minimal_1.default.Reader(data)))); } } exports.HealthServiceClientImpl = HealthServiceClientImpl; class NetworkServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.SetICEConfiguration = this.SetICEConfiguration.bind(this); this.GetICEConfiguration = this.GetICEConfiguration.bind(this); } SetICEConfiguration(request) { const data = network_1.SetICEConfigurationRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.NetworkService", "SetICEConfiguration", data); return promise.then((data) => network_1.SetICEConfigurationResponse.decode(new minimal_1.default.Reader(data))); } GetICEConfiguration(request) { const data = network_1.GetICEConfigurationRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.NetworkService", "GetICEConfiguration", data); return promise.then((data) => network_1.GetICEConfigurationResponse.decode(new minimal_1.default.Reader(data))); } } exports.NetworkServiceClientImpl = NetworkServiceClientImpl; class VersionServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.GetSoftwareVersion = this.GetSoftwareVersion.bind(this); } GetSoftwareVersion(request) { const data = version_1.GetSoftwareVersionRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot_cam.VersionService", "GetSoftwareVersion", data); return promise.then((data) => version_1.GetSoftwareVersionResponse.decode(new minimal_1.default.Reader(data))); } } exports.VersionServiceClientImpl = VersionServiceClientImpl; //# sourceMappingURL=service.js.map