creditario-client 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46b308c258087cfbc03b9981c99bf430be8a508a8d3e5ba00e7f0de961e6cad5
4
- data.tar.gz: '09d7a1455008f4180c81e8d39e263e97b9299d224c97211cbc55b3b953a1b7d7'
3
+ metadata.gz: b450f825957ef5b550f453f2ab1cdcfd8abf1813cf5ad7c063d5922011498168
4
+ data.tar.gz: 5513a8630e36dc9b0499b14ddd286999eaec7dcfd551d86a7aa438d41c837418
5
5
  SHA512:
6
- metadata.gz: 502a00118b2ac43a3f3697ba301725d13dfce2be76f7f894af8dee696e11cc35a796723f464b70fd4dca0a54bcf814c975e5fd85f3b27138323b2c77e0fdc166
7
- data.tar.gz: 76df6ff28807820bc92fb26b0ec48f800a0ce01ca1c7a04522200b76edf42a0d4676d7330b386d7dd02776b4ac63d8bdcf189a0f5785ab378527efe91f313795
6
+ metadata.gz: d178b5ba0750bace58ac00928c020135e85fc832880e981e2a05f6e5e5b2009cae74c6144eda615024f2878de1cd7bff7c70cfb1ee2f04dbea0e09615035dd1d
7
+ data.tar.gz: e094ded2b9b11c5fc7bc079df4f851d4d8c10a1f1daef481391254b3c487eb673da2cc13dcd9ff4d733e5c2ec0c917322cd9580f8064c84d1362cedb8d6eabb9
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ VERSION 1.1.2
2
+
3
+ Release notes:
4
+
5
+ - HOTFIX: Inverstors repository on update action can't upload documents using multipart/form-data.
6
+
1
7
  VERSION 1.1.0
2
8
 
3
9
  Release notes:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- creditario-client (1.1.0)
4
+ creditario-client (1.1.2)
5
5
  multipart-post (= 2.0.0)
6
6
  oj (~> 3.0.0)
7
7
 
@@ -22,7 +22,7 @@ module Creditario # :nodoc:
22
22
  #
23
23
  def create(params = {})
24
24
  enctype = params.delete(:enctype) || false
25
- request_method = enctype ? :multipart : :post
25
+ request_method = enctype ? :multipart_post : :post
26
26
  response = API.request(request_method, self.resource_path, params)
27
27
 
28
28
  attributes = response.dig("data").first
@@ -15,7 +15,7 @@ module Creditario # :nodoc:
15
15
  # Repositorio maneja.
16
16
  # De lo contrario, regresa un Hash con los errores arrojados por el servidor de creditar.io
17
17
  def create(params = {})
18
- response = API.request(:multipart, self.resource_path, params)
18
+ response = API.request(:multipart_post, self.resource_path, params)
19
19
 
20
20
  attributes = response.dig("data").first
21
21
  links = response.dig("links")
@@ -32,6 +32,9 @@ module Creditario # :nodoc:
32
32
  uri = URI(Creditario::Client.api_base + path)
33
33
  request = request_from_method(method, uri, params)
34
34
 
35
+ request["User-Agent"] = "creditario-client gem v#{Creditario::Client::VERSION}"
36
+ request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
37
+
35
38
  response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
36
39
  http.request(request)
37
40
  end
@@ -63,8 +66,10 @@ module Creditario # :nodoc:
63
66
  request
64
67
  when :post
65
68
  set_request_body(set_request_headers(Net::HTTP::Post.new(uri)), params)
66
- when :multipart
69
+ when :multipart_post
67
70
  set_authorization_headers(Net::HTTP::Post::Multipart.new(uri, params))
71
+ when :multipart_patch
72
+ set_authorization_headers(Net::HTTP::Put::Multipart.new(uri, params))
68
73
  when :delete
69
74
  set_request_headers(Net::HTTP::Delete.new(uri))
70
75
  when :patch
@@ -75,8 +80,6 @@ module Creditario # :nodoc:
75
80
  def set_request_headers(request)
76
81
  request = set_authorization_headers(request)
77
82
 
78
- request["User-Agent"] = "creditario-client gem v#{Creditario::Client::VERSION}"
79
- request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
80
83
  request["Content-Type"] = "application/json"
81
84
 
82
85
  request
@@ -23,7 +23,7 @@ module Creditario # :nodoc:
23
23
  enctype = params.delete(:enctype) || false
24
24
  path = "#{self.resource_path}/#{id}"
25
25
  path = include_param.nil? ? path : path + "?include=#{include_param}"
26
- request_method = enctype ? :multipart : :patch
26
+ request_method = enctype ? :multipart_patch : :patch
27
27
  response = API.request(request_method, path, params)
28
28
 
29
29
  attributes = response.dig("data").first
@@ -4,6 +4,6 @@ module Creditario
4
4
  module Client
5
5
  ###
6
6
  # Versión actual de la gema *creditario-client*
7
- VERSION = "1.1.0"
7
+ VERSION = "1.1.2"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creditario-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - michelada.io
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj