-
-
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: Add support for the Packages API #430
- Loading branch information
1 parent
ef65273
commit 47e1ff4
Showing
4 changed files
with
34 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
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,30 @@ | ||
import { BaseService, PaginatedRequestOptions, RequestHelper, Sudo } from '../infrastructure'; | ||
import { ProjectId } from '.'; | ||
|
||
class Packages extends BaseService { | ||
all(projectId: ProjectId, options?: PaginatedRequestOptions) { | ||
const pId = encodeURIComponent(projectId); | ||
|
||
return RequestHelper.get(this, `projects/${gId}/packages`, options); | ||
} | ||
|
||
remove(projectId: ProjectId, packageId: number, options?: Sudo) { | ||
const [pId, pkId] = [projectId, packageId].map(encodeURIComponent); | ||
|
||
return RequestHelper.del(this, `projects/${pId}/packages/${pkId}`, options); | ||
} | ||
|
||
show(projectId: ProjectId, packageId: number, options?: Sudo) { | ||
const [pId, pkId] = [projectId, packageId].map(encodeURIComponent); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/packages/${pkId}`, options); | ||
} | ||
|
||
showFiles(projectId: ProjectId, packageId: number, options?: Sudo) { | ||
const [pId, pkId] = [projectId, packageId].map(encodeURIComponent); | ||
|
||
return RequestHelper.get(this, `projects/${pId}/packages/${pkId}/package_files`, options); | ||
} | ||
} | ||
|
||
export default Packages; |
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