oneuptime/ApplicationScanner/worker/main.ts

21 lines
546 B
TypeScript
Raw Normal View History

2022-04-10 21:24:54 +00:00
import BackendAPI from '../Utils/api';
2022-04-03 15:27:09 +00:00
2022-02-27 12:24:02 +00:00
import ApplicationSecurity from './applicationSecurity';
2021-06-25 16:35:31 +00:00
2022-02-25 13:22:20 +00:00
export default {
2022-04-12 12:54:51 +00:00
runApplicationScan: async function (): void {
2022-04-03 15:27:09 +00:00
const securities = await BackendAPI.get(
'application/applicationSecurities'
);
if (securities && securities.length > 0) {
await Promise.all(
securities.map((security: $TSFixMe) => {
return ApplicationSecurity.scan(security);
})
2021-06-29 20:33:48 +00:00
);
2021-06-25 16:35:31 +00:00
}
2022-04-03 15:27:09 +00:00
return;
2021-06-25 16:35:31 +00:00
},
};