async function _listIntegrations (passphrase) {
  const apiKey = await getApiKey()
  const accessToken = await getAccessToken(passphrase)
  const orgs = await getOrgs(accessToken, apiKey)
  const integrations = await getIntegrations(orgs[0].id, accessToken, apiKey, { pageNum: 1, pageSize: PAGE_SIZE })
  let result = integrations.content

  const pages = integrations.pages
  const fetches = []
  for (let i = 2; i <= pages; i++) {
    fetches.push(getIntegrations(orgs[0].id, accessToken, apiKey, { pageNum: i, pageSize: PAGE_SIZE }))
  }

  const rest = await Promise.all(fetches)

  rest.forEach((integration) => { result = result.concat(integration.content) })

  return result
}
// simplified to include only id+orgId, and name. Formatted for output.
simplified to include only id+orgId, and name. Formatted for output.
simplified to include only id + orgId and name . Formatted for output .
async function _listIntegrations (passphrase) {
  const apiKey = await getApiKey()
  const accessToken = await getAccessToken(passphrase)
  const orgs = await getOrgs(accessToken, apiKey)
  const integrations = await getIntegrations(orgs[0].id, accessToken, apiKey, { pageNum: 1, pageSize: PAGE_SIZE })
  let result = integrations.content
  const pages = integrations.pages
  const fetches = []
  for (let i = 2; i <= pages; i++) {
    fetches.push(getIntegrations(orgs[0].id, accessToken, apiKey, { pageNum: i, pageSize: PAGE_SIZE }))
  }
  const rest = await Promise.all(fetches)
  rest.forEach((integration) => { result = result.concat(integration.content) })
  return result
}
async function _listIntegrations ( passphrase ) { const apiKey = await getApiKey ( ) const accessToken = await getAccessToken ( passphrase ) const orgs = await getOrgs ( accessToken , apiKey ) const integrations = await getIntegrations ( orgs [ 0 ] . id , accessToken , apiKey , { pageNum : 1 , pageSize : PAGE_SIZE } ) let result = integrations . content const pages = integrations . pages const fetches = [ ] for ( let i = 2 ; i <= pages ; i ++ ) { fetches . push ( getIntegrations ( orgs [ 0 ] . id , accessToken , apiKey , { pageNum : i , pageSize : PAGE_SIZE } ) ) } const rest = await Promise . all ( fetches ) rest . forEach ( ( integration ) => { result = result . concat ( integration . content ) } ) return result }
simplified to include only id+orgId, and name.
simplified to include only id + orgId and name .