Code formatting (#280)
This commit is contained in:
@@ -1,67 +1,67 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/metrics")
|
||||
return ({
|
||||
user:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
forks:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
},
|
||||
pullRequests:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
title:faker.lorem.sentence(),
|
||||
repository:{nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(50000),
|
||||
},
|
||||
contributionsCollection:{
|
||||
pullRequestReviewContributions:{
|
||||
nodes:[
|
||||
{
|
||||
occurredAt:faker.date.recent(),
|
||||
pullRequest:{
|
||||
title:faker.lorem.sentence(),
|
||||
number:faker.datatype.number(1000),
|
||||
repository:{nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(1000),
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/metrics")
|
||||
return ({
|
||||
user:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
},
|
||||
projects:{totalCount:faker.datatype.number(100)},
|
||||
packages:{totalCount:faker.datatype.number(100)},
|
||||
organizations:{nodes:[], totalCount:faker.datatype.number(5)},
|
||||
gists:{
|
||||
nodes:[{createdAt:faker.date.recent(), name:faker.lorem.slug()}],
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
forks:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
},
|
||||
pullRequests:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
title:faker.lorem.sentence(),
|
||||
repository:{nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(50000),
|
||||
},
|
||||
contributionsCollection:{
|
||||
pullRequestReviewContributions:{
|
||||
nodes:[
|
||||
{
|
||||
occurredAt:faker.date.recent(),
|
||||
pullRequest:{
|
||||
title:faker.lorem.sentence(),
|
||||
number:faker.datatype.number(1000),
|
||||
repository:{nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(1000),
|
||||
},
|
||||
starredRepositories:{totalCount:faker.datatype.number(1000)},
|
||||
followers:{totalCount:faker.datatype.number(10000)},
|
||||
following:{totalCount:faker.datatype.number(10000)},
|
||||
bio:faker.lorem.sentence(),
|
||||
status:{message:faker.lorem.paragraph()},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(100)},
|
||||
},
|
||||
})
|
||||
}
|
||||
projects:{totalCount:faker.datatype.number(100)},
|
||||
packages:{totalCount:faker.datatype.number(100)},
|
||||
organizations:{nodes:[], totalCount:faker.datatype.number(5)},
|
||||
gists:{
|
||||
nodes:[{createdAt:faker.date.recent(), name:faker.lorem.slug()}],
|
||||
totalCount:faker.datatype.number(1000),
|
||||
},
|
||||
starredRepositories:{totalCount:faker.datatype.number(1000)},
|
||||
followers:{totalCount:faker.datatype.number(10000)},
|
||||
following:{totalCount:faker.datatype.number(10000)},
|
||||
bio:faker.lorem.sentence(),
|
||||
status:{message:faker.lorem.paragraph()},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(100)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/metrics")
|
||||
return ({
|
||||
repository:{viewerHasStarred:faker.datatype.boolean()},
|
||||
viewer:{login},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/metrics")
|
||||
return ({
|
||||
repository:{viewerHasStarred:faker.datatype.boolean()},
|
||||
viewer:{login},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/octocat")
|
||||
return ({
|
||||
user:{viewerIsFollowing:faker.datatype.boolean()},
|
||||
viewer:{login},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/octocat")
|
||||
return ({
|
||||
user:{viewerIsFollowing:faker.datatype.boolean()},
|
||||
viewer:{login},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/organizations")
|
||||
return ({
|
||||
organization:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
forks:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
},
|
||||
projects:{totalCount:faker.datatype.number(100)},
|
||||
packages:{totalCount:faker.datatype.number(100)},
|
||||
membersWithRole:{totalCount:faker.datatype.number(100)},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(100)},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/organizations")
|
||||
return ({
|
||||
organization:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
})
|
||||
}
|
||||
forks:{
|
||||
nodes:[
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
},
|
||||
projects:{totalCount:faker.datatype.number(100)},
|
||||
packages:{totalCount:faker.datatype.number(100)},
|
||||
membersWithRole:{totalCount:faker.datatype.number(100)},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(100)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/ranking")
|
||||
return ({
|
||||
repo_rank:{repositoryCount:faker.datatype.number(100000)},
|
||||
forks_rank:{repositoryCount:faker.datatype.number(100000)},
|
||||
created_rank:{userCount:faker.datatype.number(100000)},
|
||||
user_rank:{userCount:faker.datatype.number(100000)},
|
||||
repo_total:{repositoryCount:faker.datatype.number(100000)},
|
||||
user_total:{userCount:faker.datatype.number(100000)},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/ranking")
|
||||
return ({
|
||||
repo_rank:{repositoryCount:faker.datatype.number(100000)},
|
||||
forks_rank:{repositoryCount:faker.datatype.number(100000)},
|
||||
created_rank:{userCount:faker.datatype.number(100000)},
|
||||
user_rank:{userCount:faker.datatype.number(100000)},
|
||||
repo_total:{repositoryCount:faker.datatype.number(100000)},
|
||||
user_total:{userCount:faker.datatype.number(100000)},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/repositories")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/repositories")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositories:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositories:{
|
||||
edges:[
|
||||
@@ -46,4 +48,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
name:"metrics",
|
||||
owner:{login},
|
||||
createdAt:new Date().toISOString(),
|
||||
diskUsage:Math.floor(Math.random()*10000),
|
||||
homepageUrl:faker.internet.url(),
|
||||
watchers:{totalCount:faker.datatype.number(1000)},
|
||||
stargazers:{totalCount:faker.datatype.number(10000)},
|
||||
languages:{
|
||||
edges:[
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
],
|
||||
},
|
||||
issues_open:{totalCount:faker.datatype.number(100)},
|
||||
issues_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_open:{totalCount:faker.datatype.number(100)},
|
||||
pr_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_merged:{totalCount:faker.datatype.number(100)},
|
||||
releases:{totalCount:faker.datatype.number(100)},
|
||||
forkCount:faker.datatype.number(100),
|
||||
licenseInfo:{spdxId:"MIT"},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
name:"metrics",
|
||||
owner:{login},
|
||||
createdAt:new Date().toISOString(),
|
||||
diskUsage:Math.floor(Math.random() * 10000),
|
||||
homepageUrl:faker.internet.url(),
|
||||
watchers:{totalCount:faker.datatype.number(1000)},
|
||||
stargazers:{totalCount:faker.datatype.number(10000)},
|
||||
languages:{
|
||||
edges:[
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
{size:faker.datatype.number(100000), node:{color:faker.internet.color(), name:faker.lorem.word()}},
|
||||
],
|
||||
},
|
||||
issues_open:{totalCount:faker.datatype.number(100)},
|
||||
issues_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_open:{totalCount:faker.datatype.number(100)},
|
||||
pr_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_merged:{totalCount:faker.datatype.number(100)},
|
||||
releases:{totalCount:faker.datatype.number(100)},
|
||||
forkCount:faker.datatype.number(100),
|
||||
licenseInfo:{spdxId:"MIT"},
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user:{
|
||||
databaseId:faker.datatype.number(10000000),
|
||||
name:faker.name.findName(),
|
||||
login,
|
||||
createdAt:`${faker.date.past(10)}`,
|
||||
avatarUrl:faker.image.people(),
|
||||
websiteUrl:faker.internet.url(),
|
||||
isHireable:faker.datatype.boolean(),
|
||||
twitterUsername:login,
|
||||
repositories:{totalCount:faker.datatype.number(100), totalDiskUsage:faker.datatype.number(100000), nodes:[]},
|
||||
packages:{totalCount:faker.datatype.number(10)},
|
||||
starredRepositories:{totalCount:faker.datatype.number(1000)},
|
||||
watching:{totalCount:faker.datatype.number(100)},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(10)},
|
||||
sponsorshipsAsMaintainer:{totalCount:faker.datatype.number(10)},
|
||||
contributionsCollection:{
|
||||
totalRepositoriesWithContributedCommits:faker.datatype.number(100),
|
||||
totalCommitContributions:faker.datatype.number(10000),
|
||||
restrictedContributionsCount:faker.datatype.number(10000),
|
||||
totalIssueContributions:faker.datatype.number(100),
|
||||
totalPullRequestContributions:faker.datatype.number(1000),
|
||||
totalPullRequestReviewContributions:faker.datatype.number(1000),
|
||||
},
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
weeks:[
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
repositoriesContributedTo:{totalCount:faker.datatype.number(100)},
|
||||
followers:{totalCount:faker.datatype.number(1000)},
|
||||
following:{totalCount:faker.datatype.number(1000)},
|
||||
issueComments:{totalCount:faker.datatype.number(1000)},
|
||||
organizations:{totalCount:faker.datatype.number(10)},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user:{
|
||||
databaseId:faker.datatype.number(10000000),
|
||||
name:faker.name.findName(),
|
||||
login,
|
||||
createdAt:`${faker.date.past(10)}`,
|
||||
avatarUrl:faker.image.people(),
|
||||
websiteUrl:faker.internet.url(),
|
||||
isHireable:faker.datatype.boolean(),
|
||||
twitterUsername:login,
|
||||
repositories:{totalCount:faker.datatype.number(100), totalDiskUsage:faker.datatype.number(100000), nodes:[]},
|
||||
packages:{totalCount:faker.datatype.number(10)},
|
||||
starredRepositories:{totalCount:faker.datatype.number(1000)},
|
||||
watching:{totalCount:faker.datatype.number(100)},
|
||||
sponsorshipsAsSponsor:{totalCount:faker.datatype.number(10)},
|
||||
sponsorshipsAsMaintainer:{totalCount:faker.datatype.number(10)},
|
||||
contributionsCollection:{
|
||||
totalRepositoriesWithContributedCommits:faker.datatype.number(100),
|
||||
totalCommitContributions:faker.datatype.number(10000),
|
||||
restrictedContributionsCount:faker.datatype.number(10000),
|
||||
totalIssueContributions:faker.datatype.number(100),
|
||||
totalPullRequestContributions:faker.datatype.number(1000),
|
||||
totalPullRequestReviewContributions:faker.datatype.number(1000),
|
||||
},
|
||||
})
|
||||
}
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
weeks:[
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
{
|
||||
contributionDays:[
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
{color:faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"])},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
repositoriesContributedTo:{totalCount:faker.datatype.number(100)},
|
||||
followers:{totalCount:faker.datatype.number(1000)},
|
||||
following:{totalCount:faker.datatype.number(1000)},
|
||||
issueComments:{totalCount:faker.datatype.number(1000)},
|
||||
organizations:{totalCount:faker.datatype.number(10)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
|
||||
return ({
|
||||
repository:{
|
||||
object:{
|
||||
oid:"MOCKED_SHA",
|
||||
abbreviatedOid:"MOCKED_SHA",
|
||||
messageHeadline:faker.lorem.sentence(),
|
||||
committedDate:faker.date.recent(),
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
|
||||
return ({
|
||||
repository:{
|
||||
object:{
|
||||
oid:"MOCKED_SHA",
|
||||
abbreviatedOid:"MOCKED_SHA",
|
||||
messageHeadline:faker.lorem.sentence(),
|
||||
committedDate:faker.date.recent(),
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > followup/user")
|
||||
return ({
|
||||
user:{
|
||||
issues_open:{totalCount:faker.datatype.number(100)},
|
||||
issues_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_open:{totalCount:faker.datatype.number(100)},
|
||||
pr_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_merged:{totalCount:faker.datatype.number(100)},
|
||||
},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > followup/user")
|
||||
return ({
|
||||
user:{
|
||||
issues_open:{totalCount:faker.datatype.number(100)},
|
||||
issues_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_open:{totalCount:faker.datatype.number(100)},
|
||||
pr_closed:{totalCount:faker.datatype.number(100)},
|
||||
pr_merged:{totalCount:faker.datatype.number(100)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > gists/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > gists/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[
|
||||
@@ -36,4 +38,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/organization")
|
||||
return ({
|
||||
organization:{
|
||||
description:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/organization")
|
||||
return ({
|
||||
organization:{
|
||||
description:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/repository")
|
||||
return ({
|
||||
repository:{
|
||||
description:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/repository")
|
||||
return ({
|
||||
repository:{
|
||||
description:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/user")
|
||||
return ({
|
||||
user:{
|
||||
bio:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/user")
|
||||
return ({
|
||||
user:{
|
||||
bio:faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > isocalendar/calendar")
|
||||
//Generate calendar
|
||||
const date = new Date(query.match(/from: "(?<date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)"/)?.groups?.date)
|
||||
const to = new Date(query.match(/to: "(?<date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)"/)?.groups?.date)
|
||||
const weeks = []
|
||||
let contributionDays = []
|
||||
for (; date <= to; date.setDate(date.getDate()+1)) {
|
||||
//Create new week on sunday
|
||||
if (date.getDay() === 0) {
|
||||
weeks.push({contributionDays})
|
||||
contributionDays = []
|
||||
}
|
||||
//Random contributions
|
||||
const contributionCount = Math.min(10, Math.max(0, faker.datatype.number(14)-4))
|
||||
contributionDays.push({
|
||||
contributionCount,
|
||||
color:["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"][Math.ceil(contributionCount/10/0.25)],
|
||||
date:date.toISOString().substring(0, 10),
|
||||
})
|
||||
}
|
||||
return ({
|
||||
user:{
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
weeks,
|
||||
},
|
||||
},
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > isocalendar/calendar")
|
||||
//Generate calendar
|
||||
const date = new Date(query.match(/from: "(?<date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)"/)?.groups?.date)
|
||||
const to = new Date(query.match(/to: "(?<date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)"/)?.groups?.date)
|
||||
const weeks = []
|
||||
let contributionDays = []
|
||||
for (; date <= to; date.setDate(date.getDate() + 1)) {
|
||||
//Create new week on sunday
|
||||
if (date.getDay() === 0) {
|
||||
weeks.push({contributionDays})
|
||||
contributionDays = []
|
||||
}
|
||||
//Random contributions
|
||||
const contributionCount = Math.min(10, Math.max(0, faker.datatype.number(14) - 4))
|
||||
contributionDays.push({
|
||||
contributionCount,
|
||||
color:["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"][Math.ceil(contributionCount / 10 / 0.25)],
|
||||
date:date.toISOString().substring(0, 10),
|
||||
})
|
||||
}
|
||||
return ({
|
||||
user:{
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
weeks,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,278 +1,278 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > licenses/default")
|
||||
return ({
|
||||
licenses:[
|
||||
{
|
||||
spdxId:"AGPL-3.0",
|
||||
name:"GNU Affero General Public License v3.0",
|
||||
nickname:"GNU AGPLv3",
|
||||
key:"agpl-3.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"network-use-disclose", label:"Network use is distribution"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"Apache-2.0",
|
||||
name:"Apache License 2.0",
|
||||
nickname:null,
|
||||
key:"apache-2.0",
|
||||
limitations:[
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSD-2-Clause",
|
||||
name:'BSD 2-Clause "Simplified" License',
|
||||
nickname:null,
|
||||
key:"bsd-2-clause",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSD-3-Clause",
|
||||
name:'BSD 3-Clause "New" or "Revised" License',
|
||||
nickname:null,
|
||||
key:"bsd-3-clause",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSL-1.0",
|
||||
name:"Boost Software License 1.0",
|
||||
nickname:null,
|
||||
key:"bsl-1.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright--source", label:"License and copyright notice for source"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"CC0-1.0",
|
||||
name:"Creative Commons Zero v1.0 Universal",
|
||||
nickname:null,
|
||||
key:"cc0-1.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"EPL-2.0",
|
||||
name:"Eclipse Public License 2.0",
|
||||
nickname:null,
|
||||
key:"epl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"GPL-2.0",
|
||||
name:"GNU General Public License v2.0",
|
||||
nickname:"GNU GPLv2",
|
||||
key:"gpl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"GPL-3.0",
|
||||
name:"GNU General Public License v3.0",
|
||||
nickname:"GNU GPLv3",
|
||||
key:"gpl-3.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"LGPL-2.1",
|
||||
name:"GNU Lesser General Public License v2.1",
|
||||
nickname:"GNU LGPLv2.1",
|
||||
key:"lgpl-2.1",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"same-license--library", label:"Same license (library)"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"MIT",
|
||||
name:"MIT License",
|
||||
nickname:null,
|
||||
key:"mit",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"MPL-2.0",
|
||||
name:"Mozilla Public License 2.0",
|
||||
nickname:null,
|
||||
key:"mpl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"same-license--file", label:"Same license (file)"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"Unlicense",
|
||||
name:"The Unlicense",
|
||||
nickname:null,
|
||||
key:"unlicense",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[],
|
||||
permissions:[
|
||||
{key:"private-use", label:"Private use"},
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > licenses/default")
|
||||
return ({
|
||||
licenses:[
|
||||
{
|
||||
spdxId:"AGPL-3.0",
|
||||
name:"GNU Affero General Public License v3.0",
|
||||
nickname:"GNU AGPLv3",
|
||||
key:"agpl-3.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"network-use-disclose", label:"Network use is distribution"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"Apache-2.0",
|
||||
name:"Apache License 2.0",
|
||||
nickname:null,
|
||||
key:"apache-2.0",
|
||||
limitations:[
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSD-2-Clause",
|
||||
name:'BSD 2-Clause "Simplified" License',
|
||||
nickname:null,
|
||||
key:"bsd-2-clause",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSD-3-Clause",
|
||||
name:'BSD 3-Clause "New" or "Revised" License',
|
||||
nickname:null,
|
||||
key:"bsd-3-clause",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"BSL-1.0",
|
||||
name:"Boost Software License 1.0",
|
||||
nickname:null,
|
||||
key:"bsl-1.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright--source", label:"License and copyright notice for source"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"CC0-1.0",
|
||||
name:"Creative Commons Zero v1.0 Universal",
|
||||
nickname:null,
|
||||
key:"cc0-1.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"EPL-2.0",
|
||||
name:"Eclipse Public License 2.0",
|
||||
nickname:null,
|
||||
key:"epl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"GPL-2.0",
|
||||
name:"GNU General Public License v2.0",
|
||||
nickname:"GNU GPLv2",
|
||||
key:"gpl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"GPL-3.0",
|
||||
name:"GNU General Public License v3.0",
|
||||
nickname:"GNU GPLv3",
|
||||
key:"gpl-3.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"same-license", label:"Same license"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"LGPL-2.1",
|
||||
name:"GNU Lesser General Public License v2.1",
|
||||
nickname:"GNU LGPLv2.1",
|
||||
key:"lgpl-2.1",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"document-changes", label:"State changes"},
|
||||
{key:"same-license--library", label:"Same license (library)"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"MIT",
|
||||
name:"MIT License",
|
||||
nickname:null,
|
||||
key:"mit",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"MPL-2.0",
|
||||
name:"Mozilla Public License 2.0",
|
||||
nickname:null,
|
||||
key:"mpl-2.0",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"trademark-use", label:"Trademark use"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[
|
||||
{key:"disclose-source", label:"Disclose source"},
|
||||
{key:"include-copyright", label:"License and copyright notice"},
|
||||
{key:"same-license--file", label:"Same license (file)"},
|
||||
],
|
||||
permissions:[
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
{key:"patent-use", label:"Patent use"},
|
||||
{key:"private-use", label:"Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
spdxId:"Unlicense",
|
||||
name:"The Unlicense",
|
||||
nickname:null,
|
||||
key:"unlicense",
|
||||
limitations:[
|
||||
{key:"liability", label:"Liability"},
|
||||
{key:"warranty", label:"Warranty"},
|
||||
],
|
||||
conditions:[],
|
||||
permissions:[
|
||||
{key:"private-use", label:"Private use"},
|
||||
{key:"commercial-use", label:"Commercial use"},
|
||||
{key:"modifications", label:"Modification"},
|
||||
{key:"distribution", label:"Distribution"},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > licenses/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
licenseInfo:{spdxId:"MIT", name:"MIT License", nickname:null, key:"mit"},
|
||||
url:"https://github.com/lowlighter/metrics",
|
||||
databaseId:293860197,
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > licenses/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
licenseInfo:{spdxId:"MIT", name:"MIT License", nickname:null, key:"mit"},
|
||||
url:"https://github.com/lowlighter/metrics",
|
||||
databaseId:293860197,
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/contributions")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/contributions")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[
|
||||
@@ -29,4 +31,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/default")
|
||||
const type = query.match(/(?<type>followers|following)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/default")
|
||||
const type = query.match(/(?<type>followers|following)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20+80*Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
login,
|
||||
@@ -21,4 +23,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/repository")
|
||||
const type = query.match(/(?<type>stargazers|watchers)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/repository")
|
||||
const type = query.match(/(?<type>stargazers|watchers)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
@@ -10,11 +11,12 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20+80*Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
login,
|
||||
@@ -25,4 +27,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/sponsors")
|
||||
const type = query.match(/(?<type>sponsorshipsAsSponsor|sponsorshipsAsMaintainer)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/sponsors")
|
||||
const type = query.match(/(?<type>sponsorshipsAsSponsor|sponsorshipsAsMaintainer)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
login,
|
||||
[type]:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
login,
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20+80*Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
sponsorEntity:{
|
||||
@@ -29,4 +31,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
project:{
|
||||
name:"Repository project example",
|
||||
updatedAt:`${faker.date.recent()}`,
|
||||
body:faker.lorem.paragraph(),
|
||||
progress:{
|
||||
doneCount:faker.datatype.number(10),
|
||||
inProgressCount:faker.datatype.number(10),
|
||||
todoCount:faker.datatype.number(10),
|
||||
enabled:true,
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
project:{
|
||||
name:"Repository project example",
|
||||
updatedAt:`${faker.date.recent()}`,
|
||||
body:faker.lorem.paragraph(),
|
||||
progress:{
|
||||
doneCount:faker.datatype.number(10),
|
||||
inProgressCount:faker.datatype.number(10),
|
||||
todoCount:faker.datatype.number(10),
|
||||
enabled:true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/user")
|
||||
return ({
|
||||
user:{
|
||||
projects:{
|
||||
totalCount:1,
|
||||
nodes:[
|
||||
{
|
||||
name:"User-owned project",
|
||||
updatedAt:`${faker.date.recent()}`,
|
||||
body:faker.lorem.paragraph(),
|
||||
progress:{
|
||||
doneCount:faker.datatype.number(10),
|
||||
inProgressCount:faker.datatype.number(10),
|
||||
todoCount:faker.datatype.number(10),
|
||||
enabled:true,
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/user")
|
||||
return ({
|
||||
user:{
|
||||
projects:{
|
||||
totalCount:1,
|
||||
nodes:[
|
||||
{
|
||||
name:"User-owned project",
|
||||
updatedAt:`${faker.date.recent()}`,
|
||||
body:faker.lorem.paragraph(),
|
||||
progress:{
|
||||
doneCount:faker.datatype.number(10),
|
||||
inProgressCount:faker.datatype.number(10),
|
||||
todoCount:faker.datatype.number(10),
|
||||
enabled:true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > reactions/default")
|
||||
const type = query.match(/(?<type>issues|issueComments)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > reactions/default")
|
||||
const type = query.match(/(?<type>issues|issueComments)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(100).fill(null).map(_ => ({
|
||||
@@ -27,4 +29,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stargazers/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stargazers/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:new Array(faker.datatype.number({min:50, max:100})).fill(null).map(() => ({
|
||||
@@ -17,4 +19,4 @@
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
|
||||
return ({
|
||||
user:{
|
||||
starredRepositories:{
|
||||
edges:[
|
||||
{
|
||||
starredAt:`${faker.date.recent(14)}`,
|
||||
node:{
|
||||
description:"📊 An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere !",
|
||||
forkCount:faker.datatype.number(100),
|
||||
isFork:false,
|
||||
issues:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
nameWithOwner:"lowlighter/metrics",
|
||||
openGraphImageUrl:"https://repository-images.githubusercontent.com/293860197/7fd72080-496d-11eb-8fe0-238b38a0746a",
|
||||
pullRequests:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
stargazerCount:faker.datatype.number(10000),
|
||||
licenseInfo:{
|
||||
nickname:null,
|
||||
name:"MIT License",
|
||||
},
|
||||
primaryLanguage:{
|
||||
color:"#f1e05a",
|
||||
name:"JavaScript",
|
||||
},
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
|
||||
return ({
|
||||
user:{
|
||||
starredRepositories:{
|
||||
edges:[
|
||||
{
|
||||
starredAt:`${faker.date.recent(14)}`,
|
||||
node:{
|
||||
description:"📊 An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere !",
|
||||
forkCount:faker.datatype.number(100),
|
||||
isFork:false,
|
||||
issues:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
nameWithOwner:"lowlighter/metrics",
|
||||
openGraphImageUrl:"https://repository-images.githubusercontent.com/293860197/7fd72080-496d-11eb-8fe0-238b38a0746a",
|
||||
pullRequests:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
stargazerCount:faker.datatype.number(10000),
|
||||
licenseInfo:{
|
||||
nickname:null,
|
||||
name:"MIT License",
|
||||
},
|
||||
primaryLanguage:{
|
||||
color:"#f1e05a",
|
||||
name:"JavaScript",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user