-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding support for ReleaseLinks API
- Loading branch information
1 parent
b0af54b
commit d6a2248
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { BaseService, RequestHelper } from '../infrastructure'; | ||
|
||
class ReleaseLinks extends BaseService { | ||
all(projectId: ProjectId, tagName: string, options?: PaginatedRequestOptions) { | ||
const [pId, tId] = [projectId, tagName].map(encodeURIComponent); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/releases/${tId}/assets/links`, options); | ||
} | ||
|
||
create(projectId: ProjectId, tagName: string, name: string, url: string, options?: Sudo) { | ||
const [pId, tId] = [projectId, tagName].map(encodeURIComponent); | ||
|
||
return RequestHelper.post(this, `projects/${pId}/releases/${tId}/assets/links`, { | ||
name, | ||
url, | ||
...options, | ||
}); | ||
} | ||
|
||
edit( | ||
projectId: ProjectId, | ||
tagName: string, | ||
linkId: number, | ||
options: Sudo & ({ name: string } | { url: string }), | ||
) { | ||
const [pId, tId, lId] = [projectId, tagName, linkId].map(encodeURIComponent); | ||
|
||
return RequestHelper.put(this, `projects/${pId}/releases/${tId}/assets/links/${lId}`, options); | ||
} | ||
|
||
remove(projectId: ProjectId, tagName: string, linkId: number, options?: Sudo) { | ||
const [pId, tId, lId] = [projectId, tagName, linkId].map(encodeURIComponent); | ||
|
||
return RequestHelper.del(this, `projects/${pId}/releases/${tId}/assets/links/${lId}`, options); | ||
} | ||
|
||
show(projectId: ProjectId, tagName: string, linkId: number, options?: Sudo) { | ||
const [pId, tId, lId] = [projectId, tagName, linkId].map(encodeURIComponent); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/releases/${tId}/assets/links/${lId}`, options); | ||
} | ||
} | ||
|
||
export default ReleaseLinks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters