atlas_rb 1.11.0 → 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: 58d8d5524e43dc1f14f172ea65bc1e78e55826a63c814f2ef517675d07732d08
4
- data.tar.gz: 548d4cba38f7a2ef81f210612157ee36a56de6e15b5fcff367b4df1b73fda847
3
+ metadata.gz: b7340207635a0bb6db21f36e716000082d7d67fa3d62603388656bfe6d829c81
4
+ data.tar.gz: fbf68dbb0590ce6d05c3f75f6f879bb392dc45dcca488503b3c19ee57b823cb2
5
5
  SHA512:
6
- metadata.gz: 745c494de1bd2da2a0048e2d3d562961bed6e48058b30da25dcbcdc0f9b2b7f3159c2b831508ac972a968dc6f02ee2a7f0a5cf11b85e2319277d1f200adf51f4
7
- data.tar.gz: fe90db7467cdae4726357c2ba6d0d939d50c4174f1a3aa43ee8fd91adea19923fa321f53804fb52ed8db39eab22b578dadc6e542f77d54d1e1177e1effab0c53
6
+ metadata.gz: 1d07bb66ff2c4c7bf8c5f243fc01afe244e83d1bc53e9734ac22ea7b41990104c538ac53520cf47f4aa55195499ee6a9e0ed81c06fec2afad33b0f4076990bb5
7
+ data.tar.gz: 46bb9c90c94d5f5e2a3501693e2802ae6dfb84ccc4c5c68c5c99ee34e9c2b86203f20867a94251801f9d28e6d66387779e5f5a48ba3fb25439b257d208b3bbb0
data/.version CHANGED
@@ -1 +1 @@
1
- 1.11.0
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.0)
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,8 +57,11 @@ 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`,
61
- # `description`, `in_progress`, `incomplete`, `incomplete_reason`).
60
+ # Each entry in `"works"` is a flat Work summary (`id`, `title`,
61
+ # `description`, `in_progress`, `incomplete`, `incomplete_reason`,
62
+ # `handle`). `handle` is carried on the summary, not just the detail
63
+ # read, so "which Works never minted?" is answerable from one page
64
+ # rather than a fetch per row.
62
65
  #
63
66
  # @example Find stuck deposits
64
67
  # AtlasRb::Work.list(in_progress: true)
@@ -220,11 +223,28 @@ module AtlasRb
220
223
  # "stuck" list.
221
224
  #
222
225
  # Idempotent on the server: calling `complete` on an already-complete
223
- # Work is a no-op — Atlas simply re-saves with `in_progress: false`.
226
+ # Work is a no-op — Atlas re-saves with `in_progress: false`.
224
227
  # Atlas does not currently stamp a `completed_by` audit field; the
225
228
  # `nuid:` parameter is plumbed through for parity with the other
226
229
  # lifecycle bindings and in case Atlas adds completion audit later.
227
230
  #
231
+ # **This call also mints the Work's persistent identifier.** Atlas
232
+ # registers `<prefix>/<noid>` with its Handle service, pointed at the
233
+ # public Work page, and records it as `handle` on the Work. Two
234
+ # consequences for a caller:
235
+ #
236
+ # * **Minting can never fail the call.** A handle server that is down,
237
+ # slow or unconfigured leaves `handle` null and the Work still
238
+ # complete — never a non-2xx. So a `200` does not promise a handle:
239
+ # the response body carries the Work, so check `handle` on it rather
240
+ # than assuming success minted one.
241
+ # * **Re-completing is safe.** Atlas mints only when `handle` is empty,
242
+ # and the underlying registration is keyed by handle name, so a repeat
243
+ # call re-points rather than minting a second identifier.
244
+ #
245
+ # A deployment with no handle server configured mints nothing at all,
246
+ # which is the normal state for a stack brought up without it.
247
+ #
228
248
  # @param id [String] the Work ID.
229
249
  # @param nuid [String, nil] optional NUID of the acting user.
230
250
  # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
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.0
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-13 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