(input: {
name: string;
data: UploadFileData;
mediaType?: string;
expiresInSec?: number;
})
| 331 | |
| 332 | // ── Uploads ───────────────────────────────────────────────────────────── |
| 333 | uploadFile(input: { |
| 334 | name: string; |
| 335 | data: UploadFileData; |
| 336 | mediaType?: string; |
| 337 | expiresInSec?: number; |
| 338 | }): Promise<FileMeta> { |
| 339 | const form = new FormData(); |
| 340 | form.append('name', input.name); |
| 341 | if (input.expiresInSec !== undefined) { |
| 342 | form.append('expires_in_sec', String(input.expiresInSec)); |
| 343 | } |
| 344 | form.append('file', blobFromInput(input), input.name); |
| 345 | return this.formRequest<FileMeta>('POST', '/files', form); |
| 346 | } |
| 347 | deleteFile(fileId: string): Promise<{ deleted: true }> { |
| 348 | return this.request('DELETE', `/files/${encodeURIComponent(fileId)}`, undefined); |
| 349 | } |
nothing calls this directly
no test coverage detected