import { request , IRequestOptions } from "@esri/arcgis-rest-request" ; import { getPortalUrl } from "./get-portal-url" ; export interface IPortal { id : string ; isPortal : boolean ; name : string ; [ key ] : any ; } param requestOptions export function getSelf ( requestOptions ? ) { return getPortal ( null , requestOptions ) ; } param id param requestOptions export function getPortal ( id ? , requestOptions ? ) { const idOrSelf = id ? id : "self" ; const url = `${ getPortalUrl ( requestOptions ) }/portals/${ idOrSelf }` ; const options = { ... { httpMethod : "GET" } , ... requestOptions } ; return request ( url , options ) ; }