atlas_rb 0.0.94 → 0.0.95
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/Gemfile.lock +1 -1
- data/lib/atlas_rb/collection.rb +33 -1
- data/lib/atlas_rb/community.rb +33 -1
- data/lib/atlas_rb/work.rb +65 -1
- 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: 2f04b74aca7b48fdba1f279e1b818cacc6e34be23c96a12b90c7cdd201ee0904
|
|
4
|
+
data.tar.gz: 9aeefc94a12ac0d8798e4fbf0d5edd5a9d6dacf9a6ec540184e2617b0cb0d5cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e028b1c2439beff9c27bc2f6a98082f7b76ebe86b7a16620c0a3d8aadfe5bc2463093e4c70f7d91198cf04a38100c4ea311f3415195743640aeb833b7847df3b
|
|
7
|
+
data.tar.gz: 4730752d8d3df7ec5715d7ae0bc71c892944a3ee215659f611d4216be171a284f3d71bf3413b2d4db17404641691f4c18836d7246b0d8045e0128552e22e069b
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.95
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/collection.rb
CHANGED
|
@@ -125,7 +125,12 @@ module AtlasRb
|
|
|
125
125
|
AtlasRb::Mash.new(JSON.parse(multipart({}).patch(ROUTE + id, payload)&.body))
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
-
# Patch individual metadata fields without uploading a
|
|
128
|
+
# Patch individual descriptive-metadata fields without uploading a
|
|
129
|
+
# full MODS document.
|
|
130
|
+
#
|
|
131
|
+
# Scoped to user-authored descriptive metadata only. Programmatic
|
|
132
|
+
# writes of machine-set Delegate URIs (thumbnails) have their own
|
|
133
|
+
# purpose-specific endpoint — see {.set_thumbnails}.
|
|
129
134
|
#
|
|
130
135
|
# @param id [String] the Collection ID.
|
|
131
136
|
# @param values [Hash] field-level metadata updates.
|
|
@@ -137,6 +142,33 @@ module AtlasRb
|
|
|
137
142
|
AtlasRb::Mash.new(JSON.parse(connection({ metadata: values }).patch(ROUTE + id)&.body))
|
|
138
143
|
end
|
|
139
144
|
|
|
145
|
+
# Attach the three thumbnail/preview Delegate URIs to a Collection.
|
|
146
|
+
#
|
|
147
|
+
# Collection-level mirror of {Work.set_thumbnails}. Atlas dispatches
|
|
148
|
+
# each non-blank URI to its matching Delegate role
|
|
149
|
+
# (`thumbnail_image` / `thumbnail_image_2x` / `preview_image`) via
|
|
150
|
+
# `DelegateUpdater`. Missing keys are left untouched.
|
|
151
|
+
#
|
|
152
|
+
# @param id [String] the Collection ID.
|
|
153
|
+
# @param thumbnail [String, nil] IIIF URI for the ~85² thumbnail.
|
|
154
|
+
# @param thumbnail_2x [String, nil] IIIF URI for the ~170² 2x thumbnail.
|
|
155
|
+
# @param preview [String, nil] IIIF URI for the ~500w preview image.
|
|
156
|
+
# @return [AtlasRb::Mash] the parsed JSON response.
|
|
157
|
+
#
|
|
158
|
+
# @example
|
|
159
|
+
# AtlasRb::Collection.set_thumbnails(
|
|
160
|
+
# "col-456",
|
|
161
|
+
# thumbnail: "https://iiif.example.edu/iiif/3/c.jp2/full/!85,85/0/default.jpg",
|
|
162
|
+
# thumbnail_2x: "https://iiif.example.edu/iiif/3/c.jp2/full/!170,170/0/default.jpg",
|
|
163
|
+
# preview: "https://iiif.example.edu/iiif/3/c.jp2/full/500,/0/default.jpg"
|
|
164
|
+
# )
|
|
165
|
+
def self.set_thumbnails(id, thumbnail: nil, thumbnail_2x: nil, preview: nil)
|
|
166
|
+
body = { thumbnail: thumbnail, thumbnail_2x: thumbnail_2x, preview: preview }.compact
|
|
167
|
+
AtlasRb::Mash.new(JSON.parse(
|
|
168
|
+
connection({}).patch(ROUTE + id + '/thumbnails', JSON.dump(body))&.body
|
|
169
|
+
))
|
|
170
|
+
end
|
|
171
|
+
|
|
140
172
|
# Fetch the Collection's MODS representation in the requested format.
|
|
141
173
|
#
|
|
142
174
|
# @param id [String] the Collection ID.
|
data/lib/atlas_rb/community.rb
CHANGED
|
@@ -130,7 +130,12 @@ module AtlasRb
|
|
|
130
130
|
AtlasRb::Mash.new(JSON.parse(multipart({}).patch(ROUTE + id, payload)&.body))
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
# Patch individual metadata fields without uploading a
|
|
133
|
+
# Patch individual descriptive-metadata fields without uploading a
|
|
134
|
+
# full MODS document.
|
|
135
|
+
#
|
|
136
|
+
# Scoped to user-authored descriptive metadata only. Programmatic
|
|
137
|
+
# writes of machine-set Delegate URIs (thumbnails) have their own
|
|
138
|
+
# purpose-specific endpoint — see {.set_thumbnails}.
|
|
134
139
|
#
|
|
135
140
|
# @param id [String] the Community ID.
|
|
136
141
|
# @param values [Hash] field-level metadata updates (shape determined by
|
|
@@ -143,6 +148,33 @@ module AtlasRb
|
|
|
143
148
|
AtlasRb::Mash.new(JSON.parse(connection({ metadata: values }).patch(ROUTE + id)&.body))
|
|
144
149
|
end
|
|
145
150
|
|
|
151
|
+
# Attach the three thumbnail/preview Delegate URIs to a Community.
|
|
152
|
+
#
|
|
153
|
+
# Community-level mirror of {Work.set_thumbnails}. Atlas dispatches
|
|
154
|
+
# each non-blank URI to its matching Delegate role
|
|
155
|
+
# (`thumbnail_image` / `thumbnail_image_2x` / `preview_image`) via
|
|
156
|
+
# `DelegateUpdater`. Missing keys are left untouched.
|
|
157
|
+
#
|
|
158
|
+
# @param id [String] the Community ID.
|
|
159
|
+
# @param thumbnail [String, nil] IIIF URI for the ~85² thumbnail.
|
|
160
|
+
# @param thumbnail_2x [String, nil] IIIF URI for the ~170² 2x thumbnail.
|
|
161
|
+
# @param preview [String, nil] IIIF URI for the ~500w preview image.
|
|
162
|
+
# @return [AtlasRb::Mash] the parsed JSON response.
|
|
163
|
+
#
|
|
164
|
+
# @example
|
|
165
|
+
# AtlasRb::Community.set_thumbnails(
|
|
166
|
+
# "c-123",
|
|
167
|
+
# thumbnail: "https://iiif.example.edu/iiif/3/m.jp2/full/!85,85/0/default.jpg",
|
|
168
|
+
# thumbnail_2x: "https://iiif.example.edu/iiif/3/m.jp2/full/!170,170/0/default.jpg",
|
|
169
|
+
# preview: "https://iiif.example.edu/iiif/3/m.jp2/full/500,/0/default.jpg"
|
|
170
|
+
# )
|
|
171
|
+
def self.set_thumbnails(id, thumbnail: nil, thumbnail_2x: nil, preview: nil)
|
|
172
|
+
body = { thumbnail: thumbnail, thumbnail_2x: thumbnail_2x, preview: preview }.compact
|
|
173
|
+
AtlasRb::Mash.new(JSON.parse(
|
|
174
|
+
connection({}).patch(ROUTE + id + '/thumbnails', JSON.dump(body))&.body
|
|
175
|
+
))
|
|
176
|
+
end
|
|
177
|
+
|
|
146
178
|
# Fetch the Community's MODS representation in the requested format.
|
|
147
179
|
#
|
|
148
180
|
# @param id [String] the Community ID.
|
data/lib/atlas_rb/work.rb
CHANGED
|
@@ -177,7 +177,13 @@ module AtlasRb
|
|
|
177
177
|
AtlasRb::Mash.new(JSON.parse(multipart({}).patch(ROUTE + id, payload)&.body))
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
-
# Patch individual metadata fields without uploading a
|
|
180
|
+
# Patch individual descriptive-metadata fields without uploading a
|
|
181
|
+
# full MODS document.
|
|
182
|
+
#
|
|
183
|
+
# Scoped to user-authored descriptive metadata only. Programmatic
|
|
184
|
+
# writes of machine-set Delegate URIs (thumbnails, image
|
|
185
|
+
# derivatives) have their own purpose-specific endpoints — see
|
|
186
|
+
# {.set_thumbnails} and {.set_image_derivatives}.
|
|
181
187
|
#
|
|
182
188
|
# @param id [String] the Work ID.
|
|
183
189
|
# @param values [Hash] field-level metadata updates.
|
|
@@ -189,6 +195,64 @@ module AtlasRb
|
|
|
189
195
|
AtlasRb::Mash.new(JSON.parse(connection({ metadata: values }).patch(ROUTE + id)&.body))
|
|
190
196
|
end
|
|
191
197
|
|
|
198
|
+
# Attach the three thumbnail/preview Delegate URIs to a Work.
|
|
199
|
+
#
|
|
200
|
+
# Purpose-specific PATCH for the `thumbnail_image` /
|
|
201
|
+
# `thumbnail_image_2x` / `preview_image` Delegate roles. Atlas
|
|
202
|
+
# dispatches each URI to its matching role via `DelegateUpdater`.
|
|
203
|
+
# Distinct from {.metadata} — these are machine-set IIIF URIs, not
|
|
204
|
+
# user-authored descriptive content. Missing keys are left
|
|
205
|
+
# untouched server-side; only the URIs you pass are upserted.
|
|
206
|
+
#
|
|
207
|
+
# @param id [String] the Work ID.
|
|
208
|
+
# @param thumbnail [String, nil] IIIF URI for the ~85² thumbnail.
|
|
209
|
+
# @param thumbnail_2x [String, nil] IIIF URI for the ~170² 2x thumbnail.
|
|
210
|
+
# @param preview [String, nil] IIIF URI for the ~500w preview image.
|
|
211
|
+
# @return [AtlasRb::Mash] the parsed JSON response.
|
|
212
|
+
#
|
|
213
|
+
# @example
|
|
214
|
+
# AtlasRb::Work.set_thumbnails(
|
|
215
|
+
# "w-789",
|
|
216
|
+
# thumbnail: "https://iiif.example.edu/iiif/3/abc.jp2/full/!85,85/0/default.jpg",
|
|
217
|
+
# thumbnail_2x: "https://iiif.example.edu/iiif/3/abc.jp2/full/!170,170/0/default.jpg",
|
|
218
|
+
# preview: "https://iiif.example.edu/iiif/3/abc.jp2/full/500,/0/default.jpg"
|
|
219
|
+
# )
|
|
220
|
+
def self.set_thumbnails(id, thumbnail: nil, thumbnail_2x: nil, preview: nil)
|
|
221
|
+
body = { thumbnail: thumbnail, thumbnail_2x: thumbnail_2x, preview: preview }.compact
|
|
222
|
+
AtlasRb::Mash.new(JSON.parse(
|
|
223
|
+
connection({}).patch(ROUTE + id + '/thumbnails', JSON.dump(body))&.body
|
|
224
|
+
))
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Attach the three image-derivative Delegate URIs to a Work.
|
|
228
|
+
#
|
|
229
|
+
# Sibling of {.set_thumbnails} for the `small_image` /
|
|
230
|
+
# `medium_image` / `large_image` Delegate roles. Atlas dispatches
|
|
231
|
+
# each URI to its matching role via `DelegateUpdater`. The
|
|
232
|
+
# resulting Delegates are downloadable and surface through
|
|
233
|
+
# {.assets} for the downloads UI. Missing keys are left untouched
|
|
234
|
+
# server-side; only the URIs you pass are upserted.
|
|
235
|
+
#
|
|
236
|
+
# @param id [String] the Work ID.
|
|
237
|
+
# @param small [String, nil] IIIF URI for the small derivative.
|
|
238
|
+
# @param medium [String, nil] IIIF URI for the medium derivative.
|
|
239
|
+
# @param large [String, nil] IIIF URI for the large derivative.
|
|
240
|
+
# @return [AtlasRb::Mash] the parsed JSON response.
|
|
241
|
+
#
|
|
242
|
+
# @example
|
|
243
|
+
# AtlasRb::Work.set_image_derivatives(
|
|
244
|
+
# "w-789",
|
|
245
|
+
# small: "https://iiif.example.edu/iiif/3/abc.jp2/full/800,/0/default.jpg",
|
|
246
|
+
# medium: "https://iiif.example.edu/iiif/3/abc.jp2/full/1600,/0/default.jpg",
|
|
247
|
+
# large: "https://iiif.example.edu/iiif/3/abc.jp2/full/full/0/default.jpg"
|
|
248
|
+
# )
|
|
249
|
+
def self.set_image_derivatives(id, small: nil, medium: nil, large: nil)
|
|
250
|
+
body = { small: small, medium: medium, large: large }.compact
|
|
251
|
+
AtlasRb::Mash.new(JSON.parse(
|
|
252
|
+
connection({}).patch(ROUTE + id + '/image_derivatives', JSON.dump(body))&.body
|
|
253
|
+
))
|
|
254
|
+
end
|
|
255
|
+
|
|
192
256
|
# List the assets attached to a Work — {Blob}s and {Delegate}s alike.
|
|
193
257
|
#
|
|
194
258
|
# Useful for building download UIs — the response includes enough to
|
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: 0.0.
|
|
4
|
+
version: 0.0.95
|
|
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-05-
|
|
11
|
+
date: 2026-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|