widgit_accounts_sdk 0.0.1 → 0.0.2

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: 8a59aef3a5e0413b6cce398b9bbde9c5bc8c058e12d5f95b94f549da7fc2a7f6
4
- data.tar.gz: ca056e41a9891b1b5c6d6f016c1c12c88a35566979d031c7f365e1788eba9fc1
3
+ metadata.gz: 6c0bc9dbe6869b14e497542ca5e4d4dea00a29d3301e19dbf2f26bc70e1deaa6
4
+ data.tar.gz: 890fb807737d3e544db3590c573ab4587c8893980e2a50df94b7d58133ac089b
5
5
  SHA512:
6
- metadata.gz: 37c5d73075994e18cd8681cbf984cc4e117a9560a95cbcad51c8bf38fa87ce560c3a24a2b1e703d184bef386fea833a42169b64b164273c53ebf00fcadc8f0ba
7
- data.tar.gz: 74d86331f5ab85917c974b29911ba6964ce69e327d0eb117c1bed0caf48a3ef5cb2ff7b5fbce575926f33c675d44a187e0eb656796a74a9b6ee4de819d610ebd
6
+ metadata.gz: cff001a4a81b142573ff35d82bc89c2afdfc0051fad6da77c91361bb297c528d90a864c8f8ee1ad3b06aa3170453f8c4a163369dcf6edecb0a2e6fe608dbd44f
7
+ data.tar.gz: b0e3d8912702ed1b55ce315ed2db0d4bba5829edcee7a55ac25d450a8830f12bd654b8da1197ac8de449b76bb50c5561aece4024c78f68fbd7ef539ce21e22be
@@ -29,8 +29,11 @@ module WidgitAccountsSdk
29
29
  return success.merge('exists' => response['exists'])
30
30
  end
31
31
 
32
- def invite(email, first_name, last_name)
33
- response = request("/api/v1/accounts/invite?email=#{email}&first_name=#{first_name}&last_name=#{last_name}", :post)
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
36
+ response = request(request_url, :post)
34
37
  return failed(response['error']) if response['status'] == 'failure'
35
38
  return response
36
39
  end
@@ -53,6 +56,12 @@ module WidgitAccountsSdk
53
56
  return response
54
57
  end
55
58
 
59
+ def watch(uid, watcher_url)
60
+ response = request("/api/v1/accounts/#{uid}/watch?address=#{Rails.application.config.wa_webhooks_url}")
61
+ return failed(response['error']) if response['status'] == 'failure'
62
+ return response
63
+ end
64
+
56
65
  private
57
66
  def request(path, method = :get, params = {})
58
67
  uri = URI.parse("#{WidgitAccountsSdk.configuration.host}#{path}")
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.1
4
+ version: 0.0.2
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-14 00:00:00.000000000 Z
12
+ date: 2023-06-15 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