* 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 { versionColorForRangeCurrent } from './node-version-color.js'
|
|
|
|
const description = `<p>This badge indicates whether the package supports the <b>latest</b> release of node.</p>
|
|
<p>The node version support is retrieved from the <code>engines.node</code> section in package.json.</p>`
|
|
|
|
export default class NodeCurrentVersion extends NodeVersionBase {
|
|
static route = this.buildRoute('node/v', { withTag: true })
|
|
|
|
static defaultBadgeData = {
|
|
label: 'node',
|
|
}
|
|
|
|
static type = 'current'
|
|
|
|
static colorResolver = versionColorForRangeCurrent
|
|
|
|
static openApi = {
|
|
'/node/v/{packageName}': {
|
|
get: {
|
|
summary: 'Node Current',
|
|
description,
|
|
parameters: [
|
|
pathParam({
|
|
name: 'packageName',
|
|
example: 'passport',
|
|
description: packageNameDescription,
|
|
}),
|
|
queryParam({
|
|
name: 'registry_uri',
|
|
example: 'https://registry.npmjs.com',
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
'/node/v/{packageName}/{tag}': {
|
|
get: {
|
|
summary: 'Node Current (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',
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
}
|
|
}
|