import { request } from "@esri/arcgis-rest-request" ; import { getPortalUrl } from "../util/get-portal-url" ; import { IUserItemOptions , determineOwner } from "./helpers" ; param requestOptions returns export function protectItem ( requestOptions ) { return determineOwner ( requestOptions ) . then ( owner => { const url = `${ getPortalUrl ( requestOptions ) }/content/users/${ owner }/items/${ requestOptions . id }/protect` ; return request ( url , requestOptions ) ; } ) ; } param requestOptions returns export function unprotectItem ( requestOptions ) { return determineOwner ( requestOptions ) . then ( owner => { const url = `${ getPortalUrl ( requestOptions ) }/content/users/${ owner }/items/${ requestOptions . id }/unprotect` ; return request ( url , requestOptions ) ; } ) ; }