atlas_rb 1.22.0 → 1.23.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: 547ea9704ea6c2845a7573bd9518cca8d96b3a65eb3792642e3944f99ae1853a
4
- data.tar.gz: 6c3754d4d4a6c509599e66c9062268b3c30c1b967a536b0231249a0010567c19
3
+ metadata.gz: 8df0d572649e0456aa2a8e77b436114aa3a91a2fbfe0e6c05ce2a8426dd7c6ff
4
+ data.tar.gz: e368597905337f62111f4e649eb88a75f5e06c85202ff3dcf5cc3e99d283d948
5
5
  SHA512:
6
- metadata.gz: b259694bf763b09743fc3c64fcd7f612202dec0249f35a8f3c1e211007235425de0c8d1f4c6235a5c9d3256022adb87cfffa9a43275eb25e29f2051579cc128e
7
- data.tar.gz: 8e09316edfca23f4d966ca9c4e49d7d410711241e420fa0c4f01dfa1541c66d07907e6263640b1749b2b19203709441d3282f494b5526218c583116cc19b24e5
6
+ metadata.gz: 005ae8ac014dab468bbfb9c5da901c926ba2c746d78c3bedadda431e310d3d21b99f547b91f8e33563784ba45a782cefa4155c7fcfc35a09c11c8e9f43d9fe5b
7
+ data.tar.gz: 2d35888d562851ec0ad7cd9419faceee619568723f98c1a34e172ac01f33c56e2ae8491eedae2d851067969acfdd02bf6439364d3b2517448cfadb0a13436fa9
data/.version CHANGED
@@ -1 +1 @@
1
- 1.22.0
1
+ 1.23.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.0
4
+
5
+ These bindings need Atlas 0.6.212 or later.
6
+
7
+ ### Added — `Work.withdrawn_assets`, the listing a Restore needs
8
+
9
+ ```ruby
10
+ AtlasRb::Work.withdrawn_assets(work_id, nuid: admin_nuid).each do |asset|
11
+ AtlasRb::Admin::Resource.restore(asset.file_set, nuid: admin_nuid)
12
+ end
13
+ ```
14
+
15
+ A FileSet withdrawn with `Resource.tombstone` drops out of `Work.assets` and
16
+ `Work.file_sets`, so nothing listed it. This read lists the assets of a Work's
17
+ withdrawn FileSets, in the `Work.assets` shape plus the FileSet's
18
+ `tombstoned_at` and `tombstoned_by`. Atlas allows it for the admin and
19
+ devolved-admin tiers; anyone else gets a `403`, which raises `ResourceError`. A
20
+ missing Work returns `nil`.
21
+
22
+ ### Documented — `file_set` on every `Work.assets` and `Work.file_sets` entry
23
+
24
+ Each asset entry carries the NOID of the FileSet it is listed under. That is
25
+ the id `Resource.tombstone` and `Admin::Resource.restore` take, so a caller no
26
+ longer needs `Blob.ancestry` to find it. No reader change.
27
+
3
28
  ## 1.22.0
4
29
 
5
30
  These bindings need Atlas 0.6.211 or later.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.22.0)
4
+ atlas_rb (1.23.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
data/lib/atlas_rb/work.rb CHANGED
@@ -440,7 +440,11 @@ module AtlasRb
440
440
  # A Blob entry also carries `language` and `track_label`, set by {Blob.create}
441
441
  # and {Blob.update} for a caption or other text track and `nil` otherwise
442
442
  # (Atlas 0.6.211 or later). A FileSet withdrawn with {Resource.tombstone}
443
- # drops out of this listing and {.file_sets}.
443
+ # drops out of this listing and {.file_sets}; {.withdrawn_assets} lists it.
444
+ #
445
+ # Every entry carries `file_set`, the NOID of the FileSet it is listed
446
+ # under (Atlas 0.6.212 or later). That is the id {Resource.tombstone} and
447
+ # {Admin::Resource.restore} take to withdraw or restore the file.
444
448
  #
445
449
  # @param id [String] the Work ID.
446
450
  # @param nuid [String, nil] optional acting user's NUID. On the relay-signing
@@ -465,6 +469,44 @@ module AtlasRb
465
469
  end
466
470
  end
467
471
 
472
+ # List the assets of a Work's withdrawn FileSets, so they can be restored.
473
+ #
474
+ # Wraps `GET /works/<id>/withdrawn_assets` (Atlas 0.6.212 or later). A
475
+ # FileSet withdrawn with {Resource.tombstone} drops out of {.assets} and
476
+ # {.file_sets}; this is the listing that still names it. Each entry has the
477
+ # {.assets} shape, including `file_set` (the id to pass to
478
+ # {Admin::Resource.restore}), plus the FileSet's `tombstoned_at` and
479
+ # `tombstoned_by`.
480
+ #
481
+ # Atlas allows it for the admin and devolved-admin tiers only, the same
482
+ # tiers that may tombstone and restore a FileSet.
483
+ #
484
+ # @param id [String] the Work ID.
485
+ # @param nuid [String, nil] optional acting user's NUID. On the relay-signing
486
+ # path it is signed into the assertion `sub`; on the BYO-JWT (`ATLAS_JWT`)
487
+ # path it is ignored (identity lives in the token).
488
+ # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
489
+ # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
490
+ # omitted.
491
+ # @return [Array<AtlasRb::Mash>, nil] one entry per asset of a withdrawn
492
+ # FileSet; `[]` when nothing is withdrawn.
493
+ #
494
+ # `nil` when Atlas answers `404` — nothing is there to read, or, with a
495
+ # misconfigured `ATLAS_URL`, the route is not Atlas's at all.
496
+ # @raise [AtlasRb::ResourceError] on any non-2xx other than `404` / `410`
497
+ # (a `403` for a caller below the delegate tier, a `5xx`, a proxy's
498
+ # `503`), carrying Atlas's status and body so the failure is attributable
499
+ # at the boundary.
500
+ # @example Offer Restore for a removed caption
501
+ # AtlasRb::Work.withdrawn_assets("w-789", nuid: admin_nuid).each do |a|
502
+ # AtlasRb::Admin::Resource.restore(a.file_set, nuid: admin_nuid)
503
+ # end
504
+ def self.withdrawn_assets(id, nuid: nil, on_behalf_of: nil)
505
+ read_body(connection({}, nuid, on_behalf_of: on_behalf_of).get(ROUTE + id + '/withdrawn_assets')) do |body|
506
+ body.map { |entry| AtlasRb::Mash.new(entry) }
507
+ end
508
+ end
509
+
468
510
  # List a Work's page FileSets in order, each with its assets.
469
511
  #
470
512
  # Wraps `GET /works/<id>/file_sets` — the ordered, grouped sibling of
@@ -473,7 +515,7 @@ module AtlasRb
473
515
  # (`null`-position) FileSets last; metadata and derivative-container
474
516
  # FileSets are excluded as entries. Each entry nests its downloadable
475
517
  # assets — the page's content Blobs plus any per-page IIIF Delegates —
476
- # in the same polymorphic shape {.assets} returns.
518
+ # in the same polymorphic shape {.assets} returns, `file_set` included.
477
519
  #
478
520
  # This is the read a IIIF Presentation manifest assembler needs: the
479
521
  # response is **unpaginated** by design, so the whole page sequence
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.22.0
4
+ version: 1.23.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-29 00:00:00.000000000 Z
11
+ date: 2026-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday