slack-ruby-client 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/danger.yml +19 -0
  3. data/.github/workflows/integtest.yml +25 -0
  4. data/.github/workflows/rubocop.yml +13 -0
  5. data/.github/workflows/test.yml +34 -0
  6. data/.gitignore +5 -3
  7. data/.rubocop.yml +2 -1
  8. data/.rubocop_todo.yml +86 -26
  9. data/CHANGELOG.md +13 -0
  10. data/CONTRIBUTING.md +1 -1
  11. data/Gemfile +18 -1
  12. data/Gemfile.danger +6 -0
  13. data/README.md +3 -2
  14. data/RELEASING.md +1 -1
  15. data/bin/commands/admin_apps_requests.rb +11 -0
  16. data/bin/commands/admin_conversations.rb +1 -0
  17. data/bin/commands/admin_emoji.rb +2 -2
  18. data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
  19. data/bin/commands/apps_manifest.rb +1 -0
  20. data/bin/commands/bookmarks.rb +52 -0
  21. data/bin/commands/team.rb +1 -0
  22. data/bin/commands.rb +2 -0
  23. data/lib/slack/real_time/client.rb +2 -2
  24. data/lib/slack/version.rb +1 -1
  25. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +16 -0
  26. data/lib/slack/web/api/endpoints/admin_conversations.rb +2 -0
  27. data/lib/slack/web/api/endpoints/admin_emoji.rb +2 -2
  28. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  29. data/lib/slack/web/api/endpoints/apps_manifest.rb +2 -0
  30. data/lib/slack/web/api/endpoints/bookmarks.rb +86 -0
  31. data/lib/slack/web/api/endpoints/chat.rb +1 -1
  32. data/lib/slack/web/api/endpoints/team.rb +2 -0
  33. data/lib/slack/web/api/endpoints.rb +4 -0
  34. data/lib/slack/web/api/errors.rb +28 -2
  35. data/lib/slack/web/api/patches/chat.1.patch +1 -1
  36. data/lib/slack/web/faraday/connection.rb +4 -4
  37. data/lib/slack/web/faraday/request.rb +2 -0
  38. data/lib/slack/web/faraday/response/raise_error.rb +2 -10
  39. data/lib/slack/web/faraday/response/wrap_error.rb +1 -1
  40. data/lib/slack-ruby-client.rb +2 -1
  41. data/lib/tasks/real_time.rake +1 -3
  42. data/slack-ruby-client.gemspec +5 -13
  43. data/spec/integration/integration_spec.rb +1 -1
  44. data/spec/slack/events/request_spec.rb +1 -1
  45. data/spec/slack/real_time/client_spec.rb +20 -18
  46. data/spec/slack/real_time/event_handlers/channel_spec.rb +8 -8
  47. data/spec/slack/real_time/event_handlers/group_spec.rb +2 -2
  48. data/spec/slack/real_time/event_handlers/im_spec.rb +2 -2
  49. data/spec/slack/real_time/store_spec.rb +2 -2
  50. data/spec/slack/slack_spec.rb +4 -4
  51. data/spec/slack/version_spec.rb +1 -1
  52. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
  53. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
  54. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
  55. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +28 -16
  56. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +4 -2
  57. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +22 -14
  58. data/spec/slack/web/api/pagination/cursor_spec.rb +7 -7
  59. data/spec/slack/web/client_spec.rb +25 -7
  60. data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -1
  61. data/spec/support/real_time/connected_client.rb +1 -1
  62. metadata +25 -154
  63. data/.travis.yml +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fa18d8339ff27661d942ef4d0cee003ff8e1146db504063a736374c5f5bf940
4
- data.tar.gz: fc3bca990c3ad938a23db950b2008932a29518363360ada378856e71f2c1b477
3
+ metadata.gz: 243d21fccb29fbddcaac69727c60a1a947e5b7e3a53136f96953099539141ae6
4
+ data.tar.gz: dcfeabe229a37247b94e4e030a5abf675792835b061a7917afdfcbd9827f4228
5
5
  SHA512:
6
- metadata.gz: 932b6be224f16a7873a24907074944eea9ac8fcb47e35f7f9ef876d11df396197771c44727738b63267e4da45cd5c2050084972844a76fa6134fc54e2a9aa0d6
7
- data.tar.gz: 8a5904155cd7b3d52fbeca8c9a0887bca7eabe4bb4b668174aa4accb5cfefb7784ec91f3e3d9182fef44d6a994168b72c4530c36a74cf2d7564eec6a0e204ea5
6
+ metadata.gz: 5891098e3cb0bb938241157c779c0a8cdac0e18edac21d0251dd80949c5d70f21cc3429773138fc0092e29937f4f525d51f9975a4aa0f059a7cfbcb78a3c3723
7
+ data.tar.gz: 05a88513dad67cf2dc50dd2580a50588d99413801498fc959c495234955c419b5a861c86b8c98bef49ea50dfabb346aa26356c406a521f084555cece9249d364
@@ -0,0 +1,19 @@
1
+ name: PR Linter
2
+ on: [pull_request]
3
+ jobs:
4
+ danger:
5
+ runs-on: ubuntu-latest
6
+ env:
7
+ BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ with:
11
+ fetch-depth: 0
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.6
15
+ bundler-cache: true
16
+ - run: |
17
+ # the personal token is public, this is ok, base64 encode to avoid tripping Github
18
+ TOKEN=$(echo -n NWY1ZmM5MzEyMzNlYWY4OTZiOGU3MmI3MWQ3Mzk0MzgxMWE4OGVmYwo= | base64 --decode)
19
+ DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
@@ -0,0 +1,25 @@
1
+ name: Integration Tests
2
+ on: [push]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ entry:
9
+ - { ruby: 2.7.1, concurrency: async-websocket }
10
+ name: test (ruby=${{ matrix.entry.ruby }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Install Ruby
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.entry.ruby }}
17
+ - name: Run Tests
18
+ env:
19
+ CONCURRENCY: ${{ matrix.entry.concurrency }}
20
+ SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
21
+ RACK_ENV: test
22
+ run: |
23
+ bundle install
24
+ bundle exec rake
25
+
@@ -0,0 +1,13 @@
1
+ name: Rubocop
2
+ on: [push, pull_request]
3
+ jobs:
4
+ lint:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v2
8
+ - name: Set up Ruby
9
+ uses: ruby/setup-ruby@v1
10
+ with:
11
+ ruby-version: 2.7
12
+ bundler-cache: true
13
+ - run: bundle exec rubocop
@@ -0,0 +1,34 @@
1
+ name: Tests
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ entry:
9
+ - { ruby: "2.7" }
10
+ - { ruby: "2.7", concurrency: async-websocket }
11
+ - { ruby: "3.0" }
12
+ - { ruby: "3.1" }
13
+ - { ruby: ruby-head, ignore: true }
14
+ - { ruby: jruby-head, ignore: true }
15
+ name: test (ruby=${{ matrix.entry.ruby }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Install Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.entry.ruby }}
22
+ - name: Set Concurrency
23
+ run: |
24
+ if [[ ! -z "${{ matrix.entry.concurrency }}" ]]; then
25
+ echo "Setting concurrency to ${{ matrix.entry.concurrency }}."
26
+ echo "CONCURRENCY=${{ matrix.entry.concurrency }}" >> $GITHUB_ENV
27
+ fi
28
+ - name: Run Tests
29
+ continue-on-error: ${{ matrix.entry.ignore || false }}
30
+ env:
31
+ RACK_ENV: test
32
+ run: |
33
+ bundle install
34
+ bundle exec rake
data/.gitignore CHANGED
@@ -1,7 +1,9 @@
1
- .env
2
- pkg
3
- Gemfile.lock
4
1
  .DS_Store
5
2
  .bundle
3
+ .byebug_history
4
+ .env
6
5
  .idea
7
6
  .rspec_status
7
+ .ruby-version
8
+ Gemfile.lock
9
+ pkg
data/.rubocop.yml CHANGED
@@ -2,10 +2,11 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  require:
4
4
  - rubocop-performance
5
+ - rubocop-rake
5
6
  - rubocop-rspec
6
7
 
7
8
  AllCops:
8
- TargetRubyVersion: 2.5
9
+ TargetRubyVersion: 2.7
9
10
  NewCops: enable
10
11
  DisplayCopNames: true
11
12
  Exclude:
data/.rubocop_todo.yml CHANGED
@@ -1,22 +1,29 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-12-21 14:31:33 UTC using RuboCop version 0.93.1.
3
+ # on 2022-05-04 06:11:49 UTC using RuboCop version 1.26.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
- # Configuration parameters: Include.
11
- # Include: **/*.gemspec
12
- Gemspec/RequiredRubyVersion:
10
+ # Configuration parameters: AllowedMethods.
11
+ # AllowedMethods: enums
12
+ Lint/ConstantDefinitionInBlock:
13
13
  Exclude:
14
- - 'slack-ruby-client.gemspec'
14
+ - 'lib/tasks/real_time.rake'
15
15
 
16
16
  # Offense count: 1
17
- Lint/ConstantDefinitionInBlock:
17
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
18
+ Lint/EmptyBlock:
18
19
  Exclude:
19
- - 'lib/tasks/real_time.rake'
20
+ - 'spec/support/real_time/concurrency/mock.rb'
21
+
22
+ # Offense count: 1
23
+ # Configuration parameters: AllowComments.
24
+ Lint/EmptyClass:
25
+ Exclude:
26
+ - 'spec/support/real_time/concurrency/mock.rb'
20
27
 
21
28
  # Offense count: 2
22
29
  Lint/MissingSuper:
@@ -25,19 +32,19 @@ Lint/MissingSuper:
25
32
  - 'lib/slack/real_time/stores/store.rb'
26
33
 
27
34
  # Offense count: 1
28
- # Cop supports --auto-correct.
35
+ # This cop supports unsafe auto-correction (--auto-correct-all).
29
36
  Lint/NonDeterministicRequireOrder:
30
37
  Exclude:
31
38
  - 'spec/spec_helper.rb'
32
39
 
33
40
  # Offense count: 2
34
- # Cop supports --auto-correct.
41
+ # This cop supports safe auto-correction (--auto-correct).
35
42
  Lint/RedundantCopDisableDirective:
36
43
  Exclude:
37
44
  - 'lib/slack-ruby-client.rb'
38
45
 
39
46
  # Offense count: 12
40
- # Configuration parameters: IgnoredMethods.
47
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
41
48
  Metrics/AbcSize:
42
49
  Max: 48
43
50
 
@@ -47,12 +54,12 @@ Metrics/CyclomaticComplexity:
47
54
  Max: 14
48
55
 
49
56
  # Offense count: 12
50
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
57
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
51
58
  Metrics/MethodLength:
52
59
  Max: 32
53
60
 
54
61
  # Offense count: 1
55
- # Configuration parameters: CountKeywordArgs.
62
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
56
63
  Metrics/ParameterLists:
57
64
  Max: 6
58
65
 
@@ -61,14 +68,26 @@ Metrics/ParameterLists:
61
68
  Metrics/PerceivedComplexity:
62
69
  Max: 16
63
70
 
71
+ # Offense count: 1
72
+ # Configuration parameters: MinSize.
73
+ Performance/CollectionLiteralInLoop:
74
+ Exclude:
75
+ - 'lib/tasks/real_time.rake'
76
+
64
77
  # Offense count: 2
65
- # Cop supports --auto-correct.
78
+ # This cop supports safe auto-correction (--auto-correct).
66
79
  Performance/RegexpMatch:
67
80
  Exclude:
68
81
  - 'lib/tasks/web.rake'
69
82
 
70
83
  # Offense count: 3
71
- # Cop supports --auto-correct.
84
+ # This cop supports safe auto-correction (--auto-correct).
85
+ Performance/StringInclude:
86
+ Exclude:
87
+ - 'lib/tasks/web.rake'
88
+
89
+ # Offense count: 3
90
+ # This cop supports safe auto-correction (--auto-correct).
72
91
  RSpec/ContextMethod:
73
92
  Exclude:
74
93
  - 'spec/slack/messages/formatting_spec.rb'
@@ -81,18 +100,19 @@ RSpec/ContextWording:
81
100
  Enabled: false
82
101
 
83
102
  # Offense count: 127
84
- # Cop supports --auto-correct.
103
+ # This cop supports safe auto-correction (--auto-correct).
85
104
  # Configuration parameters: AllowConsecutiveOneLiners.
86
105
  RSpec/EmptyLineAfterExample:
87
106
  Enabled: false
88
107
 
89
- # Offense count: 62
90
- # Configuration parameters: Max.
108
+ # Offense count: 64
109
+ # Configuration parameters: CountAsOne.
91
110
  RSpec/ExampleLength:
92
- Enabled: false
111
+ Max: 18
93
112
 
94
- # Offense count: 16
95
- # Configuration parameters: CustomTransform, IgnoreMethods.
113
+ # Offense count: 17
114
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
115
+ # Include: **/*_spec*rb*, **/spec/**/*
96
116
  RSpec/FilePath:
97
117
  Enabled: false
98
118
 
@@ -102,26 +122,46 @@ RSpec/FilePath:
102
122
  RSpec/MessageSpies:
103
123
  EnforcedStyle: receive
104
124
 
105
- # Offense count: 95
125
+ # Offense count: 96
106
126
  RSpec/MultipleExpectations:
107
127
  Max: 5
108
128
 
129
+ # Offense count: 5
130
+ # Configuration parameters: AllowSubject.
131
+ RSpec/MultipleMemoizedHelpers:
132
+ Max: 9
133
+
109
134
  # Offense count: 3
110
135
  # Configuration parameters: IgnoreSharedExamples.
111
136
  RSpec/NamedSubject:
112
137
  Exclude:
113
138
  - 'spec/slack/web/api/mixins/conversations_list_spec.rb'
114
139
 
115
- # Offense count: 48
140
+ # Offense count: 50
116
141
  RSpec/NestedGroups:
117
142
  Max: 6
118
143
 
144
+ # Offense count: 6
145
+ RSpec/StubbedMock:
146
+ Exclude:
147
+ - 'spec/slack/real_time/client_spec.rb'
148
+ - 'spec/slack/real_time/event_handlers/event_handlers_spec.rb'
149
+ - 'spec/slack/web/api/pagination/cursor_spec.rb'
150
+ - 'spec/slack/web/client_spec.rb'
151
+
119
152
  # Offense count: 2
120
153
  RSpec/SubjectStub:
121
154
  Exclude:
122
155
  - 'spec/slack/web/api/mixins/conversations_spec.rb'
123
156
  - 'spec/slack/web/api/mixins/users_spec.rb'
124
157
 
158
+ # Offense count: 4
159
+ # This cop supports safe auto-correction (--auto-correct).
160
+ # Configuration parameters: .
161
+ # SupportedStyles: constant, string
162
+ RSpec/VerifiedDoubleReference:
163
+ EnforcedStyle: string
164
+
125
165
  # Offense count: 12
126
166
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
127
167
  RSpec/VerifiedDoubles:
@@ -131,14 +171,20 @@ RSpec/VerifiedDoubles:
131
171
  - 'spec/slack/web/faraday/response/raise_error_spec.rb'
132
172
  - 'spec/support/real_time/connected_client.rb'
133
173
 
174
+ # Offense count: 1
175
+ # This cop supports safe auto-correction (--auto-correct).
176
+ Rake/Desc:
177
+ Exclude:
178
+ - 'lib/tasks/git.rake'
179
+
134
180
  # Offense count: 4
135
- # Configuration parameters: .
181
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
136
182
  # SupportedStyles: annotated, template, unannotated
137
183
  Style/FormatStringToken:
138
184
  EnforcedStyle: unannotated
139
185
 
140
186
  # Offense count: 6
141
- # Cop supports --auto-correct.
187
+ # This cop supports safe auto-correction (--auto-correct).
142
188
  Style/GlobalStdStream:
143
189
  Exclude:
144
190
  - 'lib/slack/logger.rb'
@@ -147,11 +193,18 @@ Style/GlobalStdStream:
147
193
  - 'spec/slack/web/client_spec.rb'
148
194
 
149
195
  # Offense count: 1
150
- # Cop supports --auto-correct.
196
+ # This cop supports safe auto-correction (--auto-correct).
151
197
  Style/MultilineTernaryOperator:
152
198
  Exclude:
153
199
  - 'spec/support/vcr.rb'
154
200
 
201
+ # Offense count: 3
202
+ Style/OpenStructUse:
203
+ Exclude:
204
+ - 'spec/slack/web/api/endpoints/custom_specs/chat_spec.rb'
205
+ - 'spec/slack/web/api/pagination/cursor_spec.rb'
206
+ - 'spec/slack/web/faraday/response/raise_error_spec.rb'
207
+
155
208
  # Offense count: 1
156
209
  # Configuration parameters: AllowedMethods.
157
210
  # AllowedMethods: respond_to_missing?
@@ -160,7 +213,14 @@ Style/OptionalBooleanParameter:
160
213
  - 'spec/support/queue_with_timeout.rb'
161
214
 
162
215
  # Offense count: 1
163
- # Cop supports --auto-correct.
216
+ # This cop supports unsafe auto-correction (--auto-correct-all).
217
+ Style/SlicingWithRange:
218
+ Exclude:
219
+ - 'lib/slack/web/api/mixins/ids.id.rb'
220
+
221
+ # Offense count: 1
222
+ # This cop supports unsafe auto-correction (--auto-correct-all).
223
+ # Configuration parameters: Mode.
164
224
  Style/StringConcatenation:
165
225
  Exclude:
166
226
  - 'lib/tasks/real_time.rake'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 1.1.0 (2022/06/05)
2
+
3
+ * [#400](https://github.com/slack-ruby/slack-ruby-client/pull/400): Replace Travis-CI with GitHub Actions - [@dblock](https://github.com/dblock).
4
+ * [#401](https://github.com/slack-ruby/slack-ruby-client/pull/401): Upgraded RuboCop to 1.26.0 - [@dblock](https://github.com/dblock).
5
+ * [#401](https://github.com/slack-ruby/slack-ruby-client/pull/401): Added support for Ruby 3.1.1 - [@dblock](https://github.com/dblock).
6
+ * [#405](https://github.com/slack-ruby/slack-ruby-client/pull/405): Added `admin_apps_requests_cancel`, `admin_users_unsupportedVersions_export`, `bookmarks_add`, `bookmarks_edit`, `bookmarks_list`, `bookmarks_remove` - [@dblock](https://github.com/dblock).
7
+ * [#404](https://github.com/slack-ruby/slack-ruby-client/pull/404): Update `chat_update` method not to raise error with parameter which contains only `reply_broadcast` - [@colorbox](https://github.com/colorbox).
8
+ * [#406](https://github.com/slack-ruby/slack-ruby-client/pull/406): Update Faraday to `>= 2.0` - [@schinery](https://github.com/slack-ruby/slack-ruby-client/pull/406).
9
+ * [#406](https://github.com/slack-ruby/slack-ruby-client/pull/406): Removed support for Ruby 2.5 and 2.6 - [@schinery](https://github.com/slack-ruby/slack-ruby-client/pull/406).
10
+ * [#406](https://github.com/slack-ruby/slack-ruby-client/pull/406): Test against latest Ruby 2.7, 3.0 and 3.1 - [@schinery](https://github.com/slack-ruby/slack-ruby-client/pull/406).
11
+ * [#406](https://github.com/slack-ruby/slack-ruby-client/pull/406): Upgraded RuboCop to 1.26.1 and lock to version - [@schinery](https://github.com/slack-ruby/slack-ruby-client/pull/406).
12
+ * [#406](https://github.com/slack-ruby/slack-ruby-client/pull/406): Updated Danger PR Linter GitHub action to use separate `Gemfile` - [@schinery](https://github.com/slack-ruby/slack-ruby-client/pull/406).
13
+
1
14
  ### 1.0.0 (2021/12/21)
2
15
 
3
16
  * [#394](https://github.com/slack-ruby/slack-ruby-client/pull/394): Added support for Ruby 3.0 - [@dblock](https://github.com/dblock).
data/CONTRIBUTING.md CHANGED
@@ -157,7 +157,7 @@ git push origin my-feature-branch -f
157
157
 
158
158
  ### Check on Your Pull Request
159
159
 
160
- Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
160
+ Go back to your pull request after a few minutes and see whether it passed muster with CI. Everything should look green, otherwise fix issues and amend your commit as described above.
161
161
 
162
162
  ### Be Patient
163
163
 
data/Gemfile CHANGED
@@ -13,5 +13,22 @@ if ENV.key?('CONCURRENCY')
13
13
  end
14
14
 
15
15
  group :test do
16
- gem 'slack-ruby-danger', '~> 0.2.0', require: false
16
+ gem 'activesupport'
17
+ gem 'erubis'
18
+ gem 'faraday-typhoeus'
19
+ gem 'json-schema'
20
+ gem 'rake', '~> 13'
21
+ gem 'rspec'
22
+ gem 'rubocop', '1.26.1' # Lock to specific version to avoid breaking cops/changes
23
+ gem 'rubocop-performance'
24
+ gem 'rubocop-rake'
25
+ gem 'rubocop-rspec'
26
+ gem 'timecop'
27
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
28
+ # https://github.com/vcr/vcr/pull/907
29
+ gem 'vcr', github: 'vcr/vcr', ref: '7ac8292c'
30
+ else
31
+ gem 'vcr'
32
+ end
33
+ gem 'webmock'
17
34
  end
data/Gemfile.danger ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :test do
4
+ gem 'danger-toc', '~> 0.2.0', require: false
5
+ gem 'slack-ruby-danger', '~> 0.2.0', require: false
6
+ end
data/README.md CHANGED
@@ -2,7 +2,8 @@ Slack Ruby Client
2
2
  =================
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/slack-ruby-client.svg)](http://badge.fury.io/rb/slack-ruby-client)
5
- [![Build Status](https://app.travis-ci.com/slack-ruby/slack-ruby-client.svg?branch=master)](https://app.travis-ci.com/slack-ruby/slack-ruby-client)
5
+ [![Integration Tests](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integtest.yml/badge.svg?branch=master)](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integtest.yml)
6
+ [![Tests](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/test.yml)
6
7
  [![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client)
7
8
 
8
9
  A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messaging](https://api.slack.com/rtm) and [Events](https://api.slack.com/events-api) APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html).
@@ -70,7 +71,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
70
71
 
71
72
  ## Stable Release
72
73
 
73
- You're reading the documentation for the **stable** release of slack-ruby-client, v1.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
74
+ You're reading the documentation for the **stable** release of slack-ruby-client, 1.1.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
74
75
 
75
76
  ## Installation
76
77
 
data/RELEASING.md CHANGED
@@ -11,7 +11,7 @@ bundle install
11
11
  rake
12
12
  ```
13
13
 
14
- Check that the last build succeeded in [Travis CI](https://app.travis-ci.com/github/slack-ruby/slack-ruby-client) for all supported platforms.
14
+ Check that the last build succeeded in [GitHub Actions](https://github.com/slack-ruby/slack-ruby-client/actions) for all supported platforms.
15
15
 
16
16
  Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.
17
17
 
@@ -3,6 +3,17 @@
3
3
 
4
4
  desc 'AdminAppsRequests methods.'
5
5
  command 'admin_apps_requests' do |g|
6
+ g.desc 'Cancel approval request for team'
7
+ g.long_desc %( Cancel approval request for team )
8
+ g.command 'cancel' do |c|
9
+ c.flag 'request_id', desc: 'The id of the request to cancel.'
10
+ c.flag 'enterprise_id', desc: 'The ID of the enterprise where this request belongs.'
11
+ c.flag 'team_id', desc: 'The ID of the workspace where this request belongs.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_apps_requests_cancel(options))
14
+ end
15
+ end
16
+
6
17
  g.desc 'List app requests for a team/workspace.'
7
18
  g.long_desc %( List app requests for a team/workspace. )
8
19
  g.command 'list' do |c|
@@ -16,6 +16,7 @@ command 'admin_conversations' do |g|
16
16
  g.long_desc %( Convert a public channel to a private channel. )
17
17
  g.command 'convertToPrivate' do |c|
18
18
  c.flag 'channel_id', desc: 'The channel to convert to private.'
19
+ c.flag 'name', desc: 'Name of private channel to create. Only respected when converting an MPIM.'
19
20
  c.action do |_global_options, options, _args|
20
21
  puts JSON.dump($client.admin_conversations_convertToPrivate(options))
21
22
  end
@@ -16,8 +16,8 @@ command 'admin_emoji' do |g|
16
16
  g.desc 'Add an emoji alias.'
17
17
  g.long_desc %( Add an emoji alias. )
18
18
  g.command 'addAlias' do |c|
19
- c.flag 'alias_for', desc: 'The alias of the emoji.'
20
- c.flag 'name', desc: 'The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.'
19
+ c.flag 'alias_for', desc: 'Name of the emoji for which the alias is being made. Any wrapping whitespace or colons will be automatically trimmed.'
20
+ c.flag 'name', desc: 'The new alias for the specified emoji. Any wrapping whitespace or colons will be automatically trimmed.'
21
21
  c.action do |_global_options, options, _args|
22
22
  puts JSON.dump($client.admin_emoji_addAlias(options))
23
23
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminUsersUnsupportedversions methods.'
5
+ command 'admin_users_unsupportedVersions' do |g|
6
+ g.desc 'Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file.'
7
+ g.long_desc %( Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file. )
8
+ g.command 'export' do |c|
9
+ c.flag 'date_end_of_support', desc: 'Unix timestamp of the date of past or upcoming end of support cycles. If not provided will include all announced end of support cycles.'
10
+ c.flag 'date_sessions_started', desc: 'Unix timestamp of a date to start looking for user sessions. If not provided will start six months ago.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.admin_users_unsupportedVersions_export(options))
13
+ end
14
+ end
15
+ end
@@ -44,6 +44,7 @@ command 'apps_manifest' do |g|
44
44
  g.long_desc %( Validate an app manifest )
45
45
  g.command 'validate' do |c|
46
46
  c.flag 'manifest', desc: 'The manifest to be validated. Will be validated against the app manifest schema - read our guide.'
47
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to validate.'
47
48
  c.action do |_global_options, options, _args|
48
49
  puts JSON.dump($client.apps_manifest_validate(options))
49
50
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'Bookmarks methods.'
5
+ command 'bookmarks' do |g|
6
+ g.desc 'Add bookmark to a channel.'
7
+ g.long_desc %( Add bookmark to a channel. )
8
+ g.command 'add' do |c|
9
+ c.flag 'channel_id', desc: 'Channel to add bookmark in.'
10
+ c.flag 'title', desc: 'Title for the bookmark.'
11
+ c.flag 'type', desc: 'Type of the bookmark i.e link.'
12
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
13
+ c.flag 'entity_id', desc: 'ID of the entity being bookmarked. Only applies to message and file types.'
14
+ c.flag 'link', desc: 'Link to bookmark.'
15
+ c.flag 'parent_id', desc: "Id of this bookmark's parent."
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump($client.bookmarks_add(options))
18
+ end
19
+ end
20
+
21
+ g.desc 'Edit bookmark.'
22
+ g.long_desc %( Edit bookmark. )
23
+ g.command 'edit' do |c|
24
+ c.flag 'bookmark_id', desc: 'Bookmark to update.'
25
+ c.flag 'channel_id', desc: 'Channel to update bookmark in.'
26
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
27
+ c.flag 'link', desc: 'Link to bookmark.'
28
+ c.flag 'title', desc: 'Title for the bookmark.'
29
+ c.action do |_global_options, options, _args|
30
+ puts JSON.dump($client.bookmarks_edit(options))
31
+ end
32
+ end
33
+
34
+ g.desc 'List bookmark for the channel.'
35
+ g.long_desc %( List bookmark for the channel. )
36
+ g.command 'list' do |c|
37
+ c.flag 'channel_id', desc: 'Channel to list bookmarks in.'
38
+ c.action do |_global_options, options, _args|
39
+ puts JSON.dump($client.bookmarks_list(options))
40
+ end
41
+ end
42
+
43
+ g.desc 'Remove bookmark from the channel.'
44
+ g.long_desc %( Remove bookmark from the channel. )
45
+ g.command 'remove' do |c|
46
+ c.flag 'bookmark_id', desc: 'Bookmark to remove.'
47
+ c.flag 'channel_id', desc: 'Channel to remove bookmark.'
48
+ c.action do |_global_options, options, _args|
49
+ puts JSON.dump($client.bookmarks_remove(options))
50
+ end
51
+ end
52
+ end
data/bin/commands/team.rb CHANGED
@@ -26,6 +26,7 @@ command 'team' do |g|
26
26
  g.desc 'Gets information about the current team.'
27
27
  g.long_desc %( Gets information about the current team. )
28
28
  g.command 'info' do |c|
29
+ c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
29
30
  c.flag 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.'
30
31
  c.action do |_global_options, options, _args|
31
32
  puts JSON.dump($client.team_info(options))
data/bin/commands.rb CHANGED
@@ -22,6 +22,7 @@ require 'commands/admin_teams_settings'
22
22
  require 'commands/admin_usergroups'
23
23
  require 'commands/admin_users'
24
24
  require 'commands/admin_users_session'
25
+ require 'commands/admin_users_unsupportedVersions'
25
26
  require 'commands/api'
26
27
  require 'commands/apps'
27
28
  require 'commands/apps_connections'
@@ -29,6 +30,7 @@ require 'commands/apps_event_authorizations'
29
30
  require 'commands/apps_manifest'
30
31
  require 'commands/auth'
31
32
  require 'commands/auth_teams'
33
+ require 'commands/bookmarks'
32
34
  require 'commands/bots'
33
35
  require 'commands/calls'
34
36
  require 'commands/calls_participants'
@@ -44,7 +44,7 @@ module Slack
44
44
 
45
45
  # Start RealTime client and block until it disconnects.
46
46
  def start!(&block)
47
- @callback = block if block_given?
47
+ @callback = block if block
48
48
  build_socket
49
49
  @socket.start_sync(self)
50
50
  end
@@ -52,7 +52,7 @@ module Slack
52
52
  # Start RealTime client and return immediately.
53
53
  # The RealTime::Client will run in the background.
54
54
  def start_async(&block)
55
- @callback = block if block_given?
55
+ @callback = block if block
56
56
  build_socket
57
57
  @socket.start_async(self)
58
58
  end
data/lib/slack/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Slack
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
@@ -6,6 +6,22 @@ module Slack
6
6
  module Api
7
7
  module Endpoints
8
8
  module AdminAppsRequests
9
+ #
10
+ # Cancel approval request for team
11
+ #
12
+ # @option options [string] :request_id
13
+ # The id of the request to cancel.
14
+ # @option options [Object] :enterprise_id
15
+ # The ID of the enterprise where this request belongs.
16
+ # @option options [Object] :team_id
17
+ # The ID of the workspace where this request belongs.
18
+ # @see https://api.slack.com/methods/admin.apps.requests.cancel
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps.requests/admin.apps.requests.cancel.json
20
+ def admin_apps_requests_cancel(options = {})
21
+ throw ArgumentError.new('Required arguments :request_id missing') if options[:request_id].nil?
22
+ post('admin.apps.requests.cancel', options)
23
+ end
24
+
9
25
  #
10
26
  # List app requests for a team/workspace.
11
27
  #