| 230 | } |
| 231 | |
| 232 | async setUrlAuth( |
| 233 | name: string, |
| 234 | auth: SpriteUrlAuth, |
| 235 | signal?: AbortSignal, |
| 236 | ): Promise<void> { |
| 237 | const response = await fetch(this.spritePath(name), { |
| 238 | method: 'PUT', |
| 239 | headers: this.headers({ 'content-type': 'application/json' }), |
| 240 | body: JSON.stringify({ url_settings: { auth } }), |
| 241 | ...(signal ? { signal } : {}), |
| 242 | }) |
| 243 | if (!response.ok) await this.fail('PUT', this.spritePath(name), response) |
| 244 | await response.body?.cancel() |
| 245 | } |
| 246 | |
| 247 | async fsRead(name: string, path: string): Promise<Uint8Array> { |
| 248 | const url = this.spritePath( |