Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / logs / helper.ts
blob0d694ebd9bec8926a35937bf801a51c27f66762b
1 import queryPages from '@proton/shared/lib/api/helpers/queryPages';
2 import { queryLogs } from '@proton/shared/lib/api/logs';
3 import type { AuthLog } from '@proton/shared/lib/authlog';
4 import type { Api } from '@proton/shared/lib/interfaces';
6 export const getAllAuthenticationLogs = (api: Api) => {
7     return queryPages(
8         (Page, PageSize) => {
9             return api<{ Logs: AuthLog[]; Total: number }>(
10                 queryLogs({
11                     Page,
12                     PageSize,
13                 })
14             );
15         },
16         { pageSize: 150 }
17     ).then((pages) => {
18         return pages.flatMap(({ Logs }) => Logs);
19     });