enotas_api 3.0.1 → 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 +5 -6
- data/.rubocop.yml +1 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +44 -36
- data/README.md +7 -6
- data/Rakefile +1 -1
- data/enotas_api.gemspec +1 -6
- data/lib/enotas_api/request_provider.rb +4 -4
- data/lib/enotas_api/v1/baixar_pdf_nfs.rb +1 -1
- data/lib/enotas_api/v1/baixar_pdf_nfs_id_externo.rb +1 -1
- data/lib/enotas_api/v1/baixar_xml_nfs.rb +1 -1
- data/lib/enotas_api/v1/baixar_xml_nfs_id_externo.rb +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
- data/lib/enotas_api.rb +1 -1
- metadata +17 -80
- data/sample2.rb +0 -89
- data/sample3.rb +0 -8
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
@@ -18,13 +18,12 @@ jobs:
|
|
18
18
|
runs-on: ubuntu-latest
|
19
19
|
|
20
20
|
steps:
|
21
|
-
- uses: actions/checkout@
|
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
|
21
|
+
- uses: actions/checkout@v3
|
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/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.2.2
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -4,3 +4,11 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in enotas_api.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
group :development do
|
9
|
+
gem 'rake', '~> 13.0', '>= 13.0.6'
|
10
|
+
gem 'rspec', '~> 3.12'
|
11
|
+
gem 'rubocop', '~> 1.51'
|
12
|
+
gem 'rubocop-rspec', '~> 2.22'
|
13
|
+
gem 'webmock', '~> 3.18', '>= 3.18.1'
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,55 +1,63 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enotas_api (
|
4
|
+
enotas_api (4.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.8.
|
10
|
-
public_suffix (>= 2.0.2, <
|
9
|
+
addressable (2.8.4)
|
10
|
+
public_suffix (>= 2.0.2, < 6.0)
|
11
11
|
ast (2.4.2)
|
12
12
|
crack (0.4.5)
|
13
13
|
rexml
|
14
14
|
diff-lcs (1.5.0)
|
15
15
|
hashdiff (1.0.1)
|
16
|
-
|
17
|
-
|
16
|
+
json (2.6.3)
|
17
|
+
parallel (1.23.0)
|
18
|
+
parser (3.2.2.1)
|
18
19
|
ast (~> 2.4.1)
|
19
|
-
public_suffix (
|
20
|
+
public_suffix (5.0.1)
|
20
21
|
rainbow (3.1.1)
|
21
|
-
rake (13.0.
|
22
|
-
regexp_parser (2.
|
22
|
+
rake (13.0.6)
|
23
|
+
regexp_parser (2.8.0)
|
23
24
|
rexml (3.2.5)
|
24
|
-
rspec (3.
|
25
|
-
rspec-core (~> 3.
|
26
|
-
rspec-expectations (~> 3.
|
27
|
-
rspec-mocks (~> 3.
|
28
|
-
rspec-core (3.
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-expectations (3.
|
25
|
+
rspec (3.12.0)
|
26
|
+
rspec-core (~> 3.12.0)
|
27
|
+
rspec-expectations (~> 3.12.0)
|
28
|
+
rspec-mocks (~> 3.12.0)
|
29
|
+
rspec-core (3.12.2)
|
30
|
+
rspec-support (~> 3.12.0)
|
31
|
+
rspec-expectations (3.12.3)
|
31
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-mocks (3.
|
33
|
+
rspec-support (~> 3.12.0)
|
34
|
+
rspec-mocks (3.12.5)
|
34
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-support (3.
|
37
|
-
rubocop (1.
|
36
|
+
rspec-support (~> 3.12.0)
|
37
|
+
rspec-support (3.12.0)
|
38
|
+
rubocop (1.51.0)
|
39
|
+
json (~> 2.3)
|
38
40
|
parallel (~> 1.10)
|
39
|
-
parser (>= 3.
|
41
|
+
parser (>= 3.2.0.0)
|
40
42
|
rainbow (>= 2.2.2, < 4.0)
|
41
43
|
regexp_parser (>= 1.8, < 3.0)
|
42
44
|
rexml (>= 3.2.5, < 4.0)
|
43
|
-
rubocop-ast (>= 1.
|
45
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
44
46
|
ruby-progressbar (~> 1.7)
|
45
|
-
unicode-display_width (>=
|
46
|
-
rubocop-ast (1.
|
47
|
-
parser (>= 3.
|
48
|
-
rubocop-
|
49
|
-
rubocop (~> 1.
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
48
|
+
rubocop-ast (1.28.1)
|
49
|
+
parser (>= 3.2.1.0)
|
50
|
+
rubocop-capybara (2.18.0)
|
51
|
+
rubocop (~> 1.41)
|
52
|
+
rubocop-factory_bot (2.23.1)
|
53
|
+
rubocop (~> 1.33)
|
54
|
+
rubocop-rspec (2.22.0)
|
55
|
+
rubocop (~> 1.33)
|
56
|
+
rubocop-capybara (~> 2.17)
|
57
|
+
rubocop-factory_bot (~> 2.22)
|
58
|
+
ruby-progressbar (1.13.0)
|
59
|
+
unicode-display_width (2.4.2)
|
60
|
+
webmock (3.18.1)
|
53
61
|
addressable (>= 2.8.0)
|
54
62
|
crack (>= 0.3.2)
|
55
63
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -59,11 +67,11 @@ PLATFORMS
|
|
59
67
|
|
60
68
|
DEPENDENCIES
|
61
69
|
enotas_api!
|
62
|
-
rake (~> 13.0)
|
63
|
-
rspec (~> 3.
|
64
|
-
rubocop (~> 1.
|
65
|
-
rubocop-rspec (~> 2.
|
66
|
-
webmock (~> 3.
|
70
|
+
rake (~> 13.0, >= 13.0.6)
|
71
|
+
rspec (~> 3.12)
|
72
|
+
rubocop (~> 1.51)
|
73
|
+
rubocop-rspec (~> 2.22)
|
74
|
+
webmock (~> 3.18, >= 3.18.1)
|
67
75
|
|
68
76
|
BUNDLED WITH
|
69
|
-
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
|
@@ -141,6 +141,7 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
|
|
141
141
|
- [ ] Manifestação de Destinatário (NF-e)
|
142
142
|
|
143
143
|
# Como liberar uma nova versão
|
144
|
+
1. Garantir cobertura de teste em 100% (para rodar os testes: rake check)
|
144
145
|
1. Atualizar o [CHANGELOG](https://github.com/bempapp/enotas_api/blob/main/CHANGELOG.md)
|
145
146
|
1. Atualizar a versão em [version.rb](https://github.com/bempapp/enotas_api/blob/main/lib/enotas_api/version.rb)
|
146
147
|
1. Realizar o commit
|
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('>=
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1')
|
16
16
|
|
17
17
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
18
|
|
@@ -27,10 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
end
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.11'
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 1.30'
|
33
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.11'
|
34
|
-
spec.add_development_dependency 'webmock', '~> 3.14'
|
35
30
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
36
31
|
end
|
@@ -5,19 +5,19 @@ require 'net/http'
|
|
5
5
|
module EnotasApi
|
6
6
|
class RequestProvider
|
7
7
|
def get(url)
|
8
|
-
request(obj: Net::HTTP::Get, url:
|
8
|
+
request(obj: Net::HTTP::Get, url:)
|
9
9
|
end
|
10
10
|
|
11
11
|
def post(url, body)
|
12
|
-
request(obj: Net::HTTP::Post, url
|
12
|
+
request(obj: Net::HTTP::Post, url:, body:)
|
13
13
|
end
|
14
14
|
|
15
15
|
def post_form(url, form_data)
|
16
|
-
request(obj: Net::HTTP::Post, url
|
16
|
+
request(obj: Net::HTTP::Post, url:, form_data: form_data.to_a)
|
17
17
|
end
|
18
18
|
|
19
19
|
def delete(url)
|
20
|
-
request(obj: Net::HTTP::Delete, url:
|
20
|
+
request(obj: Net::HTTP::Delete, url:)
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -8,7 +8,7 @@ module EnotasApi
|
|
8
8
|
class BaixarPdfNfs < EnotasApi::Request
|
9
9
|
def initialize(empresa_id, nfs_id)
|
10
10
|
uri = "/v1/empresas/#{url_encode(empresa_id)}/nfes/#{url_encode(nfs_id)}/pdf"
|
11
|
-
super(uri
|
11
|
+
super(uri:, result_object: EnotasApi::RawResult)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module EnotasApi
|
|
8
8
|
class BaixarPdfNfsIdExterno < EnotasApi::Request
|
9
9
|
def initialize(empresa_id, id_externo)
|
10
10
|
uri = "/v1/empresas/#{url_encode(empresa_id)}/nfes/porIdExterno/#{url_encode(id_externo)}/pdf"
|
11
|
-
super(uri
|
11
|
+
super(uri:, result_object: EnotasApi::RawResult)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -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
data/lib/enotas_api.rb
CHANGED
metadata
CHANGED
@@ -1,85 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enotas_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Bohrer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '13.0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '13.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rspec
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.11'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.11'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.30'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.30'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop-rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '2.11'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '2.11'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: webmock
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.14'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.14'
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
83
13
|
description: Non oficial, well supported, e-notas ruby api client
|
84
14
|
email:
|
85
15
|
- eduardo@bemp.com.br
|
@@ -145,9 +75,16 @@ files:
|
|
145
75
|
- lib/enotas_api/v1/listar_notas_fiscais.rb
|
146
76
|
- lib/enotas_api/v1/vincular_certificado.rb
|
147
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
|
148
87
|
- lib/enotas_api/version.rb
|
149
|
-
- sample2.rb
|
150
|
-
- sample3.rb
|
151
88
|
homepage: https://github.com/bempapp/enotas_api
|
152
89
|
licenses:
|
153
90
|
- MIT
|
@@ -157,7 +94,7 @@ metadata:
|
|
157
94
|
source_code_uri: https://github.com/bempapp/enotas_api
|
158
95
|
changelog_uri: https://github.com/bempapp/enotas_api/blob/main/CHANGELOG.md
|
159
96
|
rubygems_mfa_required: 'true'
|
160
|
-
post_install_message:
|
97
|
+
post_install_message:
|
161
98
|
rdoc_options: []
|
162
99
|
require_paths:
|
163
100
|
- lib
|
@@ -165,15 +102,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
102
|
requirements:
|
166
103
|
- - ">="
|
167
104
|
- !ruby/object:Gem::Version
|
168
|
-
version: '
|
105
|
+
version: '3.1'
|
169
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
107
|
requirements:
|
171
108
|
- - ">="
|
172
109
|
- !ruby/object:Gem::Version
|
173
110
|
version: '0'
|
174
111
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
112
|
+
rubygems_version: 3.1.2
|
113
|
+
signing_key:
|
177
114
|
specification_version: 4
|
178
115
|
summary: E-notas API client
|
179
116
|
test_files: []
|
data/sample2.rb
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# rubocop:disable all
|
3
|
-
|
4
|
-
require_relative 'lib/enotas_api'
|
5
|
-
|
6
|
-
EnotasApi::Configuration.configure(api_key: 'Nzk2ZGViNWUtYWY0YS00M2Y3LThhMjEtZGU4MTYzODkwNjAw')
|
7
|
-
|
8
|
-
sz = EnotasApi::V1::Empresa.new({
|
9
|
-
id: 'b90c486b-b53e-48a6-8f94-141f83980600',
|
10
|
-
cnpj: '31552469000167',
|
11
|
-
inscricaoMunicipal: '61114626',
|
12
|
-
razaoSocial: 'Salão Zen Desenvolvimento de Sistemas LTDA',
|
13
|
-
nomeFantasia: 'Salão Zen',
|
14
|
-
optanteSimplesNacional: true,
|
15
|
-
email: 'administrativo@salaozen.com.br',
|
16
|
-
telefoneComercial: '51 993286954',
|
17
|
-
aliquotaIss: 2.0,
|
18
|
-
regimeEspecialTributacao: '6',
|
19
|
-
# codigoServicoMunicipal: '010100100',
|
20
|
-
# descricaoServico: 'Análise de sistemas',
|
21
|
-
# itemListaServicoLC116: '1.01',
|
22
|
-
endereco: {
|
23
|
-
codigoIbgeUf: 43,
|
24
|
-
codigoIbgeCidade: 4_314_902,
|
25
|
-
pais: 'Brasil',
|
26
|
-
uf: 'RS',
|
27
|
-
cidade: 'Porto Alegre',
|
28
|
-
logradouro: 'Avenida Jose Aloisio Filho',
|
29
|
-
numero: '411',
|
30
|
-
complemento: '266',
|
31
|
-
bairro: 'Humaitá',
|
32
|
-
cep: '90250180'
|
33
|
-
},
|
34
|
-
configuracoesNFSeHomologacao: {
|
35
|
-
sequencialNFe: 1,
|
36
|
-
serieNFe: '1',
|
37
|
-
sequencialLoteNFe: 1,
|
38
|
-
usuarioAcessoProvedor: nil,
|
39
|
-
senhaAcessoProvedor: nil,
|
40
|
-
tokenAcessoProvedor: nil
|
41
|
-
},
|
42
|
-
configuracoesNFSeProducao: {
|
43
|
-
sequencialNFe: 682,
|
44
|
-
serieNFe: '1',
|
45
|
-
sequencialLoteNFe: 682,
|
46
|
-
usuarioAcessoProvedor: nil,
|
47
|
-
senhaAcessoProvedor: nil,
|
48
|
-
tokenAcessoProvedor: nil
|
49
|
-
}
|
50
|
-
})
|
51
|
-
|
52
|
-
nfs = EnotasApi::V1::Nfs.new(
|
53
|
-
idExterno: "teste-#{Random.rand(999_999_999)}",
|
54
|
-
ambienteEmissao: 'Homologacao',
|
55
|
-
enviarPorEmail: true,
|
56
|
-
cliente: {
|
57
|
-
tipoPessoa: 'F',
|
58
|
-
nome: 'Luis Eduardo Bohrer da Silva',
|
59
|
-
email: 'eduardo@salaozen.com.br',
|
60
|
-
cpfCnpj: '00910366071',
|
61
|
-
endereco: {
|
62
|
-
uf: 'RS',
|
63
|
-
cidade: 'Porto Alegre',
|
64
|
-
logradouro: 'Avenida Jose Aloisio Filho',
|
65
|
-
numero: '411',
|
66
|
-
complemento: '266',
|
67
|
-
bairro: 'Humaitá',
|
68
|
-
cep: '90250180'
|
69
|
-
}
|
70
|
-
},
|
71
|
-
servico: {
|
72
|
-
descricao: 'Teste'
|
73
|
-
# codigoInternoServicoMunicipal: "14283"
|
74
|
-
},
|
75
|
-
valorTotal: 1.0,
|
76
|
-
observacoes: 'Teste'
|
77
|
-
)
|
78
|
-
|
79
|
-
# json_nota = EnotasApi::V1::EmitirNfs.new(sz.id, nfs).call
|
80
|
-
# puts 'JSON NOTA', json_nota.to_json
|
81
|
-
|
82
|
-
# puts EnotasApi::V1::ConsultarNfs.new(sz.id, json_nota.nfeId).call.to_json
|
83
|
-
|
84
|
-
nfId = 'abb97f74-f98b-4dbb-a48b-1c1991d60600'
|
85
|
-
nfId = 'f2acaf7f-918a-4f67-8248-88b9c6d60600'
|
86
|
-
salonId = '0569139F-03F6-4189-A224-D546E49D0600'
|
87
|
-
puts EnotasApi::V1::ConsultarNfs.new(salonId, nfId).call.to_json
|
88
|
-
|
89
|
-
# "valorCofins":0.0,"valorCsll":0.0,"valorInss":0.0,"valorIr":0.0,"valorPis":0.0,","valorIss":48.0
|
data/sample3.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# rubocop:disable all
|
3
|
-
|
4
|
-
require_relative 'lib/enotas_api'
|
5
|
-
|
6
|
-
EnotasApi::Configuration.configure(api_key: 'Nzk2ZGViNWUtYWY0YS00M2Y3LThhMjEtZGU4MTYzODkwNjAw')
|
7
|
-
|
8
|
-
puts EnotasApi::V1::ConsultarNfs.new('B90C486B-B53E-48A6-8F94-141F83980600', 'development:nfs:2:1:bu').call.to_json
|