atlas_rb 1.3.4 → 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: 3f1d65e6631474391c3971b939e6394049b6b5f4198a14ffd55bd5e9c51d2bbf
4
- data.tar.gz: d3371babc6a6aca8141a3692b399fd9989d5f8f29341ac376e3d1bed5850d0f4
3
+ metadata.gz: e15c24fddbec1fba3da8aef5e85d769ddf4861e9bccad136957b342515e34dab
4
+ data.tar.gz: 2044a925120234a5e3fa1553fc3fc4ec2b3dad05c4215af58697c157fc84cdff
5
5
  SHA512:
6
- metadata.gz: f9450d1ed3d4c77708b619c4c48686c35606cee0d8633d9fcd448440127398b613f2d664fb672bbfaccb0bf44143ccbf8731aac29e3d967f09b56177ab7517ae
7
- data.tar.gz: acb806ac1e60026594bac52eb124415439daa77ceb219cc5465dc961d16ab78b2dc481fe64256a5cbf109e67347170ac15e2f484fb7d19ea248b69406a950834
6
+ metadata.gz: a62880ec96483584dc82cacd3a186822ec7af2f64893ede345ccc73f071462106f21b753579dcb6eb9c391018860f828881d4fa7cbe191da4f3e8a76b27d6574
7
+ data.tar.gz: b4f66124c5b5c51e550a13b3c60a01a4ce9d6efaa771577be41d46d8f4172967d5124441db1a2a55c44717b92898175643c35d74afe550405a5d57a75fe73767
data/.version CHANGED
@@ -1 +1 @@
1
- 1.3.4
1
+ 1.3.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Added — `Compilation.list(q:)` title filter
6
+
7
+ `Compilation.list` accepts `q:`, a case-insensitive title substring
8
+ filter (Atlas v0.6.60, `GET /compilations?q=<term>`). The filter applies
9
+ before pagination, so the returned `"pagination"` block describes the
10
+ filtered result. Backs the Cerberus Add-to-set typeahead.
11
+
12
+ ```ruby
13
+ AtlasRb::Compilation.list(q: "course", nuid: "000000002")
14
+ ```
15
+
3
16
  ## 1.3.4
4
17
 
5
18
  ### Added — Compilation (DRS "Sets") bindings
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.3.4)
4
+ atlas_rb (1.3.6)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -57,10 +57,13 @@ module AtlasRb
57
57
  #
58
58
  # Defaults to the acting user's own Sets. Pass `owner:` to list another
59
59
  # user's — that is admin-only and raises {AtlasRb::ForbiddenError} for
60
- # anyone else. There is no public browse surface.
60
+ # anyone else. There is no public browse surface. Pass `q:` to narrow
61
+ # by case-insensitive title substring; the filter applies before
62
+ # pagination, so the `"pagination"` block describes the filtered result.
61
63
  #
62
64
  # @param owner [String, nil] NUID whose Sets to list (admin-only when it
63
65
  # isn't the acting user). Omit for "my Sets".
66
+ # @param q [String, nil] case-insensitive title substring filter.
64
67
  # @param page [Integer, nil] 1-indexed page number.
65
68
  # @param per_page [Integer, nil] page size override.
66
69
  # @param nuid [String, nil] optional acting user's NUID, forwarded as the
@@ -78,9 +81,13 @@ module AtlasRb
78
81
  #
79
82
  # @example Another user's Sets (admin)
80
83
  # AtlasRb::Compilation.list(owner: "000000002", nuid: "000000004")
81
- def self.list(owner: nil, page: nil, per_page: nil, nuid: nil, on_behalf_of: nil)
84
+ #
85
+ # @example Title typeahead
86
+ # AtlasRb::Compilation.list(q: "course", nuid: "000000002")
87
+ def self.list(owner: nil, q: nil, page: nil, per_page: nil, nuid: nil, on_behalf_of: nil)
82
88
  params = {}
83
89
  params[:owner] = owner if owner
90
+ params[:q] = q if q
84
91
  params[:page] = page if page
85
92
  params[:per_page] = per_page if per_page
86
93
  AtlasRb::Mash.new(JSON.parse(
@@ -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.4
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff