import * as cloudinary from 'cloudinary' ; import { CLOUD_NAME , API_KEY , API_SECRET } from '../../environments' ; remarks This method is part of the  shared .
 *
 *  param createReadStream returns beta export const uploadFile = async ( file ) : Promise < string > => { cloudinary . config ( { cloud_name : CLOUD_NAME ! , api_key : API_KEY ! , api_secret : API_SECRET ! } ) ; const uniqueFilename = new Date ( ) . toISOString ( ) ; const result = await new Promise ( async ( resolve , reject ) => { cloudinary . v2 . uploader . upload_stream ( { folder : 'rest' , public_id : uniqueFilename , tags : 'rest' } , ( err , image ) => { if ( err ) { reject ( err ) ; } resolve ( image ) ; } ) . end ( file . buffer ) ; } ) ; return result [ 'secure_url' ] ; } ;