fatture_in_cloud_ruby 0.1.3 → 0.2.6

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: 3ccd69d477867e756b04fac66e79a9285ed8a8a7f6038de12c7f368397dd065b
4
- data.tar.gz: 901f6badb0a29f69774eecc269fa1b3e657cee2dd2d9b796786c39987fe7658b
3
+ metadata.gz: f8330901398703d9c02e699743133dd8cef8e9f78f3761504e94c27996dcbbc7
4
+ data.tar.gz: 15fdccbd8ecfa1314000af81c24c9e875a7dc76b6905bf0afdd5f35aed289669
5
5
  SHA512:
6
- metadata.gz: 8fcc1420eb826239f14cf5e291ad554a3f778eaf8fce6c6c384676a23ec5e4eff13777441818c4617cc374bdc59ac9c8f09d3ae2f105f2e4453848d3c7daf3ac
7
- data.tar.gz: cec1b253a4665febc7262f5d35e1db7c5ffb593dafb3dbab9b5b2d596e9011350838abf113377fa4fc4c720c465ed378bca1b436c86d11cea38a93c898c3f3e9
6
+ metadata.gz: e775fc8c39185b8d5ec64e5d19010291ee8285c0279e158043393a0391796c6912db92e3bdab8ab3a420e7659388dd841a965a51051977487d1de1423e4b835b
7
+ data.tar.gz: 105e5a5befd0d6f303d4939f68e4965c808557c862328a3a8d99bf923e940629b548ccee3f27080998f2895675227f0d9c5aef2ea7d33905fe4d73117b6ab9ec
@@ -0,0 +1 @@
1
+ fatture_in_cloud_ruby
@@ -0,0 +1 @@
1
+ 2.6.5
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fatture_in_cloud_ruby (0.1.3)
4
+ fatture_in_cloud_ruby (0.2.6)
5
5
  api_struct (~> 1.0.5)
6
- dry-configurable (~> 0.8.0)
6
+ dry-configurable (~> 0.11.5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -16,69 +16,75 @@ GEM
16
16
  dry-monads (~> 1)
17
17
  hashie
18
18
  http
19
- ast (2.4.0)
20
- concurrent-ruby (1.1.5)
19
+ ast (2.4.1)
20
+ concurrent-ruby (1.1.6)
21
21
  diff-lcs (1.3)
22
22
  domain_name (0.5.20190701)
23
23
  unf (>= 0.0.5, < 1.0.0)
24
- dry-configurable (0.8.3)
24
+ dry-configurable (0.11.5)
25
25
  concurrent-ruby (~> 1.0)
26
26
  dry-core (~> 0.4, >= 0.4.7)
27
+ dry-equalizer (~> 0.2)
27
28
  dry-core (0.4.9)
28
29
  concurrent-ruby (~> 1.0)
29
30
  dry-equalizer (0.3.0)
30
31
  dry-inflector (0.2.0)
31
- dry-monads (1.3.4)
32
+ dry-monads (1.3.5)
32
33
  concurrent-ruby (~> 1.0)
33
34
  dry-core (~> 0.4, >= 0.4.4)
34
35
  dry-equalizer
35
- ffi (1.11.3)
36
+ ffi (1.13.1)
36
37
  ffi-compiler (1.0.1)
37
38
  ffi (>= 1.0.0)
38
39
  rake
39
- hashie (4.0.0)
40
- http (4.2.0)
40
+ hashie (4.1.0)
41
+ http (4.4.1)
41
42
  addressable (~> 2.3)
42
43
  http-cookie (~> 1.0)
43
- http-form_data (~> 2.0)
44
+ http-form_data (~> 2.2)
44
45
  http-parser (~> 1.2.0)
45
46
  http-cookie (1.0.3)
46
47
  domain_name (~> 0.5)
47
- http-form_data (2.1.1)
48
+ http-form_data (2.3.0)
48
49
  http-parser (1.2.1)
49
50
  ffi-compiler (>= 1.0, < 2.0)
50
- jaro_winkler (1.5.4)
51
- parallel (1.19.1)
52
- parser (2.7.0.1)
51
+ parallel (1.19.2)
52
+ parser (2.7.1.3)
53
53
  ast (~> 2.4.0)
54
- public_suffix (4.0.2)
54
+ public_suffix (4.0.5)
55
55
  rainbow (3.0.0)
56
56
  rake (13.0.1)
57
+ regexp_parser (1.7.1)
58
+ rexml (3.2.4)
57
59
  rspec (3.9.0)
58
60
  rspec-core (~> 3.9.0)
59
61
  rspec-expectations (~> 3.9.0)
60
62
  rspec-mocks (~> 3.9.0)
61
- rspec-core (3.9.1)
62
- rspec-support (~> 3.9.1)
63
- rspec-expectations (3.9.0)
63
+ rspec-core (3.9.2)
64
+ rspec-support (~> 3.9.3)
65
+ rspec-expectations (3.9.2)
64
66
  diff-lcs (>= 1.2.0, < 2.0)
65
67
  rspec-support (~> 3.9.0)
66
68
  rspec-mocks (3.9.1)
67
69
  diff-lcs (>= 1.2.0, < 2.0)
68
70
  rspec-support (~> 3.9.0)
69
- rspec-support (3.9.2)
70
- rubocop (0.78.0)
71
- jaro_winkler (~> 1.5.1)
71
+ rspec-support (3.9.3)
72
+ rubocop (0.85.1)
72
73
  parallel (~> 1.10)
73
- parser (>= 2.6)
74
+ parser (>= 2.7.0.1)
74
75
  rainbow (>= 2.2.2, < 4.0)
76
+ regexp_parser (>= 1.7)
77
+ rexml
78
+ rubocop-ast (>= 0.0.3)
75
79
  ruby-progressbar (~> 1.7)
76
- unicode-display_width (>= 1.4.0, < 1.7)
80
+ unicode-display_width (>= 1.4.0, < 2.0)
81
+ rubocop-ast (0.0.3)
82
+ parser (>= 2.7.0.1)
77
83
  ruby-progressbar (1.10.1)
78
84
  unf (0.1.4)
79
85
  unf_ext
80
- unf_ext (0.0.7.6)
81
- unicode-display_width (1.6.0)
86
+ unf_ext (0.0.7.7)
87
+ unicode-display_width (1.7.0)
82
88
 
83
89
  PLATFORMS
84
90
  ruby
@@ -88,7 +94,7 @@ DEPENDENCIES
88
94
  fatture_in_cloud_ruby!
89
95
  rake (~> 13.0)
90
96
  rspec (~> 3.0)
91
- rubocop (~> 0.78.0)
97
+ rubocop
92
98
 
93
99
  BUNDLED WITH
94
100
  1.17.3
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+
2
3
  task :default => :spec
@@ -1,44 +1,45 @@
1
+ # frozen_string_literal: true
1
2
 
2
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "fatture_in_cloud_ruby/version"
5
+ require 'fatture_in_cloud_ruby/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "fatture_in_cloud_ruby"
8
+ spec.name = 'fatture_in_cloud_ruby'
8
9
  spec.version = FattureInCloudRuby::VERSION
9
- spec.authors = ["Andrea Vanini"]
10
- spec.email = ["andrea.vanini@uidu.org"]
10
+ spec.authors = ['Andrea Vanini']
11
+ spec.email = ['andrea.vanini@uidu.org']
11
12
 
12
13
  spec.summary = 'A ruby API wrapper for FattureInCloud API'
13
14
  spec.description = 'A ruby API wrapper for FattureInCloud API'
14
- spec.homepage = "https://github.com/uidu-org/fatture-in-cloud-ruby"
15
- spec.license = "MIT"
15
+ spec.homepage = 'https://github.com/uidu-org/fatture-in-cloud-ruby'
16
+ spec.license = 'MIT'
16
17
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
18
19
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
20
  if spec.respond_to?(:metadata)
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/uidu-org/fatture-in-cloud-ruby"
22
- spec.metadata["changelog_uri"] = "https://github.com/uidu-org/fatture-in-cloud-ruby/CHANGELOG.md"
21
+ spec.metadata['homepage_uri'] = spec.homepage
22
+ spec.metadata['source_code_uri'] = 'https://github.com/uidu-org/fatture-in-cloud-ruby'
23
+ spec.metadata['changelog_uri'] = 'https://github.com/uidu-org/fatture-in-cloud-ruby/CHANGELOG.md'
23
24
  else
24
- raise "RubyGems 2.0 or newer is required to protect against " \
25
- "public gem pushes."
25
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
26
+ 'public gem pushes.'
26
27
  end
27
28
 
28
29
  # Specify which files should be added to the gem when it is released.
29
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
31
32
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
33
  end
33
- spec.bindir = "exe"
34
+ spec.bindir = 'exe'
34
35
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
36
+ spec.require_paths = ['lib']
36
37
 
37
38
  spec.add_dependency 'api_struct', '~> 1.0.5'
38
- spec.add_dependency 'dry-configurable', '~> 0.8.0'
39
+ spec.add_dependency 'dry-configurable', '~> 0.11.5'
39
40
 
40
- spec.add_development_dependency "bundler", "~> 1.17"
41
- spec.add_development_dependency "rake", "~> 13.0"
41
+ spec.add_development_dependency 'bundler', '~> 1.17'
42
+ spec.add_development_dependency 'rake', '~> 13.0'
42
43
  spec.add_development_dependency 'rspec', '~> 3.0'
43
- spec.add_development_dependency 'rubocop', '~> 0.78.0'
44
+ spec.add_development_dependency 'rubocop'
44
45
  end
@@ -1,13 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'api_struct'
2
4
  require 'dry-configurable'
3
5
 
4
- require_relative 'api_struct_settings'
5
- require_relative "version"
6
- require_relative "clients/corrispettivi"
6
+ require_relative 'fatture_in_cloud_ruby/version'
7
+ require_relative 'fatture_in_cloud_ruby/settings'
8
+ require_relative 'fatture_in_cloud_ruby/api_struct_settings'
9
+ require_relative 'fatture_in_cloud_ruby/clients/corrispettivi'
10
+ require_relative 'fatture_in_cloud_ruby/corrispettivi'
7
11
 
8
12
  module FattureInCloudRuby
9
- extend Dry::Configurable
10
-
11
13
  class Error < StandardError; end
12
- # Your code goes here...
13
14
  end
@@ -1,40 +1,40 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FattureInCloudRuby
2
4
  module Clients
3
5
  class Corrispettivi < ApiStruct::Client
4
6
  fatture_in_cloud :corrispettivi
5
7
 
6
- def list(year)
8
+ def list(**params)
7
9
  post(
8
10
  path: 'corrispettivi/lista',
9
11
  json: {
10
- anno: year,
11
12
  api_uid: FattureInCloudRuby::Settings.config.api_uid,
12
13
  api_key: FattureInCloudRuby::Settings.config.api_key
13
- }
14
+ }.merge(params)
14
15
  )
15
16
  end
16
17
 
17
- def retrieve(id)
18
+ def retrieve(id); end
19
+
20
+ def delete(id)
21
+ post(
22
+ path: 'corrispettivi/elimina',
23
+ json: {
24
+ api_uid: FattureInCloudRuby::Settings.config.api_uid,
25
+ api_key: FattureInCloudRuby::Settings.config.api_key
26
+ }.merge(id: id)
27
+ )
18
28
  end
19
29
 
20
- def create(tipo: 'ricevute', metodo:, importi_ivati: true, desc:, riga:)
30
+ def create(**params)
31
+ puts params.inspect
21
32
  post(
22
33
  path: 'corrispettivi/nuovo',
23
34
  json: {
24
35
  api_uid: FattureInCloudRuby::Settings.config.api_uid,
25
- api_key: FattureInCloudRuby::Settings.config.api_key,
26
- tipo: tipo,
27
- protocollo_auto: true,
28
- metodo: metodo,
29
- desc: desc,
30
- importi_ivati: importi_ivati,
31
- lista_righe: [
32
- {
33
- importo: riga[:importo],
34
- cod_iva: riga[:cod_iva]
35
- }
36
- ]
37
- }
36
+ api_key: FattureInCloudRuby::Settings.config.api_key
37
+ }.merge(params)
38
38
  )
39
39
  end
40
40
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FattureInCloudRuby
4
+ module Clients
5
+ class Proforma < ApiStruct::Client
6
+ fatture_in_cloud :proforma
7
+
8
+ def list(**params)
9
+ post(
10
+ path: 'proforma/lista',
11
+ json: {
12
+ api_uid: FattureInCloudRuby::Settings.config.api_uid,
13
+ api_key: FattureInCloudRuby::Settings.config.api_key
14
+ }.merge(params)
15
+ )
16
+ end
17
+
18
+ def retrieve(id); end
19
+
20
+ def delete(id)
21
+ post(
22
+ path: 'proforma/elimina',
23
+ json: {
24
+ api_uid: FattureInCloudRuby::Settings.config.api_uid,
25
+ api_key: FattureInCloudRuby::Settings.config.api_key
26
+ }.merge(id: id)
27
+ )
28
+ end
29
+
30
+ def create(**params)
31
+ puts params.inspect
32
+ post(
33
+ path: 'proforma/nuovo',
34
+ json: {
35
+ api_uid: FattureInCloudRuby::Settings.config.api_uid,
36
+ api_key: FattureInCloudRuby::Settings.config.api_key
37
+ }.merge(params)
38
+ )
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FattureInCloudRuby
4
+ class Corrispettivi < ApiStruct::Entity
5
+ client_service FattureInCloudRuby::Clients::Corrispettivi
6
+
7
+ # client_service AuthorsClient, prefix: true, only: :index
8
+ # alias:
9
+ # client_service AuthorsClient, prefix: :prefix, except: :index
10
+
11
+ attr_entity :success, :error, :error_code,
12
+ :id, :metodo, :importi_ivati,
13
+ :desc, :riga, :protocollo_auto, :tipo, :lista_corrispettivi,
14
+ :new_id
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FattureInCloudRuby
4
+ class Proforma < ApiStruct::Entity
5
+ client_service FattureInCloudRuby::Clients::Proforma
6
+
7
+ # client_service AuthorsClient, prefix: true, only: :index
8
+ # alias:
9
+ # client_service AuthorsClient, prefix: :prefix, except: :index
10
+
11
+ attr_entity :success, :error, :error_code
12
+ attr_entity :nome, :id_cliente, :id_fornitore, :indirizzo_via, :indirizzo_cap, :indirizzo_citta, :indirizzo_provincia
13
+ attr_entity :paese, :paese_iso
14
+ attr_entity :piva, :cf
15
+ attr_entity :salva_anagrafica
16
+ attr_entity :prezzi_ivati
17
+ attr_entity :lista_articoli
18
+ end
19
+ end
@@ -1,6 +1,6 @@
1
1
  module FattureInCloudRuby
2
2
  class Settings
3
- extend ::Dry::Configurable
3
+ extend Dry::Configurable
4
4
 
5
5
  setting :api_key
6
6
  setting :api_uid
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FattureInCloudRuby
2
- VERSION = "0.1.3"
4
+ VERSION = '0.2.6'
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fatture_in_cloud_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Vanini
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api_struct
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.0
33
+ version: 0.11.5
34
34
  type: :runtime
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: 0.8.0
40
+ version: 0.11.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.78.0
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.78.0
96
+ version: '0'
97
97
  description: A ruby API wrapper for FattureInCloud API
98
98
  email:
99
99
  - andrea.vanini@uidu.org
@@ -102,6 +102,8 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - ".ruby-gemset"
106
+ - ".ruby-version"
105
107
  - CODE_OF_CONDUCT.md
106
108
  - Gemfile
107
109
  - Gemfile.lock
@@ -114,6 +116,9 @@ files:
114
116
  - lib/fatture_in_cloud_ruby.rb
115
117
  - lib/fatture_in_cloud_ruby/api_struct_settings.rb
116
118
  - lib/fatture_in_cloud_ruby/clients/corrispettivi.rb
119
+ - lib/fatture_in_cloud_ruby/clients/proforma.rb
120
+ - lib/fatture_in_cloud_ruby/corrispettivi.rb
121
+ - lib/fatture_in_cloud_ruby/proforma.rb
117
122
  - lib/fatture_in_cloud_ruby/settings.rb
118
123
  - lib/fatture_in_cloud_ruby/version.rb
119
124
  homepage: https://github.com/uidu-org/fatture-in-cloud-ruby
@@ -123,7 +128,7 @@ metadata:
123
128
  homepage_uri: https://github.com/uidu-org/fatture-in-cloud-ruby
124
129
  source_code_uri: https://github.com/uidu-org/fatture-in-cloud-ruby
125
130
  changelog_uri: https://github.com/uidu-org/fatture-in-cloud-ruby/CHANGELOG.md
126
- post_install_message:
131
+ post_install_message:
127
132
  rdoc_options: []
128
133
  require_paths:
129
134
  - lib
@@ -139,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
144
  version: '0'
140
145
  requirements: []
141
146
  rubygems_version: 3.0.6
142
- signing_key:
147
+ signing_key:
143
148
  specification_version: 4
144
149
  summary: A ruby API wrapper for FattureInCloud API
145
150
  test_files: []