import { UserSession } from "@esri/arcgis-rest-auth" ; import { request } from "@esri/arcgis-rest-request" ; import { IServiceNameAvailable } from "@esri/arcgis-rest-types" ; export param { string } name param { UserSession } session return { * } export function isServiceNameAvailable ( name , type , session ) { const url = `${ session . portal }/portals/self/isServiceNameAvailable` ; return request ( url , { params : { name , type , } , httpMethod : "GET" , authentication : session , } ) ; }