dor-services-client 6.7.0 → 6.12.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/README.md +0 -4
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/object.rb +0 -4
- data/lib/dor/services/client/version.rb +1 -1
- metadata +8 -9
- data/lib/dor/services/client/files.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26bddfafc5474ced10f6638e3f3ee92fe256dda16b0950852137136ffdfa10aa
|
4
|
+
data.tar.gz: e77de104568b6a1c442be4c7e2b297364b2bb9dc0315ed9b8e108c62eb7257aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85220d276305560175cea0aa2a8b463675ea44fb20485f7997feec57ff3fc634cca3f7b101407a0c2e586526b47793b329ae09230772f585590ec10236dca9d6
|
7
|
+
data.tar.gz: 439aec36903c5816f2736a0400a6751e460d74c81a6d6d3f11fec9721648672189fa9193f0f9df7010218d52389af0e17bb0e5373f6ea7589125ad558b2484c7
|
data/README.md
CHANGED
@@ -142,10 +142,6 @@ object_client.collections
|
|
142
142
|
# Query for a collection's members
|
143
143
|
object_client.members
|
144
144
|
|
145
|
-
# View information about an object's files
|
146
|
-
object_client.files.retrieve(filename: filename_string)
|
147
|
-
object_client.files.list
|
148
|
-
|
149
145
|
# Create, update, destroy, and list administrative tags for an object
|
150
146
|
object_client.administrative_tags.create(tags: ['Tag : One', 'Tag : Two'])
|
151
147
|
object_client.administrative_tags.replace(tags: ['Tag : One', 'Tag : Two']) # like #create but removes current tags first
|
data/dor-services-client.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
25
|
spec.add_dependency 'activesupport', '>= 4.2', '< 7'
|
26
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
26
|
+
spec.add_dependency 'cocina-models', '~> 0.40.1' # leave pinned to patch level until cocina-models hits 1.0
|
27
27
|
spec.add_dependency 'deprecation', '>= 0'
|
28
28
|
spec.add_dependency 'faraday', '>= 0.15', '< 2'
|
29
29
|
spec.add_dependency 'moab-versioning', '~> 4.0'
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
- Michael Giarlo
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.40.1
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.40.1
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: deprecation
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,7 +205,7 @@ dependencies:
|
|
205
205
|
- - ">="
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
|
-
description:
|
208
|
+
description:
|
209
209
|
email:
|
210
210
|
- jcoyne@justincoyne.com
|
211
211
|
- leftwing@alumni.rutgers.edu
|
@@ -237,7 +237,6 @@ files:
|
|
237
237
|
- lib/dor/services/client/embargo.rb
|
238
238
|
- lib/dor/services/client/error_faraday_middleware.rb
|
239
239
|
- lib/dor/services/client/events.rb
|
240
|
-
- lib/dor/services/client/files.rb
|
241
240
|
- lib/dor/services/client/marcxml.rb
|
242
241
|
- lib/dor/services/client/members.rb
|
243
242
|
- lib/dor/services/client/metadata.rb
|
@@ -253,7 +252,7 @@ files:
|
|
253
252
|
homepage: https://github.com/sul-dlss/dor-services-client
|
254
253
|
licenses: []
|
255
254
|
metadata: {}
|
256
|
-
post_install_message:
|
255
|
+
post_install_message:
|
257
256
|
rdoc_options: []
|
258
257
|
require_paths:
|
259
258
|
- lib
|
@@ -269,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
268
|
version: '0'
|
270
269
|
requirements: []
|
271
270
|
rubygems_version: 3.1.2
|
272
|
-
signing_key:
|
271
|
+
signing_key:
|
273
272
|
specification_version: 4
|
274
273
|
summary: A client for dor-services-app
|
275
274
|
test_files: []
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dor
|
4
|
-
module Services
|
5
|
-
class Client
|
6
|
-
# API calls relating to files
|
7
|
-
class Files < VersionedService
|
8
|
-
# @param object_identifier [String] the pid for the object
|
9
|
-
def initialize(connection:, version:, object_identifier:)
|
10
|
-
super(connection: connection, version: version)
|
11
|
-
@object_identifier = object_identifier
|
12
|
-
end
|
13
|
-
|
14
|
-
# Get the contents from the workspace
|
15
|
-
# @param [String] filename the name of the file to retrieve
|
16
|
-
# @return [String] the file contents from the workspace
|
17
|
-
def retrieve(filename:)
|
18
|
-
resp = connection.get do |req|
|
19
|
-
req.url "#{api_version}/objects/#{object_identifier}/contents/#{filename}"
|
20
|
-
end
|
21
|
-
return unless resp.success?
|
22
|
-
|
23
|
-
resp.body
|
24
|
-
end
|
25
|
-
|
26
|
-
# Get the list of files in the workspace
|
27
|
-
# @return [Array<String>] the list of filenames in the workspace
|
28
|
-
def list
|
29
|
-
resp = connection.get do |req|
|
30
|
-
req.url "#{api_version}/objects/#{object_identifier}/contents"
|
31
|
-
end
|
32
|
-
return [] unless resp.success?
|
33
|
-
|
34
|
-
json = JSON.parse(resp.body)
|
35
|
-
json['items'].map { |item| item['name'] }
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
attr_reader :object_identifier
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|