async function notes(uid, sid, username) {
const notes = [];
let page = 1;
let pageCount = 1;
const params = {
method: 'GET',
headers: { 'X-Futuware-UID': uid, 'X-Futuware-SID': sid, }
};
while (page <= pageCount) {
const response = await fetch(
`https://d3.ru/api/user_notes/?user_login=${username}&page=${page++}`, params);
const result = await response.json();
pageCount = result.page_count;
notes.push(...result.user_notes);
}
return notes;
}