gitbeaker/src/services/DeployKeys.ts
Daniel Rose da1a8f6a63 fix: Make package Typescript-conformant
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.
2019-06-12 15:06:00 +02:00

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;