archivesspace-client 0.2.0 → 0.4.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/ci.yml +1 -2
- data/.github/workflows/publish.yml +1 -1
- data/.ruby-version +1 -0
- data/README.md +6 -4
- data/archivesspace-client.gemspec +11 -12
- data/bin/console +21 -0
- data/examples/export.rb +1 -1
- data/examples/repo_and_user.rb +3 -3
- data/examples/templates.rb +18 -0
- data/examples/test_connection.rb +1 -1
- data/examples/user_groups.rb +2 -2
- data/lib/archivesspace/client/client.rb +2 -0
- data/lib/archivesspace/client/configuration.rb +1 -1
- data/lib/archivesspace/client/request.rb +1 -0
- data/lib/archivesspace/client/template.rb +51 -8
- data/lib/archivesspace/client/templates/resource.json.jbuilder +7 -0
- data/lib/archivesspace/client/version.rb +1 -1
- data/lib/archivesspace/client.rb +1 -0
- data/spec/archivesspace/client_spec.rb +8 -10
- data/spec/archivesspace/templates_spec.rb +17 -3
- data/spec/fixtures/cassettes/backend_version.yml +35 -24
- metadata +52 -70
- data/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ff1d8782c564f4dfdf2dce03267b11f9e60fc14648bd07da6a9882c169050e
|
4
|
+
data.tar.gz: 23f900ce6d47bf4a4b55646249306c49f0d41ef671f2c8ba30ad8ea1855ca000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99478138d6f6902b7f3efd07c92f5635f69ee43b4609135c92bb3c541454c95254da6f401de1be0051245e0a99f30de2c6cb2c19661bf2688a09bda789441a05
|
7
|
+
data.tar.gz: c7f45e1358d6550164a05b1ed966c6ac6cb1f993bd2ab3c570c7ae52ba70de50923c19a4907fbc1951cd8a1db2b82a05062b4b464fa3f6446b6ca50f7a37668e
|
data/.github/workflows/ci.yml
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/README.md
CHANGED
@@ -95,11 +95,11 @@ client.use_global_repository
|
|
95
95
|
|
96
96
|
Templates are an optional feature that can help simplify the effort of creating
|
97
97
|
json payloads for ArchivesSpace. Rather than construct the json programatically
|
98
|
-
according to the schemas a
|
99
|
-
|
98
|
+
according to the schemas a template can be used to generate payloads instead which
|
99
|
+
are transformed to json automatically. There are a small number of
|
100
100
|
templates provided with the client, but you can create your own and access them
|
101
101
|
by setting the `ARCHIVESSPACE_CLIENT_TEMPLATES_PATH` envvar. A particularly simple
|
102
|
-
template might look like:
|
102
|
+
`erb` template might look like:
|
103
103
|
|
104
104
|
```erb
|
105
105
|
{
|
@@ -115,11 +115,13 @@ assembling the payload. To process a template:
|
|
115
115
|
|
116
116
|
```ruby
|
117
117
|
data = { repo_code: 'ABC', name: 'ABC Archive', agent_contact_name: 'ABC Admin' }
|
118
|
-
json = ArchivesSpace::Template.process(
|
118
|
+
json = ArchivesSpace::Template.process("repository_with_agent.json.erb", data)
|
119
119
|
response = client.post('/repositories/with_agent', json)
|
120
120
|
puts response.result.success? ? '=)' : '=('
|
121
121
|
```
|
122
122
|
|
123
|
+
To view available templates use: `ArchivesSpace::Template.list`
|
124
|
+
|
123
125
|
## CLI
|
124
126
|
|
125
127
|
Create an `~/.asclientrc` file with a json version of the client configuration:
|
@@ -14,25 +14,24 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = %w[asclient]
|
17
19
|
spec.files = `git ls-files -z`.split("\x0")
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
21
|
-
spec.add_development_dependency "aruba"
|
22
|
-
spec.add_development_dependency "
|
23
|
-
spec.add_development_dependency "
|
24
|
-
spec.add_development_dependency "
|
25
|
-
spec.add_development_dependency "cucumber"
|
26
|
-
spec.add_development_dependency "json_spec"
|
27
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
spec.add_development_dependency "aruba", "~> 2.0"
|
23
|
+
spec.add_development_dependency "capybara_discoball", "~> 0.1.0"
|
24
|
+
spec.add_development_dependency "json_spec", "~> 1.1", ">= 1.1.5"
|
25
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
28
26
|
spec.add_development_dependency "rspec", "3.6.0"
|
29
|
-
spec.add_development_dependency "rubocop"
|
30
|
-
spec.add_development_dependency "standard"
|
31
|
-
spec.add_development_dependency "vcr", "
|
32
|
-
spec.add_development_dependency "webmock", "3.
|
27
|
+
spec.add_development_dependency "rubocop", "1.56"
|
28
|
+
spec.add_development_dependency "standard", "1.31.0"
|
29
|
+
spec.add_development_dependency "vcr", "6.2.0"
|
30
|
+
spec.add_development_dependency "webmock", "3.19.1"
|
33
31
|
|
34
32
|
spec.add_dependency "dry-cli", "~> 0.7"
|
35
33
|
spec.add_dependency "httparty", "~> 0.14"
|
36
34
|
spec.add_dependency "json", "~> 2.0"
|
37
35
|
spec.add_dependency "nokogiri", "~> 1.10"
|
36
|
+
spec.add_dependency "jbuilder", "~> 2.11.5"
|
38
37
|
end
|
data/bin/console
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "archivesspace/client"
|
6
|
+
|
7
|
+
config = ArchivesSpace::Configuration.new(
|
8
|
+
{
|
9
|
+
base_uri: "https://test.archivesspace.org/staff/api",
|
10
|
+
base_repo: "",
|
11
|
+
username: "admin",
|
12
|
+
password: "admin",
|
13
|
+
page_size: 50,
|
14
|
+
throttle: 0,
|
15
|
+
verify_ssl: false
|
16
|
+
}
|
17
|
+
)
|
18
|
+
@client = ArchivesSpace::Client.new(config).login
|
19
|
+
|
20
|
+
require "irb"
|
21
|
+
IRB.start(__FILE__)
|
data/examples/export.rb
CHANGED
@@ -7,7 +7,7 @@ require "archivesspace/client"
|
|
7
7
|
# official sandbox
|
8
8
|
config = ArchivesSpace::Configuration.new(
|
9
9
|
{
|
10
|
-
base_uri: "
|
10
|
+
base_uri: "https://test.archivesspace.org/staff/api",
|
11
11
|
base_repo: "",
|
12
12
|
username: "admin",
|
13
13
|
password: "admin",
|
data/examples/repo_and_user.rb
CHANGED
@@ -7,7 +7,7 @@ require "archivesspace/client"
|
|
7
7
|
# official sandbox
|
8
8
|
config = ArchivesSpace::Configuration.new(
|
9
9
|
{
|
10
|
-
base_uri: "
|
10
|
+
base_uri: "https://sandbox.archivesspace.org/api",
|
11
11
|
base_repo: "",
|
12
12
|
username: "admin",
|
13
13
|
password: "admin",
|
@@ -34,7 +34,7 @@ user_data = {
|
|
34
34
|
}
|
35
35
|
user_password = "123456"
|
36
36
|
|
37
|
-
repository = ArchivesSpace::Template.process(
|
37
|
+
repository = ArchivesSpace::Template.process("repository_with_agent.json.erb", repo_data)
|
38
38
|
|
39
39
|
begin
|
40
40
|
response = client.post("/repositories/with_agent", repository)
|
@@ -46,7 +46,7 @@ begin
|
|
46
46
|
ap response.parsed
|
47
47
|
end
|
48
48
|
|
49
|
-
user = ArchivesSpace::Template.process(
|
49
|
+
user = ArchivesSpace::Template.process("user.json.erb", user_data)
|
50
50
|
response = client.post("users", user, {password: user_password})
|
51
51
|
if response.result.success?
|
52
52
|
user = client.users.find { |r| r["username"] == "lmessi" }
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
4
|
+
require "awesome_print"
|
5
|
+
require "archivesspace/client"
|
6
|
+
|
7
|
+
puts ArchivesSpace::Template.list
|
8
|
+
|
9
|
+
template = "repository_with_agent.json.erb"
|
10
|
+
user_data = {
|
11
|
+
username: "harrykane",
|
12
|
+
name: "Harry Kane",
|
13
|
+
is_admin: false
|
14
|
+
}
|
15
|
+
|
16
|
+
puts ArchivesSpace::Template.process(template, user_data)
|
17
|
+
# or, if you really want ...
|
18
|
+
puts ArchivesSpace::Template::Erb.new(template, user_data).process
|
data/examples/test_connection.rb
CHANGED
@@ -7,7 +7,7 @@ require "archivesspace/client"
|
|
7
7
|
# official sandbox
|
8
8
|
config = ArchivesSpace::Configuration.new(
|
9
9
|
{
|
10
|
-
base_uri: "
|
10
|
+
base_uri: "https://sandbox.archivesspace.org/api",
|
11
11
|
base_repo: "",
|
12
12
|
username: "admin",
|
13
13
|
password: "admin",
|
data/examples/user_groups.rb
CHANGED
@@ -7,7 +7,7 @@ require "archivesspace/client"
|
|
7
7
|
# official sandbox
|
8
8
|
config = ArchivesSpace::Configuration.new(
|
9
9
|
{
|
10
|
-
base_uri: "
|
10
|
+
base_uri: "https://sandbox.archivesspace.org/api",
|
11
11
|
base_repo: "",
|
12
12
|
username: "admin",
|
13
13
|
password: "admin",
|
@@ -27,7 +27,7 @@ user_data = {
|
|
27
27
|
|
28
28
|
client.post(
|
29
29
|
"users",
|
30
|
-
ArchivesSpace::Template.process(
|
30
|
+
ArchivesSpace::Template.process("user.json.erb", user_data),
|
31
31
|
{password: "123456"}
|
32
32
|
)
|
33
33
|
|
@@ -28,6 +28,7 @@ module ArchivesSpace
|
|
28
28
|
@options = options
|
29
29
|
@options[:headers] =
|
30
30
|
options[:headers] ? default_headers(@method).merge(options[:headers]) : default_headers(@method)
|
31
|
+
@options[:headers]["User-Agent"] = "#{Client::NAME}/#{Client::VERSION}"
|
31
32
|
@options[:verify] = config.verify_ssl
|
32
33
|
@options[:timeout] = config.timeout
|
33
34
|
@options[:query] = {} unless options.key? :query
|
@@ -3,17 +3,13 @@
|
|
3
3
|
module ArchivesSpace
|
4
4
|
module Template
|
5
5
|
def self.list
|
6
|
-
Dir.glob File.join(templates_path
|
6
|
+
Dir.glob ["*"], base: File.join(templates_path)
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.process(template, data)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.read(file)
|
16
|
-
File.read("#{templates_path}/#{file}.json.erb")
|
10
|
+
processor = File.extname(template).delete(".").camelize
|
11
|
+
processor = Object.const_get("ArchivesSpace::Template::#{processor}")
|
12
|
+
processor.new(template, data).process
|
17
13
|
end
|
18
14
|
|
19
15
|
def self.templates_path
|
@@ -22,5 +18,52 @@ module ArchivesSpace
|
|
22
18
|
File.join(File.dirname(File.expand_path(__FILE__)), "templates")
|
23
19
|
)
|
24
20
|
end
|
21
|
+
|
22
|
+
class Processor
|
23
|
+
attr_reader :template, :data
|
24
|
+
|
25
|
+
def initialize(template, data)
|
26
|
+
@template = template
|
27
|
+
@data = data
|
28
|
+
|
29
|
+
validate_template
|
30
|
+
end
|
31
|
+
|
32
|
+
def extension
|
33
|
+
raise "Not implemented"
|
34
|
+
end
|
35
|
+
|
36
|
+
def read_template
|
37
|
+
File.read(File.join(ArchivesSpace::Template.templates_path, template))
|
38
|
+
end
|
39
|
+
|
40
|
+
def validate_template
|
41
|
+
raise "Invalid template" unless File.extname(template).end_with? extension
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class Erb < Processor
|
46
|
+
def extension
|
47
|
+
".erb"
|
48
|
+
end
|
49
|
+
|
50
|
+
def process
|
51
|
+
t = ERB.new(read_template)
|
52
|
+
r = t.result(binding).squeeze("\n")
|
53
|
+
JSON.parse(r).to_json
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Jbuilder < Processor
|
58
|
+
def extension
|
59
|
+
".jbuilder"
|
60
|
+
end
|
61
|
+
|
62
|
+
def process
|
63
|
+
::Jbuilder.encode do |json|
|
64
|
+
eval(read_template, binding) # standard:disable Security/Eval
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
25
68
|
end
|
26
69
|
end
|
data/lib/archivesspace/client.rb
CHANGED
@@ -4,11 +4,9 @@ require "spec_helper"
|
|
4
4
|
|
5
5
|
describe ArchivesSpace::Client do
|
6
6
|
let(:client) { ArchivesSpace::Client.new }
|
7
|
-
let(:login) { -> { client.login } }
|
8
7
|
|
9
8
|
describe "Configuration" do
|
10
9
|
it "will use the default configuration if none is provided" do
|
11
|
-
client = ArchivesSpace::Client.new
|
12
10
|
expect(client.config.base_uri).to eq DEFAULT_BASE_URI
|
13
11
|
end
|
14
12
|
|
@@ -24,42 +22,43 @@ describe ArchivesSpace::Client do
|
|
24
22
|
|
25
23
|
describe "Repository scoping" do
|
26
24
|
it "will set the repository with an integer id" do
|
27
|
-
client = ArchivesSpace::Client.new
|
28
25
|
client.repository 2
|
29
26
|
expect(client.config.base_repo).to eq "repositories/2"
|
30
27
|
end
|
31
28
|
|
32
29
|
it "will set the repository with a string id cast to integer" do
|
33
|
-
client = ArchivesSpace::Client.new
|
34
30
|
client.repository "2"
|
35
31
|
expect(client.config.base_repo).to eq "repositories/2"
|
36
32
|
end
|
37
33
|
|
38
34
|
it "will fail if the id cannot be cast to integer" do
|
39
|
-
client = ArchivesSpace::Client.new
|
40
35
|
expect { client.repository("xyz") }.to raise_error(
|
41
36
|
ArchivesSpace::RepositoryIdError
|
42
37
|
)
|
43
38
|
end
|
44
39
|
|
45
40
|
it "will use the global repo if repository is passed nil" do
|
46
|
-
client = ArchivesSpace::Client.new
|
47
41
|
client.repository 2
|
48
42
|
client.repository nil
|
49
43
|
expect(client.config.base_repo).to eq ""
|
50
44
|
end
|
51
45
|
|
52
46
|
it "will use the global repo when the method is called" do
|
53
|
-
client = ArchivesSpace::Client.new
|
54
47
|
client.repository 2
|
55
48
|
client.use_global_repository
|
56
49
|
expect(client.config.base_repo).to eq ""
|
57
50
|
end
|
58
51
|
end
|
59
52
|
|
53
|
+
describe "Requests" do
|
54
|
+
it "will have an identifiable user agent" do
|
55
|
+
request = ArchivesSpace::Request.new(client.config)
|
56
|
+
expect(request.options[:headers]["User-Agent"]).to eq "#{ArchivesSpace::Client::NAME}/#{ArchivesSpace::Client::VERSION}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
60
|
describe "Pagination" do
|
61
61
|
it "will have a method for defined paginated record types" do
|
62
|
-
client = ArchivesSpace::Client.new
|
63
62
|
ArchivesSpace::Pagination::ENDPOINTS.each do |e|
|
64
63
|
next if e.match?("/")
|
65
64
|
|
@@ -68,7 +67,6 @@ describe ArchivesSpace::Client do
|
|
68
67
|
end
|
69
68
|
|
70
69
|
it "will have a method for defined paginated record types with multipart path" do
|
71
|
-
client = ArchivesSpace::Client.new
|
72
70
|
expect(client.respond_to?(:people)).to be true
|
73
71
|
end
|
74
72
|
end
|
@@ -80,7 +78,7 @@ describe ArchivesSpace::Client do
|
|
80
78
|
|
81
79
|
it "can retrieve the backend version info" do
|
82
80
|
VCR.use_cassette("backend_version") do
|
83
|
-
login
|
81
|
+
client.login
|
84
82
|
response = client.get "version"
|
85
83
|
expect(response.status_code).to eq(200)
|
86
84
|
expect(response.body).to match(/ArchivesSpace \(.*\)/)
|
@@ -7,20 +7,34 @@ describe ArchivesSpace::Template do
|
|
7
7
|
templates = ArchivesSpace::Template.list
|
8
8
|
expect(templates).to_not be_empty
|
9
9
|
expect(templates).to include(/repository_with_agent.*erb/)
|
10
|
+
expect(templates).to include(/resource.*jbuilder/)
|
10
11
|
end
|
11
12
|
|
12
13
|
it "can change the path when template envvar is set" do
|
13
14
|
expect(ArchivesSpace::Template.templates_path).to match(
|
14
|
-
/#{File.join(
|
15
|
+
/#{File.join("lib", "archivesspace", "client", "templates")}/
|
15
16
|
)
|
16
17
|
ENV["ARCHIVESSPACE_CLIENT_TEMPLATES_PATH"] = "/path/to/nowhere"
|
17
18
|
expect(ArchivesSpace::Template.templates_path).to eq "/path/to/nowhere"
|
18
19
|
ENV.delete("ARCHIVESSPACE_CLIENT_TEMPLATES_PATH")
|
19
20
|
end
|
20
21
|
|
21
|
-
it "can process
|
22
|
+
it "can process an erb template" do
|
22
23
|
data = {repo_code: "ABC", name: "ABC Archive", agent_contact_name: "ABC Admin"}
|
23
|
-
json = JSON.parse(ArchivesSpace::Template.process(
|
24
|
+
json = JSON.parse(ArchivesSpace::Template.process("repository_with_agent.json.erb", data))
|
24
25
|
expect(json["repository"]["repo_code"]).to eq data[:repo_code]
|
25
26
|
end
|
27
|
+
|
28
|
+
it "can process a jbuilder template" do
|
29
|
+
data = {"title" => "Title", "object_number" => "001.001", "description_level" => "collection"}
|
30
|
+
json = JSON.parse(ArchivesSpace::Template.process("resource.json.jbuilder", data))
|
31
|
+
expect(json["id_0"]).to eq data["object_number"]
|
32
|
+
end
|
33
|
+
|
34
|
+
it "rejects a template that does not match by extension" do
|
35
|
+
data = {"title" => "Title"}
|
36
|
+
expect {
|
37
|
+
JSON.parse(ArchivesSpace::Template::Erb.new("resource.json.jbuilder", data).process)
|
38
|
+
}.to raise_error "Invalid template"
|
39
|
+
end
|
26
40
|
end
|
@@ -6,30 +6,38 @@ http_interactions:
|
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
9
|
-
headers:
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Content-Length:
|
13
|
+
- nnnn
|
14
|
+
User-Agent:
|
15
|
+
- ArchivesSpaceClient/0.3.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
10
20
|
response:
|
11
21
|
status:
|
12
22
|
code: 200
|
13
23
|
message: OK
|
14
24
|
headers:
|
15
|
-
Date:
|
16
|
-
- Sat, 26 Dec 2015 05:05:14 GMT
|
17
|
-
Content-Type:
|
18
|
-
- application/json
|
19
25
|
Cache-Control:
|
20
26
|
- private, must-revalidate, max-age=0
|
21
|
-
Content-
|
22
|
-
-
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
23
29
|
X-Content-Type-Options:
|
24
30
|
- nosniff
|
31
|
+
Content-Length:
|
32
|
+
- '3087'
|
25
33
|
Server:
|
26
|
-
- Jetty(
|
34
|
+
- Jetty(9.4.44.v20210927)
|
27
35
|
body:
|
28
36
|
encoding: UTF-8
|
29
|
-
string:
|
30
|
-
|
31
|
-
|
32
|
-
recorded_at:
|
37
|
+
string: '{"session":"24622209ad0b8c8b7223f13ec1bdad594856eaab6461264cbf7f177fd18bcde1","user":{"lock_version":19,"username":"admin","name":"Administrator","source":"DBAuth","is_system_user":true,"create_time":"2016-10-05T06:24:16Z","system_mtime":"2023-12-29T18:41:21Z","user_mtime":"2023-12-29T18:41:21Z","is_active_user":true,"jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","update_container_profile_record","update_location_profile_record","update_enumeration_record","administer_system","manage_users","become_user","view_all_records","create_repository","delete_repository","transfer_repository","index_system","manage_repository","update_accession_record","update_resource_record","update_digital_object_record","update_event_record","delete_event_record","suppress_archival_record","transfer_archival_record","delete_archival_record","view_suppressed","view_repository","update_classification_record","delete_classification_record","mediate_edits","import_records","cancel_importer_job","manage_subject_record","manage_agent_record","manage_vocabulary_record","merge_agents_and_subjects","merge_archival_record","manage_rde_templates","update_container_record","manage_container_record","manage_container_profile_record","manage_location_profile_record","update_assessment_record","delete_assessment_record","manage_assessment_attributes","create_job","cancel_job","view_agent_contact_record","manage_enumeration_record","manage_custom_report_templates"],"_archivesspace":["administer_system","manage_users","become_user","view_all_records","create_repository","delete_repository","transfer_repository","index_system","manage_repository","update_accession_record","update_resource_record","update_digital_object_record","update_event_record","delete_event_record","suppress_archival_record","transfer_archival_record","delete_archival_record","view_suppressed","view_repository","update_classification_record","delete_classification_record","mediate_edits","import_records","cancel_importer_job","manage_subject_record","manage_agent_record","manage_vocabulary_record","merge_agents_and_subjects","merge_archival_record","manage_rde_templates","update_container_record","manage_container_record","manage_container_profile_record","manage_location_profile_record","update_assessment_record","delete_assessment_record","manage_assessment_attributes","create_job","cancel_job","view_agent_contact_record","manage_enumeration_record","manage_custom_report_templates","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","update_container_profile_record","update_location_profile_record","update_enumeration_record"]}}}
|
38
|
+
|
39
|
+
'
|
40
|
+
recorded_at: Fri, 29 Dec 2023 18:41:25 GMT
|
33
41
|
- request:
|
34
42
|
method: get
|
35
43
|
uri: http://localhost:8089/version
|
@@ -38,31 +46,34 @@ http_interactions:
|
|
38
46
|
string: ''
|
39
47
|
headers:
|
40
48
|
X-Archivesspace-Session:
|
41
|
-
-
|
49
|
+
- 24622209ad0b8c8b7223f13ec1bdad594856eaab6461264cbf7f177fd18bcde1
|
50
|
+
User-Agent:
|
51
|
+
- ArchivesSpaceClient/0.3.0
|
52
|
+
Accept-Encoding:
|
53
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
54
|
+
Accept:
|
55
|
+
- "*/*"
|
42
56
|
response:
|
43
57
|
status:
|
44
58
|
code: 200
|
45
59
|
message: OK
|
46
60
|
headers:
|
47
|
-
Date:
|
48
|
-
- Sat, 26 Dec 2015 05:05:14 GMT
|
49
|
-
Content-Type:
|
50
|
-
- text/html;charset=UTF-8
|
51
61
|
Cache-Control:
|
52
62
|
- private, must-revalidate, max-age=0
|
53
|
-
Content-
|
54
|
-
-
|
63
|
+
Content-Type:
|
64
|
+
- text/html;charset=utf-8
|
55
65
|
X-Xss-Protection:
|
56
66
|
- 1; mode=block
|
57
67
|
X-Content-Type-Options:
|
58
68
|
- nosniff
|
59
69
|
X-Frame-Options:
|
60
70
|
- SAMEORIGIN
|
71
|
+
Content-Length:
|
72
|
+
- '22'
|
61
73
|
Server:
|
62
|
-
- Jetty(
|
74
|
+
- Jetty(9.4.44.v20210927)
|
63
75
|
body:
|
64
76
|
encoding: UTF-8
|
65
|
-
string: ArchivesSpace (
|
66
|
-
|
67
|
-
|
68
|
-
recorded_with: VCR 3.0.1
|
77
|
+
string: ArchivesSpace (v3.4.1)
|
78
|
+
recorded_at: Fri, 29 Dec 2023 18:41:25 GMT
|
79
|
+
recorded_with: VCR 6.2.0
|
metadata
CHANGED
@@ -1,113 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archivesspace-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Cooper
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: awesome_print
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
19
|
+
version: '2.0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
26
|
+
version: '2.0'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: capybara_discoball
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
|
-
- - "
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: cucumber
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
31
|
+
- - "~>"
|
74
32
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
33
|
+
version: 0.1.0
|
76
34
|
type: :development
|
77
35
|
prerelease: false
|
78
36
|
version_requirements: !ruby/object:Gem::Requirement
|
79
37
|
requirements:
|
80
|
-
- - "
|
38
|
+
- - "~>"
|
81
39
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
40
|
+
version: 0.1.0
|
83
41
|
- !ruby/object:Gem::Dependency
|
84
42
|
name: json_spec
|
85
43
|
requirement: !ruby/object:Gem::Requirement
|
86
44
|
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.1'
|
87
48
|
- - ">="
|
88
49
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
50
|
+
version: 1.1.5
|
90
51
|
type: :development
|
91
52
|
prerelease: false
|
92
53
|
version_requirements: !ruby/object:Gem::Requirement
|
93
54
|
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.1'
|
94
58
|
- - ">="
|
95
59
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
60
|
+
version: 1.1.5
|
97
61
|
- !ruby/object:Gem::Dependency
|
98
62
|
name: rake
|
99
63
|
requirement: !ruby/object:Gem::Requirement
|
100
64
|
requirements:
|
101
65
|
- - "~>"
|
102
66
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
67
|
+
version: '13.0'
|
104
68
|
type: :development
|
105
69
|
prerelease: false
|
106
70
|
version_requirements: !ruby/object:Gem::Requirement
|
107
71
|
requirements:
|
108
72
|
- - "~>"
|
109
73
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
74
|
+
version: '13.0'
|
111
75
|
- !ruby/object:Gem::Dependency
|
112
76
|
name: rspec
|
113
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,58 +90,58 @@ dependencies:
|
|
126
90
|
name: rubocop
|
127
91
|
requirement: !ruby/object:Gem::Requirement
|
128
92
|
requirements:
|
129
|
-
- -
|
93
|
+
- - '='
|
130
94
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
95
|
+
version: '1.56'
|
132
96
|
type: :development
|
133
97
|
prerelease: false
|
134
98
|
version_requirements: !ruby/object:Gem::Requirement
|
135
99
|
requirements:
|
136
|
-
- -
|
100
|
+
- - '='
|
137
101
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
102
|
+
version: '1.56'
|
139
103
|
- !ruby/object:Gem::Dependency
|
140
104
|
name: standard
|
141
105
|
requirement: !ruby/object:Gem::Requirement
|
142
106
|
requirements:
|
143
|
-
- -
|
107
|
+
- - '='
|
144
108
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
109
|
+
version: 1.31.0
|
146
110
|
type: :development
|
147
111
|
prerelease: false
|
148
112
|
version_requirements: !ruby/object:Gem::Requirement
|
149
113
|
requirements:
|
150
|
-
- -
|
114
|
+
- - '='
|
151
115
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
116
|
+
version: 1.31.0
|
153
117
|
- !ruby/object:Gem::Dependency
|
154
118
|
name: vcr
|
155
119
|
requirement: !ruby/object:Gem::Requirement
|
156
120
|
requirements:
|
157
121
|
- - '='
|
158
122
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
123
|
+
version: 6.2.0
|
160
124
|
type: :development
|
161
125
|
prerelease: false
|
162
126
|
version_requirements: !ruby/object:Gem::Requirement
|
163
127
|
requirements:
|
164
128
|
- - '='
|
165
129
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
130
|
+
version: 6.2.0
|
167
131
|
- !ruby/object:Gem::Dependency
|
168
132
|
name: webmock
|
169
133
|
requirement: !ruby/object:Gem::Requirement
|
170
134
|
requirements:
|
171
135
|
- - '='
|
172
136
|
- !ruby/object:Gem::Version
|
173
|
-
version: 3.
|
137
|
+
version: 3.19.1
|
174
138
|
type: :development
|
175
139
|
prerelease: false
|
176
140
|
version_requirements: !ruby/object:Gem::Requirement
|
177
141
|
requirements:
|
178
142
|
- - '='
|
179
143
|
- !ruby/object:Gem::Version
|
180
|
-
version: 3.
|
144
|
+
version: 3.19.1
|
181
145
|
- !ruby/object:Gem::Dependency
|
182
146
|
name: dry-cli
|
183
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,10 +198,25 @@ dependencies:
|
|
234
198
|
- - "~>"
|
235
199
|
- !ruby/object:Gem::Version
|
236
200
|
version: '1.10'
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: jbuilder
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - "~>"
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: 2.11.5
|
208
|
+
type: :runtime
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - "~>"
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 2.11.5
|
237
215
|
description: Interact with ArchivesSpace via the API.
|
238
216
|
email:
|
239
217
|
- mark.c.cooper@outlook.com
|
240
|
-
executables:
|
218
|
+
executables:
|
219
|
+
- asclient
|
241
220
|
extensions: []
|
242
221
|
extra_rdoc_files: []
|
243
222
|
files:
|
@@ -246,15 +225,17 @@ files:
|
|
246
225
|
- ".gitignore"
|
247
226
|
- ".rspec"
|
248
227
|
- ".rubocop.yml"
|
249
|
-
- ".
|
228
|
+
- ".ruby-version"
|
250
229
|
- Gemfile
|
251
230
|
- LICENSE.txt
|
252
231
|
- README.md
|
253
232
|
- Rakefile
|
254
233
|
- archivesspace-client.gemspec
|
234
|
+
- bin/console
|
255
235
|
- examples/export.rb
|
256
236
|
- examples/password_reset.rb
|
257
237
|
- examples/repo_and_user.rb
|
238
|
+
- examples/templates.rb
|
258
239
|
- examples/test_connection.rb
|
259
240
|
- examples/user_groups.rb
|
260
241
|
- exe/asclient
|
@@ -275,6 +256,7 @@ files:
|
|
275
256
|
- lib/archivesspace/client/templates/digital_object.json.erb
|
276
257
|
- lib/archivesspace/client/templates/repository.json.erb
|
277
258
|
- lib/archivesspace/client/templates/repository_with_agent.json.erb
|
259
|
+
- lib/archivesspace/client/templates/resource.json.jbuilder
|
278
260
|
- lib/archivesspace/client/templates/user.json.erb
|
279
261
|
- lib/archivesspace/client/version.rb
|
280
262
|
- spec/archivesspace/client_spec.rb
|
@@ -301,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
283
|
- !ruby/object:Gem::Version
|
302
284
|
version: '0'
|
303
285
|
requirements: []
|
304
|
-
rubygems_version: 3.
|
286
|
+
rubygems_version: 3.5.9
|
305
287
|
signing_key:
|
306
288
|
specification_version: 4
|
307
289
|
summary: Interact with ArchivesSpace via the API.
|
data/.travis.yml
DELETED