atlas_rb 1.23.0 → 1.24.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/.version +1 -1
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/atlas_rb/resource_writes.rb +11 -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: 6c096f45a9cfbbd11efce0d0d79f193341ff5d77081f920580ca20e1621423f1
|
|
4
|
+
data.tar.gz: 885250be775307675bb65533467f33edd8630e70a4dc8c249b1bd06d7ba26e2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d20b72fafff966ece826ff60782ebb33dad8826390ce682e663409affa982350fbfad3a1e1206c850a96f850b619a7964116c4bc8ef2377d2b4fc471726eb07
|
|
7
|
+
data.tar.gz: e8e92d11281fadf833efb1eaff9b3d41e65662202981bc4837c68adf00761c789d9aa42d82a8081caa3f010bbc455a57a4cf051458c5ebea0fa382f80f5b51bb
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.24.0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.24.0
|
|
4
|
+
|
|
5
|
+
These bindings need Atlas 0.6.213 or later.
|
|
6
|
+
|
|
7
|
+
### Added — `reason:` on `Resource.tombstone`
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
AtlasRb::Resource.tombstone(work_id, reason: "Removed from view by legal order", nuid: admin_nuid)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The library's withdrawal policy requires a note saying why an object was
|
|
14
|
+
removed, and fixes its wording. `reason:` must be one of the policy's five
|
|
15
|
+
notes, word for word. Atlas answers `422` with `invalid_reason` for any other
|
|
16
|
+
value, and the call returns that raw response as before. The note carries no
|
|
17
|
+
date: read `tombstoned_at` for that.
|
|
18
|
+
|
|
19
|
+
Community, Collection, Work and FileSet reads return the note as
|
|
20
|
+
`tombstone_reason`, including the `410` body of a tombstoned read. A restore
|
|
21
|
+
clears it. Omit the keyword to tombstone with no note, as before.
|
|
22
|
+
|
|
3
23
|
## 1.23.0
|
|
4
24
|
|
|
5
25
|
These bindings need Atlas 0.6.212 or later.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -543,7 +543,7 @@ write. The whole surface:
|
|
|
543
543
|
| `Resource.set_permissions(id, acl)` | `PATCH /resources/{id}/permissions` |
|
|
544
544
|
| `Resource.set_thumbnails(id, thumbnail:, thumbnail_2x:, preview:)` | `PATCH /resources/{id}/thumbnails` |
|
|
545
545
|
| `Resource.reparent(id, parent_id)` | `PATCH /resources/{id}/parent` |
|
|
546
|
-
| `Resource.tombstone(id)` | `POST /resources/{id}/tombstone` |
|
|
546
|
+
| `Resource.tombstone(id, reason:)` | `POST /resources/{id}/tombstone` |
|
|
547
547
|
| `Admin::Resource.restore(id)` | `POST /resources/{id}/restore` |
|
|
548
548
|
| `Admin::Resource.destroy(id, confirm: :i_understand)` | `DELETE /resources/{id}` |
|
|
549
549
|
|
|
@@ -144,14 +144,23 @@ module AtlasRb
|
|
|
144
144
|
# {Work.file_sets}. Atlas refuses a FileSet from anyone outside the admin and
|
|
145
145
|
# devolved-admin tiers with `403`, even a user who can edit the Work.
|
|
146
146
|
#
|
|
147
|
+
# `reason:` records why the resource was removed (Atlas 0.6.213 or later).
|
|
148
|
+
# It must be one of the removal notes the library's withdrawal policy
|
|
149
|
+
# allows, word for word; Atlas answers `422` with `invalid_reason` for any
|
|
150
|
+
# other value. The note carries no date: read `tombstoned_at` for that.
|
|
151
|
+
# The resource returns it as `tombstone_reason`, and a restore clears it.
|
|
152
|
+
#
|
|
147
153
|
# @param id [String] the resource's NOID.
|
|
154
|
+
# @param reason [String, nil] one of the policy's removal notes, or `nil`
|
|
155
|
+
# for none.
|
|
148
156
|
# @param nuid [String, nil] the acting user's NUID, stamped on the resource
|
|
149
157
|
# as `tombstoned_by`.
|
|
150
158
|
# @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
|
|
151
159
|
# header.
|
|
152
160
|
# @return [Faraday::Response] the raw response — read `status` yourself.
|
|
153
|
-
def self.tombstone(id, nuid: nil, on_behalf_of: nil)
|
|
154
|
-
connection({}, nuid, on_behalf_of: on_behalf_of)
|
|
161
|
+
def self.tombstone(id, reason: nil, nuid: nil, on_behalf_of: nil)
|
|
162
|
+
connection({}, nuid, on_behalf_of: on_behalf_of)
|
|
163
|
+
.post('/resources/' + id + '/tombstone', { reason: reason }.compact.to_json)
|
|
155
164
|
end
|
|
156
165
|
|
|
157
166
|
# Atlas answers a write with the resource under its type key, matching what
|
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.
|
|
4
|
+
version: 1.24.0
|
|
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-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|