Maybe one way to get only first file in directory:
listAll(listRef).then((res) => { if (res.items[0] != null) { getDownloadURL(res.items[0]).then((url) => { zStorageApi[i] = url; }); } });