atlas_rb 1.1.0 → 1.1.1
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/.version +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/atlas_rb/work.rb +15 -2
- 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: 9660fb0f48db5601e75f8fb0579794cd398d42fbdbe1c2e849b67bb32569d9c1
|
|
4
|
+
data.tar.gz: fa8f43e4f7577027c3368e30f4ebf5c231202edbcaa1004ef0711582925680ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b98eab79df77eda36139468d6701ea8e56f5ae16ee85e3ef22635bc11f42aed762654bd9dbf02b87a4f8521bb4de335724b249c3700397d748572bd734bf62b4
|
|
7
|
+
data.tar.gz: c8f565644a54f99e6110131e6d1b361c21f51e068c565837c5226d21eb700b488fa13e1be9e59d591b587b4303196c785abf0c1fc8bb5eec000840b1515f2961
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`depositor:` kwarg on `AtlasRb::Work.create`** — optional NUID
|
|
8
|
+
forwarded as the `depositor` query param on `POST /works`. When
|
|
9
|
+
omitted, behaviour is unchanged: Atlas defaults the depositor to the
|
|
10
|
+
acting user. When provided, Atlas stamps the named NUID as the Work's
|
|
11
|
+
`depositor` and records the acting user as the `proxy_uploader`.
|
|
12
|
+
|
|
13
|
+
Motivation: proxy deposit. Librarians and bulk-deposit jobs frequently
|
|
14
|
+
upload Works on behalf of a researcher who is the rightful credited
|
|
15
|
+
depositor. Until now there was no way to express that split through
|
|
16
|
+
the gem — callers had to choose between misattributing the deposit to
|
|
17
|
+
the librarian or dropping to a raw Faraday call. The depositor is
|
|
18
|
+
immutable post-create; there is no corresponding setter on the update
|
|
19
|
+
surface.
|
|
20
|
+
|
|
3
21
|
## 1.1.0
|
|
4
22
|
|
|
5
23
|
### Added
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/work.rb
CHANGED
|
@@ -93,6 +93,13 @@ module AtlasRb
|
|
|
93
93
|
# @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
|
|
94
94
|
# header. Falls through to {AtlasRb.config}.default_on_behalf_of when
|
|
95
95
|
# omitted.
|
|
96
|
+
# @param depositor [String, nil] optional NUID to stamp on the new Work's
|
|
97
|
+
# `depositor` field. When omitted, Atlas defaults the depositor to the
|
|
98
|
+
# acting user (`nuid:`); this kwarg is the proxy / batch escape hatch
|
|
99
|
+
# where the librarian who uploaded the Work is distinct from the person
|
|
100
|
+
# it should be attributed to. The acting user becomes the Work's
|
|
101
|
+
# `proxy_uploader`. The depositor is immutable post-create; there is no
|
|
102
|
+
# setter on the update surface.
|
|
96
103
|
# @return [Hash] the created Work payload (post-update if `xml_path` was
|
|
97
104
|
# supplied).
|
|
98
105
|
#
|
|
@@ -105,9 +112,15 @@ module AtlasRb
|
|
|
105
112
|
# @example Retry-safe bulk-deposit create
|
|
106
113
|
# key = SecureRandom.uuid
|
|
107
114
|
# AtlasRb::Work.create("col-456", idempotency_key: key)
|
|
108
|
-
|
|
115
|
+
#
|
|
116
|
+
# @example Proxy deposit — librarian uploads on behalf of a researcher
|
|
117
|
+
# AtlasRb::Work.create("col-456", depositor: "000000123")
|
|
118
|
+
def self.create(id, xml_path = nil, idempotency_key: nil, nuid: nil,
|
|
119
|
+
on_behalf_of: nil, depositor: nil)
|
|
120
|
+
params = { collection_id: id }
|
|
121
|
+
params[:depositor] = depositor if depositor
|
|
109
122
|
result = AtlasRb::Mash.new(JSON.parse(
|
|
110
|
-
connection(
|
|
123
|
+
connection(params, nuid,
|
|
111
124
|
on_behalf_of: on_behalf_of, idempotency_key: idempotency_key).post(ROUTE)&.body
|
|
112
125
|
))["work"]
|
|
113
126
|
return result unless xml_path.present?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: atlas_rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Cliff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|