UNPKG

@esri/arcgis-rest-portal

Version:

ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request

41 lines 1.43 kB
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc. * Apache-2.0 */ import { genericSearch } from "../util/generic-search.js"; /** * Search a portal for groups. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/group-search.htm) for more information. * * ```js * import { searchGroups } from "@esri/arcgis-rest-portal"; * * searchGroups('water') * .then(response) // response.total => 355 * ``` * * @param search - A string or RequestOptions object to pass through to the endpoint. * @returns A Promise that will resolve with the data from the response. */ export function searchGroups(search) { return genericSearch(search, "group"); } /** * Search a portal for items in a group. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm) for more information. * * ```js * import { searchGroupContent } from "@esri/arcgis-rest-portal"; * * searchGroupContent({ * q: 'water', * groupId: 'abc123' * }) * .then(response => { * console.log(response.total); * }); * ``` * * @param options - An object containing search parameters. * @returns A Promise that resolves to the search result containing items within the specified group. */ export function searchGroupContent(options) { return genericSearch(options, "groupContent"); } //# sourceMappingURL=search.js.map