feathers-sync
Advanced tools
Comparing version 2.2.0 to 2.3.0
163
CHANGELOG.md
@@ -1,8 +0,41 @@ | ||
# Change Log | ||
# Changelog | ||
## [v2.2.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v2.2.0) (2021-01-24) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v2.1.0...v2.2.0) | ||
**Implemented enhancements:** | ||
- Add adapter for MongoDB [\#136](https://github.com/feathersjs-ecosystem/feathers-sync/issues/136) | ||
**Closed issues:** | ||
- Infinite Loop with Alias Services [\#153](https://github.com/feathersjs-ecosystem/feathers-sync/issues/153) | ||
- Only send sync events but not receive from other apps [\#148](https://github.com/feathersjs-ecosystem/feathers-sync/issues/148) | ||
- Feather Context not updated on Horizontal scaling. [\#147](https://github.com/feathersjs-ecosystem/feathers-sync/issues/147) | ||
**Merged pull requests:** | ||
- Add TypeScript typings [\#159](https://github.com/feathersjs-ecosystem/feathers-sync/pull/159) ([daffl](https://github.com/daffl)) | ||
- Duplicate redisClient \(bug fix\) \* Customize subscriber event [\#158](https://github.com/feathersjs-ecosystem/feathers-sync/pull/158) ([dubiousdavid](https://github.com/dubiousdavid)) | ||
- Update all dependencies and fix AQMP test timeout [\#157](https://github.com/feathersjs-ecosystem/feathers-sync/pull/157) ([daffl](https://github.com/daffl)) | ||
- Finalize NATS support [\#156](https://github.com/feathersjs-ecosystem/feathers-sync/pull/156) ([daffl](https://github.com/daffl)) | ||
- Fix loop when initializing twice [\#154](https://github.com/feathersjs-ecosystem/feathers-sync/pull/154) ([mrfrase3](https://github.com/mrfrase3)) | ||
- chore\(ci\): Move CI to Github actions [\#152](https://github.com/feathersjs-ecosystem/feathers-sync/pull/152) ([daffl](https://github.com/daffl)) | ||
- chore\(release\): Initial setup for semantic-release [\#151](https://github.com/feathersjs-ecosystem/feathers-sync/pull/151) ([daffl](https://github.com/daffl)) | ||
## [v2.1.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v2.1.0) (2020-04-09) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v2.0.0...v2.1.0) | ||
**Closed issues:** | ||
- An in-range update of @feathersjs/feathers is breaking the build 🚨 [\#145](https://github.com/feathersjs-ecosystem/feathers-sync/issues/145) | ||
- An in-range update of @feathersjs/feathers is breaking the build 🚨 [\#141](https://github.com/feathersjs-ecosystem/feathers-sync/issues/141) | ||
- custom adapters app.sync.serialize is not a function [\#137](https://github.com/feathersjs-ecosystem/feathers-sync/issues/137) | ||
- TypeError: app.service\(...\).publish is not a function [\#131](https://github.com/feathersjs-ecosystem/feathers-sync/issues/131) | ||
**Merged pull requests:** | ||
- NATS support [\#149](https://github.com/feathersjs-ecosystem/feathers-sync/pull/149) ([ViljarVoidula](https://github.com/ViljarVoidula)) | ||
- Added support for using an existing Redis Client instead of creating … [\#146](https://github.com/feathersjs-ecosystem/feathers-sync/pull/146) ([fbarzin](https://github.com/fbarzin)) | ||
@@ -15,11 +48,33 @@ - Update redis to the latest version 🚀 [\#144](https://github.com/feathersjs-ecosystem/feathers-sync/pull/144) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) | ||
## [v2.0.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v2.0.0) (2019-11-15) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.2.0...v2.0.0) | ||
**Merged pull requests:** | ||
**Implemented enhancements:** | ||
- Is serialization of the complete context required in event ? [\#87](https://github.com/feathersjs-ecosystem/feathers-sync/issues/87) | ||
**Fixed bugs:** | ||
- Multiple notifications while using amqp [\#120](https://github.com/feathersjs-ecosystem/feathers-sync/issues/120) | ||
- Error: The field 'strict' is not a valid collection option [\#119](https://github.com/feathersjs-ecosystem/feathers-sync/issues/119) | ||
- getting error collection.find\(...\).sort\(...\).limit\(...\).nextObject is not a function [\#110](https://github.com/feathersjs-ecosystem/feathers-sync/issues/110) | ||
- Memory leak [\#94](https://github.com/feathersjs-ecosystem/feathers-sync/issues/94) | ||
- Mubsub: broken cursor [\#92](https://github.com/feathersjs-ecosystem/feathers-sync/issues/92) | ||
- Remove mubsub \(MongoDB\) adapter [\#135](https://github.com/feathersjs-ecosystem/feathers-sync/pull/135) ([daffl](https://github.com/daffl)) | ||
**Closed issues:** | ||
- mubsub nested dependency security issue [\#134](https://github.com/feathersjs-ecosystem/feathers-sync/issues/134) | ||
- Async MongoClient.connect and app mixins [\#125](https://github.com/feathersjs-ecosystem/feathers-sync/issues/125) | ||
## [v1.2.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.2.0) (2019-11-12) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.1.3...v1.2.0) | ||
**Closed issues:** | ||
- \# [\#133](https://github.com/feathersjs-ecosystem/feathers-sync/issues/133) | ||
- Using channels with feathers-sync [\#132](https://github.com/feathersjs-ecosystem/feathers-sync/issues/132) | ||
- Unable to use feathers-sync with sentinel setup [\#126](https://github.com/feathersjs-ecosystem/feathers-sync/issues/126) | ||
**Merged pull requests:** | ||
@@ -30,4 +85,12 @@ | ||
## [v1.1.3](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.1.3) (2019-10-22) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.1.2...v1.1.3) | ||
**Closed issues:** | ||
- An in-range update of mocha is breaking the build 🚨 [\#123](https://github.com/feathersjs-ecosystem/feathers-sync/issues/123) | ||
- An in-range update of amqplib is breaking the build 🚨 [\#118](https://github.com/feathersjs-ecosystem/feathers-sync/issues/118) | ||
- An in-range update of lodash is breaking the build 🚨 [\#116](https://github.com/feathersjs-ecosystem/feathers-sync/issues/116) | ||
- An in-range update of mocha is breaking the build 🚨 [\#115](https://github.com/feathersjs-ecosystem/feathers-sync/issues/115) | ||
**Merged pull requests:** | ||
@@ -40,4 +103,10 @@ | ||
## [v1.1.2](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.1.2) (2019-07-16) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.1.1...v1.1.2) | ||
**Closed issues:** | ||
- feathers-sync couldnt understand mongodb+srv [\#112](https://github.com/feathersjs-ecosystem/feathers-sync/issues/112) | ||
- An in-range update of lodash is breaking the build 🚨 [\#111](https://github.com/feathersjs-ecosystem/feathers-sync/issues/111) | ||
**Merged pull requests:** | ||
@@ -49,4 +118,14 @@ | ||
## [v1.1.1](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.1.1) (2019-01-31) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.1.0...v1.1.1) | ||
**Closed issues:** | ||
- Disabling synchronization on authentication doesn't work [\#106](https://github.com/feathersjs-ecosystem/feathers-sync/issues/106) | ||
- An in-range update of @feathersjs/feathers is breaking the build 🚨 [\#102](https://github.com/feathersjs-ecosystem/feathers-sync/issues/102) | ||
- An in-range update of debug is breaking the build 🚨 [\#101](https://github.com/feathersjs-ecosystem/feathers-sync/issues/101) | ||
- An in-range update of @feathersjs/feathers is breaking the build 🚨 [\#100](https://github.com/feathersjs-ecosystem/feathers-sync/issues/100) | ||
- An in-range update of amqplib is breaking the build 🚨 [\#99](https://github.com/feathersjs-ecosystem/feathers-sync/issues/99) | ||
- Bulk patching a service from within another service returns null values [\#96](https://github.com/feathersjs-ecosystem/feathers-sync/issues/96) | ||
**Merged pull requests:** | ||
@@ -58,4 +137,12 @@ | ||
## [v1.1.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.1.0) (2018-10-18) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.0.3...v1.1.0) | ||
**Closed issues:** | ||
- Question: Disable Sync for specific service or Method [\#95](https://github.com/feathersjs-ecosystem/feathers-sync/issues/95) | ||
- An in-range update of @feathersjs/feathers is breaking the build 🚨 [\#91](https://github.com/feathersjs-ecosystem/feathers-sync/issues/91) | ||
- An in-range update of lodash is breaking the build 🚨 [\#90](https://github.com/feathersjs-ecosystem/feathers-sync/issues/90) | ||
- An in-range update of debug is breaking the build 🚨 [\#88](https://github.com/feathersjs-ecosystem/feathers-sync/issues/88) | ||
**Merged pull requests:** | ||
@@ -67,4 +154,10 @@ | ||
## [v1.0.3](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.0.3) (2018-08-05) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.0.2...v1.0.3) | ||
**Closed issues:** | ||
- \[MongoDB\] Writing event fails when the hook context contains a query with a key starting with `$` [\#83](https://github.com/feathersjs-ecosystem/feathers-sync/issues/83) | ||
- Can't get it to work [\#80](https://github.com/feathersjs-ecosystem/feathers-sync/issues/80) | ||
**Merged pull requests:** | ||
@@ -75,4 +168,9 @@ | ||
## [v1.0.2](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.0.2) (2018-06-11) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.0.1...v1.0.2) | ||
**Closed issues:** | ||
- Does not send service events to client if service is connected to moongoose [\#50](https://github.com/feathersjs-ecosystem/feathers-sync/issues/50) | ||
**Merged pull requests:** | ||
@@ -83,7 +181,25 @@ | ||
## [v1.0.1](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.0.1) (2018-03-09) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v1.0.0...v1.0.1) | ||
**Closed issues:** | ||
- Server crashes when failing to connect to mongo or when connection is closed [\#43](https://github.com/feathersjs-ecosystem/feathers-sync/issues/43) | ||
## [v1.0.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v1.0.0) (2018-03-06) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v0.1.4...v1.0.0) | ||
**Closed issues:** | ||
- Pass a mongoDb Object as config.db [\#74](https://github.com/feathersjs-ecosystem/feathers-sync/issues/74) | ||
- Multiple services using the same Redis [\#73](https://github.com/feathersjs-ecosystem/feathers-sync/issues/73) | ||
- Add support for DynamoDB \(AmazonAWS\) [\#67](https://github.com/feathersjs-ecosystem/feathers-sync/issues/67) | ||
- Hook is not being emitted [\#32](https://github.com/feathersjs-ecosystem/feathers-sync/issues/32) | ||
- Add support for WebRTC [\#19](https://github.com/feathersjs-ecosystem/feathers-sync/issues/19) | ||
- Add support for Kafka [\#18](https://github.com/feathersjs-ecosystem/feathers-sync/issues/18) | ||
- Add support for SQS [\#17](https://github.com/feathersjs-ecosystem/feathers-sync/issues/17) | ||
- Solidify default options [\#16](https://github.com/feathersjs-ecosystem/feathers-sync/issues/16) | ||
- Add tests for RabbitMQ [\#15](https://github.com/feathersjs-ecosystem/feathers-sync/issues/15) | ||
**Merged pull requests:** | ||
@@ -98,4 +214,14 @@ | ||
## [v0.1.4](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v0.1.4) (2017-11-11) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v0.1.3...v0.1.4) | ||
**Closed issues:** | ||
- Little question i am Missing Something? [\#68](https://github.com/feathersjs-ecosystem/feathers-sync/issues/68) | ||
- An in-range update of redis is breaking the build 🚨 [\#65](https://github.com/feathersjs-ecosystem/feathers-sync/issues/65) | ||
- Node Crashes on user service `patch` or `put` requests [\#63](https://github.com/feathersjs-ecosystem/feathers-sync/issues/63) | ||
- Feathers-sync breaks when trying to authenticate [\#62](https://github.com/feathersjs-ecosystem/feathers-sync/issues/62) | ||
- An in-range update of feathers is breaking the build 🚨 [\#61](https://github.com/feathersjs-ecosystem/feathers-sync/issues/61) | ||
- \<delete me\> [\#60](https://github.com/feathersjs-ecosystem/feathers-sync/issues/60) | ||
**Merged pull requests:** | ||
@@ -107,7 +233,17 @@ | ||
## [v0.1.3](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v0.1.3) (2017-06-07) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v0.1.2...v0.1.3) | ||
**Fixed bugs:** | ||
- Mubsub config option fix [\#59](https://github.com/feathersjs-ecosystem/feathers-sync/pull/59) ([startupthekid](https://github.com/startupthekid)) | ||
**Closed issues:** | ||
- An in-range update of mocha is breaking the build 🚨 [\#58](https://github.com/feathersjs-ecosystem/feathers-sync/issues/58) | ||
- Scale server on kubernetes [\#55](https://github.com/feathersjs-ecosystem/feathers-sync/issues/55) | ||
- Mongo events don't get emitted on serverX [\#45](https://github.com/feathersjs-ecosystem/feathers-sync/issues/45) | ||
**Merged pull requests:** | ||
- Mubsub config option fix [\#59](https://github.com/feathersjs-ecosystem/feathers-sync/pull/59) ([startupthekid](https://github.com/startupthekid)) | ||
- Update semistandard to the latest version 🚀 [\#57](https://github.com/feathersjs-ecosystem/feathers-sync/pull/57) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) | ||
@@ -117,4 +253,14 @@ - Update dependencies to enable Greenkeeper 🌴 [\#56](https://github.com/feathersjs-ecosystem/feathers-sync/pull/56) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) | ||
## [v0.1.2](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v0.1.2) (2016-12-08) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v0.1.1...v0.1.2) | ||
**Closed issues:** | ||
- Real-time events doesn't fire when using Mongodb database adapter [\#26](https://github.com/feathersjs-ecosystem/feathers-sync/issues/26) | ||
- Add support for Redis [\#14](https://github.com/feathersjs-ecosystem/feathers-sync/issues/14) | ||
- Add support for RabbitMQ [\#13](https://github.com/feathersjs-ecosystem/feathers-sync/issues/13) | ||
- Event not fired in socket on client [\#11](https://github.com/feathersjs-ecosystem/feathers-sync/issues/11) | ||
- Link to sync in README is broken [\#8](https://github.com/feathersjs-ecosystem/feathers-sync/issues/8) | ||
- TypeError: Cannot read property 'split' of undefined [\#6](https://github.com/feathersjs-ecosystem/feathers-sync/issues/6) | ||
**Merged pull requests:** | ||
@@ -136,5 +282,14 @@ | ||
## [v0.1.1](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v0.1.1) (2016-01-30) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/v0.1.0...v0.1.1) | ||
**Closed issues:** | ||
- Error: Cannot find module 'feathers-sync' [\#5](https://github.com/feathersjs-ecosystem/feathers-sync/issues/5) | ||
- Plugin not published on Npm? [\#1](https://github.com/feathersjs-ecosystem/feathers-sync/issues/1) | ||
## [v0.1.0](https://github.com/feathersjs-ecosystem/feathers-sync/tree/v0.1.0) (2016-01-29) | ||
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-sync/compare/0b4c7f07decaf430e82f509210667e4464d595d6...v0.1.0) | ||
**Merged pull requests:** | ||
@@ -147,2 +302,2 @@ | ||
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* | ||
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* |
@@ -1,37 +0,69 @@ | ||
const amqplib = require('amqplib'); | ||
const amqpConnectionManager = require('amqp-connection-manager'); | ||
const debug = require('debug')('feathers-sync:amqp'); | ||
const core = require('../core'); | ||
module.exports = config => { | ||
const open = amqplib.connect(config.uri, config.amqpConnectionOptions); | ||
const { deserialize, serialize, key } = config; | ||
module.exports = (config) => { | ||
const amqpConnection = amqpConnectionManager.connect( | ||
[config.uri], | ||
config.amqpConnectionOptions | ||
); | ||
const { deserialize, serialize, key = 'feathersSync' } = config; | ||
debug(`Setting up AMQP connection ${config.uri}`); | ||
return app => { | ||
return (app) => { | ||
app.configure(core); | ||
const channelWrapper = amqpConnection.createChannel({ | ||
json: true, | ||
setup: async (channel) => { | ||
try { | ||
// Creates a broadcast channel | ||
await channel.assertExchange(key, 'fanout', { durable: false }); | ||
const ready = open.then(connection => connection.createChannel() | ||
.then(channel => { | ||
return channel.assertExchange(key, 'fanout', { durable: false }).then(() => { | ||
return channel.assertQueue('', { autoDelete: true }).then(q => { | ||
channel.bindQueue(q.queue, key, '').then(() => { | ||
channel.consume(q.queue, message => { | ||
if (message !== null) { | ||
debug(`Got ${key} event from APMQ channel`); | ||
app.emit('sync-in', message.content); | ||
} | ||
}, { noAck: true }); | ||
// Creates a queue and the data will be deleted after delivering being consumed. | ||
const { queue } = await channel.assertQueue('', { | ||
autoDelete: true | ||
}); | ||
// Binds the exchange broadcast to the queue | ||
await channel.bindQueue(queue, key, 'queue-binding'); | ||
app.on('sync-out', data => { | ||
debug(`Publishing ${key} event to APMQ channel`); | ||
channel.publish(key, '', Buffer.from(data)); | ||
}); | ||
return channel; | ||
}); | ||
// Send the message to the service | ||
channel.consume( | ||
queue, | ||
(message) => { | ||
if (message !== null) { | ||
debug(`Got ${key} event from APMQ channel`); | ||
app.emit('sync-in', message.content); | ||
} | ||
}, | ||
{ noAck: true } | ||
); | ||
// Publish the received message to the queue | ||
app.on('sync-out', (data) => { | ||
try { | ||
const publishResponse = channel.publish( | ||
key, | ||
queue, | ||
Buffer.from(data) | ||
); | ||
debug(`Publish success: |${publishResponse}| APMQ channel`); | ||
} catch (error) { | ||
debug(`Publish fail: |${error.message}| APMQ channel`); | ||
} | ||
}); | ||
}); | ||
}).then(channel => ({ connection, channel }))); | ||
return channel; | ||
} catch (error) { | ||
debug(`Publish fail: |${error.message}| APMQ channel`); | ||
} | ||
} | ||
}); | ||
const ready = new Promise((resolve, reject) => { | ||
channelWrapper.on('close', () => { | ||
reject(new Error('Channel was closed unexpectedly')); | ||
}); | ||
channelWrapper.on('connect', () => { | ||
resolve(); | ||
}); | ||
channelWrapper.on('error', (error) => { | ||
reject(new Error(error.message)); | ||
}); | ||
}); | ||
app.sync = { | ||
@@ -41,2 +73,3 @@ deserialize, | ||
ready, | ||
connection: amqpConnection, // can be useful for tracking amqp connection states | ||
type: 'amqp' | ||
@@ -43,0 +76,0 @@ }; |
@@ -17,8 +17,4 @@ const redis = require('redis'); | ||
const [pub, sub] = redisClient | ||
? [redisClient, redisClient.duplicate()] | ||
: [ | ||
redis.createClient(db, config.redisOptions), | ||
redis.createClient(db, config.redisOptions) | ||
]; | ||
const pub = redisClient || redis.createClient(db, config.redisOptions); | ||
const sub = pub.duplicate(); | ||
@@ -25,0 +21,0 @@ app.configure(core); |
{ | ||
"name": "feathers-sync", | ||
"description": "Feathers", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"repository": { | ||
@@ -22,5 +22,6 @@ "type": "git", | ||
"engines": { | ||
"node": ">= 6" | ||
"node": ">= 12" | ||
}, | ||
"main": "lib/", | ||
"types": "types/", | ||
"scripts": { | ||
@@ -47,2 +48,3 @@ "publish": "git push origin --tags && npm run changelog && git push origin", | ||
"dependencies": { | ||
"amqp-connection-manager": "^3.2.1", | ||
"amqplib": "^0.6.0", | ||
@@ -49,0 +51,0 @@ "debug": "^4.3.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152037
273
6
+ Addedamqp-connection-manager@3.9.0(transitive)
+ Addedpromise-breaker@5.0.0(transitive)