import { IHubRequestOptions } from "@esri/hub-common" ; import { getItemResources } from "@esri/arcgis-rest-portal" ; import { DRAFT_RESOURCE_REGEX } from "./_draft-resource-regex" ; param siteOrPageId param hubRequestOptions private export function _getDraftResourceNames ( siteOrPageId , hubRequestOptions ) { return getItemResources ( siteOrPageId , { portal : hubRequestOptions . portal , authentication : hubRequestOptions . authentication } ) . then ( response => { const draftResourceNames = response . resources . map ( ( { resource : name } ) => name ) . filter ( ( name ) => name . search ( DRAFT_RESOURCE_REGEX ) !== - 1 ) ; return draftResourceNames ; } ) ; }