lark-sdk 1.0.0 → 1.0.2

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: 828ec452f22dfb002801e9c322f540b0eca669f45529f4111a8bc6dfc3842372
4
- data.tar.gz: ef2f9b167e6129e4cad649769d019b743dd7a3f9e365affc9f0662cf1626fc39
3
+ metadata.gz: e01c411acf1296eed034499a8d51dfbfcd3ad456bee82aa78645a4e08f13bfb8
4
+ data.tar.gz: 2a593ea76f2239e3e978d6c0576ab0acbb3e9a7f5f774a26712d5dacc699b7a1
5
5
  SHA512:
6
- metadata.gz: bd756a5a651c2906d3d383a707ca8c9166bf3f94128213d1285160565f0cad259b109f9581da499e2ab7eda867ad4e4242b6268424bb22c518fd988ecaa8bd51
7
- data.tar.gz: 6e38c2ae9693319fdaf8344954bef8fbfef1e67b2f4f3929eb8ccd89561e9036c63ed6626c5f77f1cf243689448c6cf46308dfd5c3bdbc3fde3d1430867c5ae3
6
+ metadata.gz: 24cc174b337c06d9e25bba7451157ca4de96380ca9b46475306d82584eb61d56431710102a3936b4519e9872e290d804399887d1696b6d5233e5858d347a7649
7
+ data.tar.gz: 820e8ad03c5d89f95f4baf00d3ae54ad07b99c25a184606dd31fa76ad43863e9bcb8b9b7bd64eb4e9a883048d4973b05598c0395b15c69e4cbe9c7dd5ae87d59
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Lark
1
+ [![Gem Version](https://badge.fury.io/rb/lark-sdk.svg)](https://badge.fury.io/rb/lark-sdk)
2
2
 
3
- Unofficial ruby SDKs for Lark API [飞书](https://open.feishu.cn/document)
3
+ > Ruby SDKs for Lark(飞书) API https://open.feishu.cn/
4
4
 
5
5
  ## 安装
6
6
 
@@ -20,9 +20,9 @@ Or install it yourself as:
20
20
 
21
21
  require 'lark/sdk'
22
22
 
23
- ## 使用说明
23
+ ## 使用
24
24
 
25
- 初始化配置:
25
+ 初始化:
26
26
 
27
27
  ```ruby
28
28
  # config/initializers/lark.rb
@@ -33,7 +33,7 @@ Lark.configure do |config|
33
33
  end
34
34
  ```
35
35
 
36
- 新建 Lark API 接口实例:
36
+ 实例化 API
37
37
 
38
38
  ```ruby
39
39
  api = Lark::Api.new(
@@ -57,148 +57,15 @@ cipher.decrypt(message)
57
57
  cipher.encrypt(message)
58
58
  ```
59
59
 
60
- ## Api 列表
61
-
62
- ### 授权
63
- [`lib/lark/apis/auth.rb`](lib/lark/apis/auth.rb)
64
-
65
- | 名称 | 接口 |
66
- | --- | --- |
67
- | [获取 app_access_token](https://open.feishu.cn/document/ukTMukTMukTM/uADN14CM0UjLwQTN) | `api.app_access_token` |
68
- | [获取 tenant_access_token](https://open.feishu.cn/document/ukTMukTMukTM/uEjNz4SM2MjLxYzM) | `api.tenant_access_token` |
69
- | 更新 app_ticket | `api.app_ticket=` |
70
- | 获取 app_ticket | `api.app_ticket` |
71
- | [重新推送 app_ticket](https://open.feishu.cn/document/ukTMukTMukTM/uQjNz4CN2MjL0YzM) | `api.auth.app_ticket_resend` |
72
-
73
- ### 身份验证
74
- [`lib/lark/apis/authen.rb`](lib/lark/apis/authen.rb)
75
-
76
- | 名称 | 接口 |
77
- | --- | --- |
78
- | [请求身份验证](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN) | `api.authen.index(redirect_uri, state)` |
79
- | [获取登录用户身份](https://open.feishu.cn/document/ukTMukTMukTM/uEDO4UjLxgDO14SM4gTN) | `api.authen.access_token(code)` |
80
- | [刷新 access_token](https://open.feishu.cn/document/ukTMukTMukTM/uQDO4UjL0gDO14CN4gTN) | `api.authen.refresh_access_token(refresh_token)` |
81
- | [获取用户信息](https://open.feishu.cn/document/ukTMukTMukTM/uIDO4UjLygDO14iM4gTN) | `api.authen.user_info(user_access_token)` |
82
-
83
-
84
- ### 通讯录
85
- [`lib/lark/apis/contact.rb`](lib/lark/apis/contact.rb)
86
-
87
- | 名称 | 接口 |
88
- | --- | --- |
89
- | [获取通讯录授权范围](https://open.feishu.cn/document/ukTMukTMukTM/ugjNz4CO2MjL4YzM) | `api.contact.scope_get` |
90
- | [新增部门](https://open.feishu.cn/document/ukTMukTMukTM/uYzNz4iN3MjL2czM) | `api.contact.department_add` |
91
- | [批量新增部门](https://open.feishu.cn/document/ukTMukTMukTM/uMDOwUjLzgDM14yM4ATN) | `api.contact.department_batch_add` |
92
- | [删除部门](https://open.feishu.cn/document/ukTMukTMukTM/ugzNz4CO3MjL4czM) | `api.contact.department_delete` |
93
- | [更新部门信息](https://open.feishu.cn/document/ukTMukTMukTM/uczNz4yN3MjL3czM) | `api.contact.department_update` |
94
- | [获取部门详情](https://open.feishu.cn/document/ukTMukTMukTM/uAzNz4CM3MjLwczM) | `api.contact.department_get` |
95
- | [获取子部门列表](https://open.feishu.cn/document/ukTMukTMukTM/ugzN3QjL4czN04CO3cDN) | `api.contact.department_children` |
96
- | [获取子部门 ID 列表](https://open.feishu.cn/document/ukTMukTMukTM/ukjNz4SO2MjL5YzM) | `api.contact.department_children_ids` |
97
- | [批量获取部门详情](https://open.feishu.cn/document/ukTMukTMukTM/uczN3QjL3czN04yN3cDN) | `api.contact.department_batch_get` |
98
- | [获取部门用户列表](https://open.feishu.cn/document/ukTMukTMukTM/uEzNz4SM3MjLxczM) | `api.contact.department_user_list` |
99
- | [获取部门用户详情](https://open.feishu.cn/document/ukTMukTMukTM/uYzN3QjL2czN04iN3cDN) | `api.contact.department_user_detail_list` |
100
- | [新增用户](https://open.feishu.cn/document/ukTMukTMukTM/uMzNz4yM3MjLzczM) | `api.contact.user_add` |
101
- | [批量新增用户](https://open.feishu.cn/document/ukTMukTMukTM/uIDOwUjLygDM14iM4ATN) | `api.contact.user_batch_add` |
102
- | [删除用户](https://open.feishu.cn/document/ukTMukTMukTM/uUzNz4SN3MjL1czM) | `api.contact.user_delete` |
103
- | [更新用户信息](https://open.feishu.cn/document/ukTMukTMukTM/uQzNz4CN3MjL0czM) | `api.contact.user_update` |
104
- | [批量获取用户信息](https://open.feishu.cn/document/ukTMukTMukTM/uIzNz4iM3MjLyczM) | `api.contact.user_batch_get` |
105
- | [获取企业自定义用户属性配置](https://open.feishu.cn/document/ukTMukTMukTM/ucTN3QjL3UzN04yN1cDN) | `api.contact.tenant_custom_attr_get` |
106
- | [查询批量任务执行状态](https://open.feishu.cn/document/ukTMukTMukTM/uUDOwUjL1gDM14SN4ATN) | `api.contact.task_get` |
107
- | [获取应用管理员管理范围](https://open.feishu.cn/document/ukTMukTMukTM/uMzN3QjLzczN04yM3cDN) | `api.contact.user_admin_scope_get` |
108
- | [获取角色列表](https://open.feishu.cn/document/ukTMukTMukTM/uYzMwUjL2MDM14iNzATN) | `api.contact.role_list` |
109
- | [获取角色成员列表](https://open.feishu.cn/document/ukTMukTMukTM/uczMwUjL3MDM14yNzATN) | `api.contact.role_members` |
110
- | [使用手机号或邮箱获取用户 ID](https://open.feishu.cn/document/ukTMukTMukTM/uUzMyUjL1MjM14SNzITN) | `api.user.batch_get_id` |
60
+ [Api 列表](https://github.com/mycolorway/lark-ruby-sdk/wiki/API-List)
111
61
 
112
62
 
113
- ### 用户群组
114
- [`lib/lark/apis/user.rb`](lib/lark/apis/user.rb)
115
-
116
- | 名称 | 接口 |
117
- | --- | --- |
118
- | [获取用户所在的群列表](https://open.feishu.cn/document/ukTMukTMukTM/uQzMwUjL0MDM14CNzATN) | `api.user.group_list` |
119
- | [获取群成员列表](https://open.feishu.cn/document/ukTMukTMukTM/uUzMwUjL1MDM14SNzATN) | `api.chat.members` |
120
- | [搜索用户所在的群列表](https://open.feishu.cn/document/ukTMukTMukTM/uUTOyUjL1kjM14SN5ITN) | `api.chat.search` |
121
-
122
-
123
- ### 应用管理
124
- [`lib/lark/apis/application.rb`](lib/lark/apis/application.rb)
125
-
126
- | 名称 | 接口 |
127
- | --- | --- |
128
- | [校验应用管理员](https://open.feishu.cn/document/ukTMukTMukTM/uITN1EjLyUTNx4iM1UTM) | `api.application.is_user_admin` |
129
- | [获取应用在企业内的可用范围](https://open.feishu.cn/document/ukTMukTMukTM/uIjM3UjLyIzN14iMycTN) | `api.application.app_visibility` |
130
- | [获取用户可用的应用](https://open.feishu.cn/document/ukTMukTMukTM/uMjM3UjLzIzN14yMycTN) | `api.application.user_visible_apps` |
131
- | [获取企业安装的应用](https://open.feishu.cn/document/ukTMukTMukTM/uYDN3UjL2QzN14iN0cTN) | `api.application.app_list` |
132
- | [更新应用可用范围](https://open.feishu.cn/document/ukTMukTMukTM/ucDN3UjL3QzN14yN0cTN) | `api.application.app_update_visibility` |
133
-
134
-
135
- ### 应用商店
136
- [`lib/lark/apis/pay.rb`](lib/lark/apis/pay.rb)
137
-
138
- | 名称 | 接口 |
139
- | --- | --- |
140
- | [查询用户是否在应用开通范围](查询用户是否在应用开通范围) | `api.pay.paid_scope_check_user` |
141
- | [查询租户购买的付费方案](https://open.feishu.cn/document/ukTMukTMukTM/uETNwUjLxUDM14SM1ATN) | `api.pay.order_list` |
142
- | [查询订单详情](https://open.feishu.cn/document/ukTMukTMukTM/uITNwUjLyUDM14iM1ATN) | `api.pay.order_get` |
143
-
144
-
145
- ### 机器人 → 群信息和群管理
146
- [`lib/lark/apis/chat.rb`](lib/lark/apis/chat.rb)
147
-
148
- | 名称 | 接口 |
149
- | --- | --- |
150
- | [创建群](https://open.feishu.cn/document/ukTMukTMukTM/ukDO5QjL5gTO04SO4kDN) | `api.chat.create` |
151
- | [获取群列表](https://open.feishu.cn/document/ukTMukTMukTM/uITO5QjLykTO04iM5kDN) | `api.chat.list` |
152
- | [获取群信息](https://open.feishu.cn/document/ukTMukTMukTM/uMTO5QjLzkTO04yM5kDN) | `api.chat.info` |
153
- | [更新群信息](https://open.feishu.cn/document/ukTMukTMukTM/uYTO5QjL2kTO04iN5kDN) | `api.chat.update` |
154
- | [拉用户进群](https://open.feishu.cn/document/ukTMukTMukTM/ucTO5QjL3kTO04yN5kDN) | `api.chat.chatter_add` |
155
- | [移除用户出群](https://open.feishu.cn/document/ukTMukTMukTM/uADMwUjLwADM14CMwATN) | `api.chat.chatter_delete` |
156
- | [解散群](https://open.feishu.cn/document/ukTMukTMukTM/uUDN5QjL1QTO04SN0kDN) | `api.chat.disband` |
157
-
158
-
159
- ### 机器人信息和管理
160
- [`lib/lark/apis/bot.rb`](lib/lark/apis/bot.rb)
161
-
162
- | 名称 | 接口 |
163
- | --- | --- |
164
- | [获取机器人信息](https://open.feishu.cn/document/ukTMukTMukTM/uAjMxEjLwITMx4CMyETM) | `api.bot.info` |
165
- | [拉机器人进群](https://open.feishu.cn/document/ukTMukTMukTM/uYDO04iN4QjL2gDN) | `api.bot.add` |
166
- | [将机器人移出群](https://open.feishu.cn/document/ukTMukTMukTM/ucDO04yN4QjL3gDN) | `api.bot.remove` |
167
-
168
-
169
- ### 消息
170
- [`lib/lark/apis/message.rb`](lib/lark/apis/message.rb)
171
-
172
- | 名称 | 接口 |
173
- | --- | --- |
174
- | [批量发送消息](https://open.feishu.cn/document/ukTMukTMukTM/ucDO1EjL3gTNx4yN4UTM) | `api.message.batch_send` |
175
- | [发送消息(文本/图片/富文本/名片/卡片)](https://open.feishu.cn/document/ukTMukTMukTM/uUjNz4SN2MjL1YzM) | `api.message.direct_send` |
176
-
177
-
178
- ### 图片
179
- [`lib/lark/apis/image.rb`](lib/lark/apis/image.rb)
180
-
181
- | 名称 | 接口 |
182
- | --- | --- |
183
- | [上传图片](https://open.feishu.cn/document/ukTMukTMukTM/uEDO04SM4QjLxgDN) | `api.image.upload` |
184
- | [获取图片](https://open.feishu.cn/document/ukTMukTMukTM/uYzN5QjL2cTO04iN3kDN) | `api.image.download` |
185
-
186
-
187
- ## Development
188
-
189
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
190
-
191
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
192
-
193
- ## Contributing
194
-
195
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lark. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lark/blob/master/CODE_OF_CONDUCT.md).
63
+ ## 贡献
196
64
 
65
+ 如果你有好的意见或建议,欢迎给我们提issue或pull request。
197
66
 
198
67
  ## License
199
68
 
200
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
201
-
202
- ## Code of Conduct
69
+ The MIT License(http://opensource.org/licenses/MIT)
203
70
 
204
- Everyone interacting in the Lark project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lark/blob/master/CODE_OF_CONDUCT.md).
71
+ 请自由地享受和参与开源
data/lark.gemspec CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Sean Dong"]
7
7
  spec.email = ["sindon@gmail.com"]
8
8
 
9
- spec.summary = %q{Lark API SDKs for ruby}
10
- spec.description = %q{Unofficial ruby SDKs for Lark API [飞书](https://open.feishu.cn)}
9
+ spec.summary = %q{Lark(飞书) API SDKs for ruby}
10
+ spec.description = %q{Lark(飞书) API SDKs for ruby https://open.feishu.cn}
11
11
  spec.homepage = "https://github.com/mycolorway/lark-ruby-sdk"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
@@ -39,7 +39,7 @@ module Lark
39
39
  end
40
40
 
41
41
  def department_batch_get(department_ids=[])
42
- get 'contact/v1/department/detail/batch_get', params: {department_id: department_ids}
42
+ get 'contact/v1/department/detail/batch_get', params: {department_ids: department_ids}
43
43
  end
44
44
 
45
45
  def department_user_list(department_id:, offset:, page_size:, fetch_child: false)
@@ -76,7 +76,7 @@ module Lark
76
76
  post 'contact/v1/user/update', payload
77
77
  end
78
78
 
79
- def user_batch_get(params=[])
79
+ def user_batch_get(params={})
80
80
  get 'contact/v1/user/batch_get', params: params
81
81
  end
82
82
 
@@ -105,4 +105,4 @@ module Lark
105
105
  end
106
106
  end
107
107
  end
108
- end
108
+ end
@@ -2,7 +2,7 @@ module Lark
2
2
  module Apis
3
3
  module Image
4
4
  def upload(image, image_type)
5
- post_file 'image/v4/put/', file, params: { image_type: image_type }
5
+ post_file 'image/v4/put/', image, params: { image_type: image_type }
6
6
  end
7
7
 
8
8
  def download(image_key)
data/lib/lark/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lark
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.2'.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.0
4
+ version: 1.0.2
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-02-18 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '5.10'
97
- description: Unofficial ruby SDKs for Lark API [飞书](https://open.feishu.cn)
97
+ description: Lark(飞书) API SDKs for ruby https://open.feishu.cn
98
98
  email:
99
99
  - sindon@gmail.com
100
100
  executables: []
@@ -160,5 +160,5 @@ requirements: []
160
160
  rubygems_version: 3.1.2
161
161
  signing_key:
162
162
  specification_version: 4
163
- summary: Lark API SDKs for ruby
163
+ summary: Lark(飞书) API SDKs for ruby
164
164
  test_files: []