gitbeaker/src/services/Repositories.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

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;