pipedrive-connect 2.0.1 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131444c95f6ebc0388e1bbc98d1a9e3b6093a18e4c66d3e97865a05bc68b3a78
4
- data.tar.gz: 3ac8c7f3a256c9c7cc0c0bf2e2bd13d272f1ee89d556b4e549e8593762451f6f
3
+ metadata.gz: b59e1ddcf850e86b6ab8ddfc384c83d86b55839b9518ea482190f1685a9d0f4a
4
+ data.tar.gz: 19715830d980662d719712275641380c818322c06f919b6b6924feda0dada118
5
5
  SHA512:
6
- metadata.gz: 7d66f1e1446e979020acd1216ef46a6a90e2910248a52fecaf62371adf79fd5af22c0d95e26f7b576a02c63a395289b684f246b4657278d321f0e01d82981593
7
- data.tar.gz: 6a993a356288b5d470d44653cc646942b9485d9e9fb21b955204c7347acb84854cfb840e4971bc4df254160ff8bb30a4a93e854aedbac9fc10838d5ab3b598e9
6
+ metadata.gz: e8aaf434d1b15bae2de6608c1baada88ae3cd4010c29f633dcfe28804958a5b6a9356a68f92af392e7bf5bf023659e748c1d19281c34fb45d13583e22253740b
7
+ data.tar.gz: 7b9318cee4b94c8b352a7767e8ba6d96c021836f44321ea2d69fcc88beebf1b54533c992669ee8b4d4cf2b6add603c8d15e3ed371e3c3554355f81e7ccbe44df
data/CHANGELOG.md CHANGED
@@ -5,11 +5,21 @@ 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.0.1] - 2025-04-17
8
+ ## [2.1.0] - 2025-08-06
9
+
10
+ ### Added
11
+ - New `use_fields_version` method in Fields module to override API version specifically for fields operations
12
+ - Fields-specific version override functionality that allows resources to use different API versions for fields vs general operations
13
+ - `fields_api_version` method to query the fields-specific API version
9
14
 
10
- - Fix bugs instroduced with version 2 where the base url for v1 was broken.
11
- - Add github actions
15
+ ### Changed
16
+ - Activity resource now uses `use_fields_version :v1` instead of `use_version :v1` to override version only for fields operations
17
+ - Activity general operations now use v2 API while fields operations continue to use v1 API as required by Pipedrive
18
+
19
+ ## [2.0.1] - 2025-04-17
12
20
 
21
+ - Fix bugs introduced with version 2 where the base URL for v1 was broken.
22
+ - Add GitHub Actions workflow
13
23
  ## [2.0.0] - 2025-04-11
14
24
 
15
25
  - **BREAKING change**: Minimum ruby version updated to 2.7.
@@ -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?
@@ -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.0"
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.0
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-06 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: []