lark-sdk 1.0.9 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5868e2971c4a26c336cd64e0a8eb6c436148f822ce794af05892df4ff5549bb
4
- data.tar.gz: 12409e9192b839c6a2a944ea5a2ab097616859db4038439064ec6370bdb178f1
3
+ metadata.gz: '08a4fde8fbeb4ee1de6296383a3213ef9e9fc165dcef5bb686de850c1d55ee97'
4
+ data.tar.gz: 7260c1e561d94e347a9db46c023578dd6561fc0ae9321f18421b573d66695ba9
5
5
  SHA512:
6
- metadata.gz: 8705f5044981d5d1cce3630ce7f2b4c54e7c6bceb8c61b0d0f24210b12765bfb742689abdc607d9b187b89da237beff6b9d5f52c65db9ec132fcc136a8c28ffe
7
- data.tar.gz: ecf301ef9d0f47ac681ee4c0caf0725f1d19ebe75e2de5a1872f4a82735689c23aaed2c9eca238c88cf4bba82e14c99cb75ff74ea1874f972b72c56bfcb823af
6
+ metadata.gz: f7c041bbb3b7339dad3fa7b0e7e0d7c8d34b4b6e324d623785838b4c79dd13af99f8e149c0f41b034fda7c5c89833a3b19bfa8699f948bfc13ada9ecc59a9044
7
+ data.tar.gz: b6facce755dafa4bcd048fb342d1c7dc95636b1db1dddeb3e39a4a86815f0f4a2b084a429d3515b184ba24372129608815c59554adf5f476b496e6ae604a79d4
@@ -5,8 +5,8 @@ require 'lark/config'
5
5
  require 'lark/cipher'
6
6
  require 'lark/helper'
7
7
 
8
- LIB_PATH = "#{File.dirname(__FILE__)}/lark"
9
- Dir["#{LIB_PATH}/apis/*.rb", "#{LIB_PATH}/token_store/*.rb"].each { |path| require path }
8
+ lib_path = "#{File.dirname(__FILE__)}/lark"
9
+ Dir["#{lib_path}/apis/**/*.rb", "#{lib_path}/token_store/*.rb"].each { |path| require path }
10
10
 
11
11
  require 'lark/api'
12
12
 
@@ -15,6 +15,7 @@ module Lark
15
15
 
16
16
  # Exceptions
17
17
  class RedisNotConfigException < RuntimeError; end
18
+ class AppNotConfigException < RuntimeError; end
18
19
  class AccessTokenExpiredError < RuntimeError; end
19
20
  class ResultErrorException < RuntimeError; end
20
21
  class ResponseError < StandardError
@@ -16,6 +16,7 @@ module Lark
16
16
  api_mount :image
17
17
  api_mount :mina
18
18
  api_mount :notify
19
+ api_mount :interactive
19
20
  api_mount :'drive/file'
20
21
  api_mount :'drive/folder'
21
22
  api_mount :'drive/platform'
@@ -25,6 +26,8 @@ module Lark
25
26
  def initialize options={}
26
27
  @app_id = options.delete(:app_id) || Lark.config.default_app_id
27
28
  @app_secret = options.delete(:app_secret) || Lark.config.default_app_secret
29
+ raise AppNotConfigException if @app_id.nil? || @app_id.empty?
30
+
28
31
  @tenant_key = options.delete(:tenant_key)
29
32
  @isv = options.delete(:isv) || Lark.config.default_isv
30
33
  @options = options
@@ -76,12 +79,14 @@ module Lark
76
79
 
77
80
  def app_token_store
78
81
  return @app_token_store if defined?(@app_token_store)
82
+
79
83
  klass = isv ? TokenStore::IsvAppToken : TokenStore::AppToken
80
84
  @app_token_store = klass.new(self)
81
85
  end
82
86
 
83
87
  def tenant_token_store
84
88
  return @tenant_token_store if defined?(@tenant_token_store)
89
+
85
90
  klass = isv ? TokenStore::IsvTenantToken : TokenStore::TenantToken
86
91
  @tenant_token_store = klass.new(self)
87
92
  end
@@ -39,7 +39,7 @@ module Lark
39
39
  end
40
40
 
41
41
  def update(payload={})
42
- get 'chat/v4/update/', payload
42
+ post 'chat/v4/update/', payload
43
43
  end
44
44
 
45
45
  def chatter_add(chat_id:, user_ids: nil, open_ids: nil)
@@ -63,4 +63,4 @@ module Lark
63
63
  end
64
64
  end
65
65
  end
66
- end
66
+ end
@@ -0,0 +1,12 @@
1
+ module Lark
2
+ module Apis
3
+ module Interactive
4
+ def card_update(token:, card:)
5
+ post 'interactive/v1/card/update', {
6
+ token: token,
7
+ card: card
8
+ }
9
+ end
10
+ end
11
+ end
12
+ end
@@ -7,7 +7,7 @@ module Lark
7
7
  class_eval <<-CODE, __FILE__, __LINE__ + 1
8
8
  def #{name.to_s.gsub('/', '_')}
9
9
  @#{name.to_s.gsub('/', '_')} ||= Class.new(SimpleDelegator) do
10
- include Apis::#{name.to_s.classify}
10
+ include ::Lark::Apis::#{name.to_s.classify}
11
11
  end.new(self)
12
12
  end
13
13
  CODE
@@ -1,3 +1,3 @@
1
1
  module Lark
2
- VERSION = '1.0.9'.freeze
2
+ VERSION = '1.0.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lark-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Dong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-13 00:00:00.000000000 Z
11
+ date: 2020-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -123,6 +123,7 @@ files:
123
123
  - lib/lark/apis/drive/folder.rb
124
124
  - lib/lark/apis/drive/platform.rb
125
125
  - lib/lark/apis/image.rb
126
+ - lib/lark/apis/interactive.rb
126
127
  - lib/lark/apis/message.rb
127
128
  - lib/lark/apis/mina.rb
128
129
  - lib/lark/apis/notify.rb