import * as resources from "@fluidframework/gitresources" ; import Axios from "axios" ; export async function getOrCreateRepository ( endpoint , owner , repository ) { console . log ( `Get Repo: ${ endpoint }/${ owner }/${ repository }` ) ; const details = await Axios . get ( `${ endpoint }/repos/${ owner }/${ repository }` ) . catch ( ( error ) => error . response && error . response . status === 400 ? null : Promise . reject ( error ) ) ; if ( ! details || details . status === 400 ) { console . log ( `Create Repo: ${ endpoint }/${ owner }/${ repository }` ) ; const createParams = { name : repository } ; await Axios . post ( `${ endpoint }/${ owner }/repos` , createParams ) ; } }