UNPKG

@intruder-detection/shelly-api-typescript

Version:

Typescript client for the Shelly HTTP API

1,953 lines (1,826 loc) 93.7 kB
import { DeepPartial } from 'ts-essentials'; import { AxiosRequestConfig, AxiosError } from 'axios'; interface BaseIdType { id: number; } declare enum CommonErrors { InvalidArgument = -103, DeadlineExceeded = -104, KeyNotFound = -105, ResourceAlreadyExists = -106, ResourceExausted = -108, FailedPreconditon = -109, Unavaliable = -114, NoHandlerFound = 404, RequestTimeout = 408 } interface Connected { connected: boolean; } interface BaseShellyResponse<T = undefined> { id: number; src: string; dst?: string; result?: T; error?: BaseError; } interface BaseError { code: number; message: string; } interface BaseRequest { id: number; method: string; src?: string; params?: { [key: string]: any; }; } declare enum AxiosErrorCodes { Timeout = "ETIMEDOUT", ConnectionAborted = "ECONNABORTED" } type EmptyResponse = BaseShellyResponse<null>; interface RestartRequired { restart_required: boolean; } declare enum ShellyMethods { GetStatus = "Shelly.GetStatus", GetConfig = "Shelly.GetConfig", ListMethods = "Shelly.ListMethods", GetDeviceInfo = "Shelly.GetDeviceInfo", ListProfiles = "Shelly.ListProfiles", SetProfile = "Shelly.SetProfile", ListTimezones = "Shelly.ListTimezones", DetectLocation = "Shelly.DetectLocation", CheckForUpdate = "Shelly.CheckForUpdate", Update = "Shelly.Update", FactoryReset = "Shelly.FactoryReset", ResetWiFiConfig = "Shelly.ResetWiFiConfig", Reboot = "Shelly.Reboot", SetAuth = "Shelly.SetAuth", PutUserCA = "Shelly.PutUserCA", PutTLSClientCert = "Shelly.PutTLSClientCert", PutTLSClientKey = "Shelly.PutTLSClientKey", GetComponents = "Shelly.GetComponents" } declare enum ShellyExtraMethods { Shelly = "shelly" } declare enum ScheduleMethods { Create = "Schedule.Create", Update = "Schedule.Update", List = "Schedule.List", Delete = "Schedule.Delete", DeleteAll = "Schedule.DeleteAll" } declare enum WebhookMethods { ListSupported = "Webhook.ListSupported", List = "Webhook.List", Create = "Webhook.Create", Update = "Webhook.Update", Delete = "Webhook.Delete", DeleteAll = "Webhook.DeleteAll" } declare enum HTTPMethods { GET = "HTTP.GET" } declare enum KVSMethods { Set = "KVS.Set", Get = "KVS.Get", GetMany = "KVS.GetMany", List = "KVS.List", Delete = "KVS.Delete" } declare enum SystemMethods { SetConfig = "Sys.SetConfig", GetConfig = "Sys.GetConfig", GetStatus = "Sys.GetStatus" } declare enum WifiMethods { GetConfig = "WiFi.GetConfig", SetConfig = "WiFi.SetConfig", GetStatus = "WiFi.GetStatus", Scan = "WiFi.Scan", ListAPClients = "Wifi.ListAPClients" } declare enum EthernetMethods { SetConfig = "Eth.SetConfig", GetConfig = "Eth.GetConfig", GetStatus = "Eth.GetStatus" } declare enum BLEMethods { SetConfig = "BLE.SetConfig", GetConfig = "BLE.GetConfig", GetStatus = "BLE.GetStatus" } declare enum CloudMethods { SetConfig = "Cloud.SetConfig", GetConfig = "Cloud.GetConfig", GetStatus = "Cloud.GetStatus" } declare enum MQTTMethods { SetConfig = "MQTT.SetConfig", GetConfig = "MQTT.GetConfig", GetStatus = "MQTT.GetStatus" } declare enum WsMethods { SetConfig = "Ws.SetConfig", GetConfig = "Ws.GetConfig", GetStatus = "Ws.GetStatus" } declare enum ScriptMethods { Create = "Script.Create", Delete = "Script.Delete", Eval = "Script.Eval", GetCode = "Script.GetCode", GetConfig = "Script.GetConfig", GetStatus = "Script.GetStatus", List = "Script.List", PutCode = "Script.PutCode", SetConfig = "Script.SetConfig", Start = "Script.Start", Stop = "Script.Stop" } declare enum SwitchMethods { Set = "Switch.Set", Toggle = "Switch.Toggle", SetConfig = "Switch.SetConfig", GetConfig = "Switch.GetConfig", GetStatus = "Switch.GetStatus", ResetCounters = "Switch.ResetCounters" } declare enum InputMethods { GetConfig = "Input.GetConfig", SetConfig = "Input.SetConfig", GetStatus = "Input.GetStatus", CheckExpression = "Input.CheckExpression", ResetCounters = "Input.ResetCounters", Trigger = "Input.Trigger" } declare enum ModbusMethods { SetConfig = "Modbus.SetConfig", GetConfig = "Modbus.GetConfig", GetStatus = "Modbus.GetStatus" } declare enum VoltmeterMethods { SetConfig = "Voltmeter.SetConfig", GetConfig = "Voltmeter.GetConfig", GetStatus = "Voltmeter.GetStatus" } declare enum CoverMethods { SetConfig = "Cover.SetConfig", GetConfig = "Cover.GetConfig", GetStatus = "Cover.GetStatus", Open = "Cover.Open", Close = "Cover.Close", Stop = "Cover.Stop", GoToPosition = "Cover.GoToPosition", Calibrate = "Cover.Calibrate", ResetCounters = "Cover.ResetCounters" } declare enum LightMethods { SetConfig = "Light.SetConfig", GetConfig = "Light.GetConfig", GetStatus = "Light.GetStatus", Set = "Light.Set", Toggle = "Light.Toggle", Calibrate = "Light.Calibrate", ResetCounters = "Light.ResetCounters" } declare enum DevicePowerMethods { SetConfig = "DevicePower.SetConfig", GetConfig = "DevicePower.GetConfig", GetStatus = "DevicePower.GetStatus" } type Gen2Methods = BLEMethods | CloudMethods | CoverMethods | EthernetMethods | HTTPMethods | InputMethods | KVSMethods | LightMethods | MQTTMethods | ScheduleMethods | ScriptMethods | ShellyMethods | ShellyExtraMethods | SwitchMethods | SystemMethods | VoltmeterMethods | WebhookMethods | WifiMethods | WsMethods; interface Observer { enable: boolean; } interface WifiConfig { ap: WifiAccessPoint; sta: WifiStation$1; sta1: WifiStation$1; roam: WifiRoaming; } interface WifiAccessPoint { ssid: string; is_open: boolean; enable: boolean; range_extender: Observer; } interface WifiAccessPointWithPass extends WifiAccessPoint { pass: string; } interface WifiRoaming { rssi_thr: number; interval: number; } interface WifiStation$1 { ssid: null | string; is_open: boolean; enable: boolean; ipv4mode: 'dhcp' | 'static'; ip: string; netmask: string; gw: string; nameserver: string; } interface WifiStationWithPass extends WifiStation$1 { pass: string; } interface WifiGetConfigResponse extends BaseShellyResponse<WifiConfig> { } interface WifiGetStatusResponse extends BaseShellyResponse<WifiStatus> { } interface WifiStatus { sta_ip: string | null; status: string; ssid: string | null; rssi: number; ap_client_count: number; } interface WifiListAPClientsResponse extends BaseShellyResponse<ListAPClients> { } interface ListAPClients { ts: number | null; ap_clients: ApClient[]; } interface ApClient { mac: string; ip: string; ip_static: boolean; mport: number; since: number; } interface WifiScanResponse extends BaseShellyResponse<WifiScan[]> { } interface WifiScan { ssid: string | null; bssid: string | null; auth: number; channel: number; rssi: number; } interface WifiSetConfigBody { config: DeepPartial<WifiConfigForSetConfiguration>; } interface WifiConfigForSetConfiguration { ap: WifiAccessPointWithPass; sta: WifiStationWithPass; sta1: WifiStationWithPass; roam: WifiRoaming; } interface WifiSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface AvailableUpdates { stable?: Version; beta?: Version; } interface Version { version: string; build_id: string; } interface Device$1 { name: null; mac: string; fw_id: string; discoverable: boolean; eco_mode: boolean; } interface Debug { level: number; file_level: string | null; mqtt: Observer; websocket: Observer; udp: UDP; } interface UDP { addr: string | null; } declare enum Timezones { Abidjan = "Africa/Abidjan", Algiers = "Africa/Algiers", Bissau = "Africa/Bissau", Cairo = "Africa/Cairo", Casablanca = "Africa/Casablanca", Ceuta = "Africa/Ceuta", El_Aaiun = "Africa/El_Aaiun", Johannesburg = "Africa/Johannesburg", Juba = "Africa/Juba", Khartoum = "Africa/Khartoum", Lagos = "Africa/Lagos", Maputo = "Africa/Maputo", Monrovia = "Africa/Monrovia", Nairobi = "Africa/Nairobi", Ndjamena = "Africa/Ndjamena", Sao_Tome = "Africa/Sao_Tome", Tripoli = "Africa/Tripoli", Tunis = "Africa/Tunis", Windhoek = "Africa/Windhoek", Adak = "America/Adak", Anchorage = "America/Anchorage", Araguaina = "America/Araguaina", Buenos_Aires = "America/Argentina/Buenos_Aires", Catamarca = "America/Argentina/Catamarca", Cordoba = "America/Argentina/Cordoba", Jujuy = "America/Argentina/Jujuy", La_Rioja = "America/Argentina/La_Rioja", Mendoza = "America/Argentina/Mendoza", Rio_Gallegos = "America/Argentina/Rio_Gallegos", Salta = "America/Argentina/Salta", San_Juan = "America/Argentina/San_Juan", San_Luis = "America/Argentina/San_Luis", Tucuman = "America/Argentina/Tucuman", Ushuaia = "America/Argentina/Ushuaia", Asuncion = "America/Asuncion", Bahia = "America/Bahia", Bahia_Banderas = "America/Bahia_Banderas", Barbados = "America/Barbados", Belem = "America/Belem", Belize = "America/Belize", Boa_Vista = "America/Boa_Vista", Bogota = "America/Bogota", Boise = "America/Boise", Cambridge_Bay = "America/Cambridge_Bay", Campo_Grande = "America/Campo_Grande", Cancun = "America/Cancun", Caracas = "America/Caracas", Cayenne = "America/Cayenne", Chicago = "America/Chicago", Chihuahua = "America/Chihuahua", Ciudad_Juarez = "America/Ciudad_Juarez", Costa_Rica = "America/Costa_Rica", Cuiaba = "America/Cuiaba", Danmarkshavn = "America/Danmarkshavn", Dawson = "America/Dawson", Dawson_Creek = "America/Dawson_Creek", Denver = "America/Denver", Detroit = "America/Detroit", Edmonton = "America/Edmonton", Eirunepe = "America/Eirunepe", El_Salvador = "America/El_Salvador", Fort_Nelson = "America/Fort_Nelson", Fortaleza = "America/Fortaleza", Glace_Bay = "America/Glace_Bay", Goose_Bay = "America/Goose_Bay", Grand_Turk = "America/Grand_Turk", Guatemala = "America/Guatemala", Guayaquil = "America/Guayaquil", Guyana = "America/Guyana", Halifax = "America/Halifax", Havana = "America/Havana", Hermosillo = "America/Hermosillo", Indianapolis = "America/Indiana/Indianapolis", Knox = "America/Indiana/Knox", Marengo = "America/Indiana/Marengo", Petersburg = "America/Indiana/Petersburg", Tell_City = "America/Indiana/Tell_City", Vevay = "America/Indiana/Vevay", Vincennes = "America/Indiana/Vincennes", Winamac = "America/Indiana/Winamac", Inuvik = "America/Inuvik", Iqaluit = "America/Iqaluit", Jamaica = "America/Jamaica", Juneau = "America/Juneau", Louisville = "America/Kentucky/Louisville", Monticello = "America/Kentucky/Monticello", La_Paz = "America/La_Paz", Lima = "America/Lima", Los_Angeles = "America/Los_Angeles", Maceio = "America/Maceio", Managua = "America/Managua", Manaus = "America/Manaus", Martinique = "America/Martinique", Matamoros = "America/Matamoros", Mazatlan = "America/Mazatlan", Menominee = "America/Menominee", Merida = "America/Merida", Metlakatla = "America/Metlakatla", Mexico_City = "America/Mexico_City", Miquelon = "America/Miquelon", Moncton = "America/Moncton", Monterrey = "America/Monterrey", Montevideo = "America/Montevideo", New_York = "America/New_York", Nome = "America/Nome", Noronha = "America/Noronha", Beulah = "America/North_Dakota/Beulah", Center = "America/North_Dakota/Center", New_Salem = "America/North_Dakota/New_Salem", Nuuk = "America/Nuuk", Ojinaga = "America/Ojinaga", Panama = "America/Panama", Paramaribo = "America/Paramaribo", Phoenix = "America/Phoenix", Port = "America/Port-au-Prince", Porto_Velho = "America/Porto_Velho", Puerto_Rico = "America/Puerto_Rico", Punta_Arenas = "America/Punta_Arenas", Rankin_Inlet = "America/Rankin_Inlet", Recife = "America/Recife", Regina = "America/Regina", Resolute = "America/Resolute", Rio_Branco = "America/Rio_Branco", Santarem = "America/Santarem", Santiago = "America/Santiago", Santo_Domingo = "America/Santo_Domingo", Sao_Paulo = "America/Sao_Paulo", Scoresbysund = "America/Scoresbysund", Sitka = "America/Sitka", St_Johns = "America/St_Johns", Swift_Current = "America/Swift_Current", Tegucigalpa = "America/Tegucigalpa", Thule = "America/Thule", Tijuana = "America/Tijuana", Toronto = "America/Toronto", Vancouver = "America/Vancouver", Whitehorse = "America/Whitehorse", Winnipeg = "America/Winnipeg", Yakutat = "America/Yakutat", Casey = "Antarctica/Casey", Davis = "Antarctica/Davis", Macquarie = "Antarctica/Macquarie", Mawson = "Antarctica/Mawson", Palmer = "Antarctica/Palmer", Rothera = "Antarctica/Rothera", Troll = "Antarctica/Troll", Almaty = "Asia/Almaty", Amman = "Asia/Amman", Anadyr = "Asia/Anadyr", Aqtau = "Asia/Aqtau", Aqtobe = "Asia/Aqtobe", Ashgabat = "Asia/Ashgabat", Atyrau = "Asia/Atyrau", Baghdad = "Asia/Baghdad", Baku = "Asia/Baku", Bangkok = "Asia/Bangkok", Barnaul = "Asia/Barnaul", Beirut = "Asia/Beirut", Bishkek = "Asia/Bishkek", Chita = "Asia/Chita", Choibalsan = "Asia/Choibalsan", Colombo = "Asia/Colombo", Damascus = "Asia/Damascus", Dhaka = "Asia/Dhaka", Dili = "Asia/Dili", Dubai = "Asia/Dubai", Dushanbe = "Asia/Dushanbe", Famagusta = "Asia/Famagusta", Gaza = "Asia/Gaza", Hebron = "Asia/Hebron", Ho_Chi_Minh = "Asia/Ho_Chi_Minh", Hong_Kong = "Asia/Hong_Kong", Hovd = "Asia/Hovd", Irkutsk = "Asia/Irkutsk", Jakarta = "Asia/Jakarta", Jayapura = "Asia/Jayapura", Jerusalem = "Asia/Jerusalem", Kabul = "Asia/Kabul", Kamchatka = "Asia/Kamchatka", Karachi = "Asia/Karachi", Kathmandu = "Asia/Kathmandu", Khandyga = "Asia/Khandyga", Kolkata = "Asia/Kolkata", Krasnoyarsk = "Asia/Krasnoyarsk", Kuching = "Asia/Kuching", Macau = "Asia/Macau", Magadan = "Asia/Magadan", Makassar = "Asia/Makassar", Manila = "Asia/Manila", Nicosia = "Asia/Nicosia", Novokuznetsk = "Asia/Novokuznetsk", Novosibirsk = "Asia/Novosibirsk", Omsk = "Asia/Omsk", Oral = "Asia/Oral", Pontianak = "Asia/Pontianak", Pyongyang = "Asia/Pyongyang", Qatar = "Asia/Qatar", Qostanay = "Asia/Qostanay", Qyzylorda = "Asia/Qyzylorda", Riyadh = "Asia/Riyadh", Sakhalin = "Asia/Sakhalin", Samarkand = "Asia/Samarkand", Seoul = "Asia/Seoul", Shanghai = "Asia/Shanghai", Singapore = "Asia/Singapore", Srednekolymsk = "Asia/Srednekolymsk", Taipei = "Asia/Taipei", Tashkent = "Asia/Tashkent", Tbilisi = "Asia/Tbilisi", Tehran = "Asia/Tehran", Thimphu = "Asia/Thimphu", Tokyo = "Asia/Tokyo", Tomsk = "Asia/Tomsk", Ulaanbaatar = "Asia/Ulaanbaatar", Urumqi = "Asia/Urumqi", Ust = "Asia/Ust-Nera", Vladivostok = "Asia/Vladivostok", Yakutsk = "Asia/Yakutsk", Yangon = "Asia/Yangon", Yekaterinburg = "Asia/Yekaterinburg", Yerevan = "Asia/Yerevan", Azores = "Atlantic/Azores", Bermuda = "Atlantic/Bermuda", Canary = "Atlantic/Canary", Cape_Verde = "Atlantic/Cape_Verde", Faroe = "Atlantic/Faroe", Madeira = "Atlantic/Madeira", South_Georgia = "Atlantic/South_Georgia", Stanley = "Atlantic/Stanley", Adelaide = "Australia/Adelaide", Brisbane = "Australia/Brisbane", Broken_Hill = "Australia/Broken_Hill", Darwin = "Australia/Darwin", Eucla = "Australia/Eucla", Hobart = "Australia/Hobart", Lindeman = "Australia/Lindeman", Lord_Howe = "Australia/Lord_Howe", Melbourne = "Australia/Melbourne", Perth = "Australia/Perth", Sydney = "Australia/Sydney", CET = "CET", CST6CDT = "CST6CDT", EET = "EET", EST = "EST", EST5EDT = "EST5EDT", EtcGMT = "Etc/GMT", GMTPlus1 = "Etc/GMT+1", GMTPlus10 = "Etc/GMT+10", GMTPlus11 = "Etc/GMT+11", GMTPlus12 = "Etc/GMT+12", GMTPlus2 = "Etc/GMT+2", GMTPlus3 = "Etc/GMT+3", GMTPlus4 = "Etc/GMT+4", GMTPlus5 = "Etc/GMT+5", GMTPlus6 = "Etc/GMT+6", GMTPlus7 = "Etc/GMT+7", GMTPlus8 = "Etc/GMT+8", GMTPlus9 = "Etc/GMT+9", GMTMinus1 = "Etc/GMT-1", GMTMinus10 = "Etc/GMT-10", GMTMinus11 = "Etc/GMT-11", GMTMinus12 = "Etc/GMT-12", GMTMinus13 = "Etc/GMT-13", GMTMinus14 = "Etc/GMT-14", GMTMinus2 = "Etc/GMT-2", GMTMinus3 = "Etc/GMT-3", GMTMinus4 = "Etc/GMT-4", GMTMinus5 = "Etc/GMT-5", GMTMinus6 = "Etc/GMT-6", GMTMinus7 = "Etc/GMT-7", GMTMinus8 = "Etc/GMT-8", GMTMinus9 = "Etc/GMT-9", UTC = "Etc/UTC", Andorra = "Europe/Andorra", Astrakhan = "Europe/Astrakhan", Athens = "Europe/Athens", Belgrade = "Europe/Belgrade", Berlin = "Europe/Berlin", Brussels = "Europe/Brussels", Bucharest = "Europe/Bucharest", Budapest = "Europe/Budapest", Chisinau = "Europe/Chisinau", Dublin = "Europe/Dublin", Gibraltar = "Europe/Gibraltar", Helsinki = "Europe/Helsinki", Istanbul = "Europe/Istanbul", Kaliningrad = "Europe/Kaliningrad", Kirov = "Europe/Kirov", Kyiv = "Europe/Kyiv", Lisbon = "Europe/Lisbon", London = "Europe/London", Madrid = "Europe/Madrid", Malta = "Europe/Malta", Minsk = "Europe/Minsk", Moscow = "Europe/Moscow", Paris = "Europe/Paris", Prague = "Europe/Prague", Riga = "Europe/Riga", Rome = "Europe/Rome", Samara = "Europe/Samara", Saratov = "Europe/Saratov", Simferopol = "Europe/Simferopol", Sofia = "Europe/Sofia", Tallinn = "Europe/Tallinn", Tirane = "Europe/Tirane", Ulyanovsk = "Europe/Ulyanovsk", Vienna = "Europe/Vienna", Vilnius = "Europe/Vilnius", Volgograd = "Europe/Volgograd", Warsaw = "Europe/Warsaw", Zurich = "Europe/Zurich", Factory = "Factory", GMT = "GMT", HST = "HST", Chagos = "Indian/Chagos", Maldives = "Indian/Maldives", Mauritius = "Indian/Mauritius", MET = "MET", MST = "MST", MST7MDT = "MST7MDT", PST8PDT = "PST8PDT", Apia = "Pacific/Apia", Auckland = "Pacific/Auckland", Bougainville = "Pacific/Bougainville", Chatham = "Pacific/Chatham", Easter = "Pacific/Easter", Efate = "Pacific/Efate", Fakaofo = "Pacific/Fakaofo", Fiji = "Pacific/Fiji", Galapagos = "Pacific/Galapagos", Gambier = "Pacific/Gambier", Guadalcanal = "Pacific/Guadalcanal", Guam = "Pacific/Guam", Honolulu = "Pacific/Honolulu", Kanton = "Pacific/Kanton", Kiritimati = "Pacific/Kiritimati", Kosrae = "Pacific/Kosrae", Kwajalein = "Pacific/Kwajalein", Marquesas = "Pacific/Marquesas", Nauru = "Pacific/Nauru", Niue = "Pacific/Niue", Norfolk = "Pacific/Norfolk", Noumea = "Pacific/Noumea", Pago_Pago = "Pacific/Pago_Pago", Palau = "Pacific/Palau", Pitcairn = "Pacific/Pitcairn", Port_Moresby = "Pacific/Port_Moresby", Rarotonga = "Pacific/Rarotonga", Tahiti = "Pacific/Tahiti", Tarawa = "Pacific/Tarawa", Tongatapu = "Pacific/Tongatapu", WET = "WET" } interface Location$1 { tz: Timezones; lat: number; lon: number; } interface SystemStatus { mac: string; restart_required: boolean; time: string; unixtime: number; uptime: number; ram_size: number; ram_free: number; fs_size: number; fs_free: number; cfg_rev: number; kvs_rev: number; schedule_rev: number; webhook_rev: number; available_updates: AvailableUpdates; } interface SystemConfig { device: Device$1; location: Location$1; debug: Debug; ui_data: UIData$1; rpc_udp: RPCUDP$1; sntp: SNTP$2; cfg_rev: number; } interface RPCUDP$1 { dst_addr: null; listen_port: null; } interface SNTP$2 { server: string; } interface UIData$1 { } interface GetStatusResponse extends BaseShellyResponse<GetStatusResult> { } interface GetStatusResult { ble: Ble; cloud: Cloud$2; mqtt: Cloud$2; sys: SystemStatus; wifi: Wifi; ws: Cloud$2; } interface Ble { dev_list: string; } interface Cloud$2 extends Connected { } interface Wifi { sta_ip: string; status: string; ssid: string; rssi: number; } interface BLEConfig { enable: boolean; rpc: Observer; observer: Observer; } interface CloudConfig { enable: boolean; server?: string; } interface MqttConfig { enable: boolean; server: string | null; client_id: string; user: string | null; pass: string | null; ssl_ca: string | null; topic_prefix: string; rpc_ntf: boolean; status_ntf: boolean; use_client_cert: boolean; enable_rpc: boolean; enable_control: boolean; } interface WsConfig { enable: boolean; server: string | null; ssl_ca: '*' | 'user_ca.pem' | 'ca.pem'; } interface InputConfig { id: number; name: string | null; type?: 'switch' | 'button' | 'analog' | 'count'; enable?: boolean; invert?: boolean; factory_reset?: boolean; report_thr?: number; range_map?: [number, number] | null; range?: number; xpercent?: XInfo; count_rep_thr?: number; freq_window?: number; freq_rep_thr?: number; xcounts?: XInfo; xfreq?: XInfo; } interface XInfo { expr: string | null; unit: string | null; } declare enum Inputs { zero = "input:0", one = "input:1", two = "input:2", three = "input:3" } type FourInputsDeviceConfig = { [Inputs.zero]?: InputConfig; [Inputs.one]?: InputConfig; [Inputs.two]?: InputConfig; [Inputs.three]?: InputConfig; }; interface InputIdBody { id: number; } interface GetConfigResponse extends BaseShellyResponse<GetConfigResponseResult> { } interface GetConfigResponseResult extends FourInputsDeviceConfig { ble: BLEConfig; cloud: CloudConfig; mqtt: MqttConfig; sys: Sys; wifi: WifiConfig; ws: WsConfig; } interface Sys { device: Device$1; location: Location$1; debug: Debug; ui_data: UIData; rpc_udp: RPCUDP; sntp: SNTP$1; cfg_rev: number; } interface RPCUDP { dst_addr: null; listen_port: null; } interface SNTP$1 { server: string; } interface UIData { } interface ListMethodsResponse extends BaseShellyResponse<ListMethodsResponseResult> { } interface ListMethodsResponseResult { methods: string[]; } interface GetDeviceInfoBody { ident: boolean; } interface GetDeviceInfoResponse extends BaseShellyResponse<GetDeviceInfoResponseResult> { } interface GetDeviceInfoResponseResult { name: string; id: string; mac: string; slot: number; key: string; batch: string; fw_sbits: string; model: string; gen: number; fw_id: string; ver: string; app: string; auth_en: boolean; auth_domain: string; } interface ListTimezonesResponse extends BaseShellyResponse<ListTimezonesResponseResult> { } interface ListTimezonesResponseResult { timezones: string[]; } interface DetectLocationResponse extends BaseShellyResponse<Location> { } interface CheckForUpdateResponse extends BaseShellyResponse<AvailableUpdates> { } interface UpdateBody { stage?: 'stable' | 'beta'; url?: string; } interface RebootBody { delay_ms?: number; } interface SetAuthBody { user: string; realm: string; ha1: string | null; } interface PutUserCaBody { data: string | null; append: boolean; } interface PutUserCaResponse extends BaseShellyResponse<PutUserCaResponseResult> { } interface PutUserCaResponseResult { len: number; } interface GetComponentsBody { offset?: number; include?: string[]; dynamic_only?: boolean; } interface GetComponentsResponse extends BaseShellyResponse<GetComponentsResponseResult> { } interface GetComponentsResponseResult { components: Component[]; cfg_rev: number; offset: number; total: number; } interface Component { key: string; status: Status; config: MqttConfig | WsConfig | BLEConfig | CloudConfig | WifiConfig | SystemConfig; } interface Status { dev_list?: string; connected?: boolean; } interface BleConfigResponse extends BaseShellyResponse<BLEConfig> { } interface BLEGetStatusResponse extends BaseShellyResponse<BLEGetStatusResponseResult> { } interface BLEGetStatusResponseResult { ip?: string | null; dev_list: string; } interface BLESetConfigBody { config: BLEConfig; } interface BLESetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface CloudSetConfigBody { config: CloudConfig; } interface CloudSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface CloudGetStatusResponse extends BaseShellyResponse<Connected> { } interface CloudConfigResponse extends BaseShellyResponse<CloudConfig> { } interface SystemGetStatusResponse extends BaseShellyResponse<SystemStatus> { } interface SystemGetConfigResponse extends BaseShellyResponse<SystemConfig> { } interface SystemSetConfigBody { config: DeepPartial<SystemConfig>; } interface SystemSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface ScheduleRevision { id?: number; rev: number; } interface ScheduleJobCall { method: Gen2Methods; params?: { [key: string]: any; }; } interface ScheduleJob { id: number; enable: boolean; timespec: string; calls: ScheduleJobCall[]; } interface ListSchedulesResponse extends BaseShellyResponse<ListSchedulesResponseResult> { } interface ListSchedulesResponseResult extends ScheduleRevision { jobs: ScheduleJob[]; } interface CreateScheduleBody extends ScheduleJob { } interface CreateScheduleResponse extends BaseShellyResponse<ScheduleRevision> { } interface UpdateScheduleBody extends ScheduleJob { id: number; } interface UpdateScheduleResponse extends BaseShellyResponse<ScheduleRevision> { } interface DeleteScheduleBody { id: number; } interface DeleteScheduleResponse extends BaseShellyResponse<ScheduleRevision> { } interface DeleteAllSchedulesResponse extends BaseShellyResponse<ScheduleRevision> { } interface ScriptListResponse extends BaseShellyResponse<ScriptListResponseResult> { } interface ScriptListResponseResult { scripts: ScriptInformation[]; } interface ScriptInformation { id: number; name: string; enable: boolean; running: boolean; } interface ScriptGetCodeBody { id: number; offset?: number; len?: number; } interface ScriptGetCodeResponse extends BaseShellyResponse<ScriptGetCodeResponseResult> { } interface ScriptGetCodeResponseResult { data: string; left: number; } interface ScriptGetConfigBody { id: number; } interface ScriptGetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface ScriptGetStatusBody { id: number; } interface ScriptGetStatusResponse extends BaseShellyResponse<ScriptGetStatusResponseResult> { } interface ScriptGetStatusResponseResult { id: number; running: boolean; mem_used: number; mem_peak: number; mem_free: number; errors?: ('crashed' | 'syntax_error' | 'reference_error' | 'type_error' | 'out_of_memory' | 'out_of_codespace' | 'internal_error' | 'not_implemented' | 'file_read_error' | 'bad_arguments')[]; } interface ScriptConfig { id: number; name: string; enable: boolean; } interface ScriptSetConfigBody { id: number; config: DeepPartial<ScriptConfig>; } interface ScriptSetConfigResponse extends BaseShellyResponse<ScriptConfig> { } interface ScriptCreateBody { name?: string; } interface ScriptCreateResponse extends BaseShellyResponse<ScriptCreateResponseResult> { } interface ScriptCreateResponseResult { id: number; } interface ScriptEvalBody { id: number; code: string; } interface ScriptEvalResponse extends BaseShellyResponse<ScriptEvalResponseResult> { } interface ScriptEvalResponseResult { result: string; } interface ScriptDeleteBody { id: number; } interface ScriptDeleteResponse extends BaseShellyResponse<null> { } interface ScriptStartBody extends BaseIdType { } interface ScriptStartResponse extends BaseShellyResponse<ScriptStartResponseResult> { } interface ScriptStartResponseResult { was_running: boolean; } interface ScriptPutCodeBody { id: number; code: string; append?: boolean; } interface ScriptPutCodeResponse extends BaseShellyResponse<ScriptPutCodeResponseResult> { } interface ScriptPutCodeResponseResult { len: number; } interface EthernetConfiguration { enable: boolean; ipv4mode: 'dhcp' | 'static'; ip: string | null; netmask: string | null; gw: string | null; nameserver: string | null; } interface EthSetConfigBody { config: EthernetConfiguration; } interface EthSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface EthGetConfigResponse extends BaseShellyResponse<EthernetConfiguration> { } interface EthGetStatusResponse extends BaseShellyResponse<EthGetStatusResponseResult> { } interface EthGetStatusResponseResult { ip: string | null; } interface KVSListBody { match?: string; } interface KVSListResponse extends BaseShellyResponse<KVSListResponseResult> { } interface KVSListResponseResult { keys: { [key: string]: { etag: string; }; }; } interface KVSGetManyBody { match: string; } interface KVSGetManyResponse extends BaseShellyResponse<KVSGetManyResponseResult> { } interface KVSGetManyResponseResult { items: Value[]; } interface Value { etag: string; value: string | number | boolean | { [key: string]: any; }; } interface KVSGetBody { key: string; } interface KVSGetResponse extends BaseShellyResponse<KVSGetResponseResult> { } interface KVSGetResponseResult { etag: string; value: string | number | boolean | { [key: string]: any; }; } interface KVSDeleteBody { key: string; etag?: string; } interface KVSDeleteResponse extends BaseShellyResponse<KVSDeleteResponseResult> { } interface KVSDeleteResponseResult { rev: string; } type KVSValue = string | number | boolean | { [key: string]: any; }; interface KVSSetBody { key: string; value: KVSValue; etag?: string; } interface KVSSetResponse extends BaseShellyResponse<KVSSetResponseResult> { } interface KVSSetResponseResult { etag: string; rev: number; } interface InputGetStatusResponse extends BaseShellyResponse<InputGetStatusResponseResult> { } interface InputGetStatusResponseResult { id: number; state: boolean; } interface InputGetConfigResponse extends BaseShellyResponse<InputConfig> { } interface InputSetConfigBody extends InputIdBody { config: InputConfig; } interface InputSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface InputCheckExpressionBody { expr: string; inputs: any[]; } interface InputCheckExpressionResponse extends BaseShellyResponse<InputCheckExpressionResponseResult> { } type InputOutPut = [string, string]; type InputOutPutErrorMessage = [string, string, string]; interface InputCheckExpressionResponseResult { results: (InputOutPut | InputOutPutErrorMessage)[]; } interface InputResetCountersBody extends InputIdBody { type?: string[]; } interface InputResetCountersResponse extends BaseShellyResponse<InputResetCountersResponseResult> { } interface InputResetCountersResponseResult { counts: { total: number; }; } interface InputTriggerBody extends InputIdBody { event_type: 'btn_down' | 'btn_up' | 'single_push' | 'double_push' | 'triple_push' | 'long_push'; } interface InputTriggerResponse extends BaseShellyResponse<RestartRequired> { } interface MQTTSetConfigBody { config: DeepPartial<MqttConfig>; } interface MQTTSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface MQTTGetStatusResponse extends BaseShellyResponse<Connected> { } interface MQTTGetConfigResponse extends BaseShellyResponse<MqttConfig> { } interface ListSupportedWebhooksResponse extends BaseShellyResponse<ListSupportedWebhooksResponseResult> { } interface ListSupportedWebhooksResponseResult { types: { [key: string]: TypeObject; }; } interface TypeObject { name: string; type: 'boolean' | 'number' | 'string'; desc: string; } interface WebhookRev { rev: number; } interface WebhookConfig { id: number; event: string; cid: number; enable?: boolean; name?: string | null; ssl_ca: '*' | 'user_ca.pem' | null; urls: string[]; active_between?: string[]; condition?: string | null; repeat_period?: number; } interface ListWebhooksResponse extends BaseShellyResponse<ListWebhooksResponseResult> { } interface ListWebhooksResponseResult extends WebhookRev { hooks: Hook[]; } interface Hook { id: number; cid: number; enable: boolean; event: string; name: string | null; ssl_ca: string | null; urls: string[]; condition: string | null; repeat_period: number; } interface CreateWebhookBody extends WebhookConfig { } interface CreateWebhookResponse extends BaseShellyResponse<CreateWebhookResponseResult> { } interface CreateWebhookResponseResult extends BaseIdType, WebhookRev { } interface DeleteWebhookBody extends BaseIdType { } interface DeleteWebhookResponse extends BaseShellyResponse<WebhookRev> { } interface DeleteAllWebhooksResponse extends BaseShellyResponse<WebhookRev> { } interface UpdateWebhookBody extends WebhookConfig { } interface UpdateWebhookResponse extends BaseShellyResponse<WebhookRev> { } interface WsSetConfigBody { config: DeepPartial<WsConfig>; } interface WsSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface WsGetStatusResponse extends BaseShellyResponse<Connected> { } interface WsGetConfigResponse extends BaseShellyResponse<WsConfig> { } interface SwitchConfig { id: number; name: string | null; in_mode: 'momentary' | 'follow' | 'flip' | 'detached' | 'cycle' | 'activate'; initial_state: 'off' | 'on' | 'restore_last' | 'match_input'; auto_on: boolean; auto_on_delay: number; auto_off: boolean; auto_off_delay: number; autorecover_voltage_errors: boolean; input_id: number; power_limit: number; voltage_limit: number; undervoltage_limit: number; current_limit: number; } interface ActiveEnergyCounter { total: number; by_minute: number[]; minute_ts: number; } interface ReturnedActiveEnergyCounter { total: number; by_minute: number[]; minute_ts: number; } interface SwitchComponentStatus { id: number; source: string; output: boolean; timer_started_at: number; timer_duration: number; apower: number; voltage: number; current: number; pf: number; freq: number; aenergy: ActiveEnergyCounter; ret_aenergy: ReturnedActiveEnergyCounter; temperature: TemperatureInfo$2; errors: string[]; } interface TemperatureInfo$2 { tC: number | null; tF: number | null; } interface SwitchGetStatusBody extends BaseIdType { } interface SwitchGetStatusResponse extends BaseShellyResponse<SwitchComponentStatus> { } interface ScriptStopBody extends BaseIdType { } interface ScriptStopResponse extends BaseShellyResponse<ScriptStopResponseResult> { } interface ScriptStopResponseResult { was_running: boolean; } interface SwitchGetConfigBody extends BaseIdType { } interface SwitchGetConfigResponse extends BaseShellyResponse<SwitchConfig> { } interface SwitchSetConfigBody extends BaseIdType { config: SwitchConfig; } interface SwitchSetConfigResponse extends BaseShellyResponse<null> { } interface WasOn { was_on: boolean; } interface SwitchSetBody extends BaseIdType { on: boolean; toggle_after: number; } interface SwitchSetResponse extends BaseShellyResponse<WasOn> { } interface SwitchToggleBody extends BaseIdType { } interface SwitchToggleResponse extends BaseShellyResponse<WasOn> { } interface SwitchResetCountersBody extends BaseIdType { type: string[]; } interface SwitchResetCountersResponse extends BaseShellyResponse<SwitchResetCountersResponseResult> { } interface SwitchResetCountersResponseResult { aenergy: Pick<ActiveEnergyCounter, 'total'>; ret_aenergy: Pick<ReturnedActiveEnergyCounter, 'total'>; } interface ModbusConfig { enable: boolean; } interface ModbusGetConfigResponse extends BaseShellyResponse<ModbusConfig> { } interface ModbusGetStatusResponse extends BaseShellyResponse<ModbusConfig> { } interface ModbusSetConfigBody { config: ModbusConfig; } interface ModbusSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface VoltmeterConfig extends BaseIdType { name: string | null; report_thr: number; range: number; xvoltage: { expr: string | null; unit: string | null; }; } interface VoltmeterStatus { id: number; voltage: number | null; xvoltage: number | null; errors?: string[]; } interface VoltmeterGetConfigResponse extends BaseShellyResponse<VoltmeterConfig> { } interface VoltmeterSetConfigBody { config: VoltmeterConfig; } interface VoltmeterSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface VoltmeterGetStatusResponse extends BaseShellyResponse<VoltmeterStatus> { } interface CoverConfig extends BaseIdType { name: string; in_mode?: 'single' | 'dual' | 'detached'; initial_state: 'open' | 'closed' | 'stopped'; power_limit: number; voltage_limit: number; undervoltage_limit: number; current_limit: number; motor: MotorConfig; maxtime_open: number; maxtime_close: number; swap_inputs?: boolean; invert_directions: boolean; obstruction_detection?: ObstructionDetectionConfig; safety_switch?: SafetySwitchConfig; } interface MotorConfig { idle_power_thr: number; idle_confirm_period: number; } interface ObstructionDetectionConfig { enable: boolean; direction: 'open' | 'close' | 'both'; action: 'stop' | 'reverse'; power_thr: number; holdoff: number; } interface SafetySwitchConfig { enable: boolean; direction: 'open' | 'close' | 'both'; action: 'stop' | 'reverse' | 'pause'; allowed_move: 'reverse' | null; } interface CoverStatus { id: number; source: string; state: 'open' | 'closed' | 'opening' | 'closing' | 'stopped' | 'calibrating'; apower: number; voltage: number; current: number; pf: number; freq: number; aenergy: ActiveEnergyCounter; current_pos?: number | null; target_pos?: number | null; move_timeout?: number; move_started_at?: number; pos_control: boolean; last_direction: 'open' | 'close' | null; temperature?: TemperatureInfo$1; errors?: string[]; } interface TemperatureInfo$1 { value: number; unit: string; } interface CoverGetConfigBody extends BaseIdType { } interface CoverGetConfigResponse extends BaseShellyResponse<CoverConfig> { } interface CoverGetStatusBody extends BaseIdType { } interface CoverGetStatusResponse extends BaseShellyResponse<CoverStatus> { } interface CoverSetConfigBody extends BaseIdType { config: DeepPartial<CoverConfig>; } interface CoverSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface CoverCalibrateBody extends BaseIdType { } interface CoverOpenBody extends BaseIdType { duration: number; } interface CoverCloseBody extends BaseIdType { duration: number; } interface CoverStopBody extends BaseIdType { } interface CoverGoToPositionBody extends BaseIdType { pos: number; rel: number; } interface CoverResetCountersBody extends BaseIdType { type?: string[]; } interface CoverResetCountersResponse extends BaseShellyResponse<CoverResetCountersResponseResult> { } interface CoverResetCountersResponseResult { aenergy: { total: number; }; } interface LightCalibrateBody extends BaseIdType { } interface LightResetCountersBody extends BaseIdType { type?: string[]; } interface LightResetCountersResponse extends BaseShellyResponse<LightResetCountersResponseResult> { } interface LightResetCountersResponseResult { aenergy: { total: number; }; } interface LightSetBody extends BaseIdType { on?: boolean; brightness?: number; transition_duration?: number; toggle_after?: number; } interface LightToggleBody extends BaseIdType { } interface LightConfig extends BaseIdType { name: string | null; in_mode: 'follow' | 'flip' | 'activate' | 'detached' | 'dim' | 'dual_dim'; initial_state: 'off' | 'on' | 'restore_last'; auto_on: boolean; auto_on_delay: number; auto_off: boolean; auto_off_delay: number; transition_duration: number; min_brightness_on_toggle: number; night_mode: NightModeConfig; button_fade_rate: number; button_presets: ButtonPresetsConfig; range_map: [number, number] | null; power_limit?: number; voltage_limit?: number; undervoltage_limit?: number; current_limit?: number; } interface NightModeConfig { enable: boolean; brightness: number; active_between: [string, string]; } interface ButtonPresetsConfig { button_doublepush: ButtonDoublePushConfig | null; } interface ButtonDoublePushConfig { brightness: number; } interface LightStatus { id: number; source: string; output: boolean; brightness: number; timer_started_at?: number; timer_duration?: number; transition?: TransitionInfo; temperature?: TemperatureInfo; aenergy?: ActiveEnergyInfo; apower?: number; voltage?: number; current?: number; calibration?: CalibrationInfo; } interface TransitionInfo { target: { output: boolean; brightness: number; }; started_at: number; duration: number; } interface TemperatureInfo { tC: number | null; tF: number | null; } interface ActiveEnergyInfo { total: number; by_minute: number[]; minute_ts: number; } interface CalibrationInfo { progress: number; errors?: string[]; flags?: string[]; } interface LightGetStatusBody extends BaseIdType { } interface LightGetStatusResponse extends BaseShellyResponse<LightStatus> { } interface LightGetConfigBody extends BaseIdType { } interface LightGetConfigResponse extends BaseShellyResponse<LightConfig> { } interface LightSetConfigBody extends BaseIdType { config: DeepPartial<LightConfig>; } interface LightSetConfigResponse extends BaseShellyResponse<RestartRequired> { } interface DevicePowerGetStatusResponse extends BaseShellyResponse<DevicePowerStatus> { } interface DevicePowerStatus { id: number; battery: BatteryInfo; external?: ExternalPowerInfo; errors: string[]; } interface BatteryInfo { V: number | null; percent: number | null; } interface ExternalPowerInfo { present: boolean; } interface WifiMethodsMapping { [WifiMethods.GetConfig]: { body: undefined; response: WifiGetConfigResponse; }; [WifiMethods.SetConfig]: { body: WifiSetConfigBody; response: WifiSetConfigResponse; }; [WifiMethods.GetStatus]: { body: undefined; response: WifiGetStatusResponse; }; [WifiMethods.ListAPClients]: { body: undefined; response: WifiListAPClientsResponse; }; [WifiMethods.Scan]: { body: undefined; response: WifiScanResponse; }; } interface ShellyMethodsMapping { [ShellyMethods.GetStatus]: { body: undefined; response: GetStatusResponse; }; [ShellyMethods.GetConfig]: { body: undefined; response: GetConfigResponse; }; [ShellyMethods.ListMethods]: { body: undefined; response: ListMethodsResponse; }; [ShellyMethods.GetDeviceInfo]: { body?: GetDeviceInfoBody; response: GetDeviceInfoResponse; }; [ShellyMethods.ListProfiles]: { body: undefined; response: EmptyResponse; }; [ShellyMethods.SetProfile]: { body: undefined; response: EmptyResponse; }; [ShellyMethods.ListTimezones]: { body: undefined; response: ListTimezonesResponse; }; [ShellyMethods.DetectLocation]: { body: undefined; response: DetectLocationResponse; }; [ShellyMethods.CheckForUpdate]: { body: undefined; response: CheckForUpdateResponse; }; [ShellyMethods.Update]: { body: UpdateBody; response: EmptyResponse; }; [ShellyMethods.FactoryReset]: { body: undefined; response: EmptyResponse; }; [ShellyMethods.ResetWiFiConfig]: { body: undefined; response: EmptyResponse; }; [ShellyMethods.Reboot]: { body: RebootBody; response: EmptyResponse; }; [ShellyMethods.SetAuth]: { body: SetAuthBody; response: EmptyResponse; }; [ShellyMethods.PutUserCA]: { body: PutUserCaBody; response: PutUserCaResponse; }; [ShellyMethods.PutTLSClientCert]: { body: PutUserCaBody; response: PutUserCaResponse; }; [ShellyMethods.PutTLSClientKey]: { body: PutUserCaBody; response: PutUserCaResponse; }; [ShellyMethods.GetComponents]: { body: GetComponentsBody; response: GetComponentsResponse; }; } interface ShellyExtraMethodsMapping { [ShellyExtraMethods.Shelly]: { body: undefined; response: GetDeviceInfoResponseResult; }; } interface BLEMethodsMapping { [BLEMethods.GetStatus]: { body: undefined; response: BLEGetStatusResponse; }; [BLEMethods.GetConfig]: { body: undefined; response: BleConfigResponse; }; [BLEMethods.SetConfig]: { body: BLESetConfigBody; response: BLESetConfigResponse; }; } interface CloudMethodsMapping { [CloudMethods.GetStatus]: { body: undefined; response: CloudGetStatusResponse; }; [CloudMethods.GetConfig]: { body: undefined; response: CloudConfigResponse; }; [CloudMethods.SetConfig]: { body: CloudSetConfigBody; response: CloudSetConfigResponse; }; } interface SystemMethodsMapping { [SystemMethods.GetStatus]: { body: undefined; response: SystemGetStatusResponse; }; [SystemMethods.GetConfig]: { body: undefined; response: SystemGetConfigResponse; }; [SystemMethods.SetConfig]: { body: SystemSetConfigBody; response: SystemSetConfigResponse; }; } interface ScheduleMethodMapping { [ScheduleMethods.List]: { body: undefined; response: ListSchedulesResponse; }; [ScheduleMethods.Create]: { body: CreateScheduleBody; response: CreateScheduleResponse; }; [ScheduleMethods.Update]: { body: UpdateScheduleBody; response: UpdateScheduleResponse; }; [ScheduleMethods.Delete]: { body: DeleteScheduleBody; response: DeleteScheduleResponse; }; [ScheduleMethods.DeleteAll]: { body: undefined; response: DeleteAllSchedulesResponse; }; } interface ScriptMethodsMapping { [ScriptMethods.List]: { body: undefined; response: ScriptListResponse; }; [ScriptMethods.GetCode]: { body: ScriptGetCodeBody; response: ScriptGetCodeResponse; }; [ScriptMethods.GetConfig]: { body: ScriptGetConfigBody; response: ScriptGetConfigResponse; }; [ScriptMethods.SetConfig]: { body: ScriptSetConfigBody; response: ScriptSetConfigResponse; }; [ScriptMethods.GetStatus]: { body: ScriptGetStatusBody; response: ScriptGetStatusResponse; }; [ScriptMethods.Create]: { body: ScriptCreateBody; response: ScriptCreateResponse; }; [ScriptMethods.PutCode]: { body: ScriptPutCodeBody; response: ScriptPutCodeResponse; }; [ScriptMethods.Eval]: { body: ScriptEvalBody; response: ScriptEvalResponse; }; [ScriptMethods.Start]: { body: ScriptStartBody; response: ScriptStartResponse; }; [ScriptMethods.Delete]: { body: ScriptDeleteBody; response: ScriptDeleteResponse; }; [ScriptMethods.Stop]: { body: ScriptStopBody; response: ScriptStopResponse; }; } interface KVSMethodsMapping { [KVSMethods.List]: { body: KVSListBody; response: KVSListResponse; }; [KVSMethods.GetMany]: { body: KVSGetManyBody; response: KVSGetManyResponse; }; [KVSMethods.Get]: { body: KVSGetBody; response: KVSGetResponse; }; [KVSMethods.Delete]: { body: KVSDeleteBody; response: KVSDeleteResponse; }; [KVSMethods.Set]: { body: KVSSetBody; response: KVSSetResponse; }; } interface EthernetMethodsMapping { [EthernetMethods.GetStatus]: { body: undefined; response: EthGetStatusResponse; }; [EthernetMethods.GetConfig]: { body: undefined; response: EthGetConfigResponse; }; [EthernetMethods.SetConfig]: { body: EthSetConfigBody; response: EthSetConfigResponse; }; } interface InputMethodsMapping { [InputMethods.GetStatus]: { body: InputIdBody; response: InputGetStatusResponse; }; [InputMethods.GetConfig]: { body: InputIdBody; response: InputGetConfigRespons