line-bot-api 1.19.0 → 1.20.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 +4 -4
- data/lib/line/bot/api/version.rb +1 -1
- data/lib/line/bot/client.rb +27 -1
- data/lib/line/bot/httpclient.rb +2 -4
- data/line-bot-api.gemspec +1 -2
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c883b0ee3ec91de695af601b3e147a9da46b4e75688522adbc76d98ef03758
|
4
|
+
data.tar.gz: 2fb79d8e282e2e832a9f66dad91f51db41bf9381ad7f015fb4efb5e6bac592af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05859f1da6840e6803ee814b335af6b854db5832d52a6f9b5760a56cd38a33d2f6c2655ea82b8b3026855714454d74ae231ec66739677f28147743973511a793'
|
7
|
+
data.tar.gz: 25dc42c2df495b0221d74306cf831f68ab72004808a92f72d415e50b75837b937dc95f49f3bd8673ee2b16475d829f3e5d14c189f4170b5a0b645f5217f934db
|
data/lib/line/bot/api/version.rb
CHANGED
data/lib/line/bot/client.rb
CHANGED
@@ -492,6 +492,31 @@ module Line
|
|
492
492
|
delete(endpoint, endpoint_path, credentials)
|
493
493
|
end
|
494
494
|
|
495
|
+
# Set rich menu alias
|
496
|
+
#
|
497
|
+
# @param rich_menu_id [String] ID of an uploaded rich menu
|
498
|
+
# @param rich_menu_alias_id [String] string of alias words rich menu
|
499
|
+
#
|
500
|
+
# @return [Net::HTTPResponse]
|
501
|
+
def set_rich_menus_alias(rich_menu_id, rich_menu_alias_id)
|
502
|
+
channel_token_required
|
503
|
+
|
504
|
+
endpoint_path = '/bot/richmenu/alias'
|
505
|
+
post(endpoint, endpoint_path, { richMenuId: rich_menu_id, richMenuAliasId: rich_menu_alias_id }.to_json, credentials)
|
506
|
+
end
|
507
|
+
|
508
|
+
# Unset rich menu alias
|
509
|
+
#
|
510
|
+
# @param rich_menu_alias_id [String] string of alias words rich menu
|
511
|
+
#
|
512
|
+
# @return [Net::HTTPResponse]
|
513
|
+
def unset_rich_menus_alias(rich_menu_alias_id)
|
514
|
+
channel_token_required
|
515
|
+
|
516
|
+
endpoint_path = "/bot/richmenu/alias/#{rich_menu_alias_id}"
|
517
|
+
delete(endpoint, endpoint_path, credentials)
|
518
|
+
end
|
519
|
+
|
495
520
|
# Link a rich menu to a user
|
496
521
|
#
|
497
522
|
# If you want to link a rich menu to multiple users,
|
@@ -954,7 +979,7 @@ module Line
|
|
954
979
|
def validate_signature(content, channel_signature)
|
955
980
|
return false if !channel_signature || !channel_secret
|
956
981
|
|
957
|
-
hash = OpenSSL::HMAC.digest(OpenSSL::Digest
|
982
|
+
hash = OpenSSL::HMAC.digest(OpenSSL::Digest.new('SHA256'), channel_secret, content)
|
958
983
|
signature = Base64.strict_encode64(hash)
|
959
984
|
|
960
985
|
variable_secure_compare(channel_signature, signature)
|
@@ -986,6 +1011,7 @@ module Line
|
|
986
1011
|
if file.respond_to?(:content_type)
|
987
1012
|
content_type = file.content_type
|
988
1013
|
raise ArgumentError, "invalid content type: #{content_type}" unless ['image/jpeg', 'image/png'].include?(content_type)
|
1014
|
+
|
989
1015
|
content_type
|
990
1016
|
else
|
991
1017
|
case file.path
|
data/lib/line/bot/httpclient.rb
CHANGED
data/line-bot-api.gemspec
CHANGED
@@ -17,10 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.required_ruby_version = '>= 2.
|
20
|
+
spec.required_ruby_version = '>= 2.4.0'
|
21
21
|
|
22
22
|
spec.add_development_dependency "addressable", "~> 2.3"
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.11" if RUBY_VERSION < "2.3"
|
24
23
|
spec.add_development_dependency 'rake', "~> 13.0"
|
25
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
25
|
spec.add_development_dependency "webmock", "~> 3.8"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-bot-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LINE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -114,15 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.
|
117
|
+
version: 2.4.0
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
rubygems_version: 2.7.6
|
124
|
+
rubygems_version: 3.1.4
|
126
125
|
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: SDK of the LINE Messaging API
|