import { createFolder , IAddFolderResponse , getUserContent } from "@esri/arcgis-rest-portal" ; import { UserSession } from "@esri/arcgis-rest-auth" ; private export function getExportsFolderId ( authentication ) { return getUserContent ( { authentication } ) . then ( ( userContent ) => { const exportFolder = userContent . folders . find ( ( folder ) => { return folder . title === "item-exports" ; } ) ; if ( exportFolder ) { return { folder : exportFolder } ; } return createFolder ( { authentication , title : "item-exports" } ) ; } ) . then ( ( response ) => { const { folder } = response as IAddFolderResponse ; return folder . id ; } ) ; }