widgit_accounts_sdk 0.0.7 → 0.0.9

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: 7c55743e80bab6e1a33ac5ddd8bba686d00ce44f4a2322bf32603bf0a2f3d93b
4
- data.tar.gz: f4ae9bfab8e4fc08bdf6a4a9d68e8ed1486390860433f0c01820b5c4f9a6cf34
3
+ metadata.gz: 02f0c0fb936f113d9379f36ff88ac51ba25820270698290aed62a2705e2a1242
4
+ data.tar.gz: 95fd39a61dcee7413594bd6805ea7238305588261281ebb3cda2003fbf479d38
5
5
  SHA512:
6
- metadata.gz: 4af367fbf76278d2a46b20ee2b8d0284f234217fd03010eee4e97d17d4141dbb6e79ed26c65b0dfe35f30f1a6ba4a22c21f294f4b716afb9768e85ac7ca45898
7
- data.tar.gz: 750e4532950ca2d82d0ca3702df03cbc1f8109e51cdd2222ef2c0491d3223d5a5437c9b120c53d096c74672ae445d3ac1fd5c21e341f1c6dd5f9711c02752352
6
+ metadata.gz: 9c145bb37a9dfa3ca9cf4d4413f86ea855a1645a17b805e7134399fc3a23bc2896324fb6b35454334f2e03ed6bad4e4f36756d7c0f24cf003524ea5457a90d64
7
+ data.tar.gz: 808949d3120fe509121861a5cb05c292fbe61da77213f0fe0d5029ec4c555827a38395e6ddd08b90229ca9936b47b12db830a550d18de10aea448c63950b9ced
@@ -30,11 +30,10 @@ module WidgitAccountsSdk
30
30
  return success.merge('exists' => response['exists'])
31
31
  end
32
32
 
33
- def invite(email, first_name = nil, last_name = nil)
34
- email = CGI.escape email # URL encode the string, for things like plus forwarding which get converted to spaces
35
- request_url = "/api/v1/accounts/invite?#{email.to_query(:email)}"
36
- request_url += "&#{first_name.to_query(:first_name)}" if first_name
37
- request_url += "&#{last_name.to_query(:last_name)}" if last_name
33
+ def invite(email, **options)
34
+ params = { email: email }.merge(options.compact)
35
+ query = params.to_query
36
+ request_url = "/api/v1/accounts/invite?#{query}"
38
37
  response = request(request_url, :post)
39
38
  return failed(response['error']) if response['status'] == 'failed'
40
39
  return response
@@ -131,15 +130,19 @@ module WidgitAccountsSdk
131
130
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
132
131
  http.open_timeout = 30
133
132
  http.read_timeout = 30
134
- case method
135
- when :get
136
- req = Net::HTTP::Get.new(uri.request_uri)
137
- when :post
138
- req = Net::HTTP::Post.new(uri.request_uri)
139
- req.body = params.to_query
140
- when :patch
141
- req = Net::HTTP::Patch.new(uri.request_uri)
142
- req.body = params.to_query
133
+
134
+ req =
135
+ case method
136
+ when :get
137
+ Net::HTTP::Get.new(uri.request_uri)
138
+ when :post
139
+ Net::HTTP::Post.new(uri.request_uri)
140
+ when :patch
141
+ Net::HTTP::Patch.new(uri.request_uri)
142
+ end
143
+ if [:post, :patch].include?(method)
144
+ req.body = params.to_json
145
+ req["Content-Type"] = "application/json"
143
146
  end
144
147
  req["Authorization"] = WidgitAccountsSdk.configuration.api_key
145
148
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: widgit_accounts_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stu Wright
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-09-19 00:00:00.000000000 Z
12
+ date: 2026-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jwt
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.4.1
55
+ rubygems_version: 3.5.22
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: Widgit Accounts API Client Ruby Gem