-
-
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 Releases API #295
- Loading branch information
1 parent
b0af54b
commit 7191e81
Showing
3 changed files
with
37 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,35 @@ | ||
import { BaseService, RequestHelper } from '../infrastructure'; | ||
|
||
class Releases extends BaseService { | ||
all(projectId: ProjectId, options?: PaginatedRequestOptions) { | ||
const pId = encodeURIComponent(projectId); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/releases`, options); | ||
} | ||
|
||
create(projectId: ProjectId, options?: BaseRequestOptions) { | ||
const pId = encodeURIComponent(projectId); | ||
|
||
return RequestHelper.post(this, `projects/${pId}/releases`, options); | ||
} | ||
|
||
edit(projectId: ProjectId, tagName: string, options?: BaseRequestOptions) { | ||
const [pId, tId] = [projectId, tagName].map(encodeURIComponent); | ||
|
||
return RequestHelper.put(this, `projects/${pId}/releases/${tId}`, options); | ||
} | ||
|
||
remove(projectId: ProjectId, tagName: string, options?: Sudo) { | ||
const [pId, tId] = [projectId, tagName].map(encodeURIComponent); | ||
|
||
return RequestHelper.del(this, `projects/${pId}/releases/${tId}`, options); | ||
} | ||
|
||
show(projectId: ProjectId, tagName: string, options?: Sudo) { | ||
const [pId, tId] = [projectId, tagName].map(encodeURIComponent); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/releases/${tId}`, options); | ||
} | ||
} | ||
|
||
export default Releases; |
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