patch_retention 0.1.3 → 0.1.5

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: cf00b3a8f5069ab659bab2ca865777f408e86eaeca6335900d4be57b889b9c92
4
- data.tar.gz: 925189b1b36aba6f33ae5f10f609c3471f49ceeb964dc748205ea8c71d1f5cfa
3
+ metadata.gz: e09da85122b9149656266b2ffb272f51ec729747c97f52287dd5c89b2b26a03c
4
+ data.tar.gz: 7806f37ed28567871f577c26f8565107d21e65da1dbe58497a177b9920a2222e
5
5
  SHA512:
6
- metadata.gz: d17b4a0602ba7463f3baaade37c65cc70774f18af352a89a171f5c0d4f6b7e0a7a2ed338a8711653969c8c5e33f1a35fae09fc470f512b8212082f25bb03ea57
7
- data.tar.gz: c3f0012eb7e348acf60cecf0a997e05c812cdf5ad14aed02cfe2837f53bd7e4107c91e417d226403f79e7dc95dc01bca26bc562c990d7583e244d309e543d6ed
6
+ metadata.gz: e17497a6c6cb6f2e24002a72438689e67d8d862c2b20eb43ffac61ce7427f7a46eef1096e11ef31dd153b1492880fbedfba8c95c24cb4fc29c9ffaa24bd16368
7
+ data.tar.gz: f674998100632b6e64fcbe01d4af1f828b1636e5fe59e5f797d7287c42d7e013494ac59091eb02415a007fa3818e8698a3bd3cf62cb2ee87475237ce29b98247
data/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@
8
8
  - Fix `delete` method to return true when the response is 204
9
9
  - Allow users to pass a config object for any request, and use the config object for the connection
10
10
 
11
+ ## [0.1.4] - YYYY-MM-DD
12
+
13
+ - Enhanced the `PatchRetention::Contacts::FindOrCreate` service to accept a flexible set of contact parameters, removing the previous restriction on allowed keys.
14
+
15
+ ## [0.1.5] - YYYY-MM-DD
16
+
17
+ - Fixed `PatchRetention::Contacts::FindOrCreate` to correctly format search query parameters according to API expectations.
18
+
11
19
  ## [0.1.0] - 2023-12-03
12
20
 
13
21
  - Initial release
@@ -4,21 +4,13 @@ module PatchRetention::Contacts::FindOrCreate
4
4
  include PatchRetention::Util
5
5
  extend self
6
6
 
7
- ALLOWED_CONTACT_PARAMS = %i[
8
- first_name
9
- last_name
10
- email
11
- phone
12
- sms_on
13
- email_on
14
- ].freeze
15
-
16
7
  def call(contact_params:, query_params:, config: nil)
17
- contact_params = contact_params.slice(*ALLOWED_CONTACT_PARAMS)
18
-
19
8
  raise_error_if_present do
20
9
  PatchRetention.connection(config).patch(PatchRetention::Contacts::API_PATH) do |req|
21
- req.params["search"] = build_search_string(query_params)
10
+ build_search_params(query_params).each do |key, value|
11
+ req.params[key] = value
12
+ end
13
+
22
14
  req.body = contact_params
23
15
  end
24
16
  end
@@ -26,11 +18,10 @@ module PatchRetention::Contacts::FindOrCreate
26
18
 
27
19
  private
28
20
 
29
- def build_search_string(query_params)
30
- query_params = query_params.slice(:email, :phone).compact.map do |key, value|
31
- { "search:#{key}" => value }
32
- end.reduce(&:merge)
33
-
34
- URI.encode_www_form(query_params)
21
+ # Returns a hash of search parameters, correctly prefixed
22
+ def build_search_params(query_params)
23
+ query_params.slice(:email, :phone).compact.transform_keys do |key|
24
+ "search:#{key}"
25
+ end
35
26
  end
36
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PatchRetention
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_retention
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Playbypoint
8
8
  - Gerardo Ortega
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-12-16 00:00:00.000000000 Z
12
+ date: 2025-04-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Patch Retention API wrapper.
15
15
  email:
@@ -41,7 +41,6 @@ files:
41
41
  - lib/patch_retention/events/find.rb
42
42
  - lib/patch_retention/util.rb
43
43
  - lib/patch_retention/version.rb
44
- - patch_retention.gemspec
45
44
  - sig/patch_retention.rbs
46
45
  homepage: https://playbypoint.com
47
46
  licenses:
@@ -50,7 +49,7 @@ metadata:
50
49
  homepage_uri: https://playbypoint.com
51
50
  source_code_uri: https://playbypoint.com
52
51
  changelog_uri: https://playbypoint.com
53
- post_install_message:
52
+ post_install_message:
54
53
  rdoc_options: []
55
54
  require_paths:
56
55
  - lib
@@ -65,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
64
  - !ruby/object:Gem::Version
66
65
  version: '0'
67
66
  requirements: []
68
- rubygems_version: 3.1.4
69
- signing_key:
67
+ rubygems_version: 3.0.3.1
68
+ signing_key:
70
69
  specification_version: 4
71
70
  summary: Patch Retention API wrapper.
72
71
  test_files: []
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/patch_retention/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "patch_retention"
7
- spec.version = PatchRetention::VERSION
8
- spec.authors = ["Playbypoint", "Gerardo Ortega"]
9
- spec.email = ["webmaster@playbypoint.com", "g3ortega@gmail.com"]
10
-
11
- spec.summary = "Patch Retention API wrapper."
12
- spec.description = "Patch Retention API wrapper."
13
- spec.homepage = "https://playbypoint.com"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- # spec.metadata["allowed_push_host"] = "Set to your gem server 'https://example.com'"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://playbypoint.com"
21
- spec.metadata["changelog_uri"] = "https://playbypoint.com"
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
- end
29
- end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
33
-
34
- # Uncomment to register a new dependency of your gem
35
- # spec.add_dependency "example-gem", "~> 1.0"
36
-
37
- # For more information and examples about making a new gem, check out our
38
- # guide at: https://bundler.io/guides/creating_gem.html
39
- end