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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8df0d572649e0456aa2a8e77b436114aa3a91a2fbfe0e6c05ce2a8426dd7c6ff
4
- data.tar.gz: e368597905337f62111f4e649eb88a75f5e06c85202ff3dcf5cc3e99d283d948
3
+ metadata.gz: 6c096f45a9cfbbd11efce0d0d79f193341ff5d77081f920580ca20e1621423f1
4
+ data.tar.gz: 885250be775307675bb65533467f33edd8630e70a4dc8c249b1bd06d7ba26e2f
5
5
  SHA512:
6
- metadata.gz: 005ae8ac014dab468bbfb9c5da901c926ba2c746d78c3bedadda431e310d3d21b99f547b91f8e33563784ba45a782cefa4155c7fcfc35a09c11c8e9f43d9fe5b
7
- data.tar.gz: 2d35888d562851ec0ad7cd9419faceee619568723f98c1a34e172ac01f33c56e2ae8491eedae2d851067969acfdd02bf6439364d3b2517448cfadb0a13436fa9
6
+ metadata.gz: 2d20b72fafff966ece826ff60782ebb33dad8826390ce682e663409affa982350fbfad3a1e1206c850a96f850b619a7964116c4bc8ef2377d2b4fc471726eb07
7
+ data.tar.gz: e8e92d11281fadf833efb1eaff9b3d41e65662202981bc4837c68adf00761c789d9aa42d82a8081caa3f010bbc455a57a4cf051458c5ebea0fa382f80f5b51bb
data/.version CHANGED
@@ -1 +1 @@
1
- 1.23.0
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.23.0)
4
+ atlas_rb (1.24.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
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).post('/resources/' + id + '/tombstone')
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.23.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2026-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday