// List all repositories
const repos = await store.listRepos();
console.log(`Found ${repos.repos.length} repositories`);
for (const repo of repos.repos) {
console.log(`${repo.repoId}: ${repo.defaultBranch}`);
if (repo.baseRepo) {
console.log(` Synced with: ${repo.baseRepo.owner}/${repo.baseRepo.name}`);
}
}
// With pagination
const page = await store.listRepos({
limit: 20,
cursor: repos.nextCursor,
});
// Iterate through all pages
let cursor: string | undefined;
do {
const result = await store.listRepos({ limit: 50, cursor });
for (const repo of result.repos) {
console.log(repo.repoId);
}
cursor = result.nextCursor;
} while (cursor);