diff options
author | Rebecca Turner <me@re-becca.org> | 2016-10-20 12:54:56 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-10-20 13:42:47 +0300 |
commit | 846f61c1dd4a033f77aa736ab01c27ae6724fe1c (patch) | |
tree | 437319b5050aba53b3f9325c354fe760b198e6b0 /node_modules/npm-registry-client | |
parent | bc84012c2c615024b08868acbd8df53a7ca8d146 (diff) |
npm-registry-client@7.3.0
Credit: @iarna
PR-URL: https://github.com/npm/npm-registry-client/pull/129
PR-URL: https://github.com/npm/npm-registry-client/pull/145
Diffstat (limited to 'node_modules/npm-registry-client')
27 files changed, 110 insertions, 1134 deletions
diff --git a/node_modules/npm-registry-client/README.md b/node_modules/npm-registry-client/README.md index 9d81f4df3..e14159cd0 100644 --- a/node_modules/npm-registry-client/README.md +++ b/node_modules/npm-registry-client/README.md @@ -318,3 +318,11 @@ any): origin (unique combination of protocol:host:port). Passed to the [httpAgent](https://nodejs.org/api/http.html#http_agent_maxsockets). Default = 50 +* `isFromCI` {Boolean} Identify to severs if this request is coming from CI (for statistics purposes). + Default = detected from environment– primarily this is done by looking for + the CI environment variable to be set to `true`. Also accepted are the + existence of the `JENKINS_URL`, `bamboo.buildKey` and `TDDIUM` environment + variables. +* `scope` {String} The scope of the project this command is being run for. This is the + top level npm module in which a command was run. + Default = none diff --git a/node_modules/npm-registry-client/lib/initialize.js b/node_modules/npm-registry-client/lib/initialize.js index 3c12697f0..174d6470a 100644 --- a/node_modules/npm-registry-client/lib/initialize.js +++ b/node_modules/npm-registry-client/lib/initialize.js @@ -11,6 +11,11 @@ function initialize (uri, method, accept, headers) { this.config.sessionToken = crypto.randomBytes(8).toString('hex') this.log.verbose('request id', this.config.sessionToken) } + if (this.config.isFromCI == null) { + this.config.isFromCI = Boolean( + process.env['CI'] === 'true' || process.env['TDDIUM'] || + process.env['JENKINS_URL'] || process.env['bamboo.buildKey']) + } var opts = { url: uri, @@ -47,7 +52,11 @@ function initialize (uri, method, accept, headers) { if (this.refer) headers.referer = this.refer headers['npm-session'] = this.config.sessionToken + headers['npm-in-ci'] = String(this.config.isFromCI) headers['user-agent'] = this.config.userAgent + if (this.config.scope) { + headers['npm-scope'] = this.config.scope + } return opts } diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json index 362803be0..77e053e2f 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json @@ -10,31 +10,23 @@ "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" - ], - [ - { - "raw": "number-is-nan@^1.0.0", - "scope": null, - "escapedName": "number-is-nan", - "name": "number-is-nan", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" ] ], - "_from": "number-is-nan@^1.0.0", - "_id": "number-is-nan@1.0.0", + "_from": "number-is-nan@>=1.0.0 <2.0.0", + "_id": "number-is-nan@1.0.1", "_inCache": true, "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at/number-is-nan", - "_nodeVersion": "0.12.3", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/number-is-nan-1.0.1.tgz_1475212313367_0.9480371843092144" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.10.0", + "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { "raw": "number-is-nan@^1.0.0", @@ -48,11 +40,11 @@ "_requiredBy": [ "/npm-registry-client/npmlog/gauge/string-width/code-point-at" ], - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "_shasum": "097b602b53422a522c1afb8790318336941a011d", "_shrinkwrap": null, "_spec": "number-is-nan@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", + "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -62,14 +54,14 @@ "url": "https://github.com/sindresorhus/number-is-nan/issues" }, "dependencies": {}, - "description": "ES6 Number.isNaN() ponyfill", + "description": "ES2015 Number.isNaN() ponyfill", "devDependencies": { - "ava": "0.0.4" + "ava": "*" }, "directories": {}, "dist": { - "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + "shasum": "097b602b53422a522c1afb8790318336941a011d", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -77,13 +69,11 @@ "files": [ "index.js" ], - "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "gitHead": "ed9cdac3f428cc929b61bb230da42c87477af4b9", "homepage": "https://github.com/sindresorhus/number-is-nan#readme", "keywords": [ - "es6", "es2015", "ecmascript", - "harmony", "ponyfill", "polyfill", "shim", @@ -107,7 +97,7 @@ "url": "git+https://github.com/sindresorhus/number-is-nan.git" }, "scripts": { - "test": "node test.js" + "test": "ava" }, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md index 93d851a14..246350871 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md @@ -1,8 +1,6 @@ # number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) -> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method +> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) ## Install diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json index d602d507a..59e664346 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json @@ -10,31 +10,23 @@ "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" - ], - [ - { - "raw": "code-point-at@^1.0.0", - "scope": null, - "escapedName": "code-point-at", - "name": "code-point-at", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" ] ], - "_from": "code-point-at@^1.0.0", - "_id": "code-point-at@1.0.0", + "_from": "code-point-at@>=1.0.0 <2.0.0", + "_id": "code-point-at@1.0.1", "_inCache": true, "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at", - "_nodeVersion": "0.12.5", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/code-point-at-1.0.1.tgz_1475223183649_0.724906453397125" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.11.2", + "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { "raw": "code-point-at@^1.0.0", @@ -48,11 +40,11 @@ "_requiredBy": [ "/npm-registry-client/npmlog/gauge/string-width" ], - "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", - "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.1.tgz", + "_shasum": "1104cd34f9b5b45d3eba88f1babc1924e1ce35fb", "_shrinkwrap": null, "_spec": "code-point-at@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -66,12 +58,12 @@ }, "description": "ES2015 String#codePointAt() ponyfill", "devDependencies": { - "ava": "0.0.4" + "ava": "*" }, "directories": {}, "dist": { - "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", - "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" + "shasum": "1104cd34f9b5b45d3eba88f1babc1924e1ce35fb", + "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -79,11 +71,10 @@ "files": [ "index.js" ], - "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", - "homepage": "https://github.com/sindresorhus/code-point-at", + "gitHead": "502d72c5a959275e5d90f9c6641589756af44085", + "homepage": "https://github.com/sindresorhus/code-point-at#readme", "keywords": [ "es2015", - "es6", "ponyfill", "polyfill", "shim", @@ -110,7 +101,7 @@ "url": "git+https://github.com/sindresorhus/code-point-at.git" }, "scripts": { - "test": "node test.js" + "test": "ava" }, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md index 71e7d0931..ef9713f1b 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md @@ -1,8 +1,6 @@ # code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) -> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com) ## Install diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json index 3b853d672..cf107ae74 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json @@ -10,7 +10,7 @@ "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" ], [ { @@ -22,19 +22,23 @@ "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" + "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" ] ], "_from": "number-is-nan@^1.0.0", - "_id": "number-is-nan@1.0.0", + "_id": "number-is-nan@1.0.1", "_inCache": true, "_location": "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point/number-is-nan", - "_nodeVersion": "0.12.3", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/number-is-nan-1.0.1.tgz_1475212313367_0.9480371843092144" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.10.0", + "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { "raw": "number-is-nan@^1.0.0", @@ -48,11 +52,11 @@ "_requiredBy": [ "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point" ], - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "_shasum": "097b602b53422a522c1afb8790318336941a011d", "_shrinkwrap": null, "_spec": "number-is-nan@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", + "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -62,14 +66,14 @@ "url": "https://github.com/sindresorhus/number-is-nan/issues" }, "dependencies": {}, - "description": "ES6 Number.isNaN() ponyfill", + "description": "ES2015 Number.isNaN() ponyfill", "devDependencies": { - "ava": "0.0.4" + "ava": "*" }, "directories": {}, "dist": { - "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + "shasum": "097b602b53422a522c1afb8790318336941a011d", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -77,13 +81,11 @@ "files": [ "index.js" ], - "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "gitHead": "ed9cdac3f428cc929b61bb230da42c87477af4b9", "homepage": "https://github.com/sindresorhus/number-is-nan#readme", "keywords": [ - "es6", "es2015", "ecmascript", - "harmony", "ponyfill", "polyfill", "shim", @@ -107,7 +109,7 @@ "url": "git+https://github.com/sindresorhus/number-is-nan.git" }, "scripts": { - "test": "node test.js" + "test": "ava" }, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md index 93d851a14..246350871 100644 --- a/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md +++ b/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md @@ -1,8 +1,6 @@ # number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) -> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method +> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) ## Install diff --git a/node_modules/npm-registry-client/node_modules/retry/.npmignore b/node_modules/npm-registry-client/node_modules/retry/.npmignore deleted file mode 100644 index e7726a071..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules/* -npm-debug.log diff --git a/node_modules/npm-registry-client/node_modules/retry/License b/node_modules/npm-registry-client/node_modules/retry/License deleted file mode 100644 index 0b58de379..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/License +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/node_modules/npm-registry-client/node_modules/retry/Makefile b/node_modules/npm-registry-client/node_modules/retry/Makefile deleted file mode 100644 index eee21a99d..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -SHELL := /bin/bash - -test: - @node test/runner.js - -release-major: test - npm version major -m "Release %s" - git push - npm publish - -release-minor: test - npm version minor -m "Release %s" - git push - npm publish - -release-patch: test - npm version patch -m "Release %s" - git push - npm publish - -.PHONY: test - diff --git a/node_modules/npm-registry-client/node_modules/retry/README.md b/node_modules/npm-registry-client/node_modules/retry/README.md deleted file mode 100644 index eee05f7bb..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# retry - -Abstraction for exponential and custom retry strategies for failed operations. - -## Installation - - npm install retry - -## Current Status - -This module has been tested and is ready to be used. - -## Tutorial - -The example below will retry a potentially failing `dns.resolve` operation -`10` times using an exponential backoff strategy. With the default settings, this -means the last attempt is made after `17 minutes and 3 seconds`. - -``` javascript -var dns = require('dns'); -var retry = require('retry'); - -function faultTolerantResolve(address, cb) { - var operation = retry.operation(); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(err ? operation.mainError() : null, addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, addresses) { - console.log(err, addresses); -}); -``` - -Of course you can also configure the factors that go into the exponential -backoff. See the API documentation below for all available settings. -currentAttempt is an int representing the number of attempts so far. - -``` javascript -var operation = retry.operation({ - retries: 5, - factor: 3, - minTimeout: 1 * 1000, - maxTimeout: 60 * 1000, - randomize: true, -}); -``` - -## API - -### retry.operation([options]) - -Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: - -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -### retry.timeouts([options]) - -Returns an array of timeouts. All time `options` and return values are in -milliseconds. If `options` is an array, a copy of that array is returned. - -`options` is a JS object that can contain any of the following keys: - -* `retries`: The maximum amount of times to retry the operation. Default is `10`. -* `factor`: The exponential factor to use. Default is `2`. -* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. -* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. -* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. - -The formula used to calculate the individual timeouts is: - -``` -Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) -``` - -Have a look at [this article][article] for a better explanation of approach. - -If you want to tune your `factor` / `times` settings to attempt the last retry -after a certain amount of time, you can use wolfram alpha. For example in order -to tune for `10` attempts in `5 minutes`, you can use this equation: - -![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) - -Explaining the various values from left to right: - -* `k = 0 ... 9`: The `retries` value (10) -* `1000`: The `minTimeout` value in ms (1000) -* `x^k`: No need to change this, `x` will be your resulting factor -* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) - -To make this a little easier for you, use wolfram alpha to do the calculations: - -<http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000> - -[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html - -### retry.createTimeout(attempt, opts) - -Returns a new `timeout` (integer in milliseconds) based on the given parameters. - -`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). - -`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. - -`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). - -### retry.wrap(obj, [options], [methodNames]) - -Wrap all functions of the `obj` with retry. Optionally you can pass operation options and -an array of method names which need to be wrapped. - -``` -retry.wrap(obj) - -retry.wrap(obj, ['method1', 'method2']) - -retry.wrap(obj, {retries: 3}) - -retry.wrap(obj, {retries: 3}, ['method1', 'method2']) -``` -The `options` object can take any options that the usual call to `retry.operation` can take. - -### new RetryOperation(timeouts, [options]) - -Creates a new `RetryOperation` where `timeouts` is an array where each value is -a timeout given in milliseconds. - -Available options: -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -If `forever` is true, the following changes happen: -* `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. - -#### retryOperation.errors() - -Returns an array of all errors that have been passed to -`retryOperation.retry()` so far. - -#### retryOperation.mainError() - -A reference to the error object that occured most frequently. Errors are -compared using the `error.message` property. - -If multiple error messages occured the same amount of time, the last error -object with that message is returned. - -If no errors occured so far, the value is `null`. - -#### retryOperation.attempt(fn, timeoutOps) - -Defines the function `fn` that is to be retried and executes it for the first -time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. - -Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. -Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. - - -#### retryOperation.try(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.start(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.retry(error) - -Returns `false` when no `error` value is given, or the maximum amount of retries -has been reached. - -Otherwise it returns `true`, and retries the operation after the timeout for -the current attempt number. - -#### retryOperation.stop() - -Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. - -#### retryOperation.attempts() - -Returns an int representing the number of attempts it took to call `fn` before it was successful. - -## License - -retry is licensed under the MIT license. - - -# Changelog - -0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. - -0.9.0 Adding `unref` functionality, thanks to @satazor. - -0.8.0 Implementing retry.wrap. - -0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). - -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. - -0.5.0 Some minor refactoring. - -0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. - -0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). - -0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/node_modules/npm-registry-client/node_modules/retry/equation.gif b/node_modules/npm-registry-client/node_modules/retry/equation.gif Binary files differdeleted file mode 100644 index 97107237b..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/equation.gif +++ /dev/null diff --git a/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/node_modules/npm-registry-client/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6f..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -});
\ No newline at end of file diff --git a/node_modules/npm-registry-client/node_modules/retry/example/stop.js b/node_modules/npm-registry-client/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafeeb..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} diff --git a/node_modules/npm-registry-client/node_modules/retry/index.js b/node_modules/npm-registry-client/node_modules/retry/index.js deleted file mode 100644 index ee62f3a11..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/retry');
\ No newline at end of file diff --git a/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/node_modules/npm-registry-client/node_modules/retry/lib/retry.js deleted file mode 100644 index 77428cfd0..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/lib/retry.js +++ /dev/null @@ -1,99 +0,0 @@ -var RetryOperation = require('./retry_operation'); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && options.forever, - unref: options && options.unref - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper() { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }; - obj[method].options = options; - } -}; diff --git a/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js deleted file mode 100644 index 2b3db8e17..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js +++ /dev/null @@ -1,143 +0,0 @@ -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._timeouts = timeouts; - this._options = options || {}; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(this._errors.length - 1, this._errors.length); - this._timeouts = this._cachedTimeouts.slice(0); - timeout = this._timeouts.shift(); - } else { - return false; - } - } - - var self = this; - var timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (this._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; diff --git a/node_modules/npm-registry-client/node_modules/retry/package.json b/node_modules/npm-registry-client/node_modules/retry/package.json deleted file mode 100644 index 0ba214a6f..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "retry@^0.10.0", - "scope": null, - "escapedName": "retry", - "name": "retry", - "rawSpec": "^0.10.0", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" - ] - ], - "_from": "retry@>=0.10.0 <0.11.0", - "_id": "retry@0.10.0", - "_inCache": true, - "_location": "/npm-registry-client/retry", - "_nodeVersion": "4.2.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" - }, - "_npmUser": { - "name": "tim-kos", - "email": "tim@debuggable.com" - }, - "_npmVersion": "2.1.7", - "_phantomChildren": {}, - "_requested": { - "raw": "retry@^0.10.0", - "scope": null, - "escapedName": "retry", - "name": "retry", - "rawSpec": "^0.10.0", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client" - ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", - "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", - "_shrinkwrap": null, - "_spec": "retry@^0.10.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", - "author": { - "name": "Tim Koschützki", - "email": "tim@debuggable.com", - "url": "http://debuggable.com/" - }, - "bugs": { - "url": "https://github.com/tim-kos/node-retry/issues" - }, - "dependencies": {}, - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "directories": { - "lib": "./lib" - }, - "dist": { - "shasum": "649e15ca408422d98318161935e7f7d652d435dd", - "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" - }, - "engines": { - "node": "*" - }, - "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", - "homepage": "https://github.com/tim-kos/node-retry", - "license": "MIT", - "main": "index", - "maintainers": [ - { - "name": "tim-kos", - "email": "tim@debuggable.com" - } - ], - "name": "retry", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" - }, - "scripts": {}, - "version": "0.10.0" -} diff --git a/node_modules/npm-registry-client/node_modules/retry/test/common.js b/node_modules/npm-registry-client/node_modules/retry/test/common.js deleted file mode 100644 index 224720696..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/common.js +++ /dev/null @@ -1,10 +0,0 @@ -var common = module.exports; -var path = require('path'); - -var rootDir = path.join(__dirname, '..'); -common.dir = { - lib: rootDir + '/lib' -}; - -common.assert = require('assert'); -common.fake = require('fake');
\ No newline at end of file diff --git a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js b/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js deleted file mode 100644 index b41307cb5..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testForeverUsesFirstTimeout() { - var operation = retry.operation({ - retries: 0, - minTimeout: 100, - maxTimeout: 100, - forever: true - }); - - operation.attempt(function(numAttempt) { - console.log('>numAttempt', numAttempt); - var err = new Error("foo"); - if (numAttempt == 10) { - operation.stop(); - } - - if (operation.retry(err)) { - return; - } - }); -})(); diff --git a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js deleted file mode 100644 index 916936424..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js +++ /dev/null @@ -1,176 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -(function testErrors() { - var operation = retry.operation(); - - var error = new Error('some error'); - var error2 = new Error('some other error'); - operation._errors.push(error); - operation._errors.push(error2); - - assert.deepEqual(operation.errors(), [error, error2]); -})(); - -(function testMainErrorReturnsMostFrequentError() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - operation._errors.push(error); - - assert.strictEqual(operation.mainError(), error); -})(); - -(function testMainErrorReturnsLastErrorOnEqualCount() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - - assert.strictEqual(operation.mainError(), error2); -})(); - -(function testAttempt() { - var operation = retry.operation(); - var fn = new Function(); - - var timeoutOpts = { - timeout: 1, - cb: function() {} - }; - operation.attempt(fn, timeoutOpts); - - assert.strictEqual(fn, operation._fn); - assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); - assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); -})(); - -(function testRetry() { - var times = 3; - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForever() { - var error = new Error('some error'); - var operation = retry.operation({ retries: 3, forever: true }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 6 && operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 6); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForeverNoRetries() { - var error = new Error('some error'); - var delay = 50 - var operation = retry.operation({ - retries: null, - forever: true, - minTimeout: delay, - maxTimeout: delay - }); - - var attempts = 0; - var startTime = new Date().getTime(); - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 4 && operation.retry(error)) { - return; - } - - var endTime = new Date().getTime(); - var minTime = startTime + (delay * 3); - var maxTime = minTime + 20 // add a little headroom for code execution time - assert(endTime > minTime) - assert(endTime < maxTime) - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testStop() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts === 2) { - operation.stop(); - - assert.strictEqual(attempts, 2); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - } - - if (operation.retry(error)) { - return; - } - }); - }; - - fn(); -})(); diff --git a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js deleted file mode 100644 index 7ca8bc7eb..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js +++ /dev/null @@ -1,77 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -function getLib() { - return { - fn1: function() {}, - fn2: function() {}, - fn3: function() {} - }; -} - -(function wrapAll() { - var lib = getLib(); - retry.wrap(lib); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapAllPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn1.options.retries, 2); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function wrapDefined() { - var lib = getLib(); - retry.wrap(lib, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapDefinedAndPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function runWrappedWithoutError() { - var callbackCalled; - var lib = {method: function(a, b, callback) { - assert.equal(a, 1); - assert.equal(b, 2); - assert.equal(typeof callback, 'function'); - callback(); - }}; - retry.wrap(lib); - lib.method(1, 2, function() { - callbackCalled = true; - }); - assert.ok(callbackCalled); -}()); - -(function runWrappedWithError() { - var callbackCalled; - var lib = {method: function(callback) { - callback(new Error('Some error')); - }}; - retry.wrap(lib, {retries: 1}); - lib.method(function(err) { - callbackCalled = true; - assert.ok(err instanceof Error); - }); - assert.ok(!callbackCalled); -}()); diff --git a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js deleted file mode 100644 index 7206b0fb0..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js +++ /dev/null @@ -1,69 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testDefaultValues() { - var timeouts = retry.timeouts(); - - assert.equal(timeouts.length, 10); - assert.equal(timeouts[0], 1000); - assert.equal(timeouts[1], 2000); - assert.equal(timeouts[2], 4000); -})(); - -(function testDefaultValuesWithRandomize() { - var minTimeout = 5000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - randomize: true - }); - - assert.equal(timeouts.length, 10); - assert.ok(timeouts[0] > minTimeout); - assert.ok(timeouts[1] > timeouts[0]); - assert.ok(timeouts[2] > timeouts[1]); -})(); - -(function testPassedTimeoutsAreUsed() { - var timeoutsArray = [1000, 2000, 3000]; - var timeouts = retry.timeouts(timeoutsArray); - assert.deepEqual(timeouts, timeoutsArray); - assert.notStrictEqual(timeouts, timeoutsArray); -})(); - -(function testTimeoutsAreWithinBoundaries() { - var minTimeout = 1000; - var maxTimeout = 10000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - maxTimeout: maxTimeout - }); - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] >= minTimeout); - assert.ok(timeouts[i] <= maxTimeout); - } -})(); - -(function testTimeoutsAreIncremental() { - var timeouts = retry.timeouts(); - var lastTimeout = timeouts[0]; - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] > lastTimeout); - lastTimeout = timeouts[i]; - } -})(); - -(function testTimeoutsAreIncrementalForFactorsLessThanOne() { - var timeouts = retry.timeouts({ - retries: 3, - factor: 0.5 - }); - - var expected = [250, 500, 1000]; - assert.deepEqual(expected, timeouts); -})(); - -(function testRetries() { - var timeouts = retry.timeouts({retries: 2}); - assert.strictEqual(timeouts.length, 2); -})(); diff --git a/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/node_modules/npm-registry-client/node_modules/retry/test/runner.js deleted file mode 100644 index e0ee2f570..000000000 --- a/node_modules/npm-registry-client/node_modules/retry/test/runner.js +++ /dev/null @@ -1,5 +0,0 @@ -var far = require('far').create(); - -far.add(__dirname); -far.include(/\/test-.*\.js$/); -far.execute(); diff --git a/node_modules/npm-registry-client/package.json b/node_modules/npm-registry-client/package.json index 51ff6bebb..f463851a8 100644 --- a/node_modules/npm-registry-client/package.json +++ b/node_modules/npm-registry-client/package.json @@ -2,52 +2,56 @@ "_args": [ [ { - "raw": "npm-registry-client@7.2.1", + "raw": "npm-registry-client@7.3.0", "scope": null, "escapedName": "npm-registry-client", "name": "npm-registry-client", - "rawSpec": "7.2.1", - "spec": "7.2.1", + "rawSpec": "7.3.0", + "spec": "7.3.0", "type": "version" }, - "/Users/zkat/Documents/code/npm" + "/Users/rebecca/code/npm" ] ], - "_from": "npm-registry-client@7.2.1", - "_id": "npm-registry-client@7.2.1", + "_from": "npm-registry-client@7.3.0", + "_id": "npm-registry-client@7.3.0", "_inCache": true, "_location": "/npm-registry-client", - "_nodeVersion": "6.3.1", + "_nodeVersion": "6.7.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-registry-client-7.2.1.tgz_1472871043942_0.2117650501895696" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/npm-registry-client-7.3.0.tgz_1476956977374_0.8605887587182224" }, "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.10.7", + "_npmVersion": "3.10.9", "_phantomChildren": { - "inherits": "2.0.3" + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "inherits": "2.0.3", + "readable-stream": "2.1.5", + "strip-ansi": "3.0.1" }, "_requested": { - "raw": "npm-registry-client@7.2.1", + "raw": "npm-registry-client@7.3.0", "scope": null, "escapedName": "npm-registry-client", "name": "npm-registry-client", - "rawSpec": "7.2.1", - "spec": "7.2.1", + "rawSpec": "7.3.0", + "spec": "7.3.0", "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz", - "_shasum": "c792266b088cc313f8525e7e35248626c723db75", + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.3.0.tgz", + "_shasum": "f2a390e8b13b78fafe26e9fa9d8bc74e17bcaa50", "_shrinkwrap": null, - "_spec": "npm-registry-client@7.2.1", - "_where": "/Users/zkat/Documents/code/npm", + "_spec": "npm-registry-client@7.3.0", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -79,10 +83,10 @@ }, "directories": {}, "dist": { - "shasum": "c792266b088cc313f8525e7e35248626c723db75", - "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz" + "shasum": "f2a390e8b13b78fafe26e9fa9d8bc74e17bcaa50", + "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.3.0.tgz" }, - "gitHead": "debec76884db8092c2c7a21ab5b4ed083f8ce2c9", + "gitHead": "0e0a707dcf62e9705ef17b7d471d3657c33e79e6", "homepage": "https://github.com/npm/npm-registry-client#readme", "license": "ISC", "main": "index.js", @@ -115,5 +119,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "7.2.1" + "version": "7.3.0" } diff --git a/node_modules/npm-registry-client/test/config-override.js b/node_modules/npm-registry-client/test/config-override.js index 026cb199c..ab44aa02b 100644 --- a/node_modules/npm-registry-client/test/config-override.js +++ b/node_modules/npm-registry-client/test/config-override.js @@ -24,7 +24,9 @@ var config = { log: { fake: function () {} }, defaultTag: 'next', couchToken: { object: true }, - sessionToken: 'hamchunx' + sessionToken: 'hamchunx', + isFromCI: true, + scope: '@test' } test('config defaults', function (t) { @@ -52,6 +54,8 @@ test('config defaults', function (t) { t.equal(client.config.defaultTag, 'next') t.ok(client.config.couchToken.object) t.equal(client.config.sessionToken, 'hamchunx') + t.ok(client.config.isFromCI) + t.is(client.config.scope, '@test') t.end() }) |