Files
shields/services/azure-devops/vso-redirect.service.js
Caleb Cartwright 726830f067 Add ability to transform query params in redirct service, run [Endpoint GitHubReleaseRedirect SensioLabs VSO] (#3125)
* feat(redirector): added transformQueryParams to redirector

* refactor: renamed to transformPath in redirector

* Rename targetUrl to targetPath

Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>

* feat(redirector): handle param conflicts
2019-03-04 18:11:37 -06:00

32 lines
885 B
JavaScript

'use strict'
const { redirector } = require('..')
module.exports = [
redirector({
category: 'build',
route: {
base: 'vso/build',
pattern: ':organization/:projectId/:definitionId/:branch*',
},
transformPath: ({ organization, projectId, definitionId, branch }) => {
let path = `/azure-devops/build/${organization}/${projectId}/${definitionId}`
if (branch) {
path += `/${branch}`
}
return path
},
dateAdded: new Date('2019-02-08'),
}),
redirector({
category: 'build',
route: {
base: 'vso/release',
pattern: ':organization/:projectId/:definitionId/:environmentId',
},
transformPath: ({ organization, projectId, definitionId, environmentId }) =>
`/azure-devops/release/${organization}/${projectId}/${definitionId}/${environmentId}`,
dateAdded: new Date('2019-02-08'),
}),
]