tokyo_api 1.6.0 → 1.7.0
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 +4 -4
- data/.github/workflows/ci.yml +14 -0
- data/.ruby-version +1 -1
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/tokyo_api/identity.rb +4 -7
- data/spec/identity_spec.rb +12 -41
- data/tokyo_api.gemspec +14 -22
- metadata +7 -7
- data/.travis.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1632d0b0d73603bbf7eba85d8343f91cb8ee95926cf4b1e9e82dcd7e8e2674f7
|
4
|
+
data.tar.gz: 96e8a638a06c798c45e54b40e2018a1a0c5652614363c9f094e95c08cbdddc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e161f064e5dc728c24bafd7e4062eaef534ce63f2b278ba3cde492e8e5688156d5667f24fe858ded83fff39f21487085bbd15acc2ae73c52831bcafa6cdd1c38
|
7
|
+
data.tar.gz: 13c6dc24f97b53163e12e8f8e134a7e7c1e709d3847a6edfec9df131cbbd35e6053784482d1e5757b88bf5fdd98cc29f4ce1177e4f3c001dc097b3573fee113e
|
@@ -0,0 +1,14 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
test:
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- uses: actions/checkout@v2
|
9
|
+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
10
|
+
with:
|
11
|
+
ruby-version: 2.7
|
12
|
+
bundler-cache: true
|
13
|
+
- run: bundle install
|
14
|
+
- run: bundle exec rspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.3
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# tokyo\_api
|
2
2
|
|
3
3
|
A ruby gem for communicating with ControlShift's Tokyo API.
|
4
4
|
|
5
|
-
[](https://github.com/controlshift/tokyo_api/actions/workflows/ci.yml)
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0
|
data/lib/tokyo_api/identity.rb
CHANGED
@@ -10,18 +10,15 @@ module TokyoApi
|
|
10
10
|
client.get_request("#{normalized_base_path}full_user/#{url_escape(id)}").body
|
11
11
|
end
|
12
12
|
|
13
|
-
def tokyo_identity_user_path(id,
|
13
|
+
def tokyo_identity_user_path(id, required_fields: nil, opt_in_public_ids: nil, minimum_consent_level: nil, encrypted: nil)
|
14
14
|
path = String.new("/#{normalized_base_path}user/#{url_escape(id)}")
|
15
15
|
|
16
16
|
params = []
|
17
17
|
params << required_fields_param(required_fields) unless required_fields.nil?
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
minimum_consent_level, encrypted)
|
23
|
-
params << additional_subscription_parameters if additional_subscription_parameters.present?
|
24
|
-
end
|
19
|
+
additional_subscription_parameters = path_for_subscription_status_params(opt_in_public_ids,
|
20
|
+
minimum_consent_level, encrypted)
|
21
|
+
params << additional_subscription_parameters if additional_subscription_parameters.present?
|
25
22
|
|
26
23
|
path << "?#{params.join('&')}" if params.any?
|
27
24
|
|
data/spec/identity_spec.rb
CHANGED
@@ -60,49 +60,20 @@ describe TokyoApi::Identity do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'should not include query string parameter if argument is false' do
|
69
|
-
expect(subject.identity.tokyo_identity_user_path('123abc456',
|
70
|
-
with_subscription_status: false)).not_to match(/.+with_subscription_status=.+/)
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'should not include opt_in_public_ids and minimum_consent_level if with_subscription_status is false' do
|
74
|
-
tokyo_path = subject.identity.tokyo_identity_user_path('123abc456',
|
75
|
-
with_subscription_status: false,
|
76
|
-
opt_in_public_ids: ['policy-1.5'],
|
77
|
-
minimum_consent_level: 'explicit')
|
78
|
-
|
79
|
-
expect(tokyo_path).not_to match(/.+opt_in_public_ids=.+/)
|
80
|
-
expect(tokyo_path).not_to match(/.+minimum_consent_level=.+/)
|
81
|
-
end
|
63
|
+
it 'should include encrypted parameter if argument is true' do
|
64
|
+
expect(subject.identity.tokyo_identity_user_path('123abc456', encrypted: true)).to match(/.+encrypted=.+/)
|
65
|
+
end
|
82
66
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
67
|
+
it 'should include opt_in_public_ids and minimum_consent_level' do
|
68
|
+
tokyo_path = subject.identity.tokyo_identity_user_path('123abc456',
|
69
|
+
required_fields: %i[first_name last_name email
|
70
|
+
postal phone],
|
71
|
+
opt_in_public_ids: ['policy-1.5'],
|
72
|
+
minimum_consent_level: 'explicit')
|
87
73
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'should include opt_in_public_ids and minimum_consent_level if with_subscription_status is true' do
|
94
|
-
tokyo_path = subject.identity.tokyo_identity_user_path('123abc456',
|
95
|
-
required_fields: %i[first_name last_name email
|
96
|
-
postal phone],
|
97
|
-
with_subscription_status: true,
|
98
|
-
opt_in_public_ids: ['policy-1.5'],
|
99
|
-
minimum_consent_level: 'explicit')
|
100
|
-
|
101
|
-
expect(tokyo_path).to match(/.+with_subscription_status=true.*/)
|
102
|
-
expect(tokyo_path).to match(/.+opt_in_public_ids=.+/)
|
103
|
-
expect(tokyo_path).to match(/.+minimum_consent_level=.+/)
|
104
|
-
expect { URI.parse(tokyo_path) }.not_to raise_error
|
105
|
-
end
|
74
|
+
expect(tokyo_path).to match(/.+opt_in_public_ids=.+/)
|
75
|
+
expect(tokyo_path).to match(/.+minimum_consent_level=.+/)
|
76
|
+
expect { URI.parse(tokyo_path) }.not_to raise_error
|
106
77
|
end
|
107
78
|
end
|
108
79
|
|
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.
|
5
|
+
# stub: tokyo_api 1.7.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tokyo_api".freeze
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.7.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 = "
|
14
|
+
s.date = "2022-02-22"
|
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 = [
|
@@ -20,10 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
|
+
".github/workflows/ci.yml",
|
23
24
|
".rspec",
|
24
25
|
".ruby-gemset",
|
25
26
|
".ruby-version",
|
26
|
-
".travis.yml",
|
27
27
|
"Gemfile",
|
28
28
|
"LICENSE.txt",
|
29
29
|
"README.md",
|
@@ -55,29 +55,21 @@ Gem::Specification.new do |s|
|
|
55
55
|
]
|
56
56
|
s.homepage = "http://github.com/controlshift/tokyo_api".freeze
|
57
57
|
s.licenses = ["MIT".freeze]
|
58
|
-
s.rubygems_version = "3.
|
58
|
+
s.rubygems_version = "3.2.32".freeze
|
59
59
|
s.summary = "Ruby API Wrapper for Tokyo CRM service".freeze
|
60
60
|
|
61
61
|
if s.respond_to? :specification_version then
|
62
62
|
s.specification_version = 4
|
63
|
+
end
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
else
|
73
|
-
s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
74
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
75
|
-
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
76
|
-
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
77
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
78
|
-
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
79
|
-
s.add_dependency(%q<webmock>.freeze, [">= 0"])
|
80
|
-
end
|
65
|
+
if s.respond_to? :add_runtime_dependency then
|
66
|
+
s.add_runtime_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
67
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
68
|
+
s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
|
69
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
70
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
71
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
72
|
+
s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
|
81
73
|
else
|
82
74
|
s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
83
75
|
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
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.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vertebrae
|
@@ -117,10 +117,10 @@ extra_rdoc_files:
|
|
117
117
|
- README.md
|
118
118
|
files:
|
119
119
|
- ".document"
|
120
|
+
- ".github/workflows/ci.yml"
|
120
121
|
- ".rspec"
|
121
122
|
- ".ruby-gemset"
|
122
123
|
- ".ruby-version"
|
123
|
-
- ".travis.yml"
|
124
124
|
- Gemfile
|
125
125
|
- LICENSE.txt
|
126
126
|
- README.md
|
@@ -153,7 +153,7 @@ homepage: http://github.com/controlshift/tokyo_api
|
|
153
153
|
licenses:
|
154
154
|
- MIT
|
155
155
|
metadata: {}
|
156
|
-
post_install_message:
|
156
|
+
post_install_message:
|
157
157
|
rdoc_options: []
|
158
158
|
require_paths:
|
159
159
|
- lib
|
@@ -168,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
172
|
-
signing_key:
|
171
|
+
rubygems_version: 3.2.32
|
172
|
+
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Ruby API Wrapper for Tokyo CRM service
|
175
175
|
test_files: []
|
data/.travis.yml
DELETED