leanplum_api 3.0.2 → 3.0.3

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
  SHA1:
3
- metadata.gz: 0c7a269a442739ed3de7ce55113e6c811d559fb5
4
- data.tar.gz: 5c88e058755a2e71e6560daa8cfcb4fcb252fea5
3
+ metadata.gz: 981ece28774e6f0627530dc0410181d5eeb52522
4
+ data.tar.gz: dcaf55c062c0a533973f1a3f8e0118542d8ed3ea
5
5
  SHA512:
6
- metadata.gz: 7823628353da613c0730d17e096e0473c15921fdd8d24a060fdb8b79c145ca4c7db267a43f3afac9ea1a0489c42e63be5d6da06b851de5f7368c9a4819e8f380
7
- data.tar.gz: 486e871d455d2bb514b259efb243d19b33e7b772d4f1efd9ddec23d2bb906b8113f3e0c8a3b80ab52db495891244e2f7172d96f6bb2d0c287dfc4626dfc3e282
6
+ metadata.gz: aa4dbf8587246f8a4b6cd6f18e5c7ffd6f3737a72358386131572a1f59fe50997d07d881bfd077f4c274a23945c96f4f6a5c3403a1c475672f1f39b7eaafa057
7
+ data.tar.gz: 5e6836dc8850193e3a1313de6bf1db2a2eeeca8fd49fdc6801482548d14ce2aac518b8efc1683d91f52e6149a14d0f380538be4f25b3923e37a53bec1558cfa5
data/README.md CHANGED
@@ -66,7 +66,7 @@ attribute_hash = {
66
66
  }
67
67
  api.set_user_attributes(attribute_hash)
68
68
 
69
- # You must also provide the :event property for event tracking.
69
+ # You must also provide the :event property for event tracking.
70
70
  ## :info is an optional property for an extra string.
71
71
  ## You can optionally provide a :time; if it is not set Leanplum will timestamp the event "now".
72
72
  ## All other key/values besides :user_id, :device_id, :event, and :time will be sent as event params.
@@ -96,7 +96,7 @@ api.track_events(event, force_anomalous_override: true)
96
96
  ```ruby
97
97
  api = LeanplumApi::API.new
98
98
  job_id = api.export_data(start_time, end_time)
99
- response = wait_for_job(job_id)
99
+ response = wait_for_export_job(job_id)
100
100
  ```
101
101
 
102
102
  **Note well that Leanplum now officially recommends use of the automated S3 export instead of API based export.** According to a Leanplum engineer these two data export methodologies are completely independent data paths and in our experience we have found API based data export to be missing 10-15% of the data that is eventually returned by the automated export.
@@ -110,8 +110,8 @@ To write _new_ specs (or regenerate one of [VCR](https://github.com/vcr/vcr)'s Y
110
110
  > BE AWARE THAT IF YOU WRITE A NEW SPEC OR DELETE A VCR FILE, IT'S POSSIBLE THAT REAL DATA WILL BE WRITTEN TO THE `LEANPLUM_APP_ID` YOU CONFIGURE! Certainly a real request will be made to rebuild the VCR file, and while specs run with ```devMode=true```, it's usually a good idea to create a fake app for testing/running specs against.
111
111
 
112
112
  ```bash
113
- export LEANPLUM_PRODUCTION_KEY=dev_somethingsomeg123456
114
113
  export LEANPLUM_APP_ID=app_somethingsomething2039410238
114
+ export LEANPLUM_PRODUCTION_KEY=dev_somethingsomeg123456
115
115
  export LEANPLUM_DATA_EXPORT_KEY=data_something_3238mmmX
116
116
  export LEANPLUM_CONTENT_READ_ONLY_KEY=sometingsome23xx9
117
117
  export LEANPLUM_DEVELOPMENT_KEY=sometingsome23xx923n23i
@@ -1,11 +1,13 @@
1
1
  module LeanplumApi
2
2
  class API
3
+ extend Gem::Deprecate
4
+
5
+ class LeanplumValidationException < RuntimeError; end
6
+
3
7
  EXPORT_PENDING = 'PENDING'
4
8
  EXPORT_RUNNING = 'RUNNING'
5
9
  EXPORT_FINISHED = 'FINISHED'
6
10
 
7
- class LeanplumValidationException < RuntimeError; end
8
-
9
11
  def initialize(options = {})
10
12
  fail 'LeanplumApi not configured yet!' unless LeanplumApi.configuration
11
13
  end
@@ -18,24 +20,21 @@ module LeanplumApi
18
20
  track_multi(events, nil, options)
19
21
  end
20
22
 
21
- # This method is for tracking events and/or updating user attributes at the same time, batched together like leanplum
22
- # recommends.
23
- # Set the :force_anomalous_override to catch warnings from leanplum about anomalous events and force them to not
24
- # be considered anomalous
23
+ # This method is for tracking events and/or updating user attributes at the same time, batched together like
24
+ # leanplum recommends.
25
+ # Set the :force_anomalous_override option to catch warnings from leanplum about anomalous events and force them to
26
+ # not be considered anomalous.
25
27
  def track_multi(events = nil, user_attributes = nil, options = {})
26
- events = Array.wrap(events)
27
- user_attributes = Array.wrap(user_attributes)
28
-
29
- request_data = user_attributes.map { |h| build_user_attributes_hash(h) }
30
- request_data += events.map { |h| build_event_attributes_hash(h, options) }
28
+ request_data = Array.wrap(user_attributes).map { |h| build_user_attributes_hash(h) } +
29
+ Array.wrap(events).map { |h| build_event_attributes_hash(h, options) }
31
30
  response = production_connection.multi(request_data).body['response']
32
31
 
33
32
  if options[:force_anomalous_override]
34
33
  user_ids_to_reset = []
35
34
  response.each_with_index do |indicator, i|
36
35
  # Leanplum's engineering team likes to break their API and or change stuff without warning (often)
37
- # and has no idea what "versioning" actually means, so we just reset
38
- # everyone all the time. This condition should be:
36
+ # and has no idea what "versioning" actually means, so we just reset everyone all the time.
37
+ # This condition should be:
39
38
  # if indicator['warning'] && indicator['warning']['message'] =~ /Past event detected/i
40
39
  #
41
40
  # but it has to be:
@@ -98,6 +97,7 @@ module LeanplumApi
98
97
 
99
98
  def get_export_results(job_id)
100
99
  response = data_export_connection.get(action: 'getExportResults', jobId: job_id).body['response'].first
100
+
101
101
  if response['state'] == EXPORT_FINISHED
102
102
  LeanplumApi.configuration.logger.info("Export finished.")
103
103
  LeanplumApi.configuration.logger.debug(" Response: #{response}")
@@ -113,7 +113,7 @@ module LeanplumApi
113
113
  end
114
114
  end
115
115
 
116
- def wait_for_job(job_id, polling_interval = 60)
116
+ def wait_for_export_job(job_id, polling_interval = 60)
117
117
  while get_export_results(job_id)[:state] != EXPORT_FINISHED
118
118
  LeanplumApi.configuration.logger.debug("Polling job #{job_id}: #{get_export_results(job_id)}")
119
119
  sleep(polling_interval)
@@ -121,6 +121,12 @@ module LeanplumApi
121
121
  get_export_results(job_id)
122
122
  end
123
123
 
124
+ # Remove in version 4.x
125
+ def wait_for_job(job_id, polling_interval = 60)
126
+ wait_for_export_job(job_id, polling_interval)
127
+ end
128
+ deprecate :wait_for_job, 'wait_for_export_job', 2018, 6
129
+
124
130
  def user_attributes(user_id)
125
131
  export_user(user_id)['userAttributes'].inject({}) do |attrs, (k, v)|
126
132
  # Leanplum doesn't use true JSON for booleans...
@@ -181,21 +187,25 @@ module LeanplumApi
181
187
  private
182
188
 
183
189
  def production_connection
184
- @production ||= Connection::Production.new
190
+ fail "production_key not configured!" unless LeanplumApi.configuration.production_key
191
+ @production ||= Connection.new(LeanplumApi.configuration.production_key)
185
192
  end
186
193
 
187
194
  # Only instantiated for data export endpoint calls
188
195
  def data_export_connection
189
- @data_export ||= Connection::DataExport.new
196
+ fail "data_export_key not configured!" unless LeanplumApi.configuration.data_export_key
197
+ @data_export ||= Connection.new(LeanplumApi.configuration.data_export_key)
190
198
  end
191
199
 
192
200
  # Only instantiated for ContentReadOnly calls (AB tests)
193
201
  def content_read_only_connection
194
- @content_read_only ||= Connection::ContentReadOnly.new
202
+ fail "content_read_only_key not configured!" unless LeanplumApi.configuration.content_read_only_key
203
+ @content_read_only ||= Connection.new(LeanplumApi.configuration.content_read_only_key)
195
204
  end
196
205
 
197
206
  def development_connection
198
- @development ||= Connection::Development.new
207
+ fail "development_key not configured!" unless LeanplumApi.configuration.development_key
208
+ @development ||= Connection.new(LeanplumApi.configuration.development_key)
199
209
  end
200
210
 
201
211
  # Deletes the user_id and device_id key/value pairs from the hash parameter.
@@ -1,19 +1,19 @@
1
1
  module LeanplumApi
2
2
  class << self
3
3
  attr_accessor :configuration
4
- end
5
4
 
6
- def self.configure
7
- self.configuration ||= Configuration.new
8
- yield(configuration) if block_given?
9
- end
5
+ def configure
6
+ self.configuration ||= Configuration.new
7
+ yield(configuration) if block_given?
8
+ end
10
9
 
11
- def self.reset!
12
- self.configuration = Configuration.new
10
+ def reset!
11
+ self.configuration = Configuration.new
12
+ end
13
13
  end
14
14
 
15
15
  class Configuration
16
- DEFAULT_LEANPLUM_API_VERSION = '1.0.6'
16
+ DEFAULT_LEANPLUM_API_VERSION = '1.0.6'.freeze
17
17
 
18
18
  # Required IDs and access keys provided by leanplum
19
19
  attr_accessor :app_id
@@ -1,9 +1,13 @@
1
- module LeanplumApi::Connection
2
- class Production
3
- LEANPLUM_API_PATH = '/api'
1
+ module LeanplumApi
2
+ class Connection
3
+ LEANPLUM_API_PATH = '/api'.freeze
4
4
 
5
- def initialize(options = {})
6
- @logger = options[:logger] || Logger.new(STDERR)
5
+ def initialize(client_key)
6
+ @client_key = client_key
7
+ end
8
+
9
+ def get(query)
10
+ connection.get(LEANPLUM_API_PATH, query.merge(authentication_params))
7
11
  end
8
12
 
9
13
  def multi(payload)
@@ -12,24 +16,19 @@ module LeanplumApi::Connection
12
16
  end
13
17
  end
14
18
 
15
- def get(query)
16
- connection.get(LEANPLUM_API_PATH, query.merge(authentication_params))
17
- end
19
+ private
18
20
 
19
21
  def authentication_params
20
22
  {
21
23
  appId: LeanplumApi.configuration.app_id,
22
- clientKey: LeanplumApi.configuration.production_key,
24
+ clientKey: @client_key,
23
25
  apiVersion: LeanplumApi.configuration.api_version,
24
26
  devMode: LeanplumApi.configuration.developer_mode
25
27
  }
26
28
  end
27
29
 
28
- private
29
-
30
30
  def connection
31
31
  fail 'APP_ID not configured!' unless LeanplumApi.configuration.app_id
32
- fail 'PRODUCTION_KEY not configured!' unless LeanplumApi.configuration.production_key
33
32
 
34
33
  options = {
35
34
  url: 'https://www.leanplum.com',
@@ -43,7 +42,7 @@ module LeanplumApi::Connection
43
42
  connection.request :leanplum_response_validation
44
43
  connection.request :json
45
44
 
46
- connection.response :logger, @logger, bodies: true if LeanplumApi.configuration.api_debug
45
+ connection.response :logger, LeanplumApi.configuration.logger, bodies: true if LeanplumApi.configuration.api_debug
47
46
  connection.response :json, :content_type => /\bjson$/
48
47
 
49
48
  connection.adapter Faraday.default_adapter
@@ -18,6 +18,7 @@ module LeanplumApi
18
18
  fail BadResponseError, response.inspect unless response.status == 200 && response.body['response']
19
19
  fail BadResponseError, "No :success key in #{response.inspect}!" unless response.body['response'].is_a?(Array) && response.body['response'].first.has_key?('success')
20
20
  fail BadResponseError, "Not a success! Response: #{response.inspect}" unless response.body['response'].first['success'] == true
21
+
21
22
  validate_operation_success(operations, response) if operations
22
23
  end
23
24
  end
@@ -1,3 +1,3 @@
1
1
  module LeanplumApi
2
- VERSION = '3.0.2'
2
+ VERSION = '3.0.3'
3
3
  end
data/spec/api_spec.rb CHANGED
@@ -156,7 +156,7 @@ describe LeanplumApi::API do
156
156
  context 'user_events' do
157
157
  it 'should get user events for this user' do
158
158
  VCR.use_cassette('export_user') do
159
- expect(api.user_events(first_user_id)[purchase].keys).to eq(['count'])
159
+ expect(api.user_events(first_user_id)[purchase].keys).to eq(['firstTime', 'count', 'lastTime'])
160
160
  end
161
161
  end
162
162
  end
@@ -171,25 +171,17 @@ describe LeanplumApi::API do
171
171
  end
172
172
 
173
173
  context 'data export methods' do
174
- around(:all) do |example|
175
- LeanplumApi.configure do |c|
176
- c.developer_mode = false
177
- end
178
- example.run
179
- LeanplumApi.configure { |c| c.developer_mode = true }
180
- end
181
-
182
174
  context 'export_data' do
183
175
  context 'regular export' do
184
176
  it 'should request a data export job with a starttime' do
185
177
  VCR.use_cassette('export_data') do
186
- expect { api.export_data(Time.at(1438660800).utc) }.to raise_error LeanplumApi::ResourceNotFoundError
178
+ expect { api.export_data(Time.at(1438660800).utc) }.to raise_error LeanplumApi::BadResponseError
187
179
  end
188
180
  end
189
181
 
190
182
  it 'should request a data export job with start and end dates' do
191
183
  VCR.use_cassette('export_data_dates') do
192
- expect { api.export_data(Date.new(2015, 9, 5), Date.new(2015, 9, 6)) }.to raise_error LeanplumApi::ResourceNotFoundError
184
+ expect { api.export_data(Date.new(2017, 8, 5), Date.new(2017, 8, 6)) }.to_not raise_error
193
185
  end
194
186
  end
195
187
  end
@@ -8,33 +8,38 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
15
  - "*/*"
16
16
  response:
17
17
  status:
18
- code: 404
19
- message: Not Found
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - e87e99bf7869f537a17983d4c3779707
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxDoAyCtl9jMBQ; expires=Tue, 06-Oct-2020 17:33:33 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:52 GMT
30
+ - Thu, 17 Aug 2017 21:33:33 GMT
27
31
  Server:
28
32
  - Google Frontend
33
+ Content-Length:
34
+ - '96'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:33 GMT
29
37
  Cache-Control:
30
38
  - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
35
39
  body:
36
40
  encoding: UTF-8
37
- string: '{"response":[{"error":{"message":"No matching data found."},"success":false}]}'
41
+ string: '{"response":[{"error":{"message":"You cannot export data older than
42
+ 60 days"},"success":false}]}'
38
43
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
44
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
45
  recorded_with: VCR 3.0.3
@@ -2,39 +2,43 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://www.leanplum.com/api?action=exportData&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DATA_EXPORT_KEY>&devMode=false&endDate=20150906&startDate=20150905
5
+ uri: https://www.leanplum.com/api?action=exportData&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DATA_EXPORT_KEY>&devMode=false&endDate=20170806&startDate=20170805
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
15
15
  - "*/*"
16
16
  response:
17
17
  status:
18
- code: 404
19
- message: Not Found
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - 8184014402cee4aaa004b8db0c7fa518
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxD-BCCul9jMBQ; expires=Tue, 06-Oct-2020 17:33:34 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:53 GMT
30
+ - Thu, 17 Aug 2017 21:33:34 GMT
27
31
  Server:
28
32
  - Google Frontend
33
+ Content-Length:
34
+ - '85'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:34 GMT
29
37
  Cache-Control:
30
38
  - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
35
39
  body:
36
40
  encoding: UTF-8
37
- string: '{"response":[{"error":{"message":"No matching data found."},"success":false}]}'
41
+ string: '{"response":[{"jobId":"export_4727756026281984_1504277415450767360","success":true}]}'
38
42
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.10.0
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,22 +21,24 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
25
  X-Cloud-Trace-Context:
26
- - b7ed8a2d93f600276bf6f09eddff4c8c
26
+ - 821f167b9c66879b30679054f7b7b692
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxCUBSCpl9jMBQ; expires=Tue, 06-Oct-2020 17:33:29 GMT; path=/
27
29
  Date:
28
- - Tue, 15 Nov 2016 10:32:36 GMT
30
+ - Thu, 17 Aug 2017 21:33:29 GMT
29
31
  Server:
30
32
  - Google Frontend
31
33
  Content-Length:
32
- - '303'
34
+ - '454'
33
35
  Expires:
34
- - Tue, 15 Nov 2016 10:32:36 GMT
36
+ - Thu, 17 Aug 2017 21:33:29 GMT
35
37
  Cache-Control:
36
38
  - private
37
39
  body:
38
40
  encoding: UTF-8
39
- string: '{"response":[{"totalSessions":0,"created":1.43935302887E9,"events":{"purchase":{"count":24}},"lastActive":1.446709787966E9,"states":{},"success":true,"userAttributes":{"first_name":"Mike","create_date":"2010-01-01","email":"still_tippin@test.com","last_name":"Jones","is_tipping":"True","gender":"m"}}]}'
40
- http_version:
41
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
41
+ string: '{"response":[{"totalSessions":0,"created":1.43935302887E9,"events":{"purchase":{"firstTime":1.460514593026E9,"count":36,"lastTime":1.503005506018E9}},"unsubscribeChannels":[],"userId":"123456","lastActive":1.446709787966E9,"states":{},"userBucket":358,"devices":[],"success":true,"userAttributes":{"first_name":"Mike","create_date":"2010-01-01","email":"still_tippin@test.com","last_name":"Jones","gender":"m","is_tipping":"True"},"timeSpentInApp":0.0}]}'
42
+ http_version:
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
42
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,20 +21,24 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - 255c8fa75fc030d09d96ef436bfecbb2
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxDkBCCwl9jMBQ; expires=Tue, 06-Oct-2020 17:33:36 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:54 GMT
30
+ - Thu, 17 Aug 2017 21:33:36 GMT
27
31
  Server:
28
32
  - Google Frontend
33
+ Content-Length:
34
+ - '44'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:36 GMT
29
37
  Cache-Control:
30
38
  - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
35
39
  body:
36
40
  encoding: UTF-8
37
41
  string: '{"response":[{"abTests":[],"success":true}]}'
38
42
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,20 +21,24 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - e6ae12b1a7b12094b3d4ae7f38fc28bf
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxCkAyCwl9jMBQ; expires=Tue, 06-Oct-2020 17:33:36 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:54 GMT
30
+ - Thu, 17 Aug 2017 21:33:36 GMT
27
31
  Server:
28
32
  - Google Frontend
33
+ Content-Length:
34
+ - '44'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:36 GMT
29
37
  Cache-Control:
30
38
  - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
35
39
  body:
36
40
  encoding: UTF-8
37
41
  string: '{"response":[{"abTests":[],"success":true}]}'
38
42
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,20 +21,24 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - 99791af56ed96a2e814f36bba5e43e5c
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxC5ASCvl9jMBQ; expires=Tue, 06-Oct-2020 17:33:35 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:53 GMT
30
+ - Thu, 17 Aug 2017 21:33:35 GMT
27
31
  Server:
28
32
  - Google Frontend
33
+ Content-Length:
34
+ - '268'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:35 GMT
29
37
  Cache-Control:
30
38
  - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
35
39
  body:
36
40
  encoding: UTF-8
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}]}'
41
+ 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
42
  http_version:
39
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,23 +21,25 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
25
  X-Cloud-Trace-Context:
26
- - 12a07ad33968771fe966d66789f04e87
26
+ - 2be9d7df703848967473640cd9e1ed4b
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxDkAyCxl9jMBQ; expires=Tue, 06-Oct-2020 17:33:37 GMT; path=/
27
29
  Date:
28
- - Fri, 01 Jul 2016 14:47:55 GMT
30
+ - Thu, 17 Aug 2017 21:33:37 GMT
29
31
  Server:
30
32
  - Google Frontend
33
+ Content-Length:
34
+ - '165'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:37 GMT
31
37
  Cache-Control:
32
38
  - private
33
- Alt-Svc:
34
- - quic=":443"; ma=2592000; v="35,34,33,32,31,30,29,28,27,26,25"
35
- Transfer-Encoding:
36
- - chunked
37
39
  body:
38
40
  encoding: UTF-8
39
41
  string: '{"response":[{"success":true,"messages":[{"id":5670583287676928,"created":1.440091595799E9,"name":"New
40
42
  Message","active":false,"messageType":"Push Notification"}]}]}'
41
43
  http_version:
42
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
44
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
43
45
  recorded_with: VCR 3.0.3
@@ -1,45 +1,5 @@
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
43
3
  - request:
44
4
  method: get
45
5
  uri: https://www.leanplum.com/api?action=getVars&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&userId=123456
@@ -48,7 +8,7 @@ http_interactions:
48
8
  string: ''
49
9
  headers:
50
10
  User-Agent:
51
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
52
12
  Accept-Encoding:
53
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
54
14
  Accept:
@@ -61,20 +21,24 @@ http_interactions:
61
21
  Access-Control-Allow-Origin:
62
22
  - "*"
63
23
  Content-Type:
64
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - d92d025319adee1119428bcc10cfe581
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxD7ASCvl9jMBQ; expires=Tue, 06-Oct-2020 17:33:35 GMT; path=/
65
29
  Date:
66
- - Fri, 01 Jul 2016 14:59:30 GMT
30
+ - Thu, 17 Aug 2017 21:33:35 GMT
67
31
  Server:
68
32
  - Google Frontend
33
+ Content-Length:
34
+ - '123'
35
+ Expires:
36
+ - Thu, 17 Aug 2017 21:33:35 GMT
69
37
  Cache-Control:
70
38
  - private
71
- Alt-Svc:
72
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
73
- Transfer-Encoding:
74
- - chunked
75
39
  body:
76
40
  encoding: UTF-8
77
- string: '{"response":[{"vars":{},"interfaceRules":[],"variants":[],"eventRules":[],"regions":{},"success":true,"messages":{}}]}'
41
+ string: '{"response":[{"vars":{},"interfaceRules":[],"variants":[],"regions":{},"success":true,"messages":{},"interfaceEvents":[]}]}'
78
42
  http_version:
79
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
80
44
  recorded_with: VCR 3.0.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Accept-Encoding:
13
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
14
  Accept:
@@ -21,20 +21,20 @@ http_interactions:
21
21
  Access-Control-Allow-Origin:
22
22
  - "*"
23
23
  Content-Type:
24
- - application/json
24
+ - application/json; charset=UTF-8
25
+ X-Cloud-Trace-Context:
26
+ - 7da0e833b34df34c9cd2b6e4a31eb65c
27
+ Set-Cookie:
28
+ - GOOGAPPUID=xCgsIAxDkBiCxl9jMBQ; expires=Tue, 06-Oct-2020 17:33:37 GMT; path=/
25
29
  Date:
26
- - Fri, 01 Jul 2016 14:47:55 GMT
30
+ - Thu, 17 Aug 2017 21:33:37 GMT
27
31
  Server:
28
32
  - Google Frontend
29
- Cache-Control:
30
- - private
31
- Alt-Svc:
32
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
33
- Transfer-Encoding:
34
- - chunked
33
+ Content-Length:
34
+ - '73'
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 04:00:00 GMT
39
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
40
40
  recorded_with: VCR 3.0.3
@@ -2,13 +2,13 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1502510400
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"data":[{"action":"setUserAttributes","resetAnomalies":true,"userId":123456}]}'
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.9.2
11
+ - Faraday v0.12.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  Accept-Encoding:
@@ -23,20 +23,24 @@ http_interactions:
23
23
  Access-Control-Allow-Origin:
24
24
  - "*"
25
25
  Content-Type:
26
- - application/json
26
+ - application/json; charset=UTF-8
27
+ X-Cloud-Trace-Context:
28
+ - d7ebf4fc0c3a18f67ee55f88e5d57ebf
29
+ Set-Cookie:
30
+ - GOOGAPPUID=xCgsIAxDFASCql9jMBQ; expires=Tue, 06-Oct-2020 17:33:30 GMT; path=/
27
31
  Date:
28
- - Fri, 01 Jul 2016 14:47:50 GMT
32
+ - Thu, 17 Aug 2017 21:33:30 GMT
29
33
  Server:
30
34
  - Google Frontend
35
+ Content-Length:
36
+ - '31'
37
+ Expires:
38
+ - Thu, 17 Aug 2017 21:33:30 GMT
31
39
  Cache-Control:
32
40
  - private
33
- Alt-Svc:
34
- - quic=":443"; ma=2592000; v="35,34,33,32,31,30,29,28,27,26,25"
35
- Transfer-Encoding:
36
- - chunked
37
41
  body:
38
42
  encoding: UTF-8
39
43
  string: '{"response":[{"success":true}]}'
40
44
  http_version:
41
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
45
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
42
46
  recorded_with: VCR 3.0.3
@@ -2,13 +2,13 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1502510400
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","is_tipping":true}}]}'
9
9
  headers:
10
10
  User-Agent:
11
- - Faraday v0.10.0
11
+ - Faraday v0.12.1
12
12
  Content-Type:
13
13
  - application/json
14
14
  Accept-Encoding:
@@ -23,23 +23,25 @@ http_interactions:
23
23
  Access-Control-Allow-Origin:
24
24
  - "*"
25
25
  Content-Type:
26
- - application/json
26
+ - application/json; charset=UTF-8
27
27
  X-Cloud-Trace-Context:
28
- - be84cbe23b33980fe7159ca706386efb
28
+ - 40f001f15ccddf7fe56b8794e359ed7f
29
+ Set-Cookie:
30
+ - GOOGAPPUID=xCgoIAxA0IKiX2MwF; expires=Tue, 06-Oct-2020 17:33:29 GMT; path=/
29
31
  Date:
30
- - Tue, 15 Nov 2016 10:28:11 GMT
32
+ - Thu, 17 Aug 2017 21:33:29 GMT
31
33
  Server:
32
34
  - Google Frontend
33
35
  Content-Length:
34
- - '122'
36
+ - '120'
35
37
  Expires:
36
- - Tue, 15 Nov 2016 10:28:11 GMT
38
+ - Thu, 17 Aug 2017 21:33:29 GMT
37
39
  Cache-Control:
38
40
  - private
39
41
  body:
40
42
  encoding: UTF-8
41
- string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
42
- time skew. User will be excluded from analytics."}}]}'
43
- http_version:
44
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
43
+ string: '{"response":[{"success":true,"warning":{"message":"Device clock skew
44
+ detected (5 days behind). Rewriting timestamp."}}]}'
45
+ http_version:
46
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
45
47
  recorded_with: VCR 3.0.3
@@ -2,14 +2,14 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1502510400
6
6
  body:
7
7
  encoding: UTF-8
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"}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1502510400","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1502509800"}]}'
10
10
  headers:
11
11
  User-Agent:
12
- - Faraday v0.9.2
12
+ - Faraday v0.12.1
13
13
  Content-Type:
14
14
  - application/json
15
15
  Accept-Encoding:
@@ -24,22 +24,26 @@ http_interactions:
24
24
  Access-Control-Allow-Origin:
25
25
  - "*"
26
26
  Content-Type:
27
- - application/json
27
+ - application/json; charset=UTF-8
28
+ X-Cloud-Trace-Context:
29
+ - 666897794060191c1e9d5e8388b81353
30
+ Set-Cookie:
31
+ - GOOGAPPUID=xCgsIAxDcASCql9jMBQ; expires=Tue, 06-Oct-2020 17:33:30 GMT; path=/
28
32
  Date:
29
- - Fri, 01 Jul 2016 14:47:50 GMT
33
+ - Thu, 17 Aug 2017 21:33:30 GMT
30
34
  Server:
31
35
  - Google Frontend
36
+ Content-Length:
37
+ - '260'
38
+ Expires:
39
+ - Thu, 17 Aug 2017 21:33:30 GMT
32
40
  Cache-Control:
33
41
  - private
34
- Alt-Svc:
35
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
- Transfer-Encoding:
37
- - chunked
38
42
  body:
39
43
  encoding: UTF-8
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
42
- detected: time skew. User will be excluded from analytics."}}]}'
44
+ string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Device
45
+ clock skew detected (5 days behind). Rewriting timestamp."}},{"isOffline":true,"success":true,"warning":{"message":"Device
46
+ clock skew detected (5 days behind). Rewriting timestamp."}}]}'
43
47
  http_version:
44
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
48
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
45
49
  recorded_with: VCR 3.0.3
@@ -2,14 +2,14 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1502510400
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","is_tipping":true}},{"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"}]}'
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","is_tipping":true}},{"action":"track","event":"purchase","userId":123456,"time":"1502510400","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1502509800"}]}'
10
10
  headers:
11
11
  User-Agent:
12
- - Faraday v0.10.0
12
+ - Faraday v0.12.1
13
13
  Content-Type:
14
14
  - application/json
15
15
  Accept-Encoding:
@@ -24,25 +24,27 @@ http_interactions:
24
24
  Access-Control-Allow-Origin:
25
25
  - "*"
26
26
  Content-Type:
27
- - application/json
27
+ - application/json; charset=UTF-8
28
28
  X-Cloud-Trace-Context:
29
- - 4a5e92e1cf1088dd41b9caa898272564
29
+ - c07da72319072cbedf834d35a3a8e5d9
30
+ Set-Cookie:
31
+ - GOOGAPPUID=xCgsIAxDTAyCtl9jMBQ; expires=Tue, 06-Oct-2020 17:33:33 GMT; path=/
30
32
  Date:
31
- - Tue, 15 Nov 2016 10:29:45 GMT
33
+ - Thu, 17 Aug 2017 21:33:33 GMT
32
34
  Server:
33
35
  - Google Frontend
34
36
  Content-Length:
35
- - '372'
37
+ - '366'
36
38
  Expires:
37
- - Tue, 15 Nov 2016 10:29:45 GMT
39
+ - Thu, 17 Aug 2017 21:33:33 GMT
38
40
  Cache-Control:
39
41
  - private
40
42
  body:
41
43
  encoding: UTF-8
42
- string: '{"response":[{"success":true,"warning":{"message":"Anomaly detected:
43
- time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
44
- detected: time skew. User will be excluded from analytics."}},{"isOffline":true,"success":true,"warning":{"message":"Anomaly
45
- detected: time skew. User will be excluded from analytics."}}]}'
46
- http_version:
47
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
44
+ string: '{"response":[{"success":true,"warning":{"message":"Device clock skew
45
+ detected (5 days behind). Rewriting timestamp."}},{"isOffline":true,"success":true,"warning":{"message":"Device
46
+ clock skew detected (5 days behind). Rewriting timestamp."}},{"isOffline":true,"success":true,"warning":{"message":"Device
47
+ clock skew detected (5 days behind). Rewriting timestamp."}}]}'
48
+ http_version:
49
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
48
50
  recorded_with: VCR 3.0.3
@@ -2,14 +2,14 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1502510400
6
6
  body:
7
7
  encoding: UTF-8
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"}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1502510400","params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1502509800"}]}'
10
10
  headers:
11
11
  User-Agent:
12
- - Faraday v0.9.2
12
+ - Faraday v0.12.1
13
13
  Content-Type:
14
14
  - application/json
15
15
  Accept-Encoding:
@@ -24,33 +24,37 @@ http_interactions:
24
24
  Access-Control-Allow-Origin:
25
25
  - "*"
26
26
  Content-Type:
27
- - application/json
27
+ - application/json; charset=UTF-8
28
+ X-Cloud-Trace-Context:
29
+ - a90e4c3f6da128e404bdf0b1affc16e0
30
+ Set-Cookie:
31
+ - GOOGAPPUID=xCgsIAxDrBCCrl9jMBQ; expires=Tue, 06-Oct-2020 17:33:31 GMT; path=/
28
32
  Date:
29
- - Fri, 01 Jul 2016 14:47:51 GMT
33
+ - Thu, 17 Aug 2017 21:33:31 GMT
30
34
  Server:
31
35
  - Google Frontend
36
+ Content-Length:
37
+ - '260'
38
+ Expires:
39
+ - Thu, 17 Aug 2017 21:33:31 GMT
32
40
  Cache-Control:
33
41
  - private
34
- Alt-Svc:
35
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
- Transfer-Encoding:
37
- - chunked
38
42
  body:
39
43
  encoding: UTF-8
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
42
- detected: time skew. User will be excluded from analytics."}}]}'
44
+ string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Device
45
+ clock skew detected (5 days behind). Rewriting timestamp."}},{"isOffline":true,"success":true,"warning":{"message":"Device
46
+ clock skew detected (5 days behind). Rewriting timestamp."}}]}'
43
47
  http_version:
44
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
48
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
45
49
  - request:
46
50
  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=1439352000
51
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_DEVELOPMENT_KEY>&devMode=false&time=1502510400
48
52
  body:
49
53
  encoding: UTF-8
50
54
  string: '{"data":[{"action":"setUserAttributes","resetAnomalies":true,"userId":123456},{"action":"setUserAttributes","resetAnomalies":true,"userId":54321}]}'
51
55
  headers:
52
56
  User-Agent:
53
- - Faraday v0.9.2
57
+ - Faraday v0.12.1
54
58
  Content-Type:
55
59
  - application/json
56
60
  Accept-Encoding:
@@ -65,20 +69,24 @@ http_interactions:
65
69
  Access-Control-Allow-Origin:
66
70
  - "*"
67
71
  Content-Type:
68
- - application/json
72
+ - application/json; charset=UTF-8
73
+ X-Cloud-Trace-Context:
74
+ - 8890d27564945450410dd64dd6ac16ce
75
+ Set-Cookie:
76
+ - GOOGAPPUID=xCgsIAxDOByCsl9jMBQ; expires=Tue, 06-Oct-2020 17:33:32 GMT; path=/
69
77
  Date:
70
- - Fri, 01 Jul 2016 14:47:51 GMT
78
+ - Thu, 17 Aug 2017 21:33:32 GMT
71
79
  Server:
72
80
  - Google Frontend
81
+ Content-Length:
82
+ - '48'
83
+ Expires:
84
+ - Thu, 17 Aug 2017 21:33:32 GMT
73
85
  Cache-Control:
74
86
  - private
75
- Alt-Svc:
76
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
77
- Transfer-Encoding:
78
- - chunked
79
87
  body:
80
88
  encoding: UTF-8
81
89
  string: '{"response":[{"success":true},{"success":true}]}'
82
90
  http_version:
83
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
91
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
84
92
  recorded_with: VCR 3.0.3
@@ -2,14 +2,14 @@
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=1439352000
5
+ uri: https://www.leanplum.com/api?action=multi&apiVersion=1.0.6&appId=<LEANPLUM_APP_ID>&clientKey=<LEANPLUM_PRODUCTION_KEY>&devMode=false&time=1502510400
6
6
  body:
7
7
  encoding: UTF-8
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}]}'
8
+ string: '{"data":[{"action":"track","event":"purchase","userId":123456,"time":"1502510400","allowOffline":true,"params":{"some_timestamp":"2015-05-01
9
+ 01:02:03"}},{"action":"track","event":"purchase_page_view","userId":54321,"time":"1502509800","allowOffline":true}]}'
10
10
  headers:
11
11
  User-Agent:
12
- - Faraday v0.9.2
12
+ - Faraday v0.12.1
13
13
  Content-Type:
14
14
  - application/json
15
15
  Accept-Encoding:
@@ -24,22 +24,26 @@ http_interactions:
24
24
  Access-Control-Allow-Origin:
25
25
  - "*"
26
26
  Content-Type:
27
- - application/json
27
+ - application/json; charset=UTF-8
28
+ X-Cloud-Trace-Context:
29
+ - da0211f2f027a6d6521dbbc188cc4764
30
+ Set-Cookie:
31
+ - GOOGAPPUID=xCgoIAxAGIKuX2MwF; expires=Tue, 06-Oct-2020 17:33:31 GMT; path=/
28
32
  Date:
29
- - Fri, 01 Jul 2016 14:47:50 GMT
33
+ - Thu, 17 Aug 2017 21:33:31 GMT
30
34
  Server:
31
35
  - Google Frontend
36
+ Content-Length:
37
+ - '260'
38
+ Expires:
39
+ - Thu, 17 Aug 2017 21:33:31 GMT
32
40
  Cache-Control:
33
41
  - private
34
- Alt-Svc:
35
- - quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25"
36
- Transfer-Encoding:
37
- - chunked
38
42
  body:
39
43
  encoding: UTF-8
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
42
- detected: time skew. User will be excluded from analytics."}}]}'
44
+ string: '{"response":[{"isOffline":true,"success":true,"warning":{"message":"Device
45
+ clock skew detected (5 days behind). Rewriting timestamp."}},{"isOffline":true,"success":true,"warning":{"message":"Device
46
+ clock skew detected (5 days behind). Rewriting timestamp."}}]}'
43
47
  http_version:
44
- recorded_at: Wed, 12 Aug 2015 04:00:00 GMT
48
+ recorded_at: Sat, 12 Aug 2017 04:00:00 GMT
45
49
  recorded_with: VCR 3.0.3
data/spec/http_spec.rb CHANGED
@@ -1,10 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe LeanplumApi::Connection::Production do
3
+ describe LeanplumApi::Connection do
4
+ let(:http) { described_class.new(LeanplumApi.configuration.production_key) }
5
+ def argument_string(dev_mode)
6
+ "appId=#{LeanplumApi.configuration.app_id}&clientKey=#{LeanplumApi.configuration.production_key}&apiVersion=1.0.6&devMode=#{dev_mode}&action=multi&time=#{Time.now.utc.strftime('%s')}"
7
+ end
8
+
4
9
  context 'regular mode' do
5
10
  it 'should build the right multi url' do
6
- http = described_class.new
7
- expect(http.send(:authed_multi_param_string)).to eq("appId=#{LeanplumApi.configuration.app_id}&clientKey=#{LeanplumApi.configuration.production_key}&apiVersion=1.0.6&devMode=false&action=multi&time=#{Time.now.utc.strftime('%s')}")
11
+ expect(http.send(:authed_multi_param_string)).to eq(argument_string(false))
8
12
  end
9
13
  end
10
14
 
@@ -16,8 +20,7 @@ describe LeanplumApi::Connection::Production do
16
20
  end
17
21
 
18
22
  it 'should build the right developer mode url' do
19
- http = described_class.new
20
- expect(http.send(:authed_multi_param_string)).to eq("appId=#{LeanplumApi.configuration.app_id}&clientKey=#{LeanplumApi.configuration.production_key}&apiVersion=1.0.6&devMode=true&action=multi&time=#{Time.now.utc.strftime('%s')}")
23
+ expect(http.send(:authed_multi_param_string)).to eq(argument_string(true))
21
24
  end
22
25
  end
23
26
  end
data/spec/spec_helper.rb CHANGED
@@ -18,7 +18,7 @@ RSpec.configure do |config|
18
18
  end
19
19
 
20
20
  # Leanplum requires passing the time in some requests so we freeze it.
21
- Timecop.freeze('2015-08-12'.to_time.utc)
21
+ Timecop.freeze('2017-08-12'.to_time.utc)
22
22
  end
23
23
  end
24
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leanplum_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
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: 2017-08-16 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -147,10 +147,7 @@ files:
147
147
  - lib/leanplum_api.rb
148
148
  - lib/leanplum_api/api.rb
149
149
  - lib/leanplum_api/configuration.rb
150
- - lib/leanplum_api/connections/content_read_only.rb
151
- - lib/leanplum_api/connections/data_export.rb
152
- - lib/leanplum_api/connections/development.rb
153
- - lib/leanplum_api/connections/production.rb
150
+ - lib/leanplum_api/connection.rb
154
151
  - lib/leanplum_api/faraday_middleware/response_validation.rb
155
152
  - lib/leanplum_api/logger.rb
156
153
  - lib/leanplum_api/version.rb
@@ -1,15 +0,0 @@
1
- require 'leanplum_api/connections/production'
2
-
3
- module LeanplumApi::Connection
4
- class ContentReadOnly < Production
5
- def initialize(options = {})
6
- raise 'Content read only key not configured!' unless LeanplumApi.configuration.content_read_only_key
7
- super
8
- end
9
-
10
- # Data export API requests need to use the Data Export key
11
- def authentication_params
12
- super.merge(clientKey: LeanplumApi.configuration.content_read_only_key)
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- require 'leanplum_api/connections/production'
2
-
3
- module LeanplumApi::Connection
4
- class DataExport < Production
5
- def initialize(options = {})
6
- raise 'Data export key not configured' unless LeanplumApi.configuration.data_export_key
7
- super
8
- end
9
-
10
- # Data export API requests need to use the Data Export key
11
- def authentication_params
12
- super.merge(clientKey: LeanplumApi.configuration.data_export_key)
13
- end
14
- end
15
- end
@@ -1,14 +0,0 @@
1
- require 'leanplum_api/connections/production'
2
-
3
- module LeanplumApi::Connection
4
- class Development < Production
5
- def initialize(options = {})
6
- raise 'Development key not configured!' unless LeanplumApi.configuration.development_key
7
- super
8
- end
9
-
10
- def authentication_params
11
- super.merge(clientKey: LeanplumApi.configuration.development_key)
12
- end
13
- end
14
- end