atlas_rb 1.28.0 → 1.28.1
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/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/atlas_rb/work.rb +42 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f7cb74b4e4b3ef68b7aff99b26d2ac253d7834403aab7044a72a007bcf56c3d
|
|
4
|
+
data.tar.gz: 89e00c992776ff2c04876e2ec3e992642b66bc2b2a794e5234a2e62ac1c74aff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e51d08455c2c8e8c1cc57c7f4dc04cc74f016f9e1f85f2975b61608427b4d38f814aaedb9e124e0472a8fa7654f31a6267ce2dd4f968e6ebc1817bf06df9f83d
|
|
7
|
+
data.tar.gz: 8d589063122434a3d1583cf476d1f86fd952e880a467b823b653860233015b807ab2b06f6c2e9472842da135c8be1f5d1b2ce92322d8f08b83be749119504d9a
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.28.
|
|
1
|
+
1.28.1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.28.1
|
|
4
|
+
|
|
5
|
+
Requires an Atlas that serves `GET /works/:id/file_revisions` (0.6.243 or
|
|
6
|
+
later).
|
|
7
|
+
|
|
8
|
+
### Added — `AtlasRb::Work.file_revisions`
|
|
9
|
+
|
|
10
|
+
Lists the revision dates of a Work's replaced files: one entry per Blob with
|
|
11
|
+
more than one revision, as `blob_id` and `revisions`, newest first. Each
|
|
12
|
+
revision carries only `revision` and `created`. Atlas allows it to anyone who
|
|
13
|
+
can read the Work, so it carries no attribution; `Blob.versions` stays the
|
|
14
|
+
admin-gated, attributed history. `[]` when no file was ever replaced, `nil` on
|
|
15
|
+
a 404.
|
|
16
|
+
|
|
3
17
|
## 1.28.0
|
|
4
18
|
|
|
5
19
|
Requires an Atlas that stores the preview image's size and placeholder (0.6.234
|
data/Gemfile.lock
CHANGED
data/lib/atlas_rb/work.rb
CHANGED
|
@@ -515,6 +515,48 @@ module AtlasRb
|
|
|
515
515
|
end
|
|
516
516
|
end
|
|
517
517
|
|
|
518
|
+
# List the revision dates of a Work's replaced files.
|
|
519
|
+
#
|
|
520
|
+
# Wraps `GET /works/<id>/file_revisions` (Atlas 0.6.243 or later). Each
|
|
521
|
+
# entry names one Blob that has been replaced at least once, as
|
|
522
|
+
# `"blob_id"`, and lists its content revisions newest first under
|
|
523
|
+
# `"revisions"`. A revision carries only `"revision"`, the contiguous
|
|
524
|
+
# 1-based ordinal (1 is the first upload), and `"created"`, an ISO-8601
|
|
525
|
+
# timestamp.
|
|
526
|
+
#
|
|
527
|
+
# The Blobs are the ones {.assets} lists, so a file in a withdrawn FileSet
|
|
528
|
+
# stays out, and a Delegate never appears. Atlas allows the call to anyone
|
|
529
|
+
# who can read the Work, so it carries no attribution, digest, size or
|
|
530
|
+
# filename. The attributed history is {Blob.versions}, which is
|
|
531
|
+
# admin-gated.
|
|
532
|
+
#
|
|
533
|
+
# @param id [String] the Work ID.
|
|
534
|
+
# @param nuid [String, nil] optional acting user's NUID. On the relay-signing
|
|
535
|
+
# path it is signed into the assertion `sub`; on the BYO-JWT (`ATLAS_JWT`)
|
|
536
|
+
# path it is ignored (identity lives in the token).
|
|
537
|
+
# @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
|
|
538
|
+
# header. Falls through to {AtlasRb.config}.default_on_behalf_of when
|
|
539
|
+
# omitted.
|
|
540
|
+
# @return [Array<AtlasRb::Mash>, nil] one entry per Blob with more than one
|
|
541
|
+
# revision: `"blob_id"` and `"revisions"` (each `"revision"` and
|
|
542
|
+
# `"created"`), newest first. `[]` when no file was ever replaced.
|
|
543
|
+
#
|
|
544
|
+
# `nil` when Atlas answers `404` — no such Work, or, with a misconfigured
|
|
545
|
+
# `ATLAS_URL`, the route is not Atlas's at all.
|
|
546
|
+
# @raise [AtlasRb::ResourceError] on any non-2xx other than `404` / `410`
|
|
547
|
+
# (a `403` for a caller who cannot read the Work, a `5xx`, a proxy's
|
|
548
|
+
# `503`), carrying Atlas's status and body so the failure is attributable
|
|
549
|
+
# at the boundary.
|
|
550
|
+
# @example Show when each file was replaced
|
|
551
|
+
# AtlasRb::Work.file_revisions("w-789", nuid: viewer_nuid).each do |entry|
|
|
552
|
+
# entry.revisions.each { |r| puts "#{entry.blob_id} v#{r.revision} #{r.created}" }
|
|
553
|
+
# end
|
|
554
|
+
def self.file_revisions(id, nuid: nil, on_behalf_of: nil)
|
|
555
|
+
read_body(connection({}, nuid, on_behalf_of: on_behalf_of).get("#{ROUTE}#{id}/file_revisions")) do |body|
|
|
556
|
+
body.map { |entry| AtlasRb::Mash.new(entry) }
|
|
557
|
+
end
|
|
558
|
+
end
|
|
559
|
+
|
|
518
560
|
# Grade a Work's health green, yellow or red.
|
|
519
561
|
#
|
|
520
562
|
# Wraps `GET /works/<id>/health_check` (Atlas 0.6.232 or later). `grade` is
|