From bde30b25897eec19bd98975b901f8811bf4b4985 Mon Sep 17 00:00:00 2001 From: chris48s Date: Wed, 8 Nov 2023 19:49:20 +0000 Subject: [PATCH] add meaningful descriptions including keywords (#9715) --- services/amo/amo-base.js | 5 +++-- services/amo/amo-downloads.service.js | 5 +++-- services/amo/amo-rating.service.js | 4 +++- services/amo/amo-users.service.js | 3 ++- services/amo/amo-version.service.js | 3 ++- services/bit/bit-components.service.js | 2 +- services/coincap/coincap-base.js | 5 ++++- services/coincap/coincap-changepercent24hr.service.js | 3 ++- services/coincap/coincap-priceusd.service.js | 3 ++- services/coincap/coincap-rank.service.js | 3 ++- services/conan/conan-version.service.js | 1 + services/cpan/cpan-license.service.js | 3 ++- services/cpan/cpan-version.service.js | 3 ++- services/cpan/cpan.js | 5 +++++ 14 files changed, 34 insertions(+), 14 deletions(-) diff --git a/services/amo/amo-base.js b/services/amo/amo-base.js index d24f44e63a916..36771f8a6ea92 100644 --- a/services/amo/amo-base.js +++ b/services/amo/amo-base.js @@ -2,7 +2,8 @@ import Joi from 'joi' import { nonNegativeInteger } from '../validators.js' import { BaseJsonService } from '../index.js' -const keywords = ['amo', 'firefox'] +const description = + '[addons.mozilla.org](https://addons.mozilla.org) (AMO) publishes extensions for Mozilla Firefox' const schema = Joi.object({ average_daily_users: nonNegativeInteger, @@ -26,4 +27,4 @@ class BaseAmoService extends BaseJsonService { } } -export { BaseAmoService, keywords } +export { BaseAmoService, description } diff --git a/services/amo/amo-downloads.service.js b/services/amo/amo-downloads.service.js index d8ca97447c50d..1459a0a72a25b 100644 --- a/services/amo/amo-downloads.service.js +++ b/services/amo/amo-downloads.service.js @@ -1,8 +1,9 @@ import { renderDownloadsBadge } from '../downloads.js' import { redirector, pathParams } from '../index.js' -import { BaseAmoService } from './amo-base.js' +import { BaseAmoService, description as baseDescription } from './amo-base.js' + +const description = `${baseDescription} -const description = ` Previously \`amo/d\` provided a “total downloads” badge. However, [updates to the v3 API](https://github.com/badges/shields/issues/3079) only give us weekly downloads. The route \`amo/d\` redirects to \`amo/dw\`. diff --git a/services/amo/amo-rating.service.js b/services/amo/amo-rating.service.js index 5930c1dd0f38b..2569881c169ea 100644 --- a/services/amo/amo-rating.service.js +++ b/services/amo/amo-rating.service.js @@ -1,7 +1,7 @@ import { starRating } from '../text-formatters.js' import { floorCount as floorCountColor } from '../color-formatters.js' import { pathParams } from '../index.js' -import { BaseAmoService } from './amo-base.js' +import { BaseAmoService, description } from './amo-base.js' export default class AmoRating extends BaseAmoService { static category = 'rating' @@ -11,12 +11,14 @@ export default class AmoRating extends BaseAmoService { '/amo/rating/{addonId}': { get: { summary: 'Mozilla Add-on Rating', + description, parameters: pathParams({ name: 'addonId', example: 'dustman' }), }, }, '/amo/stars/{addonId}': { get: { summary: 'Mozilla Add-on Stars', + description, parameters: pathParams({ name: 'addonId', example: 'dustman' }), }, }, diff --git a/services/amo/amo-users.service.js b/services/amo/amo-users.service.js index 0a4b4be526dd7..cd850b2b597bd 100644 --- a/services/amo/amo-users.service.js +++ b/services/amo/amo-users.service.js @@ -1,6 +1,6 @@ import { renderDownloadsBadge } from '../downloads.js' import { pathParams } from '../index.js' -import { BaseAmoService } from './amo-base.js' +import { BaseAmoService, description } from './amo-base.js' export default class AmoUsers extends BaseAmoService { static category = 'downloads' @@ -10,6 +10,7 @@ export default class AmoUsers extends BaseAmoService { '/amo/users/{addonId}': { get: { summary: 'Mozilla Add-on Users', + description, parameters: pathParams({ name: 'addonId', example: 'dustman' }), }, }, diff --git a/services/amo/amo-version.service.js b/services/amo/amo-version.service.js index 219692437d0d4..50f74f8c5b28f 100644 --- a/services/amo/amo-version.service.js +++ b/services/amo/amo-version.service.js @@ -1,6 +1,6 @@ import { renderVersionBadge } from '../version.js' import { pathParams } from '../index.js' -import { BaseAmoService } from './amo-base.js' +import { BaseAmoService, description } from './amo-base.js' export default class AmoVersion extends BaseAmoService { static category = 'version' @@ -10,6 +10,7 @@ export default class AmoVersion extends BaseAmoService { '/amo/v/{addonId}': { get: { summary: 'Mozilla Add-on Version', + description, parameters: pathParams({ name: 'addonId', example: 'dustman' }), }, }, diff --git a/services/bit/bit-components.service.js b/services/bit/bit-components.service.js index 7b40a08e4ede7..683882da9cbf4 100644 --- a/services/bit/bit-components.service.js +++ b/services/bit/bit-components.service.js @@ -20,7 +20,7 @@ export default class BitComponents extends BaseJsonService { static openApi = { '/bit/collection/total-components/{owner}/{collection}': { get: { - summary: 'Bit', + summary: 'Bit Components', parameters: pathParams( { name: 'owner', diff --git a/services/coincap/coincap-base.js b/services/coincap/coincap-base.js index d602fb252954e..b8e6581073482 100644 --- a/services/coincap/coincap-base.js +++ b/services/coincap/coincap-base.js @@ -1,5 +1,8 @@ import { BaseJsonService } from '../index.js' +const description = + '[Coincap](https://coincap.io/) is a cryptocurrency exchange' + export default class BaseCoincapService extends BaseJsonService { static category = 'other' @@ -19,4 +22,4 @@ export default class BaseCoincapService extends BaseJsonService { } } -export { BaseCoincapService } +export { BaseCoincapService, description } diff --git a/services/coincap/coincap-changepercent24hr.service.js b/services/coincap/coincap-changepercent24hr.service.js index 2906cc7634943..6cb5a19b86152 100644 --- a/services/coincap/coincap-changepercent24hr.service.js +++ b/services/coincap/coincap-changepercent24hr.service.js @@ -1,7 +1,7 @@ import Joi from 'joi' import { pathParams } from '../index.js' import { floorCount } from '../color-formatters.js' -import BaseCoincapService from './coincap-base.js' +import { BaseCoincapService, description } from './coincap-base.js' const schema = Joi.object({ data: Joi.object({ @@ -19,6 +19,7 @@ export default class CoincapChangePercent24HrUsd extends BaseCoincapService { '/coincap/change-percent-24hr/{assetId}': { get: { summary: 'Coincap (Change Percent 24Hr)', + description, parameters: pathParams({ name: 'assetId', example: 'bitcoin', diff --git a/services/coincap/coincap-priceusd.service.js b/services/coincap/coincap-priceusd.service.js index f594c68415858..1ca6e9187b5d2 100644 --- a/services/coincap/coincap-priceusd.service.js +++ b/services/coincap/coincap-priceusd.service.js @@ -1,6 +1,6 @@ import Joi from 'joi' import { pathParams } from '../index.js' -import BaseCoincapService from './coincap-base.js' +import { BaseCoincapService, description } from './coincap-base.js' const schema = Joi.object({ data: Joi.object({ @@ -18,6 +18,7 @@ export default class CoincapPriceUsd extends BaseCoincapService { '/coincap/price-usd/{assetId}': { get: { summary: 'Coincap (Price USD)', + description, parameters: pathParams({ name: 'assetId', example: 'bitcoin', diff --git a/services/coincap/coincap-rank.service.js b/services/coincap/coincap-rank.service.js index 7566b3314e8f1..75e2d017f3c48 100644 --- a/services/coincap/coincap-rank.service.js +++ b/services/coincap/coincap-rank.service.js @@ -1,6 +1,6 @@ import Joi from 'joi' import { pathParams } from '../index.js' -import BaseCoincapService from './coincap-base.js' +import { BaseCoincapService, description } from './coincap-base.js' const schema = Joi.object({ data: Joi.object({ @@ -18,6 +18,7 @@ export default class CoincapRank extends BaseCoincapService { '/coincap/rank/{assetId}': { get: { summary: 'Coincap (Rank)', + description, parameters: pathParams({ name: 'assetId', example: 'bitcoin', diff --git a/services/conan/conan-version.service.js b/services/conan/conan-version.service.js index 6bbdb1c945450..2b5acef3406d2 100644 --- a/services/conan/conan-version.service.js +++ b/services/conan/conan-version.service.js @@ -13,6 +13,7 @@ export default class ConanVersion extends ConditionalGithubAuthV3Service { '/conan/v/{packageName}': { get: { summary: 'Conan Center', + description: '[Conan](https://conan.io/) is a package manager for C++', parameters: pathParams({ name: 'packageName', example: 'boost', diff --git a/services/cpan/cpan-license.service.js b/services/cpan/cpan-license.service.js index 9f1af2fa04748..d67c721a50f86 100644 --- a/services/cpan/cpan-license.service.js +++ b/services/cpan/cpan-license.service.js @@ -1,5 +1,5 @@ import { pathParams } from '../index.js' -import BaseCpanService from './cpan.js' +import { BaseCpanService, description } from './cpan.js' export default class CpanLicense extends BaseCpanService { static category = 'license' @@ -9,6 +9,7 @@ export default class CpanLicense extends BaseCpanService { '/cpan/l/{packageName}': { get: { summary: 'CPAN License', + description, parameters: pathParams({ name: 'packageName', example: 'Config-Augeas', diff --git a/services/cpan/cpan-version.service.js b/services/cpan/cpan-version.service.js index 5964f2955add6..6971a3df814c2 100644 --- a/services/cpan/cpan-version.service.js +++ b/services/cpan/cpan-version.service.js @@ -1,6 +1,6 @@ import { pathParams } from '../index.js' import { renderVersionBadge } from '../version.js' -import BaseCpanService from './cpan.js' +import { BaseCpanService, description } from './cpan.js' export default class CpanVersion extends BaseCpanService { static category = 'version' @@ -10,6 +10,7 @@ export default class CpanVersion extends BaseCpanService { '/cpan/v/{packageName}': { get: { summary: 'CPAN Version', + description, parameters: pathParams({ name: 'packageName', example: 'Config-Augeas', diff --git a/services/cpan/cpan.js b/services/cpan/cpan.js index 96d0c4c941332..de24f4d7ddbfa 100644 --- a/services/cpan/cpan.js +++ b/services/cpan/cpan.js @@ -6,6 +6,9 @@ const schema = Joi.object({ license: Joi.array().items(Joi.string()).min(1).required(), }).required() +const description = + '[CPAN](https://www.cpan.org/) is a package registry for Perl' + export default class BaseCpanService extends BaseJsonService { static defaultBadgeData = { label: 'cpan' } @@ -14,3 +17,5 @@ export default class BaseCpanService extends BaseJsonService { return this._requestJson({ schema, url }) } } + +export { BaseCpanService, description }