erp_integration 0.37.0 → 0.38.0

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: 0cada8b9430a9d7f2918b907580b4ab1c8468fa1dbb607a64800289113342cf8
4
- data.tar.gz: 440657857bbd868e4b0ebbe4541bed1077d72f0f20a5091689b8c1c2da1fb083
3
+ metadata.gz: a9ec7d14403a7fa4972458b0a2b55b317ae1431c12ff9e9cc7c7a85b79a1591f
4
+ data.tar.gz: 11ac2f98ada47b54e13ddef91651af058c7179561b26310496c0f20129fdec26
5
5
  SHA512:
6
- metadata.gz: 705a7f8099838ee20b08adbf47e4527054e0ca937f11dfdd9b7391a91a83503f15944a07b85655967ef5873bd72e1d310aa464529bb83ffa9ed3b2899c16d175
7
- data.tar.gz: 76fe2e8e50e089ccf18e02485d28eaabaaafb2fcabfafeb7ba2c0f9fcc965b06726c9cff866fa1369a39cc2af0e59f4fadb3534224ac30ce5c72cd750b6f8a2b
6
+ metadata.gz: 577f07c764ae85b9726a894048c86d28054aabcf173d9e4edc6dfca3adc878ef20b3985b2d1958bf274716bcb8bd612d2ea701615528fa77b6c2df6d186942a1
7
+ data.tar.gz: 5eaca359b7ef4c0ade19441f3b1ee562e36f42f30928ff8a96e97753d0b9c53cfef64b596c02d82fd0b663d0156832499283a10ea545fd7b370cf59922bb03d0
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ['lib']
30
30
 
31
31
  # ActiveSupport is used for extended support of String inflections.
32
- spec.add_dependency 'activesupport', '>= 0.12'
32
+ spec.add_dependency 'activesupport', '>= 4.1.16'
33
33
 
34
34
  # Faraday is a HTTP/REST API client library to interact with third-party API vendors
35
35
  spec.add_dependency 'faraday', '>= 0.17.3', '< 1.9.0'
@@ -15,6 +15,44 @@ module ErpIntegration
15
15
  select(:boms).find_by!(code: sku).boms.any?
16
16
  end
17
17
  alias billing_of_materials? bom?
18
+
19
+ # https://developers.fulfil.io/rest_api/model/product.product/#add-product-images
20
+ # If you have your product images hosted not on Fulfil, you can use this endpoint to add the media in Fulfil
21
+ # to a product.
22
+ # The method expects a list of objects when making the request:
23
+ #
24
+ # url (string) image URL
25
+ # name (string) name of the image file, including image extension
26
+ #
27
+ # example:
28
+ #
29
+ # [
30
+ # [
31
+ # {
32
+ # "url": "https://dns.mysite.com/media/image1.jpg?format=jpg&name=small",
33
+ # "name": "product1_1.jpg"
34
+ # },
35
+ # {
36
+ # "url": "https://mysite.net/us/images/product_2.jpg",
37
+ # "name": "product1_2.jpg"
38
+ # }
39
+ # ]
40
+ # ]
41
+ #
42
+ # To simplify the API usage, we're sending the received image_objects wrapped in an array
43
+ #
44
+ # @param [Integer] id
45
+ # @param [Array<Object>] image_objects
46
+ def add_media(id, image_objects)
47
+ client.put("model/#{model_name}/#{id}/add_media", [image_objects])
48
+ true
49
+
50
+ # Workaround: Fulfil api does not return a json when status code is 200 (a.k.a. "Ok")
51
+ # and faraday is having an error when trying to parse it. Let's skip the parse error
52
+ # and move on.
53
+ rescue Faraday::ParsingError
54
+ true
55
+ end
18
56
  end
19
57
  end
20
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.37.0'
4
+ VERSION = '0.38.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-15 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.12'
19
+ version: 4.1.16
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.12'
26
+ version: 4.1.16
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -353,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
353
  - !ruby/object:Gem::Version
354
354
  version: '0'
355
355
  requirements: []
356
- rubygems_version: 3.3.7
356
+ rubygems_version: 3.2.3
357
357
  signing_key:
358
358
  specification_version: 4
359
359
  summary: Connects Mejuri with third-party ERP vendors