cocina-models 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/maps/Collection.json +7 -0
- data/docs/maps/File.json +3 -3
- data/lib/cocina/models/collection.rb +5 -2
- data/lib/cocina/models/dro.rb +0 -18
- data/lib/cocina/models/release_tag.rb +23 -0
- data/lib/cocina/models/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e0f86ea43364f19ac571ed53c9ebd0dfd610ff70a16f8e96613f8e8315fbf45
|
4
|
+
data.tar.gz: 625a041c6b78df070094a61323d46397bae562f6d84d58f3858e1daa60a7f3be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a69f97500ec76b11e9f87be25f1986858081aa6596c06ad3f2db20edd6e6071cd20fd3aa3268ca1b759168eaa8d18d39ef022576ad3bd34bf1d7a90a1e263f8a
|
7
|
+
data.tar.gz: c5881f14a057c3b9f1912c0417b297889b410cd3184f6fef7d24eef0ad46484f2a27a9fae493caa3549ca6bee3804dcddf9527e9ba2aeeadd61a6389006e50e2
|
data/docs/maps/Collection.json
CHANGED
@@ -125,6 +125,13 @@
|
|
125
125
|
"description": "Administrative or Internal project this resource is a part of.",
|
126
126
|
"type": "string"
|
127
127
|
},
|
128
|
+
"releaseTags": {
|
129
|
+
"description": "Tags for release",
|
130
|
+
"type": "array",
|
131
|
+
"items": {
|
132
|
+
"$ref": "ReleaseTag.json"
|
133
|
+
}
|
134
|
+
},
|
128
135
|
"sdrPreserve": {
|
129
136
|
"description": "If this resource should be sent to Preservation.",
|
130
137
|
"type": "boolean"
|
data/docs/maps/File.json
CHANGED
@@ -64,12 +64,12 @@
|
|
64
64
|
"properties": {
|
65
65
|
"height": {
|
66
66
|
"description": "Height in pixels",
|
67
|
-
"type": "integer"
|
67
|
+
"type": "integer"
|
68
68
|
},
|
69
69
|
"width": {
|
70
70
|
"description": "Width in pixels",
|
71
|
-
"type": "integer"
|
72
|
-
}
|
71
|
+
"type": "integer"
|
72
|
+
}
|
73
73
|
}
|
74
74
|
},
|
75
75
|
"size": {
|
@@ -26,8 +26,11 @@ module Cocina
|
|
26
26
|
|
27
27
|
# Subschema for administrative concerns
|
28
28
|
class Administrative < Dry::Struct
|
29
|
-
|
29
|
+
attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).meta(omittable: true)
|
30
|
+
|
31
|
+
def self.from_dynamic(dyn)
|
30
32
|
params = {}
|
33
|
+
params[:releaseTags] = dyn['releaseTags'].map { |rt| ReleaseTag.from_dynamic(rt) } if dyn['releaseTags']
|
31
34
|
Administrative.new(params)
|
32
35
|
end
|
33
36
|
end
|
@@ -56,7 +59,7 @@ module Cocina
|
|
56
59
|
}
|
57
60
|
|
58
61
|
# params[:access] = Access.from_dynamic(dyn['access']) if dyn['access']
|
59
|
-
|
62
|
+
params[:administrative] = Administrative.from_dynamic(dyn['administrative']) if dyn['administrative']
|
60
63
|
|
61
64
|
Collection.new(params)
|
62
65
|
end
|
data/lib/cocina/models/dro.rb
CHANGED
@@ -26,24 +26,6 @@ module Cocina
|
|
26
26
|
Vocab.webarchive_seed
|
27
27
|
].freeze
|
28
28
|
|
29
|
-
# Subschema for release tags
|
30
|
-
class ReleaseTag < Dry::Struct
|
31
|
-
attribute :to, Types::Strict::String
|
32
|
-
attribute :what, Types::Strict::String.enum('self', 'collection')
|
33
|
-
# we use 'when' other places, but that's reserved word, so 'date' it is!
|
34
|
-
attribute :date, Types::Params::DateTime
|
35
|
-
attribute :who, Types::Strict::String
|
36
|
-
attribute :release, Types::Params::Bool
|
37
|
-
|
38
|
-
def self.from_dynamic(dyn)
|
39
|
-
ReleaseTag.new(to: dyn['to'],
|
40
|
-
what: dyn['what'],
|
41
|
-
date: dyn['date'],
|
42
|
-
who: dyn['who'],
|
43
|
-
release: dyn['release'])
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
29
|
# Subschema for access concerns
|
48
30
|
class Access < Dry::Struct
|
49
31
|
attribute :embargoReleaseDate, Types::Params::DateTime.meta(omittable: true)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
# Subschema for release tags
|
6
|
+
class ReleaseTag < Dry::Struct
|
7
|
+
attribute :to, Types::Strict::String.enum('Searchworks', 'Earthworks')
|
8
|
+
attribute :what, Types::Strict::String.enum('self', 'collection')
|
9
|
+
# we use 'when' other places, but that's reserved word, so 'date' it is!
|
10
|
+
attribute :date, Types::Params::DateTime
|
11
|
+
attribute :who, Types::Strict::String
|
12
|
+
attribute :release, Types::Params::Bool
|
13
|
+
|
14
|
+
def self.from_dynamic(dyn)
|
15
|
+
ReleaseTag.new(to: dyn['to'],
|
16
|
+
what: dyn['what'],
|
17
|
+
date: dyn['date'],
|
18
|
+
who: dyn['who'],
|
19
|
+
release: dyn['release'])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- lib/cocina/models/dro.rb
|
177
177
|
- lib/cocina/models/file.rb
|
178
178
|
- lib/cocina/models/file_set.rb
|
179
|
+
- lib/cocina/models/release_tag.rb
|
179
180
|
- lib/cocina/models/types.rb
|
180
181
|
- lib/cocina/models/version.rb
|
181
182
|
- lib/cocina/models/vocab.rb
|