atlas_rb 1.3.5 → 1.3.6

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: 21def65708de4960bb66f35c923b37b4caff75a7eb4c17721abb2e20982c8afc
4
- data.tar.gz: e75048782fac64edb37a5e8a4798b126a2939e70a38770f4b78848bfd77ca160
3
+ metadata.gz: e15c24fddbec1fba3da8aef5e85d769ddf4861e9bccad136957b342515e34dab
4
+ data.tar.gz: 2044a925120234a5e3fa1553fc3fc4ec2b3dad05c4215af58697c157fc84cdff
5
5
  SHA512:
6
- metadata.gz: 4e9a70d364d40dfc8f21b42d29c0eae9905b52d76858d855375af12590d2250f13b70af67be75d95384658041ac5676c37d4d78664cc8d8d623fab07cc45b246
7
- data.tar.gz: ea5156c1b8f0c842ed2ad3dc342fafd3153c0d9fd733c73a840a6aa6f8ff404bdd1854e026502a6a1f0e4a94b8c7959c0f8596a961c6aa204a82c1f5ca559653
6
+ metadata.gz: a62880ec96483584dc82cacd3a186822ec7af2f64893ede345ccc73f071462106f21b753579dcb6eb9c391018860f828881d4fa7cbe191da4f3e8a76b27d6574
7
+ data.tar.gz: b4f66124c5b5c51e550a13b3c60a01a4ce9d6efaa771577be41d46d8f4172967d5124441db1a2a55c44717b92898175643c35d74afe550405a5d57a75fe73767
data/.version CHANGED
@@ -1 +1 @@
1
- 1.3.5
1
+ 1.3.6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.3.5)
4
+ atlas_rb (1.3.6)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -123,5 +123,42 @@ module AtlasRb
123
123
  multipart(nuid, on_behalf_of: on_behalf_of).patch(ROUTE + id, payload)&.body
124
124
  ))
125
125
  end
126
+
127
+ # Persist the per-page IIIF image-service pointer on a FileSet.
128
+ #
129
+ # Purpose-specific PATCH for the `service_file` Delegate role — the
130
+ # Cantaloupe image-service base URI for this page's JP2, from which a
131
+ # viewer derives any size on demand via `info.json`. Atlas upserts the
132
+ # Delegate (re-setting never mints a duplicate), nesting it in a
133
+ # `:derivative` FileSet under the page; it surfaces in the ordered
134
+ # page listing ({Work.file_sets}) for IIIF manifest assembly.
135
+ #
136
+ # Sibling of {Work.set_thumbnails} / {Work.set_image_derivatives} —
137
+ # a machine-set IIIF URI, not user-authored descriptive content.
138
+ #
139
+ # @param id [String] the FileSet ID.
140
+ # @param uri [String] the IIIF image-service base URI for the page.
141
+ # @param nuid [String, nil] optional acting user's NUID, forwarded as the
142
+ # `User:` header. Required for cerberus-token requests; legacy bearer
143
+ # tokens still resolve without it.
144
+ # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
145
+ # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
146
+ # omitted.
147
+ # @return [AtlasRb::Mash] the updated `"file_set"` payload.
148
+ # @raise [AtlasRb::StaleResourceError] if Atlas reports an optimistic-lock
149
+ # conflict that exhausted its internal retry budget (HTTP 409 with
150
+ # `error: "stale_resource"`).
151
+ #
152
+ # @example
153
+ # AtlasRb::FileSet.set_iiif_service(
154
+ # "fs-001",
155
+ # "https://iiif.example.edu/iiif/3/abc.jp2"
156
+ # )
157
+ def self.set_iiif_service(id, uri, nuid: nil, on_behalf_of: nil)
158
+ AtlasRb::Mash.new(JSON.parse(
159
+ connection({}, nuid, on_behalf_of: on_behalf_of)
160
+ .patch(ROUTE + id + "/iiif_service", JSON.dump({ uri: uri }))&.body
161
+ ))
162
+ end
126
163
  end
127
164
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff