()
| 132 | }, |
| 133 | |
| 134 | async list() { |
| 135 | const out: ArtifactRepoSummary[] = []; |
| 136 | let cursor: string | undefined; |
| 137 | let done = false; |
| 138 | const seenCursors = new Set<string>(); |
| 139 | while (!done) { |
| 140 | const page = await binding.list({ limit: LIST_PAGE_SIZE, cursor }); |
| 141 | for (const repo of page.repos) { |
| 142 | const local = unscopedName(sessionId, repo.name); |
| 143 | if (local !== undefined) out.push({ ...repo, name: local }); |
| 144 | } |
| 145 | const next = page.cursor; |
| 146 | if (next === undefined) { |
| 147 | done = true; |
| 148 | } else { |
| 149 | if (seenCursors.has(next)) { |
| 150 | throw new Error(`artifacts list returned a non-advancing cursor: ${next}`); |
| 151 | } |
| 152 | seenCursors.add(next); |
| 153 | cursor = next; |
| 154 | } |
| 155 | } |
| 156 | return out; |
| 157 | }, |
| 158 | |
| 159 | async import(name, source, opts) { |
| 160 | const result = await binding.import({ |
nothing calls this directly
no test coverage detected