mirror of
https://github.com/bendtherules/github-delete-unused-repos.git
synced 2026-08-19 00:32:09 +00:00
Add redux store and package
This commit is contained in:
+80
-69
@@ -2,140 +2,151 @@ import * as Octokit from '@octokit/rest';
|
||||
|
||||
// +++ All typescript definitions +++
|
||||
interface RequestOptions {
|
||||
method: string;
|
||||
url: string;
|
||||
headers: any;
|
||||
query?: string;
|
||||
variables?: Variables;
|
||||
method: string;
|
||||
url: string;
|
||||
headers: any;
|
||||
query?: string;
|
||||
variables?: Variables;
|
||||
}
|
||||
|
||||
interface Result {
|
||||
headers: {
|
||||
status: string;
|
||||
};
|
||||
headers: {
|
||||
status: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface OctokitError {
|
||||
code: number;
|
||||
status: string;
|
||||
code: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface OctokitMod extends Octokit {
|
||||
// The following are added because Octokit does not expose the hook.error, hook.before, and hook.after methods
|
||||
hook: {
|
||||
error: (when: 'request', callback: (error: OctokitError, options: RequestOptions) => void) => void;
|
||||
before: (when: 'request', callback: (result: Result, options: RequestOptions) => void) => void;
|
||||
after: (when: 'request', callback: (result: Result, options: RequestOptions) => void) => void;
|
||||
};
|
||||
// The following are added because Octokit does not expose the hook.error, hook.before, and hook.after methods
|
||||
hook: {
|
||||
error: (
|
||||
when: 'request',
|
||||
callback: (error: OctokitError, options: RequestOptions) => void
|
||||
) => void;
|
||||
before: (
|
||||
when: 'request',
|
||||
callback: (result: Result, options: RequestOptions) => void
|
||||
) => void;
|
||||
after: (
|
||||
when: 'request',
|
||||
callback: (result: Result, options: RequestOptions) => void
|
||||
) => void;
|
||||
};
|
||||
}
|
||||
|
||||
interface Variables {
|
||||
[key: string]: any;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface ResponseWithDataArray<T> {
|
||||
data: T[];
|
||||
data: T[];
|
||||
}
|
||||
|
||||
interface ResponseWithMetaLink {
|
||||
meta: {
|
||||
link: string;
|
||||
};
|
||||
meta: {
|
||||
link: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ResponseWithDataArrayAndMeta<T> extends ResponseWithDataArray<T>, ResponseWithMetaLink {
|
||||
}
|
||||
export interface ResponseWithDataArrayAndMeta<T>
|
||||
extends ResponseWithDataArray<T>,
|
||||
ResponseWithMetaLink {}
|
||||
|
||||
export interface ResponseFromGetUserRepo extends ResponseWithMetaLink {
|
||||
data: RepoFromGetUserRepo[];
|
||||
data: RepoFromGetUserRepo[];
|
||||
}
|
||||
|
||||
export interface ResponseFromGetBranches extends ResponseWithMetaLink {
|
||||
data: BranchFromGetBranches[];
|
||||
data: BranchFromGetBranches[];
|
||||
}
|
||||
|
||||
export interface ResponseFromGetRepo {
|
||||
data: RepoFromGetRepo;
|
||||
meta: {};
|
||||
data: RepoFromGetRepo;
|
||||
meta: {};
|
||||
}
|
||||
|
||||
export interface ResponseFromCompareCommits {
|
||||
data: {
|
||||
status: string;
|
||||
ahead_by: number;
|
||||
behind_by: number;
|
||||
total_commits: number;
|
||||
};
|
||||
data: {
|
||||
status: string;
|
||||
ahead_by: number;
|
||||
behind_by: number;
|
||||
total_commits: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ResponseFromGetContributors extends ResponseWithMetaLink {
|
||||
data: OwnerFromGetContributors[] | undefined;
|
||||
data: OwnerFromGetContributors[] | undefined;
|
||||
}
|
||||
|
||||
export interface RepoFromGetUserRepo {
|
||||
default_branch: string;
|
||||
description: string;
|
||||
fork: boolean;
|
||||
full_name: string;
|
||||
homepage: string;
|
||||
id: number;
|
||||
language: string;
|
||||
name: string;
|
||||
owner: OwnerFromGetUserRepo;
|
||||
private: boolean;
|
||||
pushed_at: string;
|
||||
url: string;
|
||||
default_branch: string;
|
||||
description: string;
|
||||
fork: boolean;
|
||||
full_name: string;
|
||||
homepage: string;
|
||||
id: number;
|
||||
language: string;
|
||||
name: string;
|
||||
owner: OwnerFromGetUserRepo;
|
||||
private: boolean;
|
||||
pushed_at: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface OwnerFromGetUserRepo {
|
||||
avatar_url: string;
|
||||
gravatar_id: string;
|
||||
html_url: string;
|
||||
id: number;
|
||||
login: string;
|
||||
repos_url: string;
|
||||
type: UserType;
|
||||
avatar_url: string;
|
||||
gravatar_id: string;
|
||||
html_url: string;
|
||||
id: number;
|
||||
login: string;
|
||||
repos_url: string;
|
||||
type: UserType;
|
||||
}
|
||||
|
||||
export type OwnerFromGetContributors = OwnerFromGetUserRepo;
|
||||
|
||||
enum UserType {
|
||||
User = 'User'
|
||||
User = 'User',
|
||||
}
|
||||
|
||||
export interface BranchFromGetBranches {
|
||||
name: string;
|
||||
commit: CommitFromGetBranches;
|
||||
name: string;
|
||||
commit: CommitFromGetBranches;
|
||||
}
|
||||
|
||||
interface CommitFromGetBranches {
|
||||
sha: string;
|
||||
url: string;
|
||||
sha: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface RepoFromGetRepo {
|
||||
parent: RepoFromGetUserRepo;
|
||||
parent: RepoFromGetUserRepo;
|
||||
}
|
||||
|
||||
export interface RepoNameWithUnusedFlag {
|
||||
repoName: string;
|
||||
unused: boolean;
|
||||
repoName: string;
|
||||
unused: boolean;
|
||||
}
|
||||
|
||||
export interface RepoNameWithBranches {
|
||||
repoName: string;
|
||||
branches: BranchFromGetBranches[];
|
||||
repoName: string;
|
||||
branches: BranchFromGetBranches[];
|
||||
}
|
||||
|
||||
export interface RepoNameWithParentRepo {
|
||||
repoName: string;
|
||||
parentRepo: RepoFromGetUserRepo;
|
||||
repoName: string;
|
||||
parentRepo: RepoFromGetUserRepo;
|
||||
}
|
||||
|
||||
export interface RepoNameWithBranchesAndParent extends RepoNameWithBranches, RepoNameWithParentRepo {
|
||||
}
|
||||
export interface RepoNameWithBranchesAndParent
|
||||
extends RepoNameWithBranches,
|
||||
RepoNameWithParentRepo {}
|
||||
|
||||
export interface ObjectWithPerPage {
|
||||
per_page?: number;
|
||||
per_page?: number;
|
||||
}
|
||||
// --- End all typescript definitions ---
|
||||
// --- End all typescript definitions ---
|
||||
|
||||
Reference in New Issue
Block a user