klaviyo 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1baf7e1870c03ff86c72a16d22660ca2eea9d4c8bbcbec8e23d6797a05114aa8
4
- data.tar.gz: a51a43bdbbeafc98209be44e174931eabafa67d5cdb5119b9603037dcfb4e233
3
+ metadata.gz: 48ce149f6493a79a418c85585a43079cf3735102c7f3090439a18f5f1c253425
4
+ data.tar.gz: 4633715d8397a09f1c8b70c0cf90e75eebfd2ced0cdf60d20c7b8a90aa0623f1
5
5
  SHA512:
6
- metadata.gz: fb17e43af4d4f45cfc5e34c0710ff0c18e18db6152f657362d79980ba9315594bcb73edd1057e8d4e29888ed27038380058e061a14b32c7043f85dab0d3ad4c7
7
- data.tar.gz: 59d2695a3867749aacdfe713cf9337ea7e6e427c65e5b508b21c1c70b656bb73dadd7a5cae0586d3e7d875422b7457c51abd6560a15c0330d6586c951d359f24
6
+ metadata.gz: f0295d3b07f3aa56ba3285ade79c35eb2bd9498b8931461b10cad486be12cdf0e507e64456f0c383255b8972a491212505df94a3a508c4ea9dfbd0f5973ab98a
7
+ data.tar.gz: cf4f1f10ebad10c3b5c19c0eb6f95862ffabf012f17451610061c6d140f188c752686a10db87c5a52465d346476d61463cee68a4f80c8f17c5e1dac6e34edde1
data/klaviyo.gemspec CHANGED
@@ -2,8 +2,8 @@ files = ['klaviyo.gemspec', '{lib}/**/**/*'].map {|f| Dir[f]}.flatten
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'klaviyo'
5
- s.version = '2.2.0'
6
- s.date = '2021-10-04'
5
+ s.version = '2.3.0'
6
+ s.date = '2021-10-28'
7
7
  s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
8
8
  s.description = 'Ruby wrapper for the Klaviyo API'
9
9
  s.authors = ['Klaviyo Team']
@@ -4,7 +4,7 @@ module Klaviyo
4
4
  V1_API = 'v1'
5
5
  V2_API = 'v2'
6
6
 
7
- KL_VERSION = '2.2.0'
7
+ KL_VERSION = '2.3.0'
8
8
  KL_USER_AGENT = "Ruby_Klaviyo/#{KL_VERSION}"
9
9
 
10
10
  HTTP_DELETE = 'delete'
@@ -27,7 +27,7 @@ module Klaviyo
27
27
  private
28
28
 
29
29
  def self.request(method, path, content_type, **kwargs)
30
- check_private_api_key_exists()
30
+ check_private_api_key_exists(kwargs)
31
31
  url = "#{BASE_API_URL}/#{path}"
32
32
  connection = Faraday.new(
33
33
  url: url,
@@ -82,7 +82,7 @@ module Klaviyo
82
82
  query_params = encode_params(params)
83
83
  priv_api_key = kwargs[:api_key] || Klaviyo.private_api_key || nil
84
84
  full_url = "#{V1_API}/#{path}?api_key=#{priv_api_key}#{query_params}"
85
- request(method, full_url, content_type)
85
+ request(method, full_url, content_type, body: {api_key: priv_api_key})
86
86
  end
87
87
  end
88
88
 
@@ -90,7 +90,7 @@ module Klaviyo
90
90
  path = "#{V2_API}/#{path}"
91
91
  priv_api_key = kwargs[:api_key] || Klaviyo.private_api_key || nil
92
92
  key = {
93
- "api_key": "#{priv_api_key}"
93
+ :api_key => "#{priv_api_key}"
94
94
  }
95
95
  data = {}
96
96
  data[:body] = kwargs.merge(key)
@@ -109,8 +109,8 @@ module Klaviyo
109
109
  end
110
110
  end
111
111
 
112
- def self.check_private_api_key_exists()
113
- if !Klaviyo.private_api_key
112
+ def self.check_private_api_key_exists(kwargs)
113
+ if !Klaviyo.private_api_key && kwargs[:body][:api_key].nil?
114
114
  raise KlaviyoError.new(NO_PRIVATE_API_KEY_ERROR)
115
115
  end
116
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaviyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaviyo Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-04 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json