Metal-mediated intramolecular hydroamination and hydro(acy)alkoxylation reactions