vend-ruby-v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97c417d40350db65f2b53fe048b31f76a897cc0e
4
+ data.tar.gz: 931b4f55ab969bdb5eb530d69c1b98358cfdffb1
5
+ SHA512:
6
+ metadata.gz: e5128bf97419dbe0978fe2d8844f1846ee5086fc99363ae56464d012c77859f680d110c44f073d4232f94183877988130203f7717600246cce2f42085a4b44f9
7
+ data.tar.gz: 9a048372b2d2fc76d3b78ad6775c4d88d97d97560b27d89c7d1a0acdd89c87c68fa8d1d7c594a5d999efddbdd3f9baa4458d130761d0dd5c365710c64053ff82
@@ -0,0 +1,74 @@
1
+ # Vend::Ruby::V2
2
+ ## Installation
3
+
4
+ Add this line to your application's Gemfile:
5
+
6
+ ```ruby
7
+ gem 'vend-ruby-v2'
8
+ ```
9
+
10
+ And then execute:
11
+
12
+ $ bundle
13
+
14
+ Or install it yourself as:
15
+
16
+ $ gem install vend-ruby-v2
17
+
18
+ ## Usage
19
+
20
+ For full examples of using the API client, please see the [examples folder](examples) and refer to Vend [developer documentation](https://docs.vendhq.com/v0.9/reference).
21
+
22
+ Example:
23
+
24
+ ```rb
25
+ # Configure the client to talk to a given store
26
+ Vend.configure do |config|
27
+ config.domain_prefix = ENV['VEND_DOMAIN_PREFIX']
28
+ config.access_token = ENV['VEND_ACCESS_TOKEN']
29
+ end
30
+
31
+ # Make an API request for a given resource
32
+ Vend::Customer.all
33
+ => {:data=>
34
+ [{:id=>"0afa8de1-1450-11e7-edec-9df1c629417c",
35
+ :customer_code=>"WALKIN",
36
+ ...
37
+ ```
38
+ ### Thread Safety
39
+
40
+ The `Vend.configure` method is NOT thread-safe. This mechanism is designed for applications or CLI's (command-line interfaces) where thread safety is not a concern. If you need to guarantee thread safety, we support this alternative mechanism to make thread-safe API requests:
41
+
42
+ Rather then setting up a single `connection` for all API requests, you would construct a new connection for each thread. If you can ensure that each of these connections is stored in a thread-safe manner, you can pass the `connection` as you query the resource.
43
+
44
+ ```rb
45
+ connection = Vend::Connection.build(
46
+ Vend::Config.new(
47
+ config.domain_prefix = ENV['VEND_DOMAIN_PREFIX'],
48
+ config.access_token = ENV['VEND_ACCESS_TOKEN']
49
+ )
50
+ )
51
+ => #<Faraday::Connection:0x007fbf95068978 ... >>
52
+
53
+ Vend::Customer.all
54
+ => {:data=>
55
+ [{:id=>"0afa8de1-1450-11e7-edec-9df1c629417c",
56
+ :customer_code=>"WALKIN",
57
+ ...
58
+ ```
59
+
60
+
61
+ ## Development
62
+
63
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
64
+
65
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
66
+
67
+ ## Contributing
68
+
69
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vend-ruby-v2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
70
+
71
+
72
+ ## License
73
+
74
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,29 @@
1
+ require 'pry'
2
+ require 'hashie'
3
+ require 'faraday_middleware'
4
+ require 'oj'
5
+ require 'vend/version'
6
+ require 'vend/config'
7
+ require 'vend/connection'
8
+ require 'vend/exception'
9
+ require 'vend/request'
10
+ require 'vend/resource_actions'
11
+ require 'vend/middleware/auth'
12
+ require 'vend/middleware/http_exception'
13
+ require 'vend/oauth2/auth_code'
14
+ require 'vend/resources/resource'
15
+
16
+ module Vend
17
+ resources = File.join(File.dirname(__FILE__), 'vend', 'resources', '**', '*.rb')
18
+ Dir.glob(resources, &method(:require))
19
+
20
+ class << self
21
+ attr_reader :api, :config
22
+
23
+ def configure
24
+ @config = Vend::Config.new.tap { |h| yield(h) }
25
+ @api = Vend::Connection.build(@config)
26
+ end
27
+ end
28
+ # Your code goes here...
29
+ end
@@ -0,0 +1,7 @@
1
+ module Vend
2
+ class Config < Hashie::Mash
3
+ def api_url
4
+ "https://#{domain_prefix}.vendhq.com/api"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ module Vend
2
+ module Connection
3
+ HEADERS = {
4
+ 'accept' => 'application/json'
5
+ }.freeze
6
+
7
+ def self.build(config)
8
+ Faraday.new(url: config.api_url) do |conn|
9
+ conn.options[:timeout] = 120
10
+ conn.request config[:request_type] || :json
11
+ conn.headers = HEADERS
12
+ conn.use Vend::Middleware::Auth, config
13
+ conn.use Vend::Middleware::HttpException
14
+ conn.adapter Faraday.default_adapter
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,58 @@
1
+ module Vend
2
+ class HttpError < StandardError
3
+ attr_accessor :response_headers
4
+ def initialize(headers)
5
+ @response_headers = headers
6
+ end
7
+ end
8
+
9
+ class BadRequest < HttpError; end
10
+ class Unauthorized < HttpError; end
11
+ class Forbidden < HttpError; end
12
+ class NotFound < HttpError; end
13
+ class MethodNotAllowed < HttpError; end
14
+ class NotAccepted < HttpError; end
15
+ class TimeOut < HttpError; end
16
+ class ResourceConflict < HttpError; end
17
+ class TooManyRequests < HttpError; end
18
+ class InternalServerError < HttpError; end
19
+ class BadGateway < HttpError; end
20
+ class ServiceUnavailable < HttpError; end
21
+ class GatewayTimeout < HttpError; end
22
+ class BandwidthLimitExceeded < HttpError; end
23
+
24
+ module HttpErrors
25
+ ERRORS = {
26
+ 400 => Vend::BadRequest,
27
+ 401 => Vend::Unauthorized,
28
+ 403 => Vend::Forbidden,
29
+ 404 => Vend::NotFound,
30
+ 405 => Vend::MethodNotAllowed,
31
+ 406 => Vend::NotAccepted,
32
+ 408 => Vend::TimeOut,
33
+ 409 => Vend::ResourceConflict,
34
+ 429 => Vend::TooManyRequests,
35
+ 500 => Vend::InternalServerError,
36
+ 502 => Vend::BadGateway,
37
+ 503 => Vend::ServiceUnavailable,
38
+ 504 => Vend::GatewayTimeout,
39
+ 509 => Vend::BandwidthLimitExceeded
40
+ }.freeze
41
+
42
+ def throw_http_exception!(code, env)
43
+ return unless ERRORS.keys.include? code
44
+ response_headers = {}
45
+ unless env.body.empty?
46
+ response_headers = begin
47
+ Oj.load(env.body, symbol_keys: true)
48
+ rescue
49
+ {}
50
+ end
51
+ end
52
+ unless env[:response_headers] && env[:response_headers]['X-Retry-After'].nil?
53
+ response_headers[:retry_after] = env[:response_headers]['X-Retry-After'].to_i
54
+ end
55
+ raise ERRORS[code].new(response_headers), env.body
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,15 @@
1
+ module Vend
2
+ module Middleware
3
+ class Auth < Faraday::Middleware
4
+ def initialize(app, options = {})
5
+ @app = app
6
+ @options = options
7
+ end
8
+
9
+ def call(env)
10
+ env[:request_headers]['Authorization'] = "Bearer #{@options[:access_token]}"
11
+ @app.call env
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ require 'vend/exception'
2
+
3
+ module Vend
4
+ module Middleware
5
+ class HttpException < Faraday::Response::Middleware
6
+ include Vend::HttpErrors
7
+
8
+ def on_complete(env)
9
+ throw_http_exception! env[:status].to_i, env
10
+ env
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,45 @@
1
+ require 'oauth2'
2
+
3
+ module Vend
4
+ module Oauth2
5
+ class AuthCode
6
+ DEFAULT_OPTIONS = {}
7
+ AUTHORIZE_URL = '/connect'
8
+ TOKEN_URL = '/api/1.0/token'
9
+
10
+ attr_accessor :store, :client_id, :secret, :redirect_uri
11
+
12
+ def initialize(store, client_id, secret, redirect_uri, options = {})
13
+ @store = store
14
+ @client_id = client_id
15
+ @secret = secret
16
+ @redirect_uri = redirect_uri
17
+ @options = DEFAULT_OPTIONS.merge(options)
18
+ end
19
+
20
+ def authorize_url
21
+ get_oauth2_client.auth_code.authorize_url(redirect_uri: redirect_uri)
22
+ end
23
+
24
+ def token_from_code(code)
25
+ client = get_oauth2_client(store)
26
+ client.auth_code.get_token(code, redirect_uri: redirect_uri)
27
+ end
28
+
29
+ def refresh_token(auth_token, refresh_token)
30
+ access_token = OAuth2::AccessToken.new(get_oauth2_client(store), auth_token, {refresh_token: refresh_token})
31
+ access_token.refresh!
32
+ end
33
+
34
+ protected
35
+
36
+ def get_oauth2_client(domain_prefix = 'secure')
37
+ OAuth2::Client.new(client_id, secret, {
38
+ site: "https://#{domain_prefix}.vendhq.com",
39
+ authorize_url: AUTHORIZE_URL,
40
+ token_url: TOKEN_URL
41
+ })
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,82 @@
1
+ require 'json'
2
+
3
+ module Vend
4
+ class PathBuilder
5
+ attr_reader :uri
6
+
7
+ def initialize(uri)
8
+ @uri = uri
9
+ end
10
+
11
+ def build(key = nil)
12
+ if key
13
+ "#{uri}/#{key}"
14
+ else
15
+ uri
16
+ end
17
+ end
18
+
19
+ def to_s
20
+ @uri
21
+ end
22
+ end
23
+
24
+ class Request < Module
25
+ def initialize(version, uri)
26
+ @uri = case version
27
+ when '0.9'
28
+ uri
29
+ when '1.0', '2.0'
30
+ "#{version}/#{uri}"
31
+ else
32
+ "2.0/#{uri}"
33
+ end
34
+ end
35
+
36
+ def included(base)
37
+ base.extend ClassMethods
38
+ path_builder = PathBuilder.new @uri
39
+ base.define_singleton_method :path do
40
+ path_builder
41
+ end
42
+ end
43
+
44
+ module ClassMethods
45
+ def get(path, params = {})
46
+ response = raw_request(:get, path, params)
47
+ build_response_object response
48
+ end
49
+
50
+ def delete(path, params = {})
51
+ response = raw_request(:delete, path, params)
52
+ build_response_object(response)
53
+ end
54
+
55
+ def post(path, params = {})
56
+ response = raw_request(:post, path, params)
57
+ build_response_object response
58
+ end
59
+
60
+ def put(path, params = {})
61
+ response = raw_request(:put, path, params)
62
+ build_response_object response
63
+ end
64
+
65
+ def raw_request(method, path, params = {})
66
+ client = params.delete(:connection) || Vend.api
67
+ client.send(method, path.to_s, params)
68
+ end
69
+
70
+ private
71
+
72
+ def build_response_object(response)
73
+ parse response.body
74
+ end
75
+
76
+ def parse(json)
77
+ return [] if json.empty?
78
+ Oj.load(json, symbol_keys: true)
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,47 @@
1
+ module Vend
2
+ class ResourceActions < Module
3
+ attr_reader :options
4
+
5
+ def initialize(options = {})
6
+ @options = options
7
+ tap do |mod|
8
+ mod.define_singleton_method :_options do
9
+ mod.options
10
+ end
11
+ end
12
+ end
13
+
14
+ def included(base)
15
+ base.send(:include, Request.new(options[:api_version], options[:uri]))
16
+ base.extend(ClassMethods)
17
+ options[:disable_methods] ||= []
18
+ methods = ClassMethods.public_instance_methods & options[:disable_methods]
19
+ methods.each { |name| base.send(:remove_method, name) }
20
+ end
21
+
22
+ module ClassMethods
23
+ def all(params = {})
24
+ get path.build, params
25
+ end
26
+
27
+ def find(resource_id, params = {})
28
+ raise ArgumentError if resource_id.nil?
29
+ get path.build(resource_id), params
30
+ end
31
+
32
+ def create(params = {})
33
+ post path.build, params
34
+ end
35
+
36
+ def update(resource_id, params = {})
37
+ raise ArgumentError if resource_id.nil?
38
+ put path.build(resource_id), params
39
+ end
40
+
41
+ def destroy(resource_id, params = {})
42
+ raise ArgumentError if resource_id.nil?
43
+ delete path.build(resource_id), params
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,8 @@
1
+ # Brands
2
+ # https://docs.vendhq.com/reference#brands
3
+
4
+ module Vend
5
+ class Brand < Resource
6
+ include Vend::ResourceActions.new uri: 'brands'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Consignments
2
+ # https://docs.vendhq.com/reference#consignments-2
3
+
4
+ module Vend
5
+ class Consignment < Resource
6
+ include Vend::ResourceActions.new uri: 'consignments'
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ # Customers
2
+ # https://docs.vendhq.com/reference#customers-2
3
+
4
+ module Vend
5
+ class Customer < Resource
6
+ include Vend::ResourceActions.new uri: 'customers'
7
+
8
+ def self.all_v0_9(params = {})
9
+ get 'customers', params
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ # Customer Groups
2
+ # https://docs.vendhq.com/reference#customer-groups
3
+
4
+ module Vend
5
+ class CustomerGroup < Resource
6
+ include Vend::ResourceActions.new uri: 'customer_groups'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Inventory
2
+ # https://docs.vendhq.com/reference#inventory
3
+
4
+ module Vend
5
+ class Inventory < Resource
6
+ include Vend::ResourceActions.new uri: 'inventory'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Outlets
2
+ # https://docs.vendhq.com/reference#outlets
3
+
4
+ module Vend
5
+ class Outlet < Resource
6
+ include Vend::ResourceActions.new uri: 'outlets'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Outlet Product Taxes
2
+ # https://docs.vendhq.com/reference#outlet-product-taxes
3
+
4
+ module Vend
5
+ class OutletProductTax < Resource
6
+ include Vend::ResourceActions.new uri: 'outlet_taxes'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # PaymentTypes
2
+ # https://docs.vendhq.com/reference#payment-types
3
+
4
+ module Vend
5
+ class PaymentType < Resource
6
+ include Vend::ResourceActions.new uri: 'payment_types'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # PriceBooks
2
+ # https://docs.vendhq.com/reference#price-books
3
+
4
+ module Vend
5
+ class PriceBook < Resource
6
+ include Vend::ResourceActions.new uri: 'price_books'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # PriceBookProducts
2
+ # https://docs.vendhq.com/reference#price-book-products
3
+
4
+ module Vend
5
+ class PriceBookProduct < Resource
6
+ include Vend::ResourceActions.new uri: 'price_book_products'
7
+ end
8
+ end
@@ -0,0 +1,33 @@
1
+ # Products
2
+ # https://docs.vendhq.com/reference#products-2
3
+
4
+ module Vend
5
+ class Product < Resource
6
+ include Vend::ResourceActions.new uri: 'products'
7
+
8
+ def self.find_v0_9(resource_id, params = {})
9
+ get "products/#{resource_id}", params
10
+ end
11
+
12
+ def self.update(params = {})
13
+ post 'products', params
14
+ end
15
+
16
+ def self.inventory(resource_id, params = {})
17
+ get "2.0/products/#{resource_id}/inventory", params
18
+ end
19
+
20
+ def self.update_inventory(params = {})
21
+ post 'products', params
22
+ end
23
+
24
+ def self.image_upload(resource_id, params)
25
+ connection = params[:connection] || Vend.api
26
+ response = connection.post do |req|
27
+ req.url "2.0/products/#{resource_id}/actions/image_upload"
28
+ req.body = { image: params[:image] }
29
+ end
30
+ Oj.load(response.body, symbol_keys: true)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,8 @@
1
+ # Product Images
2
+ # https://docs.vendhq.com/reference#product-images
3
+
4
+ module Vend
5
+ class ProductImage < Resource
6
+ include Vend::ResourceActions.new uri: 'product_images'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # ProductTypes
2
+ # https://docs.vendhq.com/reference#product_types
3
+
4
+ module Vend
5
+ class ProductType < Resource
6
+ include Vend::ResourceActions.new uri: 'product_types'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Registers
2
+ # https://docs.vendhq.com/reference#registers
3
+
4
+ module Vend
5
+ class Register < Resource
6
+ include Vend::ResourceActions.new uri: 'registers'
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ require 'vend/request'
2
+ require 'vend/resource_actions'
3
+
4
+ module Vend
5
+ class Resource < Hashie::Trash
6
+ include Hashie::Extensions::MethodAccess
7
+ include Hashie::Extensions::IgnoreUndeclared
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ # Sale
2
+ # https://docs.vendhq.com/reference#sales
3
+
4
+ module Vend
5
+ class Sale < Resource
6
+ include Vend::ResourceActions.new uri: 'sales'
7
+
8
+ def self.create(params = {})
9
+ post 'register_sales', params
10
+ end
11
+
12
+ def self.return(resource_id, params = {})
13
+ put "/api/2.0/sales/#{resource_id}/actions/return", params
14
+ end
15
+
16
+ def self.register_sale(resource_id, params = {})
17
+ get "/api/register_sales/#{resource_id}", params
18
+ end
19
+
20
+ def self.finalize_return(params = {})
21
+ post '/api/register_sales', params
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,8 @@
1
+ # Search
2
+ # https://docs.vendhq.com/reference#search
3
+
4
+ module Vend
5
+ class Search < Resource
6
+ include Vend::ResourceActions.new uri: 'search'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Suppliers
2
+ # https://docs.vendhq.com/reference#suppliers-2
3
+
4
+ module Vend
5
+ class Supplier < Resource
6
+ include Vend::ResourceActions.new uri: 'suppliers'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Tags
2
+ # https://docs.vendhq.com/reference#tags
3
+
4
+ module Vend
5
+ class Tag < Resource
6
+ include Vend::ResourceActions.new uri: 'tags'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Taxes
2
+ # https://docs.vendhq.com/reference#taxes
3
+
4
+ module Vend
5
+ class Tax < Resource
6
+ include Vend::ResourceActions.new uri: 'taxes'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # Users
2
+ # https://docs.vendhq.com/reference#users-2
3
+
4
+ module Vend
5
+ class User < Resource
6
+ include Vend::ResourceActions.new uri: 'users'
7
+ end
8
+ end
@@ -0,0 +1,26 @@
1
+ # Webhooks
2
+ # https://docs.vendhq.com/reference#webhooks-1
3
+
4
+ module Vend
5
+ class Webhook < Resource
6
+ include Vend::ResourceActions.new api_version: '0.9', uri: 'webhooks'
7
+
8
+ def self.create(params = {})
9
+ make_urlencoded_request(:post, '/api/webhooks', params)
10
+ end
11
+
12
+ def self.update(resource_id, params = {})
13
+ make_urlencoded_request(:put, "/api/webhooks/#{resource_id}", params)
14
+ end
15
+
16
+ def self.make_urlencoded_request(method, url, params)
17
+ connection = params[:connection] || Vend.api
18
+ response = connection.send(method) do |req|
19
+ req.url url
20
+ req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
21
+ req.body = "data=#{params[:data].to_json}"
22
+ end
23
+ Oj.load(response.body, symbol_keys: true)
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Vend
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vend/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'vend-ruby-v2'
8
+ spec.version = Vend::VERSION
9
+ spec.platform = Gem::Platform::RUBY
10
+ spec.required_ruby_version = '>= 2.0.0'
11
+ spec.license = 'MIT'
12
+
13
+ spec.authors = ['Yurkiv Misha']
14
+ spec.email = ['m.yurkiv@coaxsoft.com']
15
+ spec.summary = 'Ruby client library for the VendHQ API'
16
+ spec.description = spec.summary
17
+ spec.homepage = 'https://github.com/coaxsoft/vend-ruby-v2'
18
+
19
+ spec.require_paths = ['lib']
20
+ spec.files = Dir['README.md', 'lib/**/*', 'vend.gemspec']
21
+
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'rake'
24
+
25
+ spec.add_development_dependency 'rspec'
26
+ spec.add_development_dependency 'rspec-nc'
27
+ spec.add_development_dependency 'webmock'
28
+
29
+ spec.add_dependency 'faraday', '~> 0.13.1'
30
+ spec.add_dependency 'faraday_middleware', '~> 0.10.0'
31
+ spec.add_dependency 'hashie', '~> 3.4'
32
+ spec.add_dependency 'jwt', '~> 1.5.4'
33
+ spec.add_dependency 'oauth2'
34
+ spec.add_dependency 'oj'
35
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vend-ruby-v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yurkiv Misha
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-nc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: faraday
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.13.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.13.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: faraday_middleware
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.10.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.10.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: hashie
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.4'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: jwt
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 1.5.4
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.5.4
139
+ - !ruby/object:Gem::Dependency
140
+ name: oauth2
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: oj
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: Ruby client library for the VendHQ API
168
+ email:
169
+ - m.yurkiv@coaxsoft.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - README.md
175
+ - lib/vend.rb
176
+ - lib/vend/config.rb
177
+ - lib/vend/connection.rb
178
+ - lib/vend/exception.rb
179
+ - lib/vend/middleware/auth.rb
180
+ - lib/vend/middleware/http_exception.rb
181
+ - lib/vend/oauth2/auth_code.rb
182
+ - lib/vend/request.rb
183
+ - lib/vend/resource_actions.rb
184
+ - lib/vend/resources/brand.rb
185
+ - lib/vend/resources/consignment.rb
186
+ - lib/vend/resources/customer.rb
187
+ - lib/vend/resources/customer_group.rb
188
+ - lib/vend/resources/inventory.rb
189
+ - lib/vend/resources/outlet.rb
190
+ - lib/vend/resources/outlet_product_tax.rb
191
+ - lib/vend/resources/payment_type.rb
192
+ - lib/vend/resources/price_book.rb
193
+ - lib/vend/resources/price_book_product.rb
194
+ - lib/vend/resources/product.rb
195
+ - lib/vend/resources/product_image.rb
196
+ - lib/vend/resources/product_type.rb
197
+ - lib/vend/resources/register.rb
198
+ - lib/vend/resources/resource.rb
199
+ - lib/vend/resources/sale.rb
200
+ - lib/vend/resources/search.rb
201
+ - lib/vend/resources/supplier.rb
202
+ - lib/vend/resources/tag.rb
203
+ - lib/vend/resources/tax.rb
204
+ - lib/vend/resources/user.rb
205
+ - lib/vend/resources/webhook.rb
206
+ - lib/vend/version.rb
207
+ - vend.gemspec
208
+ homepage: https://github.com/coaxsoft/vend-ruby-v2
209
+ licenses:
210
+ - MIT
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: 2.0.0
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.6.13
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: Ruby client library for the VendHQ API
232
+ test_files: []