-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathstats.js
More file actions
38 lines (28 loc) · 763 Bytes
/
stats.js
File metadata and controls
38 lines (28 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
# Stats features (only for GitHub Enterprise)
## Setup
```javascript
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const stats = require('../libs/features/stats');
let githubCli = new GitHubClient({
baseUri: "http://github.at.home/api/v3",
token: process.env.TOKEN_GHITHUB_ENTERPRISE
}, stats); //<-- add stats features
```
*/
/*
## fetchStats
- parameter: `type` see: https://developer.github.com/v3/enterprise/admin_stats/
- return: `Promise`
### Description
`fetchStats` gets statistics from a type (issues, hooks, ...)
*/
function fetchStats({type}){
return this.getData({path:`/enterprise/stats/${type}`})
.then(response => {
return response.data;
});
}
module.exports = {
fetchStats: fetchStats
};