pipedrive-connect 2.0.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131444c95f6ebc0388e1bbc98d1a9e3b6093a18e4c66d3e97865a05bc68b3a78
4
- data.tar.gz: 3ac8c7f3a256c9c7cc0c0bf2e2bd13d272f1ee89d556b4e549e8593762451f6f
3
+ metadata.gz: aaf73c515815f3c167d4ae50a7df906187f6f907979b9112890aa67c37ce7ed0
4
+ data.tar.gz: ca708585ed82f05fb61a6c24f7a0daf40e927abec936532fe508049b4c1cded1
5
5
  SHA512:
6
- metadata.gz: 7d66f1e1446e979020acd1216ef46a6a90e2910248a52fecaf62371adf79fd5af22c0d95e26f7b576a02c63a395289b684f246b4657278d321f0e01d82981593
7
- data.tar.gz: 6a993a356288b5d470d44653cc646942b9485d9e9fb21b955204c7347acb84854cfb840e4971bc4df254160ff8bb30a4a93e854aedbac9fc10838d5ab3b598e9
6
+ metadata.gz: b939b3ec4aa1548549f2e81b81c2d8c93d1f9d35f40ca4076a6adfef8914c12c223c500d87f3b6d17681ec1d2713ded9fbd58ac8b54cf4a9eb811a8312713b92
7
+ data.tar.gz: 596515219b75357ef3e18312065b7764596f9959d24db958250b9142578f684e3b2e95c14f6378053345d51200e16e934be942760f3ca3e44c09e11bd4a73d79
data/CHANGELOG.md CHANGED
@@ -5,10 +5,26 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
7
7
 
8
+ ## [2.1.1] - 2025-08-06
9
+
10
+ ### Changed
11
+ - Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
12
+
13
+ ## [2.1.0] - 2025-08-06
14
+
15
+ ### Added
16
+ - New `use_fields_version` method in Fields module to override API version specifically for fields operations
17
+ - Fields-specific version override functionality that allows resources to use different API versions for fields vs general operations
18
+ - `fields_api_version` method to query the fields-specific API version
19
+
20
+ ### Changed
21
+ - Activity resource now uses `use_fields_version :v1` instead of `use_version :v1` to override version only for fields operations
22
+ - Activity general operations now use v2 API while fields operations continue to use v1 API as required by Pipedrive
23
+
8
24
  ## [2.0.1] - 2025-04-17
9
25
 
10
- - Fix bugs instroduced with version 2 where the base url for v1 was broken.
11
- - Add github actions
26
+ - Fix bugs introduced with version 2 where the base URL for v1 was broken.
27
+ - Add GitHub Actions workflow
12
28
 
13
29
  ## [2.0.0] - 2025-04-11
14
30
 
@@ -18,6 +18,7 @@ module Pipedrive
18
18
  end
19
19
 
20
20
  def api_version_prefix
21
+ # Version 1 endpoints don't use the '/api/' prefix
21
22
  return api_version if api_version == :v1
22
23
 
23
24
  "api/#{api_version}"
@@ -10,6 +10,24 @@ module Pipedrive
10
10
  end
11
11
 
12
12
  module ClassMethods
13
+ # Set version specifically for fields operations
14
+ def use_fields_version(version)
15
+ @fields_version = version
16
+ end
17
+
18
+ # override the default version with the one provided
19
+ def api_version
20
+ return @version if @version
21
+
22
+ # Fall back to original Request module logic if no version override
23
+ super
24
+ end
25
+
26
+ # Fields-specific API version
27
+ def fields_api_version
28
+ @fields_version || api_version
29
+ end
30
+
13
31
  def fields
14
32
  url = fields_url || "#{class_name.downcase}Fields"
15
33
 
@@ -18,7 +36,7 @@ module Pipedrive
18
36
  request_more_fields = true
19
37
 
20
38
  while request_more_fields
21
- response = request(:get, url, start: start)
39
+ response = fields_request(:get, url, start: start)
22
40
  data.concat(response.dig(:data))
23
41
  # Check wether there are more fields to bring
24
42
  metadata = response.dig(:additional_data, :pagination)
@@ -40,6 +58,20 @@ module Pipedrive
40
58
  end
41
59
  [dicc, data]
42
60
  end
61
+
62
+ # Fields-specific request method that uses fields_api_version
63
+ private def fields_request(method, url, params = {})
64
+ # Temporarily override the api_version for this request
65
+ original_version = @version
66
+ @version = @fields_version if @fields_version
67
+
68
+ begin
69
+ request(method, url, params)
70
+ ensure
71
+ # Restore original version
72
+ @version = original_version
73
+ end
74
+ end
43
75
  end
44
76
 
45
77
  def fields
@@ -3,6 +3,11 @@
3
3
  module Pipedrive
4
4
  class Activity < Resource
5
5
  include Fields
6
+
7
+ # fields are only available in v1
8
+ # https://developers.pipedrive.com/docs/api/v1/ActivityFields#getActivityFields
9
+ use_fields_version :v1
10
+
6
11
  self.resources_url = "activities"
7
12
 
8
13
  def self.supports_v2_api?
@@ -8,8 +8,12 @@ module Pipedrive
8
8
  has_many :products, class_name: "Product"
9
9
  has_many :participants, class_name: "Participant"
10
10
 
11
+ # fields are only available in v1
12
+ # https://developers.pipedrive.com/docs/api/v1/DealFields#getDealFields
13
+ use_fields_version :v1
14
+
11
15
  def self.supports_v2_api?
12
- false
16
+ true
13
17
  end
14
18
  end
15
19
  end
@@ -8,5 +8,13 @@ module Pipedrive
8
8
  has_many :activities, class_name: "Activity"
9
9
  has_many :deals, class_name: "Deal"
10
10
  has_many :persons, class_name: "Person"
11
+
12
+ # fields are only available in v1
13
+ # https://developers.pipedrive.com/docs/api/v1/OrganizationFields#getOrganizationFields
14
+ use_fields_version :v1
15
+
16
+ def self.supports_v2_api?
17
+ true
18
+ end
11
19
  end
12
20
  end
@@ -7,5 +7,13 @@ module Pipedrive
7
7
 
8
8
  has_many :deals, class_name: "Deal"
9
9
  has_many :activities, class_name: "Activity"
10
+
11
+ # fields are only available in v1
12
+ # https://developers.pipedrive.com/docs/api/v1/PersonFields#getPersonFields
13
+ use_fields_version :v1
14
+
15
+ def self.supports_v2_api?
16
+ true
17
+ end
10
18
  end
11
19
  end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pipedrive
4
- class Pipeline < Resource; end
4
+ class Pipeline < Resource
5
+ def self.supports_v2_api?
6
+ true
7
+ end
8
+ end
5
9
  end
@@ -4,8 +4,12 @@ module Pipedrive
4
4
  class Product < Resource
5
5
  include Fields
6
6
 
7
+ # fields are only available in v1
8
+ # https://developers.pipedrive.com/docs/api/v1/ProductFields#getProductFields
9
+ use_fields_version :v1
10
+
7
11
  def self.supports_v2_api?
8
- false
12
+ true
9
13
  end
10
14
  end
11
15
  end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pipedrive
4
- class Stage < Resource; end
4
+ class Stage < Resource
5
+ def self.supports_v2_api?
6
+ true
7
+ end
8
+ end
5
9
  end
@@ -18,5 +18,9 @@ module Pipedrive
18
18
 
19
19
  items.map { |d| new(d) }
20
20
  end
21
+
22
+ def self.supports_v2_api?
23
+ true
24
+ end
21
25
  end
22
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pipedrive
4
- VERSION = "2.0.1"
4
+ VERSION = "2.1.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipedrive-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Get on Board
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-04-18 00:00:00.000000000 Z
11
+ date: 2025-08-07 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: faraday
@@ -23,6 +24,7 @@ dependencies:
23
24
  - - "<"
24
25
  - !ruby/object:Gem::Version
25
26
  version: '3'
27
+ description:
26
28
  email: team@getonbrd.com
27
29
  executables: []
28
30
  extensions: []
@@ -86,6 +88,7 @@ metadata:
86
88
  source_code_uri: https://github.com/getonbrd/pipedrive-connect
87
89
  changelog_uri: https://github.com/getonbrd/pipedrive-connect/CHANGELOG.md
88
90
  rubygems_mfa_required: 'true'
91
+ post_install_message:
89
92
  rdoc_options: []
90
93
  require_paths:
91
94
  - lib
@@ -100,7 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
103
  - !ruby/object:Gem::Version
101
104
  version: '0'
102
105
  requirements: []
103
- rubygems_version: 3.6.2
106
+ rubygems_version: 3.5.21
107
+ signing_key:
104
108
  specification_version: 4
105
109
  summary: Ruby binding for the pipedrive API.
106
110
  test_files: []