chore: code formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/metrics")
|
||||
return ({
|
||||
user: {
|
||||
@@ -22,14 +22,14 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
popular: {
|
||||
nodes: [{ stargazers: { totalCount: faker.datatype.number(50000) } }],
|
||||
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()}` },
|
||||
repository: {nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
],
|
||||
totalCount: faker.datatype.number(50000),
|
||||
@@ -42,29 +42,29 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
pullRequest: {
|
||||
title: faker.lorem.sentence(),
|
||||
number: faker.datatype.number(1000),
|
||||
repository: { nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}` },
|
||||
repository: {nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
},
|
||||
},
|
||||
],
|
||||
totalCount: faker.datatype.number(1000),
|
||||
},
|
||||
},
|
||||
projects: { totalCount: faker.datatype.number(100) },
|
||||
packages: { totalCount: faker.datatype.number(100) },
|
||||
organizations: { nodes: [], totalCount: faker.datatype.number(5) },
|
||||
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() }],
|
||||
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) },
|
||||
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) },
|
||||
discussionsStarted: { totalCount: faker.datatype.number(1000) },
|
||||
discussionsComments: { totalCount: faker.datatype.number(1000) },
|
||||
discussionAnswers: { totalCount: faker.datatype.number(1000) },
|
||||
status: {message: faker.lorem.paragraph()},
|
||||
sponsorshipsAsSponsor: {totalCount: faker.datatype.number(100)},
|
||||
discussionsStarted: {totalCount: faker.datatype.number(1000)},
|
||||
discussionsComments: {totalCount: faker.datatype.number(1000)},
|
||||
discussionAnswers: {totalCount: faker.datatype.number(1000)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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 },
|
||||
repository: {viewerHasStarred: faker.datatype.boolean()},
|
||||
viewer: {login},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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 },
|
||||
user: {viewerIsFollowing: faker.datatype.boolean()},
|
||||
viewer: {login},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > achievements/organizations")
|
||||
return ({
|
||||
organization: {
|
||||
@@ -22,12 +22,12 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
popular: {
|
||||
nodes: [{ stargazers: { totalCount: faker.datatype.number(50000) } }],
|
||||
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) },
|
||||
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() }) {
|
||||
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) },
|
||||
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,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user: {
|
||||
@@ -8,29 +8,29 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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"]) },
|
||||
{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"]) },
|
||||
{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"]) },
|
||||
{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"])},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user: {
|
||||
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) },
|
||||
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) },
|
||||
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)},
|
||||
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,9 +1,9 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user: {
|
||||
repositories: { totalCount: faker.datatype.number(100), totalDiskUsage: faker.datatype.number(100000) },
|
||||
repositories: {totalCount: faker.datatype.number(100), totalDiskUsage: faker.datatype.number(100000)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
? ({
|
||||
@@ -27,30 +27,30 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nodes: [
|
||||
{
|
||||
name: faker.random.words(),
|
||||
watchers: { totalCount: faker.datatype.number(1000) },
|
||||
stargazers: { totalCount: faker.datatype.number(10000) },
|
||||
owner: { login },
|
||||
watchers: {totalCount: faker.datatype.number(1000)},
|
||||
stargazers: {totalCount: faker.datatype.number(10000)},
|
||||
owner: {login},
|
||||
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() } },
|
||||
{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) },
|
||||
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" },
|
||||
deployments: { totalCount: faker.datatype.number(100) },
|
||||
environments: { totalCount: faker.datatype.number(100) },
|
||||
licenseInfo: {spdxId: "MIT"},
|
||||
deployments: {totalCount: faker.datatype.number(100)},
|
||||
environments: {totalCount: faker.datatype.number(100)},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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 },
|
||||
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) },
|
||||
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() } },
|
||||
{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) },
|
||||
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" },
|
||||
deployments: { totalCount: faker.datatype.number(100) },
|
||||
environments: { totalCount: faker.datatype.number(100) },
|
||||
licenseInfo: {spdxId: "MIT"},
|
||||
deployments: {totalCount: faker.datatype.number(100)},
|
||||
environments: {totalCount: faker.datatype.number(100)},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/user")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
|
||||
return ({
|
||||
repository: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > discussions/categories")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
@@ -13,7 +13,7 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
: ({
|
||||
user: {
|
||||
repositoryDiscussions: {
|
||||
edges: new Array(100).fill(null).map(_ => ({ cursor: "MOCKED_CURSOR" })),
|
||||
edges: new Array(100).fill(null).map(_ => ({cursor: "MOCKED_CURSOR"})),
|
||||
nodes: new Array(100).fill(null).map(_ => ({
|
||||
category: {
|
||||
emoji: faker.random.arrayElement([":chart_with_upwards_trend:", ":chart_with_downwards_trend:", ":bar_char:"]),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > discussions/comments")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
@@ -13,8 +13,8 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
: ({
|
||||
user: {
|
||||
repositoryDiscussionsComments: {
|
||||
edges: new Array(100).fill(null).map(_ => ({ cursor: "MOCKED_CURSOR" })),
|
||||
nodes: new Array(100).fill(null).map(_ => ({ upvoteCount: faker.datatype.number(10) })),
|
||||
edges: new Array(100).fill(null).map(_ => ({cursor: "MOCKED_CURSOR"})),
|
||||
nodes: new Array(100).fill(null).map(_ => ({upvoteCount: faker.datatype.number(10)})),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > discussions/statistics")
|
||||
return ({
|
||||
user: {
|
||||
started: { totalCount: faker.datatype.number(1000) },
|
||||
comments: { totalCount: faker.datatype.number(1000) },
|
||||
answers: { totalCount: faker.datatype.number(1000) },
|
||||
started: {totalCount: faker.datatype.number(1000)},
|
||||
comments: {totalCount: faker.datatype.number(1000)},
|
||||
answers: {totalCount: faker.datatype.number(1000)},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > followup/repository/collaborators")
|
||||
return ({
|
||||
repository: {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > followup/repository")
|
||||
return ({
|
||||
issues_open: { issueCount: faker.datatype.number(100) },
|
||||
issues_drafts: { issueCount: faker.datatype.number(100) },
|
||||
issues_skipped: { issueCount: faker.datatype.number(100) },
|
||||
issues_closed: { issueCount: faker.datatype.number(100) },
|
||||
pr_open: { issueCount: faker.datatype.number(100) },
|
||||
pr_drafts: { issueCount: faker.datatype.number(100) },
|
||||
pr_closed: { issueCount: faker.datatype.number(100) },
|
||||
pr_merged: { issueCount: faker.datatype.number(100) },
|
||||
issues_open: {issueCount: faker.datatype.number(100)},
|
||||
issues_drafts: {issueCount: faker.datatype.number(100)},
|
||||
issues_skipped: {issueCount: faker.datatype.number(100)},
|
||||
issues_closed: {issueCount: faker.datatype.number(100)},
|
||||
pr_open: {issueCount: faker.datatype.number(100)},
|
||||
pr_drafts: {issueCount: faker.datatype.number(100)},
|
||||
pr_closed: {issueCount: faker.datatype.number(100)},
|
||||
pr_merged: {issueCount: faker.datatype.number(100)},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > followup/user")
|
||||
return ({
|
||||
issues_open: { issueCount: faker.datatype.number(100) },
|
||||
issues_drafts: { issueCount: faker.datatype.number(100) },
|
||||
issues_skipped: { issueCount: faker.datatype.number(100) },
|
||||
issues_closed: { issueCount: faker.datatype.number(100) },
|
||||
pr_open: { issueCount: faker.datatype.number(100) },
|
||||
pr_drafts: { issueCount: faker.datatype.number(100) },
|
||||
pr_closed: { issueCount: faker.datatype.number(100) },
|
||||
pr_merged: { issueCount: faker.datatype.number(100) },
|
||||
issues_open: {issueCount: faker.datatype.number(100)},
|
||||
issues_drafts: {issueCount: faker.datatype.number(100)},
|
||||
issues_skipped: {issueCount: faker.datatype.number(100)},
|
||||
issues_closed: {issueCount: faker.datatype.number(100)},
|
||||
pr_open: {issueCount: faker.datatype.number(100)},
|
||||
pr_drafts: {issueCount: faker.datatype.number(100)},
|
||||
pr_closed: {issueCount: faker.datatype.number(100)},
|
||||
pr_merged: {issueCount: faker.datatype.number(100)},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
? ({
|
||||
@@ -23,16 +23,16 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
{
|
||||
stargazerCount: faker.datatype.number(10),
|
||||
isFork: false,
|
||||
forks: { totalCount: faker.datatype.number(10) },
|
||||
files: [{ name: faker.system.fileName() }],
|
||||
comments: { totalCount: faker.datatype.number(10) },
|
||||
forks: {totalCount: faker.datatype.number(10)},
|
||||
files: [{name: faker.system.fileName()}],
|
||||
comments: {totalCount: faker.datatype.number(10)},
|
||||
},
|
||||
{
|
||||
stargazerCount: faker.datatype.number(10),
|
||||
isFork: false,
|
||||
forks: { totalCount: faker.datatype.number(10) },
|
||||
files: [{ name: faker.system.fileName() }],
|
||||
comments: { totalCount: faker.datatype.number(10) },
|
||||
forks: {totalCount: faker.datatype.number(10)},
|
||||
files: [{name: faker.system.fileName()}],
|
||||
comments: {totalCount: faker.datatype.number(10)},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/organization")
|
||||
return ({
|
||||
organization: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/repository")
|
||||
return ({
|
||||
repository: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > introduction/user")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
@@ -9,7 +9,7 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
for (; date <= to; date.setDate(date.getDate() + 1)) {
|
||||
//Create new week on sunday
|
||||
if (date.getDay() === 0) {
|
||||
weeks.push({ contributionDays })
|
||||
weeks.push({contributionDays})
|
||||
contributionDays = []
|
||||
}
|
||||
//Random contributions
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > licenses/default")
|
||||
return ({
|
||||
licenses: [
|
||||
@@ -9,22 +9,22 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: "GNU AGPLv3",
|
||||
key: "agpl-3.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{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" },
|
||||
{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"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -33,20 +33,20 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "apache-2.0",
|
||||
limitations: [
|
||||
{ key: "trademark-use", label: "Trademark use" },
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{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" },
|
||||
{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"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -55,17 +55,17 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "bsd-2-clause",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{key: "liability", label: "Liability"},
|
||||
{key: "warranty", label: "Warranty"},
|
||||
],
|
||||
conditions: [
|
||||
{ key: "include-copyright", label: "License and copyright notice" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -74,17 +74,17 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "bsd-3-clause",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{key: "liability", label: "Liability"},
|
||||
{key: "warranty", label: "Warranty"},
|
||||
],
|
||||
conditions: [
|
||||
{ key: "include-copyright", label: "License and copyright notice" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -93,17 +93,17 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "bsl-1.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{key: "liability", label: "Liability"},
|
||||
{key: "warranty", label: "Warranty"},
|
||||
],
|
||||
conditions: [
|
||||
{ key: "include-copyright--source", label: "License and copyright notice for source" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -112,17 +112,17 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -131,20 +131,20 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "epl-2.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{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" },
|
||||
{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"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -153,20 +153,20 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: "GNU GPLv2",
|
||||
key: "gpl-2.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -175,21 +175,21 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: "GNU GPLv3",
|
||||
key: "gpl-3.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{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" },
|
||||
{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"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -198,20 +198,20 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: "GNU LGPLv2.1",
|
||||
key: "lgpl-2.1",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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)" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -220,17 +220,17 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "mit",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{key: "liability", label: "Liability"},
|
||||
{key: "warranty", label: "Warranty"},
|
||||
],
|
||||
conditions: [
|
||||
{ key: "include-copyright", label: "License and copyright notice" },
|
||||
{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" },
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
{key: "private-use", label: "Private use"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -239,21 +239,21 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "mpl-2.0",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "trademark-use", label: "Trademark use" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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)" },
|
||||
{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" },
|
||||
{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"},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -262,15 +262,15 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
nickname: null,
|
||||
key: "unlicense",
|
||||
limitations: [
|
||||
{ key: "liability", label: "Liability" },
|
||||
{ key: "warranty", label: "Warranty" },
|
||||
{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" },
|
||||
{key: "private-use", label: "Private use"},
|
||||
{key: "commercial-use", label: "Commercial use"},
|
||||
{key: "modifications", label: "Modification"},
|
||||
{key: "distribution", label: "Distribution"},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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" },
|
||||
licenseInfo: {spdxId: "MIT", name: "MIT License", nickname: null, key: "mit"},
|
||||
url: "https://github.com/lowlighter/metrics",
|
||||
databaseId: 293860197,
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
? ({
|
||||
@@ -22,11 +22,11 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
avatarUrl: null,
|
||||
},
|
||||
nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
stargazers: { totalCount: faker.datatype.number(1000) },
|
||||
watchers: { totalCount: faker.datatype.number(1000) },
|
||||
forks: { totalCount: faker.datatype.number(1000) },
|
||||
issues: { totalCount: faker.datatype.number(1000) },
|
||||
pullRequests: { totalCount: faker.datatype.number(1000) },
|
||||
stargazers: {totalCount: faker.datatype.number(1000)},
|
||||
watchers: {totalCount: faker.datatype.number(1000)},
|
||||
forks: {totalCount: faker.datatype.number(1000)},
|
||||
issues: {totalCount: faker.datatype.number(1000)},
|
||||
pullRequests: {totalCount: faker.datatype.number(1000)},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/issues")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/repository")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > projects/user")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
@@ -20,7 +20,7 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
createdAt: faker.date.recent(),
|
||||
reactions: {
|
||||
nodes: new Array(50).fill(null).map(_ => ({
|
||||
user: { login: faker.internet.userName() },
|
||||
user: {login: faker.internet.userName()},
|
||||
content: faker.random.arrayElement(["HEART", "THUMBS_UP", "THUMBS_DOWN", "LAUGH", "CONFUSED", "EYES", "ROCKET", "HOORAY"]),
|
||||
})),
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
|
||||
return ({
|
||||
repository: {
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > sponsors/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ?
|
||||
({
|
||||
user: {
|
||||
sponsorshipsAsMaintainer: {
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
})
|
||||
: ({
|
||||
user: {
|
||||
sponsorshipsAsMaintainer: {
|
||||
edges: new Array(10).fill("MOCKED_CURSOR"),
|
||||
nodes: new Array(10).fill(null).map(_ => ({
|
||||
sponsorEntity: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
tier: {
|
||||
monthlyPriceInDollars: faker.datatype.number(10),
|
||||
},
|
||||
})),
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user: {
|
||||
sponsorshipsAsMaintainer: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
: ({
|
||||
user: {
|
||||
sponsorshipsAsMaintainer: {
|
||||
edges: new Array(10).fill("MOCKED_CURSOR"),
|
||||
nodes: new Array(10).fill(null).map(_ => ({
|
||||
sponsorEntity: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
tier: {
|
||||
monthlyPriceInDollars: faker.datatype.number(10),
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > sponsors/all")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ?
|
||||
({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user: {
|
||||
sponsorsActivities: {
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
})
|
||||
: ({
|
||||
user: {
|
||||
sponsorsActivities: {
|
||||
edges: new Array(10).fill("MOCKED_CURSOR"),
|
||||
nodes: new Array(10).fill(null).map(_ => ({
|
||||
sponsor: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
sponsorsTier: {
|
||||
monthlyPriceInDollars: faker.datatype.number(10),
|
||||
},
|
||||
})),
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
: ({
|
||||
user: {
|
||||
sponsorsActivities: {
|
||||
edges: new Array(10).fill("MOCKED_CURSOR"),
|
||||
nodes: new Array(10).fill(null).map(_ => ({
|
||||
sponsor: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
sponsorsTier: {
|
||||
monthlyPriceInDollars: faker.datatype.number(10),
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > sponsors/default")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
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)
|
||||
? ({
|
||||
@@ -12,7 +12,7 @@ export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
: ({
|
||||
repository: {
|
||||
stargazers: {
|
||||
edges: new Array(faker.datatype.number({ min: 50, max: 100 })).fill(null).map(() => ({
|
||||
edges: new Array(faker.datatype.number({min: 50, max: 100})).fill(null).map(() => ({
|
||||
starredAt: `${faker.date.recent(30)}`,
|
||||
cursor: "MOCKED_CURSOR",
|
||||
})),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**Mocked data */
|
||||
export default function({ faker, query, login = faker.internet.userName() }) {
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
|
||||
return ({
|
||||
user: {
|
||||
|
||||
Reference in New Issue
Block a user