Refactor remaining [github] services (#5748)

This commit is contained in:
Bryan Kok
2020-10-20 07:41:03 +08:00
committed by GitHub
parent 77826cf257
commit dd2223407f
7 changed files with 199 additions and 251 deletions

View File

@@ -15,32 +15,26 @@ const schema = Joi.alternatives(
)
module.exports = class GithubSize extends GithubAuthV3Service {
static get category() {
return 'size'
static category = 'size'
static route = {
base: 'github/size',
pattern: ':user/:repo/:path*',
}
static get route() {
return {
base: 'github/size',
pattern: ':user/:repo/:path*',
}
}
static get examples() {
return [
{
title: 'GitHub file size in bytes',
namedParams: {
user: 'webcaetano',
repo: 'craft',
path: 'build/phaser-craft.min.js',
},
staticPreview: this.render({ size: 9170 }),
keywords: ['repo'],
documentation,
static examples = [
{
title: 'GitHub file size in bytes',
namedParams: {
user: 'webcaetano',
repo: 'craft',
path: 'build/phaser-craft.min.js',
},
]
}
staticPreview: this.render({ size: 9170 }),
keywords: ['repo'],
documentation,
},
]
static render({ size }) {
return {