(id)
| 215 | readDocumentUpdate: readUpdate, |
| 216 | saveDocumentUpdate: saveUpdate, |
| 217 | async deleteDocument(id) { |
| 218 | await fs.unlink(docPath(id)).catch((error) => { |
| 219 | if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error |
| 220 | }) |
| 221 | }, |
| 222 | async readDocumentBase64(id) { |
| 223 | const data = await readUpdate(id) |
| 224 | return data ? { id, data: Buffer.from(data).toString("base64") } : null |