import { addGroupUsers , IAddGroupUsersResult , IUser , } from "@esri/arcgis-rest-portal" ; import { IAuthenticationManager } from "@esri/arcgis-rest-request" ; private export param { string } id param { IUser [ ] } admins param { IAuthenticationManager } authentication return { IAddGroupUsersResult } export function autoAddUsersAsAdmins ( id , admins , authentication ) { let response = Promise . resolve ( null ) ; if ( admins . length ) { const args = { id , admins : admins . map ( ( a ) => a . username ) , authentication , } ; response = addGroupUsers ( args ) ; } return response ; }