Skip to content

Commit 32a772f

Browse files
committed
Add endpoint to delete draft attachments
1 parent 4a152dc commit 32a772f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/collections/AttachmentsCollection.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import FormData from 'form-data';
77
import type Crypto from 'crypto';
88
import fs from 'fs';
99
import path from 'path';
10+
import { DeleteObjectResponse } from './generic/DeleteObjectResponse';
1011

1112
export class AttachmentsCollection extends OmahaCollection {
1213

@@ -155,6 +156,18 @@ export class AttachmentsCollection extends OmahaCollection {
155156
);
156157
}
157158

159+
/**
160+
* Deletes an attachment on a draft release.
161+
* @param repo The UUID of the repository.
162+
* @param version The version string.
163+
* @param asset The name of the asset.
164+
*/
165+
public async delete(repo: string, version: string, asset: string) {
166+
return this.client.delete<DeleteObjectResponse>(
167+
this.format('/v1/repositories/:repo/releases/:version/:asset', { repo, version, asset }),
168+
);
169+
}
170+
158171
}
159172

160173
interface Hashes {

0 commit comments

Comments
 (0)