sul_orcid_client 0.5.0 → 0.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/Gemfile.lock +80 -69
- data/lib/sul_orcid_client/cocina_support.rb +0 -18
- data/lib/sul_orcid_client/contributor_mapper.rb +9 -8
- data/lib/sul_orcid_client/version.rb +1 -1
- data/lib/sul_orcid_client.rb +1 -1
- data/sul_orcid_client.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c0b1ede02c640634f62eeeaecdc164ba772b6892cab517a3d33b3a1e6a880b8
|
4
|
+
data.tar.gz: 1e16d0da5a41b5af16c7388f84cb4fcf6384d7987ae73f5327e8e61cdc077b3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ec8a59ab3f5f8869d735eb56c04a5bf95eb4393fbd7441f3995d112e3dbb113ad532520d845406d8d2f44e1ef3675c660e566fc1794af725cd1c8f19f67bfb7
|
7
|
+
data.tar.gz: a200843b3089908ce16aae221972b002aa0d6f586f9463b069b44252deada3e93423cd4eafc0cfb77c0f169e74f746d6c48c312c84a467fa4b44a287704ab282
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sul_orcid_client (0.
|
4
|
+
sul_orcid_client (0.7.0)
|
5
5
|
activesupport (>= 4.2)
|
6
6
|
cocina-models (~> 0.90)
|
7
7
|
faraday
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (8.0.
|
15
|
+
activesupport (8.0.2)
|
16
16
|
base64
|
17
17
|
benchmark (>= 0.3)
|
18
18
|
bigdecimal
|
@@ -27,13 +27,13 @@ GEM
|
|
27
27
|
uri (>= 0.13.1)
|
28
28
|
addressable (2.8.7)
|
29
29
|
public_suffix (>= 2.0.2, < 7.0)
|
30
|
-
ast (2.4.
|
30
|
+
ast (2.4.3)
|
31
31
|
attr_extras (7.1.0)
|
32
|
-
base64 (0.
|
33
|
-
benchmark (0.4.
|
34
|
-
bigdecimal (3.
|
35
|
-
byebug (
|
36
|
-
cocina-models (0.
|
32
|
+
base64 (0.3.0)
|
33
|
+
benchmark (0.4.1)
|
34
|
+
bigdecimal (3.2.2)
|
35
|
+
byebug (12.0.0)
|
36
|
+
cocina-models (0.104.1)
|
37
37
|
activesupport
|
38
38
|
deprecation
|
39
39
|
dry-struct (~> 1.0)
|
@@ -48,15 +48,15 @@ GEM
|
|
48
48
|
thor
|
49
49
|
zeitwerk (~> 2.1)
|
50
50
|
concurrent-ruby (1.3.5)
|
51
|
-
connection_pool (2.5.
|
51
|
+
connection_pool (2.5.3)
|
52
52
|
crack (1.0.0)
|
53
53
|
bigdecimal
|
54
54
|
rexml
|
55
55
|
deprecation (1.1.0)
|
56
56
|
activesupport
|
57
|
-
diff-lcs (1.
|
57
|
+
diff-lcs (1.6.2)
|
58
58
|
docile (1.4.1)
|
59
|
-
drb (2.2.
|
59
|
+
drb (2.2.3)
|
60
60
|
dry-core (1.1.0)
|
61
61
|
concurrent-ruby (~> 1.0)
|
62
62
|
logger
|
@@ -67,12 +67,12 @@ GEM
|
|
67
67
|
concurrent-ruby (~> 1.0)
|
68
68
|
dry-core (~> 1.1)
|
69
69
|
zeitwerk (~> 2.6)
|
70
|
-
dry-struct (1.
|
70
|
+
dry-struct (1.8.0)
|
71
71
|
dry-core (~> 1.1)
|
72
72
|
dry-types (~> 1.8, >= 1.8.2)
|
73
73
|
ice_nine (~> 0.11)
|
74
74
|
zeitwerk (~> 2.6)
|
75
|
-
dry-types (1.8.
|
75
|
+
dry-types (1.8.3)
|
76
76
|
bigdecimal (~> 3.0)
|
77
77
|
concurrent-ruby (~> 1.0)
|
78
78
|
dry-core (~> 1.0)
|
@@ -83,97 +83,107 @@ GEM
|
|
83
83
|
activesupport (>= 3.0, < 9.0)
|
84
84
|
equivalent-xml (0.6.0)
|
85
85
|
nokogiri (>= 1.4.3)
|
86
|
-
faraday (2.
|
86
|
+
faraday (2.13.2)
|
87
87
|
faraday-net_http (>= 2.0, < 3.5)
|
88
88
|
json
|
89
89
|
logger
|
90
|
-
faraday-net_http (3.4.
|
90
|
+
faraday-net_http (3.4.1)
|
91
91
|
net-http (>= 0.5.0)
|
92
|
-
faraday-retry (2.2
|
92
|
+
faraday-retry (2.3.2)
|
93
93
|
faraday (~> 2.0)
|
94
|
-
hashdiff (1.
|
94
|
+
hashdiff (1.2.0)
|
95
95
|
hashie (5.0.0)
|
96
96
|
i18n (1.14.7)
|
97
97
|
concurrent-ruby (~> 1.0)
|
98
98
|
ice_nine (0.11.2)
|
99
|
-
json (2.
|
99
|
+
json (2.12.2)
|
100
100
|
jsonpath (1.1.5)
|
101
101
|
multi_json
|
102
|
-
jwt (
|
102
|
+
jwt (3.1.2)
|
103
103
|
base64
|
104
|
-
language_server-protocol (3.17.0.
|
105
|
-
|
106
|
-
|
104
|
+
language_server-protocol (3.17.0.5)
|
105
|
+
lint_roller (1.1.0)
|
106
|
+
logger (1.7.0)
|
107
|
+
minitest (5.25.5)
|
107
108
|
multi_json (1.15.0)
|
108
|
-
multi_xml (0.7.
|
109
|
+
multi_xml (0.7.2)
|
109
110
|
bigdecimal (~> 3.1)
|
110
111
|
net-http (0.6.0)
|
111
112
|
uri
|
112
|
-
nokogiri (1.18.
|
113
|
+
nokogiri (1.18.8-arm64-darwin)
|
113
114
|
racc (~> 1.4)
|
114
|
-
nokogiri (1.18.
|
115
|
+
nokogiri (1.18.8-x86_64-darwin)
|
115
116
|
racc (~> 1.4)
|
116
|
-
nokogiri (1.18.
|
117
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
117
118
|
racc (~> 1.4)
|
118
|
-
oauth2 (2.0.
|
119
|
-
faraday (>= 0.17.3, <
|
120
|
-
jwt (>= 1.0, <
|
119
|
+
oauth2 (2.0.12)
|
120
|
+
faraday (>= 0.17.3, < 4.0)
|
121
|
+
jwt (>= 1.0, < 4.0)
|
122
|
+
logger (~> 1.2)
|
121
123
|
multi_xml (~> 0.5)
|
122
124
|
rack (>= 1.2, < 4)
|
123
|
-
snaky_hash (~> 2.0)
|
124
|
-
version_gem (
|
125
|
+
snaky_hash (~> 2.0, >= 2.0.3)
|
126
|
+
version_gem (>= 1.1.8, < 3)
|
125
127
|
openapi_parser (1.0.0)
|
126
|
-
optimist (3.2.
|
127
|
-
parallel (1.
|
128
|
-
parser (3.3.
|
128
|
+
optimist (3.2.1)
|
129
|
+
parallel (1.27.0)
|
130
|
+
parser (3.3.8.0)
|
129
131
|
ast (~> 2.4.1)
|
130
132
|
racc
|
131
133
|
patience_diff (1.2.0)
|
132
134
|
optimist (~> 3.0)
|
133
|
-
|
135
|
+
prism (1.4.0)
|
136
|
+
public_suffix (6.0.2)
|
134
137
|
racc (1.8.1)
|
135
|
-
rack (3.1.
|
138
|
+
rack (3.1.16)
|
136
139
|
rainbow (3.1.1)
|
137
|
-
rake (13.
|
140
|
+
rake (13.3.0)
|
138
141
|
regexp_parser (2.10.0)
|
139
|
-
rexml (3.4.
|
140
|
-
rspec (3.13.
|
142
|
+
rexml (3.4.1)
|
143
|
+
rspec (3.13.1)
|
141
144
|
rspec-core (~> 3.13.0)
|
142
145
|
rspec-expectations (~> 3.13.0)
|
143
146
|
rspec-mocks (~> 3.13.0)
|
144
|
-
rspec-core (3.13.
|
147
|
+
rspec-core (3.13.5)
|
145
148
|
rspec-support (~> 3.13.0)
|
146
|
-
rspec-expectations (3.13.
|
149
|
+
rspec-expectations (3.13.5)
|
147
150
|
diff-lcs (>= 1.2.0, < 2.0)
|
148
151
|
rspec-support (~> 3.13.0)
|
149
|
-
rspec-mocks (3.13.
|
152
|
+
rspec-mocks (3.13.5)
|
150
153
|
diff-lcs (>= 1.2.0, < 2.0)
|
151
154
|
rspec-support (~> 3.13.0)
|
152
|
-
rspec-support (3.13.
|
153
|
-
rubocop (1.
|
155
|
+
rspec-support (3.13.4)
|
156
|
+
rubocop (1.77.0)
|
154
157
|
json (~> 2.3)
|
155
|
-
language_server-protocol (
|
158
|
+
language_server-protocol (~> 3.17.0.2)
|
159
|
+
lint_roller (~> 1.1.0)
|
156
160
|
parallel (~> 1.10)
|
157
161
|
parser (>= 3.3.0.2)
|
158
162
|
rainbow (>= 2.2.2, < 4.0)
|
159
163
|
regexp_parser (>= 2.9.3, < 3.0)
|
160
|
-
rubocop-ast (>= 1.
|
164
|
+
rubocop-ast (>= 1.45.1, < 2.0)
|
161
165
|
ruby-progressbar (~> 1.7)
|
162
166
|
unicode-display_width (>= 2.4.0, < 4.0)
|
163
|
-
rubocop-ast (1.
|
164
|
-
parser (>= 3.3.
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
rubocop (~> 1.
|
169
|
-
rubocop-
|
170
|
-
|
171
|
-
rubocop
|
172
|
-
rubocop-
|
173
|
-
|
174
|
-
|
175
|
-
rubocop (
|
176
|
-
|
167
|
+
rubocop-ast (1.45.1)
|
168
|
+
parser (>= 3.3.7.2)
|
169
|
+
prism (~> 1.4)
|
170
|
+
rubocop-capybara (2.22.1)
|
171
|
+
lint_roller (~> 1.1)
|
172
|
+
rubocop (~> 1.72, >= 1.72.1)
|
173
|
+
rubocop-factory_bot (2.27.1)
|
174
|
+
lint_roller (~> 1.1)
|
175
|
+
rubocop (~> 1.72, >= 1.72.1)
|
176
|
+
rubocop-performance (1.25.0)
|
177
|
+
lint_roller (~> 1.1)
|
178
|
+
rubocop (>= 1.75.0, < 2.0)
|
179
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
180
|
+
rubocop-rspec (3.6.0)
|
181
|
+
lint_roller (~> 1.1)
|
182
|
+
rubocop (~> 1.72, >= 1.72.1)
|
183
|
+
rubocop-rspec_rails (2.31.0)
|
184
|
+
lint_roller (~> 1.1)
|
185
|
+
rubocop (~> 1.72, >= 1.72.1)
|
186
|
+
rubocop-rspec (~> 3.5)
|
177
187
|
ruby-progressbar (1.13.0)
|
178
188
|
securerandom (0.4.1)
|
179
189
|
simplecov (0.22.0)
|
@@ -182,10 +192,10 @@ GEM
|
|
182
192
|
simplecov_json_formatter (~> 0.1)
|
183
193
|
simplecov-html (0.13.1)
|
184
194
|
simplecov_json_formatter (0.1.4)
|
185
|
-
snaky_hash (2.0.
|
186
|
-
hashie
|
187
|
-
version_gem (
|
188
|
-
super_diff (0.
|
195
|
+
snaky_hash (2.0.3)
|
196
|
+
hashie (>= 0.1.0, < 6)
|
197
|
+
version_gem (>= 1.1.8, < 3)
|
198
|
+
super_diff (0.16.0)
|
189
199
|
attr_extras (>= 6.2.4)
|
190
200
|
diff-lcs
|
191
201
|
patience_diff
|
@@ -195,17 +205,18 @@ GEM
|
|
195
205
|
unicode-display_width (3.1.4)
|
196
206
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
197
207
|
unicode-emoji (4.0.4)
|
198
|
-
uri (1.0.
|
208
|
+
uri (1.0.3)
|
199
209
|
vcr (6.3.1)
|
200
210
|
base64
|
201
|
-
version_gem (1.1.
|
202
|
-
webmock (3.25.
|
211
|
+
version_gem (1.1.8)
|
212
|
+
webmock (3.25.1)
|
203
213
|
addressable (>= 2.8.0)
|
204
214
|
crack (>= 0.3.2)
|
205
215
|
hashdiff (>= 0.4.0, < 2.0.0)
|
206
|
-
zeitwerk (2.7.
|
216
|
+
zeitwerk (2.7.3)
|
207
217
|
|
208
218
|
PLATFORMS
|
219
|
+
arm64-darwin-23
|
209
220
|
arm64-darwin-24
|
210
221
|
x86_64-darwin-19
|
211
222
|
x86_64-darwin-22
|
@@ -227,4 +238,4 @@ DEPENDENCIES
|
|
227
238
|
webmock
|
228
239
|
|
229
240
|
BUNDLED WITH
|
230
|
-
2.
|
241
|
+
2.6.9
|
@@ -2,17 +2,7 @@
|
|
2
2
|
|
3
3
|
class SulOrcidClient
|
4
4
|
# Helper methods for working with Orcid in Cocina
|
5
|
-
# NOTE: there is similar code in dor_indexing_app which fetches
|
6
|
-
# ORCIDs out of cocina. Consider consolidating at some point or keeping in sync.
|
7
|
-
# see https://github.com/sul-dlss/dor_indexing_app/blob/main/app/services/orcid_builder.rb
|
8
|
-
# and https://github.com/sul-dlss/dor_indexing_app/issues/1022
|
9
5
|
class CocinaSupport
|
10
|
-
# @param [Cocina::Models::Contributor] contributor to check
|
11
|
-
# @return [Boolean] true unless the contributor has a citation status of false
|
12
|
-
def self.cited?(contributor)
|
13
|
-
contributor.note.none? { |note| note.type == 'citation status' && note.value == 'false' }
|
14
|
-
end
|
15
|
-
|
16
6
|
# @param [Cocina::Models::Contributor] contributor to check
|
17
7
|
# @return [String, nil] orcid id including host if present
|
18
8
|
# rubocop:disable Metrics/AbcSize
|
@@ -30,13 +20,5 @@ class SulOrcidClient
|
|
30
20
|
URI.join(identifier.source.uri, identifier.value).to_s
|
31
21
|
end
|
32
22
|
# rubocop:enable Metrics/AbcSize
|
33
|
-
|
34
|
-
# @param [Cocina::Models::Description] description containing contributors to check
|
35
|
-
# @return [Array<String>] orcid ids including host if present
|
36
|
-
# Note that non-cited contributors are excluded.
|
37
|
-
def self.cited_orcidids(description)
|
38
|
-
cited_contributors = description.contributor.select { |contributor| cited?(contributor) }
|
39
|
-
cited_contributors.filter_map { |contributor| orcidid(contributor) }
|
40
|
-
end
|
41
23
|
end
|
42
24
|
end
|
@@ -13,8 +13,6 @@ class SulOrcidClient
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def map
|
16
|
-
return unless CocinaSupport.cited?(contributor)
|
17
|
-
|
18
16
|
{
|
19
17
|
'credit-name': map_credit_name,
|
20
18
|
'contributor-orcid': map_orcid,
|
@@ -43,20 +41,23 @@ class SulOrcidClient
|
|
43
41
|
def name_from_structured_value(structured_value)
|
44
42
|
forename = structured_value.find { |name_part| name_part.type == 'forename' }&.value
|
45
43
|
surname = structured_value.find { |name_part| name_part.type == 'surname' }&.value
|
46
|
-
[forename, surname].join(' ')
|
47
|
-
end
|
48
44
|
|
49
|
-
|
45
|
+
if forename.present? || surname.present?
|
46
|
+
[forename, surname].compact.join(' ')
|
47
|
+
else
|
48
|
+
structured_value.first.value
|
49
|
+
end
|
50
|
+
end
|
50
51
|
|
52
|
+
# find and map an ORCID from a contributor.identifier
|
51
53
|
def map_orcid
|
52
|
-
identifier = contributor.identifier.find { |check_identifier|
|
53
|
-
|
54
|
+
identifier = contributor.identifier.find { |check_identifier| check_identifier.type == 'ORCID' }
|
54
55
|
return unless identifier
|
55
56
|
|
56
57
|
{
|
57
58
|
uri: URI.join(identifier.source.uri, identifier.value).to_s,
|
58
59
|
path: identifier.value,
|
59
|
-
host:
|
60
|
+
host: 'orcid.org'
|
60
61
|
}
|
61
62
|
end
|
62
63
|
|
data/lib/sul_orcid_client.rb
CHANGED
@@ -93,7 +93,7 @@ class SulOrcidClient
|
|
93
93
|
num_pages = (num_results / max_num_returned.to_f).ceil
|
94
94
|
|
95
95
|
# we already have page 1 of the results
|
96
|
-
(1..num_pages - 1).each do |page_num|
|
96
|
+
(1..num_pages - 1).each do |page_num| # rubocop:disable Lint/AmbiguousRange
|
97
97
|
response = get("/v3.0/#{search_method}/?q=#{query}&start=#{(page_num * max_num_returned) + 1}&rows=#{max_num_returned}")
|
98
98
|
total_response[response_name] += response[response_name]
|
99
99
|
end
|
data/sul_orcid_client.gemspec
CHANGED
@@ -12,12 +12,12 @@ Gem::Specification.new do |spec|
|
|
12
12
|
|
13
13
|
spec.summary = 'Interface for interacting with the ORCID API.'
|
14
14
|
spec.description = 'This provides API interaction with the ORCID API'
|
15
|
-
spec.homepage = 'https://github.com/sul-dlss/
|
15
|
+
spec.homepage = 'https://github.com/sul-dlss/orcid_client'
|
16
16
|
spec.required_ruby_version = '>= 3.2.0'
|
17
17
|
|
18
18
|
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
-
spec.metadata['source_code_uri'] = 'https://github.com/sul-dlss/
|
20
|
-
spec.metadata['changelog_uri'] = 'https://github.com/sul-dlss/
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/sul-dlss/orcid_client'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/sul-dlss/orcid_client/releases'
|
21
21
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
22
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sul_orcid_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Mangiafico
|
8
8
|
- Justin Littman
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -269,12 +269,12 @@ files:
|
|
269
269
|
- lib/sul_orcid_client/version.rb
|
270
270
|
- lib/sul_orcid_client/work_mapper.rb
|
271
271
|
- sul_orcid_client.gemspec
|
272
|
-
homepage: https://github.com/sul-dlss/
|
272
|
+
homepage: https://github.com/sul-dlss/orcid_client
|
273
273
|
licenses: []
|
274
274
|
metadata:
|
275
|
-
homepage_uri: https://github.com/sul-dlss/
|
276
|
-
source_code_uri: https://github.com/sul-dlss/
|
277
|
-
changelog_uri: https://github.com/sul-dlss/
|
275
|
+
homepage_uri: https://github.com/sul-dlss/orcid_client
|
276
|
+
source_code_uri: https://github.com/sul-dlss/orcid_client
|
277
|
+
changelog_uri: https://github.com/sul-dlss/orcid_client/releases
|
278
278
|
rubygems_mfa_required: 'true'
|
279
279
|
rdoc_options: []
|
280
280
|
require_paths:
|
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
290
|
- !ruby/object:Gem::Version
|
291
291
|
version: '0'
|
292
292
|
requirements: []
|
293
|
-
rubygems_version: 3.6.
|
293
|
+
rubygems_version: 3.6.2
|
294
294
|
specification_version: 4
|
295
295
|
summary: Interface for interacting with the ORCID API.
|
296
296
|
test_files: []
|