| 12345678910111213141516171819202122 |
- function reportArtifactUrl(item = {}, kind) {
- if (kind === 'background') return item.backgroundReportUrl || ''
- if (kind === 'professional') return item.professionalReportUrl || ''
- if (kind === 'public') return item.publicReportUrl || item.fileUrl || ''
- return ''
- }
- function reportArtifactLinks(item = {}) {
- return {
- background: reportArtifactUrl(item, 'background'),
- professional: reportArtifactUrl(item, 'professional'),
- public: reportArtifactUrl(item, 'public')
- }
- }
- function reportArtifactDownloadUrl(url) {
- if (!url) return ''
- const separator = url.indexOf('?') >= 0 ? '&' : '?'
- return `${url}${separator}_download=${Date.now()}`
- }
- module.exports = { reportArtifactUrl, reportArtifactLinks, reportArtifactDownloadUrl }
|