salesforce_streamer 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/auto-approve.yml +3 -3
- data/.github/workflows/auto-merge.yml +19 -0
- data/Gemfile.lock +36 -32
- data/README.md +12 -0
- data/lib/salesforce_streamer/configuration.rb +7 -1
- data/lib/salesforce_streamer/server.rb +4 -1
- data/lib/salesforce_streamer/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b4745cb1c8f38229ac4be01e746a7b865458c37e0d293f3505bfe9803cce20c
|
4
|
+
data.tar.gz: 290378a24b830fedd86290a06deaf5050fd1187c22467cadc6b1278aee19cebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228d3f363b0b0bb292e94c4776c74fd8930f616250664fb586cfafa2695fcdde07f754f850c430e87ec12b9473046d733975d4c5ac3f9d9e70fd6be0ef8baa73
|
7
|
+
data.tar.gz: '0850171e7c9762b7cf498a8c9066b21482cab7e69f30d7a72d9cc0ca7b12c90ab5ea167ae312614d6d25060558cfd7aa2a880f60e6d7eaacf8229e916e14c61b'
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# automatically approve PRs submitted by Dependabot
|
1
|
+
# automatically approve PRs submitted by Dependabot or Renofidev
|
2
2
|
# this will allow Dependabot to automatically merge dependency update PRs where CI passes
|
3
3
|
# from: https://github.com/hmarr/auto-approve-action
|
4
|
-
name: Auto approve
|
4
|
+
name: Auto approve dependency upgrades PRs
|
5
5
|
|
6
6
|
on:
|
7
7
|
pull_request
|
@@ -11,6 +11,6 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
steps:
|
13
13
|
- uses: hmarr/auto-approve-action@v2.0.0
|
14
|
-
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
|
14
|
+
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' || github.actor == 'renofidev'
|
15
15
|
with:
|
16
16
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: automerge
|
2
|
+
on:
|
3
|
+
pull_request_review:
|
4
|
+
types:
|
5
|
+
- submitted
|
6
|
+
check_suite:
|
7
|
+
types:
|
8
|
+
- completed
|
9
|
+
status: {}
|
10
|
+
jobs:
|
11
|
+
automerge:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: automerge
|
15
|
+
uses: "pascalgn/automerge-action@v0.11.0"
|
16
|
+
env:
|
17
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
18
|
+
MERGE_METHOD: squash
|
19
|
+
MERGE_DELETE_BRANCH: true
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
salesforce_streamer (2.
|
4
|
+
salesforce_streamer (2.2.0)
|
5
5
|
dry-initializer (~> 3.0)
|
6
6
|
faye (~> 1.4)
|
7
7
|
restforce (>= 4.2, < 6.0)
|
@@ -13,13 +13,13 @@ GEM
|
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
14
|
ast (2.4.1)
|
15
15
|
byebug (11.1.3)
|
16
|
-
codecov (0.2.
|
16
|
+
codecov (0.2.12)
|
17
17
|
json
|
18
18
|
simplecov
|
19
19
|
cookiejar (0.3.3)
|
20
20
|
diff-lcs (1.4.4)
|
21
21
|
docile (1.3.2)
|
22
|
-
dry-initializer (3.0.
|
22
|
+
dry-initializer (3.0.4)
|
23
23
|
em-http-request (1.1.7)
|
24
24
|
addressable (>= 2.3.4)
|
25
25
|
cookiejar (!= 0.3.1)
|
@@ -29,8 +29,9 @@ GEM
|
|
29
29
|
em-socksify (0.3.2)
|
30
30
|
eventmachine (>= 1.0.0.beta.4)
|
31
31
|
eventmachine (1.2.7)
|
32
|
-
faraday (1.0
|
32
|
+
faraday (1.1.0)
|
33
33
|
multipart-post (>= 1.2, < 3)
|
34
|
+
ruby2_keywords
|
34
35
|
faraday_middleware (1.0.0)
|
35
36
|
faraday (~> 1.0)
|
36
37
|
faye (1.4.0)
|
@@ -50,53 +51,56 @@ GEM
|
|
50
51
|
jwt (2.2.2)
|
51
52
|
multi_json (1.15.0)
|
52
53
|
multipart-post (2.1.1)
|
53
|
-
parallel (1.
|
54
|
-
parser (2.7.
|
54
|
+
parallel (1.20.0)
|
55
|
+
parser (2.7.2.0)
|
55
56
|
ast (~> 2.4.1)
|
56
|
-
public_suffix (4.0.
|
57
|
+
public_suffix (4.0.6)
|
57
58
|
rack (2.2.3)
|
58
59
|
rainbow (3.0.0)
|
59
60
|
rake (13.0.1)
|
60
|
-
regexp_parser (1.
|
61
|
-
restforce (5.0.
|
61
|
+
regexp_parser (1.8.2)
|
62
|
+
restforce (5.0.3)
|
62
63
|
faraday (>= 0.9.0, <= 2.0)
|
63
64
|
faraday_middleware (>= 0.8.8, <= 2.0)
|
64
65
|
hashie (>= 1.2.0, < 5.0)
|
65
66
|
jwt (>= 1.5.6)
|
66
67
|
rexml (3.2.4)
|
67
|
-
rspec (3.
|
68
|
-
rspec-core (~> 3.
|
69
|
-
rspec-expectations (~> 3.
|
70
|
-
rspec-mocks (~> 3.
|
71
|
-
rspec-core (3.
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-expectations (3.
|
68
|
+
rspec (3.10.0)
|
69
|
+
rspec-core (~> 3.10.0)
|
70
|
+
rspec-expectations (~> 3.10.0)
|
71
|
+
rspec-mocks (~> 3.10.0)
|
72
|
+
rspec-core (3.10.0)
|
73
|
+
rspec-support (~> 3.10.0)
|
74
|
+
rspec-expectations (3.10.0)
|
74
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-mocks (3.
|
76
|
+
rspec-support (~> 3.10.0)
|
77
|
+
rspec-mocks (3.10.0)
|
77
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
-
rspec-support (~> 3.
|
79
|
-
rspec-support (3.
|
80
|
-
rubocop (
|
79
|
+
rspec-support (~> 3.10.0)
|
80
|
+
rspec-support (3.10.0)
|
81
|
+
rubocop (1.2.0)
|
81
82
|
parallel (~> 1.10)
|
82
|
-
parser (>= 2.7.1.
|
83
|
+
parser (>= 2.7.1.5)
|
83
84
|
rainbow (>= 2.2.2, < 4.0)
|
84
|
-
regexp_parser (>= 1.
|
85
|
+
regexp_parser (>= 1.8)
|
85
86
|
rexml
|
86
|
-
rubocop-ast (>= 0.
|
87
|
+
rubocop-ast (>= 1.0.1)
|
87
88
|
ruby-progressbar (~> 1.7)
|
88
89
|
unicode-display_width (>= 1.4.0, < 2.0)
|
89
|
-
rubocop-ast (
|
90
|
-
parser (>= 2.7.1.
|
91
|
-
rubocop-performance (1.
|
92
|
-
rubocop (>= 0.
|
93
|
-
|
94
|
-
|
90
|
+
rubocop-ast (1.1.1)
|
91
|
+
parser (>= 2.7.1.5)
|
92
|
+
rubocop-performance (1.8.1)
|
93
|
+
rubocop (>= 0.87.0)
|
94
|
+
rubocop-ast (>= 0.4.0)
|
95
|
+
rubocop-rspec (2.0.0)
|
96
|
+
rubocop (~> 1.0)
|
97
|
+
rubocop-ast (>= 1.1.0)
|
95
98
|
ruby-progressbar (1.10.1)
|
96
|
-
|
99
|
+
ruby2_keywords (0.0.2)
|
100
|
+
simplecov (0.19.1)
|
97
101
|
docile (~> 1.1)
|
98
102
|
simplecov-html (~> 0.11)
|
99
|
-
simplecov-html (0.12.
|
103
|
+
simplecov-html (0.12.3)
|
100
104
|
unicode-display_width (1.7.0)
|
101
105
|
websocket-driver (0.7.3)
|
102
106
|
websocket-extensions (>= 0.1.0)
|
data/README.md
CHANGED
@@ -91,6 +91,7 @@ SalesforceStreamer.configure do |config|
|
|
91
91
|
config.exception_adapter = proc { |e| puts e }
|
92
92
|
config.replay_adapter = MyReplayAdapter
|
93
93
|
config.use_middleware AfterMessageReceived
|
94
|
+
config.use_faye_extension ErrorLoggingExtension.new
|
94
95
|
config.manage_topics = true
|
95
96
|
end
|
96
97
|
```
|
@@ -173,6 +174,17 @@ end
|
|
173
174
|
|
174
175
|
This adapter will be used directly by `Restforce::ReplayExtension`.
|
175
176
|
|
177
|
+
### Use Faye Extension
|
178
|
+
|
179
|
+
The `config.use_faye_extension` should be given an object that responds to
|
180
|
+
`.incoming(message, callback)` or `.outgoing(message, callback)` or both. Find
|
181
|
+
out more about extensions from
|
182
|
+
[Faye](https://github.com/faye/faye/blob/master/spec/ruby/server/extensions_spec.rb)
|
183
|
+
specs.
|
184
|
+
|
185
|
+
Any configured extensions are added to the Faye client used by the Restforce
|
186
|
+
client when starting up the server.
|
187
|
+
|
176
188
|
## Development
|
177
189
|
|
178
190
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -3,7 +3,7 @@ module SalesforceStreamer
|
|
3
3
|
class Configuration
|
4
4
|
attr_accessor :environment, :logger, :require_path, :config_file,
|
5
5
|
:manage_topics, :exception_adapter, :replay_adapter
|
6
|
-
attr_reader :middleware
|
6
|
+
attr_reader :middleware, :faye_extensions
|
7
7
|
|
8
8
|
class << self
|
9
9
|
attr_writer :instance
|
@@ -26,6 +26,7 @@ module SalesforceStreamer
|
|
26
26
|
@config_file = './config/streamer.yml'
|
27
27
|
@require_path = './config/environment'
|
28
28
|
@middleware = []
|
29
|
+
@faye_extensions = [ReplayIdErrorExtension.new]
|
29
30
|
end
|
30
31
|
|
31
32
|
def manage_topics?
|
@@ -37,6 +38,11 @@ module SalesforceStreamer
|
|
37
38
|
@middleware << [klass, args, block]
|
38
39
|
end
|
39
40
|
|
41
|
+
# adds a Faye extension
|
42
|
+
def use_faye_extension(extension)
|
43
|
+
@faye_extensions << extension
|
44
|
+
end
|
45
|
+
|
40
46
|
# returns a ready to use chain of middleware
|
41
47
|
def middleware_runner(last_handler)
|
42
48
|
@middleware.reduce(last_handler) do |next_handler, current_handler|
|
@@ -27,7 +27,10 @@ module SalesforceStreamer
|
|
27
27
|
return @client if @client
|
28
28
|
@client = Restforce.new
|
29
29
|
@client.authenticate!
|
30
|
-
|
30
|
+
Configuration.instance.faye_extensions.each do |extension|
|
31
|
+
Log.debug %(adding Faye extension #{extension})
|
32
|
+
@client.faye.add_extension extension
|
33
|
+
end
|
31
34
|
@client
|
32
35
|
end
|
33
36
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce_streamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Serok
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-initializer
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- ".github/ISSUE_TEMPLATE/story.md"
|
173
173
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
174
174
|
- ".github/workflows/auto-approve.yml"
|
175
|
+
- ".github/workflows/auto-merge.yml"
|
175
176
|
- ".gitignore"
|
176
177
|
- ".rspec"
|
177
178
|
- ".travis.yml"
|
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
219
|
- !ruby/object:Gem::Version
|
219
220
|
version: '0'
|
220
221
|
requirements: []
|
221
|
-
rubygems_version: 3.1.
|
222
|
+
rubygems_version: 3.1.4
|
222
223
|
signing_key:
|
223
224
|
specification_version: 4
|
224
225
|
summary: A wrapper around the Restforce Streaming API with a built-in PushTopic manager.
|