cocina-models 0.69.2 → 0.70.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 +4 -4
- data/README.md +10 -2
- data/lib/cocina/generator/schema.rb +6 -3
- data/lib/cocina/models/admin_policy_with_metadata.rb +30 -0
- data/lib/cocina/models/collection.rb +2 -2
- data/lib/cocina/models/collection_with_metadata.rb +39 -0
- data/lib/cocina/models/dro.rb +2 -2
- data/lib/cocina/models/dro_with_metadata.rb +51 -0
- data/lib/cocina/models/file_set.rb +1 -1
- data/lib/cocina/models/object_metadata.rb +14 -0
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/models.rb +33 -0
- data/lib/cocina/rspec/matchers.rb +13 -8
- data/openapi.yml +84 -0
- metadata +10 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab6c36807c8585e07d8fc5529e6ef1aa08e88f7fc93d3dc7605aecb87e9138db
|
|
4
|
+
data.tar.gz: 8a5c302070e2beab4c3606124e1b68e64a1ab1063c8c32d05e47a66db3325d78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33fa2bd17896f666da8f4bdc1249a1e216f0344c0dc6d95e47b76a97b801a2ab1abf05fd1ca287e7bd23e134a34de8900e985e7db3bfea2e91b9c359be209722
|
|
7
|
+
data.tar.gz: 93ac31afd9d5da0587d4798c8e3ae571853f0e2b3c85d6edcda231ab886d9fd4f3559e7616a70f2290629028faa745bc40406f47f0bbe5ec95574bbe084bb532
|
data/README.md
CHANGED
|
@@ -53,10 +53,14 @@ which pushes the gem to rubygems.org. Next write up the release notes: https://
|
|
|
53
53
|
|
|
54
54
|
### Step 2: Update client gems coupled to the models
|
|
55
55
|
|
|
56
|
+
**NOTE**: You can skip this step if the new release is a patch-level bump only.
|
|
57
|
+
|
|
56
58
|
Next, you should release versions of [sdr-client](https://github.com/sul-dlss/sdr-client) and [dor-services-client](https://github.com/sul-dlss/dor-services-client/) pinned to this version because applications such as [Argo](https://github.com/sul-dlss/argo) depend on both of these gems using the same models.
|
|
57
59
|
|
|
58
60
|
### Step 3: Update service API specifications and gems
|
|
59
61
|
|
|
62
|
+
**NOTE**: You can skip this first half of the step if there have not been any changes to the `cocina-models` OpenAPI spec since the prior release.
|
|
63
|
+
|
|
60
64
|
The cocina-models gem is used in applications that have an API specification that accepts Cocina models. Next, make sure that the `openapi.yml` for these applications include the `openapi.yml` schema changes made in cocina-models. This list of services is known to include:
|
|
61
65
|
|
|
62
66
|
* [sul-dlss/sdr-api](https://github.com/sul-dlss/sdr-api)
|
|
@@ -85,7 +89,9 @@ There are scripts to help with this:
|
|
|
85
89
|
|
|
86
90
|
#### Step 4A: Create the PRs
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
There is a Jenkins CI job that you can run manually to create all the PRs you need. Head to https://sul-ci-prod.stanford.edu/job/SUL-DLSS/job/access-update-scripts/job/cocina-level2-updates/ and then click `Build Now`. Click the new build that is created and then `Console Output` to watch the build. Once it has completed, you can proceed with the next step.
|
|
93
|
+
|
|
94
|
+
If for some reason the above method does not work, the sul-dlss/access-update-scripts repo has a script for this: `cocina_level2_prs.rb`. You will need a github access token with scopes of "read:org" and "repo" (see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to run it, as noted in the comments at the top of that script.
|
|
89
95
|
|
|
90
96
|
#### Step 4B: Merge the PRs
|
|
91
97
|
|
|
@@ -95,6 +101,8 @@ access-update-scripts repo has a script for this: `cocina_level2_prs.rb`. You
|
|
|
95
101
|
|
|
96
102
|
[sul-dlss/sdr-deploy](https://github.com/sul-dlss/sdr-deploy) has a flag in the deploy script to limit deploys to cocina dependent applications. Refer to instructions in the [sdr-deploy/README](https://github.com/sul-dlss/sdr-deploy/blob/main/README.md#only-deploy-repos-related-to-cocina-models-update).
|
|
97
103
|
|
|
104
|
+
**[Turn off Google Books](https://sul-gbooks-prod.stanford.edu/features) when deploying to production.** This avoids failed deposit due to a temporary Cocina model mismatch. Unlike other applications, the deposits will fail without retry and require manual remediation.
|
|
105
|
+
|
|
98
106
|
## Usage conventions
|
|
99
107
|
|
|
100
108
|
The following are the recommended naming conventions for code using Cocina models:
|
|
@@ -112,7 +120,7 @@ As of the 0.69.0 release, the `cocina-models` gem provides RSpec matchers for do
|
|
|
112
120
|
* `expect(http_response_body_with_cocina_json).to equal_cocina_model(cocina_instance)`
|
|
113
121
|
* `cocina_object_with` (AKA `match_cocina_object_with`): Compare a Cocina model instance with a hash containining part of the structure of a Cocina object. Example usage:
|
|
114
122
|
* `expect(CocinaObjectStore).to have_received(:save).with(cocina_object_with(access: { view: 'world' }, structural: { contains: [...] }))`
|
|
115
|
-
* expect(updated_cocina_item).to match_cocina_object_with(structural: { hasMemberOrders: [] })
|
|
123
|
+
* `expect(updated_cocina_item).to match_cocina_object_with(structural: { hasMemberOrders: [] })`
|
|
116
124
|
* `cocina_object_with_types`: Check a Cocina object's type information. Example usage:
|
|
117
125
|
* `expect(object_client).to have_received(:update).with(params: cocina_object_with_types(content_type: Cocina::Models::ObjectType.book, viewing_direction: 'left-to-right'))`
|
|
118
126
|
* `cocina_admin_policy_with_registration_collections`: Check a Cocina admin policy's collections. Example usage:
|
|
@@ -47,10 +47,13 @@ module Cocina
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def types
|
|
50
|
-
|
|
51
|
-
return '' if
|
|
50
|
+
type_schema_property = schema_properties.find { |schema_property| schema_property.key == 'type' }
|
|
51
|
+
return '' if type_schema_property.nil?
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
type_schema_doc = type_schema_property.schema_doc
|
|
54
|
+
return '' if type_schema_doc.enum.nil?
|
|
55
|
+
|
|
56
|
+
types_list = type_schema_doc.enum.map { |item| "'#{item}'" }.join(",\n ")
|
|
54
57
|
|
|
55
58
|
<<~RUBY
|
|
56
59
|
include Checkable
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cocina
|
|
4
|
+
module Models
|
|
5
|
+
class AdminPolicyWithMetadata < Struct
|
|
6
|
+
include Validatable
|
|
7
|
+
|
|
8
|
+
include Checkable
|
|
9
|
+
|
|
10
|
+
TYPES = ['https://cocina.sul.stanford.edu/models/admin_policy'].freeze
|
|
11
|
+
|
|
12
|
+
# The version of Cocina with which this object conforms.
|
|
13
|
+
# example: 1.2.3
|
|
14
|
+
attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
|
|
15
|
+
attribute :type, Types::Strict::String.enum(*AdminPolicyWithMetadata::TYPES)
|
|
16
|
+
# example: druid:bc123df4567
|
|
17
|
+
attribute :externalIdentifier, Types::Strict::String
|
|
18
|
+
attribute :label, Types::Strict::String
|
|
19
|
+
attribute :version, Types::Strict::Integer
|
|
20
|
+
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
|
|
21
|
+
attribute :description, Description.optional.meta(omittable: true)
|
|
22
|
+
# When the object was created.
|
|
23
|
+
attribute :created, Types::Params::DateTime.meta(omittable: true)
|
|
24
|
+
# When the object was modified.
|
|
25
|
+
attribute :modified, Types::Params::DateTime.meta(omittable: true)
|
|
26
|
+
# Key for optimistic locking. The contents of the key is not specified.
|
|
27
|
+
attribute :lock, Types::Strict::String
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -25,9 +25,9 @@ module Cocina
|
|
|
25
25
|
# Version for the Collection within SDR.
|
|
26
26
|
attribute :version, Types::Strict::Integer
|
|
27
27
|
attribute(:access, CollectionAccess.default { CollectionAccess.new })
|
|
28
|
-
attribute
|
|
28
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
|
29
29
|
attribute(:description, Description.default { Description.new })
|
|
30
|
-
attribute
|
|
30
|
+
attribute(:identification, CollectionIdentification.default { CollectionIdentification.new })
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cocina
|
|
4
|
+
module Models
|
|
5
|
+
class CollectionWithMetadata < Struct
|
|
6
|
+
include Validatable
|
|
7
|
+
|
|
8
|
+
include Checkable
|
|
9
|
+
|
|
10
|
+
TYPES = ['https://cocina.sul.stanford.edu/models/collection',
|
|
11
|
+
'https://cocina.sul.stanford.edu/models/curated-collection',
|
|
12
|
+
'https://cocina.sul.stanford.edu/models/user-collection',
|
|
13
|
+
'https://cocina.sul.stanford.edu/models/exhibit',
|
|
14
|
+
'https://cocina.sul.stanford.edu/models/series'].freeze
|
|
15
|
+
|
|
16
|
+
# The version of Cocina with which this object conforms.
|
|
17
|
+
# example: 1.2.3
|
|
18
|
+
attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
|
|
19
|
+
# The content type of the Collection. Selected from an established set of values.
|
|
20
|
+
attribute :type, Types::Strict::String.enum(*CollectionWithMetadata::TYPES)
|
|
21
|
+
# example: druid:bc123df4567
|
|
22
|
+
attribute :externalIdentifier, Types::Strict::String
|
|
23
|
+
# Primary processing label (can be same as title) for a Collection.
|
|
24
|
+
attribute :label, Types::Strict::String
|
|
25
|
+
# Version for the Collection within SDR.
|
|
26
|
+
attribute :version, Types::Strict::Integer
|
|
27
|
+
attribute(:access, CollectionAccess.default { CollectionAccess.new })
|
|
28
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
|
29
|
+
attribute(:description, Description.default { Description.new })
|
|
30
|
+
attribute(:identification, CollectionIdentification.default { CollectionIdentification.new })
|
|
31
|
+
# When the object was created.
|
|
32
|
+
attribute :created, Types::Params::DateTime.meta(omittable: true)
|
|
33
|
+
# When the object was modified.
|
|
34
|
+
attribute :modified, Types::Params::DateTime.meta(omittable: true)
|
|
35
|
+
# Key for optimistic locking. The contents of the key is not specified.
|
|
36
|
+
attribute :lock, Types::Strict::String
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/cocina/models/dro.rb
CHANGED
|
@@ -37,8 +37,8 @@ module Cocina
|
|
|
37
37
|
attribute(:access, DROAccess.default { DROAccess.new })
|
|
38
38
|
attribute(:administrative, Administrative.default { Administrative.new })
|
|
39
39
|
attribute(:description, Description.default { Description.new })
|
|
40
|
-
attribute
|
|
41
|
-
attribute
|
|
40
|
+
attribute(:identification, Identification.default { Identification.new })
|
|
41
|
+
attribute(:structural, DROStructural.default { DROStructural.new })
|
|
42
42
|
attribute :geographic, Geographic.optional.meta(omittable: true)
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cocina
|
|
4
|
+
module Models
|
|
5
|
+
class DROWithMetadata < Struct
|
|
6
|
+
include Validatable
|
|
7
|
+
|
|
8
|
+
include Checkable
|
|
9
|
+
|
|
10
|
+
TYPES = ['https://cocina.sul.stanford.edu/models/object',
|
|
11
|
+
'https://cocina.sul.stanford.edu/models/3d',
|
|
12
|
+
'https://cocina.sul.stanford.edu/models/agreement',
|
|
13
|
+
'https://cocina.sul.stanford.edu/models/book',
|
|
14
|
+
'https://cocina.sul.stanford.edu/models/document',
|
|
15
|
+
'https://cocina.sul.stanford.edu/models/geo',
|
|
16
|
+
'https://cocina.sul.stanford.edu/models/image',
|
|
17
|
+
'https://cocina.sul.stanford.edu/models/page',
|
|
18
|
+
'https://cocina.sul.stanford.edu/models/photograph',
|
|
19
|
+
'https://cocina.sul.stanford.edu/models/manuscript',
|
|
20
|
+
'https://cocina.sul.stanford.edu/models/map',
|
|
21
|
+
'https://cocina.sul.stanford.edu/models/media',
|
|
22
|
+
'https://cocina.sul.stanford.edu/models/track',
|
|
23
|
+
'https://cocina.sul.stanford.edu/models/webarchive-binary',
|
|
24
|
+
'https://cocina.sul.stanford.edu/models/webarchive-seed'].freeze
|
|
25
|
+
|
|
26
|
+
# The version of Cocina with which this object conforms.
|
|
27
|
+
# example: 1.2.3
|
|
28
|
+
attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
|
|
29
|
+
# The content type of the DRO. Selected from an established set of values.
|
|
30
|
+
attribute :type, Types::Strict::String.enum(*DROWithMetadata::TYPES)
|
|
31
|
+
# example: druid:bc123df4567
|
|
32
|
+
attribute :externalIdentifier, Types::Strict::String
|
|
33
|
+
# Primary processing label (can be same as title) for a DRO.
|
|
34
|
+
attribute :label, Types::Strict::String
|
|
35
|
+
# Version for the DRO within SDR.
|
|
36
|
+
attribute :version, Types::Strict::Integer
|
|
37
|
+
attribute(:access, DROAccess.default { DROAccess.new })
|
|
38
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
|
39
|
+
attribute(:description, Description.default { Description.new })
|
|
40
|
+
attribute(:identification, Identification.default { Identification.new })
|
|
41
|
+
attribute(:structural, DROStructural.default { DROStructural.new })
|
|
42
|
+
attribute :geographic, Geographic.optional.meta(omittable: true)
|
|
43
|
+
# When the object was created.
|
|
44
|
+
attribute :created, Types::Params::DateTime.meta(omittable: true)
|
|
45
|
+
# When the object was modified.
|
|
46
|
+
attribute :modified, Types::Params::DateTime.meta(omittable: true)
|
|
47
|
+
# Key for optimistic locking. The contents of the key is not specified.
|
|
48
|
+
attribute :lock, Types::Strict::String
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -29,7 +29,7 @@ module Cocina
|
|
|
29
29
|
attribute :label, Types::Strict::String
|
|
30
30
|
# Version for the Fileset within SDR.
|
|
31
31
|
attribute :version, Types::Strict::Integer
|
|
32
|
-
attribute
|
|
32
|
+
attribute(:structural, FileSetStructural.default { FileSetStructural.new })
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cocina
|
|
4
|
+
module Models
|
|
5
|
+
class ObjectMetadata < Struct
|
|
6
|
+
# When the object was created.
|
|
7
|
+
attribute :created, Types::Params::DateTime.meta(omittable: true)
|
|
8
|
+
# When the object was modified.
|
|
9
|
+
attribute :modified, Types::Params::DateTime.meta(omittable: true)
|
|
10
|
+
# Key for optimistic locking. The contents of the key is not specified.
|
|
11
|
+
attribute :lock, Types::Strict::String
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/cocina/models.rb
CHANGED
|
@@ -21,6 +21,7 @@ class CocinaModelsInflector < Zeitwerk::Inflector
|
|
|
21
21
|
'request_dro' => 'RequestDRO',
|
|
22
22
|
'dro_access' => 'DROAccess',
|
|
23
23
|
'dro_structural' => 'DROStructural',
|
|
24
|
+
'dro_with_metadata' => 'DROWithMetadata',
|
|
24
25
|
'request_dro_structural' => 'RequestDROStructural',
|
|
25
26
|
'rspec' => 'RSpec',
|
|
26
27
|
'version' => 'VERSION'
|
|
@@ -110,6 +111,38 @@ module Cocina
|
|
|
110
111
|
clazz.new(dyn, false, validate)
|
|
111
112
|
end
|
|
112
113
|
|
|
114
|
+
# Coerces DROWithMetadata, CollectionWithMetadata, AdminPolicyWithMetadata to DRO, Collection, AdminPolicy
|
|
115
|
+
# @param [DROWithMetadata,CollectionWithMetadata,AdminPolicyWithMetadata] cocina_object
|
|
116
|
+
# @return [DRO,Collection,AdminPolicy]
|
|
117
|
+
def self.without_metadata(cocina_object)
|
|
118
|
+
build(cocina_object.to_h.except(:created, :modified, :lock))
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Adds metadata to a DRO, Collection, AdminPolicy
|
|
122
|
+
# or updates for a DROWithMetadata, CollectionWithMetadata, AdminPolicyWithMetadata
|
|
123
|
+
# @param [DROWithMetadata,CollectionWithMetadata,
|
|
124
|
+
# AdminPolicyWithMetadata,DRO,Collection,AdminPolicy] cocina_object
|
|
125
|
+
# @param [String] lock
|
|
126
|
+
# @param [DateTime] created
|
|
127
|
+
# @param [DateTime] modified
|
|
128
|
+
# @return [DROWithMetadata,CollectionWithMetadata,AdminPolicyWithMetadata]
|
|
129
|
+
def self.with_metadata(cocina_object, lock, created: nil, modified: nil)
|
|
130
|
+
props = cocina_object.to_h
|
|
131
|
+
props[:created] = created.iso8601 if created
|
|
132
|
+
props[:modified] = modified.iso8601 if modified
|
|
133
|
+
props[:lock] = lock
|
|
134
|
+
|
|
135
|
+
clazz = case cocina_object.type
|
|
136
|
+
when *DRO::TYPES
|
|
137
|
+
DROWithMetadata
|
|
138
|
+
when *Collection::TYPES
|
|
139
|
+
CollectionWithMetadata
|
|
140
|
+
else
|
|
141
|
+
AdminPolicyWithMetadata
|
|
142
|
+
end
|
|
143
|
+
clazz.new(props)
|
|
144
|
+
end
|
|
145
|
+
|
|
113
146
|
def self.type_for(dyn)
|
|
114
147
|
dyn.with_indifferent_access.fetch('type')
|
|
115
148
|
rescue KeyError
|
|
@@ -11,16 +11,21 @@ module Cocina
|
|
|
11
11
|
matcher :cocina_object_with do |**kwargs|
|
|
12
12
|
kwargs.each do |cocina_section, expected|
|
|
13
13
|
match do |actual|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
# created, modified, lock for *WithMetadata don't respond to all?
|
|
15
|
+
if expected.respond_to?(:all?)
|
|
16
|
+
expected.all? do |expected_key, expected_value|
|
|
17
|
+
# NOTE: there's no better method on Hash that I could find for this.
|
|
18
|
+
# #include? and #member? only check keys, not k/v pairs
|
|
19
|
+
actual.public_send(cocina_section).to_h.any? do |actual_key, actual_value|
|
|
20
|
+
if expected_value.is_a?(Hash) && actual_value.is_a?(Hash)
|
|
21
|
+
expected_value.all? { |pair| actual_value.to_a.include?(pair) }
|
|
22
|
+
else
|
|
23
|
+
actual_key == expected_key && actual_value == expected_value
|
|
24
|
+
end
|
|
22
25
|
end
|
|
23
26
|
end
|
|
27
|
+
else
|
|
28
|
+
expected == actual.public_send(cocina_section)
|
|
24
29
|
end
|
|
25
30
|
end
|
|
26
31
|
end
|
data/openapi.yml
CHANGED
|
@@ -31,6 +31,18 @@ paths:
|
|
|
31
31
|
responses:
|
|
32
32
|
'200':
|
|
33
33
|
description: noop
|
|
34
|
+
/validate/DROWithMetadata:
|
|
35
|
+
post:
|
|
36
|
+
summary: Validate a DRO with object metadata
|
|
37
|
+
requestBody:
|
|
38
|
+
required: true
|
|
39
|
+
content:
|
|
40
|
+
application/json:
|
|
41
|
+
schema:
|
|
42
|
+
$ref: '#/components/schemas/DROWithMetadata'
|
|
43
|
+
responses:
|
|
44
|
+
'200':
|
|
45
|
+
description: noop
|
|
34
46
|
/validate/Collection:
|
|
35
47
|
post:
|
|
36
48
|
summary: Validate a Collection
|
|
@@ -55,6 +67,18 @@ paths:
|
|
|
55
67
|
responses:
|
|
56
68
|
'200':
|
|
57
69
|
description: noop
|
|
70
|
+
/validate/CollectionWithMetadata:
|
|
71
|
+
post:
|
|
72
|
+
summary: Validate a Collection with object metadata
|
|
73
|
+
requestBody:
|
|
74
|
+
required: true
|
|
75
|
+
content:
|
|
76
|
+
application/json:
|
|
77
|
+
schema:
|
|
78
|
+
$ref: '#/components/schemas/CollectionWithMetadata'
|
|
79
|
+
responses:
|
|
80
|
+
'200':
|
|
81
|
+
description: noop
|
|
58
82
|
/validate/AdminPolicy:
|
|
59
83
|
post:
|
|
60
84
|
summary: Validate an AdminPolicy
|
|
@@ -79,6 +103,18 @@ paths:
|
|
|
79
103
|
responses:
|
|
80
104
|
'200':
|
|
81
105
|
description: noop
|
|
106
|
+
/validate/AdminPolicyWithMetadata:
|
|
107
|
+
post:
|
|
108
|
+
summary: Validate an AdminPolicy with object metadata
|
|
109
|
+
requestBody:
|
|
110
|
+
required: true
|
|
111
|
+
content:
|
|
112
|
+
application/json:
|
|
113
|
+
schema:
|
|
114
|
+
$ref: '#/components/schemas/AdminPolicyWithMetadata'
|
|
115
|
+
responses:
|
|
116
|
+
'200':
|
|
117
|
+
description: noop
|
|
82
118
|
/validate/Description:
|
|
83
119
|
post:
|
|
84
120
|
summary: Validate a Description
|
|
@@ -295,6 +331,14 @@ components:
|
|
|
295
331
|
description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
|
|
296
332
|
type: string
|
|
297
333
|
nullable: true
|
|
334
|
+
# AdminPolicyWithMetadata schema should not be copied to sdr-api and dor-services-app.
|
|
335
|
+
AdminPolicyWithMetadata:
|
|
336
|
+
description: Admin Policy with addition object metadata.
|
|
337
|
+
type: object
|
|
338
|
+
additionalProperties: false
|
|
339
|
+
allOf:
|
|
340
|
+
- $ref: "#/components/schemas/AdminPolicy"
|
|
341
|
+
- $ref: "#/components/schemas/ObjectMetadata"
|
|
298
342
|
AppliesTo:
|
|
299
343
|
description: Property model for indicating the parts, aspects, or versions of the resource to which a
|
|
300
344
|
descriptive element is applicable.
|
|
@@ -414,6 +458,8 @@ components:
|
|
|
414
458
|
- type
|
|
415
459
|
- version
|
|
416
460
|
- access
|
|
461
|
+
- administrative
|
|
462
|
+
- identification
|
|
417
463
|
CollectionAccess:
|
|
418
464
|
description: Access metadata for collections
|
|
419
465
|
type: object
|
|
@@ -450,6 +496,14 @@ components:
|
|
|
450
496
|
$ref: '#/components/schemas/CatalogLink'
|
|
451
497
|
sourceId:
|
|
452
498
|
$ref: '#/components/schemas/SourceId'
|
|
499
|
+
# CollectionWithMetadata schema should not be copied to sdr-api and dor-services-app.
|
|
500
|
+
CollectionWithMetadata:
|
|
501
|
+
description: Collection with addition object metadata.
|
|
502
|
+
type: object
|
|
503
|
+
additionalProperties: false
|
|
504
|
+
allOf:
|
|
505
|
+
- $ref: "#/components/schemas/Collection"
|
|
506
|
+
- $ref: "#/components/schemas/ObjectMetadata"
|
|
453
507
|
Contributor:
|
|
454
508
|
description: Property model for describing agents contributing in some way to
|
|
455
509
|
the creation and history of the resource.
|
|
@@ -894,6 +948,8 @@ components:
|
|
|
894
948
|
- label
|
|
895
949
|
- type
|
|
896
950
|
- version
|
|
951
|
+
- identification
|
|
952
|
+
- structural
|
|
897
953
|
DROAccess:
|
|
898
954
|
type: object
|
|
899
955
|
additionalProperties: false
|
|
@@ -968,6 +1024,14 @@ components:
|
|
|
968
1024
|
type: array
|
|
969
1025
|
items:
|
|
970
1026
|
$ref: '#/components/schemas/Druid'
|
|
1027
|
+
# DROWithMetadata schema should not be copied to sdr-api and dor-services-app.
|
|
1028
|
+
DROWithMetadata:
|
|
1029
|
+
description: DRO with addition object metadata.
|
|
1030
|
+
type: object
|
|
1031
|
+
additionalProperties: false
|
|
1032
|
+
allOf:
|
|
1033
|
+
- $ref: "#/components/schemas/DRO"
|
|
1034
|
+
- $ref: "#/components/schemas/ObjectMetadata"
|
|
971
1035
|
Druid:
|
|
972
1036
|
type: string
|
|
973
1037
|
pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
|
|
@@ -1158,6 +1222,7 @@ components:
|
|
|
1158
1222
|
- label
|
|
1159
1223
|
- type
|
|
1160
1224
|
- version
|
|
1225
|
+
- structural
|
|
1161
1226
|
FileSetStructural:
|
|
1162
1227
|
description: Structural metadata
|
|
1163
1228
|
type: object
|
|
@@ -1343,6 +1408,25 @@ components:
|
|
|
1343
1408
|
required:
|
|
1344
1409
|
- type
|
|
1345
1410
|
- digest
|
|
1411
|
+
# ObjectMetadata schema should not be copied to sdr-api and dor-services-app.
|
|
1412
|
+
ObjectMetadata:
|
|
1413
|
+
description: Metadata for a cocina object.
|
|
1414
|
+
type: object
|
|
1415
|
+
additionalProperties: false
|
|
1416
|
+
properties:
|
|
1417
|
+
created:
|
|
1418
|
+
description: When the object was created.
|
|
1419
|
+
type: string
|
|
1420
|
+
format: date-time
|
|
1421
|
+
modified:
|
|
1422
|
+
description: When the object was modified.
|
|
1423
|
+
type: string
|
|
1424
|
+
format: date-time
|
|
1425
|
+
lock:
|
|
1426
|
+
description: Key for optimistic locking. The contents of the key is not specified.
|
|
1427
|
+
type: string
|
|
1428
|
+
required:
|
|
1429
|
+
- lock
|
|
1346
1430
|
Presentation:
|
|
1347
1431
|
description: Presentation data for the File.
|
|
1348
1432
|
type: object
|
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.70.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-03-
|
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -293,6 +293,7 @@ files:
|
|
|
293
293
|
- lib/cocina/models/admin_policy.rb
|
|
294
294
|
- lib/cocina/models/admin_policy_access_template.rb
|
|
295
295
|
- lib/cocina/models/admin_policy_administrative.rb
|
|
296
|
+
- lib/cocina/models/admin_policy_with_metadata.rb
|
|
296
297
|
- lib/cocina/models/administrative.rb
|
|
297
298
|
- lib/cocina/models/applies_to.rb
|
|
298
299
|
- lib/cocina/models/business_barcode.rb
|
|
@@ -304,6 +305,7 @@ files:
|
|
|
304
305
|
- lib/cocina/models/collection.rb
|
|
305
306
|
- lib/cocina/models/collection_access.rb
|
|
306
307
|
- lib/cocina/models/collection_identification.rb
|
|
308
|
+
- lib/cocina/models/collection_with_metadata.rb
|
|
307
309
|
- lib/cocina/models/contributor.rb
|
|
308
310
|
- lib/cocina/models/controlled_digital_lending_access.rb
|
|
309
311
|
- lib/cocina/models/dark_access.rb
|
|
@@ -324,6 +326,7 @@ files:
|
|
|
324
326
|
- lib/cocina/models/dro_access.rb
|
|
325
327
|
- lib/cocina/models/dro_rights_description_builder.rb
|
|
326
328
|
- lib/cocina/models/dro_structural.rb
|
|
329
|
+
- lib/cocina/models/dro_with_metadata.rb
|
|
327
330
|
- lib/cocina/models/druid.rb
|
|
328
331
|
- lib/cocina/models/embargo.rb
|
|
329
332
|
- lib/cocina/models/event.rb
|
|
@@ -341,6 +344,7 @@ files:
|
|
|
341
344
|
- lib/cocina/models/location_based_access.rb
|
|
342
345
|
- lib/cocina/models/location_based_download_access.rb
|
|
343
346
|
- lib/cocina/models/message_digest.rb
|
|
347
|
+
- lib/cocina/models/object_metadata.rb
|
|
344
348
|
- lib/cocina/models/object_type.rb
|
|
345
349
|
- lib/cocina/models/presentation.rb
|
|
346
350
|
- lib/cocina/models/purl.rb
|
|
@@ -377,7 +381,7 @@ homepage: https://github.com/sul-dlss/cocina-models
|
|
|
377
381
|
licenses: []
|
|
378
382
|
metadata:
|
|
379
383
|
rubygems_mfa_required: 'true'
|
|
380
|
-
post_install_message:
|
|
384
|
+
post_install_message:
|
|
381
385
|
rdoc_options: []
|
|
382
386
|
require_paths:
|
|
383
387
|
- lib
|
|
@@ -392,8 +396,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
392
396
|
- !ruby/object:Gem::Version
|
|
393
397
|
version: '0'
|
|
394
398
|
requirements: []
|
|
395
|
-
rubygems_version: 3.
|
|
396
|
-
signing_key:
|
|
399
|
+
rubygems_version: 3.3.9
|
|
400
|
+
signing_key:
|
|
397
401
|
specification_version: 4
|
|
398
402
|
summary: Data models for the SDR
|
|
399
403
|
test_files: []
|