diff --git a/README.md b/README.md index eb8062b..6592739 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ When running multiple instances of your Feathers application (e.g. on several He feathers-sync uses a messaging mechanism to propagate all events to all application instances. It currently supports: -- Redis via [redis](https://github.com/NodeRedis/node_redis) +- Redis via [ioredis](https://github.com/luin/ioredis) - AMQP (RabbitMQ) via [amqplib](https://github.com/squaremo/amqp.node) This allows to scale real-time websocket connections to any number of clients. @@ -94,33 +94,39 @@ app.service('messages').hooks({ `feathers-sync` can be initialized either by specifying the type of adapter through the `uri` (e.g. `redis://localhost:6379`) or using e.g. `sync.redis` directly: ```js -// Configure Redis +// Configure with Redis app.configure( sync({ uri: 'redis://localhost:6379', }) ); -app.configure( - sync.redis({ - db: redisInstance, - }) -); +// Configure Redis using an existing redis instance +const Redis = require('ioredis'); +const redisClient = new Redis({ + // see https://luin.github.io/ioredis/index.html#RedisOptions for additional options + host: 'my.redis.host.com', + port: 6379, + lazyConnect: true, + maxRetriesPerRequest: null, + // ... +}); -// Configure Redis using an existing redisClient app.configure( sync.redis({ - redisClient: redisClient, + key: 'feathers-sync', + serialize: JSON.stringify, + deserialize: JSON.parse, + redisClient }) ); ``` ### Redis -- `uri` - The connection string (must start with `redis://`) +- `uri` - The connection string (must start with `redis://`) (default: `localhost:6379`) - `key` - The key under which all synchronization events will be stored (default: `feathers-sync`) -- `redisClient` - An existing instance of redisClient -- `redisOptions` - Redis [client options](http://redis.js.org/#api-rediscreateclient) +- `redisClient` - (optional) An existing instance of a redis client ### AMQP @@ -155,8 +161,6 @@ const bson = require('bson'); app.configure( sync({ uri: 'redis://localhost:6379', - // Replies will be sent to callbacks as Buffers instead of Strings for bson.deserialize to work. - redisOptions: { return_buffers: true }, serialize: bson.serialize, deserialize: bson.deserialize, }) diff --git a/lib/adapters/redis.js b/lib/adapters/redis.js index 8890825..5877fd1 100644 --- a/lib/adapters/redis.js +++ b/lib/adapters/redis.js @@ -1,27 +1,18 @@ -const redis = require('redis'); +const Redis = require('ioredis'); const debug = require('debug')('feathers-sync:redis'); const core = require('../core'); module.exports = config => { return app => { const { key, serialize, deserialize, redisClient, uri } = config; - const options = { - url: uri, - ...config.redisOptions - }; if (!redisClient) { - debug(`Setting up Redis client for ${options.uri}`); + debug(`Setting up new Redis client for ${uri}`); } - const pub = redisClient || redis.createClient(options); + const pub = redisClient || new Redis(uri); const sub = pub.duplicate(); - const msgFromRedisHandler = data => { - debug(`Got ${key} message from Redis`); - app.emit('sync-in', data); - }; - app.configure(core); app.sync = { deserialize, @@ -30,11 +21,17 @@ module.exports = config => { sub, type: 'redis', ready: new Promise((resolve, reject) => { - pub.connect(); - sub.connect(); sub.once('ready', resolve); sub.once('error', reject); - }).then(() => sub.subscribe(key, msgFromRedisHandler, true)) + }).then(() => { + sub.subscribe(key); + sub.on(serialize && deserialize ? 'messageBuffer' : 'message', function (channel, data) { + if (channel.toString() === key) { + debug(`Got ${key} message from Redis`); + app.emit('sync-in', data); + } + }); + }) }; app.on('sync-out', data => { diff --git a/package-lock.json b/package-lock.json index 088389c..ca467d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,12 +12,12 @@ "amqp-connection-manager": "^4.1.10", "amqplib": "^0.10.3", "debug": "^4.3.4", + "ioredis": "^5.3.1", "lodash": "^4.17.21", - "nats": "^2.12.1", - "redis": "^4.6.4" + "nats": "^2.12.1" }, "devDependencies": { - "@feathersjs/feathers": "^5.0.0-pre.38", + "@feathersjs/feathers": "^5.0.3", "@semantic-release/commit-analyzer": "^9.0.2", "@semantic-release/npm": "^9.0.2", "@semantic-release/release-notes-generator": "^10.0.3", @@ -626,9 +626,9 @@ } }, "node_modules/@feathersjs/commons": { - "version": "5.0.0-pre.38", - "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.0-pre.38.tgz", - "integrity": "sha512-Nh3snF12c0f+KsPwcmkpWBFi/coZj22fUmdqGgncVbZvf/01J3hvcUdKZ0sasLuanschj6jgiYHeDDQspLtXig==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.3.tgz", + "integrity": "sha512-8UHTd/WUl7VzNScAnfCGL3/6bzhnaZkFzrLVNgK8tsO1vz+XAbcDuWN/EI4CKNjrjepOtF9KD/wixXPpLJrdkA==", "dev": true, "engines": { "node": ">= 12" @@ -639,12 +639,12 @@ } }, "node_modules/@feathersjs/feathers": { - "version": "5.0.0-pre.38", - "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.0-pre.38.tgz", - "integrity": "sha512-sX5JTCki9byEwQbftgqZhCYtQeE2Ga3Prr65SPBpTOKuz0vH6IzUc93S/V/t7QtM8Kx9Cm64O9e/bmlPABJt3g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.3.tgz", + "integrity": "sha512-g7kKG1UrDEaT2g3X9N+OZ3LZe0gVnAyV1hyW3ED+vX1XUHRHLw/QY16h5w0fJlRrgD2MTuU/Itl+nXMbnI4Wtw==", "dev": true, "dependencies": { - "@feathersjs/commons": "^5.0.0-pre.38", + "@feathersjs/commons": "^5.0.3", "@feathersjs/hooks": "^0.8.1", "events": "^3.3.0" }, @@ -691,6 +691,11 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1181,59 +1186,6 @@ "npmlog": "2 || ^3.1.0 || ^4.0.0" } }, - "node_modules/@redis/bloom": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", - "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/client": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.5.tgz", - "integrity": "sha512-fuMnpDYSjT5JXR9rrCW1YWA4L8N/9/uS4ImT3ZEC/hcaQRI1D/9FvwjriRj1UvepIgzZXthFVKMNRzP/LNL7BQ==", - "dependencies": { - "cluster-key-slot": "1.1.2", - "generic-pool": "3.9.0", - "yallist": "4.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@redis/graph": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.0.tgz", - "integrity": "sha512-16yZWngxyXPd+MJxeSr0dqh2AIOi8j9yXKcKCwVaKDbH3HTuETpDVPcLujhFYVPtYrngSco31BUcSa9TH31Gqg==", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/json": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.4.tgz", - "integrity": "sha512-LUZE2Gdrhg0Rx7AN+cZkb1e6HjoSKaeeW8rYnt89Tly13GBI5eP4CwDVr+MY8BAYfCg4/N15OUrtLoona9uSgw==", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/search": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.1.1.tgz", - "integrity": "sha512-pqCXTc5e7wJJgUuJiC3hBgfoFRoPxYzwn0BEfKgejTM7M/9zP3IpUcqcjgfp8hF+LoV8rHZzcNTz7V+pEIY7LQ==", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, - "node_modules/@redis/time-series": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.0.4.tgz", - "integrity": "sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng==", - "peerDependencies": { - "@redis/client": "^1.0.0" - } - }, "node_modules/@semantic-release/commit-analyzer": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz", @@ -3397,6 +3349,14 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -4977,14 +4937,6 @@ "wide-align": "^1.1.0" } }, - "node_modules/generic-pool": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", - "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", - "engines": { - "node": ">= 4" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -5754,6 +5706,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ioredis": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.1.tgz", + "integrity": "sha512-C+IBcMysM6v52pTLItYMeV4Hz7uriGtoJdz7SSBDX6u+zwSYGirLdQh3L7t/OItWITcw3gTFMjJReYUwS4zihg==", + "dependencies": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, "node_modules/ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", @@ -6626,6 +6601,11 @@ "integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=", "dev": true }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" + }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", @@ -6638,6 +6618,11 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" + }, "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -12243,17 +12228,23 @@ "esprima": "~4.0.0" } }, - "node_modules/redis": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.6.4.tgz", - "integrity": "sha512-wi2tgDdQ+Q8q+PR5FLRx4QvDiWaA+PoJbrzsyFqlClN5R4LplHqN3scs/aGjE//mbz++W19SgxiEnQ27jnCRaA==", + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "dependencies": { - "@redis/bloom": "1.2.0", - "@redis/client": "1.5.5", - "@redis/graph": "1.1.0", - "@redis/json": "1.0.4", - "@redis/search": "1.1.1", - "@redis/time-series": "1.0.4" + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/regexp.prototype.flags": { @@ -13568,6 +13559,11 @@ "node": ">= 8" } }, + "node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" + }, "node_modules/standard-engine": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-14.0.1.tgz", @@ -15103,7 +15099,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yaml": { "version": "2.2.1", @@ -15782,18 +15779,18 @@ } }, "@feathersjs/commons": { - "version": "5.0.0-pre.38", - "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.0-pre.38.tgz", - "integrity": "sha512-Nh3snF12c0f+KsPwcmkpWBFi/coZj22fUmdqGgncVbZvf/01J3hvcUdKZ0sasLuanschj6jgiYHeDDQspLtXig==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.3.tgz", + "integrity": "sha512-8UHTd/WUl7VzNScAnfCGL3/6bzhnaZkFzrLVNgK8tsO1vz+XAbcDuWN/EI4CKNjrjepOtF9KD/wixXPpLJrdkA==", "dev": true }, "@feathersjs/feathers": { - "version": "5.0.0-pre.38", - "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.0-pre.38.tgz", - "integrity": "sha512-sX5JTCki9byEwQbftgqZhCYtQeE2Ga3Prr65SPBpTOKuz0vH6IzUc93S/V/t7QtM8Kx9Cm64O9e/bmlPABJt3g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.3.tgz", + "integrity": "sha512-g7kKG1UrDEaT2g3X9N+OZ3LZe0gVnAyV1hyW3ED+vX1XUHRHLw/QY16h5w0fJlRrgD2MTuU/Itl+nXMbnI4Wtw==", "dev": true, "requires": { - "@feathersjs/commons": "^5.0.0-pre.38", + "@feathersjs/commons": "^5.0.3", "@feathersjs/hooks": "^0.8.1", "events": "^3.3.0" } @@ -15827,6 +15824,11 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -16220,46 +16222,6 @@ "ssri": "^8.0.0" } }, - "@redis/bloom": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", - "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", - "requires": {} - }, - "@redis/client": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.5.5.tgz", - "integrity": "sha512-fuMnpDYSjT5JXR9rrCW1YWA4L8N/9/uS4ImT3ZEC/hcaQRI1D/9FvwjriRj1UvepIgzZXthFVKMNRzP/LNL7BQ==", - "requires": { - "cluster-key-slot": "1.1.2", - "generic-pool": "3.9.0", - "yallist": "4.0.0" - } - }, - "@redis/graph": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.0.tgz", - "integrity": "sha512-16yZWngxyXPd+MJxeSr0dqh2AIOi8j9yXKcKCwVaKDbH3HTuETpDVPcLujhFYVPtYrngSco31BUcSa9TH31Gqg==", - "requires": {} - }, - "@redis/json": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.4.tgz", - "integrity": "sha512-LUZE2Gdrhg0Rx7AN+cZkb1e6HjoSKaeeW8rYnt89Tly13GBI5eP4CwDVr+MY8BAYfCg4/N15OUrtLoona9uSgw==", - "requires": {} - }, - "@redis/search": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.1.1.tgz", - "integrity": "sha512-pqCXTc5e7wJJgUuJiC3hBgfoFRoPxYzwn0BEfKgejTM7M/9zP3IpUcqcjgfp8hF+LoV8rHZzcNTz7V+pEIY7LQ==", - "requires": {} - }, - "@redis/time-series": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.0.4.tgz", - "integrity": "sha512-ThUIgo2U/g7cCuZavucQTQzA9g9JbDDY2f64u3AbAoz/8vE2lt2U37LamDUVChhaDA3IRT9R6VvJwqnUfTJzng==", - "requires": {} - }, "@semantic-release/commit-analyzer": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz", @@ -17899,6 +17861,11 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -19095,11 +19062,6 @@ "wide-align": "^1.1.0" } }, - "generic-pool": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", - "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==" - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -19665,6 +19627,22 @@ "p-is-promise": "^3.0.0" } }, + "ioredis": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.1.tgz", + "integrity": "sha512-C+IBcMysM6v52pTLItYMeV4Hz7uriGtoJdz7SSBDX6u+zwSYGirLdQh3L7t/OItWITcw3gTFMjJReYUwS4zihg==", + "requires": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + } + }, "ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", @@ -20318,6 +20296,11 @@ "integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=", "dev": true }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" + }, "lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", @@ -20330,6 +20313,11 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" + }, "lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -24336,17 +24324,17 @@ "esprima": "~4.0.0" } }, - "redis": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.6.4.tgz", - "integrity": "sha512-wi2tgDdQ+Q8q+PR5FLRx4QvDiWaA+PoJbrzsyFqlClN5R4LplHqN3scs/aGjE//mbz++W19SgxiEnQ27jnCRaA==", + "redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==" + }, + "redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "requires": { - "@redis/bloom": "1.2.0", - "@redis/client": "1.5.5", - "@redis/graph": "1.1.0", - "@redis/json": "1.0.4", - "@redis/search": "1.1.1", - "@redis/time-series": "1.0.4" + "redis-errors": "^1.0.0" } }, "regexp.prototype.flags": { @@ -25281,6 +25269,11 @@ "minipass": "^3.1.1" } }, + "standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" + }, "standard-engine": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-14.0.1.tgz", @@ -26485,7 +26478,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "2.2.1", diff --git a/package.json b/package.json index 0d5ab2e..1f6fd17 100644 --- a/package.json +++ b/package.json @@ -57,12 +57,12 @@ "amqp-connection-manager": "^4.1.10", "amqplib": "^0.10.3", "debug": "^4.3.4", + "ioredis": "^5.3.1", "lodash": "^4.17.21", - "nats": "^2.12.1", - "redis": "^4.6.4" + "nats": "^2.12.1" }, "devDependencies": { - "@feathersjs/feathers": "^5.0.0-pre.38", + "@feathersjs/feathers": "^5.0.3", "@semantic-release/commit-analyzer": "^9.0.2", "@semantic-release/npm": "^9.0.2", "@semantic-release/release-notes-generator": "^10.0.3", diff --git a/test/adapters/redis.test.js b/test/adapters/redis.test.js index 2efb86c..9293ec3 100644 --- a/test/adapters/redis.test.js +++ b/test/adapters/redis.test.js @@ -59,7 +59,6 @@ describe('feathers-sync Redis custom serializer / deserializer tests', () => { const createApp = _app({ uri: 'redis://localhost:6379', key: 'feathers-sync2', - redisOptions: { return_buffers: true }, serialize: bson.serialize, deserialize: bson.deserialize });