leanplum_api 1.4.2 → 2.0.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
  SHA1:
3
- metadata.gz: 96a62527d89596e1a01c6260c1b6a78b6a942442
4
- data.tar.gz: 0700fe592e63ae062c2f5bebc104f1238763ca44
3
+ metadata.gz: 7b8d4f6eb38f52bcc546f280eedf54ae413f6029
4
+ data.tar.gz: 023e78d43a6bd80fb69eb4a225a4fc59a14a72db
5
5
  SHA512:
6
- metadata.gz: c6248055081fb84ed57b51c5b36b8fd7797e44027f7715812f820922c7e2f5140b510d57e9f20dbe8ec5c5f48f9828d964d8d7615abb8edb9c3d3d1181b62dbc
7
- data.tar.gz: 1e4683d7f50be65b44fc7c1b9e7ffa9d26e4729e2488c19c887dfbdac739726d77c243e07ebb563546c0c009e8114cc45f0094c275b595448e7e0cfc0b1f2b78
6
+ metadata.gz: 93b7f8cd1ce616bcbe16a0c5045363e8defad9a23c746333b91a7bac2bf30dfe1c09b023835e689d01aac07310b9d391eb540ba63853c03cc8b92bcc27b74b5c
7
+ data.tar.gz: 54648ce19ffa56ff6f4377100181e6347228d1def62dd0af22ec3e4734c27be1385dc0e14848571f527b149dbb691d86a6b0311fa3a71cb582959702edcc1d1c
data/README.md CHANGED
@@ -20,17 +20,19 @@ You need to obtain (at a minimum) the `PRODUCTION_KEY` and `APP_ID` from Leanplu
20
20
  require 'leanplum_api'
21
21
 
22
22
  LeanplumApi.configure do |config|
23
+ # Required keys
23
24
  config.app_id = 'MY_APP_ID'
24
25
  config.production_key = 'MY_CLIENT_KEY'
25
- config.data_export_key = 'MY_DATA_KEY' # Optional; necessary only if you want to call data export methods.
26
- config.content_read_only_key = 'MY_CONTENT_KEY' # Optional; necessary for retrieving AB test info
27
- config.development_key = 'MY_CONTENT_KEY' # Optional; needed for resetting anomalous events
26
+
27
+ # Optional keys
28
+ config.data_export_key = 'MY_DATA_KEY' # Necessary only if you want to call data export methods.
29
+ config.content_read_only_key = 'MY_CONTENT_KEY' # Necessary for retrieving AB test info
30
+ config.development_key = 'MY_CONTENT_KEY' # Necessary for resetting anomalous events
28
31
 
29
32
  # Optional configuration variables
30
- config.logger = LeanplumApi::Logger.new('file.log') # Defaults to STDOUT. The gem logger class hides passwords.
31
- config.timeout_seconds # Defaults to 600
32
- config.api_version # Defaults to 1.0.6
33
- config.developer_mode # Defaults to false
33
+ config.logger = LeanplumApi::Logger.new('my.log') # Defaults to STDOUT; the gem logger class hides passwords.
34
+ config.timeout_seconds # Defaults to 600
35
+ config.api_version # Defaults to 1.0.6
34
36
 
35
37
  # S3 export required options
36
38
  config.s3_bucket_name = 'my_bucket'
@@ -57,8 +59,8 @@ attribute_hash = {
57
59
  first_name: 'Mike',
58
60
  last_name: 'Jones',
59
61
  gender: 'm',
60
- birthday: Date.today, # Dates/times only sort of supported in user attributes
61
- email: 'still_tippin@test.com'
62
+ email: 'still_tippin@test.com',
63
+ birthday: Date.today # Dates/times will be converted to ISO8601 format
62
64
  }
63
65
  api.set_user_attributes(attribute_hash)
64
66
 
@@ -115,8 +115,16 @@ module LeanplumApi
115
115
  get_export_results(job_id)
116
116
  end
117
117
 
118
+ def user_attributes(user_id)
119
+ export_user(user_id)['userAttributes']
120
+ end
121
+
122
+ def user_events(user_id)
123
+ export_user(user_id)['events']
124
+ end
125
+
118
126
  def export_user(user_id)
119
- data_export_connection.get(action: 'exportUser', userId: user_id).body['response'].first['userAttributes']
127
+ data_export_connection.get(action: 'exportUser', userId: user_id).body['response'].first
120
128
  end
121
129
 
122
130
  def get_ab_tests(only_recent = false)
@@ -41,6 +41,7 @@ module LeanplumApi::Connection
41
41
 
42
42
  @connection ||= Faraday.new(options) do |connection|
43
43
  connection.request :leanplum_response_validation
44
+ connection.request :json
44
45
 
45
46
  connection.response :logger, @logger, bodies: true if api_debug?
46
47
  connection.response :json, :content_type => /\bjson$/
@@ -1,3 +1,3 @@
1
1
  module LeanplumApi
2
- VERSION = '1.4.2'
2
+ VERSION = '2.0.1'
3
3
  end
data/spec/api_spec.rb CHANGED
@@ -2,9 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe LeanplumApi::API do
4
4
  let(:api) { LeanplumApi::API.new }
5
+ let(:first_user_id) { 123456 }
5
6
  let(:users) do
6
7
  [{
7
- user_id: 123456,
8
+ user_id: first_user_id,
8
9
  first_name: 'Mike',
9
10
  last_name: 'Jones',
10
11
  gender: 'm',
@@ -12,12 +13,11 @@ describe LeanplumApi::API do
12
13
  create_date: '2010-01-01'.to_date
13
14
  }]
14
15
  end
15
- let(:first_user_id) { users.first[:user_id] }
16
16
 
17
17
  context 'users' do
18
18
  it 'build_user_attributes_hash' do
19
19
  expect(api.send(:build_user_attributes_hash, users.first)).to eq({
20
- userId: 123456,
20
+ userId: first_user_id,
21
21
  action: 'setUserAttributes',
22
22
  userAttributes: HashWithIndifferentAccess.new(
23
23
  first_name: 'Mike',
@@ -42,22 +42,19 @@ describe LeanplumApi::API do
42
42
  let(:broken_users) { users + [{ first_name: 'Moe' }] }
43
43
 
44
44
  it 'should raise an error' do
45
- VCR.use_cassette('set_user_attributes_broken') do
46
- expect{ api.set_user_attributes(broken_users) }.to raise_error(/No device_id or user_id in hash/)
47
- end
45
+ expect{ api.set_user_attributes(broken_users) }.to raise_error(/No device_id or user_id in hash/)
48
46
  end
49
47
  end
50
48
  end
51
49
 
52
- context 'export_user' do
50
+ context 'user_attributes' do
53
51
  it 'should get user attributes for this user' do
54
52
  VCR.use_cassette('export_user') do
55
- user_info = api.export_user(first_user_id)
56
- user_info.keys.each do |k|
53
+ api.user_attributes(first_user_id).each do |k, v|
57
54
  if users.first[k.to_sym].is_a?(Date) || users.first[k.to_sym].is_a?(DateTime)
58
- expect(user_info[k]).to eq(users.first[k.to_sym].strftime('%Y-%m-%d'))
55
+ expect(v).to eq(users.first[k.to_sym].strftime('%Y-%m-%d'))
59
56
  else
60
- expect(user_info[k]).to eq(users.first[k.to_sym])
57
+ expect(v).to eq(users.first[k.to_sym])
61
58
  end
62
59
  end
63
60
  end
@@ -79,11 +76,12 @@ describe LeanplumApi::API do
79
76
 
80
77
  context 'events' do
81
78
  let(:timestamp) { '2015-05-01 01:02:03' }
79
+ let(:purchase) { 'purchase' }
82
80
  let(:events) do
83
81
  [
84
82
  {
85
- user_id: 12345,
86
- event: 'purchase',
83
+ user_id: first_user_id,
84
+ event: purchase,
87
85
  time: Time.now.utc,
88
86
  some_timestamp: timestamp
89
87
  },
@@ -98,10 +96,10 @@ describe LeanplumApi::API do
98
96
  context '#build_event_attributes_hash' do
99
97
  let(:event_hash) do
100
98
  {
101
- userId: 12345,
99
+ userId: first_user_id,
102
100
  time: Time.now.utc.strftime('%s'),
103
101
  action: 'track',
104
- event: 'purchase',
102
+ event: purchase,
105
103
  params: { some_timestamp: timestamp }
106
104
  }
107
105
  end
@@ -152,6 +150,14 @@ describe LeanplumApi::API do
152
150
  end
153
151
  end
154
152
  end
153
+
154
+ context 'user_events' do
155
+ it 'should get user events for this user' do
156
+ VCR.use_cassette('export_user') do
157
+ expect(api.user_events(first_user_id)[purchase].keys).to eq(['count'])
158
+ end
159
+ end
160
+ end
155
161
  end
156
162
 
157
163
  # Data export and content read only endpoints forbid use of devMode
@@ -247,9 +253,10 @@ describe LeanplumApi::API do
247
253
  end
248
254
 
249
255
  it 'gets vars' do
256
+ pending 'Docs are extremely unclear about what getVars and setVars even do'
257
+
250
258
  VCR.use_cassette('get_vars') do
251
- vars = api.get_vars(first_user_id)
252
- expect(vars).to eq({ 'test_var' => 1 })
259
+ expect(api.get_vars(users.first[:user_id])).to eq({ 'test_var' => 1 })
253
260
  end
254
261
  end
255
262
  end
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:06 GMT
26
+ - Fri, 01 Jul 2016 14:47:52 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"error":{"message":"No matching data found."},"success":false}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:07 GMT
26
+ - Fri, 01 Jul 2016 14:47:53 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"error":{"message":"No matching data found."},"success":false}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:03 GMT
26
+ - Fri, 01 Jul 2016 14:47:49 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
- string: '{"response":[{"events":{},"states":{},"success":true,"userAttributes":{"first_name":"Mike","create_date":"2010-01-01","email":"still_tippin@test.com","last_name":"Jones","gender":"m"}}]}'
37
+ string: '{"response":[{"created":1.43935302887E9,"events":{"purchase":{"count":11}},"lastActive":1.446709787966E9,"states":{},"success":true,"userAttributes":{"first_name":"Mike","create_date":"2010-01-01","email":"still_tippin@test.com","last_name":"Jones","gender":"m"}}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:09 GMT
26
+ - Fri, 01 Jul 2016 14:47:54 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"abTests":[],"success":true}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:08 GMT
26
+ - Fri, 01 Jul 2016 14:47:54 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"abTests":[],"success":true}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Wed, 04 Nov 2015 20:50:07 GMT
26
+ - Fri, 01 Jul 2016 14:47:53 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"files":["https:\/\/leanplum_export.storage.googleapis.com\/export-4727756026281984-d5969d55-f242-48a6-85a3-165af08e2306-output-0"],"jobId":"export_4727756026281984_2904941266315269120","numBytes":36590,"state":"FINISHED","success":true,"numSessions":101}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -22,14 +22,16 @@ http_interactions:
22
22
  - "*"
23
23
  Content-Type:
24
24
  - application/json
25
+ X-Cloud-Trace-Context:
26
+ - 12a07ad33968771fe966d66789f04e87
25
27
  Date:
26
- - Wed, 04 Nov 2015 20:50:09 GMT
28
+ - Fri, 01 Jul 2016 14:47:55 GMT
27
29
  Server:
28
30
  - Google Frontend
29
31
  Cache-Control:
30
32
  - private
31
33
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
34
+ - quic=":443"; ma=2592000; v="35,34,33,32,31,30,29,28,27,26,25"
33
35
  Transfer-Encoding:
34
36
  - chunked
35
37
  body:
@@ -37,5 +39,5 @@ http_interactions:
37
39
  string: '{"response":[{"success":true,"messages":[{"id":5670583287676928,"created":1.440091595799E9,"name":"New
38
40
  Message","active":false,"messageType":"Push Notification"}]}]}'
39
41
  http_version:
40
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
41
- recorded_with: VCR 2.9.3
42
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_with: VCR 3.0.3
@@ -1,5 +1,45 @@
1
1
  ---
2
2
  http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data":[{"userId":123456,"action":"setUserAttributes","userAttributes":{"first_name":"Mike","last_name":"Jones","gender":"m","email":"still_tippin@test.com","create_date":"2010-01-01"}}]}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Origin:
24
+ - "*"
25
+ Content-Type:
26
+ - application/json
27
+ Date:
28
+ - Fri, 01 Jul 2016 14:59:29 GMT
29
+ Server:
30
+ - Google Frontend
31
+ Cache-Control:
32
+ - private
33
+ Alt-Svc:
34
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
35
+ Transfer-Encoding:
36
+ - chunked
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
40
+ time skew. User will be excluded from analytics."}}]}'
41
+ http_version:
42
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
3
43
  - request:
4
44
  method: get
5
45
  uri: https://www.leanplum.com/api?action=getVars&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&userId=123456
@@ -23,18 +63,18 @@ http_interactions:
23
63
  Content-Type:
24
64
  - application/json
25
65
  Date:
26
- - Wed, 04 Nov 2015 20:50:09 GMT
66
+ - Fri, 01 Jul 2016 14:59:30 GMT
27
67
  Server:
28
68
  - Google Frontend
29
69
  Cache-Control:
30
70
  - private
31
71
  Alt-Svc:
32
- - quic=":443"; p="1"; ma=604800
72
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
73
  Transfer-Encoding:
34
74
  - chunked
35
75
  body:
36
76
  encoding: UTF-8
37
- string: '{"response":[{"vars":{"test_var":1},"interfaceRules":[],"variants":[{"id":5}],"regions":{},"success":true,"messages":{},"interfaceEvents":[]}]}'
77
+ string: '{"response":[{"vars":{},"interfaceRules":[],"variants":[],"eventRules":[],"regions":{},"success":true,"messages":{}}]}'
38
78
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
79
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
80
+ recorded_with: VCR 3.0.3
@@ -23,18 +23,18 @@ http_interactions:
23
23
  Content-Type:
24
24
  - application/json
25
25
  Date:
26
- - Mon, 04 Jan 2016 18:15:51 GMT
26
+ - Fri, 01 Jul 2016 14:47:55 GMT
27
27
  Server:
28
28
  - Google Frontend
29
29
  Cache-Control:
30
30
  - private
31
31
  Alt-Svc:
32
- - quic=":443"; ma=604800; v="30,29,28,27,26,25"
32
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
33
  Transfer-Encoding:
34
34
  - chunked
35
35
  body:
36
36
  encoding: UTF-8
37
37
  string: '{"response":[{"error":{"message":"Message not found."},"success":false}]}'
38
38
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
40
- recorded_with: VCR 2.9.3
39
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
40
+ recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data":[{"action":"setUserAttributes","resetAnomalies":true,"userId":123456}]}'
@@ -25,19 +25,18 @@ http_interactions:
25
25
  Content-Type:
26
26
  - application/json
27
27
  Date:
28
- - Thu, 05 Nov 2015 07:49:48 GMT
28
+ - Fri, 01 Jul 2016 14:47:50 GMT
29
29
  Server:
30
30
  - Google Frontend
31
31
  Cache-Control:
32
32
  - private
33
33
  Alt-Svc:
34
- - quic=":443"; p="1"; ma=604800
34
+ - quic=":443"; ma=2592000; v="35,34,33,32,31,30,29,28,27,26,25"
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
40
- time skew. User will be excluded from analytics."}}]}'
39
+ string: '{"response":[{"success":true}]}'
41
40
  http_version:
42
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
43
- recorded_with: VCR 2.9.3
41
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
42
+ recorded_with: VCR 3.0.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data":[{"userId":123456,"action":"setUserAttributes","userAttributes":{"first_name":"Mike","last_name":"Jones","gender":"m","email":"still_tippin@test.com","create_date":"2010-01-01"}}]}'
@@ -25,13 +25,13 @@ http_interactions:
25
25
  Content-Type:
26
26
  - application/json
27
27
  Date:
28
- - Wed, 04 Nov 2015 20:50:02 GMT
28
+ - Fri, 01 Jul 2016 14:47:49 GMT
29
29
  Server:
30
30
  - Google Frontend
31
31
  Cache-Control:
32
32
  - private
33
33
  Alt-Svc:
34
- - quic=":443"; p="1"; ma=604800
34
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  body:
@@ -39,5 +39,5 @@ http_interactions:
39
39
  string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
40
40
  time skew. User will be excluded from analytics."}}]}'
41
41
  http_version:
42
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
43
- recorded_with: VCR 2.9.3
42
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_with: VCR 3.0.3
@@ -2,11 +2,11 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"data":[{"action":"track","event":"purchase","userId":12345,"time":"1439337600","params":{"some_timestamp":"2015-05-01
9
- 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439337000"}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1439352000","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439351400"}]}'
10
10
  headers:
11
11
  User-Agent:
12
12
  - Faraday v0.9.2
@@ -26,20 +26,20 @@ http_interactions:
26
26
  Content-Type:
27
27
  - application/json
28
28
  Date:
29
- - Wed, 04 Nov 2015 21:50:11 GMT
29
+ - Fri, 01 Jul 2016 14:47:50 GMT
30
30
  Server:
31
31
  - Google Frontend
32
32
  Cache-Control:
33
33
  - private
34
34
  Alt-Svc:
35
- - quic=":443"; p="1"; ma=604800
35
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
36
  Transfer-Encoding:
37
37
  - chunked
38
38
  body:
39
39
  encoding: UTF-8
40
40
  string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Anomaly
41
- detected: time skew. User will be excluded from analytics."}},{"success":true,"warning":{"message":"Anomaly
41
+ detected: time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
42
42
  detected: time skew. User will be excluded from analytics."}}]}'
43
- http_version:
44
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
45
- recorded_with: VCR 2.9.3
43
+ http_version:
44
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
45
+ recorded_with: VCR 3.0.3
@@ -2,11 +2,11 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"data":[{"userId":123456,"action":"setUserAttributes","userAttributes":{"first_name":"Mike","last_name":"Jones","gender":"m","email":"still_tippin@test.com","create_date":"2010-01-01"}},{"action":"track","event":"purchase","userId":12345,"time":"1439337600","params":{"some_timestamp":"2015-05-01
9
- 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439337000"}]}'
8
+ string: '{"data":[{"userId":123456,"action":"setUserAttributes","userAttributes":{"first_name":"Mike","last_name":"Jones","gender":"m","email":"still_tippin@test.com","create_date":"2010-01-01"}},{"action":"track","event":"purchase","userId":123456,"time":"1439352000","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439351400"}]}'
10
10
  headers:
11
11
  User-Agent:
12
12
  - Faraday v0.9.2
@@ -26,21 +26,21 @@ http_interactions:
26
26
  Content-Type:
27
27
  - application/json
28
28
  Date:
29
- - Wed, 04 Nov 2015 20:50:05 GMT
29
+ - Fri, 01 Jul 2016 14:47:51 GMT
30
30
  Server:
31
31
  - Google Frontend
32
32
  Cache-Control:
33
33
  - private
34
34
  Alt-Svc:
35
- - quic=":443"; p="1"; ma=604800
35
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
36
  Transfer-Encoding:
37
37
  - chunked
38
38
  body:
39
39
  encoding: UTF-8
40
- string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Anomaly
41
- detected: time skew. User will be excluded from analytics."}},{"success":true,"warning":{"message":"Anomaly
42
- detected: time skew. User will be excluded from analytics."}},{"success":true,"warning":{"message":"Anomaly
40
+ string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
41
+ time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
42
+ detected: time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
43
43
  detected: time skew. User will be excluded from analytics."}}]}'
44
- http_version:
45
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
46
- recorded_with: VCR 2.9.3
44
+ http_version:
45
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
46
+ recorded_with: VCR 3.0.3
@@ -2,11 +2,11 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"data":[{"action":"track","event":"purchase","userId":12345,"time":"1439337600","params":{"some_timestamp":"2015-05-01
9
- 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439337000"}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1439352000","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439351400"}]}'
10
10
  headers:
11
11
  User-Agent:
12
12
  - Faraday v0.9.2
@@ -26,28 +26,28 @@ http_interactions:
26
26
  Content-Type:
27
27
  - application/json
28
28
  Date:
29
- - Thu, 05 Nov 2015 07:53:30 GMT
29
+ - Fri, 01 Jul 2016 14:47:51 GMT
30
30
  Server:
31
31
  - Google Frontend
32
32
  Cache-Control:
33
33
  - private
34
34
  Alt-Svc:
35
- - quic=":443"; p="1"; ma=604800
35
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
36
  Transfer-Encoding:
37
37
  - chunked
38
38
  body:
39
39
  encoding: UTF-8
40
40
  string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Anomaly
41
- detected: time skew. User will be excluded from analytics."}},{"success":true,"warning":{"message":"Anomaly
41
+ detected: time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
42
42
  detected: time skew. User will be excluded from analytics."}}]}'
43
- http_version:
44
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
43
+ http_version:
44
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
45
45
  - request:
46
46
  method: post
47
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1439337600
47
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1439352000
48
48
  body:
49
49
  encoding: UTF-8
50
- string: '{"data":[{"action":"setUserAttributes","resetAnomalies":true,"userId":12345},{"action":"setUserAttributes","resetAnomalies":true,"userId":54321}]}'
50
+ string: '{"data":[{"action":"setUserAttributes","resetAnomalies":true,"userId":123456},{"action":"setUserAttributes","resetAnomalies":true,"userId":54321}]}'
51
51
  headers:
52
52
  User-Agent:
53
53
  - Faraday v0.9.2
@@ -67,20 +67,18 @@ http_interactions:
67
67
  Content-Type:
68
68
  - application/json
69
69
  Date:
70
- - Thu, 05 Nov 2015 07:53:30 GMT
70
+ - Fri, 01 Jul 2016 14:47:51 GMT
71
71
  Server:
72
72
  - Google Frontend
73
73
  Cache-Control:
74
74
  - private
75
75
  Alt-Svc:
76
- - quic=":443"; p="1"; ma=604800
76
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
77
77
  Transfer-Encoding:
78
78
  - chunked
79
79
  body:
80
80
  encoding: UTF-8
81
- string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
82
- time skew. User will be excluded from analytics."}},{"success":true,"warning":{"message":"Anomaly
83
- detected: time skew. User will be excluded from analytics."}}]}'
84
- http_version:
85
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
86
- recorded_with: VCR 2.9.3
81
+ string: '{"response":[{"success":true},{"success":true}]}'
82
+ http_version:
83
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
84
+ recorded_with: VCR 3.0.3
@@ -2,14 +2,16 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439337600
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1439352000
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"data":[{"action":"track","event":"purchase","userId":12345,"time":"1439337600","allowOffline":true,"params":{"some_timestamp":"2015-05-01
9
- 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439337000","allowOffline":true}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1439352000","allowOffline":true,"params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1439351400","allowOffline":true}]}'
10
10
  headers:
11
11
  User-Agent:
12
12
  - Faraday v0.9.2
13
+ Content-Type:
14
+ - application/json
13
15
  Accept-Encoding:
14
16
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
15
17
  Accept:
@@ -24,20 +26,20 @@ http_interactions:
24
26
  Content-Type:
25
27
  - application/json
26
28
  Date:
27
- - Thu, 28 Jan 2016 14:24:39 GMT
29
+ - Fri, 01 Jul 2016 14:47:50 GMT
28
30
  Server:
29
31
  - Google Frontend
30
32
  Cache-Control:
31
33
  - private
32
34
  Alt-Svc:
33
- - quic=":443"; ma=604800; v="30,29,28,27,26,25"
35
+ - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
34
36
  Transfer-Encoding:
35
37
  - chunked
36
38
  body:
37
39
  encoding: UTF-8
38
- string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
39
- time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
40
+ string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Anomaly
41
+ detected: time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
40
42
  detected: time skew. User will be excluded from analytics."}}]}'
41
43
  http_version:
42
- recorded_at: Wed, 12 Aug 2015 00:00:00 GMT
43
- recorded_with: VCR 2.9.3
44
+ recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
45
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leanplum_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lumos Labs, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: awesome_print
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -118,30 +124,30 @@ dependencies:
118
124
  name: vcr
119
125
  requirement: !ruby/object:Gem::Requirement
120
126
  requirements:
121
- - - "~>"
127
+ - - ">"
122
128
  - !ruby/object:Gem::Version
123
129
  version: '2'
124
130
  type: :development
125
131
  prerelease: false
126
132
  version_requirements: !ruby/object:Gem::Requirement
127
133
  requirements:
128
- - - "~>"
134
+ - - ">"
129
135
  - !ruby/object:Gem::Version
130
136
  version: '2'
131
137
  - !ruby/object:Gem::Dependency
132
138
  name: webmock
133
139
  requirement: !ruby/object:Gem::Requirement
134
140
  requirements:
135
- - - "~>"
141
+ - - ">"
136
142
  - !ruby/object:Gem::Version
137
- version: '1'
143
+ version: '2'
138
144
  type: :development
139
145
  prerelease: false
140
146
  version_requirements: !ruby/object:Gem::Requirement
141
147
  requirements:
142
- - - "~>"
148
+ - - ">"
143
149
  - !ruby/object:Gem::Version
144
- version: '1'
150
+ version: '2'
145
151
  description: Ruby-esque access to Leanplum API
146
152
  email:
147
153
  - analytics-dev@lumoslabs.com