sdr-client 2.3.1 → 2.5.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: 797ccc774c2d310146d945ce3dc5a58d2e2767a40608308cda938df7931bcdf7
4
- data.tar.gz: b668cc544d1b0c593d2458b47658c768eafdf94bf0ea361be02b6f67c5af4b44
3
+ metadata.gz: '0389c464ad43e038268dc5242aff43d16229135dfead77a90a4ff8bba3e6009f'
4
+ data.tar.gz: 2c1ec7488c915f3a82a4f8c5d822539bec42ce1364163740301aa6ef5bcc771e
5
5
  SHA512:
6
- metadata.gz: b7e999d795ed744dd7b2d51774718c9840a9ffa56430fe0947b53a7cabffa83ff611164af19576bf3c8b68331edcb25cd2a6063ac7bc8ce16acaaa3a58d184d5
7
- data.tar.gz: f010f0624f37c1208d782ead081ea55610b9edbeffdfe4777b47192462278ea270588e5e8f0bdeb947ffc69bd3bf8712e32fedc8f46de71f4b063f3df563dd75
6
+ metadata.gz: c756bb46d362597a15907ce763b6212735745074e8604bfc34ed9f712f719c770103353003c93df7e014e066d74a3473da30c5f0d5186563892a7f4df10ff8b9
7
+ data.tar.gz: b5322b234dce3fcf3a8b3cfa5b40da2f65b4bcc7fcccba6f6cfe4f107e0e2dac688a804056d154c65c54259344b454c6f0de630b680aeb4fc4d9e0daaaff156f
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@3.2.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.0.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sdr-client (2.3.1)
4
+ sdr-client (2.5.0)
5
5
  activesupport
6
- cocina-models (~> 0.89.0)
6
+ cocina-models (~> 0.90.0)
7
7
  config
8
8
  dry-monads
9
9
  faraday (>= 0.16)
@@ -12,17 +12,17 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.4.2)
15
+ activesupport (7.0.5)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
- addressable (2.8.1)
20
+ addressable (2.8.4)
21
21
  public_suffix (>= 2.0.2, < 6.0)
22
22
  ast (2.4.2)
23
23
  attr_extras (7.1.0)
24
24
  byebug (11.1.3)
25
- cocina-models (0.89.1)
25
+ cocina-models (0.90.0)
26
26
  activesupport
27
27
  deprecation
28
28
  dry-struct (~> 1.0)
@@ -37,9 +37,9 @@ GEM
37
37
  super_diff
38
38
  thor
39
39
  zeitwerk (~> 2.1)
40
- commonmarker (0.23.8)
40
+ commonmarker (0.23.9)
41
41
  concurrent-ruby (1.2.2)
42
- config (4.1.0)
42
+ config (4.2.0)
43
43
  deep_merge (~> 1.2, >= 1.2.1)
44
44
  dry-validation (~> 1.0, >= 1.0.0)
45
45
  crack (0.4.5)
@@ -65,12 +65,12 @@ GEM
65
65
  concurrent-ruby (~> 1.0)
66
66
  dry-core (~> 1.0, < 2)
67
67
  zeitwerk (~> 2.6)
68
- dry-schema (1.13.0)
68
+ dry-schema (1.13.2)
69
69
  concurrent-ruby (~> 1.0)
70
70
  dry-configurable (~> 1.0, >= 1.0.1)
71
71
  dry-core (~> 1.0, < 2)
72
72
  dry-initializer (~> 3.0)
73
- dry-logic (>= 1.5, < 2)
73
+ dry-logic (>= 1.4, < 2)
74
74
  dry-types (>= 1.7, < 2)
75
75
  zeitwerk (~> 2.6)
76
76
  dry-struct (1.6.0)
@@ -94,50 +94,51 @@ GEM
94
94
  activesupport (>= 3.0, < 8.0)
95
95
  equivalent-xml (0.6.0)
96
96
  nokogiri (>= 1.4.3)
97
- faraday (2.7.4)
97
+ faraday (2.7.6)
98
98
  faraday-net_http (>= 2.0, < 3.1)
99
99
  ruby2_keywords (>= 0.0.4)
100
100
  faraday-net_http (3.0.2)
101
101
  hashdiff (1.0.1)
102
- i18n (1.12.0)
102
+ i18n (1.14.1)
103
103
  concurrent-ruby (~> 1.0)
104
104
  ice_nine (0.11.2)
105
105
  json (2.6.3)
106
- jsonpath (1.1.2)
106
+ jsonpath (1.1.3)
107
107
  multi_json
108
108
  launchy (2.5.2)
109
109
  addressable (~> 2.8)
110
110
  minitest (5.18.0)
111
111
  multi_json (1.15.0)
112
- nokogiri (1.14.2-x86_64-darwin)
112
+ nokogiri (1.15.2-x86_64-darwin)
113
113
  racc (~> 1.4)
114
- nokogiri (1.14.2-x86_64-linux)
114
+ nokogiri (1.15.2-x86_64-linux)
115
115
  racc (~> 1.4)
116
116
  openapi3_parser (0.9.2)
117
117
  commonmarker (~> 0.17)
118
118
  openapi_parser (0.15.0)
119
119
  optimist (3.0.1)
120
- parallel (1.22.1)
121
- parser (3.2.1.0)
120
+ parallel (1.23.0)
121
+ parser (3.2.2.3)
122
122
  ast (~> 2.4.1)
123
+ racc
123
124
  patience_diff (1.2.0)
124
125
  optimist (~> 3.0)
125
126
  public_suffix (5.0.1)
126
- racc (1.6.2)
127
+ racc (1.7.0)
127
128
  rainbow (3.1.1)
128
129
  rake (13.0.6)
129
- regexp_parser (2.7.0)
130
+ regexp_parser (2.8.1)
130
131
  rexml (3.2.5)
131
132
  rspec (3.12.0)
132
133
  rspec-core (~> 3.12.0)
133
134
  rspec-expectations (~> 3.12.0)
134
135
  rspec-mocks (~> 3.12.0)
135
- rspec-core (3.12.1)
136
+ rspec-core (3.12.2)
136
137
  rspec-support (~> 3.12.0)
137
- rspec-expectations (3.12.2)
138
+ rspec-expectations (3.12.3)
138
139
  diff-lcs (>= 1.2.0, < 2.0)
139
140
  rspec-support (~> 3.12.0)
140
- rspec-mocks (3.12.3)
141
+ rspec-mocks (3.12.5)
141
142
  diff-lcs (>= 1.2.0, < 2.0)
142
143
  rspec-support (~> 3.12.0)
143
144
  rspec-support (3.12.0)
@@ -145,25 +146,28 @@ GEM
145
146
  rspec-core (>= 2, < 4, != 2.12.0)
146
147
  rss (0.2.9)
147
148
  rexml
148
- rubocop (1.48.0)
149
+ rubocop (1.52.1)
149
150
  json (~> 2.3)
150
151
  parallel (~> 1.10)
151
- parser (>= 3.2.0.0)
152
+ parser (>= 3.2.2.3)
152
153
  rainbow (>= 2.2.2, < 4.0)
153
154
  regexp_parser (>= 1.8, < 3.0)
154
155
  rexml (>= 3.2.5, < 4.0)
155
- rubocop-ast (>= 1.26.0, < 2.0)
156
+ rubocop-ast (>= 1.28.0, < 2.0)
156
157
  ruby-progressbar (~> 1.7)
157
158
  unicode-display_width (>= 2.4.0, < 3.0)
158
- rubocop-ast (1.27.0)
159
+ rubocop-ast (1.29.0)
159
160
  parser (>= 3.2.1.0)
160
- rubocop-capybara (2.17.1)
161
+ rubocop-capybara (2.18.0)
161
162
  rubocop (~> 1.41)
163
+ rubocop-factory_bot (2.23.1)
164
+ rubocop (~> 1.33)
162
165
  rubocop-rake (0.6.0)
163
166
  rubocop (~> 1.0)
164
- rubocop-rspec (2.18.1)
167
+ rubocop-rspec (2.22.0)
165
168
  rubocop (~> 1.33)
166
169
  rubocop-capybara (~> 2.17)
170
+ rubocop-factory_bot (~> 2.22)
167
171
  ruby-progressbar (1.13.0)
168
172
  ruby2_keywords (0.0.5)
169
173
  simplecov (0.22.0)
@@ -172,11 +176,11 @@ GEM
172
176
  simplecov_json_formatter (~> 0.1)
173
177
  simplecov-html (0.12.3)
174
178
  simplecov_json_formatter (0.1.4)
175
- super_diff (0.9.0)
179
+ super_diff (0.10.0)
176
180
  attr_extras (>= 6.2.4)
177
181
  diff-lcs
178
182
  patience_diff
179
- thor (1.2.1)
183
+ thor (1.2.2)
180
184
  tzinfo (2.0.6)
181
185
  concurrent-ruby (~> 1.0)
182
186
  unicode-display_width (2.4.2)
@@ -184,7 +188,7 @@ GEM
184
188
  addressable (>= 2.8.0)
185
189
  crack (>= 0.3.2)
186
190
  hashdiff (>= 0.4.0, < 2.0.0)
187
- zeitwerk (2.6.7)
191
+ zeitwerk (2.6.8)
188
192
 
189
193
  PLATFORMS
190
194
  x86_64-darwin-19
@@ -206,4 +210,4 @@ DEPENDENCIES
206
210
  webmock (~> 3.7)
207
211
 
208
212
  BUNDLED WITH
209
- 2.3.17
213
+ 2.4.13
@@ -10,19 +10,37 @@ module SdrClient
10
10
  checksum = Digest::MD5.file(path).base64digest
11
11
  new(checksum: checksum,
12
12
  byte_size: ::File.size(path),
13
- content_type: content_type || 'application/octet-stream',
13
+ content_type: clean_and_translate_content_type(content_type),
14
14
  filename: file_name)
15
15
  end
16
16
 
17
17
  def as_json
18
18
  {
19
- blob: { filename: filename, byte_size: byte_size, checksum: checksum, content_type: content_type }
19
+ blob: { filename: filename, byte_size: byte_size, checksum: checksum,
20
+ content_type: self.class.clean_and_translate_content_type(content_type) }
20
21
  }
21
22
  end
22
23
 
23
24
  def to_json(*_args)
24
25
  JSON.generate(as_json)
25
26
  end
27
+
28
+ # Invalid JSON files with a content type of application/json will trigger 400 errors in sdr-api
29
+ # since they are parsed and rejected (not clear why and what part of the stack is doing this).
30
+ # The work around is to change the content_type for any JSON files to a custom stand-in and
31
+ # specific to avoid the parsing, and then have this translated back to application/json after .
32
+ # upload is complete. There is a corresponding change in sdr-api to translate the content_type back
33
+ # before the Cocina is saved.
34
+ # See https://github.com/sul-dlss/happy-heron/issues/3075 for the original bug report
35
+ # See https://github.com/sul-dlss/sdr-api/pull/585 for the change in sdr-api
36
+ def self.clean_and_translate_content_type(content_type)
37
+ return 'application/octet-stream' if content_type.blank?
38
+
39
+ # ActiveStorage is expecting "application/x-stata-dta" not "application/x-stata-dta;version=14"
40
+ content_type = content_type.split(';')&.first
41
+
42
+ content_type == 'application/json' ? 'application/x-stanford-json' : content_type
43
+ end
26
44
  end
27
45
  end
28
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrClient
4
- VERSION = '2.3.1'
4
+ VERSION = '2.5.0'
5
5
  end
data/sdr-client.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_dependency 'activesupport'
31
- spec.add_dependency 'cocina-models', '~> 0.89.0'
31
+ spec.add_dependency 'cocina-models', '~> 0.90.0'
32
32
  spec.add_dependency 'config'
33
33
  spec.add_dependency 'dry-monads'
34
34
  spec.add_dependency 'faraday', '>= 0.16'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.89.0
33
+ version: 0.90.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.89.0
40
+ version: 0.90.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: config
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -289,7 +289,7 @@ metadata:
289
289
  source_code_uri: https://github.com/sul-dlss/sdr-client
290
290
  changelog_uri: https://github.com/sul-dlss/sdr-client/releases
291
291
  rubygems_mfa_required: 'true'
292
- post_install_message:
292
+ post_install_message:
293
293
  rdoc_options: []
294
294
  require_paths:
295
295
  - lib
@@ -304,8 +304,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  - !ruby/object:Gem::Version
305
305
  version: '0'
306
306
  requirements: []
307
- rubygems_version: 3.2.32
308
- signing_key:
307
+ rubygems_version: 3.4.13
308
+ signing_key:
309
309
  specification_version: 4
310
310
  summary: The CLI for https://github.com/sul-dlss/sdr-api
311
311
  test_files: []