{"draft":null,"from":28,"to":29,"files":[{"path":"client/src/api.ts","added":23,"removed":0,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -517,6 +517,29 @@\n \t\treturn this.url(`/attachments/${id}`, this.issuesServer);\n \t}\n \n+\t/** An attachment's bytes, or with `source` the svg it was drawn from; refused past `max` bytes. */\n+\tasync attachmentBytes(id: string, source: boolean, max: number): Promise<Uint8Array> {\n+\t\tif (this.issuesServer === undefined)\n+\t\t\tthrow new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);\n+\t\tconst url = `${this.attachmentUrl(id)}${source ? \"/source\" : \"\"}`;\n+\t\tlet res: Response;\n+\t\ttry {\n+\t\t\tres = await fetch(url, {\n+\t\t\t\theaders: this.headers(),\n+\t\t\t\tsignal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),\n+\t\t\t});\n+\t\t} catch (err) {\n+\t\t\tconst e = err as Error;\n+\t\t\tthrow new ApiError(\n+\t\t\t\t`could not reach ${this.issuesServer}: ${(e.cause as Error | undefined)?.message ?? e.message}`,\n+\t\t\t);\n+\t\t}\n+\t\tif (!res.ok) throw new ApiError(`${url} answered ${res.status}: ${errorSentence(await res.text())}`, res.status);\n+\t\tconst bytes = new Uint8Array(await res.arrayBuffer());\n+\t\tif (bytes.length > max) throw new ApiError(`${url} sent ${bytes.length} bytes, more than an attachment may be`);\n+\t\treturn bytes;\n+\t}\n+\n \t/** An edit (abso issue 3): it tells the issue's watchers, and `also`, unless `notify` is false. null clears a parent or Agent. */\n \tissueEdit(\n \t\tid: number,"}],"unmatched":[]}