import * as Constants from './constants' ; import type { RobotHost } from '../robot-api/types' ; import type { BuildrootAction , UpdateSessionStep , UpdateSessionStage , BuildrootStatusAction , } from './types' ; export function setBuildrootUpdateSeen ( robotName ) { return { type : Constants . BR_SET_UPDATE_SEEN , meta : { robotName } } ; } export function buildrootChangelogSeen ( robotName ) { return { type : Constants . BR_CHANGELOG_SEEN , meta : { robotName } } ; } export function buildrootUpdateIgnored ( robotName ) { return { type : Constants . BR_UPDATE_IGNORED , meta : { robotName } } ; } export function startBuildrootPremigration ( payload ) { return { type : Constants . BR_START_PREMIGRATION , meta : { shell : true } , payload , } ; } export function startBuildrootUpdate ( robotName , systemFile = null ) { return { type : Constants . BR_START_UPDATE , payload : { robotName , systemFile } , } ; } export function createSession ( host , sessionPath ) { return { type : Constants . BR_CREATE_SESSION , payload : { host , sessionPath } } ; } export function createSessionSuccess ( host , token , pathPrefix ) { return { type : Constants . BR_CREATE_SESSION_SUCCESS , payload : { host , token , pathPrefix } , } ; } export function buildrootStatus ( stage , message , progress ) { return { type : Constants . BR_STATUS , payload : { stage , message , progress } } ; } export function readUserBuildrootFile ( systemFile ) { return { type : Constants . BR_READ_USER_FILE , payload : { systemFile } , meta : { shell : true } , } ; } export function uploadBuildrootFile ( host , path , systemFile ) { return { type : Constants . BR_UPLOAD_FILE , payload : { host , path , systemFile : systemFile } , meta : { shell : true } , } ; } export function setBuildrootSessionStep ( payload ) { return { type : Constants . BR_SET_SESSION_STEP , payload } ; } export function clearBuildrootSession ( ) { return { type : Constants . BR_CLEAR_SESSION } ; } export function unexpectedBuildrootError ( message ) { return { type : Constants . BR_UNEXPECTED_ERROR , payload : { message } } ; }