arux_app 3.0.1 → 3.0.3

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: 85bcc4d2383ab3ad7c4cca9f53e8fbb2d9ee68dfe57f74fdaa8d1fa131c18765
4
- data.tar.gz: af59717d95e085489abf6ca4d168f7728778bd7be1140fceb437c4e7345680af
3
+ metadata.gz: abf9ace8f7b311960edb721dc4cbc9f0e00c8c844c9420ed91d96efe247c8536
4
+ data.tar.gz: edc123a35cd47d96a96c9aac4adba85f861a91f0167c0a755a801062d912273a
5
5
  SHA512:
6
- metadata.gz: 40e9a3479f77e03d7b9b380e6fcdcababc48c2dcfc1fe33cee00e14005b948b138f96934189cd8e1becbcef8d0aa71c54a9f57893b3431a145ecfeddf39c5f83
7
- data.tar.gz: 44cca7dee5a4b84d4bbb550201cecddc932089d7f41c20f9624fda36d4ae4440c3fab817c939315403e1953e7afc6fc0538900b5f5d4cea0ffe1a50ddd38d420
6
+ metadata.gz: ca0759a72bd036a16a1f26fb0e8983d3885e8f11301d4ea8b2683ce0b87df9f295b30287ffd7663c77c29a3eca8d06454613181ec4269ff8bed4ef8d1f35939a
7
+ data.tar.gz: 8cc563f83bdfe9d8be79088e71764f3075f37261ce89e7ae3b384303a584e8fe5bfa24a78432052c7f9db7c832403801e4c271ac275b6c6ca5d3d2baeca1831c
data/arux_app.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "arux_app"
7
- spec.version = "3.0.1"
7
+ spec.version = "3.0.3"
8
8
  spec.authors = ["Arux Software"]
9
9
  spec.email = ["sheuer@aruxsoftware.com"]
10
10
  spec.summary = "Ruby gem for interacting with the Arux.app Switchboard APIs."
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ["lib"]
18
-
18
+
19
19
  spec.add_runtime_dependency "httpi", "~> 3.0"
20
20
  spec.add_runtime_dependency "json", ">= 0"
21
21
 
@@ -26,7 +26,7 @@ module AruxApp
26
26
  end
27
27
  end
28
28
 
29
- attr_accessor :client_id, :client_secret, :redirect_uri, :js_callback, :district_subdomain, :current_user_uuid, :login_mechanism, :element
29
+ attr_accessor :client_id, :client_secret, :redirect_uri, :js_callback, :district_subdomain, :current_user_uuid, :login_mechanism, :element, :api_key
30
30
 
31
31
  def initialize(options = {})
32
32
  self.client_id = options[:client_id]
@@ -37,6 +37,7 @@ module AruxApp
37
37
  self.element = options[:element]
38
38
  self.district_subdomain = options[:district_subdomain]
39
39
  self.current_user_uuid = options[:current_user_uuid]
40
+ self.api_key = options[:api_key]
40
41
 
41
42
  raise API::InitializerError.new(:client_id, "can't be blank") if self.client_id.to_s.empty?
42
43
  raise API::InitializerError.new(:client_secret, "can't be blank") if self.client_secret.to_s.empty?
@@ -98,7 +99,7 @@ module AruxApp
98
99
  end
99
100
 
100
101
  def registration_url
101
- %(#{public_uri}/users/registrations?client_id=#{self.client_id}&redirect_uri=#{self.redirect_uri}&district=#{self.district_subdomain})
102
+ %(#{public_uri}/users/sign_up?district=#{self.district_subdomain})
102
103
  end
103
104
 
104
105
  def access_token(code)
@@ -59,12 +59,29 @@ module AruxApp
59
59
  end
60
60
  end
61
61
 
62
+ def list(params = {})
63
+ request = HTTPI::Request.new
64
+ request.url = "#{api_uri}/v1/p/customers"
65
+ request.query = URI.encode_www_form(params)
66
+ request.headers = generate_headers
67
+ response = HTTPI.get(request)
68
+ if !response.error?
69
+ JSON.parse(response.body)
70
+ else
71
+ raise(API::Error.new(response.code, response.body))
72
+ end
73
+ end
74
+
62
75
  protected
63
76
 
64
77
  def generate_headers
65
- {'User-Agent' => USER_AGENT, 'Client-Secret' => self.auth.client_secret, 'Client-Id' => self.auth.client_id}
78
+ {
79
+ 'User-Agent' => USER_AGENT,
80
+ 'Client-Secret' => self.auth.client_secret,
81
+ 'Client-Id' => self.auth.client_id,
82
+ 'Key' => self.auth.api_key
83
+ }
66
84
  end
67
-
68
85
  end
69
86
  end
70
87
  end
data/lib/arux_app.rb CHANGED
@@ -18,6 +18,6 @@ require "arux_app/api/account"
18
18
  require "arux_app/api/cart"
19
19
 
20
20
  module AruxApp
21
- VERSION = "3.0.1"
21
+ VERSION = "3.0.3"
22
22
  USER_AGENT = "Arux.app GEM #{VERSION}"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arux_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arux Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-09 00:00:00.000000000 Z
11
+ date: 2025-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpi