redis 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.deepsource.toml +9 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +1 -1
- package/README.md +25 -21
- package/heroku/index.js +14 -0
- package/heroku/node_modules/.package-lock.json +57 -0
- package/heroku/node_modules/denque/CHANGELOG.md +4 -0
- package/heroku/node_modules/denque/LICENSE +13 -0
- package/heroku/node_modules/denque/README.md +362 -0
- package/heroku/node_modules/denque/index.d.ts +31 -0
- package/heroku/node_modules/denque/index.js +443 -0
- package/heroku/node_modules/denque/package.json +55 -0
- package/heroku/node_modules/redis/.deepsource.toml +9 -0
- package/heroku/node_modules/redis/CHANGELOG.md +880 -0
- package/heroku/node_modules/redis/LICENSE +24 -0
- package/heroku/node_modules/redis/README.md +1009 -0
- package/heroku/node_modules/redis/a.js +12 -0
- package/heroku/node_modules/redis/index.js +1039 -0
- package/heroku/node_modules/redis/lib/command.js +16 -0
- package/heroku/node_modules/redis/lib/commands.js +105 -0
- package/heroku/node_modules/redis/lib/createClient.js +88 -0
- package/heroku/node_modules/redis/lib/customErrors.js +58 -0
- package/heroku/node_modules/redis/lib/debug.js +13 -0
- package/heroku/node_modules/redis/lib/extendedApi.js +113 -0
- package/heroku/node_modules/redis/lib/individualCommands.js +629 -0
- package/heroku/node_modules/redis/lib/multi.js +187 -0
- package/heroku/node_modules/redis/lib/utils.js +134 -0
- package/heroku/node_modules/redis/npm +0 -0
- package/heroku/node_modules/redis/package.json +77 -0
- package/heroku/node_modules/redis-commands/LICENSE +22 -0
- package/heroku/node_modules/redis-commands/README.md +51 -0
- package/heroku/node_modules/redis-commands/changelog.md +83 -0
- package/heroku/node_modules/redis-commands/commands.json +2334 -0
- package/heroku/node_modules/redis-commands/index.js +168 -0
- package/heroku/node_modules/redis-commands/package.json +41 -0
- package/heroku/node_modules/redis-commands/tools/build.js +62 -0
- package/heroku/node_modules/redis-errors/LICENSE +22 -0
- package/heroku/node_modules/redis-errors/README.md +116 -0
- package/heroku/node_modules/redis-errors/index.js +7 -0
- package/heroku/node_modules/redis-errors/lib/modern.js +59 -0
- package/heroku/node_modules/redis-errors/lib/old.js +119 -0
- package/heroku/node_modules/redis-errors/package.json +41 -0
- package/heroku/node_modules/redis-parser/LICENSE +22 -0
- package/heroku/node_modules/redis-parser/README.md +166 -0
- package/heroku/node_modules/redis-parser/changelog.md +156 -0
- package/heroku/node_modules/redis-parser/index.js +3 -0
- package/heroku/node_modules/redis-parser/lib/parser.js +552 -0
- package/heroku/node_modules/redis-parser/package.json +53 -0
- package/heroku/package.json +9 -0
- package/index.js +8 -19
- package/lib/createClient.js +5 -1
- package/lib/individualCommands.js +19 -7
- package/lib/utils.js +1 -1
- package/package.json +15 -13
|
@@ -4,7 +4,7 @@ var utils = require('./utils');
|
|
|
4
4
|
var debug = require('./debug');
|
|
5
5
|
var Multi = require('./multi');
|
|
6
6
|
var Command = require('./command');
|
|
7
|
-
var no_password_is_set = /no password is set/;
|
|
7
|
+
var no_password_is_set = /no password is set|called without any password configured/;
|
|
8
8
|
var loading = /LOADING/;
|
|
9
9
|
var RedisClient = require('../').RedisClient;
|
|
10
10
|
|
|
@@ -180,7 +180,7 @@ Multi.prototype.info = Multi.prototype.INFO = function info (section, callback)
|
|
|
180
180
|
return this;
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
function auth_callback (self, pass, callback) {
|
|
183
|
+
function auth_callback (self, pass, user, callback) {
|
|
184
184
|
return function (err, res) {
|
|
185
185
|
if (err) {
|
|
186
186
|
if (no_password_is_set.test(err.message)) {
|
|
@@ -191,7 +191,7 @@ function auth_callback (self, pass, callback) {
|
|
|
191
191
|
// If redis is still loading the db, it will not authenticate and everything else will fail
|
|
192
192
|
debug('Redis still loading, trying to authenticate later');
|
|
193
193
|
setTimeout(function () {
|
|
194
|
-
self.auth(pass, callback);
|
|
194
|
+
self.auth(pass, user, callback);
|
|
195
195
|
}, 100);
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
@@ -200,25 +200,37 @@ function auth_callback (self, pass, callback) {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
RedisClient.prototype.auth = RedisClient.prototype.AUTH = function auth (pass, callback) {
|
|
203
|
+
RedisClient.prototype.auth = RedisClient.prototype.AUTH = function auth (pass, user, callback) {
|
|
204
204
|
debug('Sending auth to ' + this.address + ' id ' + this.connection_id);
|
|
205
205
|
|
|
206
|
+
// Backward compatibility support for auth with password only
|
|
207
|
+
if (user instanceof Function) {
|
|
208
|
+
callback = user;
|
|
209
|
+
user = null;
|
|
210
|
+
}
|
|
206
211
|
// Stash auth for connect and reconnect.
|
|
207
212
|
this.auth_pass = pass;
|
|
213
|
+
this.auth_user = user;
|
|
208
214
|
var ready = this.ready;
|
|
209
215
|
this.ready = ready || this.offline_queue.length === 0;
|
|
210
|
-
var tmp = this.internal_send_command(new Command('auth', [pass], auth_callback(this, pass, callback)));
|
|
216
|
+
var tmp = this.internal_send_command(new Command('auth', user ? [user, pass] : [pass], auth_callback(this, pass, user, callback)));
|
|
211
217
|
this.ready = ready;
|
|
212
218
|
return tmp;
|
|
213
219
|
};
|
|
214
220
|
|
|
215
221
|
// Only works with batch, not in a transaction
|
|
216
|
-
Multi.prototype.auth = Multi.prototype.AUTH = function auth (pass, callback) {
|
|
222
|
+
Multi.prototype.auth = Multi.prototype.AUTH = function auth (pass, user, callback) {
|
|
217
223
|
debug('Sending auth to ' + this.address + ' id ' + this.connection_id);
|
|
218
224
|
|
|
225
|
+
// Backward compatibility support for auth with password only
|
|
226
|
+
if (user instanceof Function) {
|
|
227
|
+
callback = user;
|
|
228
|
+
user = null;
|
|
229
|
+
}
|
|
219
230
|
// Stash auth for connect and reconnect.
|
|
220
231
|
this.auth_pass = pass;
|
|
221
|
-
this.
|
|
232
|
+
this.auth_user = user;
|
|
233
|
+
this.queue.push(new Command('auth', user ? [user, pass] : [pass], auth_callback(this._client, pass, user, callback)));
|
|
222
234
|
return this;
|
|
223
235
|
};
|
|
224
236
|
|
package/lib/utils.js
CHANGED
|
@@ -127,7 +127,7 @@ module.exports = {
|
|
|
127
127
|
reply_to_object: replyToObject,
|
|
128
128
|
print: print,
|
|
129
129
|
err_code: /^([A-Z]+)\s+(.+)$/,
|
|
130
|
-
monitor_regex: /^[0-9]{10,11}\.[0-9]+ \[[0-9]+ .+\]
|
|
130
|
+
monitor_regex: /^[0-9]{10,11}\.[0-9]+ \[[0-9]+ .+\].*"$/,
|
|
131
131
|
clone: convenienceClone,
|
|
132
132
|
callback_or_emit: callbackOrEmit,
|
|
133
133
|
reply_in_order: replyInOrder
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redis",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "A high performance Redis client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -30,31 +30,33 @@
|
|
|
30
30
|
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
|
31
31
|
"coverage": "nyc report --reporter=html",
|
|
32
32
|
"benchmark": "node benchmarks/multi_bench.js",
|
|
33
|
-
"test": "nyc --cache mocha ./test/*.js ./test/commands/*.js --timeout=8000",
|
|
34
|
-
"lint": "eslint .
|
|
33
|
+
"test": "nyc --cache mocha ./test/*.spec.js ./test/commands/*.spec.js --timeout=8000 && npm run coverage",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"lint:fix": "eslint . --fix",
|
|
36
|
+
"lint:report": "eslint --output-file=eslint-report.json --format=json .",
|
|
35
37
|
"compare": "node benchmarks/diff_multi_bench_output.js beforeBench.txt afterBench.txt"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"denque": "^1.
|
|
39
|
-
"
|
|
40
|
-
"redis-commands": "^1.5.0",
|
|
40
|
+
"denque": "^1.5.0",
|
|
41
|
+
"redis-commands": "^1.7.0",
|
|
41
42
|
"redis-errors": "^1.2.0",
|
|
42
43
|
"redis-parser": "^3.0.0"
|
|
43
44
|
},
|
|
44
45
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
46
|
+
"node": ">=10"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"bluebird": "^3.7.2",
|
|
49
|
-
"coveralls": "^
|
|
50
|
-
"
|
|
50
|
+
"coveralls": "^3.1.0",
|
|
51
|
+
"cross-spawn": "^7.0.3",
|
|
52
|
+
"eslint": "^7.21.0",
|
|
51
53
|
"intercept-stdout": "~0.1.2",
|
|
52
54
|
"metrics": "^0.1.21",
|
|
53
|
-
"mocha": "^
|
|
54
|
-
"nyc": "^
|
|
55
|
+
"mocha": "^8.3.0",
|
|
56
|
+
"nyc": "^15.1.0",
|
|
57
|
+
"prettier": "^2.2.1",
|
|
55
58
|
"tcp-port-used": "^1.0.1",
|
|
56
|
-
"uuid": "^3.
|
|
57
|
-
"cross-spawn": "^6.0.5"
|
|
59
|
+
"uuid": "^8.3.2"
|
|
58
60
|
},
|
|
59
61
|
"repository": {
|
|
60
62
|
"type": "git",
|