shop_express 0.0.3 → 0.0.5

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: a24bf888aa7e7ea55322e9189f02075eba5945a9d4847f8ea9c3053360fe859c
4
- data.tar.gz: f189aeaf18889e4f8f95dc154395ad40487dfa998b088abda8e7cc6d100ee089
3
+ metadata.gz: 5c78960cef1f78e6fe867bd7c921fe76c428785b83bd36c411f3e90f176e64d2
4
+ data.tar.gz: 2b033578c36bf61870ada068175faf4405da75c9a34182e8bfe62741b5cdaa7b
5
5
  SHA512:
6
- metadata.gz: 68d0951f9a5b7addcf9d7e1682249d4a3f14590feba2ae49d6ceac35048340a0e1d524d8bda54038fefa2c6c9adb7eb348b0badfa21e3e8bdd8232282036885b
7
- data.tar.gz: dee40155b18c34da953dbc1db167d0314ac6932440f5dd80fc361e5d4a98a12ea7431ec175b02c7c25b70c7d8083d2f8c0945c0aa1d64076b0dd9caa4f547f79
6
+ metadata.gz: 0fe33d738c433acba88f598c9f623fda141f483493ba1bb74af965f81cc0ca6c1cf7dea111085b475bedb583a8d7bfd0816129240a81ca3097f990ff28270da9
7
+ data.tar.gz: b464e86989fd6f4e03e9e5a844fb2fb47c11c7f1d24b7ca8be771263420102877bfcddb70b5b30517aa75a59fa029a0f0cd1ef63860ec3c774e91537c2772603
@@ -3,12 +3,12 @@
3
3
  module ShopExpress
4
4
  # get list of the products from the shop_express
5
5
  class CatalogExport < ::ShopExpress::Base
6
- URL = 'api/catalog/export'
6
+ URL = '/api/catalog/export'
7
7
 
8
8
  # @param limit [Integer]
9
9
  # @param offset [Integer]
10
10
  # @param display_in_show_case [String] possible values (false, true)
11
- def call(limit: 5000, offset: 0, display_in_show_case: 'false')
11
+ def call(limit: 500, offset: 0, display_in_show_case: 'false')
12
12
  request_body = {
13
13
  limit: limit,
14
14
  offset: offset,
@@ -9,7 +9,8 @@ module ShopExpress
9
9
  def post(shop_express:, url:, body:, add_token: false)
10
10
  mixin_token!(shop_express, body) if add_token
11
11
  connection(shop_express).post(url, body).body
12
- rescue Faraday::Error
12
+ rescue Faraday::Error => e
13
+ Rails.logger.error(e) if defined?(Rails)
13
14
  ERROR
14
15
  end
15
16
 
@@ -3,7 +3,7 @@
3
3
  module ShopExpress
4
4
  # import_residues to the shop_express
5
5
  class ImportResiduences < ::ShopExpress::Base
6
- URL = 'api/catalog/importResidues/'
6
+ URL = '/api/catalog/importResidues/'
7
7
 
8
8
  # @param body [Hash]
9
9
  def call(body)
data/lib/shop_express.rb CHANGED
@@ -4,6 +4,7 @@ require_relative 'shop_express/base'
4
4
  require_relative 'shop_express/connection'
5
5
  require_relative 'shop_express/authorization'
6
6
  require_relative 'shop_express/import_residues'
7
+ require_relative 'shop_express/catalog_export'
7
8
 
8
9
  module ShopExpress
9
10
  # Base class used to store data about authentication
@@ -24,7 +25,7 @@ module ShopExpress
24
25
  def token_valid?
25
26
  return false if token.nil?
26
27
 
27
- expiration_timestamp < Time.now
28
+ expiration_timestamp > Time.now
28
29
  end
29
30
 
30
31
  def refresh_token!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shop_express
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denys Krupenov