mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Remove the typings directory. Declare and use the types/interfaces in the various index.ts files. This will produce a package that can be used by Typescript without errors. Remove the typings directory. Declare and use the types/interfaces in the various index.ts files. This will produce a package that can be used by Typescript without errors.
31 lines
1016 B
TypeScript
31 lines
1016 B
TypeScript
import { BaseService, RequestHelper, Sudo, PaginatedRequestOptions } from '../infrastructure';
|
|
import { ProjectId, KeyId } from '.';
|
|
|
|
class DeployKeys extends BaseService {
|
|
add(projectId: ProjectId, options?: Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.post(this, `projects/${pId}/deploy_keys`, options);
|
|
}
|
|
|
|
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/deploy_keys`, options);
|
|
}
|
|
|
|
show(projectId: ProjectId, keyId: KeyId, options?: Sudo) {
|
|
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/deploy_keys/${kId}`, options);
|
|
}
|
|
|
|
enable(projectId: ProjectId, keyId: KeyId, options?: Sudo) {
|
|
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
|
|
|
return RequestHelper.post(this, `projects/${pId}/deploy_keys/${kId}/enable`, options);
|
|
}
|
|
}
|
|
|
|
export default DeployKeys;
|