chore: code formatting
This commit is contained in:
@@ -1,70 +1,70 @@
|
||||
/**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:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
user: {
|
||||
repositories: {
|
||||
nodes: [
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
createdAt: faker.date.recent(),
|
||||
nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
forks:{
|
||||
nodes:[
|
||||
forks: {
|
||||
nodes: [
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
createdAt: faker.date.recent(),
|
||||
nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
popular: {
|
||||
nodes: [{ stargazers: { totalCount: faker.datatype.number(50000) } }],
|
||||
},
|
||||
pullRequests:{
|
||||
nodes:[
|
||||
pullRequests: {
|
||||
nodes: [
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
title:faker.lorem.sentence(),
|
||||
repository:{nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`},
|
||||
createdAt: faker.date.recent(),
|
||||
title: faker.lorem.sentence(),
|
||||
repository: { nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}` },
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(50000),
|
||||
totalCount: faker.datatype.number(50000),
|
||||
},
|
||||
contributionsCollection:{
|
||||
pullRequestReviewContributions:{
|
||||
nodes:[
|
||||
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()}`},
|
||||
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),
|
||||
totalCount: faker.datatype.number(1000),
|
||||
},
|
||||
},
|
||||
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),
|
||||
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)},
|
||||
discussionsStarted:{totalCount:faker.datatype.number(1000)},
|
||||
discussionsComments:{totalCount:faker.datatype.number(1000)},
|
||||
discussionAnswers:{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) },
|
||||
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,33 +1,33 @@
|
||||
/**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:{
|
||||
repositories:{
|
||||
nodes:[
|
||||
organization: {
|
||||
repositories: {
|
||||
nodes: [
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
createdAt: faker.date.recent(),
|
||||
nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
forks:{
|
||||
nodes:[
|
||||
forks: {
|
||||
nodes: [
|
||||
{
|
||||
createdAt:faker.date.recent(),
|
||||
nameWithOwner:`${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
createdAt: faker.date.recent(),
|
||||
nameWithOwner: `${faker.internet.userName()}/${faker.lorem.slug()}`,
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
popular:{
|
||||
nodes:[{stargazers:{totalCount:faker.datatype.number(50000)}}],
|
||||
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)},
|
||||
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,36 +1,36 @@
|
||||
/**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:{
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
weeks:[
|
||||
user: {
|
||||
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"]) },
|
||||
],
|
||||
},
|
||||
{
|
||||
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"]) },
|
||||
{ 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"])},
|
||||
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"]) },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/**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:{
|
||||
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),
|
||||
user: {
|
||||
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),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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)},
|
||||
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) },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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)},
|
||||
user: {
|
||||
repositories: { totalCount: faker.datatype.number(100), totalDiskUsage: faker.datatype.number(100000) },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
user: {
|
||||
get repositoriesContributedTo() {
|
||||
return this.repositories
|
||||
},
|
||||
repositories:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
repositories: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
user: {
|
||||
get repositoriesContributedTo() {
|
||||
return this.repositories
|
||||
},
|
||||
repositories:{
|
||||
edges:[
|
||||
repositories: {
|
||||
edges: [
|
||||
{
|
||||
cursor:"MOCKED_CURSOR",
|
||||
cursor: "MOCKED_CURSOR",
|
||||
},
|
||||
],
|
||||
nodes:[
|
||||
nodes: [
|
||||
{
|
||||
name:faker.random.words(),
|
||||
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()}},
|
||||
name: faker.random.words(),
|
||||
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() } },
|
||||
],
|
||||
},
|
||||
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)},
|
||||
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) },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -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},
|
||||
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()}},
|
||||
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"},
|
||||
deployments:{totalCount:faker.datatype.number(100)},
|
||||
environments:{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) },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/**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:{
|
||||
databaseId:faker.datatype.number(10000000),
|
||||
name:faker.name.findName(),
|
||||
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,
|
||||
createdAt: `${faker.date.past(10)}`,
|
||||
avatarUrl: faker.image.people(),
|
||||
websiteUrl: faker.internet.url(),
|
||||
isHireable: faker.datatype.boolean(),
|
||||
twitterUsername: login,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**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:{
|
||||
object:{
|
||||
oid:"MOCKED_SHA",
|
||||
abbreviatedOid:"MOCKED_SHA",
|
||||
messageHeadline:faker.lorem.sentence(),
|
||||
committedDate:faker.date.recent(),
|
||||
repository: {
|
||||
object: {
|
||||
oid: "MOCKED_SHA",
|
||||
abbreviatedOid: "MOCKED_SHA",
|
||||
messageHeadline: faker.lorem.sentence(),
|
||||
committedDate: faker.date.recent(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
repositoryDiscussions:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
user: {
|
||||
repositoryDiscussions: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoryDiscussions:{
|
||||
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:"]),
|
||||
name:faker.lorem.slug()
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
user: {
|
||||
repositoryDiscussions: {
|
||||
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:"]),
|
||||
name: faker.lorem.slug(),
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
repositoryDiscussionsComments:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
user: {
|
||||
repositoryDiscussionsComments: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoryDiscussionsComments:{
|
||||
edges:new Array(100).fill(null).map(_ => ({cursor:"MOCKED_CURSOR"})),
|
||||
nodes:new Array(100).fill(null).map(_ => ({upvoteCount: faker.datatype.number(10)}))
|
||||
}
|
||||
}
|
||||
user: {
|
||||
repositoryDiscussionsComments: {
|
||||
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)}
|
||||
}
|
||||
user: {
|
||||
started: { totalCount: faker.datatype.number(1000) },
|
||||
comments: { totalCount: faker.datatype.number(1000) },
|
||||
answers: { totalCount: faker.datatype.number(1000) },
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 > followup/repository/collaborators")
|
||||
return ({
|
||||
repository:{
|
||||
collaborators:{
|
||||
nodes:["github-user"]
|
||||
}
|
||||
repository: {
|
||||
collaborators: {
|
||||
nodes: ["github-user"],
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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,38 +1,38 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
user: {
|
||||
gists: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[
|
||||
user: {
|
||||
gists: {
|
||||
edges: [
|
||||
{
|
||||
cursor:"MOCKED_CURSOR",
|
||||
cursor: "MOCKED_CURSOR",
|
||||
},
|
||||
],
|
||||
totalCount:faker.datatype.number(100),
|
||||
nodes:[
|
||||
totalCount: faker.datatype.number(100),
|
||||
nodes: [
|
||||
{
|
||||
stargazerCount:faker.datatype.number(10),
|
||||
isFork:false,
|
||||
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) },
|
||||
},
|
||||
{
|
||||
stargazerCount:faker.datatype.number(10),
|
||||
isFork:false,
|
||||
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) },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -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 > introduction/organization")
|
||||
return ({
|
||||
organization:{
|
||||
description:faker.lorem.sentences(),
|
||||
organization: {
|
||||
description: faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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 > introduction/repository")
|
||||
return ({
|
||||
repository:{
|
||||
description:faker.lorem.sentences(),
|
||||
repository: {
|
||||
description: faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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 > introduction/user")
|
||||
return ({
|
||||
user:{
|
||||
bio:faker.lorem.sentences(),
|
||||
user: {
|
||||
bio: faker.lorem.sentences(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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,21 +9,21 @@ 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
|
||||
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),
|
||||
color: ["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"][Math.ceil(contributionCount / 10 / 0.25)],
|
||||
date: date.toISOString().substring(0, 10),
|
||||
})
|
||||
}
|
||||
return ({
|
||||
user:{
|
||||
calendar:{
|
||||
contributionCalendar:{
|
||||
user: {
|
||||
calendar: {
|
||||
contributionCalendar: {
|
||||
weeks,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,276 +1,276 @@
|
||||
/**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:[
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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)"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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)"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
conditions: [],
|
||||
permissions: [
|
||||
{ key: "private-use", label: "Private use" },
|
||||
{ key: "commercial-use", label: "Commercial use" },
|
||||
{ key: "modifications", label: "Modification" },
|
||||
{ key: "distribution", label: "Distribution" },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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 > licenses/repository")
|
||||
return ({
|
||||
user:{
|
||||
repository:{
|
||||
licenseInfo:{spdxId:"MIT", name:"MIT License", nickname:null, key:"mit"},
|
||||
url:"https://github.com/lowlighter/metrics",
|
||||
databaseId:293860197,
|
||||
user: {
|
||||
repository: {
|
||||
licenseInfo: { spdxId: "MIT", name: "MIT License", nickname: null, key: "mit" },
|
||||
url: "https://github.com/lowlighter/metrics",
|
||||
databaseId: 293860197,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[],
|
||||
user: {
|
||||
repositoriesContributedTo: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[
|
||||
user: {
|
||||
repositoriesContributedTo: {
|
||||
edges: [
|
||||
{
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
isInOrganization:true,
|
||||
owner:{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
cursor: "MOCKED_CURSOR",
|
||||
node: {
|
||||
isInOrganization: true,
|
||||
owner: {
|
||||
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)},
|
||||
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) },
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
user: {
|
||||
[type]: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
user: {
|
||||
[type]: {
|
||||
edges: new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor: "MOCKED_CURSOR",
|
||||
node: {
|
||||
login,
|
||||
avatarUrl:null,
|
||||
avatarUrl: null,
|
||||
},
|
||||
})),
|
||||
},
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
user: {
|
||||
repository: {
|
||||
[type]: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
user: {
|
||||
repository: {
|
||||
[type]: {
|
||||
edges: new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor: "MOCKED_CURSOR",
|
||||
node: {
|
||||
login,
|
||||
avatarUrl:null,
|
||||
avatarUrl: null,
|
||||
},
|
||||
})),
|
||||
},
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
user: {
|
||||
login,
|
||||
[type]:{
|
||||
edges:[],
|
||||
[type]: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
user: {
|
||||
login,
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
sponsorEntity:{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
[type]: {
|
||||
edges: new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
cursor: "MOCKED_CURSOR",
|
||||
node: {
|
||||
sponsorEntity: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
sponsorable:{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
sponsorable: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
},
|
||||
})),
|
||||
|
||||
@@ -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 > 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,
|
||||
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,20 +1,20 @@
|
||||
/**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:{
|
||||
projects:{
|
||||
totalCount:1,
|
||||
nodes:[
|
||||
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,
|
||||
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,27 +1,27 @@
|
||||
/**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)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
user: {
|
||||
[type]: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(100).fill(null).map(_ => ({
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
createdAt:faker.date.recent(),
|
||||
reactions:{
|
||||
nodes:new Array(50).fill(null).map(_ => ({
|
||||
user:{login:faker.internet.userName()},
|
||||
content:faker.random.arrayElement(["HEART", "THUMBS_UP", "THUMBS_DOWN", "LAUGH", "CONFUSED", "EYES", "ROCKET", "HOORAY"]),
|
||||
user: {
|
||||
[type]: {
|
||||
edges: new Array(100).fill(null).map(_ => ({
|
||||
cursor: "MOCKED_CURSOR",
|
||||
node: {
|
||||
createdAt: faker.date.recent(),
|
||||
reactions: {
|
||||
nodes: new Array(50).fill(null).map(_ => ({
|
||||
user: { login: faker.internet.userName() },
|
||||
content: faker.random.arrayElement(["HEART", "THUMBS_UP", "THUMBS_DOWN", "LAUGH", "CONFUSED", "EYES", "ROCKET", "HOORAY"]),
|
||||
})),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
/**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:{
|
||||
repository: {
|
||||
createdAt: faker.date.past(),
|
||||
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),
|
||||
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),
|
||||
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",
|
||||
stargazerCount: faker.datatype.number(10000),
|
||||
licenseInfo: {
|
||||
nickname: null,
|
||||
name: "MIT License",
|
||||
},
|
||||
primaryLanguage:{
|
||||
color:"#f1e05a",
|
||||
name:"JavaScript",
|
||||
primaryLanguage: {
|
||||
color: "#f1e05a",
|
||||
name: "JavaScript",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
/**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:{
|
||||
sponsorsListing:{
|
||||
fullDescription:faker.lorem.sentences(),
|
||||
activeGoal:{
|
||||
percentComplete:faker.datatype.number(100),
|
||||
title:faker.lorem.sentence(),
|
||||
description:faker.lorem.sentence(),
|
||||
}
|
||||
user: {
|
||||
sponsorsListing: {
|
||||
fullDescription: faker.lorem.sentences(),
|
||||
activeGoal: {
|
||||
percentComplete: faker.datatype.number(100),
|
||||
title: faker.lorem.sentence(),
|
||||
description: faker.lorem.sentence(),
|
||||
},
|
||||
},
|
||||
sponsorshipsAsMaintainer:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
nodes:new Array(10).fill(null).map(_ => ({
|
||||
sponsorEntity:{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
sponsorshipsAsMaintainer: {
|
||||
totalCount: faker.datatype.number(100),
|
||||
nodes: new Array(10).fill(null).map(_ => ({
|
||||
sponsorEntity: {
|
||||
login: faker.internet.userName(),
|
||||
avatarUrl: null,
|
||||
},
|
||||
tier:{
|
||||
monthlyPriceInDollars:faker.datatype.number(10),
|
||||
}
|
||||
}))
|
||||
}
|
||||
tier: {
|
||||
monthlyPriceInDollars: faker.datatype.number(10),
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/**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)
|
||||
? ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:[],
|
||||
repository: {
|
||||
stargazers: {
|
||||
edges: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
: ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:new Array(faker.datatype.number({min:50, max:100})).fill(null).map(() => ({
|
||||
starredAt:`${faker.date.recent(30)}`,
|
||||
cursor:"MOCKED_CURSOR",
|
||||
repository: {
|
||||
stargazers: {
|
||||
edges: new Array(faker.datatype.number({ min: 50, max: 100 })).fill(null).map(() => ({
|
||||
starredAt: `${faker.date.recent(30)}`,
|
||||
cursor: "MOCKED_CURSOR",
|
||||
})),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
/**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:{
|
||||
starredRepositories:{
|
||||
edges:[
|
||||
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),
|
||||
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),
|
||||
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",
|
||||
stargazerCount: faker.datatype.number(10000),
|
||||
licenseInfo: {
|
||||
nickname: null,
|
||||
name: "MIT License",
|
||||
},
|
||||
primaryLanguage:{
|
||||
color:"#f1e05a",
|
||||
name:"JavaScript",
|
||||
primaryLanguage: {
|
||||
color: "#f1e05a",
|
||||
name: "JavaScript",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user