@esri/arcgis-rest-portal
Version:
ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request
33 lines • 1.03 kB
JavaScript
import { genericSearch } from "../util/generic-search.js";
/**
* Search a portal for users.
*
* ```js
* import { searchUsers } from "@esri/arcgis-rest-portal";
* //
* searchUsers({ q: 'tommy', authentication })
* .then(response) // response.total => 355
* ```
*
* @param search - A RequestOptions object to pass through to the endpoint.
* @returns A Promise that will resolve with the data from the response.
*/
export function searchUsers(search) {
return genericSearch(search, "user");
}
/**
* ```js
* import { searchCommunityUsers } from "@esri/arcgis-rest-portal";
* //
* searchCommunityUsers({ q: 'tommy', authentication })
* .then(response) // response.total => 355
* ```
* Search all portals for users.
*
* @param search - A RequestOptions object to pass through to the endpoint.
* @returns A Promise that will resolve with the data from the response.
*/
export function searchCommunityUsers(search) {
return genericSearch(search, "communityUser");
}
//# sourceMappingURL=search-users.js.map