tokyo_api 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c13c06a403dbc3eeb297a65c97be04e9c6c4ecdc57faf3319fcaffc13a65752
4
- data.tar.gz: b7809a0fbf2cb061a1d187727485dfa4486c8eb82e93f22fb4eca82a3d303fa3
3
+ metadata.gz: ce924b467ea794f6a1bc81e4d9812c0d91c4a6304f17ce90b2d73a8e38b323a0
4
+ data.tar.gz: 9ee4cded3df652abd98d3e29622ecbc027ae84b7832ffefdb58b881f08016cf5
5
5
  SHA512:
6
- metadata.gz: 6ba8f238329548d345363e5b7819172104559e6dda78cf8fd188978562e71e0578362091f57a5129862473e61b41f619bb737694eb61f05cce72aa35156becc7
7
- data.tar.gz: a31540d25ae73fd9758d68b8e985a37f94defeacb2e833117927b6c8778d63226fc02c90127c0aed5969e94c85439aa58b400bf859039a427210a06db6208c41
6
+ metadata.gz: e3badd732d80242f264597b77363f8a7e26fdf74e8cb6ee4a07dc40dfdacdb8b2b24e065ef91140d0e83bd24a4818aaa32ee6e8542c658c406dfb63bb72abadb
7
+ data.tar.gz: 8e6d82eeb1bcf0d4037209f85c2e3d665ee51519dbe80942e76ec51563b1f8d1e0d78cfdc2c8ea64bf25c78d26e0e319fb3fcc7ac2e9466b4bed1718a31a09d3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
@@ -8,7 +8,7 @@ module TokyoApi
8
8
  client.get_request("#{normalized_base_path}full_user/#{url_escape(id)}").body
9
9
  end
10
10
 
11
- def tokyo_identity_user_path(id, with_subscription_status: false, required_fields: nil, opt_in_public_ids: nil, minimum_consent_level: nil)
11
+ def tokyo_identity_user_path(id, with_subscription_status: false, required_fields: nil, opt_in_public_ids: nil, minimum_consent_level: nil, encrypted: nil)
12
12
  path = "/#{normalized_base_path}user/#{url_escape(id)}"
13
13
 
14
14
  params = []
@@ -18,7 +18,7 @@ module TokyoApi
18
18
 
19
19
  if with_subscription_status
20
20
  params << 'with_subscription_status=true'
21
- additional_subscription_parameters = path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level)
21
+ additional_subscription_parameters = path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level, encrypted)
22
22
  unless additional_subscription_parameters.blank?
23
23
  params << additional_subscription_parameters
24
24
  end
@@ -31,15 +31,15 @@ module TokyoApi
31
31
  path
32
32
  end
33
33
 
34
- def subscription_status_path(id, opt_in_public_ids: nil, minimum_consent_level: nil)
34
+ def subscription_status_path(id, opt_in_public_ids: nil, minimum_consent_level: nil, encrypted: nil)
35
35
  raise 'must provide opt_in_public_ids' if opt_in_public_ids.nil?
36
36
 
37
- "/#{normalized_base_path}subscription_status/#{url_escape(id)}?#{path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level)}"
37
+ "/#{normalized_base_path}subscription_status/#{url_escape(id)}?#{path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level, encrypted)}"
38
38
  end
39
39
 
40
40
  private
41
41
 
42
- def path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level)
42
+ def path_for_subscription_status_params(opt_in_public_ids, minimum_consent_level, encrypted = nil)
43
43
  path = ''
44
44
 
45
45
  if opt_in_public_ids.present?
@@ -50,6 +50,10 @@ module TokyoApi
50
50
  path << "&minimum_consent_level=#{url_escape(minimum_consent_level)}"
51
51
  end
52
52
 
53
+ if encrypted
54
+ path << "&encrypted=1"
55
+ end
56
+
53
57
  path
54
58
  end
55
59
  end
@@ -77,6 +77,10 @@ describe TokyoApi::Identity do
77
77
  expect(subject.identity.tokyo_identity_user_path('123abc456', with_subscription_status: true)).to match /.+with_subscription_status=.+/
78
78
  end
79
79
 
80
+ it 'should include encrypted parameter if argument is true' do
81
+ expect(subject.identity.tokyo_identity_user_path('123abc456', with_subscription_status: true, encrypted: true)).to match /.+encrypted=.+/
82
+ end
83
+
80
84
  it 'should include opt_in_public_ids and minimum_consent_level if with_subscription_status is true' do
81
85
  tokyo_path = subject.identity.tokyo_identity_user_path('123abc456',
82
86
  required_fields: [:first_name, :last_name, :email, :postal, :phone],
@@ -106,5 +110,10 @@ describe TokyoApi::Identity do
106
110
  expected_path = '/identity/subscription_status/abc123?opt_in_public_ids=policy-1.5&minimum_consent_level=explicit'
107
111
  expect(subject.identity.subscription_status_path('abc123', opt_in_public_ids: ['policy-1.5'], minimum_consent_level: 'explicit')).to eq expected_path
108
112
  end
113
+
114
+ it 'should support encrypted param' do
115
+ expected_path = '/identity/subscription_status/abc123?opt_in_public_ids=policy-1.5&minimum_consent_level=explicit&encrypted=1'
116
+ expect(subject.identity.subscription_status_path('abc123', opt_in_public_ids: ['policy-1.5'], minimum_consent_level: 'explicit', encrypted: true)).to eq expected_path
117
+ end
109
118
  end
110
119
  end
data/tokyo_api.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: tokyo_api 1.2.0 ruby lib
5
+ # stub: tokyo_api 1.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "tokyo_api".freeze
9
- s.version = "1.2.0"
9
+ s.version = "1.3.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Nathan Woodhull".freeze]
14
- s.date = "2018-08-31"
14
+ s.date = "2018-09-04"
15
15
  s.description = "Tokyo is a CRM middleware, this gem helps apps talk to it.".freeze
16
16
  s.email = "nathan@controlshiftlabs.com".freeze
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tokyo_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vertebrae