Comparing version 3.0.0 to 3.0.1-next.1576454329.43a5df28b3dbdb3f6817c256fe03f2371efc20ff
@@ -0,1 +1,2 @@ | ||
/* eslint camelcase:0 */ | ||
// Import | ||
@@ -6,3 +7,3 @@ import fetch from 'cross-fetch'; | ||
// ================================= | ||
// Fetch Directly | ||
// Fetch Repository | ||
/** | ||
@@ -9,0 +10,0 @@ * Fetch data for Repostiory from Repository Name |
"use strict"; | ||
/* eslint camelcase:0 */ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -11,3 +12,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
// ================================= | ||
// Fetch Directly | ||
// Fetch Repository | ||
/** | ||
@@ -14,0 +15,0 @@ * Fetch data for Repostiory from Repository Name |
# History | ||
## v3.0.1 2019 December 16 | ||
- Fix type exports | ||
## v3.0.0 2019 December 16 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"title": "Get Repositories", | ||
"name": "getrepos", | ||
"version": "3.0.0", | ||
"version": "3.0.1-next.1576454329.43a5df28b3dbdb3f6817c256fe03f2371efc20ff", | ||
"description": "Fetch the specified repositories, or those that match a particular github user or search query", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/bevry/getrepos", |
@@ -0,16 +1,206 @@ | ||
/* eslint camelcase:0 */ | ||
// Import | ||
import fetch from 'cross-fetch' | ||
import githubAuthQueryString from 'githubauthquerystring' | ||
import { | ||
Repository, | ||
RepositoryResponse, | ||
SearchResponse, | ||
SearchRepository | ||
} from './types' | ||
const ghapi = process.env.GITHUB_API || 'https://api.github.com' | ||
import { StrictUnion } from 'simplytyped' | ||
// ================================= | ||
// Types | ||
/** | ||
* GitHub's error response | ||
* https://developer.github.com/v3/ | ||
*/ | ||
export interface Error { | ||
message: 'Bad credentials' | ||
documentation_url?: string | ||
errors?: Array<{ | ||
resource: string | ||
field: string | ||
code: string | ||
}> | ||
} | ||
/** | ||
* GitHub's Repository Response will either be a repository, or if invalid, an error | ||
*/ | ||
export type RepositoryResponse = StrictUnion<Error | Repository> | ||
/** | ||
* GitHub's Search Response will either be a search result, or if invalid, an error | ||
*/ | ||
export type SearchResponse = StrictUnion<Error | Search> | ||
/** | ||
* GitHub's response to searching for repositories | ||
* https://developer.github.com/v3/search/#search-repositories | ||
*/ | ||
export interface Search { | ||
total_count: number | ||
incomplete_results: boolean | ||
items: SearchRepository[] | ||
} | ||
/** | ||
* Search results return a subset of the full repository results | ||
*/ | ||
export interface SearchRepository { | ||
id: number | ||
node_id: string | ||
name: string | ||
full_name: string | ||
owner: Owner | ||
private: boolean | ||
html_url: string | ||
description: string | ||
fork: boolean | ||
url: string | ||
created_at: Date | ||
updated_at: Date | ||
pushed_at: Date | ||
homepage: string | ||
size: number | ||
stargazers_count: number | ||
watchers_count: number | ||
language: string | ||
forks_count: number | ||
open_issues_count: number | ||
master_branch: string | ||
default_branch: string | ||
score: number | ||
} | ||
/** | ||
* The owner of a repository | ||
*/ | ||
export interface Owner { | ||
login: string | ||
id: number | ||
node_id: string | ||
avatar_url: string | ||
gravatar_id: string | ||
url: string | ||
received_events_url: string | ||
type: string | ||
} | ||
/** | ||
* GitHub's response to getting a repository | ||
* https://developer.github.com/v3/repos/#get | ||
*/ | ||
export interface Repository extends SearchRepository { | ||
archive_url: string | ||
assignees_url: string | ||
blobs_url: string | ||
branches_url: string | ||
collaborators_url: string | ||
comments_url: string | ||
commits_url: string | ||
compare_url: string | ||
contents_url: string | ||
contributors_url: string | ||
deployments_url: string | ||
downloads_url: string | ||
events_url: string | ||
forks_url: string | ||
git_commits_url: string | ||
git_refs_url: string | ||
git_tags_url: string | ||
git_url: string | ||
issue_comment_url: string | ||
issue_events_url: string | ||
issues_url: string | ||
keys_url: string | ||
labels_url: string | ||
languages_url: string | ||
merges_url: string | ||
milestones_url: string | ||
notifications_url: string | ||
pulls_url: string | ||
releases_url: string | ||
ssh_url: string | ||
stargazers_url: string | ||
statuses_url: string | ||
subscribers_url: string | ||
subscription_url: string | ||
tags_url: string | ||
teams_url: string | ||
trees_url: string | ||
clone_url: string | ||
mirror_url: string | ||
hooks_url: string | ||
svn_url: string | ||
is_template: boolean | ||
topics: string[] | ||
has_issues: boolean | ||
has_projects: boolean | ||
has_wiki: boolean | ||
has_pages: boolean | ||
has_downloads: boolean | ||
archived: boolean | ||
disabled: boolean | ||
visibility: string | ||
permissions: Permissions | ||
allow_rebase_merge: boolean | ||
template_repository: null | ||
allow_squash_merge: boolean | ||
allow_merge_commit: boolean | ||
subscribers_count: number | ||
network_count: number | ||
license?: License | ||
organization?: Organization | ||
parent?: Repository | ||
source?: Repository | ||
} | ||
/** | ||
* The license of a repository | ||
*/ | ||
export interface License { | ||
key: string | ||
name: string | ||
spdx_id: string | ||
url: string | ||
node_id: string | ||
} | ||
/** | ||
* The organisation of a respository | ||
*/ | ||
export interface Organization { | ||
login: string | ||
id: number | ||
node_id: string | ||
avatar_url: string | ||
gravatar_id: string | ||
url: string | ||
html_url: string | ||
followers_url: string | ||
following_url: string | ||
gists_url: string | ||
starred_url: string | ||
subscriptions_url: string | ||
organizations_url: string | ||
repos_url: string | ||
events_url: string | ||
received_events_url: string | ||
type: string | ||
site_admin: boolean | ||
} | ||
/** | ||
* The permissions of a repository | ||
*/ | ||
export interface Permissions { | ||
admin: boolean | ||
push: boolean | ||
pull: boolean | ||
} | ||
/** | ||
* Search Query Options | ||
*/ | ||
interface SearchOptions { | ||
export interface SearchOptions { | ||
/** If you wish to skip the first page, then set this param, defaults to 1 */ | ||
@@ -25,3 +215,3 @@ page?: number | ||
// ================================= | ||
// Fetch Directly | ||
// Fetch Repository | ||
@@ -28,0 +218,0 @@ /** |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35574
10
472
1