* you missed one * remove examples from deprecatedService() I'm not going to replace this with openApi We have zero examples of deprecated services that declare examples * remove examples from redirector() * update test * remove compatibility code for converting examples to openApi * remove all the code for handling examples * remove a few bits of redundant code * improve docs for openApi property * last one, I promise
61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
import { pathParam, queryParam } from '../index.js'
|
|
import { packageNameDescription } from '../npm/npm-base.js'
|
|
import NodeVersionBase from './node-base.js'
|
|
import { versionColorForRangeLts } from './node-version-color.js'
|
|
|
|
const description = `<p>This badge indicates whether the package supports <b>all</b> LTS node versions.</p>
|
|
<p>The node version support is retrieved from the <code>engines.node</code> section in package.json.</p>`
|
|
|
|
export default class NodeLtsVersion extends NodeVersionBase {
|
|
static route = this.buildRoute('node/v-lts', { withTag: true })
|
|
|
|
static defaultBadgeData = {
|
|
label: 'node-lts',
|
|
}
|
|
|
|
static type = 'lts'
|
|
|
|
static colorResolver = versionColorForRangeLts
|
|
|
|
static openApi = {
|
|
'/node/v-lts/{packageName}': {
|
|
get: {
|
|
summary: 'Node LTS',
|
|
description,
|
|
parameters: [
|
|
pathParam({
|
|
name: 'packageName',
|
|
example: 'passport',
|
|
description: packageNameDescription,
|
|
}),
|
|
queryParam({
|
|
name: 'registry_uri',
|
|
example: 'https://registry.npmjs.com',
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
'/node/v-lts/{packageName}/{tag}': {
|
|
get: {
|
|
summary: 'Node LTS (with tag)',
|
|
description,
|
|
parameters: [
|
|
pathParam({
|
|
name: 'packageName',
|
|
example: 'passport',
|
|
description: packageNameDescription,
|
|
}),
|
|
pathParam({
|
|
name: 'tag',
|
|
example: 'latest',
|
|
}),
|
|
queryParam({
|
|
name: 'registry_uri',
|
|
example: 'https://registry.npmjs.com',
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
}
|
|
}
|