UNPKG

1.3 kBTypeScriptView Raw
1import * as Github from '@octokit/rest';
2export interface IRepoDescriptor {
3 name: string;
4 owner: string;
5 repo: string;
6 full_name: string;
7 ssh_url: string;
8 git_url?: string;
9 clone_url?: string;
10}
11declare interface IParamsAuth {
12 authToken: string;
13}
14declare interface IParamsRepoQuery extends IParamsAuth {
15 repoQuery: string;
16 filter: string;
17}
18export declare interface IParamsEditRepo extends IParamsAuth {
19 name: string;
20 owner: string;
21 repo: string;
22 default_branch: string;
23}
24export declare interface IParamsAddRepoToTeam extends IParamsAuth {
25 team_id: string;
26 owner: string;
27 repo: string;
28 permission?: 'pull' | 'push';
29}
30export declare interface IParamsHeaders {
31 headers: {
32 accepts: string;
33 };
34}
35export declare function getAuthenticatedOctokit(params: IParamsAuth): Promise<Github>;
36export declare function getReposRaw(params: IParamsRepoQuery): Promise<any[]>;
37export declare function getRepos(options: IParamsRepoQuery): Promise<IRepoDescriptor[]>;
38export declare function editRepo(params: IParamsEditRepo): Promise<any>;
39export declare function addRepoToTeam(params: IParamsAddRepoToTeam): Promise<any>;
40export declare function getTeams(params: IParamsAuth): Promise<Github.OrgsGetTeamsResponseItem[]>;
41export {};