enotas_api 2.0.0 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f32296c352fa04f05b793c4a65c6edf503db4bf60cf216ddd1a09d6bc2529964
4
- data.tar.gz: 9527f7fda48a0e52e5ece0bae5d76ea025d4d6477ef63d24a9823b341250ab80
3
+ metadata.gz: 7c15e10642d206faa8d6ddd3b832b21898559d92486ba3ef95ccae8a0bc550e9
4
+ data.tar.gz: 9ab8de68364a77d1b4e72881a8c17409113028a2d87690eef3d36705eb43ea51
5
5
  SHA512:
6
- metadata.gz: 037f7ee47f22ad756483d6fb87ba6913246acdab727ee1d4312313fc6cf3e9805f51c4f663a96ca9888a957bcfa76a2894620e87e11d0632f653604daf33cc13
7
- data.tar.gz: ee90b0c194e39fb8f75dc3b244be0fbed4bad065ddbcc522c5aecfa9e0d1114af055e5d73c88210f8231d471e1364222237b46b72c92e9345e9bedb80729fec9
6
+ metadata.gz: c060025b59f214c4494411ea6f9ccd4e4a9850859808fab82722acb633bd823315eac01ac14440ba3e74354e055effcd25f77ffe339e38551acb2ce51c309e96
7
+ data.tar.gz: bd2914379f8f545c0a47e9dcb6054d4884e7f525f56350183870ca0c24d8eb2f30417b59c8501b38c8fa4d2efacd860884a69149ef12a058fb58b570f0b70533
data/.rubocop.yml CHANGED
@@ -1,8 +1,6 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
- Exclude:
5
- - sample.rb
6
4
  NewCops: enable
7
5
  UseCache: true
8
6
  Layout/LineLength:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.6
1
+ 2.7.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
+ # 3.0.0
2
+ - Add support to ruby >= 2.7 (compatible with ruby 3)
3
+ - [BREAKING_CHANGE] Drop support for ruby 2.6
1
4
  # 2.0.0
2
- - [BREAK_CHANGE] Método attributes das classes entity agora renomeado para entity_attributes, porém se mantem attributes nas instancias das mesmas classes
5
+ - [BREAKING_CHANGE] Método attributes das classes entity agora renomeado para entity_attributes, porém se mantem attributes nas instancias das mesmas classes
3
6
  - Adicionando suporte completo (todos os campos) a NFS-e
4
7
  # 1.0.2
5
8
  - Ajustando bug na renderização de json, que trazia o atributo inválido @attributes no json
data/Gemfile.lock CHANGED
@@ -1,56 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enotas_api (1.0.2)
4
+ enotas_api (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.7.0)
9
+ addressable (2.8.0)
10
10
  public_suffix (>= 2.0.2, < 5.0)
11
- ast (2.4.1)
12
- crack (0.4.4)
13
- diff-lcs (1.4.4)
11
+ ast (2.4.2)
12
+ crack (0.4.5)
13
+ rexml
14
+ diff-lcs (1.5.0)
14
15
  hashdiff (1.0.1)
15
- parallel (1.20.0)
16
- parser (2.7.2.0)
16
+ parallel (1.22.1)
17
+ parser (3.1.2.0)
17
18
  ast (~> 2.4.1)
18
- public_suffix (4.0.6)
19
- rainbow (3.0.0)
19
+ public_suffix (4.0.7)
20
+ rainbow (3.1.1)
20
21
  rake (13.0.1)
21
- regexp_parser (1.8.2)
22
- rexml (3.2.4)
23
- rspec (3.10.0)
24
- rspec-core (~> 3.10.0)
25
- rspec-expectations (~> 3.10.0)
26
- rspec-mocks (~> 3.10.0)
27
- rspec-core (3.10.0)
28
- rspec-support (~> 3.10.0)
29
- rspec-expectations (3.10.0)
22
+ regexp_parser (2.5.0)
23
+ rexml (3.2.5)
24
+ rspec (3.11.0)
25
+ rspec-core (~> 3.11.0)
26
+ rspec-expectations (~> 3.11.0)
27
+ rspec-mocks (~> 3.11.0)
28
+ rspec-core (3.11.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-expectations (3.11.0)
30
31
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.10.0)
32
- rspec-mocks (3.10.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-mocks (3.11.1)
33
34
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.10.0)
35
- rspec-support (3.10.0)
36
- rubocop (1.3.1)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-support (3.11.0)
37
+ rubocop (1.30.1)
37
38
  parallel (~> 1.10)
38
- parser (>= 2.7.1.5)
39
+ parser (>= 3.1.0.0)
39
40
  rainbow (>= 2.2.2, < 4.0)
40
- regexp_parser (>= 1.8)
41
- rexml
42
- rubocop-ast (>= 1.1.1)
41
+ regexp_parser (>= 1.8, < 3.0)
42
+ rexml (>= 3.2.5, < 4.0)
43
+ rubocop-ast (>= 1.18.0, < 2.0)
43
44
  ruby-progressbar (~> 1.7)
44
- unicode-display_width (>= 1.4.0, < 2.0)
45
- rubocop-ast (1.1.1)
46
- parser (>= 2.7.1.5)
47
- rubocop-rspec (2.0.0)
48
- rubocop (~> 1.0)
49
- rubocop-ast (>= 1.1.0)
50
- ruby-progressbar (1.10.1)
51
- unicode-display_width (1.7.0)
52
- webmock (3.10.0)
53
- addressable (>= 2.3.6)
45
+ unicode-display_width (>= 1.4.0, < 3.0)
46
+ rubocop-ast (1.18.0)
47
+ parser (>= 3.1.1.0)
48
+ rubocop-rspec (2.11.1)
49
+ rubocop (~> 1.19)
50
+ ruby-progressbar (1.11.0)
51
+ unicode-display_width (2.1.0)
52
+ webmock (3.14.0)
53
+ addressable (>= 2.8.0)
54
54
  crack (>= 0.3.2)
55
55
  hashdiff (>= 0.4.0, < 2.0.0)
56
56
 
@@ -60,10 +60,10 @@ PLATFORMS
60
60
  DEPENDENCIES
61
61
  enotas_api!
62
62
  rake (~> 13.0)
63
- rspec (~> 3.10)
64
- rubocop (~> 1.3)
65
- rubocop-rspec (~> 2.0)
66
- webmock (~> 3.10)
63
+ rspec (~> 3.11)
64
+ rubocop (~> 1.30)
65
+ rubocop-rspec (~> 2.11)
66
+ webmock (~> 3.14)
67
67
 
68
68
  BUNDLED WITH
69
- 1.17.3
69
+ 2.1.4
data/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
 
4
4
  EnotasApi é uma gem não oficial porém com design simples, livre de dependências
5
5
 
6
- Criada e mantida com carinho por [@salaozen](https://github.com/salaozen).
6
+ Criada e mantida com carinho por [@bempapp](https://github.com/bempapp).
7
7
 
8
8
  ## English Readers
9
9
  *enotas_api* is a ruby api client for [e-notas](https://enotas.com.br/) [API](https://docs.enotasgw.com.br/reference).
10
10
 
11
11
  EnotasApi its a non oficial, but well with simple design an dependency free
12
12
 
13
- Created and supported with love by [@salaozen](https://github.com/salaozen).
13
+ Created and supported with love by [@bempapp](https://github.com/bempapp).
14
14
 
15
15
  PS: Because e-notas api is entire in portuguese, the code and documentation from here will also be. Sorry about that. :D
16
16
 
@@ -141,15 +141,16 @@ 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. Atualizar o [CHANGELOG](https://github.com/salaozen/enotas_api/blob/main/CHANGELOG.md)
145
- 1. Atualizar a versão em [version.rb](https://github.com/salaozen/enotas_api/blob/main/lib/enotas_api/version.rb)
144
+ 1. Atualizar o [CHANGELOG](https://github.com/bempapp/enotas_api/blob/main/CHANGELOG.md)
145
+ 1. Atualizar a versão em [version.rb](https://github.com/bempapp/enotas_api/blob/main/lib/enotas_api/version.rb)
146
146
  1. Realizar o commit
147
147
  1. Enviar ao repositório `git push origin main`
148
148
  1. Criar uma tag `git tag <VERSAO> && git push origin <VERSAO>`
149
149
  1. Gerar uma nova versão da gem `gem build enotas_api`
150
150
  1. Publicar a gem `gem push enotas_api-<VERSAO>.gem`
151
+
151
152
  ## Contributing
152
- Bug reports and pull requests are welcome on GitHub at https://github.com/salaozen/enotas_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/salaozen/enotas_api/blob/main/CODE_OF_CONDUCT.md).
153
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bempapp/enotas_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bempapp/enotas_api/blob/main/CODE_OF_CONDUCT.md).
153
154
 
154
155
  ## License
155
156
 
@@ -157,4 +158,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
157
158
 
158
159
  ## Code of Conduct
159
160
 
160
- Everyone interacting in the EnotasApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/salaozen/enotas_api/blob/main/CODE_OF_CONDUCT.md).
161
+ Everyone interacting in the EnotasApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bempapp/enotas_api/blob/main/CODE_OF_CONDUCT.md).
data/enotas_api.gemspec CHANGED
@@ -6,13 +6,13 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'enotas_api'
7
7
  spec.version = EnotasApi::VERSION
8
8
  spec.authors = ['Eduardo Bohrer']
9
- spec.email = ['eduardo@salaozen.com.br']
9
+ spec.email = ['eduardo@bemp.com.br']
10
10
 
11
11
  spec.summary = 'E-notas API client'
12
12
  spec.description = 'Non oficial, well supported, e-notas ruby api client'
13
- spec.homepage = 'https://github.com/salaozen/enotas_api'
13
+ spec.homepage = 'https://github.com/bempapp/enotas_api'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('~> 2.6')
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7')
16
16
 
17
17
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
18
 
@@ -28,8 +28,9 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_development_dependency 'rake', '~> 13.0'
31
- spec.add_development_dependency 'rspec', '~> 3.10'
32
- spec.add_development_dependency 'rubocop', '~> 1.3'
33
- spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
34
- spec.add_development_dependency 'webmock', '~> 3.10'
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
+ spec.metadata['rubygems_mfa_required'] = 'true'
35
36
  end
@@ -44,7 +44,7 @@ module EnotasApi
44
44
  def configure_request_headers(request, custom_headers)
45
45
  {
46
46
  'Authorization' => "Basic #{EnotasApi::Configuration.current.api_key}",
47
- "Accept": 'application/json',
47
+ Accept: 'application/json',
48
48
  'Content-Type' => 'application/json',
49
49
  'User-Agent' => 'Enotas-Ruby-SDK'
50
50
  }.merge(custom_headers).each { |key, value| request[key] = value }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnotasApi
4
- VERSION = '2.0.0'
4
+ VERSION = '3.0.0'
5
5
  end
data/sample2.rb ADDED
@@ -0,0 +1,89 @@
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 ADDED
@@ -0,0 +1,8 @@
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
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: 2.0.0
4
+ version: 3.0.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: 2020-11-28 00:00:00.000000000 Z
11
+ date: 2022-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,59 +30,59 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.10'
33
+ version: '3.11'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.10'
40
+ version: '3.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '1.30'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '1.30'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.0'
61
+ version: '2.11'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.0'
68
+ version: '2.11'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.10'
75
+ version: '3.14'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.10'
82
+ version: '3.14'
83
83
  description: Non oficial, well supported, e-notas ruby api client
84
84
  email:
85
- - eduardo@salaozen.com.br
85
+ - eduardo@bemp.com.br
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
@@ -146,30 +146,33 @@ files:
146
146
  - lib/enotas_api/v1/vincular_certificado.rb
147
147
  - lib/enotas_api/v1/vincular_logotipo.rb
148
148
  - lib/enotas_api/version.rb
149
- homepage: https://github.com/salaozen/enotas_api
149
+ - sample2.rb
150
+ - sample3.rb
151
+ homepage: https://github.com/bempapp/enotas_api
150
152
  licenses:
151
153
  - MIT
152
154
  metadata:
153
155
  allowed_push_host: https://rubygems.org
154
- homepage_uri: https://github.com/salaozen/enotas_api
155
- source_code_uri: https://github.com/salaozen/enotas_api
156
- changelog_uri: https://github.com/salaozen/enotas_api/blob/master/CHANGELOG.md
156
+ homepage_uri: https://github.com/bempapp/enotas_api
157
+ source_code_uri: https://github.com/bempapp/enotas_api
158
+ changelog_uri: https://github.com/bempapp/enotas_api/blob/master/CHANGELOG.md
159
+ rubygems_mfa_required: 'true'
157
160
  post_install_message:
158
161
  rdoc_options: []
159
162
  require_paths:
160
163
  - lib
161
164
  required_ruby_version: !ruby/object:Gem::Requirement
162
165
  requirements:
163
- - - "~>"
166
+ - - ">="
164
167
  - !ruby/object:Gem::Version
165
- version: '2.6'
168
+ version: '2.7'
166
169
  required_rubygems_version: !ruby/object:Gem::Requirement
167
170
  requirements:
168
171
  - - ">="
169
172
  - !ruby/object:Gem::Version
170
173
  version: '0'
171
174
  requirements: []
172
- rubygems_version: 3.0.8
175
+ rubygems_version: 3.1.6
173
176
  signing_key:
174
177
  specification_version: 4
175
178
  summary: E-notas API client