github-repository-provider
Version:
repository provider for github
157 lines (156 loc) • 5.15 kB
text/typescript
/**
* <!-- skip-example -->
* GitHub provider.
* Lookup a repository.
* known environment variables
* - GITHUB_TOKEN or GH_TOKEN api token
* @example
* import GithubProvider from 'github-repository-provider';
*
* const ghp = new GithubProvider();
* const r1 = ghp.repository('git@github.com:arlac77/github-repository-provider.git');
* const r2 = ghp.repository('git://github.com/arlac77/github-repository-provider.git');
* const r3 = ghp.repository('git+ssh://github.com/arlac77/github-repository-provider.git');
* const r4 = ghp.repository('https://github.com/arlac77/github-repository-provider.git#master');
* const r5 = ghp.repository('git+https://github.com/arlac77/github-repository-provider.git#master');
* const r6 = ghp.repository('arlac77/github-repository-provider');
* // different ways to address the same repository
*/
export class GithubProvider extends MultiGroupProvider {
static attributes: {
host: {
env: string[];
default: string;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
depends?: string;
description?: string;
set?: Function;
get?: Function;
};
ssh: {
default: string;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
depends?: string;
description?: string;
set?: Function;
get?: Function;
env?: string[] | string;
};
url: {
env: string;
set: (value: any) => any;
default: string;
depends: string;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
description?: string;
get?: Function;
};
api: {
env: string;
set: (value: any) => any;
depends: string;
default: string;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
description?: string;
get?: Function;
};
"authentication.token": {
env: string[];
additionalAttributes: {
"authentication.type": string;
};
mandatory: boolean;
type: string;
isKey: boolean;
writable: boolean;
collection: boolean;
private?: boolean;
depends?: string;
description?: string;
default?: any;
set?: Function;
get?: Function;
};
priority: {
default: number;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
depends?: string;
description?: string;
set?: Function;
get?: Function;
env?: string[] | string;
};
name: {
env: string;
type: string;
isKey: boolean;
writable: boolean;
mandatory: boolean;
collection: boolean;
private?: boolean;
depends?: string;
description?: string;
default?: any;
set?: Function;
get?: Function;
};
messageDestination: {
type: string;
default: Console;
writable: boolean;
private: boolean;
isKey: boolean;
mandatory: boolean;
collection: boolean;
depends?: string;
description?: string;
set?: Function;
get?: Function;
env?: string[] | string;
};
id: import("pacc").AttributeDefinition;
description: import("pacc").AttributeDefinition;
};
fetch(url: any, options?: {}): Promise<Response>;
fetchJSON(url: any, options?: {}): Promise<Response>;
/**
* {@link https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user}
*/
initializeRepositories(): Promise<void>;
get pullRequestClass(): typeof GithubPullRequest;
get repositoryClass(): typeof GithubRepository;
get branchClass(): typeof GithubBranch;
get repositoryGroupClass(): typeof GithubOwner;
}
export default GithubProvider;
import { GithubRepository } from "./github-repository.mjs";
import { GithubBranch } from "./github-branch.mjs";
import { GithubOwner } from "./github-owner.mjs";
import { GithubPullRequest } from "./github-pull-request.mjs";
import { MultiGroupProvider } from "repository-provider";
export { GithubRepository, GithubBranch, GithubOwner, GithubPullRequest };