summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/npm-audit-report
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/node_modules/npm-audit-report')
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/CHANGELOG.md76
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/LICENSE16
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/README.md40
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/index.js25
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/lib/utils.js60
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/package.json80
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/reporters/detail.js197
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/reporters/install.js61
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/reporters/json.js17
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/reporters/parseable.js99
-rw-r--r--deps/node/deps/npm/node_modules/npm-audit-report/reporters/quiet.js14
11 files changed, 0 insertions, 685 deletions
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/CHANGELOG.md b/deps/node/deps/npm/node_modules/npm-audit-report/CHANGELOG.md
deleted file mode 100644
index 941a1874..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/CHANGELOG.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-<a name="1.3.2"></a>
-## [1.3.2](https://github.com/npm/npm-audit-report/compare/v1.3.1...v1.3.2) (2018-12-18)
-
-
-### Bug Fixes
-
-* **parseable:** add support for critical vulns and more resolves on update/install action ([#28](https://github.com/npm/npm-audit-report/issues/28)) ([5e27893](https://github.com/npm/npm-audit-report/commit/5e27893))
-* **security:** audit fix ([ff9faf3](https://github.com/npm/npm-audit-report/commit/ff9faf3))
-* **urls:** Replace hardcoded URL to advisory with a URL from audit response ([#34](https://github.com/npm/npm-audit-report/issues/34)) ([e2fe95b](https://github.com/npm/npm-audit-report/commit/e2fe95b))
-
-
-
-<a name="1.3.1"></a>
-## [1.3.1](https://github.com/npm/npm-audit-report/compare/v1.3.0...v1.3.1) (2018-07-10)
-
-
-
-<a name="1.3.0"></a>
-# [1.3.0](https://github.com/npm/npm-audit-report/compare/v1.2.1...v1.3.0) (2018-07-09)
-
-
-### Bug Fixes
-
-* **deps:** remove object.values dependency ([2c5374a](https://github.com/npm/npm-audit-report/commit/2c5374a))
-* **detail:** Fix info-level severity ([#18](https://github.com/npm/npm-audit-report/issues/18)) ([807db5a](https://github.com/npm/npm-audit-report/commit/807db5a))
-* **tests:** a test should not cause side-effects in other tests ([#23](https://github.com/npm/npm-audit-report/issues/23)) ([a94449f](https://github.com/npm/npm-audit-report/commit/a94449f))
-
-
-### Features
-
-* **output:** add `parseable` tabular output format support ([#21](https://github.com/npm/npm-audit-report/issues/21)) ([1c9aaf4](https://github.com/npm/npm-audit-report/commit/1c9aaf4))
-
-
-
-<a name="1.2.1"></a>
-## [1.2.1](https://github.com/npm/npm-audit-report/compare/v1.2.0...v1.2.1) (2018-05-17)
-
-
-### Bug Fixes
-
-* **detail:** count id+path instead of just id ([99880fd](https://github.com/npm/npm-audit-report/commit/99880fd))
-
-
-
-<a name="1.2.0"></a>
-# [1.2.0](https://github.com/npm/npm-audit-report/compare/v1.1.0...v1.2.0) (2018-05-16)
-
-
-### Bug Fixes
-
-* **full-report:** Fix install flag for devDependencies ([#14](https://github.com/npm/npm-audit-report/issues/14)) ([30e5f30](https://github.com/npm/npm-audit-report/commit/30e5f30))
-
-
-### Features
-
-* **detail:** consistified full report with install report ([#15](https://github.com/npm/npm-audit-report/issues/15)) ([6df6810](https://github.com/npm/npm-audit-report/commit/6df6810))
-* **install:** include `npm audit` recommendation too ([32fb153](https://github.com/npm/npm-audit-report/commit/32fb153))
-
-
-
-<a name="1.1.0"></a>
-# [1.1.0](https://github.com/npm/npm-audit-report/compare/v1.0.9...v1.1.0) (2018-05-10)
-
-
-### Bug Fixes
-
-* **install:** not enough data for this conditional ([6ddc30c](https://github.com/npm/npm-audit-report/commit/6ddc30c))
-
-
-### Features
-
-* **report:** compress and reformat human-readable install report ([74d5203](https://github.com/npm/npm-audit-report/commit/74d5203))
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/LICENSE b/deps/node/deps/npm/node_modules/npm-audit-report/LICENSE
deleted file mode 100644
index 8d28acf8..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-ISC License
-
-Copyright (c) npm, Inc.
-
-Permission to use, copy, modify, and/or distribute this software for
-any purpose with or without fee is hereby granted, provided that the
-above copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
-USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/README.md b/deps/node/deps/npm/node_modules/npm-audit-report/README.md
deleted file mode 100644
index 1d1697f4..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# npm audit security report
-
-Given a response from the npm security api, render it into a variety of security reports
-
-[![Build Status](https://travis-ci.org/npm/npm-audit-report.svg?branch=master)](https://travis-ci.org/npm/npm-audit-report)
-[![Build status](https://ci.appveyor.com/api/projects/status/qictiokvxmqkiuvi/branch/master?svg=true)](https://ci.appveyor.com/project/evilpacket/npm-audit-report/branch/master)
-[![Coverage Status](https://coveralls.io/repos/github/npm/npm-audit-report/badge.svg?branch=master)](https://coveralls.io/github/npm/npm-audit-report?branch=master)
-
-The response is an object that contains an output string (the report) and a suggested exitCode.
-```
-{
- report: 'string that contains the security report',
- exit: 1
-}
-```
-
-
-## Basic usage example
-
-```
-'use strict'
-const Report = require('npm-audit-report')
-const options = {
- reporter: 'json'
-}
-
-Report(response, options, (result) => {
- console.log(result.report)
- process.exitCode = result.exitCode
-})
-```
-
-
-## options
-
-| option | values | default | description |
-| :--- | :--- | :--- |:--- |
-| reporter     | `install`, `detail`, `json`, `quiet` | `install` | specify which output format you want to use |
-| withColor     | `true`, `false`   | `true`   | indicates if some report elements should use colors |
-| withUnicode   | `true`, `false`                  | `true` | indicates if unicode characters should be used| \ No newline at end of file
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/index.js b/deps/node/deps/npm/node_modules/npm-audit-report/index.js
deleted file mode 100644
index 4f9f5d67..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict'
-
-const reporters = {
- install: require('./reporters/install'),
- parseable: require('./reporters/parseable'),
- detail: require('./reporters/detail'),
- json: require('./reporters/json'),
- quiet: require('./reporters/quiet')
-}
-
-const report = function (data, options) {
- const defaults = {
- reporter: 'install',
- withColor: true,
- withUnicode: true
- }
-
- const config = Object.assign({}, defaults, options)
- return new Promise((resolve) => {
- const result = reporters[config.reporter](data, config)
- return resolve(result)
- })
-}
-
-module.exports = report
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/lib/utils.js b/deps/node/deps/npm/node_modules/npm-audit-report/lib/utils.js
deleted file mode 100644
index 3b521a5f..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/lib/utils.js
+++ /dev/null
@@ -1,60 +0,0 @@
-'use strict'
-
-exports.severityLabel = severityLabel
-exports.color = color
-exports.totalVulnCount = totalVulnCount
-exports.severities = severities
-
-const ccs = require('console-control-strings')
-
-const severityColors = {
- critical: {
- color: 'brightMagenta',
- label: 'Critical'
- },
- high: {
- color: 'brightRed',
- label: 'High'
- },
- moderate: {
- color: 'brightYellow',
- label: 'Moderate'
- },
- low: {
- color: 'bold',
- label: 'Low'
- },
- info: {
- color: '',
- label: 'Info'
- }
-}
-
-function color (value, colorName, withColor) {
- return (colorName && withColor) ? ccs.color(colorName) + value + ccs.color('reset') : value
-}
-
-function severityLabel (sev, withColor, bold) {
- if (!(sev in severityColors)) return sev.charAt(0).toUpperCase() + sev.substr(1).toLowerCase()
- let colorName = severityColors[sev].color
- if (bold) colorName = [colorName, 'bold']
- return color(severityColors[sev].label, colorName, withColor)
-}
-
-function totalVulnCount (vulns) {
- return Object.keys(vulns).reduce((accumulator, key) => {
- const vulnCount = vulns[key]
- accumulator += vulnCount
-
- return accumulator
- }, 0)
-}
-
-function severities (vulns) {
- return Object.keys(vulns).reduce((accumulator, severity) => {
- const vulnCount = vulns[severity]
- if (vulnCount > 0) accumulator.push([severity, vulnCount])
-
- return accumulator
- }, [])
-}
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/package.json b/deps/node/deps/npm/node_modules/npm-audit-report/package.json
deleted file mode 100644
index 905c0ce3..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/package.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "_from": "npm-audit-report@1.3.2",
- "_id": "npm-audit-report@1.3.2",
- "_inBundle": false,
- "_integrity": "sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw==",
- "_location": "/npm-audit-report",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "npm-audit-report@1.3.2",
- "name": "npm-audit-report",
- "escapedName": "npm-audit-report",
- "rawSpec": "1.3.2",
- "saveSpec": null,
- "fetchSpec": "1.3.2"
- },
- "_requiredBy": [
- "#USER",
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.2.tgz",
- "_shasum": "303bc78cd9e4c226415076a4f7e528c89fc77018",
- "_spec": "npm-audit-report@1.3.2",
- "_where": "/Users/zkat/Documents/code/work/npm",
- "author": {
- "name": "Adam Baldwin"
- },
- "bugs": {
- "url": "https://github.com/npm/npm-audit-report/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "cli-table3": "^0.5.0",
- "console-control-strings": "^1.1.0"
- },
- "deprecated": false,
- "description": "Given a response from the npm security api, render it into a variety of security reports",
- "devDependencies": {
- "keyfob": "^1.0.0",
- "standard": "^11.0.1",
- "standard-version": "^4.3.0",
- "tap": "^11.1.5",
- "weallbehave": "^1.2.0",
- "weallcontribute": "^1.0.8"
- },
- "directories": {
- "lib": "lib",
- "test": "test"
- },
- "files": [
- "index.js",
- "lib",
- "reporters"
- ],
- "homepage": "https://github.com/npm/npm-audit-report#readme",
- "keywords": [
- "npm",
- "security",
- "report",
- "audit"
- ],
- "license": "ISC",
- "main": "index.js",
- "name": "npm-audit-report",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/npm/npm-audit-report.git"
- },
- "scripts": {
- "postrelease": "npm publish && git push --follow-tags",
- "prerelease": "npm t",
- "pretest": "standard",
- "release": "standard-version -s",
- "test": "tap --100 -J --coverage test/*.js",
- "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
- "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
- },
- "version": "1.3.2"
-}
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/detail.js b/deps/node/deps/npm/node_modules/npm-audit-report/reporters/detail.js
deleted file mode 100644
index f6e822eb..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/detail.js
+++ /dev/null
@@ -1,197 +0,0 @@
-'use strict'
-
-const summary = require('./install.js').summary
-const Table = require('cli-table3')
-const Utils = require('../lib/utils')
-
-const report = function (data, options) {
- const defaults = {
- severityThreshold: 'info'
- }
-
- const blankChars = {
- 'top': ' ',
- 'top-mid': ' ',
- 'top-left': ' ',
- 'top-right': ' ',
- 'bottom': ' ',
- 'bottom-mid': ' ',
- 'bottom-left': ' ',
- 'bottom-right': ' ',
- 'left': ' ',
- 'left-mid': ' ',
- 'mid': ' ',
- 'mid-mid': ' ',
- 'right': ' ',
- 'right-mid': ' ',
- 'middle': ' '
- }
-
- const config = Object.assign({}, defaults, options)
-
- let output = ''
- let exit = 0
-
- const log = function (value) {
- output = output + value + '\n'
- }
-
- const footer = function (data) {
- const total = Utils.totalVulnCount(data.metadata.vulnerabilities)
-
- if (total > 0) {
- exit = 1
- }
- log(`${summary(data, config)} in ${data.metadata.totalDependencies} scanned package${data.metadata.totalDependencies === 1 ? '' : 's'}`)
- if (total) {
- const counts = data.actions.reduce((acc, {action, isMajor, resolves}) => {
- if (action === 'update' || (action === 'install' && !isMajor)) {
- resolves.forEach(({id, path}) => acc.advisories.add(`${id}::${path}`))
- }
- if (isMajor) {
- resolves.forEach(({id, path}) => acc.major.add(`${id}::${path}`))
- }
- if (action === 'review') {
- resolves.forEach(({id, path}) => acc.review.add(`${id}::${path}`))
- }
- return acc
- }, {advisories: new Set(), major: new Set(), review: new Set()})
- if (counts.advisories.size) {
- log(` run \`npm audit fix\` to fix ${counts.advisories.size} of them.`)
- }
- if (counts.major.size) {
- const maj = counts.major.size
- log(` ${maj} vulnerabilit${maj === 1 ? 'y' : 'ies'} require${maj === 1 ? 's' : ''} semver-major dependency updates.`)
- }
- if (counts.review.size) {
- const rev = counts.review.size
- log(` ${rev} vulnerabilit${rev === 1 ? 'y' : 'ies'} require${rev === 1 ? 's' : ''} manual review. See the full report for details.`)
- }
- }
- }
-
- const reportTitle = function () {
- const tableOptions = {
- colWidths: [78]
- }
- tableOptions.chars = blankChars
- const table = new Table(tableOptions)
- table.push([{
- content: '=== npm audit security report ===',
- vAlign: 'center',
- hAlign: 'center'
- }])
- log(table.toString())
- }
-
- const actions = function (data, config) {
- reportTitle()
-
- if (Object.keys(data.advisories).length !== 0) {
- // vulns found display a report.
-
- let reviewFlag = false
-
- data.actions.forEach((action) => {
- if (action.action === 'update' || action.action === 'install') {
- const recommendation = getRecommendation(action, config)
- const label = action.resolves.length === 1 ? 'vulnerability' : 'vulnerabilities'
- log(`# Run ${Utils.color(' ' + recommendation.cmd + ' ', 'inverse', config.withColor)} to resolve ${action.resolves.length} ${label}`)
- if (recommendation.isBreaking) {
- log(`SEMVER WARNING: Recommended action is a potentially breaking change`)
- }
-
- action.resolves.forEach((resolution) => {
- const advisory = data.advisories[resolution.id]
- const tableOptions = {
- colWidths: [15, 62],
- wordWrap: true
- }
- if (!config.withUnicode) {
- tableOptions.chars = blankChars
- }
- const table = new Table(tableOptions)
-
- table.push(
- {[Utils.severityLabel(advisory.severity, config.withColor, true)]: Utils.color(advisory.title, 'bold', config.withColor)},
- {'Package': advisory.module_name},
- {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
- {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
- {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`}
- )
-
- log(table.toString() + '\n\n')
- })
- }
- if (action.action === 'review') {
- if (!reviewFlag) {
- const tableOptions = {
- colWidths: [78]
- }
- if (!config.withUnicode) {
- tableOptions.chars = blankChars
- }
- const table = new Table(tableOptions)
- table.push([{
- content: 'Manual Review\nSome vulnerabilities require your attention to resolve\n\nVisit https://go.npm.me/audit-guide for additional guidance',
- vAlign: 'center',
- hAlign: 'center'
- }])
-
- log(table.toString())
- }
- reviewFlag = true
-
- action.resolves.forEach((resolution) => {
- const advisory = data.advisories[resolution.id]
- const tableOptions = {
- colWidths: [15, 62],
- wordWrap: true
- }
- if (!config.withUnicode) {
- tableOptions.chars = blankChars
- }
- const table = new Table(tableOptions)
- const patchedIn = advisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : advisory.patched_versions
-
- table.push(
- {[Utils.severityLabel(advisory.severity, config.withColor, true)]: Utils.color(advisory.title, 'bold', config.withColor)},
- {'Package': advisory.module_name},
- {'Patched in': patchedIn},
- {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`},
- {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`},
- {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`}
- )
- log(table.toString())
- })
- }
- })
- }
- }
-
- actions(data, config)
- footer(data)
-
- return {
- report: output.trim(),
- exitCode: exit
- }
-}
-
-const getRecommendation = function (action, config) {
- if (action.action === 'install') {
- const isDev = action.resolves[0].dev
-
- return {
- cmd: `npm install ${isDev ? '--save-dev ' : ''}${action.module}@${action.target}`,
- isBreaking: action.isMajor
- }
- } else {
- return {
- cmd: `npm update ${action.module} --depth ${action.depth}`,
- isBreaking: false
- }
- }
-}
-
-module.exports = report
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/install.js b/deps/node/deps/npm/node_modules/npm-audit-report/reporters/install.js
deleted file mode 100644
index 96ea12bd..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/install.js
+++ /dev/null
@@ -1,61 +0,0 @@
-'use strict'
-
-const Utils = require('../lib/utils')
-
-module.exports = report
-function report (data, options) {
- let msg = summary(data, options)
- if (!Object.keys(data.advisories).length) {
- return {
- report: msg,
- exitCode: 0
- }
- } else {
- msg += '\n run `npm audit fix` to fix them, or `npm audit` for details'
- return {
- report: msg,
- exitCode: 1
- }
- }
-}
-
-module.exports.summary = summary
-function summary (data, options) {
- const defaults = {
- severityThreshold: 'info'
- }
-
- const config = Object.assign({}, defaults, options)
-
- function clr (str, clr) { return Utils.color(str, clr, config.withColor) }
- function green (str) { return clr(str, 'brightGreen') }
- function red (str) { return clr(str, 'brightRed') }
-
- let output = ''
-
- const log = function (value) {
- output = output + value + '\n'
- }
-
- output += 'found '
-
- if (Object.keys(data.advisories).length === 0) {
- log(`${green('0')} vulnerabilities`)
- return output
- } else {
- const total = Utils.totalVulnCount(data.metadata.vulnerabilities)
- const sev = Utils.severities(data.metadata.vulnerabilities)
-
- if (sev.length > 1) {
- const severities = sev.map((value) => {
- return `${value[1]} ${Utils.severityLabel(value[0], config.withColor).toLowerCase()}`
- }).join(', ')
- log(`${red(total)} vulnerabilities (${severities})`)
- } else {
- const vulnCount = sev[0][1]
- const vulnLabel = Utils.severityLabel(sev[0][0], config.withColor).toLowerCase()
- log(`${vulnCount} ${vulnLabel} severity vulnerabilit${vulnCount === 1 ? 'y' : 'ies'}`)
- }
- }
- return output.trim()
-}
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/json.js b/deps/node/deps/npm/node_modules/npm-audit-report/reporters/json.js
deleted file mode 100644
index 6bf5097e..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/json.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict'
-
-const report = function (data, options) {
- const defaults = {
- indent: 2
- }
-
- const config = Object.assign({}, defaults, options)
-
- const json = JSON.stringify(data, null, config.indent)
- return {
- report: json,
- exitCode: 0
- }
-}
-
-module.exports = report
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/parseable.js b/deps/node/deps/npm/node_modules/npm-audit-report/reporters/parseable.js
deleted file mode 100644
index 1d46ef22..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/parseable.js
+++ /dev/null
@@ -1,99 +0,0 @@
-'use strict'
-
-const report = function (data, options) {
- const defaults = {
- severityThreshold: 'info'
- }
-
- const config = Object.assign({}, defaults, options)
-
- let exit = 0
-
- const actions = function (data, config) {
- let accumulator = {
- critical: '',
- high: '',
- moderate: '',
- low: ''
- }
-
- if (Object.keys(data.advisories).length !== 0) {
- data.actions.forEach((action) => {
- let l = {}
- // Start with install/update actions
- if (action.action === 'update' || action.action === 'install') {
- const recommendation = getRecommendation(action, config)
- l.recommendation = recommendation.cmd
- l.breaking = recommendation.isBreaking ? 'Y' : 'N'
-
- action.resolves.forEach((resolution) => {
- const advisory = data.advisories[resolution.id]
-
- l.sevLevel = advisory.severity
- l.severity = advisory.title
- l.package = advisory.module_name
- l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`
- l.path = resolution.path
-
- accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.recommendation, l.severity, l.moreInfo, l.path, l.breaking]
- .join('\t') + '\n'
- }) // forEach resolves
- }
-
- if (action.action === 'review') {
- action.resolves.forEach((resolution) => {
- const advisory = data.advisories[resolution.id]
-
- l.sevLevel = advisory.severity
- l.severity = advisory.title
- l.package = advisory.module_name
- l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`
- l.patchedIn = advisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : advisory.patched_versions
- l.path = resolution.path
-
- accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.patchedIn, l.severity, l.moreInfo, l.path].join('\t') + '\n'
- }) // forEach resolves
- } // is review
- }) // forEach actions
- }
- return accumulator['critical'] + accumulator['high'] + accumulator['moderate'] + accumulator['low']
- }
-
- const exitCode = function (metadata) {
- let total = 0
- const keys = Object.keys(metadata.vulnerabilities)
- for (let key of keys) {
- const value = metadata.vulnerabilities[key]
- total = total + value
- }
-
- if (total > 0) {
- exit = 1
- }
- }
-
- exitCode(data.metadata)
-
- return {
- report: actions(data, config),
- exitCode: exit
- }
-}
-
-const getRecommendation = function (action, config) {
- if (action.action === 'install') {
- const isDev = action.resolves[0].dev
-
- return {
- cmd: `npm install ${isDev ? '--save-dev ' : ''}${action.module}@${action.target}`,
- isBreaking: action.isMajor
- }
- } else {
- return {
- cmd: `npm update ${action.module} --depth ${action.depth}`,
- isBreaking: false
- }
- }
-}
-
-module.exports = report
diff --git a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/quiet.js b/deps/node/deps/npm/node_modules/npm-audit-report/reporters/quiet.js
deleted file mode 100644
index d6f5c584..00000000
--- a/deps/node/deps/npm/node_modules/npm-audit-report/reporters/quiet.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-const Utils = require('../lib/utils')
-
-const report = function (data) {
- const totalVulnCount = Utils.totalVulnCount(data.metadata.vulnerabilities)
-
- return {
- report: '',
- exitCode: totalVulnCount === 0 ? 0 : 1
- }
-}
-
-module.exports = report