import { ScanRunResultResponse } from 'service-library' ; export type ScanWaitCondition = { isSucceeded ( requestResponse ) : boolean ; isFailed ( requestResponse ) : boolean ; } ; export const ScanWaitConditions = { baseScan : { isSucceeded : ( scanRunResult ) : boolean => scanRunResult . scanResult ?. state === 'pass' || scanRunResult . scanResult ?. state === 'fail' , isFailed : ( scanRunResult ) : boolean => scanRunResult . run ?. state === 'failed' , } , scanNotification : { isSucceeded : ( scanRunResponse ) : boolean => scanRunResponse . notification ?. state === 'sendFailed' || scanRunResponse . notification ?. state === 'sent' , isFailed : ( scanRunResponse ) : boolean => scanRunResponse . notification ?. state === 'queueFailed' , } , deepScan : { isSucceeded : ( scanRunResult ) : boolean => scanRunResult . run ?. state === 'completed' , isFailed : ( scanRunResult ) : boolean => scanRunResult . run ?. state === 'failed' , } , } ;