migrate examples to openApi part 13; affects [curseforge date fedora hsts modrinth ore] (#9499)

* migrate some services from examples to openApi

* improve and de-dupe service titles

* improve ore description
This commit is contained in:
chris48s
2023-12-04 12:53:21 +00:00
committed by GitHub
parent be6598623e
commit 5d1ddbc3fe
19 changed files with 226 additions and 161 deletions

View File

@@ -1,7 +1,7 @@
import { formatRelativeDate } from '../text-formatters.js'
import { BaseService } from '../index.js'
import { BaseService, pathParams } from '../index.js'
const documentation = `
const description = `
<p>
Supply a unix timestamp in seconds to display the relative time from/to now
</p>
@@ -11,16 +11,18 @@ export default class Date extends BaseService {
static category = 'other'
static route = { base: 'date', pattern: ':timestamp(-?[0-9]+)' }
static examples = [
{
title: 'Relative date',
pattern: ':timestamp',
namedParams: { timestamp: '1540814400' },
staticPreview: this.render({ relativeDateString: '2 days ago' }),
keywords: ['time', 'countdown', 'countup', 'moment'],
documentation,
static openApi = {
'/date/{timestamp}': {
get: {
summary: 'Relative date',
description,
parameters: pathParams({
name: 'timestamp',
example: '1540814400',
}),
},
},
]
}
static defaultBadgeData = { label: 'date' }