@pnpm/audit
Advanced tools
Comparing version 2.0.1 to 2.1.0
# @pnpm/audit | ||
## 2.1.0 | ||
### Minor Changes | ||
- 05baaa6e7: Add new option: timeout. | ||
### Patch Changes | ||
- Updated dependencies [05baaa6e7] | ||
- Updated dependencies [97c64bae4] | ||
- @pnpm/fetch@3.1.0 | ||
- @pnpm/types@7.1.0 | ||
- @pnpm/lockfile-utils@3.0.2 | ||
- @pnpm/lockfile-walker@4.0.2 | ||
## 2.0.1 | ||
@@ -4,0 +19,0 @@ |
@@ -12,2 +12,3 @@ import { RetryTimeoutOptions } from '@pnpm/fetch'; | ||
retry?: RetryTimeoutOptions; | ||
timeout?: number; | ||
}): Promise<AuditReport>; |
@@ -21,6 +21,6 @@ "use strict"; | ||
async function audit(lockfile, opts) { | ||
const auditTree = (0, lockfileToAuditTree_1.default)(lockfile, { include: opts.include }); | ||
const auditTree = lockfileToAuditTree_1.default(lockfile, { include: opts.include }); | ||
const registry = opts.registry.endsWith('/') ? opts.registry : `${opts.registry}/`; | ||
const auditUrl = `${registry}-/npm/v1/security/audits`; | ||
const res = await (0, fetch_1.default)(auditUrl, { | ||
const res = await fetch_1.default(auditUrl, { | ||
body: JSON.stringify(auditTree), | ||
@@ -30,2 +30,3 @@ headers: { 'Content-Type': 'application/json' }, | ||
retry: opts.retry, | ||
timeout: opts.timeout, | ||
}); | ||
@@ -32,0 +33,0 @@ if (res.status !== 200) { |
@@ -6,3 +6,3 @@ "use strict"; | ||
function lockfileToAuditTree(lockfile, opts) { | ||
const importerWalkers = (0, lockfile_walker_1.lockfileWalkerGroupImporterSteps)(lockfile, Object.keys(lockfile.importers), { include: opts === null || opts === void 0 ? void 0 : opts.include }); | ||
const importerWalkers = lockfile_walker_1.lockfileWalkerGroupImporterSteps(lockfile, Object.keys(lockfile.importers), { include: opts === null || opts === void 0 ? void 0 : opts.include }); | ||
const dependencies = {}; | ||
@@ -34,3 +34,3 @@ importerWalkers.forEach((importerWalker) => { | ||
for (const { depPath, pkgSnapshot, next } of step.dependencies) { | ||
const { name, version } = (0, lockfile_utils_1.nameVerFromPkgSnapshot)(depPath, pkgSnapshot); | ||
const { name, version } = lockfile_utils_1.nameVerFromPkgSnapshot(depPath, pkgSnapshot); | ||
const subdeps = lockfileToAuditNode(next()); | ||
@@ -37,0 +37,0 @@ const dep = { |
{ | ||
"name": "@pnpm/audit", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Audit a lockfile", | ||
@@ -14,9 +14,2 @@ "main": "lib/index.js", | ||
}, | ||
"scripts": { | ||
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts", | ||
"_test": "jest", | ||
"test": "pnpm run compile && pnpm run _test", | ||
"prepublishOnly": "pnpm run compile", | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix" | ||
}, | ||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/audit", | ||
@@ -34,3 +27,3 @@ "keywords": [ | ||
"@pnpm/constants": "5.0.0", | ||
"@pnpm/lockfile-file": "4.0.0", | ||
"@pnpm/lockfile-file": "4.0.1", | ||
"nock": "12.0.3" | ||
@@ -40,9 +33,15 @@ }, | ||
"@pnpm/error": "2.0.0", | ||
"@pnpm/fetch": "3.0.0", | ||
"@pnpm/fetch": "3.1.0", | ||
"@pnpm/lockfile-types": "3.0.0", | ||
"@pnpm/lockfile-utils": "3.0.1", | ||
"@pnpm/lockfile-walker": "4.0.1", | ||
"@pnpm/types": "7.0.0" | ||
"@pnpm/lockfile-utils": "3.0.2", | ||
"@pnpm/lockfile-walker": "4.0.2", | ||
"@pnpm/types": "7.1.0" | ||
}, | ||
"funding": "https://opencollective.com/pnpm" | ||
"funding": "https://opencollective.com/pnpm", | ||
"scripts": { | ||
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts", | ||
"_test": "jest", | ||
"test": "pnpm run compile && pnpm run _test", | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix" | ||
} | ||
} |
12975
206
+ Added@pnpm/core-loggers@6.0.1(transitive)
+ Added@pnpm/fetch@3.1.0(transitive)
+ Added@pnpm/fetching-types@2.1.0(transitive)
+ Added@pnpm/lockfile-utils@3.0.2(transitive)
+ Added@pnpm/lockfile-walker@4.0.2(transitive)
+ Added@pnpm/resolver-base@8.0.1(transitive)
+ Added@pnpm/types@7.1.0(transitive)
+ Addeddependency-path@7.0.1(transitive)
- Removed@pnpm/core-loggers@6.0.0(transitive)
- Removed@pnpm/fetch@3.0.0(transitive)
- Removed@pnpm/fetching-types@2.0.0(transitive)
- Removed@pnpm/lockfile-utils@3.0.1(transitive)
- Removed@pnpm/lockfile-walker@4.0.1(transitive)
- Removed@pnpm/resolver-base@8.0.0(transitive)
- Removed@pnpm/types@7.0.0(transitive)
- Removeddependency-path@7.0.0(transitive)
Updated@pnpm/fetch@3.1.0
Updated@pnpm/lockfile-utils@3.0.2
Updated@pnpm/lockfile-walker@4.0.2
Updated@pnpm/types@7.1.0