diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/lib/access.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/lib/access.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/lib/access.js b/deps/npm/node_modules/npm-registry-client/lib/access.js index d8d65a9442a..caa80b12191 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/access.js +++ b/deps/npm/node_modules/npm-registry-client/lib/access.js @@ -16,6 +16,12 @@ subcommands.public = function (uri, params, cb) { subcommands.restricted = function (uri, params, cb) { return setAccess.call(this, 'restricted', uri, params, cb) } +subcommands['2fa-required'] = function (uri, params, cb) { + return setRequires2fa.call(this, true, uri, params, cb) +} +subcommands['2fa-not-required'] = function (uri, params, cb) { + return setRequires2fa.call(this, false, uri, params, cb) +} function setAccess (access, uri, params, cb) { return this.request(apiUri(uri, 'package', params.package, 'access'), { @@ -25,6 +31,14 @@ function setAccess (access, uri, params, cb) { }, cb) } +function setRequires2fa (requires2fa, uri, params, cb) { + return this.request(apiUri(uri, 'package', params.package, 'access'), { + method: 'POST', + auth: params.auth, + body: JSON.stringify({ publish_requires_tfa: requires2fa }) + }, cb) +} + subcommands.grant = function (uri, params, cb) { var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') return this.request(reqUri, { |