bling_api 2.0.0 → 2.0.2
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/Gemfile.lock +1 -1
- data/lib/bling_api/client.rb +10 -10
- data/lib/bling_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d28e4f18f7d5288e30edf3b4a93b85eb015ad69a445fb585be9f231d57e0021
|
4
|
+
data.tar.gz: 41e6a1632c82eda95a0821bab1092eac48a009b4566fa8a1e8ba93db33e2946a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4ae9972ed3cb15268aa26d1d8f6d4469e361be2642f0195cf1f5cfd52ce66481990811ebe0b6b3f0ad5ab7cf8bb99d6991a3b42cd7e863a259478bf7cb23452
|
7
|
+
data.tar.gz: 9da868ee20553e1e017dabc5bc11f836cfdf08ba866c2c9138bab2563880d6a6cc4a48675620e3aaea2cc4b59f39277fff549a2f6a268a105e3d015cefea7dc6
|
data/Gemfile.lock
CHANGED
data/lib/bling_api/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module BlingApi
|
2
2
|
class Client < Ac::Base
|
3
|
-
BASE_URL = "https://
|
3
|
+
BASE_URL = "https://api.bling.com.br/Api/v3"
|
4
4
|
SAVE_RESPONSES = true
|
5
5
|
|
6
6
|
def initialize(client_id:, client_secret:, refresh_token: nil, access_token: nil, token_expires_at: nil)
|
@@ -127,31 +127,31 @@ module BlingApi
|
|
127
127
|
}
|
128
128
|
}
|
129
129
|
}
|
130
|
-
put("/contatos/#{id}", body: body)
|
130
|
+
put("/contatos/#{id}", body: body, timeout: 20)
|
131
131
|
end
|
132
132
|
|
133
133
|
def get_order(id)
|
134
|
-
get("/pedidos/vendas/#{id}") { _1.data }
|
134
|
+
get("/pedidos/vendas/#{id}", timeout: 20) { _1.data }
|
135
135
|
end
|
136
136
|
|
137
137
|
def get_contact(id)
|
138
|
-
get("/contatos/#{id}") { _1.data }
|
138
|
+
get("/contatos/#{id}", timeout: 20) { _1.data }
|
139
139
|
end
|
140
140
|
|
141
141
|
def get_seller(id)
|
142
|
-
get("/vendedores/#{id}") { _1.data }
|
142
|
+
get("/vendedores/#{id}", timeout: 20) { _1.data }
|
143
143
|
end
|
144
144
|
|
145
145
|
def get_sellers(page, limit, situation)
|
146
|
-
get("/vendedores?pagina=#{page}&limite=#{limit}&situacaoContato=#{situation}") { _1.data }
|
146
|
+
get("/vendedores?pagina=#{page}&limite=#{limit}&situacaoContato=#{situation}", timeout: 20) { _1.data }
|
147
147
|
end
|
148
148
|
|
149
149
|
def find_contact_by_document_number(document_number)
|
150
|
-
get("/contatos?numeroDocumento=#{document_number.gsub(/\D/, "")}") { _1.data }
|
150
|
+
get("/contatos?numeroDocumento=#{document_number.gsub(/\D/, "")}", timeout: 20) { _1.data }
|
151
151
|
end
|
152
152
|
|
153
153
|
def find_product_by_sku(sku)
|
154
|
-
get("/produtos?codigo=#{sku}") { _1.data }
|
154
|
+
get("/produtos?codigo=#{sku}", timeout: 20) { _1.data }
|
155
155
|
end
|
156
156
|
|
157
157
|
def create_contact(
|
@@ -239,7 +239,7 @@ module BlingApi
|
|
239
239
|
}
|
240
240
|
}
|
241
241
|
}
|
242
|
-
post("/contatos", body: body) { _1.data }
|
242
|
+
post("/contatos", body: body, timeout: 20) { _1.data }
|
243
243
|
end
|
244
244
|
|
245
245
|
# @param itens [Array<BlingApi::Item>] Array de objetos Item contendo codigo, id_produto, quantidade, valor, unidade, desconto, aliquota_ipi, descricao, descricao_detalhada, comissao_base, comissao_aliquota, comissao_valor
|
@@ -294,7 +294,7 @@ module BlingApi
|
|
294
294
|
observacoesInternas: observacoes_internas,
|
295
295
|
numeroPedidoCompra: numero_pedido_compra
|
296
296
|
}
|
297
|
-
post("/pedidos/vendas", body: body) { _1.data }
|
297
|
+
post("/pedidos/vendas", body: body, timeout: 20) { _1.data }
|
298
298
|
end
|
299
299
|
end
|
300
300
|
end
|
data/lib/bling_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bling_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
|
-
rubygems_version: 3.6.
|
83
|
+
rubygems_version: 3.6.7
|
84
84
|
specification_version: 4
|
85
85
|
summary: ''
|
86
86
|
test_files: []
|