widgit_accounts_sdk 0.0.3 → 0.0.4

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: b364cf8e9313f1f8bdaa1dc6151d88596330c051dfe4f0469d55060d95115fc9
4
- data.tar.gz: a623561a5792d926aa9ed4b8c562e30f766cad36a548bec2d8b7c19bde59186c
3
+ metadata.gz: 6fe71b03bed7f029020960beb4aaa6771657a0fb389509220bfced6287882309
4
+ data.tar.gz: 54d13001c2c7628bbcb398ae0d0601cc2ad260513c3d57d9cea4215bdc1638f5
5
5
  SHA512:
6
- metadata.gz: 6b808013be4175d5000064892d07106c0869158b1acdc271706a4f15b32e883cd09f8e39ad406e2bd1d328329b6021a8ac1d2e4de6c24a171b94c8dd695f381a
7
- data.tar.gz: 9eeae767b91a3ffeeb37afeb3a3962d097e2200cd73829ffee14983e9b8f6ff8bf9c158b05b05aaa9c56f4cd68a064fc9b484c6062adb0e20d273b8197ef642d
6
+ metadata.gz: d24f4ffd0367201b05a641c50cb02811873f87757379e4a0dfa40c950e9ca7ab545c35f014770ff538e978d514d3c701da4ffe3fe74f702c3c038b6b858db28b
7
+ data.tar.gz: cfbc0b2a8dcac71911f2ca9925b01294ba54351c9ef8f1279555fede66a7098c56f3384c543579235d586a7c7d641fd6555483135a568bdc8a70ed2ffacdb249
@@ -6,40 +6,40 @@ module WidgitAccountsSdk
6
6
  extend self
7
7
 
8
8
  def find_with_uid(uid)
9
- response = request("/api/v1/accounts?uid=#{uid}")
9
+ response = request("/api/v1/accounts?#{uid.to_query(:uid)}")
10
10
  return failed(response['error']) if response['status'] == 'failure'
11
11
  return success.merge('account' => response.dig('data', 0))
12
12
  end
13
13
 
14
14
  def find_with_email(email)
15
- response = request("/api/v1/accounts?email=#{email}")
15
+ response = request("/api/v1/accounts?#{email.to_query(:email)}")
16
16
  return failed(response['error']) if response['status'] == 'failure'
17
17
  return success.merge('account' => response.dig('data', 0))
18
18
  end
19
19
 
20
20
  def find_with_username(username)
21
- response = request("/api/v1/accounts?username=#{username}")
21
+ response = request("/api/v1/accounts?#{username.to_query(:username)}")
22
22
  return failed(response['error']) if response['status'] == 'failure'
23
23
  return success.merge('account' => response.dig('data', 0))
24
24
  end
25
25
 
26
26
  def exists?(email)
27
- response = request("/api/v1/accounts/check?email=#{email}")
27
+ response = request("/api/v1/accounts/check?#{email.to_query(:email)}")
28
28
  return failed(response['error']) if response['status'] == 'failure'
29
29
  return success.merge('exists' => response['exists'])
30
30
  end
31
31
 
32
32
  def invite(email, first_name = nil, last_name = nil)
33
- request_url = "/api/v1/accounts/invite?email=#{email}"
34
- request_url += "&first_name=#{first_name}" if first_name
35
- request_url += "&last_name=#{last_name}" if last_name
33
+ request_url = "/api/v1/accounts/invite?#{email.to_query(:email)}"
34
+ request_url += "&#{first_name.to_query(:first_name)}" if first_name
35
+ request_url += "&#{last_name.to_query(:last_name)}" if last_name
36
36
  response = request(request_url, :post)
37
37
  return failed(response['error']) if response['status'] == 'failure'
38
38
  return response
39
39
  end
40
40
 
41
41
  def get_new_invite_token(email)
42
- response = request("/api/v1/accounts/invite?email=#{email}", :post)
42
+ response = request("/api/v1/accounts/invite?#{email.to_query(:email)}", :post)
43
43
  return response['data']['invitation_token'] if response['status'] == 'success'
44
44
  return nil
45
45
  end
@@ -57,7 +57,8 @@ module WidgitAccountsSdk
57
57
  end
58
58
 
59
59
  def watch(uid, watcher_url = nil)
60
- response = request("/api/v1/accounts/#{uid}/watch?address=#{watcher_url || WidgitAccountsSdk.configuration.watch_webhook_url}")
60
+ watcher_url = watcher_url || WidgitAccountsSdk.configuration.watch_webhook_url
61
+ response = request("/api/v1/accounts/#{uid}/watch?#{watcher_url.to_query(:address)}")
61
62
  return failed(response['error']) if response['status'] == 'failure'
62
63
  return response
63
64
  end
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.3
4
+ version: 0.0.4
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: 2023-06-21 00:00:00.000000000 Z
12
+ date: 2023-07-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A Ruby client for interacting with the Widgit Accounts API
15
15
  email: james.sherriff@widgit.com
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
- rubygems_version: 3.3.7
41
+ rubygems_version: 3.3.26
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: Widgit Accounts API Client Ruby Gem