atlas_rb 1.8.8 → 1.8.9
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/resource.rb +46 -0
- 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: 1fd50831467b065989eb0ec39af5f96b87622c5d0e161e0e6a5bdef61764505a
|
|
4
|
+
data.tar.gz: 55c36e14086a0fab3776771c797af98c9a431cca3f0b09f14ffac478ab58067c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7aea8252388df4686a31174ca154b7e76da1d97dd16a8509f773bd2b918dfb282ccb93960f5138b0581df9d32d20c45a0f8cf4a1475dda787468644e1d83cdbd
|
|
7
|
+
data.tar.gz: 25e3ecf9a7cc353645a8a1ad76700523bba185895fcf1df13b9b098549a45287fb3a9c41abb0eefa559f5e1d8b4c8c4b81b7c16e5e418f4cee39e5f0d554dc56
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.8.
|
|
1
|
+
1.8.9
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/resource.rb
CHANGED
|
@@ -88,6 +88,52 @@ module AtlasRb
|
|
|
88
88
|
).map { |node| AtlasRb::Mash.new(node) }
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
+
# Every Work beneath a resource, at any depth — the structural counterpart
|
|
92
|
+
# to {Compilation.contents}. Wraps `GET /resources/<id>/descendant_works`,
|
|
93
|
+
# which flattens the resource's full descendant subtree to the Works it
|
|
94
|
+
# contains, gated to what the caller may read and paginated Solr-side. Gives
|
|
95
|
+
# a Collection the flatten-to-Works capability a Set already has, so a bulk
|
|
96
|
+
# export (e.g. hyperion) pages one gated, fast call family instead of the
|
|
97
|
+
# client-side `children → find_many → recurse` walk.
|
|
98
|
+
#
|
|
99
|
+
# Returns the same digest shape as {find_many} / {Compilation.contents}
|
|
100
|
+
# (`{ "id", "noid", "klass", "title", "thumbnail" }`) under a `"works"` key,
|
|
101
|
+
# plus a `"pagination"` envelope (`total` / `page` / `per_page` / `pages`).
|
|
102
|
+
# Membership is **structural** (`a_member_of`) only; pass
|
|
103
|
+
# `include_linked: true` to also surface linked members
|
|
104
|
+
# (`a_linked_member_of`). Restricted Works never appear for a caller who may
|
|
105
|
+
# not read them; tombstoned Works are dropped.
|
|
106
|
+
#
|
|
107
|
+
# @param id [String] an Atlas resource ID (subtree root; any type).
|
|
108
|
+
# @param page [Integer, nil] 1-based page (default 1 server-side).
|
|
109
|
+
# @param per_page [Integer, nil] page size (server default 25, capped 100).
|
|
110
|
+
# @param include_linked [Boolean, nil] also include linked members when
|
|
111
|
+
# truthy; structural-only by default.
|
|
112
|
+
# @param nuid [String, nil] optional acting user's NUID. On the relay-signing
|
|
113
|
+
# path it is signed into the assertion `sub`; on the BYO-JWT (`ATLAS_JWT`)
|
|
114
|
+
# path it is ignored (identity lives in the token).
|
|
115
|
+
# @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
|
|
116
|
+
# header. Falls through to {AtlasRb.config}.default_on_behalf_of when omitted.
|
|
117
|
+
# @return [AtlasRb::Mash, nil] the parsed envelope, with a `"works"` digest
|
|
118
|
+
# array and a `"pagination"` block; `nil` when the id resolves to nothing
|
|
119
|
+
# (`404`).
|
|
120
|
+
#
|
|
121
|
+
# @example Page a Collection's whole subtree of Works
|
|
122
|
+
# result = AtlasRb::Resource.descendant_works("col-456", per_page: 100)
|
|
123
|
+
# result["works"].map { |w| w["noid"] }
|
|
124
|
+
# result.dig("pagination", "pages")
|
|
125
|
+
def self.descendant_works(id, page: nil, per_page: nil, include_linked: nil, nuid: nil, on_behalf_of: nil)
|
|
126
|
+
params = {}
|
|
127
|
+
params[:page] = page if page
|
|
128
|
+
params[:per_page] = per_page if per_page
|
|
129
|
+
params[:include_linked] = include_linked unless include_linked.nil?
|
|
130
|
+
resp = connection(params, nuid, on_behalf_of: on_behalf_of)
|
|
131
|
+
.get('/resources/' + id + '/descendant_works')
|
|
132
|
+
return nil if resp.status == 404
|
|
133
|
+
|
|
134
|
+
AtlasRb::Mash.new(JSON.parse(resp.body))
|
|
135
|
+
end
|
|
136
|
+
|
|
91
137
|
# Validate a MODS XML document against Atlas's schema *without* persisting it.
|
|
92
138
|
#
|
|
93
139
|
# Useful for surfacing validation errors in UIs before the user commits.
|
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.8.
|
|
4
|
+
version: 1.8.9
|
|
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-07-
|
|
11
|
+
date: 2026-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|