ploomes_client 0.3.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d693449b2aafafd860eac099966a60c370bc18e473f1068d59afb2bece16c604
4
+ data.tar.gz: c3860a4de4bba9f3b1110644ac484d6dbf1f9685961f4ac620cf953c18db23cd
5
+ SHA512:
6
+ metadata.gz: b2ef03f9c919814dd1d8141c542c7157dbb2405657874178850a3e5467e847d9422847574c23ccbb8f5b59c312fce6fb810d26e93a02b1de180d0116fa321a4f
7
+ data.tar.gz: b1be6e9f96258fed50334457d0bf3b0caec2d4550d5812c5d676f376855ab7005aa831c3cc2443ebd70681de59217820889b2112b874c5904ac9a08e24ced892
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,116 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-performance
4
+
5
+ AllCops:
6
+ SuggestExtensions: false
7
+ NewCops: enable
8
+ CacheRootDirectory: tmp
9
+ Exclude:
10
+ - 'vendor/**/*'
11
+ - 'bin/**/*'
12
+ - '.git/**/*'
13
+ - 'examples/**/*'
14
+
15
+ ##### LAYOUT #####
16
+
17
+ Layout/FirstArrayElementIndentation:
18
+ Enabled: true
19
+ EnforcedStyle: consistent
20
+
21
+ Layout/FirstHashElementIndentation:
22
+ Enabled: true
23
+ EnforcedStyle: consistent
24
+
25
+ Layout/LineLength:
26
+ Max: 120
27
+ AllowedPatterns: ['(\A|\s)#']
28
+
29
+ ##### STYLE #####
30
+
31
+ Style/PreferredHashMethods:
32
+ Enabled: true
33
+ Safe: false
34
+ EnforcedStyle: verbose
35
+
36
+ Style/SymbolArray:
37
+ Enabled: true
38
+ EnforcedStyle: percent
39
+ MinSize: 3
40
+
41
+ Style/WordArray:
42
+ Enabled: true
43
+ EnforcedStyle: percent
44
+ MinSize: 3
45
+
46
+ Style/MultilineBlockChain:
47
+ Enabled: false
48
+
49
+ Style/Lambda:
50
+ Enabled: true
51
+ EnforcedStyle: literal
52
+
53
+ Style/LambdaCall:
54
+ Enabled: false
55
+
56
+ Style/Documentation:
57
+ Enabled: false
58
+
59
+ Style/ClassAndModuleChildren:
60
+ Enabled: false
61
+
62
+ ##### LINT #####
63
+
64
+ Lint/MissingSuper:
65
+ Enabled: false
66
+
67
+ ##### NAMING #####
68
+
69
+ Naming/InclusiveLanguage:
70
+ Enabled: false
71
+
72
+ Naming/PredicateName:
73
+ ForbiddenPrefixes:
74
+ - is_
75
+ - have_
76
+ # allows `has_` predicate
77
+
78
+ ###### METRICS #####
79
+
80
+ Metrics/AbcSize:
81
+ Enabled: true
82
+ Max: 22
83
+
84
+ Metrics/BlockLength:
85
+ Enabled: true
86
+ CountComments: false
87
+ Exclude:
88
+ - '**/*.gemspec'
89
+ - 'spec/**/*'
90
+
91
+ Metrics/ClassLength:
92
+ Max: 200
93
+
94
+ Metrics/MethodLength:
95
+ Enabled: true
96
+ CountAsOne: ['array', 'heredoc']
97
+ Max: 20
98
+
99
+ ##### RSPEC #####
100
+
101
+ RSpec/ContextWording:
102
+ Prefixes:
103
+ - and
104
+ - but
105
+ - when
106
+ - with
107
+ - without
108
+
109
+ RSpec/ExampleLength:
110
+ Max: 20
111
+
112
+ RSpec/MultipleMemoizedHelpers:
113
+ Enabled: false
114
+
115
+ RSpec/NestedGroups:
116
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.3.1] - 2023-05-22
4
+
5
+ - Add FHTTPClient as a runtime dependency
6
+
7
+ ## [0.3.0] - 2023-05-16
8
+
9
+ - Add more fields to Deal list service (Pipeline, Status and LossReason)
10
+
11
+ ## [0.2.0] - 2023-03-21
12
+
13
+ - Add Deal list service (filtering by id);
14
+ - Add User list service (filtering by id);
15
+
16
+ ## [0.1.0] - 2023-03-02
17
+
18
+ - Initial release
19
+ - Add base gem;
20
+ - Add Contact list service (filtering by id);
data/Gemfile ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in ploomes_client.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem 'rubocop'
10
+ gem 'rubocop-performance'
11
+ gem 'rubocop-rspec'
12
+ end
13
+
14
+ group :test do
15
+ gem 'rspec', '~> 3.0'
16
+ gem 'simplecov'
17
+ gem 'webmock'
18
+ end
19
+
20
+ group :development, :test do
21
+ gem 'pry'
22
+ gem 'pry-nav'
23
+ gem 'rake', '~> 13.0'
24
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,130 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ploomes_client (0.3.1)
5
+ dry-configurable
6
+ f_http_client (>= 0.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (7.0.4.3)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ addressable (2.8.1)
17
+ public_suffix (>= 2.0.2, < 6.0)
18
+ ast (2.4.2)
19
+ coderay (1.1.3)
20
+ concurrent-ruby (1.2.2)
21
+ crack (0.4.5)
22
+ rexml
23
+ diff-lcs (1.5.0)
24
+ docile (1.4.0)
25
+ dry-configurable (1.0.1)
26
+ dry-core (~> 1.0, < 2)
27
+ zeitwerk (~> 2.6)
28
+ dry-core (1.0.0)
29
+ concurrent-ruby (~> 1.0)
30
+ zeitwerk (~> 2.6)
31
+ dry-initializer (3.1.1)
32
+ f_http_client (0.2.0)
33
+ activesupport
34
+ addressable
35
+ dry-configurable
36
+ dry-initializer
37
+ f_service (>= 0.3.0)
38
+ httparty
39
+ f_service (0.3.0)
40
+ hashdiff (1.0.1)
41
+ httparty (0.21.0)
42
+ mini_mime (>= 1.0.0)
43
+ multi_xml (>= 0.5.2)
44
+ i18n (1.13.0)
45
+ concurrent-ruby (~> 1.0)
46
+ json (2.6.3)
47
+ method_source (1.0.0)
48
+ mini_mime (1.1.2)
49
+ minitest (5.18.0)
50
+ multi_xml (0.6.0)
51
+ parallel (1.22.1)
52
+ parser (3.2.1.0)
53
+ ast (~> 2.4.1)
54
+ pry (0.14.2)
55
+ coderay (~> 1.1)
56
+ method_source (~> 1.0)
57
+ pry-nav (1.0.0)
58
+ pry (>= 0.9.10, < 0.15)
59
+ public_suffix (5.0.1)
60
+ rainbow (3.1.1)
61
+ rake (13.0.6)
62
+ regexp_parser (2.7.0)
63
+ rexml (3.2.5)
64
+ rspec (3.12.0)
65
+ rspec-core (~> 3.12.0)
66
+ rspec-expectations (~> 3.12.0)
67
+ rspec-mocks (~> 3.12.0)
68
+ rspec-core (3.12.1)
69
+ rspec-support (~> 3.12.0)
70
+ rspec-expectations (3.12.2)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.12.0)
73
+ rspec-mocks (3.12.3)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.12.0)
76
+ rspec-support (3.12.0)
77
+ rubocop (1.47.0)
78
+ json (~> 2.3)
79
+ parallel (~> 1.10)
80
+ parser (>= 3.2.0.0)
81
+ rainbow (>= 2.2.2, < 4.0)
82
+ regexp_parser (>= 1.8, < 3.0)
83
+ rexml (>= 3.2.5, < 4.0)
84
+ rubocop-ast (>= 1.26.0, < 2.0)
85
+ ruby-progressbar (~> 1.7)
86
+ unicode-display_width (>= 2.4.0, < 3.0)
87
+ rubocop-ast (1.27.0)
88
+ parser (>= 3.2.1.0)
89
+ rubocop-capybara (2.17.1)
90
+ rubocop (~> 1.41)
91
+ rubocop-performance (1.16.0)
92
+ rubocop (>= 1.7.0, < 2.0)
93
+ rubocop-ast (>= 0.4.0)
94
+ rubocop-rspec (2.18.1)
95
+ rubocop (~> 1.33)
96
+ rubocop-capybara (~> 2.17)
97
+ ruby-progressbar (1.12.0)
98
+ simplecov (0.22.0)
99
+ docile (~> 1.1)
100
+ simplecov-html (~> 0.11)
101
+ simplecov_json_formatter (~> 0.1)
102
+ simplecov-html (0.12.3)
103
+ simplecov_json_formatter (0.1.4)
104
+ tzinfo (2.0.6)
105
+ concurrent-ruby (~> 1.0)
106
+ unicode-display_width (2.4.2)
107
+ webmock (3.18.1)
108
+ addressable (>= 2.8.0)
109
+ crack (>= 0.3.2)
110
+ hashdiff (>= 0.4.0, < 2.0.0)
111
+ zeitwerk (2.6.7)
112
+
113
+ PLATFORMS
114
+ arm64-darwin-21
115
+ x86_64-linux
116
+
117
+ DEPENDENCIES
118
+ ploomes_client!
119
+ pry
120
+ pry-nav
121
+ rake (~> 13.0)
122
+ rspec (~> 3.0)
123
+ rubocop
124
+ rubocop-performance
125
+ rubocop-rspec
126
+ simplecov
127
+ webmock
128
+
129
+ BUNDLED WITH
130
+ 2.4.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Bruno Vicenzo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # PloomesClient
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ploomes_client`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ploomes_client.
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ class Base < FHTTPClient::Base
5
+ def self.config
6
+ @config ||= PloomesClient::Configuration.config
7
+ end
8
+
9
+ private
10
+
11
+ def headers
12
+ {
13
+ 'User-Key' => config.user_key,
14
+ 'Content-Type' => 'application/json',
15
+ 'odata.metadata' => 'minimal'
16
+ }
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ class Configuration < FHTTPClient::Configuration
5
+ setting :user_key
6
+ end
7
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ module Contact
5
+ class List < PloomesClient::Base
6
+ option :id, default: -> {}
7
+
8
+ private
9
+
10
+ def make_request
11
+ self.class.get(formatted_path, headers: headers)
12
+ end
13
+
14
+ def path_template
15
+ '/Contacts?$filter=Id+eq+%<id>s'
16
+ end
17
+
18
+ def path_params
19
+ id.present? ? { id: id } : super
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ module Deal
5
+ class List < PloomesClient::Base
6
+ option :id, default: -> {}
7
+
8
+ private
9
+
10
+ def make_request
11
+ self.class.get(formatted_path, headers: headers)
12
+ end
13
+
14
+ def path_template
15
+ '/Deals?$expand=Attachments,OtherProperties,Pipeline,Status,LossReason&$filter=Id+eq+%<id>s'
16
+ end
17
+
18
+ def path_params
19
+ id.present? ? { id: id } : super
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ module User
5
+ class List < PloomesClient::Base
6
+ option :id, default: -> {}
7
+
8
+ private
9
+
10
+ def make_request
11
+ self.class.get(formatted_path, headers: headers)
12
+ end
13
+
14
+ def path_template
15
+ '/Users?$filter=Id+eq+%<id>s'
16
+ end
17
+
18
+ def path_params
19
+ id.present? ? { id: id } : super
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PloomesClient
4
+ VERSION = '0.3.1'
5
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'f_http_client'
4
+ require_relative 'ploomes_client/version'
5
+
6
+ require_relative 'ploomes_client/configuration'
7
+ require_relative 'ploomes_client/base'
8
+ require_relative 'ploomes_client/contact/list'
9
+ require_relative 'ploomes_client/deal/list'
10
+ require_relative 'ploomes_client/user/list'
11
+
12
+ module PloomesClient
13
+ end
@@ -0,0 +1,4 @@
1
+ module PloomesClient
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ploomes_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.1
5
+ platform: ruby
6
+ authors:
7
+ - Fretadao Tech Team
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-configurable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: f_http_client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.0
41
+ description:
42
+ email:
43
+ - tech@fretadao.com.br
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".rspec"
49
+ - ".rubocop.yml"
50
+ - CHANGELOG.md
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - lib/ploomes_client.rb
57
+ - lib/ploomes_client/base.rb
58
+ - lib/ploomes_client/configuration.rb
59
+ - lib/ploomes_client/contact/list.rb
60
+ - lib/ploomes_client/deal/list.rb
61
+ - lib/ploomes_client/user/list.rb
62
+ - lib/ploomes_client/version.rb
63
+ - sig/ploomes_client.rbs
64
+ homepage: https://github.com/Fretadao/ploomes_client
65
+ licenses:
66
+ - MIT
67
+ metadata:
68
+ homepage_uri: https://github.com/Fretadao/ploomes_client
69
+ source_code_uri: https://github.com/Fretadao/ploomes_client
70
+ changelog_uri: https://github.com/Fretadao/ploomes_client/CHANGELOG.md
71
+ rubygems_mfa_required: 'true'
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 3.0.0
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubygems_version: 3.3.5
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Gem to provide service clients to integrate with Ploomes API services
91
+ test_files: []