wechat 1.0.1 → 1.1.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: 8862a096490e208b18609027a14e80d12b386dcd86094065e4412856012ec3db
4
- data.tar.gz: a71e7b18973fab14ff351b04e840c534ea6229ff59c98d0cc2deee93587237ed
3
+ metadata.gz: 8d81118b4e78b92ca291b74b4040ac07d36c3c3bf5c433c583e247262a564598
4
+ data.tar.gz: 134affd462f41d996fa4cf30eb1787e3f682283ccf95b1eebd83b2ce63fdedd3
5
5
  SHA512:
6
- metadata.gz: 0dc2fab306d761d1a887478c2eb3d355064fa0c3a18bc5a91df6fb426eed5fe4d73073738d0011ca15e0b1a8042035fcb53b0d57937b9749c31d8efd94cb704e
7
- data.tar.gz: 83eb3e8c604000a515888c0bca6f7d059de49f07fd691c67dd6a0a5bc1262a8fd1758a672f6244b54f3771bd6f591593b0b03b3d660c3a1c030397dd8ee87a0e
6
+ metadata.gz: a73a0946f5e5451f731699f58c37133745a5403428cc74bccdd00006c0bff2ee935afc34d3bc4ac3f282c7fe3b59b21758b432e7d53d629adb3d6d94de3bc47a
7
+ data.tar.gz: 6a552e883d2218c46558c9f72eba7113c54f3019691c4c9874884244425958ede2487079f8ae671794bb5d5f0e2a8efd5ee4ba98afa6dcbc3cd9ce6f97bee20e
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.1.0 (released at 2025-11-24)
4
+
5
+ * Feat: api wxa_get_user_risk_rank. by @leepood #327
6
+
3
7
  ## v1.0.1 (released at 2025-07-09)
4
8
 
5
9
  * Fix after introduce httpx, status method not available for HTTPX::ErrorResponse bug
data/README-CN.md CHANGED
@@ -1,4 +1,4 @@
1
- WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://mixtint.semaphoreci.com/badges/wechat/branches/main.svg?style=shields)](https://mixtint.semaphoreci.com/projects/wechat) [![Maintainability](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/maintainability)](https://codeclimate.com/github/Eric-Guo/wechat/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/test_coverage)](https://codeclimate.com/github/Eric-Guo/wechat/test_coverage)
1
+ WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://mixtint.semaphoreci.com/badges/wechat/branches/main.svg?style=shields)](https://mixtint.semaphoreci.com/projects/wechat)[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Eric-Guo/wechat)
2
2
  ======
3
3
 
4
4
  [![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Eric-Guo/wechat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://mixtint.semaphoreci.com/badges/wechat/branches/main.svg?style=shields)](https://mixtint.semaphoreci.com/projects/wechat) [![Maintainability](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/maintainability)](https://codeclimate.com/github/Eric-Guo/wechat/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/12885358487c13e91e00/test_coverage)](https://codeclimate.com/github/Eric-Guo/wechat/test_coverage)
1
+ WeChat [![Gem Version](https://badge.fury.io/rb/wechat.svg)](https://rubygems.org/gems/wechat) [![Build Status](https://mixtint.semaphoreci.com/badges/wechat/branches/main.svg?style=shields)](https://mixtint.semaphoreci.com/projects/wechat)[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Eric-Guo/wechat)
2
2
  ======
3
3
 
4
4
  [![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Eric-Guo/wechat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -4,6 +4,7 @@ module ActionController
4
4
  module WechatResponder
5
5
  def wechat_api(opts = {})
6
6
  include Wechat::ControllerApi
7
+
7
8
  account = opts.delete(:account)
8
9
  self.wechat_cfg_account = account ? account.to_sym : :default
9
10
  self.wechat_api_client = load_controller_wechat(wechat_cfg_account, opts)
@@ -11,6 +12,7 @@ module ActionController
11
12
 
12
13
  def wechat_responder(opts = {})
13
14
  include Wechat::Responder
15
+
14
16
  account = opts.delete(:account)
15
17
  self.account_from_request = opts.delete(:account_from_request)
16
18
  self.wechat_cfg_account = account ? account.to_sym : :default
@@ -93,6 +93,12 @@ module Wechat
93
93
  post 'business/getuserphonenumber', JSON.generate(code: code), base: Wechat::Api::WXA_BASE
94
94
  end
95
95
 
96
+ def wxa_get_user_risk_rank(openid, scene, **payload)
97
+ # https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/sec-center/safety-control-capability/getUserRiskRank.html
98
+ request_body = { appid: access_token.appid, openid: openid, scene: scene }.merge(payload)
99
+ post 'getuserriskrank', JSON.generate(request_body), base: Wechat::Api::WXA_BASE
100
+ end
101
+
96
102
  def wxa_get_wxacode(path, width = 430)
97
103
  post 'getwxacode', JSON.generate(path: path, width: width), base: Wechat::Api::WXA_BASE
98
104
  end
@@ -158,7 +164,7 @@ module Wechat
158
164
 
159
165
  def material_add(type, file, opts = {})
160
166
  params = { type: type }
161
- params.merge!(description: opts.slice(:title, :introduction).to_json) if type == 'video'
167
+ params[:description] = opts.slice(:title, :introduction).to_json if type == 'video'
162
168
 
163
169
  post_file 'material/add_material', file, params: params
164
170
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skinnyworm
@@ -147,14 +147,14 @@ dependencies:
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: 1.72.2
150
+ version: 1.81.7
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: 1.72.2
157
+ version: 1.81.7
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: rails
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -175,14 +175,14 @@ dependencies:
175
175
  requirements:
176
176
  - - "~>"
177
177
  - !ruby/object:Gem::Version
178
- version: '7.1'
178
+ version: '8.0'
179
179
  type: :development
180
180
  prerelease: false
181
181
  version_requirements: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: '7.1'
185
+ version: '8.0'
186
186
  - !ruby/object:Gem::Dependency
187
187
  name: rspec-mocks
188
188
  requirement: !ruby/object:Gem::Requirement
@@ -271,8 +271,8 @@ licenses:
271
271
  metadata:
272
272
  bug_tracker_uri: https://github.com/Eric-Guo/wechat/issues
273
273
  changelog_uri: https://github.com/Eric-Guo/wechat/releases
274
- documentation_uri: https://github.com/Eric-Guo/wechat/tree/v1.0.1#readme
275
- source_code_uri: https://github.com/Eric-Guo/wechat/tree/v1.0.1
274
+ documentation_uri: https://github.com/Eric-Guo/wechat/tree/v1.1.0#readme
275
+ source_code_uri: https://github.com/Eric-Guo/wechat/tree/v1.1.0
276
276
  rubygems_mfa_required: 'true'
277
277
  post_install_message: |2
278
278
 
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  - !ruby/object:Gem::Version
292
292
  version: 3.1.6
293
293
  requirements: []
294
- rubygems_version: 3.6.9
294
+ rubygems_version: 3.7.2
295
295
  specification_version: 4
296
296
  summary: DSL for wechat message handling and API
297
297
  test_files: []
metadata.gz.sig CHANGED
Binary file