(
name: string,
signal?: AbortSignal,
)
| 293 | } |
| 294 | |
| 295 | async listCheckpoints( |
| 296 | name: string, |
| 297 | signal?: AbortSignal, |
| 298 | ): Promise<Array<SpriteCheckpoint>> { |
| 299 | const url = this.spritePath(name, '/checkpoints') |
| 300 | const response = await fetch(url, { |
| 301 | method: 'GET', |
| 302 | headers: this.headers(), |
| 303 | ...(signal ? { signal } : {}), |
| 304 | }) |
| 305 | if (!response.ok) await this.fail('GET', url, response) |
| 306 | const body = (await response.json()) as Array<{ |
| 307 | id?: unknown |
| 308 | create_time?: unknown |
| 309 | comment?: unknown |
| 310 | is_auto?: unknown |
| 311 | }> |
| 312 | return body.map((entry) => ({ |
| 313 | id: String(entry.id ?? ''), |
| 314 | ...(typeof entry.create_time === 'string' |
| 315 | ? { createTime: entry.create_time } |
| 316 | : {}), |
| 317 | ...(typeof entry.comment === 'string' ? { comment: entry.comment } : {}), |
| 318 | isAuto: entry.is_auto === true, |
| 319 | })) |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Create a checkpoint and return its new version id (e.g. `v3`). The create |
no test coverage detected