enotas_api 4.0.0 → 4.1.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/.github/workflows/check.yml +4 -5
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +3 -3
- data/README.md +6 -6
- data/Rakefile +1 -1
- data/enotas_api.gemspec +1 -1
- data/lib/enotas_api/v2/consultar_empresa.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa.rb +23 -0
- data/lib/enotas_api/v2/entities/empresa_configuracoes.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa_endereco.rb +17 -0
- data/lib/enotas_api/v2/incluir_atualizar_empresa.rb +13 -0
- data/lib/enotas_api/v2/listar_empresas.rb +17 -0
- data/lib/enotas_api/v2/vincular_certificado.rb +14 -0
- data/lib/enotas_api/v2/vincular_logotipo.rb +14 -0
- data/lib/enotas_api/version.rb +1 -1
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fec825b3ff2084de51ddee2c0667a5e195ee6cc9fdb9ebf699d8a558dd7af957
|
4
|
+
data.tar.gz: 8a4b14268bb1b3dd5be1ab1092c33f1002ff3b4cfc447514829a07869905e1fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a2ed5edd202eaa63479591af50773d1dcf7da8f1905f7504fe1559e5b6be35d3187ee3cdfe7275fe3247a1eac4f65a25972b43e9adec1aaca98e47f563a046
|
7
|
+
data.tar.gz: e3744c1133c4b529210e6be7d1ae222faca58659c68b83578238dbf2395b70601de360c672af0dd73b638d23ac44f8adfa5fce21ed294100dd5f1afcf22e3980
|
data/.github/workflows/check.yml
CHANGED
@@ -19,12 +19,11 @@ jobs:
|
|
19
19
|
|
20
20
|
steps:
|
21
21
|
- uses: actions/checkout@v3
|
22
|
-
- name: Set up Ruby
|
23
|
-
|
24
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
25
|
-
uses: ruby/setup-ruby@v1.110.0
|
22
|
+
- name: Set up Ruby 3.2
|
23
|
+
uses: ruby/setup-ruby@v1
|
26
24
|
with:
|
27
|
-
ruby-version: 2.
|
25
|
+
ruby-version: 3.2.2
|
26
|
+
bundler-cache: true
|
28
27
|
- name: Install dependencies
|
29
28
|
run: bundle install
|
30
29
|
- name: Run tests
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enotas_api (4.
|
4
|
+
enotas_api (4.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
parser (>= 3.2.1.0)
|
50
50
|
rubocop-capybara (2.18.0)
|
51
51
|
rubocop (~> 1.41)
|
52
|
-
rubocop-factory_bot (2.23.
|
52
|
+
rubocop-factory_bot (2.23.1)
|
53
53
|
rubocop (~> 1.33)
|
54
54
|
rubocop-rspec (2.22.0)
|
55
55
|
rubocop (~> 1.33)
|
@@ -74,4 +74,4 @@ DEPENDENCIES
|
|
74
74
|
webmock (~> 3.18, >= 3.18.1)
|
75
75
|
|
76
76
|
BUNDLED WITH
|
77
|
-
2.
|
77
|
+
2.4.10
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ PS: Because e-notas api is entire in portuguese, the code and documentation from
|
|
16
16
|
|
17
17
|
## Dependencias
|
18
18
|
EnotasApi não depende de nenhuma Gem externa para executar, (aloha dependency hell).
|
19
|
-
Porém implementamos
|
19
|
+
Porém implementamos com a versão de ruby `>= ruby 3.1` que é compatível com a versão que temos em produção, `~> ruby 3.2.2`.
|
20
20
|
Se tiver interesse em fazer backport para versões anteriores, não deixe de fazer seu comentário ou abrir um PR.
|
21
21
|
|
22
22
|
## Instalação
|
@@ -103,11 +103,11 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
|
|
103
103
|
- [x] Cidades com Serviço Municipal Unificado - `EnotasApi::V1::ConsultarCidadesServicoMunicipalUnificado`
|
104
104
|
- [NF-e & NFC-e (v2)](https://docs.enotasgw.com.br/v2/reference)
|
105
105
|
- Empresa
|
106
|
-
- [
|
107
|
-
- [
|
108
|
-
- [
|
109
|
-
- [
|
110
|
-
- [
|
106
|
+
- [x] Incluir/Alterar Empresa
|
107
|
+
- [x] Vincular Certificado
|
108
|
+
- [x] Vincular Logotipo
|
109
|
+
- [x] Consultar Empresa
|
110
|
+
- [x] Listar Empresas
|
111
111
|
- Nota Fiscal eletrônica de consumidor (NFC-e)
|
112
112
|
- [ ] Emitir Nota Fiscal
|
113
113
|
- [ ] Consultar Nota Fiscal
|
data/Rakefile
CHANGED
data/enotas_api.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = 'Non oficial, well supported, e-notas ruby api client'
|
13
13
|
spec.homepage = 'https://github.com/bempapp/enotas_api'
|
14
14
|
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 3.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1')
|
16
16
|
|
17
17
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
18
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'empresa_endereco'
|
5
|
+
require_relative 'empresa_emissao_nfe_produto'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class Empresa < EnotasApi::Entity
|
10
|
+
attributes id: :string,
|
11
|
+
cnpj: :string,
|
12
|
+
inscricaoMunicipal: :string,
|
13
|
+
inscricaoEstadual: :string,
|
14
|
+
razaoSocial: :string,
|
15
|
+
nomeFantasia: :string,
|
16
|
+
optanteSimplesNacional: :boolean,
|
17
|
+
email: :string,
|
18
|
+
telefoneComercial: :string,
|
19
|
+
endereco: EmpresaEndereco,
|
20
|
+
emissaoNFeProduto: EmpresaEmissaoNfeProduto
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class EmpresaConfiguracoes < EnotasApi::Entity
|
8
|
+
attributes sequencialNFe: :integer,
|
9
|
+
serieNFe: :string,
|
10
|
+
sequencialLoteNFe: :integer
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'empresa_configuracoes'
|
5
|
+
|
6
|
+
module EnotasApi
|
7
|
+
module V2
|
8
|
+
class EmpresaEmissaoNfeProduto < EnotasApi::Entity
|
9
|
+
attributes ambienteProducao: EmpresaConfiguracoes,
|
10
|
+
ambienteHomologacao: EmpresaConfiguracoes
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class EmpresaEndereco < EnotasApi::Entity
|
8
|
+
attributes uf: :string,
|
9
|
+
cidade: :string,
|
10
|
+
logradouro: :string,
|
11
|
+
numero: :string,
|
12
|
+
complemento: :string,
|
13
|
+
bairro: :string,
|
14
|
+
cep: :string
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class IncluirAtualizarEmpresa < EnotasApi::Request
|
8
|
+
def initialize(empresa)
|
9
|
+
super(method: :POST, uri: '/v2/empresas', content: empresa.to_json)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class ListarEmpresas < EnotasApi::Request
|
8
|
+
paginable
|
9
|
+
searchable %i[nome_fantasia razao_social]
|
10
|
+
sortable %i[nome_fantasia razao_social cidade data_criacao data_ultima_modificacao]
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
super(uri: '/v2/empresas')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class VincularCertificado < EnotasApi::Request
|
8
|
+
def initialize(empresa_id, nome_arquivo, arquivo, senha)
|
9
|
+
form_data = { 'FileName' => nome_arquivo, 'arquivo' => arquivo, 'senha' => senha }
|
10
|
+
super(method: :POST_FORM, uri: "/v2/empresas/#{url_encode(empresa_id)}/certificadoDigital", content: form_data)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class VincularLogotipo < EnotasApi::Request
|
8
|
+
def initialize(empresa_id, nome_arquivo, arquivo)
|
9
|
+
form_data = { 'FileName' => nome_arquivo, 'logotipo' => arquivo }
|
10
|
+
super(method: :POST_FORM, uri: "/v2/empresas/#{url_encode(empresa_id)}/logo", content: form_data)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/enotas_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enotas_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Bohrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Non oficial, well supported, e-notas ruby api client
|
14
14
|
email:
|
@@ -75,6 +75,15 @@ files:
|
|
75
75
|
- lib/enotas_api/v1/listar_notas_fiscais.rb
|
76
76
|
- lib/enotas_api/v1/vincular_certificado.rb
|
77
77
|
- lib/enotas_api/v1/vincular_logotipo.rb
|
78
|
+
- lib/enotas_api/v2/consultar_empresa.rb
|
79
|
+
- lib/enotas_api/v2/entities/empresa.rb
|
80
|
+
- lib/enotas_api/v2/entities/empresa_configuracoes.rb
|
81
|
+
- lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb
|
82
|
+
- lib/enotas_api/v2/entities/empresa_endereco.rb
|
83
|
+
- lib/enotas_api/v2/incluir_atualizar_empresa.rb
|
84
|
+
- lib/enotas_api/v2/listar_empresas.rb
|
85
|
+
- lib/enotas_api/v2/vincular_certificado.rb
|
86
|
+
- lib/enotas_api/v2/vincular_logotipo.rb
|
78
87
|
- lib/enotas_api/version.rb
|
79
88
|
homepage: https://github.com/bempapp/enotas_api
|
80
89
|
licenses:
|
@@ -93,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
102
|
requirements:
|
94
103
|
- - ">="
|
95
104
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
105
|
+
version: '3.1'
|
97
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
107
|
requirements:
|
99
108
|
- - ">="
|