atlas_rb 1.11.1 → 1.12.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: 7bacb5eb215d1dd6d3df935abd82d74909ca81d1ce91f44de67f370846dbbd80
4
- data.tar.gz: c6ea26efb6d7b083d2ede1455a126901bae8f446ece2997b441d7e593fdaba51
3
+ metadata.gz: b7340207635a0bb6db21f36e716000082d7d67fa3d62603388656bfe6d829c81
4
+ data.tar.gz: fbf68dbb0590ce6d05c3f75f6f879bb392dc45dcca488503b3c19ee57b823cb2
5
5
  SHA512:
6
- metadata.gz: a9cc966ec7e7505b26ca5e5adaeacb78201b8f83c141d77a63c6ece959fce7de3c421e26274b7b943b964ad43ff32899a3da189ac4d9fdaebf43ed7cb9e5249c
7
- data.tar.gz: 366a253542dfcf24f9e44ba4482c013ff426ec9b361b56636c2e2b96020a9b1ca738a93fa6f97d696b3b8bbd2e873ae761c7ceb4f8b8a5ef086bcf7c93ba2b5d
6
+ metadata.gz: 1d07bb66ff2c4c7bf8c5f243fc01afe244e83d1bc53e9734ac22ea7b41990104c538ac53520cf47f4aa55195499ee6a9e0ed81c06fec2afad33b0f4076990bb5
7
+ data.tar.gz: 46bb9c90c94d5f5e2a3501693e2802ae6dfb84ccc4c5c68c5c99ee34e9c2b86203f20867a94251801f9d28e6d66387779e5f5a48ba3fb25439b257d208b3bbb0
data/.version CHANGED
@@ -1 +1 @@
1
- 1.11.1
1
+ 1.12.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.0
4
+
5
+ ### Changed — index rows arrive flat
6
+
7
+ Atlas no longer wraps each row of a paginated index in its type name. `GET
8
+ /works` used to hand back `{"work" => {...}}` per row; it now hands back the
9
+ summary itself. The same applies to `/collections`, `/communities`, `/blobs`,
10
+ `/file_sets`, `/people` and `/compilations`. A single resource is still wrapped
11
+ in its type name — only rows inside a named collection changed.
12
+
13
+ ```ruby
14
+ AtlasRb::Work.list(in_progress: true)["works"].map { |row| row["id"] }
15
+ # was: row["work"]["id"]
16
+ ```
17
+
18
+ `Person.list` and `Person.resolve` unwrapped the row for you, so their return
19
+ value is unchanged. `Work.list` and `Compilation.list` return Atlas's envelope
20
+ as-is, so callers reading `row["work"]` or `row["compilation"]` must drop that
21
+ step.
22
+
23
+ **This release requires Atlas 0.6.158 or newer.** Pairing 1.12.0 with an older
24
+ Atlas makes `Person.list` and `Person.resolve` return rows of nils.
25
+
26
+ ### Fixed — `Work.list` documentation
27
+
28
+ The envelope was described as matching `Community.children`, which returns a
29
+ bare array of noid strings — a third shape. It carries `works` and
30
+ `pagination`.
31
+
3
32
  ## 1.11.0
4
33
 
5
34
  ### Added — `Work.associations` / `.associate` / `.disassociate`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.11.1)
4
+ atlas_rb (1.12.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -89,7 +89,8 @@ module AtlasRb
89
89
  # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
90
90
  # omitted.
91
91
  # @return [AtlasRb::Mash] `{ "compilations" => [...], "pagination" => {...} }`.
92
- # Each entry wraps the same `"compilation"` object {.find} returns.
92
+ # Each entry in `"compilations"` is a flat Compilation, carrying the
93
+ # same keys {.find} returns.
93
94
  # @raise [AtlasRb::ForbiddenError] on a cross-owner listing without admin.
94
95
  #
95
96
  # @example My Sets
@@ -55,12 +55,13 @@ module AtlasRb
55
55
  # server-side).
56
56
  # @param nuid [String, nil] acting principal.
57
57
  # @param on_behalf_of [String, nil] acting-as target.
58
- # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per row on the page.
58
+ # @return [Array<AtlasRb::Mash>] one Person per row on the page. Returns
59
+ # the rows alone; the pagination block is dropped.
59
60
  def self.list(page: nil, per_page: nil, nuid: nil, on_behalf_of: nil)
60
61
  params = { page: page, per_page: per_page }.compact
61
62
  JSON.parse(
62
63
  connection(params, nuid, on_behalf_of: on_behalf_of).get(ROUTE)&.body
63
- )["people"].map { |entry| AtlasRb::Mash.new(entry["person"]) }
64
+ )["people"].map { |entry| AtlasRb::Mash.new(entry) }
64
65
  end
65
66
 
66
67
  # Batch-resolve people to their authoritative display_name in one call
@@ -71,12 +72,12 @@ module AtlasRb
71
72
  # @param nuids [Array<String>] the NUIDs to resolve.
72
73
  # @param nuid [String, nil] acting principal.
73
74
  # @param on_behalf_of [String, nil] acting-as target.
74
- # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per resolved NUID
75
- # (each carries `nuid`, `affiliated_community_ids`, and `personal_root_id`).
75
+ # @return [Array<AtlasRb::Mash>] one Person per resolved NUID (each carries
76
+ # `nuid`, `affiliated_community_ids`, and `personal_root_id`).
76
77
  def self.resolve(nuids, nuid: nil, on_behalf_of: nil)
77
78
  JSON.parse(
78
79
  connection({ nuids: Array(nuids).join(",") }, nuid, on_behalf_of: on_behalf_of).get(ROUTE)&.body
79
- )["people"].map { |entry| AtlasRb::Mash.new(entry["person"]) }
80
+ )["people"].map { |entry| AtlasRb::Mash.new(entry) }
80
81
  end
81
82
 
82
83
  # Create a Person. One Person per NUID — a duplicate NUID is a 409.
data/lib/atlas_rb/work.rb CHANGED
@@ -37,9 +37,9 @@ module AtlasRb
37
37
 
38
38
  # List Works, paginated.
39
39
  #
40
- # Wraps `GET /works`. Returns the full pagination envelope rather than a
41
- # bare array so callers can page through results — the shape matches
42
- # {AtlasRb::Community.children} and {AtlasRb::Collection.children}.
40
+ # Wraps `GET /works`. Returns the full pagination envelope `works` plus
41
+ # `pagination` — rather than a bare array, so callers can page through
42
+ # results.
43
43
  #
44
44
  # @param in_progress [Boolean, nil] when set, filter to Works whose
45
45
  # `in_progress` flag matches. Omit (or pass `nil`) for "all works".
@@ -57,7 +57,7 @@ module AtlasRb
57
57
  # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
58
58
  # omitted.
59
59
  # @return [AtlasRb::Mash] `{ "works" => [...], "pagination" => {...} }`.
60
- # Each entry in `"works"` is a Work summary (`id`, `title`,
60
+ # Each entry in `"works"` is a flat Work summary (`id`, `title`,
61
61
  # `description`, `in_progress`, `incomplete`, `incomplete_reason`,
62
62
  # `handle`). `handle` is carried on the summary, not just the detail
63
63
  # read, so "which Works never minted?" is answerable from one page
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.11.1
4
+ version: 1.12.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-08-15 00:00:00.000000000 Z
11
+ date: 2026-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday