* Build(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.34.0 to 4.19.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.19.0/packages/eslint-plugin) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * chore: update eslint camelcase rule * chore: eslint camelcase updates for wordpress * chore: fix eslint camelcase for misc other services * chore: fix eslint camelcase issue in github and gitlab * chore: run prettier * chore: account for JSX globals * deps: bump typescript-eslint-parser to v4 * chore: frontend lint changes * chore: update eslint config to only run @typescript-eslint/explicit-module-boundary-types on ts files Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
'use strict'
|
|
|
|
const Joi = require('joi')
|
|
const { renderVersionBadge } = require('../version')
|
|
const {
|
|
BaseVisualStudioAppCenterService,
|
|
keywords,
|
|
documentation,
|
|
} = require('./visual-studio-app-center-base')
|
|
|
|
const schema = Joi.object({
|
|
version: Joi.string().required(),
|
|
short_version: Joi.string().required(),
|
|
}).required()
|
|
|
|
module.exports = class VisualStudioAppCenterReleasesVersion extends (
|
|
BaseVisualStudioAppCenterService
|
|
) {
|
|
static category = 'version'
|
|
|
|
static route = {
|
|
base: 'visual-studio-app-center/releases/version',
|
|
pattern: ':owner/:app/:token',
|
|
}
|
|
|
|
static examples = [
|
|
{
|
|
title: 'Visual Studio App Center Releases',
|
|
namedParams: {
|
|
owner: 'jct',
|
|
app: 'my-amazing-app',
|
|
token: 'ac70cv...',
|
|
},
|
|
staticPreview: renderVersionBadge({ version: '1.0 (4)' }),
|
|
keywords,
|
|
documentation,
|
|
},
|
|
]
|
|
|
|
static defaultBadgeData = {
|
|
label: 'release',
|
|
}
|
|
|
|
async handle({ owner, app, token }) {
|
|
const { version, short_version: shortVersion } = await this.fetch({
|
|
owner,
|
|
app,
|
|
token,
|
|
schema,
|
|
})
|
|
return renderVersionBadge({
|
|
version: `${shortVersion} (${version})`,
|
|
})
|
|
}
|
|
}
|