import { isAuthenticated , isAuthorized } from "../auth" ; import { https } from 'firebase-functions' ; import { deleteFolder } from './folders' ; import * as express from 'express' ; import * as cors from 'cors' ; const appFolders = express ( ) ; appFolders . use ( express . json ( ) ) ; appFolders . use ( cors ( { origin : true } ) ) ; appFolders . delete ( '/:uid' , isAuthenticated , isAuthorized ( [ 'admin' ] , { allowSameUser : true } ) , deleteFolder ) ; export const folders = https . onRequest ( appFolders ) ;