atlas_rb 1.29.3 → 1.29.4

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: 070db91bb5753d1cdc5961a4ba71a834935ebd8ba206fc72326d2e050188625f
4
- data.tar.gz: 5317100f574d3449b1df75a6700a6091b999d251402e565d34580632e141652b
3
+ metadata.gz: bc6d758d43135f85f61b7a8a0aa8ba86af108d4894d84f17cee9d91b7bdffbb8
4
+ data.tar.gz: ca3e2c5a080af089e4fd2734b2a8b185f3ad54d2ee58a53b3aef61ec3b518691
5
5
  SHA512:
6
- metadata.gz: 370d588a000805cf88998daa6c1b7afc267e099ce68b172459c098e7e9c3659f4ac29d15eafddbc0429287ef88ac359e41c23645df19c427cf0b0585b3bfda37
7
- data.tar.gz: 646ff86552eecd1c5dc0a6db03bc3cbd78eb5a9c1cabbb166e593437776eb90fb0311f5f0a17284ad5a74a1698d35ff9cf6a8ad05ddf1ec9b7281407caf1e7f5
6
+ metadata.gz: fd67f7abf09587a4dc0d5fc284a76108e618fa34e0c32f38a900a5ccda11d5e31255f5ab01461435674a03d08a067b71eabba49a37ceada0ad034ee5dc7d1531
7
+ data.tar.gz: eae45b648e6322aeefefc3e67f4e35c53fda0a87a36a29613b2b7d27183237a104ec5ecd5082bde721b6dfe6f049109aa247ea7d027f7762574adc9e50ab6ea7
data/.version CHANGED
@@ -1 +1 @@
1
- 1.29.3
1
+ 1.29.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.29.4
4
+
5
+ Needs an Atlas that accepts a supplied handle (0.6.277 or later). An older
6
+ Atlas ignores the param, and `complete` then mints a second handle.
7
+
8
+ ### Added — `handle:` on `Work.create`
9
+
10
+ Creates a Work with a handle it already owns, such as a migrated v1 record's.
11
+ Atlas records it as supplied, so `complete` mints nothing and never re-points
12
+ it. Admin and delegated admin only: anyone else gets `ForbiddenError` with
13
+ `action` `"supply_handle"`, and no Work is created. A malformed handle is a
14
+ `422` and a handle another Work holds is a `409`, both as `ResourceError`.
15
+
3
16
  ## 1.29.3
4
17
 
5
18
  Needs an Atlas that serves the citation route (0.6.274 or later). Against an
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.29.3)
4
+ atlas_rb (1.29.4)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
data/lib/atlas_rb/work.rb CHANGED
@@ -126,12 +126,25 @@ module AtlasRb
126
126
  # it should be attributed to. The acting user becomes the Work's
127
127
  # `proxy_uploader`. The depositor is immutable post-create; there is no
128
128
  # setter on the update surface.
129
+ # @param handle [String, nil] optional handle the Work already owns, such
130
+ # as a migrated v1 record's `"2047/d20001234"`. A resolver URL is
131
+ # accepted; Atlas strips the host. Admin and delegated admin only. Atlas
132
+ # records it as supplied, and `complete` then mints nothing and never
133
+ # re-points it. There is no way to change it after the create. Needs
134
+ # Atlas 0.6.277 or later; an older Atlas ignores the param and mints a
135
+ # second handle on `complete`.
129
136
  # @return [Hash] the created Work payload (post-update if `xml_path` was
130
137
  # supplied).
131
138
  # @raise [AtlasRb::NotFoundError] if Atlas answers `404` — the id names no such
132
139
  # resource, so the write did not happen.
140
+ # @raise [AtlasRb::ForbiddenError] if Atlas answers `403`: the caller holds no
141
+ # edit rights on the Collection, or sent `handle:` without being an admin
142
+ # or delegated admin (`action` is then `"supply_handle"`). No Work is
143
+ # created.
133
144
  # @raise [AtlasRb::ResourceError] on any other non-2xx, carrying Atlas's status
134
- # and body.
145
+ # and body. With `handle:`, a `422` (`invalid_handle`) means the value is
146
+ # not `<prefix>/<suffix>`, and a `409` (`handle_taken`) means another
147
+ # Work, live or tombstoned, holds it.
135
148
  #
136
149
  # @example Empty work, metadata to be added later
137
150
  # AtlasRb::Work.create("col-456")
@@ -145,10 +158,14 @@ module AtlasRb
145
158
  #
146
159
  # @example Proxy deposit — librarian uploads on behalf of a researcher
147
160
  # AtlasRb::Work.create("col-456", depositor: "000000123")
161
+ #
162
+ # @example Migrated Work that keeps its v1 handle
163
+ # AtlasRb::Work.create("col-456", handle: "2047/d20001234", nuid: admin_nuid)
148
164
  def self.create(id, xml_path = nil, idempotency_key: nil, nuid: nil,
149
- on_behalf_of: nil, depositor: nil)
165
+ on_behalf_of: nil, depositor: nil, handle: nil)
150
166
  params = { collection_id: id }
151
167
  params[:depositor] = depositor if depositor
168
+ params[:handle] = handle if handle
152
169
  result = AtlasRb::Mash.new(write_resource(
153
170
  connection(params, nuid,
154
171
  on_behalf_of: on_behalf_of, idempotency_key: idempotency_key).post(ROUTE)
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.29.3
4
+ version: 1.29.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff