atlas_rb 1.28.1 → 1.29.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: 3f7cb74b4e4b3ef68b7aff99b26d2ac253d7834403aab7044a72a007bcf56c3d
4
- data.tar.gz: 89e00c992776ff2c04876e2ec3e992642b66bc2b2a794e5234a2e62ac1c74aff
3
+ metadata.gz: 992d6ea2f49be14d9163123932c11e9f150751ced8e3261ef08c532879177230
4
+ data.tar.gz: 001b33d6eb73fb1b3cbcc2fc5e066ea0b1ccf5b0bae29455eafb1da0fd68036d
5
5
  SHA512:
6
- metadata.gz: e51d08455c2c8e8c1cc57c7f4dc04cc74f016f9e1f85f2975b61608427b4d38f814aaedb9e124e0472a8fa7654f31a6267ce2dd4f968e6ebc1817bf06df9f83d
7
- data.tar.gz: 8d589063122434a3d1583cf476d1f86fd952e880a467b823b653860233015b807ab2b06f6c2e9472842da135c8be1f5d1b2ce92322d8f08b83be749119504d9a
6
+ metadata.gz: c12109d7c7cda3ab19f6b41d1849c8085fd30b54a1a638a0848fcc039e46f5745b14686fbfab3a2df8390be10122278e3693dc16eb2f5f9f681383715e7ba203
7
+ data.tar.gz: 0da824372eb26beccf7b0bbb5230a6b446bc0379142b7339b228bf1364580ac19a94f3021879cd9027270539e8ad4f9f0915a7a61fd8e7f1464e474445a7a479
data/.version CHANGED
@@ -1 +1 @@
1
- 1.28.1
1
+ 1.29.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.29.0
4
+
5
+ Requires an Atlas that serves `GET /works/:id/tombstoned_assets` (0.6.244 or
6
+ later). Against an older Atlas the method answers `nil`, because that Atlas
7
+ answers `404` on the new path.
8
+
9
+ ### Renamed — `Work.withdrawn_assets` is now `Work.tombstoned_assets`
10
+
11
+ Follows Atlas's rename of `GET /works/:id/withdrawn_assets`. The signature, the
12
+ return shape and the errors are unchanged, and no alias is kept. The YARD text
13
+ says "tombstone" for the reversible removal throughout, for a whole resource,
14
+ a single file and a Darwin Core record alike.
15
+
3
16
  ## 1.28.1
4
17
 
5
18
  Requires an Atlas that serves `GET /works/:id/file_revisions` (0.6.243 or
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.28.1)
4
+ atlas_rb (1.29.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
data/README.md CHANGED
@@ -284,7 +284,7 @@ radius and the kind of authentication they need:
284
284
  ```ruby
285
285
  # Regular daily use — picks up Current.nuid via the configured default:
286
286
  AtlasRb::Work.find("w-789") # typed read
287
- AtlasRb::Resource.tombstone("w-789") # withdrawal (reversible), any type
287
+ AtlasRb::Resource.tombstone("w-789") # tombstone (reversible), any type
288
288
 
289
289
  # Operator-only, with a friction marker:
290
290
  AtlasRb::Admin::Resource.destroy("w-789", confirm: :i_understand)
@@ -541,7 +541,7 @@ if work["metadata_formats"].include?("dwc")
541
541
  end
542
542
 
543
543
  AtlasRb::Resource.put_dwc("w-789", "/tmp/dwc.xml", origin: "xml_loader")
544
- AtlasRb::Resource.delete_dwc("w-789") # withdraws; the next put_dwc restores
544
+ AtlasRb::Resource.delete_dwc("w-789") # tombstones; the next put_dwc restores
545
545
 
546
546
  history = AtlasRb::Resource.dwc_versions("w-789")
547
547
  AtlasRb::Resource.dwc_version("w-789", history["versions"].last["version_id"])
@@ -17,7 +17,7 @@ module AtlasRb
17
17
  # @api private
18
18
  ROUTE = "/resources/"
19
19
 
20
- # Hard-delete a resource — a purge, not a withdrawal.
20
+ # Hard-delete a resource — a purge, not a tombstone.
21
21
  #
22
22
  # Removes the resource's metadata, cascades into its members, and removes
23
23
  # the OCFL objects holding the preserved bytes: every retained revision,
@@ -25,7 +25,7 @@ module AtlasRb
25
25
  # records the NOIDs it removed.
26
26
  #
27
27
  # Unrecoverable — prefer {AtlasRb::Resource.tombstone} for the
28
- # user-visible withdrawal path, which keeps everything and can be
28
+ # reversible, user-visible removal, which keeps everything and can be
29
29
  # reversed. Admin-only.
30
30
  #
31
31
  # @param id [String] the resource's NOID.
@@ -49,11 +49,11 @@ module AtlasRb
49
49
 
50
50
  # Restore a previously-tombstoned resource.
51
51
  #
52
- # Reverses a withdrawal: search and show pages stop returning a withdrawn
52
+ # Reverses a tombstone: search and show pages stop returning a tombstoned
53
53
  # stub. No `confirm:` marker — restoring is itself reversible, by
54
54
  # tombstoning again.
55
55
  #
56
- # Accepts a FileSet id too (Atlas 0.6.211 or later), which puts a withdrawn
56
+ # Accepts a FileSet id too (Atlas 0.6.211 or later), which puts a tombstoned
57
57
  # caption or other attached file back in {Work.assets}.
58
58
  #
59
59
  # The devolved-admin tier calls this as well, although the namespace reads
@@ -5,7 +5,7 @@ module AtlasRb
5
5
  #
6
6
  # Houses methods whose blast radius warrants more friction than the
7
7
  # regular CRUD surface: `destroy` (hard delete — content and metadata
8
- # are unrecoverable) and `restore` (un-tombstone — reverses a withdraw,
8
+ # are unrecoverable) and `restore` (un-tombstone — reverses a tombstone,
9
9
  # typically driven from a Rails console session or a future admin UI).
10
10
  #
11
11
  # ## Why a separate namespace
@@ -83,7 +83,7 @@ module AtlasRb
83
83
  ))
84
84
  end
85
85
 
86
- # Withdraw a Work's Darwin Core record.
86
+ # Tombstone a Work's Darwin Core record.
87
87
  #
88
88
  # Nothing is purged: Atlas keeps the document and its version history, and
89
89
  # the next {put_dwc} restores the record. Until then {Work.dwc} answers
@@ -93,7 +93,7 @@ module AtlasRb
93
93
  # @param nuid [String, nil] optional acting user's NUID.
94
94
  # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
95
95
  # header.
96
- # @return [true] when the record was withdrawn.
96
+ # @return [true] when the record was tombstoned.
97
97
  # @raise [AtlasRb::NotFoundError] on `404` — the Work holds no record, or
98
98
  # the id is not a Work.
99
99
  # @raise [AtlasRb::ResourceError] on any other non-2xx.
@@ -200,7 +200,7 @@ module AtlasRb
200
200
  # Restore is the operator's counterpart and lives in
201
201
  # {AtlasRb::Admin::Resource}, where the namespace is the marker.
202
202
  #
203
- # Tombstone (withdraw) a resource.
203
+ # Tombstone a resource: retract it from discovery, reversibly.
204
204
  #
205
205
  # Returns the **raw response** rather than raising, because Atlas refuses a
206
206
  # container that still holds live children with a `422` carrying
@@ -208,13 +208,13 @@ module AtlasRb
208
208
  # error. Reversible via {.restore}.
209
209
  #
210
210
  # Accepts a FileSet id as well as a Community, Collection or Work (Atlas
211
- # 0.6.211 or later). That withdraws an attached file, such as a caption,
211
+ # 0.6.211 or later). That tombstones an attached file, such as a caption,
212
212
  # reversibly: its Blobs ride along and it drops out of {Work.assets} and
213
213
  # {Work.file_sets}. Atlas refuses a FileSet from anyone outside the admin and
214
214
  # devolved-admin tiers with `403`, even a user who can edit the Work.
215
215
  #
216
216
  # `reason:` records why the resource was removed (Atlas 0.6.213 or later).
217
- # It must be one of the removal notes the library's withdrawal policy
217
+ # It must be one of the removal notes the library's removal policy
218
218
  # allows, word for word; Atlas answers `422` with `invalid_reason` for any
219
219
  # other value. The note carries no date: read `tombstoned_at` for that.
220
220
  # The resource returns it as `tombstone_reason`, and a restore clears it.
data/lib/atlas_rb/work.rb CHANGED
@@ -447,12 +447,12 @@ module AtlasRb
447
447
  #
448
448
  # A Blob entry also carries `language` and `track_label`, set by {Blob.create}
449
449
  # and {Blob.update} for a caption or other text track and `nil` otherwise
450
- # (Atlas 0.6.211 or later). A FileSet withdrawn with {Resource.tombstone}
451
- # drops out of this listing and {.file_sets}; {.withdrawn_assets} lists it.
450
+ # (Atlas 0.6.211 or later). A FileSet tombstoned with {Resource.tombstone}
451
+ # drops out of this listing and {.file_sets}; {.tombstoned_assets} lists it.
452
452
  #
453
453
  # Every entry carries `file_set`, the NOID of the FileSet it is listed
454
454
  # under (Atlas 0.6.212 or later). That is the id {Resource.tombstone} and
455
- # {Admin::Resource.restore} take to withdraw or restore the file.
455
+ # {Admin::Resource.restore} take to tombstone or restore the file.
456
456
  #
457
457
  # @param id [String] the Work ID.
458
458
  # @param nuid [String, nil] optional acting user's NUID. On the relay-signing
@@ -477,10 +477,10 @@ module AtlasRb
477
477
  end
478
478
  end
479
479
 
480
- # List the assets of a Work's withdrawn FileSets, so they can be restored.
480
+ # List the assets of a Work's tombstoned FileSets, so they can be restored.
481
481
  #
482
- # Wraps `GET /works/<id>/withdrawn_assets` (Atlas 0.6.212 or later). A
483
- # FileSet withdrawn with {Resource.tombstone} drops out of {.assets} and
482
+ # Wraps `GET /works/<id>/tombstoned_assets` (Atlas 0.6.244 or later). A
483
+ # FileSet tombstoned with {Resource.tombstone} drops out of {.assets} and
484
484
  # {.file_sets}; this is the listing that still names it. Each entry has the
485
485
  # {.assets} shape, including `file_set` (the id to pass to
486
486
  # {Admin::Resource.restore}), plus the FileSet's `tombstoned_at` and
@@ -496,8 +496,8 @@ module AtlasRb
496
496
  # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
497
497
  # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
498
498
  # omitted.
499
- # @return [Array<AtlasRb::Mash>, nil] one entry per asset of a withdrawn
500
- # FileSet; `[]` when nothing is withdrawn.
499
+ # @return [Array<AtlasRb::Mash>, nil] one entry per asset of a tombstoned
500
+ # FileSet; `[]` when nothing is tombstoned.
501
501
  #
502
502
  # `nil` when Atlas answers `404` — nothing is there to read, or, with a
503
503
  # misconfigured `ATLAS_URL`, the route is not Atlas's at all.
@@ -506,11 +506,11 @@ module AtlasRb
506
506
  # `503`), carrying Atlas's status and body so the failure is attributable
507
507
  # at the boundary.
508
508
  # @example Offer Restore for a removed caption
509
- # AtlasRb::Work.withdrawn_assets("w-789", nuid: admin_nuid).each do |a|
509
+ # AtlasRb::Work.tombstoned_assets("w-789", nuid: admin_nuid).each do |a|
510
510
  # AtlasRb::Admin::Resource.restore(a.file_set, nuid: admin_nuid)
511
511
  # end
512
- def self.withdrawn_assets(id, nuid: nil, on_behalf_of: nil)
513
- read_body(connection({}, nuid, on_behalf_of: on_behalf_of).get(ROUTE + id + '/withdrawn_assets')) do |body|
512
+ def self.tombstoned_assets(id, nuid: nil, on_behalf_of: nil)
513
+ read_body(connection({}, nuid, on_behalf_of: on_behalf_of).get(ROUTE + id + '/tombstoned_assets')) do |body|
514
514
  body.map { |entry| AtlasRb::Mash.new(entry) }
515
515
  end
516
516
  end
@@ -524,7 +524,7 @@ module AtlasRb
524
524
  # 1-based ordinal (1 is the first upload), and `"created"`, an ISO-8601
525
525
  # timestamp.
526
526
  #
527
- # The Blobs are the ones {.assets} lists, so a file in a withdrawn FileSet
527
+ # The Blobs are the ones {.assets} lists, so a file in a tombstoned FileSet
528
528
  # stays out, and a Delegate never appears. Atlas allows the call to anyone
529
529
  # who can read the Work, so it carries no attribution, digest, size or
530
530
  # filename. The attributed history is {Blob.versions}, which is
@@ -726,7 +726,7 @@ module AtlasRb
726
726
  # the terms under `"dwc"`.
727
727
  #
728
728
  # `nil` when Atlas answers `404` — the Work holds no record (or it was
729
- # withdrawn), or the id is not a Work.
729
+ # tombstoned), or the id is not a Work.
730
730
  # @raise [AtlasRb::ResourceError] on any non-2xx other than `404` / `410`,
731
731
  # such as the `403` for a Work the caller may not read.
732
732
  # @example
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.28.1
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff