chat_sdk-teams 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 565d305af99ecdcf4935e364b5dcdb5f5c5c6d607f05b0409d3e06172c31ee00
4
- data.tar.gz: a84181ed602c61dfb7099b0552595ba53977932afe54fe92e2bec2c1b4d90a4d
3
+ metadata.gz: 5077208fda83c5941a590c7daa94b0d821399dcd49d92f3b5368498cd7e30f0b
4
+ data.tar.gz: 6271ccca3f36db8cadb455bfa47ead36eccf5ab6b6363edc39342d223f39979d
5
5
  SHA512:
6
- metadata.gz: 9b2cb430ab6aea8c317f5e45c256c4103bbf0b3a4195ab63053ba6856429af84ec56393b8953cd0ad0d830a3ff919b2593d22a3a9a3980d20ca3b9528d332a1a
7
- data.tar.gz: e39e7db71471026d17245c949e0e4d0e2f755a58b97842fe3a602422b7b3efacf0adab48cf3ea9dcd522ebb44062e31f997d4d9943a1fc277e3c418db7816a69
6
+ metadata.gz: 7a219d54aa4725525307540f3fec911ce6c956f3421faf2ba88ac2ab672972a46509b85128d044b1f8d48152ffe52973a3e241c5bc3a047c110edfef3f607ebd
7
+ data.tar.gz: 19555fa3ae535a42cf93ebd79e3e7695221648880d19d42d2a1562550b29085db991f630a12f4b60424074a85941fb4c485bf4e6f67f39ffbb4025223289840e
@@ -4,7 +4,7 @@ module ChatSDK
4
4
  module Teams
5
5
  class Adapter < ChatSDK::Adapter::Base
6
6
  capabilities :edit_messages, :delete_messages, :threads, :direct_messages,
7
- :message_history, :reactions, :file_uploads, :streaming_edit
7
+ :file_uploads, :streaming_edit, :typing_indicator
8
8
 
9
9
  attr_reader :client
10
10
 
@@ -129,24 +129,6 @@ module ChatSDK
129
129
  )
130
130
  end
131
131
 
132
- def add_reaction(channel_id:, message_id:, emoji:)
133
- require_capability!(:reactions)
134
- # Teams Bot Framework API does not support adding reactions programmatically
135
- # The capability is declared because inbound reactions are parsed
136
- raise ChatSDK::PlatformError.new(
137
- "Teams Bot Framework API does not support adding reactions programmatically",
138
- adapter_name: :teams
139
- )
140
- end
141
-
142
- def remove_reaction(channel_id:, message_id:, emoji:)
143
- require_capability!(:reactions)
144
- raise ChatSDK::PlatformError.new(
145
- "Teams Bot Framework API does not support removing reactions programmatically",
146
- adapter_name: :teams
147
- )
148
- end
149
-
150
132
  def open_dm(user_id)
151
133
  require_capability!(:direct_messages)
152
134
  # To open a DM, we need a service URL. Use the first cached one.
@@ -170,19 +152,16 @@ module ChatSDK
170
152
  conversation_id
171
153
  end
172
154
 
173
- def fetch_messages(channel_id:, thread_id: nil, cursor: nil, limit: 50)
174
- require_capability!(:message_history)
175
- # Teams Bot Framework doesn't provide a message history API
176
- # Return empty to satisfy the interface
177
- [[], nil]
178
- end
179
-
180
155
  def open_modal(trigger_id:, modal:)
181
- super # raises NotSupportedError
156
+ super
182
157
  end
183
158
 
184
159
  def start_typing(channel_id:, thread_id: nil)
185
- super # raises NotSupportedError
160
+ service_url = service_url_for(channel_id)
161
+ @client.send_typing(
162
+ service_url: service_url,
163
+ conversation_id: channel_id
164
+ )
186
165
  end
187
166
 
188
167
  def mention(user_id)
@@ -35,6 +35,11 @@ module ChatSDK
35
35
  authorized_request(:post, url, payload)
36
36
  end
37
37
 
38
+ def send_typing(service_url:, conversation_id:)
39
+ activity = {"type" => "typing"}
40
+ send_activity(service_url: service_url, conversation_id: conversation_id, activity: activity)
41
+ end
42
+
38
43
  def get_conversation_members(service_url:, conversation_id:)
39
44
  url = "#{service_url.chomp("/")}/v3/conversations/#{conversation_id}/members"
40
45
  authorized_request(:get, url)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_sdk-teams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quentin Rousseau