import * as Constants from './constants' ; import * as Types from './types' ; import type { RobotApiRequestMeta , RobotApiErrorResponse , } from '../robot-api/types' ; export const fetchStatus = ( robotName ) : Types . FetchStatusAction => ( { type : Constants . FETCH_STATUS , payload : { robotName } , meta : { } , } ) ; export const fetchStatusSuccess = ( robotName , internetStatus , interfaces , meta ) : Types . FetchStatusSuccessAction => ( { type : Constants . FETCH_STATUS_SUCCESS , payload : { robotName , internetStatus , interfaces } , meta , } ) ; export const fetchStatusFailure = ( robotName , error , meta ) : Types . FetchStatusFailureAction => ( { type : Constants . FETCH_STATUS_FAILURE , payload : { robotName , error } , meta , } ) ; export const fetchWifiList = ( robotName ) : Types . FetchWifiListAction => ( { type : Constants . FETCH_WIFI_LIST , payload : { robotName } , meta : { } , } ) ; export const fetchWifiListSuccess = ( robotName , wifiList , meta ) : Types . FetchWifiListSuccessAction => ( { type : Constants . FETCH_WIFI_LIST_SUCCESS , payload : { robotName , wifiList } , meta , } ) ; export const fetchWifiListFailure = ( robotName , error , meta ) : Types . FetchWifiListFailureAction => ( { type : Constants . FETCH_WIFI_LIST_FAILURE , payload : { robotName , error } , meta , } ) ; export const postWifiConfigure = ( robotName , options ) : Types . PostWifiConfigureAction => ( { type : Constants . POST_WIFI_CONFIGURE , payload : { robotName , options } , meta : { } , } ) ; export const postWifiConfigureSuccess = ( robotName , ssid , meta ) : Types . PostWifiConfigureSuccessAction => ( { type : Constants . POST_WIFI_CONFIGURE_SUCCESS , payload : { robotName , ssid } , meta , } ) ; export const postWifiConfigureFailure = ( robotName , error , meta ) : Types . PostWifiConfigureFailureAction => ( { type : Constants . POST_WIFI_CONFIGURE_FAILURE , payload : { robotName , error } , meta , } ) ; export const fetchWifiKeys = ( robotName ) : Types . FetchWifiKeysAction => ( { type : Constants . FETCH_WIFI_KEYS , payload : { robotName } , meta : { } , } ) ; export const fetchWifiKeysSuccess = ( robotName , wifiKeys , meta ) : Types . FetchWifiKeysSuccessAction => ( { type : Constants . FETCH_WIFI_KEYS_SUCCESS , payload : { robotName , wifiKeys } , meta , } ) ; export const fetchWifiKeysFailure = ( robotName , error , meta ) : Types . FetchWifiKeysFailureAction => ( { type : Constants . FETCH_WIFI_KEYS_FAILURE , payload : { robotName , error } , meta , } ) ; export const postWifiKeys = ( robotName , keyFile ) : Types . PostWifiKeysAction => ( { type : Constants . POST_WIFI_KEYS , payload : { robotName , keyFile } , meta : { } , } ) ; export const postWifiKeysSuccess = ( robotName , wifiKey , meta ) : Types . PostWifiKeysSuccessAction => ( { type : Constants . POST_WIFI_KEYS_SUCCESS , payload : { robotName , wifiKey } , meta , } ) ; export const postWifiKeysFailure = ( robotName , error , meta ) : Types . PostWifiKeysFailureAction => ( { type : Constants . POST_WIFI_KEYS_FAILURE , payload : { robotName , error } , meta , } ) ; export const fetchEapOptions = ( robotName ) : Types . FetchEapOptionsAction => ( { type : Constants . FETCH_EAP_OPTIONS , payload : { robotName } , meta : { } , } ) ; export const fetchEapOptionsSuccess = ( robotName , eapOptions , meta ) : Types . FetchEapOptionsSuccessAction => ( { type : Constants . FETCH_EAP_OPTIONS_SUCCESS , payload : { robotName , eapOptions } , meta , } ) ; export const fetchEapOptionsFailure = ( robotName , error , meta ) : Types . FetchEapOptionsFailureAction => ( { type : Constants . FETCH_EAP_OPTIONS_FAILURE , payload : { robotName , error } , meta , } ) ; export const postWifiDisconnect = ( robotName , ssid ) : Types . PostWifiDisconnectAction => ( { type : Constants . POST_WIFI_DISCONNECT , payload : { robotName , ssid } , meta : { } , } ) ; export const postWifiDisconnectSuccess = ( robotName , meta ) : Types . PostWifiDisconnectSuccessAction => ( { type : Constants . POST_WIFI_DISCONNECT_SUCCESS , payload : { robotName } , meta , } ) ; export const postWifiDisconnectFailure = ( robotName , error , meta ) : Types . PostWifiDisconnectFailureAction => ( { type : Constants . POST_WIFI_DISCONNECT_FAILURE , payload : { robotName , error } , meta , } ) ;