talon_one 0.1.2 → 0.1.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: be0aa81409b89e297ccc13d905de2740f63107bd
4
- data.tar.gz: ec7e40ff88c7a4eebf2fc055069bc00c4acd6212
3
+ metadata.gz: 68514d0a0f532ebe77dafebc779165ea4e5e54f9
4
+ data.tar.gz: f4feeae056e5f9dd35e317d221e064ddf5ecd512
5
5
  SHA512:
6
- metadata.gz: 461023a4eecc0b42bfbebc2c9b6eb0c3bbeee1507c0e9665972b3b73612dd931b5225b1fee538e84d67cd63c3de5e23c5cc17dd765cccff24ccb4aa36e6abac3
7
- data.tar.gz: 8bc770ef1d1c05a38120e7b5d178100824c8ecfb811c3280b39ae2a11faefe29e790ebe748bf969b0d693b51458be5bcc92ea0711b37b10ff2b430f073dfe6c5
6
+ metadata.gz: f94bf2fc2b3ef0a0fafe5f34326faa65b7a5ae93c08a8c4eb45fd25494c39d61d1891e9e8c62b73768cfdf3765f3a328b85f5e119ac99ddaf0e72ad3bb435de5
7
+ data.tar.gz: f9ad0943f28592fc0f3dd5915476a0aa90395a15c36953437b31fa62f52a004c3937014371aa30150e5a9434fbaddd7a834939f17dc72796b252e97d04b7359d
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  talon_one-*.gem
2
+ .local
2
3
  secrets.yml
3
- Gemfile.lock
4
+ Gemfile.lock
@@ -1,3 +1,7 @@
1
+ # 0.1.3 / 2018-04-27
2
+
3
+ * [FEATURE] delete_customer_data is now exposed on the integration API
4
+
1
5
  # 0.1.2 / 2018-04-27
2
6
 
3
7
  * [FEATURE] event meta-data is now exposed as `event.meta.coupon_data` and `event.meta.campaign_data`
@@ -32,23 +32,25 @@ module TalonOne
32
32
 
33
33
  res = @http.request(req)
34
34
 
35
- if res.code[0] == '2'
35
+ if res.code[0] == '2' && res.code != '204'
36
36
  result.new(Oj.load(res.body, oj_options(:strict)))
37
+ elsif res.code == '204'
38
+ true
37
39
  else
38
40
  raise TalonOne::Integration::ClientError.new("#{method.upcase} #{path} -> #{res.code} #{res.body}")
39
41
  end
40
42
  end
41
43
 
42
44
  def track_event(session_id, event_type, value)
43
- request "Post", "/v1/events", { sessionId: session_id, type: event_type, attributes: value }
45
+ request("Post", "/v1/events", { sessionId: session_id, type: event_type, attributes: value })
44
46
  end
45
47
 
46
48
  def update_customer_session(session_id, data)
47
- request "Put", "/v1/customer_sessions/#{session_id}", data
49
+ request("Put", "/v1/customer_sessions/#{session_id}", data)
48
50
  end
49
51
 
50
52
  def update_customer_profile(profile_id, data)
51
- request "Put", "/v1/customer_profiles/#{profile_id}", data
53
+ request("Put", "/v1/customer_profiles/#{profile_id}", data)
52
54
  end
53
55
 
54
56
  def close_customer_session(session_id)
@@ -67,11 +69,15 @@ module TalonOne
67
69
  if expire
68
70
  newReferral[:expiryDate] = expire
69
71
  end
70
- request "Post", "/v1/referrals", newReferral, TalonOne::Integration::ReferralCode
72
+ request("Post", "/v1/referrals", newReferral, TalonOne::Integration::ReferralCode)
71
73
  end
72
74
 
73
75
  def search_profiles_by_attributes(profileAttr)
74
- request "Post", "/v1/customer_profiles_search", { attributes: profileAttr }, TalonOne::Integration::SearchProfilesResult
76
+ request("Post", "/v1/customer_profiles_search", { attributes: profileAttr }, TalonOne::Integration::SearchProfilesResult)
77
+ end
78
+
79
+ def delete_customer_data(customerId)
80
+ request("Delete", "/v1/customer_data/#{customerId}", nil, nil)
75
81
  end
76
82
 
77
83
  private
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'talon_one'
3
- s.version = '0.1.2'
4
- s.date = '2018-04-27'
3
+ s.version = '0.1.3'
4
+ s.date = '2018-11-05'
5
5
  s.summary = 'Client for the Talon.One API'
6
6
  s.description = 'A simple client for using the Talon.One API'
7
7
  s.authors = ['Talon.One GmbH']
@@ -18,11 +18,11 @@ class TestIntegrationApiLive < LiveApiTest
18
18
  management_client.update_campaign_status @app["id"], @campaign["id"], "enabled"
19
19
 
20
20
  @event_type ||= "Viewed Page#{rand(36**3).to_s(36)}"
21
- @attribute ||= management_client.create_attribute({ entity: "Event", eventType: @event_type, name: "URL", title: "Page URL", type: "string", description: "The URL of the page that the user has viewed", tags: [], editable: true })
21
+ @attribute ||= management_client.create_attribute({ entity: "Event", eventType: @event_type, name: "URL", title: "Page URL", type: "string", description: "The URL of the page that the user has viewed", tags: [], suggestions: [], editable: true })
22
22
 
23
23
  @coupon_code = "mycode"
24
24
  @attribute_name = "Description#{rand(36**3).to_s(36)}"
25
- @coupon_attribute ||= management_client.create_attribute({ entity: "Coupon", name: @attribute_name, title: "#{rand(36**3).to_s(36)}", type: "string", description: "Description for this coupon", tags: [], editable: true })
25
+ @coupon_attribute ||= management_client.create_attribute({ entity: "Coupon", name: @attribute_name, title: "#{rand(36**3).to_s(36)}", type: "string", description: "Description for this coupon", tags: [], suggestions: [], editable: true })
26
26
  @coupon ||= management_client.create_coupon(@app["id"], @campaign["id"], { validCharacters: [], couponPattern: @coupon_code, usageLimit: 0, numberOfCoupons: 1, attributes: { @attribute_name.to_sym => "some text" } })
27
27
  end
28
28
 
@@ -50,7 +50,7 @@ class TestIntegrationApiLive < LiveApiTest
50
50
  def test_update_customer_session
51
51
  res = integration_client.update_customer_session "new-session#{rand(36**3).to_s(36)}", {
52
52
  coupon: @coupon_code,
53
- total: BigDecimal.new("45.55"),
53
+ total: 45.55,
54
54
  }
55
55
  assert res.event.accepted_coupon?, "coupon code was accepted"
56
56
  assert_equal 2, res.event.effects.length
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talon_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Talon.One GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.6.14.1
103
+ rubygems_version: 2.6.13
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Client for the Talon.One API