parallel588-klaviyo 0.14.3 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/klaviyo.gemspec +4 -4
- data/lib/klaviyo.rb +1 -1
- data/lib/klaviyo/client.rb +3 -5
- data/lib/klaviyo/resource.rb +4 -3
- data/lib/klaviyo/version.rb +1 -1
- metadata +22 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4b05296e28eda5f1953c0b0ab8d9aa195ab391dd179faefefcee0e99b71d6005
|
4
|
+
data.tar.gz: 0406daea14c4565221544bfeefbb1c552cdc22acda7cff64f31db138b73e5fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec912786cc67503a57994b40184734307de609559720ed062a5f72b3d8a41beba4bd2ec095b43d7dcc13a8feaaa373ed72cb50fda46ee21c468a5c3626221963
|
7
|
+
data.tar.gz: 0cd64fad5eed6ed748fb5dc57e4b6027331ad18dbd9aa84a1ec2eef9577457fc0a6b61f9336b40152f6c27b68585eb63cf9f8b05fe6a18016df37c57c870f5f3
|
data/klaviyo.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_runtime_dependency('virtus', '>= 1.0')
|
21
21
|
spec.add_runtime_dependency('json', '>= 1.7')
|
22
|
-
spec.add_runtime_dependency('faraday', '
|
23
|
-
spec.add_runtime_dependency('
|
24
|
-
spec.add_runtime_dependency('activesupport', ['>= 3.1', '<
|
22
|
+
spec.add_runtime_dependency('faraday', '~> 0.15.4')
|
23
|
+
spec.add_runtime_dependency('multi_json', '~> 1.13')
|
24
|
+
spec.add_runtime_dependency('activesupport', ['>= 3.1', '< 7.0'])
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
27
|
-
spec.add_development_dependency 'rake', '~>
|
27
|
+
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
|
28
28
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
29
|
spec.add_development_dependency 'pry', '~> 0.10.3'
|
30
30
|
spec.add_development_dependency 'webmock', '~> 2.0', '>= 2.0.3'
|
data/lib/klaviyo.rb
CHANGED
data/lib/klaviyo/client.rb
CHANGED
@@ -14,12 +14,10 @@ module Klaviyo
|
|
14
14
|
raise Errors::AuthenticationError, 'No Token provided.' unless @token
|
15
15
|
|
16
16
|
@conn = Faraday.new(default_req_options.merge(req_options)) do |f|
|
17
|
-
f.
|
18
|
-
|
19
|
-
f.response :logger
|
20
|
-
f.response :json, content_type: 'application/json'
|
21
|
-
f.adapter Faraday.default_adapter
|
17
|
+
f.request :url_encoded
|
18
|
+
|
22
19
|
f.use Errors::RequestError
|
20
|
+
f.adapter Faraday.default_adapter
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
data/lib/klaviyo/resource.rb
CHANGED
@@ -21,7 +21,8 @@ module Klaviyo
|
|
21
21
|
|
22
22
|
attr_reader :meta, :items
|
23
23
|
|
24
|
-
def initialize(
|
24
|
+
def initialize(raw_data)
|
25
|
+
data = raw_data.is_a?(String) ? MultiJson.load(raw_data) : raw_data
|
25
26
|
@items = data.delete('data').map { |attrs| Klaviyo::Resource.build(attrs) }
|
26
27
|
@meta = data
|
27
28
|
end
|
@@ -36,8 +37,8 @@ module Klaviyo
|
|
36
37
|
class Folder < KlaviyoObject; end
|
37
38
|
class Membership < KlaviyoObject; end
|
38
39
|
|
39
|
-
def self.build(
|
40
|
-
|
40
|
+
def self.build(params)
|
41
|
+
attrs = params.is_a?(String) ? MultiJson.load(params) : params
|
41
42
|
object = attrs.delete('object')
|
42
43
|
case object.to_s
|
43
44
|
when 'person'
|
data/lib/klaviyo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel588-klaviyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.15.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.15.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: multi_json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.13'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.13'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
version: '3.1'
|
76
76
|
- - "<"
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: '
|
78
|
+
version: '7.0'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -85,7 +85,7 @@ dependencies:
|
|
85
85
|
version: '3.1'
|
86
86
|
- - "<"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '7.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: bundler
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,14 +106,20 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '12.3'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 12.3.3
|
110
113
|
type: :development
|
111
114
|
prerelease: false
|
112
115
|
version_requirements: !ruby/object:Gem::Requirement
|
113
116
|
requirements:
|
114
117
|
- - "~>"
|
115
118
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
119
|
+
version: '12.3'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 12.3.3
|
117
123
|
- !ruby/object:Gem::Dependency
|
118
124
|
name: rspec
|
119
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
219
|
version: '0'
|
214
220
|
requirements: []
|
215
221
|
rubyforge_project:
|
216
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.7.3
|
217
223
|
signing_key:
|
218
224
|
specification_version: 4
|
219
225
|
summary: You heard us, a Ruby wrapper for the Klaviyo API
|