bot_framework 0.1.0beta → 0.1.0beta2

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -1
  3. data/README.md +14 -1
  4. data/appveyor.yml +20 -0
  5. data/bot_framework.gemspec +6 -0
  6. data/examples/dialog/basic_first_run.rb +12 -0
  7. data/examples/ruby_conf/Gemfile +8 -0
  8. data/examples/ruby_conf/Gemfile.lock +85 -0
  9. data/examples/ruby_conf/bot.rb +88 -0
  10. data/examples/ruby_conf/config.ru +6 -0
  11. data/examples/ruby_conf/speaker_data.yaml +41 -0
  12. data/examples/simple_regex/Gemfile +6 -0
  13. data/examples/simple_regex/Gemfile.lock +63 -0
  14. data/examples/simple_regex/bot.rb +35 -0
  15. data/examples/simple_regex/config.ru +6 -0
  16. data/images/emulator1.png +0 -0
  17. data/images/emulator2.png +0 -0
  18. data/lib/bot_framework.rb +12 -0
  19. data/lib/bot_framework/api_base.rb +6 -4
  20. data/lib/bot_framework/bot.rb +47 -2
  21. data/lib/bot_framework/connector.rb +13 -5
  22. data/lib/bot_framework/console_connector.rb +17 -0
  23. data/lib/bot_framework/dialogs/action_set.rb +66 -0
  24. data/lib/bot_framework/dialogs/dialog.rb +25 -0
  25. data/lib/bot_framework/dialogs/entity_recognizer.rb +123 -0
  26. data/lib/bot_framework/dialogs/luis_recognizer.rb +72 -0
  27. data/lib/bot_framework/dialogs/reg_exp_recognizer.rb +41 -0
  28. data/lib/bot_framework/dialogs/simple_dialog.rb +29 -0
  29. data/lib/bot_framework/events/event_emitter.rb +6 -0
  30. data/lib/bot_framework/message.rb +80 -0
  31. data/lib/bot_framework/models/object.rb +0 -1
  32. data/lib/bot_framework/prompt.rb +62 -0
  33. data/lib/bot_framework/server.rb +1 -1
  34. data/lib/bot_framework/session.rb +407 -0
  35. data/lib/bot_framework/simple_prompt_recognizer.rb +4 -0
  36. data/lib/bot_framework/token_validator.rb +6 -4
  37. data/lib/bot_framework/universal_bot.rb +7 -0
  38. data/lib/bot_framework/version.rb +1 -1
  39. metadata +100 -4
@@ -0,0 +1,4 @@
1
+ module BotFramework
2
+ class SimplePromptRecognizer
3
+ end
4
+ end
@@ -46,7 +46,7 @@ module BotFramework
46
46
 
47
47
  def valid_header?
48
48
  # The token was sent in the HTTP Authorization header with "Bearer" scheme
49
- condition = auth_header.start_with? 'Bearer'
49
+ condition = auth_header and auth_header.start_with? 'Bearer'
50
50
  errors << 'Invalid headers' unless condition
51
51
  condition
52
52
  end
@@ -61,14 +61,16 @@ module BotFramework
61
61
 
62
62
  def valid_iss?
63
63
  # The token contains an issuer claim with value of https://api.botframework.com
64
- condition = JWT.decode(token, nil, false).first['iss'] == 'https://api.botframework.com'
65
- errors << 'Invalid iss' unless condition
64
+ iss = JWT.decode(token, nil, false).first['iss']
65
+ condition = ['https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/', 'https://api.botframework.com'].include?(iss)
66
+ errors << "Invalid iss #{iss}" unless condition
66
67
  condition
67
68
  end
68
69
 
69
70
  def valid_audience?
70
71
  # The token contains an audience claim with a value equivalent to your bot’s Microsoft App ID.
71
- condition = (JWT.decode(token, nil, false).first['aud'] == BotFramework.connector.app_id)
72
+ aud = JWT.decode(token, nil, false).first['aud']
73
+ condition = ['https://graph.microsoft.com', BotFramework.connector.app_id].include?(aud)
72
74
  errors << 'Invalid audience' unless condition
73
75
  condition
74
76
  end
@@ -0,0 +1,7 @@
1
+ module BotFramework
2
+ class UniversalBot
3
+ def initialize(session, default_dialog); end
4
+
5
+ def dialog(name, dialogs); end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module BotFramework
2
- VERSION = '0.1.0beta'.freeze
2
+ VERSION = '0.1.0beta2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bot_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0beta
4
+ version: 0.1.0beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aboobacker MK
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-20 00:00:00.000000000 Z
11
+ date: 2017-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,6 +122,76 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: timers
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rb-readline
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: chronic
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: chronic_duration
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: nio4r
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
125
195
  description: Unofficial ruby client for microsoft botframework
126
196
  email:
127
197
  - aboobackervyd@gmail.com
@@ -137,20 +207,42 @@ files:
137
207
  - LICENSE.txt
138
208
  - README.md
139
209
  - Rakefile
210
+ - appveyor.yml
140
211
  - bin/console
141
212
  - bin/setup
142
213
  - bot_framework.gemspec
214
+ - examples/dialog/basic_first_run.rb
143
215
  - examples/echo/bot.rb
144
216
  - examples/echo/config.ru
217
+ - examples/ruby_conf/Gemfile
218
+ - examples/ruby_conf/Gemfile.lock
219
+ - examples/ruby_conf/bot.rb
220
+ - examples/ruby_conf/config.ru
221
+ - examples/ruby_conf/speaker_data.yaml
222
+ - examples/simple_regex/Gemfile
223
+ - examples/simple_regex/Gemfile.lock
224
+ - examples/simple_regex/bot.rb
225
+ - examples/simple_regex/config.ru
145
226
  - examples/stock/bot.rb
146
227
  - examples/stock/config.ru
228
+ - images/emulator1.png
229
+ - images/emulator2.png
147
230
  - lib/bot_framework.rb
148
231
  - lib/bot_framework/api_base.rb
149
232
  - lib/bot_framework/bot.rb
150
233
  - lib/bot_framework/bot_state.rb
151
234
  - lib/bot_framework/connector.rb
235
+ - lib/bot_framework/console_connector.rb
152
236
  - lib/bot_framework/conversation.rb
237
+ - lib/bot_framework/dialogs/action_set.rb
238
+ - lib/bot_framework/dialogs/dialog.rb
239
+ - lib/bot_framework/dialogs/entity_recognizer.rb
240
+ - lib/bot_framework/dialogs/luis_recognizer.rb
241
+ - lib/bot_framework/dialogs/reg_exp_recognizer.rb
242
+ - lib/bot_framework/dialogs/simple_dialog.rb
153
243
  - lib/bot_framework/errors.rb
244
+ - lib/bot_framework/events/event_emitter.rb
245
+ - lib/bot_framework/message.rb
154
246
  - lib/bot_framework/models/activity.rb
155
247
  - lib/bot_framework/models/api_response.rb
156
248
  - lib/bot_framework/models/attachment.rb
@@ -175,8 +267,12 @@ files:
175
267
  - lib/bot_framework/models/resource_response.rb
176
268
  - lib/bot_framework/models/signin_card.rb
177
269
  - lib/bot_framework/models/thumbnail_card.rb
270
+ - lib/bot_framework/prompt.rb
178
271
  - lib/bot_framework/server.rb
272
+ - lib/bot_framework/session.rb
273
+ - lib/bot_framework/simple_prompt_recognizer.rb
179
274
  - lib/bot_framework/token_validator.rb
275
+ - lib/bot_framework/universal_bot.rb
180
276
  - lib/bot_framework/util.rb
181
277
  - lib/bot_framework/version.rb
182
278
  homepage: https://github.com/tachyons/bot-framework-ruby
@@ -191,7 +287,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
287
  requirements:
192
288
  - - ">="
193
289
  - !ruby/object:Gem::Version
194
- version: '0'
290
+ version: 2.2.0
195
291
  required_rubygems_version: !ruby/object:Gem::Requirement
196
292
  requirements:
197
293
  - - ">"
@@ -199,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
295
  version: 1.3.1
200
296
  requirements: []
201
297
  rubyforge_project:
202
- rubygems_version: 2.6.6
298
+ rubygems_version: 2.6.8
203
299
  signing_key:
204
300
  specification_version: 4
205
301
  summary: Ruby client for microsoft botframework .