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 +4 -4
- data/erp_integration.gemspec +1 -1
- data/lib/erp_integration/fulfil/resources/product.rb +38 -0
- data/lib/erp_integration/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9ec7d14403a7fa4972458b0a2b55b317ae1431c12ff9e9cc7c7a85b79a1591f
|
4
|
+
data.tar.gz: 11ac2f98ada47b54e13ddef91651af058c7179561b26310496c0f20129fdec26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 577f07c764ae85b9726a894048c86d28054aabcf173d9e4edc6dfca3adc878ef20b3985b2d1958bf274716bcb8bd612d2ea701615528fa77b6c2df6d186942a1
|
7
|
+
data.tar.gz: 5eaca359b7ef4c0ade19441f3b1ee562e36f42f30928ff8a96e97753d0b9c53cfef64b596c02d82fd0b663d0156832499283a10ea545fd7b370cf59922bb03d0
|
data/erp_integration.gemspec
CHANGED
@@ -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', '>=
|
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
|
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.
|
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-
|
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:
|
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:
|
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
|
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
|