import { IHubRequestOptions } from "@esri/hub-common" ; import { getDomainsForSite , removeDomain } from "@esri/hub-common" ; param { string } siteId param { IHubRequestOptions } hubRequestOptions private export function _removeSiteDomains ( siteId , hubRequestOptions ) { if ( hubRequestOptions . isPortal ) { return Promise . resolve ( [ ] ) ; } else { return getDomainsForSite ( siteId , hubRequestOptions ) . then ( ( domains ) => { return Promise . all ( domains . map ( ( domainEntry ) => { return removeDomain ( domainEntry . id , hubRequestOptions ) ; } ) ) ; } ) ; } }