promoted-ruby-client 2.0.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push-pull-requests_check.yml +1 -1
- data/Gemfile +0 -1
- data/Gemfile.lock +70 -61
- data/README.md +3 -3
- data/dev.md +1 -1
- data/lib/promoted/ruby/client/request_builder.rb +1 -1
- data/lib/promoted/ruby/client/validator.rb +1 -1
- data/lib/promoted/ruby/client/version.rb +1 -1
- data/lib/promoted/ruby/client.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffd08d1b6e14b721172d2e30680541f1d087d14f7cdfe63dc96b60ada84b5b1a
|
4
|
+
data.tar.gz: d21fa553ef8e746c642605bb2de051d4bdc9901b5837c1db6f1ca11fe358fa98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf16053b5bef1560caf7e9a5eaf01b62dd4484d40069801310d4cc8b7eb0fdce91eb072ee4c8a1146188b5fc74a168b2769623379dfd8df2a9f493d1e214a012
|
7
|
+
data.tar.gz: f814b279bd1585402a381e8269c9c4664964381702fb5fb597845990ace9e56fdb5b8e0d24d8b2d4f3373523f764798092bcb5c324f2ca90d173b4008035993f
|
data/Gemfile
CHANGED
@@ -6,7 +6,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
group :development do
|
9
|
-
gem 'ruby-debug-ide', group: :development
|
10
9
|
gem 'debase', '>= 0.2.5.beta2', group: :development
|
11
10
|
gem 'jaro_winkler', group: :development
|
12
11
|
gem 'solargraph', group: :development
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
promoted-ruby-client (2.0.
|
4
|
+
promoted-ruby-client (2.0.2)
|
5
5
|
concurrent-ruby (~> 1)
|
6
6
|
faraday (>= 0.9.0)
|
7
7
|
faraday_middleware (>= 0.9.0)
|
@@ -12,113 +12,123 @@ GEM
|
|
12
12
|
specs:
|
13
13
|
ast (2.4.2)
|
14
14
|
backport (1.2.0)
|
15
|
-
benchmark (0.
|
16
|
-
concurrent-ruby (1.
|
17
|
-
connection_pool (2.
|
15
|
+
benchmark (0.2.1)
|
16
|
+
concurrent-ruby (1.2.2)
|
17
|
+
connection_pool (2.4.1)
|
18
18
|
debase (0.2.5.beta2)
|
19
19
|
debase-ruby_core_source (>= 0.10.12)
|
20
|
-
debase-ruby_core_source (
|
21
|
-
diff-lcs (1.
|
20
|
+
debase-ruby_core_source (3.2.1)
|
21
|
+
diff-lcs (1.5.0)
|
22
22
|
docile (1.4.0)
|
23
23
|
e2mmap (0.1.0)
|
24
|
-
faraday (1.
|
24
|
+
faraday (1.10.3)
|
25
25
|
faraday-em_http (~> 1.0)
|
26
26
|
faraday-em_synchrony (~> 1.0)
|
27
27
|
faraday-excon (~> 1.1)
|
28
|
+
faraday-httpclient (~> 1.0)
|
29
|
+
faraday-multipart (~> 1.0)
|
28
30
|
faraday-net_http (~> 1.0)
|
29
|
-
faraday-net_http_persistent (~> 1.
|
30
|
-
|
31
|
+
faraday-net_http_persistent (~> 1.0)
|
32
|
+
faraday-patron (~> 1.0)
|
33
|
+
faraday-rack (~> 1.0)
|
34
|
+
faraday-retry (~> 1.0)
|
31
35
|
ruby2_keywords (>= 0.0.4)
|
32
36
|
faraday-em_http (1.0.0)
|
33
37
|
faraday-em_synchrony (1.0.0)
|
34
38
|
faraday-excon (1.1.0)
|
39
|
+
faraday-httpclient (1.0.1)
|
40
|
+
faraday-multipart (1.0.4)
|
41
|
+
multipart-post (~> 2)
|
35
42
|
faraday-net_http (1.0.1)
|
36
43
|
faraday-net_http_persistent (1.2.0)
|
37
|
-
|
44
|
+
faraday-patron (1.0.0)
|
45
|
+
faraday-rack (1.0.0)
|
46
|
+
faraday-retry (1.0.3)
|
47
|
+
faraday_middleware (1.2.0)
|
38
48
|
faraday (~> 1.0)
|
39
|
-
jaro_winkler (1.5.
|
40
|
-
|
49
|
+
jaro_winkler (1.5.6)
|
50
|
+
json (2.6.3)
|
51
|
+
kramdown (2.4.0)
|
41
52
|
rexml
|
42
53
|
kramdown-parser-gfm (1.1.0)
|
43
54
|
kramdown (~> 2.0)
|
44
|
-
|
45
|
-
multipart-post (2.
|
46
|
-
net-http-persistent (4.0.
|
55
|
+
language_server-protocol (3.17.0.3)
|
56
|
+
multipart-post (2.3.0)
|
57
|
+
net-http-persistent (4.0.2)
|
47
58
|
connection_pool (~> 2.2)
|
48
|
-
nokogiri (1.
|
49
|
-
mini_portile2 (~> 2.5.0)
|
59
|
+
nokogiri (1.15.2-arm64-darwin)
|
50
60
|
racc (~> 1.4)
|
51
|
-
nokogiri (1.
|
61
|
+
nokogiri (1.15.2-x86_64-linux)
|
52
62
|
racc (~> 1.4)
|
53
|
-
|
54
|
-
|
55
|
-
parallel (1.20.1)
|
56
|
-
parser (3.0.2.0)
|
63
|
+
parallel (1.23.0)
|
64
|
+
parser (3.2.2.3)
|
57
65
|
ast (~> 2.4.1)
|
58
|
-
|
59
|
-
|
66
|
+
racc
|
67
|
+
racc (1.7.1)
|
68
|
+
rainbow (3.1.1)
|
60
69
|
rake (10.5.0)
|
61
|
-
|
62
|
-
|
70
|
+
rbs (2.8.4)
|
71
|
+
regexp_parser (2.8.1)
|
72
|
+
reverse_markdown (2.1.1)
|
63
73
|
nokogiri
|
64
74
|
rexml (3.2.5)
|
65
|
-
rspec (3.
|
66
|
-
rspec-core (~> 3.
|
67
|
-
rspec-expectations (~> 3.
|
68
|
-
rspec-mocks (~> 3.
|
69
|
-
rspec-core (3.
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-expectations (3.
|
75
|
+
rspec (3.12.0)
|
76
|
+
rspec-core (~> 3.12.0)
|
77
|
+
rspec-expectations (~> 3.12.0)
|
78
|
+
rspec-mocks (~> 3.12.0)
|
79
|
+
rspec-core (3.12.2)
|
80
|
+
rspec-support (~> 3.12.0)
|
81
|
+
rspec-expectations (3.12.3)
|
72
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-mocks (3.
|
83
|
+
rspec-support (~> 3.12.0)
|
84
|
+
rspec-mocks (3.12.5)
|
75
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
76
|
-
rspec-support (~> 3.
|
77
|
-
rspec-support (3.
|
78
|
-
rubocop (1.
|
86
|
+
rspec-support (~> 3.12.0)
|
87
|
+
rspec-support (3.12.1)
|
88
|
+
rubocop (1.53.1)
|
89
|
+
json (~> 2.3)
|
90
|
+
language_server-protocol (>= 3.17.0)
|
79
91
|
parallel (~> 1.10)
|
80
|
-
parser (>= 3.
|
92
|
+
parser (>= 3.2.2.3)
|
81
93
|
rainbow (>= 2.2.2, < 4.0)
|
82
94
|
regexp_parser (>= 1.8, < 3.0)
|
83
|
-
rexml
|
84
|
-
rubocop-ast (>= 1.
|
95
|
+
rexml (>= 3.2.5, < 4.0)
|
96
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
85
97
|
ruby-progressbar (~> 1.7)
|
86
|
-
unicode-display_width (>=
|
87
|
-
rubocop-ast (1.
|
88
|
-
parser (>= 3.
|
89
|
-
ruby-
|
90
|
-
rake (>= 0.8.1)
|
91
|
-
ruby-progressbar (1.11.0)
|
98
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
99
|
+
rubocop-ast (1.29.0)
|
100
|
+
parser (>= 3.2.1.0)
|
101
|
+
ruby-progressbar (1.13.0)
|
92
102
|
ruby2_keywords (0.0.5)
|
93
|
-
simplecov (0.
|
103
|
+
simplecov (0.22.0)
|
94
104
|
docile (~> 1.1)
|
95
105
|
simplecov-html (~> 0.11)
|
96
106
|
simplecov_json_formatter (~> 0.1)
|
97
107
|
simplecov-html (0.12.3)
|
98
|
-
simplecov_json_formatter (0.1.
|
99
|
-
solargraph (0.
|
108
|
+
simplecov_json_formatter (0.1.4)
|
109
|
+
solargraph (0.49.0)
|
100
110
|
backport (~> 1.2)
|
101
111
|
benchmark
|
102
|
-
bundler (
|
112
|
+
bundler (~> 2.0)
|
103
113
|
diff-lcs (~> 1.4)
|
104
114
|
e2mmap
|
105
115
|
jaro_winkler (~> 1.5)
|
106
116
|
kramdown (~> 2.3)
|
107
117
|
kramdown-parser-gfm (~> 1.1)
|
108
118
|
parser (~> 3.0)
|
109
|
-
|
110
|
-
|
119
|
+
rbs (~> 2.0)
|
120
|
+
reverse_markdown (~> 2.0)
|
121
|
+
rubocop (~> 1.38)
|
111
122
|
thor (~> 1.0)
|
112
123
|
tilt (~> 2.0)
|
113
124
|
yard (~> 0.9, >= 0.9.24)
|
114
|
-
thor (1.
|
115
|
-
tilt (2.0
|
116
|
-
unicode-display_width (2.
|
117
|
-
yard (0.9.
|
125
|
+
thor (1.2.2)
|
126
|
+
tilt (2.2.0)
|
127
|
+
unicode-display_width (2.4.2)
|
128
|
+
yard (0.9.34)
|
118
129
|
|
119
130
|
PLATFORMS
|
120
|
-
|
121
|
-
x86_64-darwin-20
|
131
|
+
arm64-darwin-21
|
122
132
|
x86_64-linux
|
123
133
|
|
124
134
|
DEPENDENCIES
|
@@ -128,9 +138,8 @@ DEPENDENCIES
|
|
128
138
|
promoted-ruby-client!
|
129
139
|
rake (~> 10.0)
|
130
140
|
rspec (~> 3.0)
|
131
|
-
ruby-debug-ide
|
132
141
|
simplecov
|
133
142
|
solargraph
|
134
143
|
|
135
144
|
BUNDLED WITH
|
136
|
-
2.
|
145
|
+
2.4.9
|
data/README.md
CHANGED
@@ -63,7 +63,7 @@ Basic information about the request user.
|
|
63
63
|
Field Name | Type | Optional? | Description
|
64
64
|
---------- | ---- | --------- | -----------
|
65
65
|
```:user_id``` | String | Yes | The platform user id, cleared from Promoted logs.
|
66
|
-
```:
|
66
|
+
```:anon_user_id``` | String | Yes | A different user id (presumably a UUID) disconnected from the platform user id, good for working with unauthenticated users or implementing right-to-be-forgotten.
|
67
67
|
```:is_internal_user``` | Boolean | Yes | If this user is a test user or not, defaults to false.
|
68
68
|
|
69
69
|
---
|
@@ -270,7 +270,7 @@ insertions = products.map { |product|
|
|
270
270
|
# Form a MetricsRequest
|
271
271
|
metrics_request = {
|
272
272
|
:request => {
|
273
|
-
:user_info => { :user_id => "912", :
|
273
|
+
:user_info => { :user_id => "912", :anon_user_id => "912191"},
|
274
274
|
:use_case => "FEED",
|
275
275
|
:paging => {
|
276
276
|
:offset => 0,
|
@@ -306,7 +306,7 @@ client.send_log_request(client_response[:log_request]) if client_response[:log_r
|
|
306
306
|
# Form a DeliveryRequest
|
307
307
|
delivery_request = {
|
308
308
|
:request => {
|
309
|
-
:user_info => { :user_id => "912", :
|
309
|
+
:user_info => { :user_id => "912", :anon_user_id => "912191"},
|
310
310
|
:use_case => "FEED",
|
311
311
|
:paging => {
|
312
312
|
:offset => 0,
|
data/dev.md
CHANGED
@@ -10,5 +10,5 @@ bundle exec rspec
|
|
10
10
|
2. Get credentials for deployment from 1password.
|
11
11
|
3. Modify `promoted-ruby-client.gemspec`'s push block.
|
12
12
|
4. Run `gem build promoted-ruby-client.gemspec` to generate `gem`.
|
13
|
-
5. Run (using new output) `gem push promoted-ruby-client-
|
13
|
+
5. Run (using new output) `gem push promoted-ruby-client-3.0.0.gem`
|
14
14
|
6. Update README with new version.
|
@@ -27,7 +27,7 @@ module Promoted
|
|
27
27
|
@view_id = request[:view_id]
|
28
28
|
@use_case = Promoted::Ruby::Client::USE_CASES[request[:use_case]] || Promoted::Ruby::Client::USE_CASES['UNKNOWN_USE_CASE']
|
29
29
|
@insertion = request[:insertion] || []
|
30
|
-
@user_info = request[:user_info] || { :user_id => nil, :
|
30
|
+
@user_info = request[:user_info] || { :user_id => nil, :anon_user_id => nil}
|
31
31
|
@timing = request[:timing] || { :client_log_timestamp => (Time.now.to_f * 1000).to_i }
|
32
32
|
|
33
33
|
# If the user didn't create a client request id, we do it for them.
|
data/lib/promoted/ruby/client.rb
CHANGED
@@ -338,7 +338,9 @@ module Promoted
|
|
338
338
|
response = nil
|
339
339
|
begin
|
340
340
|
response = send_request(delivery_request_params, @delivery_endpoint, @delivery_timeout_millis, @delivery_api_key, headers, @async_shadow_traffic)
|
341
|
-
|
341
|
+
if response != nil
|
342
|
+
@validator.validate_response!(response)
|
343
|
+
end
|
342
344
|
rescue StandardError => err
|
343
345
|
@logger.warn("Shadow traffic call failed with #{err}") if @logger
|
344
346
|
return
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promoted-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scottmcmaster
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|