(target: SyncPhase, phaseCursor: string | undefined)
| 1417 | |
| 1418 | /** Lists a single batch for the given phase. The cursor is passed only when it belongs to that phase. */ |
| 1419 | const runPhase = (target: SyncPhase, phaseCursor: string | undefined) => { |
| 1420 | if (target === 'wiki') { |
| 1421 | return listWikiPages( |
| 1422 | accessToken, |
| 1423 | organization, |
| 1424 | project, |
| 1425 | wikiFilter, |
| 1426 | maxItems, |
| 1427 | phaseCursor, |
| 1428 | syncContext |
| 1429 | ) |
| 1430 | } |
| 1431 | if (target === 'workitems') { |
| 1432 | return listWorkItems( |
| 1433 | accessToken, |
| 1434 | organization, |
| 1435 | project, |
| 1436 | filters, |
| 1437 | maxItems, |
| 1438 | phaseCursor, |
| 1439 | syncContext, |
| 1440 | lastSyncAt |
| 1441 | ) |
| 1442 | } |
| 1443 | return listRepoFiles( |
| 1444 | accessToken, |
| 1445 | organization, |
| 1446 | project, |
| 1447 | fileFilters, |
| 1448 | maxItems, |
| 1449 | phaseCursor, |
| 1450 | syncContext |
| 1451 | ) |
| 1452 | } |
| 1453 | |
| 1454 | /** True once the maxItems cap has been reached during this sync run. */ |
| 1455 | const capReached = () => |
no test coverage detected