jason-rails 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff84a9e2b7cc044abeaa159eda7993a6296035403db2e86292f3919a1d462c6c
4
- data.tar.gz: eda4dae9f235460e7566a18f178c3f569c76a03cc68762a79a2bbfa52ca51ba4
3
+ metadata.gz: b766be80d826748b141369620c08ecd14c107b5473e47b5da61bcc30587f1f91
4
+ data.tar.gz: d3b7c5fbfe078bd6235ad623add82bc64b3f8ea3c022241b089b25604b5a657a
5
5
  SHA512:
6
- metadata.gz: fe0da2a182cabbff402b508f6155d97e6e4aad4985b52b1af294b45dbea43d0604659fa7018becd638134333bdab2b1b24ca9d5a67478e442770976d0275e225
7
- data.tar.gz: fe1c7c4b0e068efacc6c3734a5fe545cbabeaa6d68f1f680ed2455ebb02832eaccaf5442f2d0315091d44b7d0aa2d62773245e6df6b9f66d1c36b4f36cbda53c
6
+ metadata.gz: feeb87b727b1517b22885b94c0b88f35baa886caefb5514d30c919d7902f520f5530273887badff425cb14c6ba0e067ecc17106299d2f823bb51e0d0e740c1de
7
+ data.tar.gz: 179e9ea89836b4dae0f3402e99a640642e5b5dd06e47587e79fe20d0e672099f8df74b56242e200d403fd4de1cca17c305c4a2ff0d7c65c898daec7bdc6f913d
@@ -11,6 +11,7 @@ class Jason::JasonController < ::ApplicationController
11
11
  payload.merge!({
12
12
  pusherKey: Jason.pusher_key,
13
13
  pusherRegion: Jason.pusher_region,
14
+ pusherHost: Jason.pusher_host || nil,
14
15
  pusherChannelPrefix: Jason.pusher_channel_prefix
15
16
  })
16
17
  end
@@ -9,12 +9,16 @@ const uuid_1 = require("uuid");
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  function pusherAdapter(jasonConfig, handlePayload, dispatch) {
11
11
  const consumerId = uuid_1.v4();
12
- const { pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig;
13
- const pusher = new pusher_js_1.default(pusherKey, {
14
- cluster: 'eu',
12
+ const { pusherHost, pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig;
13
+ let config = {
14
+ cluster: pusherRegion,
15
15
  forceTLS: true,
16
- authEndpoint: '/jason/api/pusher/auth'
17
- });
16
+ authEndpoint: '/jason/api/pusher/auth',
17
+ };
18
+ if (pusherHost) {
19
+ config = Object.assign(Object.assign({}, config), { wsHost: pusherHost, httpHost: pusherHost });
20
+ }
21
+ const pusher = new pusher_js_1.default(pusherKey, config);
18
22
  pusher.connection.bind('state_change', ({ current }) => {
19
23
  if (current === 'connected') {
20
24
  dispatch({ type: 'jason/upsert', payload: { connected: true } });
data/client/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesr2323/jason",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "module": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {
@@ -7,10 +7,10 @@ export default function pusherAdapter(jasonConfig, handlePayload, dispatch) {
7
7
  const consumerId = uuidv4()
8
8
 
9
9
  const { pusherHost, pusherKey, pusherRegion, pusherChannelPrefix } = jasonConfig
10
- let config = {
10
+ let config : any = {
11
11
  cluster: pusherRegion,
12
12
  forceTLS: true,
13
- authEndpoint: '/jason/api/pusher/auth'
13
+ authEndpoint: '/jason/api/pusher/auth',
14
14
  }
15
15
  if (pusherHost) {
16
16
  config = {
@@ -76,4 +76,4 @@ export default function pusherAdapter(jasonConfig, handlePayload, dispatch) {
76
76
  }
77
77
 
78
78
  return { getPayload, createSubscription, removeSubscription }
79
- }
79
+ }
data/lib/jason/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jason
2
- VERSION = "0.8.6"
2
+ VERSION = "0.8.7"
3
3
  end
data/lib/jason.rb CHANGED
@@ -22,6 +22,7 @@ module Jason
22
22
  self.mattr_accessor :transport_service
23
23
  self.mattr_accessor :redis
24
24
  self.mattr_accessor :pusher
25
+ self.mattr_accessor :pusher_host
25
26
  self.mattr_accessor :pusher_key
26
27
  self.mattr_accessor :pusher_region
27
28
  self.mattr_accessor :pusher_channel_prefix
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jason-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Rees