@esri/arcgis-rest-portal
Version:
ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request
19 lines • 874 B
JavaScript
/* Copyright (c) 2023 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { request } from "@esri/arcgis-rest-request";
import { getPortalUrl } from "../util/get-portal-url.js";
/**
* Fetches the properties for a user
* @param username The user whose properties to fetch
* @param requestOptions An IAuthenticatedRequestOptions object
* @returns a promise that resolves an IUserProperties object
*/
export async function getUserProperties(username, requestOptions) {
const url = `${getPortalUrl(requestOptions)}/community/users/${encodeURIComponent(username)}/properties`;
const response = await request(url, Object.assign({ httpMethod: "GET" }, requestOptions));
if (!response.properties.mapViewer) {
response.properties.mapViewer = "modern";
}
return response.properties;
}
//# sourceMappingURL=get-user-properties.js.map