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.
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { BaseService, RequestHelper, Sudo, BaseRequestOptions } from '../infrastructure';
|
|
import { ProjectId } from '.';
|
|
|
|
class Repositories extends BaseService {
|
|
compare(projectId: ProjectId, from: string, to: string, options?: Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/compare`, {
|
|
from,
|
|
to,
|
|
...options,
|
|
});
|
|
}
|
|
|
|
contributors(projectId: ProjectId, options?: Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/contributors`, options);
|
|
}
|
|
|
|
showArchive(projectId: ProjectId, options?: { sha: string } & Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/archive`, options);
|
|
}
|
|
|
|
showBlob(projectId: ProjectId, sha: string, options?: Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/blobs/${sha}`, options);
|
|
}
|
|
|
|
showBlobRaw(projectId: ProjectId, sha: string, options?: Sudo) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/blobs/${sha}/raw`, options);
|
|
}
|
|
|
|
tree(projectId: ProjectId, options?: BaseRequestOptions) {
|
|
const pId = encodeURIComponent(projectId);
|
|
|
|
return RequestHelper.get(this, `projects/${pId}/repository/tree`, options);
|
|
}
|
|
}
|
|
|
|
export default Repositories;
|