Add activity plugin (#41)

This commit is contained in:
Simon Lecoq
2021-01-09 18:57:13 +01:00
committed by GitHub
parent 879502c99a
commit 7df6c922dc
15 changed files with 886 additions and 112 deletions

View File

@@ -434,32 +434,316 @@
status:"200 OK",
"x-oauth-scopes":"repo",
},
data:page < 1 ? new Array(10).fill(null).map(() =>
(false ? {
id:"10000000001",
type:"IssueCommentEvent",
} : {
data:page < 1 ? [] : [
{
id:"10000000000",
type:"PushEvent",
type:"CommitCommentEvent",
actor:{
id:22963968,
login:"lowlighter",
},
repo: {
id:293860197,
repo:{
name:"lowlighter/metrics",
},
payload: {
ref:"refs/heads/master",
commits: [
payload:{
comment:{
user:{
login:"lowlighter",
},
path:"README.md",
commit_id:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
body:"This is a commit comment",
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000001",
type:"PullRequestReviewCommentEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"created",
comment:{
user:{
login:"lowlighter",
},
body:"This is pull request review comment",
},
pull_request:{
title:"Pull request example",
number:1,
user:{
login:"lowlighter",
},
body:"",
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000002",
type:"IssuesEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"closed",
issue:{
number:2,
title:"Issue example",
user:{
login:"lowlighter",
},
body:"Hello this is an example",
performed_via_github_app: null
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000003",
type:"GollumEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/lowlighter",
},
payload:{
pages:[
{
url:"https://api.github.com/repos/lowlighter/metrics/commits/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
page_name:"Home",
title:"Home",
summary:null,
action:"created",
sha:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
]
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString()
})
) : []
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000004",
type:"IssueCommentEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"created",
issue:{
number:3,
title:"Issue example",
user:{
login:"lowlighter",
},
labels:[
{
name:"question",
color:"d876e3",
}
],
state:"open",
},
comment:{
body:"Hello world !",
performed_via_github_app: null
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000005",
type:"ForkEvent",
actor:{
login:"lowlighter",
},
repo:{
id:327522930,
name:"lowlighter/gracidea",
},
payload:{
forkee:{
name:"gracidea",
full_name:"lowlighter/gracidea",
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000006",
type:"PullRequestReviewEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"created",
review:{
user:{
login:"lowlighter",
},
state:"approved",
},
pull_request:{
state:"open",
number:4,
locked:false,
title:"Pull request example",
user:{
login:"user",
},
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000007",
type:"ReleaseEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"published",
release:{
tag_name:"v3.1",
name:"Version 3.1",
draft: false,
prerelease: true,
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000008",
type:"CreateEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
ref:"feat-new-plugin",
ref_type:"branch",
master_branch:"master",
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"100000000009",
type:"WatchEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/gracidea",
},
payload:{action:"started"},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000010",
type:"DeleteEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
ref:"feat-plugin-merged",
ref_type:"branch",
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000011",
type:"PushEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
size:1,
ref:"refs/heads/master",
commits:[
{
sha:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
message:"Commit example",
}
]
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000012",
type:"PullRequestEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
action:"opened",
number:5,
pull_request:{
state:"open",
title:"Pull request example",
additions:210,
deletions:126,
changed_files:10,
}
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000013",
type:"MemberEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{
member:{
login:"botlighter",
},
action:"added"
},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
},
{
id:"10000000014",
type:"PublicEvent",
actor:{
login:"lowlighter",
},
repo:{
name:"lowlighter/metrics",
},
payload:{},
created_at:new Date(Date.now()-Math.floor(-Math.random()*14)*Math.floor(-Math.random()*24)*60*60*1000).toISOString(),
}
]
})
}
})