slack-ruby-client 2.1.0 → 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/.coveralls.yml +2 -0
- data/.github/workflows/test.yml +6 -0
- data/.github/workflows/update_api.yml +76 -0
- data/.gitignore +1 -0
- data/.rubocop_todo.yml +17 -29
- data/CHANGELOG.md +23 -1
- data/CONTRIBUTING.md +35 -32
- data/Gemfile +2 -0
- data/README.md +123 -14
- data/bin/commands/admin_apps_activities.rb +32 -0
- data/bin/commands/admin_apps_approved.rb +1 -0
- data/bin/commands/admin_apps_config.rb +31 -0
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_apps_restricted.rb +1 -0
- data/bin/commands/admin_functions.rb +23 -0
- data/bin/commands/admin_functions_permissions.rb +31 -0
- data/bin/commands/admin_roles.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_workflows.rb +38 -0
- data/bin/commands/admin_workflows_collaborators.rb +31 -0
- data/bin/commands/admin_workflows_permissions.rb +21 -0
- data/bin/commands/apps_activities.rb +32 -0
- data/bin/commands/apps_auth_external.rb +32 -0
- data/bin/commands/apps_datastore.rb +70 -0
- data/bin/commands/auth_teams.rb +2 -2
- data/bin/commands/calls.rb +1 -1
- data/bin/commands/chat.rb +6 -6
- data/bin/commands/chat_scheduledMessages.rb +2 -2
- data/bin/commands/conversations.rb +3 -3
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/functions_workflows_steps.rb +2 -1
- data/bin/commands/functions_workflows_steps_responses.rb +2 -1
- data/bin/commands/reminders.rb +1 -1
- data/bin/commands/stars.rb +4 -4
- data/bin/commands/team.rb +3 -1
- data/bin/commands/users.rb +1 -1
- data/lib/slack/messages/formatting.rb +44 -0
- data/lib/slack/real_time/client.rb +14 -2
- data/lib/slack/real_time/concurrency/async.rb +4 -0
- data/lib/slack/real_time/config.rb +3 -0
- data/lib/slack/real_time/socket.rb +4 -0
- data/lib/slack/real_time/stores/starter.rb +2 -2
- data/lib/slack/real_time/stores/store.rb +2 -2
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +53 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +40 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -0
- data/lib/slack/web/api/endpoints/admin_functions.rb +36 -0
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +41 -0
- data/lib/slack/web/api/endpoints/admin_roles.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +59 -0
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +26 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +54 -0
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +41 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +110 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +2 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +1 -1
- data/lib/slack/web/api/endpoints/chat.rb +14 -45
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -2
- data/lib/slack/web/api/endpoints/conversations.rb +3 -3
- data/lib/slack/web/api/endpoints/dialog.rb +1 -6
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +3 -1
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +3 -1
- data/lib/slack/web/api/endpoints/reminders.rb +1 -1
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- data/lib/slack/web/api/endpoints/team.rb +12 -2
- data/lib/slack/web/api/endpoints/users.rb +1 -1
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -0
- data/lib/slack/web/api/endpoints/views.rb +7 -23
- data/lib/slack/web/api/endpoints/workflows.rb +2 -0
- data/lib/slack/web/api/endpoints.rb +20 -0
- data/lib/slack/web/api/errors.rb +66 -4
- data/lib/slack/web/api/options.rb +26 -0
- data/lib/slack/web/api/patches/chat.attachments-blocks.patch +7 -55
- data/lib/slack/web/api/templates/method.erb +12 -0
- data/lib/slack/web/api/templates/method_spec.erb +40 -4
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack-ruby-client.rb +1 -0
- data/lib/tasks/web.rake +2 -4
- data/slack-ruby-client.gemspec +1 -0
- data/spec/slack/messages/formatting_spec.rb +60 -0
- data/spec/slack/real_time/client_spec.rb +25 -7
- data/spec/slack/real_time/concurrency/clients/async_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -10
- data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +21 -0
- data/spec/slack/web/api/endpoints/admin_functions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_activities_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +45 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/chat_spec.rb +62 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/dialog_spec.rb +14 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +6 -0
- data/spec/slack/web/api/endpoints/users_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/views_spec.rb +65 -0
- data/spec/slack/web/api/endpoints/workflows_spec.rb +8 -0
- data/spec/slack/web/api/options_spec.rb +69 -0
- data/spec/spec_helper.rb +9 -0
- metadata +45 -5
- data/lib/slack/web/api/patches/dialog.encoded-json.patch +0 -17
- data/lib/slack/web/api/patches/views.view-json.patch +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88d9fc4c82be7eb365f184eb9be4babf355c4422e7aa981a669c68df866fcd89
|
4
|
+
data.tar.gz: 6380fa106f4b05359bc4b0e8598aa02a4f2ab2bd6f31ff5fdb5f2e356c2ee76f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d41b9da28c2e14c25567e4ab620779095cc0c0f12b633937e4e4f2aa7c69b482f13cb1b9ad0353576cd2f2bd1d8c710680115b70f2fae2ef68488b334ee759e
|
7
|
+
data.tar.gz: 1ac12afca5aa38457b9fc72da39662e0b301fa2fd4ffc7d5aefddca62dc7c5988193104356e4a5b16a8c6b9ec0b28adce52f7ceda2486982c85e7eba07fbfcac
|
data/.coveralls.yml
ADDED
data/.github/workflows/test.yml
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
name: Update API
|
2
|
+
on:
|
3
|
+
workflow_dispatch:
|
4
|
+
schedule:
|
5
|
+
- cron: "15 23 * * *"
|
6
|
+
jobs:
|
7
|
+
update-api:
|
8
|
+
if: ${{ github.repository == 'slack-ruby/slack-ruby-client' }}
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
permissions:
|
11
|
+
contents: write
|
12
|
+
pull-requests: write
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
with:
|
16
|
+
submodules: recursive
|
17
|
+
fetch-depth: 0
|
18
|
+
- name: Config git to rebase
|
19
|
+
run: git config --global pull.rebase true
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: "3.2"
|
24
|
+
bundler-cache: true
|
25
|
+
- name: Update API from slack-api-ref
|
26
|
+
run: bundle exec rake slack:api:update
|
27
|
+
- name: Remove files added by setup-ruby
|
28
|
+
run: rm -rf vendor
|
29
|
+
- name: Get current date
|
30
|
+
id: date
|
31
|
+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
32
|
+
- name: Get slack-api-ref ref
|
33
|
+
id: api-ref
|
34
|
+
run: echo "::set-output name=api-ref::$(git rev-parse --short HEAD:lib/slack/web/api/slack-api-ref)"
|
35
|
+
- name: GitHub App token
|
36
|
+
if: ${{ github.repository == 'slack-ruby/slack-ruby-client' }}
|
37
|
+
id: github_app_token
|
38
|
+
uses: tibdex/github-app-token@v1.6.0
|
39
|
+
with:
|
40
|
+
app_id: ${{ secrets.CI_APP_ID }}
|
41
|
+
private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}
|
42
|
+
installation_id: 36985419
|
43
|
+
- name: Create pull request
|
44
|
+
id: cpr
|
45
|
+
uses: peter-evans/create-pull-request@v4
|
46
|
+
with:
|
47
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
48
|
+
commit-message: Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }} (${{ steps.date.outputs.date }})
|
49
|
+
title: Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }}
|
50
|
+
body: |
|
51
|
+
Update API from [slack-api-ref](https://github.com/slack-ruby/slack-api-ref).
|
52
|
+
Rev: ${{ steps.api-ref.outputs.api-ref }}
|
53
|
+
Date: ${{ steps.date.outputs.date }}
|
54
|
+
branch: automated-api-update
|
55
|
+
base: master
|
56
|
+
committer: slack-ruby-ci-bot <noreply@github.com>
|
57
|
+
author: slack-ruby-ci-bot <noreply@github.com>
|
58
|
+
- name: Update CHANGELOG
|
59
|
+
uses: jacobtomlinson/gha-find-replace@v3
|
60
|
+
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
|
61
|
+
with:
|
62
|
+
include: CHANGELOG.md
|
63
|
+
find: "\\* Your contribution here."
|
64
|
+
replace: "* [#${{steps.cpr.outputs.pull-request-number}}](https://github.com/slack-ruby-client/pulls/${{steps.cpr.outputs.pull-request-number}}): Update API from [slack-api-ref@${{ steps.api-ref.outputs.api-ref }}](https://github.com/slack-ruby/slack-api-ref/commit/${{ steps.api-ref.outputs.api-ref }}) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).\n* Your contribution here."
|
65
|
+
- name: Commit and Push
|
66
|
+
if: ${{ steps.cpr.outputs.pull-request-number != '' }}
|
67
|
+
run: |
|
68
|
+
git config --local user.name 'slack-ruby-ci-bot'
|
69
|
+
git config --local user.email 'noreply@github.com'
|
70
|
+
git config --local --unset-all http.https://github.com/.extraheader || true
|
71
|
+
AUTH=$(echo -n "x-access-token:${{ steps.github_app_token.outputs.token || secrets.GITHUB_TOKEN }}" | base64)
|
72
|
+
echo "::add-mask::${AUTH}"
|
73
|
+
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic ${AUTH}"
|
74
|
+
git add CHANGELOG.md
|
75
|
+
git commit --amend --no-edit
|
76
|
+
git push origin automated-api-update -f
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2023-08-05 13:32:37 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
|
@@ -13,10 +13,11 @@ Lint/ConstantDefinitionInBlock:
|
|
13
13
|
Exclude:
|
14
14
|
- 'lib/tasks/real_time.rake'
|
15
15
|
|
16
|
-
# Offense count:
|
16
|
+
# Offense count: 2
|
17
17
|
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
18
18
|
Lint/EmptyBlock:
|
19
19
|
Exclude:
|
20
|
+
- 'spec/slack/real_time/concurrency/clients/async_spec.rb'
|
20
21
|
- 'spec/support/real_time/concurrency/mock.rb'
|
21
22
|
|
22
23
|
# Offense count: 1
|
@@ -46,17 +47,17 @@ Lint/RedundantCopDisableDirective:
|
|
46
47
|
# Offense count: 12
|
47
48
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
48
49
|
Metrics/AbcSize:
|
49
|
-
Max:
|
50
|
+
Max: 36
|
50
51
|
|
51
52
|
# Offense count: 4
|
52
53
|
# Configuration parameters: IgnoredMethods.
|
53
54
|
Metrics/CyclomaticComplexity:
|
54
|
-
Max:
|
55
|
+
Max: 10
|
55
56
|
|
56
|
-
# Offense count:
|
57
|
+
# Offense count: 13
|
57
58
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
58
59
|
Metrics/MethodLength:
|
59
|
-
Max:
|
60
|
+
Max: 26
|
60
61
|
|
61
62
|
# Offense count: 1
|
62
63
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
@@ -66,13 +67,7 @@ Metrics/ParameterLists:
|
|
66
67
|
# Offense count: 2
|
67
68
|
# Configuration parameters: IgnoredMethods.
|
68
69
|
Metrics/PerceivedComplexity:
|
69
|
-
Max:
|
70
|
-
|
71
|
-
# Offense count: 1
|
72
|
-
# Configuration parameters: MinSize.
|
73
|
-
Performance/CollectionLiteralInLoop:
|
74
|
-
Exclude:
|
75
|
-
- 'lib/tasks/real_time.rake'
|
70
|
+
Max: 10
|
76
71
|
|
77
72
|
# Offense count: 2
|
78
73
|
# This cop supports safe auto-correction (--auto-correct).
|
@@ -86,41 +81,41 @@ Performance/StringInclude:
|
|
86
81
|
Exclude:
|
87
82
|
- 'lib/tasks/web.rake'
|
88
83
|
|
89
|
-
# Offense count:
|
84
|
+
# Offense count: 8
|
90
85
|
# This cop supports safe auto-correction (--auto-correct).
|
91
86
|
RSpec/ContextMethod:
|
92
87
|
Exclude:
|
93
88
|
- 'spec/slack/messages/formatting_spec.rb'
|
94
89
|
- 'spec/slack/web/api/mixins/users_spec.rb'
|
95
90
|
|
96
|
-
# Offense count:
|
91
|
+
# Offense count: 82
|
97
92
|
# Configuration parameters: Prefixes.
|
98
93
|
# Prefixes: when, with, without
|
99
94
|
RSpec/ContextWording:
|
100
95
|
Enabled: false
|
101
96
|
|
102
|
-
# Offense count:
|
97
|
+
# Offense count: 65
|
103
98
|
# Configuration parameters: CountAsOne.
|
104
99
|
RSpec/ExampleLength:
|
105
100
|
Max: 18
|
106
101
|
|
107
|
-
# Offense count:
|
102
|
+
# Offense count: 19
|
108
103
|
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
109
104
|
# Include: **/*_spec*rb*, **/spec/**/*
|
110
105
|
RSpec/FilePath:
|
111
106
|
Enabled: false
|
112
107
|
|
113
|
-
# Offense count:
|
108
|
+
# Offense count: 70
|
114
109
|
# Configuration parameters: .
|
115
110
|
# SupportedStyles: have_received, receive
|
116
111
|
RSpec/MessageSpies:
|
117
112
|
EnforcedStyle: receive
|
118
113
|
|
119
|
-
# Offense count:
|
114
|
+
# Offense count: 94
|
120
115
|
RSpec/MultipleExpectations:
|
121
116
|
Max: 5
|
122
117
|
|
123
|
-
# Offense count:
|
118
|
+
# Offense count: 7
|
124
119
|
# Configuration parameters: AllowSubject.
|
125
120
|
RSpec/MultipleMemoizedHelpers:
|
126
121
|
Max: 9
|
@@ -131,7 +126,7 @@ RSpec/NamedSubject:
|
|
131
126
|
Exclude:
|
132
127
|
- 'spec/slack/web/api/mixins/conversations_list_spec.rb'
|
133
128
|
|
134
|
-
# Offense count:
|
129
|
+
# Offense count: 48
|
135
130
|
RSpec/NestedGroups:
|
136
131
|
Max: 6
|
137
132
|
|
@@ -177,7 +172,7 @@ Rake/Desc:
|
|
177
172
|
Style/FormatStringToken:
|
178
173
|
EnforcedStyle: unannotated
|
179
174
|
|
180
|
-
# Offense count:
|
175
|
+
# Offense count: 5
|
181
176
|
# This cop supports safe auto-correction (--auto-correct).
|
182
177
|
Style/GlobalStdStream:
|
183
178
|
Exclude:
|
@@ -211,10 +206,3 @@ Style/OptionalBooleanParameter:
|
|
211
206
|
Style/SlicingWithRange:
|
212
207
|
Exclude:
|
213
208
|
- 'lib/slack/web/api/mixins/ids.id.rb'
|
214
|
-
|
215
|
-
# Offense count: 1
|
216
|
-
# This cop supports unsafe auto-correction (--auto-correct-all).
|
217
|
-
# Configuration parameters: Mode.
|
218
|
-
Style/StringConcatenation:
|
219
|
-
Exclude:
|
220
|
-
- 'lib/tasks/real_time.rake'
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
|
+
### 2.2.0 (2023/09/17)
|
2
|
+
|
3
|
+
* [#458](https://github.com/slack-ruby/slack-ruby-client/pull/458): Add workflow for automatic API updates - [@duffn](https://github.com/duffn).
|
4
|
+
* [#455](https://github.com/slack-ruby/slack-ruby-client/pull/455): Update Slack API: Added pagination to `team.accessLogs` and `AppsDatastore` methods - [@marfoldi](https://github.com/marfoldi).
|
5
|
+
* [#454](https://github.com/slack-ruby/slack-ruby-client/pull/454): Added `Slack::Messages::Formatting#escape` - [@marfoldi](https://github.com/marfoldi).
|
6
|
+
* [#452](https://github.com/slack-ruby/slack-ruby-client/pull/452): Automatically generate Web API multi-argument requirements from docs - [@jmanian](https://github.com/jmanian).
|
7
|
+
* [#448](https://github.com/slack-ruby/slack-ruby-client/pull/448), [#453](https://github.com/slack-ruby/slack-ruby-client/pull/453): Automatically convert more Web API arguments to JSON-encoded strings - [@jmanian](https://github.com/jmanian).
|
8
|
+
* [#465](https://github.com/slack-ruby-client/pulls/465): Update API from [slack-api-ref@878be8f](https://github.com/slack-ruby/slack-api-ref/commit/878be8f) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
9
|
+
* [#473](https://github.com/slack-ruby-client/pulls/473): Update API from [slack-api-ref@a29b520](https://github.com/slack-ruby/slack-api-ref/commit/a29b520) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
10
|
+
* [#474](https://github.com/slack-ruby-client/pulls/474): Update API from [slack-api-ref@629967e](https://github.com/slack-ruby/slack-api-ref/commit/629967e) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
11
|
+
* [#475](https://github.com/slack-ruby-client/pulls/475): Update API from [slack-api-ref@977dad5](https://github.com/slack-ruby/slack-api-ref/commit/977dad5) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
12
|
+
* [#476](https://github.com/slack-ruby-client/pulls/476): Update API from [slack-api-ref@d0b2989](https://github.com/slack-ruby/slack-api-ref/commit/d0b2989) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
13
|
+
* [#478](https://github.com/slack-ruby-client/pulls/478): Update API from [slack-api-ref@d797055](https://github.com/slack-ruby/slack-api-ref/commit/d797055) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
14
|
+
* [#480](https://github.com/slack-ruby-client/pulls/480): Add common message formatting utilities - [@chrisbloom7](https://github.com/chrisbloom7).
|
15
|
+
* [#481](https://github.com/slack-ruby-client/pulls/481): Update API from [slack-api-ref@7c22d0b](https://github.com/slack-ruby/slack-api-ref/commit/7c22d0b) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
16
|
+
* [#488](https://github.com/slack-ruby-client/pulls/488): Update API from [slack-api-ref@a45def2](https://github.com/slack-ruby/slack-api-ref/commit/a45def2) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
17
|
+
* [#490](https://github.com/slack-ruby/slack-ruby-client/pull/490): Add changelog uri to gemspec - [@MatheusRich](https://github.com/MatheusRich).
|
18
|
+
* [#491](https://github.com/slack-ruby/slack-ruby-client/pull/491): Added code coverage - [@dblock](https://github.com/dblock).
|
19
|
+
* [#486](https://github.com/slack-ruby/slack-ruby-client/pull/486): Async handler support for Slack::RealTime::Config and Client - [@milestruecar](https://github.com/milestruecar).
|
20
|
+
* [#489](https://github.com/slack-ruby-client/pulls/489): Update API from [slack-api-ref@0d3f0b6](https://github.com/slack-ruby/slack-api-ref/commit/0d3f0b6) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
21
|
+
* [#493](https://github.com/slack-ruby-client/pulls/493): Update API from [slack-api-ref@f2e768a](https://github.com/slack-ruby/slack-api-ref/commit/f2e768a) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
22
|
+
|
1
23
|
### 2.1.0 (2023/03/17)
|
2
24
|
|
3
|
-
* [#440](https://github.com/ruby
|
25
|
+
* [#440](https://github.com/slack-ruby/slack-ruby-client/pull/440): Added Enterprise support [via TideLift](https://tidelift.com/subscription/request-a-demo?utm_source=rubygems-slack-ruby-client&utm_medium=referral&utm_campaign=enterprise) - [@dblock](https://github.com/dblock).
|
4
26
|
* [#436](https://github.com/slack-ruby/slack-ruby-client/pull/436): Removed dependency on unused websocket-driver - [@blowfishpro](https://github.com/blowfishpro).
|
5
27
|
* [#434](https://github.com/slack-ruby/slack-ruby-client/pull/434): Fixed incompatibility with Faraday >= 2.7.0 and GLI usage in the `slack` script - [@blowfishpro](https://github.com/blowfishpro).
|
6
28
|
* [#446](https://github.com/slack-ruby/slack-ruby-client/pull/446): Added support for Ruby 3.2 - [@duffn](https://github.com/duffn).
|
data/CONTRIBUTING.md
CHANGED
@@ -63,38 +63,6 @@ Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop). Run `
|
|
63
63
|
|
64
64
|
Make sure that `bundle exec rake` completes without errors.
|
65
65
|
|
66
|
-
### Update Slack Web API
|
67
|
-
|
68
|
-
Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
|
69
|
-
|
70
|
-
```
|
71
|
-
bundle exec rake slack:api:update
|
72
|
-
```
|
73
|
-
|
74
|
-
#### Patching Slack Web API
|
75
|
-
|
76
|
-
Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20).
|
77
|
-
|
78
|
-
The broad steps are:
|
79
|
-
1. Run `rake slack:api:update` to check that existing patches are still valid.
|
80
|
-
- If you run into a `failed to apply patch` error, the auto-generated methods likely drifted from the last patch. Follow the steps [below](#resolving-patch-errors).
|
81
|
-
- This may add new methods if the API has updated, please split them up into multiple PRs if so.
|
82
|
-
2. Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb`.
|
83
|
-
3. Generate a patch:
|
84
|
-
```
|
85
|
-
git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.added-support.patch
|
86
|
-
```
|
87
|
-
4. Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
|
88
|
-
|
89
|
-
##### Resolving Patch Errors
|
90
|
-
|
91
|
-
The auto-generated method files may drift overtime e.g. new arguments may be added or descriptions changed. Since previous patches were based on the older auto-generated files, git may be unable to apply them to the new files. Resolving them requires some good ol' splicing:
|
92
|
-
1. Run `rake slack:api:update SKIP_PATCH=true` to create the raw auto-generated files. Commit the files that you are updating, so we can run `git diff` later.
|
93
|
-
2. Go through the old patches for the files (e.g. in `lib/slack/web/api/patches/chat.added-support.patch`), copying code into the new files.
|
94
|
-
- Run `git apply --reject path/to/patch-file.patch` to see hunks that couldn't be applied.
|
95
|
-
3. Continue with Step 2 [above](#patching-slack-web-api).
|
96
|
-
|
97
|
-
|
98
66
|
### Write Documentation
|
99
67
|
|
100
68
|
Document any external behavior in the [README](README.md).
|
@@ -163,6 +131,41 @@ Go back to your pull request after a few minutes and see whether it passed muste
|
|
163
131
|
### Be Patient
|
164
132
|
|
165
133
|
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
|
134
|
+
While you wait you can help with keeping the Slack Web API up to date, see [below](#update-slack-web-api).
|
135
|
+
|
136
|
+
### Update Slack Web API
|
137
|
+
|
138
|
+
Please make sure to [create a separate branch](#create-a-topic-branch) for your changes.
|
139
|
+
|
140
|
+
Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
|
141
|
+
|
142
|
+
```
|
143
|
+
bundle exec rake slack:api:update
|
144
|
+
```
|
145
|
+
|
146
|
+
#### Patching Slack Web API
|
147
|
+
|
148
|
+
Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20).
|
149
|
+
|
150
|
+
The broad steps are:
|
151
|
+
1. Run `rake slack:api:update` to check that existing patches are still valid.
|
152
|
+
- If you run into a `failed to apply patch` error, the auto-generated methods likely drifted from the last patch. Follow the steps [below](#resolving-patch-errors).
|
153
|
+
- This may add new methods if the API has updated, please split them up into multiple PRs if so.
|
154
|
+
2. Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb`.
|
155
|
+
3. Generate a patch:
|
156
|
+
```
|
157
|
+
git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.added-support.patch
|
158
|
+
```
|
159
|
+
4. Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
|
160
|
+
|
161
|
+
##### Resolving Patch Errors
|
162
|
+
|
163
|
+
The auto-generated method files may drift overtime e.g. new arguments may be added or descriptions changed. Since previous patches were based on the older auto-generated files, git may be unable to apply them to the new files. Resolving them requires some good ol' splicing:
|
164
|
+
1. Run `rake slack:api:update SKIP_PATCH=true` to create the raw auto-generated files. Commit the files that you are updating, so we can run `git diff` later.
|
165
|
+
2. Go through the old patches for the files (e.g. in `lib/slack/web/api/patches/chat.added-support.patch`), copying code into the new files.
|
166
|
+
- Run `git apply --reject path/to/patch-file.patch` to see hunks that couldn't be applied.
|
167
|
+
3. Continue with Step 2 [above](#patching-slack-web-api).
|
168
|
+
|
166
169
|
|
167
170
|
## Thank You
|
168
171
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,7 @@ Slack Ruby Client
|
|
5
5
|
[![Integration Tests](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integration_test.yml/badge.svg?branch=master)](https://github.com/slack-ruby/slack-ruby-client/actions/workflows/integration_test.yml)
|
6
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)
|
7
7
|
[![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client)
|
8
|
+
[![Coverage Status](https://coveralls.io/repos/github/slack-ruby/slack-ruby-client/badge.svg?branch=master)](https://coveralls.io/github/slack-ruby/slack-ruby-client?branch=master)
|
8
9
|
|
9
10
|
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).
|
10
11
|
|
@@ -30,6 +31,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
30
31
|
- [Get User Info](#get-user-info)
|
31
32
|
- [Search for a User](#search-for-a-user)
|
32
33
|
- [Other](#other)
|
34
|
+
- [JSON Arguments](#json-arguments)
|
33
35
|
- [Web Client Options](#web-client-options)
|
34
36
|
- [Pagination Support](#pagination-support)
|
35
37
|
- [Character Encoding](#character-encoding)
|
@@ -50,7 +52,15 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
50
52
|
- [Events API](#events-api)
|
51
53
|
- [Configuring Slack::Events](#configuring-slackevents)
|
52
54
|
- [Verifying the Request Signature](#verifying-the-request-signature)
|
53
|
-
- [Message
|
55
|
+
- [Message Handling](#message-handling)
|
56
|
+
- [Formatting Messages](#formatting-messages)
|
57
|
+
- [Date and time formatting](#date-and-time-formatting)
|
58
|
+
- [Channel ID formatting](#channel-id-formatting)
|
59
|
+
- [User ID formatting](#user-id-formatting)
|
60
|
+
- [URL formatting](#url-formatting)
|
61
|
+
- [Parsing Messages](#parsing-messages)
|
62
|
+
- [Unescaping message content](#unescaping-message-content)
|
63
|
+
- [Escaping message content](#escaping-message-content)
|
54
64
|
- [Command-Line Client](#command-line-client)
|
55
65
|
- [Authenticate with Slack](#authenticate-with-slack)
|
56
66
|
- [Send a Message](#send-a-message)
|
@@ -71,7 +81,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
71
81
|
|
72
82
|
## Stable Release
|
73
83
|
|
74
|
-
You're reading the documentation for the **stable** release of slack-ruby-client,
|
84
|
+
You're reading the documentation for the **stable** release of slack-ruby-client, 2.2.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
75
85
|
|
76
86
|
## Installation
|
77
87
|
|
@@ -210,6 +220,31 @@ client.users_search(user: 'dblock')
|
|
210
220
|
|
211
221
|
Refer to the [Slack Web API Method Reference](https://api.slack.com/methods) for the list of all available functions.
|
212
222
|
|
223
|
+
#### JSON Arguments
|
224
|
+
|
225
|
+
The Web API expects certain arguments to be sent as JSON-encoded strings. With the client you can pass these args as ruby hashes or arrays and they will be converted automatically to JSON, or you can provide the JSON directly.
|
226
|
+
|
227
|
+
```ruby
|
228
|
+
# As ruby objects
|
229
|
+
client.chat_postMessage(
|
230
|
+
channel: 'C123456',
|
231
|
+
text: 'Hello World',
|
232
|
+
blocks: [{type: 'section', text: {type: 'mrkdwn', text: 'Hello World'}}]
|
233
|
+
)
|
234
|
+
|
235
|
+
# As a JSON string
|
236
|
+
client.chat_postMessage(
|
237
|
+
channel: 'C123456',
|
238
|
+
text: 'Hello World',
|
239
|
+
blocks: JSON.dump([{type: 'section', text: {type: 'mrkdwn', text: 'Hello World'}}])
|
240
|
+
)
|
241
|
+
client.chat_postMessage(
|
242
|
+
channel: 'C123456',
|
243
|
+
text: 'Hello World',
|
244
|
+
blocks: '[{"type":"section","text":{"type":"mrkdwn","text":"Hello World"}}]'
|
245
|
+
)
|
246
|
+
```
|
247
|
+
|
213
248
|
#### Web Client Options
|
214
249
|
|
215
250
|
You can configure the Web client either globally or via the initializer.
|
@@ -398,6 +433,7 @@ websocket_proxy | Connect via proxy, include `:origin` and `:headers`.
|
|
398
433
|
start_options | Options to pass to `rtm.connect`, default is `{ request: { timeout: 180 } }`.
|
399
434
|
store_class | Local store class, default is an in-memory `Slack::RealTime::Stores::Starter`.
|
400
435
|
store_options | Options to initialize the store, default is `{}`.
|
436
|
+
async_handlers | Option to run handlers asynchronously. Valid options are `:all` or `:none`, default is `:none`.
|
401
437
|
logger | Optional `Logger` instance that logs RealTime requests and socket data.
|
402
438
|
|
403
439
|
Note that the RealTime client uses a Web client to obtain the WebSocket URL via [rtm.connect](https://api.slack.com/methods/rtm.connect). While `token` and `logger` options are passed down from the RealTime client, you may also configure Web client options via `Slack::Web::Client.configure` as described above.
|
@@ -557,33 +593,106 @@ Slack::Events::Request.new(http_request,
|
|
557
593
|
|
558
594
|
The `verify!` call may raise `Slack::Events::Request::MissingSigningSecret`, `Slack::Events::Request::InvalidSignature` or `Slack::Events::Request::TimestampExpired` errors.
|
559
595
|
|
560
|
-
### Message
|
596
|
+
### Message Handling
|
597
|
+
|
598
|
+
All text in Slack uses the same [system of formatting and escaping](https://api.slack.com/docs/formatting): chat messages, direct messages, file comments, etc. [Slack::Messages::Formatting](lib/slack/messages/formatting.rb) provides convenience methods to format and parse messages.
|
599
|
+
|
600
|
+
#### Formatting Messages
|
601
|
+
|
602
|
+
`Slack::Messages::Formatting` provides a number of methods for formatting objects that you can then embed in outgoing messages.
|
603
|
+
|
604
|
+
##### Date and time formatting
|
605
|
+
|
606
|
+
You can embed a pre-formatted date in a message as a string like any other text, but using Slack's date formatting allows you to display dates based on user preferences for dates and times, incorporating users' local time zones, and optionally using relative values like "yesterday", "today", or "tomorrow" when appropriate.
|
607
|
+
|
608
|
+
```ruby
|
609
|
+
date = Time.now
|
610
|
+
|
611
|
+
# Display date as `YYYY-MM-DD HH:MM:SS`
|
612
|
+
Slack::Messages::Formatting.date(date)
|
613
|
+
# => "<!date^1688150386^{date_num} {time_secs}|2023-06-30 18:39:46 +0000>"
|
614
|
+
|
615
|
+
# Specify a different format
|
616
|
+
# See https://api.slack.com/reference/surfaces/formatting#date-formatting for supported formats
|
617
|
+
Slack::Messages::Formatting.date(date, format: 'date_long_pretty')
|
618
|
+
# => "<!date^1688150386^date_long_pretty|2023-06-30 18:39:46 +0000>"
|
619
|
+
|
620
|
+
# Link your timestamp to a fully qualified URL
|
621
|
+
Slack::Messages::Formatting.date(date, link: 'https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif')
|
622
|
+
# => "<!date^1688150386^{date_num} {time_secs}^https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif|2023-06-30 18:39:46 +0000>"
|
623
|
+
|
624
|
+
# Specify custom fallback text to use if the client is unable to process the date
|
625
|
+
Slack::Messages::Formatting.date(date, text: 'party time!')
|
626
|
+
# => "<!date^1688150386^{date_num} {time_secs}|party time!>"
|
627
|
+
```
|
628
|
+
|
629
|
+
##### Channel ID formatting
|
630
|
+
|
631
|
+
If you already know the channel name you can just embed it in the message as `#some-channel`, but if you only have the ID you can embed it using special syntax which Slack will display as the channel name (while respecting channel visibility).
|
632
|
+
|
633
|
+
```ruby
|
634
|
+
channel_id = 'C0000000001'
|
635
|
+
Slack::Messages::Formatting.channel_link(channel_id)
|
636
|
+
# => "<#C0000000001>"
|
637
|
+
```
|
638
|
+
|
639
|
+
##### User ID formatting
|
640
|
+
|
641
|
+
If you already know the user name you can just embed it in the message as `@some_username`, but if you only have the ID you can embed it using special syntax which Slack will display as the user name.
|
642
|
+
|
643
|
+
```ruby
|
644
|
+
user_id = 'U0000000001'
|
645
|
+
Slack::Messages::Formatting.user_link(user_id)
|
646
|
+
# => "<@U0000000001>"
|
647
|
+
```
|
648
|
+
|
649
|
+
##### URL formatting
|
561
650
|
|
562
|
-
|
651
|
+
Slack will automatically parse fully qualified URLs in messages, but you need special formatting to embed a link with different text.
|
563
652
|
|
564
653
|
```ruby
|
565
|
-
|
654
|
+
text = 'party time'
|
655
|
+
url = 'https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif'
|
656
|
+
Slack::Messages::Formatting.url_link(text, url)
|
657
|
+
# => "<https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif|party time>"
|
658
|
+
```
|
659
|
+
|
660
|
+
#### Parsing Messages
|
661
|
+
|
662
|
+
`Slack::Messages::Formatting` also provides ways to escape or unescape messages. This comes handy, for example, you want to treat all input to a real time bot as plain text.
|
663
|
+
|
664
|
+
##### Unescaping message content
|
665
|
+
|
666
|
+
```ruby
|
667
|
+
Slack::Messages::Formatting.unescape('Hello & <world>')
|
566
668
|
# => 'Hello & <world>'
|
567
|
-
Slack::Messages::Formatting.unescape('Hey <@U024BE7LH|bob>, did you see my file?')
|
669
|
+
Slack::Messages::Formatting.unescape('Hey <@U024BE7LH|bob>, did you see my file?')
|
568
670
|
# => 'Hey @bob, did you see my file?'
|
569
|
-
Slack::Messages::Formatting.unescape('Hey <@U02BEFY4U>')
|
671
|
+
Slack::Messages::Formatting.unescape('Hey <@U02BEFY4U>')
|
570
672
|
# => 'Hey @U02BEFY4U'
|
571
|
-
Slack::Messages::Formatting.unescape('This message contains a URL <http://foo.com/>')
|
673
|
+
Slack::Messages::Formatting.unescape('This message contains a URL <http://foo.com/>')
|
572
674
|
# => 'This message contains a URL http://foo.com/'
|
573
|
-
Slack::Messages::Formatting.unescape('So does this one: <http://www.foo.com|www.foo.com>')
|
675
|
+
Slack::Messages::Formatting.unescape('So does this one: <http://www.foo.com|www.foo.com>')
|
574
676
|
# => 'So does this one: www.foo.com'
|
575
|
-
Slack::Messages::Formatting.unescape('<mailto:bob@example.com|Bob>')
|
677
|
+
Slack::Messages::Formatting.unescape('<mailto:bob@example.com|Bob>')
|
576
678
|
# => 'Bob'
|
577
|
-
Slack::Messages::Formatting.unescape('Hello <@U123|bob>, say hi to <!everyone> in <#C1234|general>')
|
679
|
+
Slack::Messages::Formatting.unescape('Hello <@U123|bob>, say hi to <!everyone> in <#C1234|general>')
|
578
680
|
# => 'Hello @bob, say hi to @everyone in #general'
|
579
|
-
Slack::Messages::Formatting.unescape('Hello <@U123|bob> > file.txt')
|
681
|
+
Slack::Messages::Formatting.unescape('Hello <@U123|bob> > file.txt')
|
580
682
|
# => 'Hello @bob > file.txt'
|
581
|
-
Slack::Messages::Formatting.unescape('“hello”')
|
683
|
+
Slack::Messages::Formatting.unescape('“hello”')
|
582
684
|
# => '"hello"'
|
583
|
-
Slack::Messages::Formatting.unescape('‘hello’')
|
685
|
+
Slack::Messages::Formatting.unescape('‘hello’')
|
584
686
|
# => "'hello'"
|
585
687
|
```
|
586
688
|
|
689
|
+
##### Escaping message content
|
690
|
+
|
691
|
+
```ruby
|
692
|
+
Slack::Messages::Formatting.escape('Hello & <world>')
|
693
|
+
# => 'Hello & <world>'
|
694
|
+
```
|
695
|
+
|
587
696
|
### Command-Line Client
|
588
697
|
|
589
698
|
The slack command-line client returns JSON data from the Slack API.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AdminAppsActivities methods.'
|
8
|
+
command 'admin_apps_activities' do |g|
|
9
|
+
g.desc 'Get logs for a specified team/org'
|
10
|
+
g.long_desc %( Get logs for a specified team/org )
|
11
|
+
g.command 'list' do |c|
|
12
|
+
c.flag 'app_id', desc: 'The ID of the app to get activities from.'
|
13
|
+
c.flag 'component_id', desc: "The component ID of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for worflows."
|
14
|
+
c.flag 'component_type', desc: "The component type of log events to be returned. Acceptable values are ('events_api', 'workflows', 'functions', 'tables')."
|
15
|
+
c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail."
|
16
|
+
c.flag 'limit', desc: 'The maximum number of items to return.'
|
17
|
+
c.flag 'log_event_type', desc: 'The event type of log events to be returned.'
|
18
|
+
c.flag 'max_date_created', desc: 'The latest timestamp of the log to retrieve (epoch microseconds).'
|
19
|
+
c.flag 'min_date_created', desc: 'The earliest timestamp of the log to retrieve (epoch microseconds).'
|
20
|
+
c.flag 'min_log_level', desc: "The minimum log level of the log events to be returned. Defaults to 'info'. Acceptable values (in order of relative importance from smallest to largest) are ('trace', 'debug', 'info', 'warn', 'error', 'fatal')."
|
21
|
+
c.flag 'sort_direction', desc: 'The direction you want the data sorted by (always by timestamp).'
|
22
|
+
c.flag 'source', desc: "The source of log events to be returned. Acceptable values are ('slack', 'developer')."
|
23
|
+
c.flag 'team_id', desc: 'The team who owns this log.'
|
24
|
+
c.flag 'trace_id', desc: 'The trace ID of log events to be returned.'
|
25
|
+
c.action do |_global_options, options, _args|
|
26
|
+
puts JSON.dump(@client.admin_apps_activities_list(options))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -9,6 +9,7 @@ module Slack
|
|
9
9
|
g.desc 'List approved apps for an org or workspace.'
|
10
10
|
g.long_desc %( List approved apps for an org or workspace. )
|
11
11
|
g.command 'list' do |c|
|
12
|
+
c.flag 'certified', desc: 'Limit the results to only include certified apps. When false, no certified apps will appear in the result.'
|
12
13
|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
13
14
|
c.flag 'enterprise_id', desc: '.'
|
14
15
|
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AdminAppsConfig methods.'
|
8
|
+
command 'admin_apps_config' do |g|
|
9
|
+
g.desc 'Look up the app config for connectors by their IDs'
|
10
|
+
g.long_desc %( Look up the app config for connectors by their IDs )
|
11
|
+
g.command 'lookup' do |c|
|
12
|
+
c.flag 'app_ids', desc: 'An array of app IDs to get app configs for.'
|
13
|
+
c.action do |_global_options, options, _args|
|
14
|
+
puts JSON.dump(@client.admin_apps_config_lookup(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
g.desc 'Set the app config for a connector'
|
19
|
+
g.long_desc %( Set the app config for a connector )
|
20
|
+
g.command 'set' do |c|
|
21
|
+
c.flag 'app_id', desc: 'The encoded app ID to set the app config for.'
|
22
|
+
c.flag 'domain_restrictions', desc: 'Domain restrictions for the app.'
|
23
|
+
c.flag 'workflow_auth_strategy', desc: 'The workflow auth permission.'
|
24
|
+
c.action do |_global_options, options, _args|
|
25
|
+
puts JSON.dump(@client.admin_apps_config_set(options))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|