import { App } from "../app"; import { Options, printDuration, run, step } from "../helpers"; const fetch = async ( integration: App, user: User, options: Options, ) => { options.log(`Fetching users from ${integration.name}`); const startTime = new Date().getTime(); return await run( integration, user, async (page, context) => { const collaborators = await step( () => integration.listCollaborators(page, context), "Opening the users list", "Opened the users list", options, ); options.log( `Got ${collaborators.length} users${options.noTimer ? "" : ` - ${printDuration(new Date().getTime() - startTime)}`}`, ); return collaborators; }, options, ); }; export default fetch;