cocina-models 0.88.0 → 0.89.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc554199583e2b12406431ed5078bae08509c75989a7aafdcf22715530f3d5da
4
- data.tar.gz: f2bd63b4b242d7f48156499fdf729935bccc728635c692628cd1e3ebb0c84cd5
3
+ metadata.gz: 6350dbb0cb127ef0fffb8a31e84c622bd0a6ed1a93d8a8fbed44462f1749b1c3
4
+ data.tar.gz: fcdfede93a6ae1c22f6b322513ef8b30f0474f7ad9aae9f9601711faf22903c1
5
5
  SHA512:
6
- metadata.gz: afaca98ac0c7260962d483ed4ff4bc0a4c9bf1c3aa538b1571541b98b2ef6d6efd9a00e0575fffd3117adc8dbd75426b4e4dffeb1ebfae4a46fa0db1c1a3e3b1
7
- data.tar.gz: '090a1137f535c219c96966b44a8af03a9a60bdf9dd871c4b6024a033d4323ffc3f000132835d71d55aa60a80f38b7601663b6403b05e6df69a699395ccdf9f99'
6
+ metadata.gz: ee21ac69b1e00d6ae0de058bda4c3b32905566804635221e60d51ab011db0c49a22d7f166f919b8327ba32b68423a11e9020bc746d122e127504475c163c9a38
7
+ data.tar.gz: d4e3e69934c64064279a4f16af8c7e1e3d0cd05623f357c891a5c9c6e462338efd51a1799c4d23aa06feda2b8ba56738949f548caaf21724dbad4f5c2c16c6f6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.88.0)
4
+ cocina-models (0.89.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -33,7 +33,7 @@ GEM
33
33
  openapi_parser (>= 0.11.1, < 1.0)
34
34
  rack (>= 1.5)
35
35
  commonmarker (0.23.8)
36
- concurrent-ruby (1.2.0)
36
+ concurrent-ruby (1.2.2)
37
37
  deprecation (1.1.0)
38
38
  activesupport
39
39
  diff-lcs (1.5.0)
@@ -106,14 +106,14 @@ GEM
106
106
  rspec-core (>= 2, < 4, != 2.12.0)
107
107
  rss (0.2.9)
108
108
  rexml
109
- rubocop (1.45.1)
109
+ rubocop (1.46.0)
110
110
  json (~> 2.3)
111
111
  parallel (~> 1.10)
112
112
  parser (>= 3.2.0.0)
113
113
  rainbow (>= 2.2.2, < 4.0)
114
114
  regexp_parser (>= 1.8, < 3.0)
115
115
  rexml (>= 3.2.5, < 4.0)
116
- rubocop-ast (>= 1.24.1, < 2.0)
116
+ rubocop-ast (>= 1.26.0, < 2.0)
117
117
  ruby-progressbar (~> 1.7)
118
118
  unicode-display_width (>= 2.4.0, < 3.0)
119
119
  rubocop-ast (1.26.0)
@@ -10,13 +10,23 @@ module Cocina
10
10
 
11
11
  module Cocina
12
12
  module Models
13
- #{name} = Types::String.constrained(
14
- format: /#{schema_doc.pattern}/
15
- )
13
+ #{name} = Types::String#{pattern}#{enum}
16
14
  end
17
15
  end
18
16
  RUBY
19
17
  end
18
+
19
+ def pattern
20
+ return unless schema_doc.pattern
21
+
22
+ ".constrained(format: /#{schema_doc.pattern}/)"
23
+ end
24
+
25
+ def enum
26
+ return unless schema_doc.enum
27
+
28
+ ".enum(#{schema_doc.enum.map { |item| quote(item) }.join(', ')})"
29
+ end
20
30
  end
21
31
  end
22
32
  end
@@ -124,7 +124,6 @@ module Cocina
124
124
 
125
125
  NO_CLEAN = [
126
126
  'checkable.rb',
127
- 'license.rb',
128
127
  'validatable.rb',
129
128
  'version.rb',
130
129
  'vocabulary.rb'
@@ -2,25 +2,27 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # Provides the template of access settings that is copied to the items goverend by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.
5
+ # Provides the template of access settings that is copied to the items governed by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.
6
6
  class AdminPolicyAccessTemplate < Struct
7
- attribute? :view, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
8
- # Available for controlled digital lending.
9
- attribute? :controlledDigitalLending, Types::Strict::Bool.default(false)
10
7
  # The human readable copyright statement that applies
11
8
  # example: Copyright World Trade Organization
12
- attribute? :copyright, Types::Strict::String.optional
13
- # Download access level. This is used in the transition from Fedora as a way to set a default download level at registration that is copied down to all the files.
14
-
15
- attribute? :download, Types::Strict::String.enum('world', 'stanford', 'location-based', 'none')
16
- # If access or download is "location-based", this indicates which location should have access. This is used in the transition from Fedora as a way to set a default location at registration that is copied down to all the files.
17
-
18
- attribute? :location, Types::Strict::String.optional.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
9
+ attribute? :copyright, Copyright.optional
19
10
  # The human readable use and reproduction statement that applies
20
11
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
21
- attribute? :useAndReproductionStatement, Types::Strict::String.optional
22
- # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
23
- attribute? :license, Types::Strict::String.optional
12
+ attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
13
+ # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
14
+ attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
15
+ # Access level.
16
+ # Validation of this property is relaxed. See the openapi for full validation.
17
+ attribute? :view, Types::Strict::String.optional.default('dark')
18
+ # Download access level.
19
+ # Validation of this property is relaxed. See the openapi for full validation.
20
+ attribute? :download, Types::Strict::String.optional.default('none')
21
+ # Not used for this access type, must be null.
22
+ # Validation of this property is relaxed. See the openapi for full validation.
23
+ attribute? :location, Types::Strict::String.optional
24
+ # Validation of this property is relaxed. See the openapi for full validation.
25
+ attribute? :controlledDigitalLending, Types::Strict::Bool.optional.default(false)
24
26
  end
25
27
  end
26
28
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- BusinessBarcode = Types::String.constrained(
6
- format: /^2050[0-9]{7}$/
7
- )
5
+ BusinessBarcode = Types::String.constrained(format: /^2050[0-9]{7}$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- CatkeyBarcode = Types::String.constrained(
6
- format: /^[0-9]+-[0-9]+$/
7
- )
5
+ CatkeyBarcode = Types::String.constrained(format: /^[0-9]+-[0-9]+$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- CocinaVersion = Types::String.constrained(
6
- format: /^\d+\.\d+\.\d+$/
7
- )
5
+ CocinaVersion = Types::String.constrained(format: /^\d+\.\d+\.\d+$/)
8
6
  end
9
7
  end
@@ -8,12 +8,12 @@ module Cocina
8
8
  attribute? :view, Types::Strict::String.default('dark').enum('world', 'dark')
9
9
  # The human readable copyright statement that applies
10
10
  # example: Copyright World Trade Organization
11
- attribute? :copyright, Types::Strict::String.optional
11
+ attribute? :copyright, Copyright.optional
12
12
  # The human readable use and reproduction statement that applies
13
13
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
14
- attribute? :useAndReproductionStatement, Types::Strict::String.optional
15
- # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
16
- attribute? :license, Types::Strict::String.optional
14
+ attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
15
+ # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
16
+ attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
17
17
  end
18
18
  end
19
19
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ Copyright = Types::String
6
+ end
7
+ end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- CreatedInFolioIdentifier = Types::String.constrained(
6
- format: /^in\d+$/
7
- )
5
+ CreatedInFolioIdentifier = Types::String.constrained(format: /^in\d+$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- DoiExceptions = Types::String.constrained(
6
- format: %r{^10\.(25740/([vV][aA]90-[cC][tT]15|[sS][yY][xX][aA]-[mM]256|12[qQ][fF]-5243|65[jJ]8-6114)|25936/629[tT]-[bB][xX]79)$}
7
- )
5
+ DoiExceptions = Types::String.constrained(format: %r{^10\.(25740/([vV][aA]90-[cC][tT]15|[sS][yY][xX][aA]-[mM]256|12[qQ][fF]-5243|65[jJ]8-6114)|25936/629[tT]-[bB][xX]79)$})
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- DoiPattern = Types::String.constrained(
6
- format: %r{^10\.(25740|80343)/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$}
7
- )
5
+ DoiPattern = Types::String.constrained(format: %r{^10\.(25740|80343)/[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$})
8
6
  end
9
7
  end
@@ -16,13 +16,13 @@ module Cocina
16
16
  attribute? :controlledDigitalLending, Types::Strict::Bool.optional.default(false)
17
17
  # The human readable copyright statement that applies
18
18
  # example: Copyright World Trade Organization
19
- attribute? :copyright, Types::Strict::String.optional
19
+ attribute? :copyright, Copyright.optional
20
20
  attribute? :embargo, Embargo.optional
21
21
  # The human readable use and reproduction statement that applies
22
22
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
23
- attribute? :useAndReproductionStatement, Types::Strict::String.optional
23
+ attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
24
24
  # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
25
- attribute? :license, Types::Strict::String.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
25
+ attribute? :license, License.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
26
26
  end
27
27
  end
28
28
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- Druid = Types::String.constrained(
6
- format: /^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$/
7
- )
5
+ Druid = Types::String.constrained(format: /^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$/)
8
6
  end
9
7
  end
@@ -17,9 +17,9 @@ module Cocina
17
17
  # Date when the Collection is released from an embargo.
18
18
  # example: 2029-06-22T07:00:00.000+00:00
19
19
  attribute :releaseDate, Types::Params::DateTime
20
- # The human readable use and reproduction statement that applies when the embargo expires.
21
- # example: These materials are in the public domain.
22
- attribute? :useAndReproductionStatement, Types::Strict::String.optional
20
+ # The human readable use and reproduction statement that applies
21
+ # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
22
+ attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
23
23
  end
24
24
  end
25
25
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- LaneMedicalBarcode = Types::String.constrained(
6
- format: /^245[0-9]{8}$/
7
- )
5
+ LaneMedicalBarcode = Types::String.constrained(format: /^245[0-9]{8}$/)
8
6
  end
9
7
  end
@@ -2,9 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # This vocabulary defines some of the supported licenses
6
- class License < Vocabulary('https://cocina.sul.stanford.edu/licenses/')
7
- property :none
8
- end
5
+ License = Types::String.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'https://cocina.sul.stanford.edu/licenses/none')
9
6
  end
10
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- MigratedFromSymphonyIdentifier = Types::String.constrained(
6
- format: /^a\d+$/
7
- )
5
+ MigratedFromSymphonyIdentifier = Types::String.constrained(format: /^a\d+$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- MigratedFromVoyagerIdentifier = Types::String.constrained(
6
- format: /^L\d+$/
7
- )
5
+ MigratedFromVoyagerIdentifier = Types::String.constrained(format: /^L\d+$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- Purl = Types::String.constrained(
6
- format: %r{^https://}
7
- )
5
+ Purl = Types::String.constrained(format: %r{^https://})
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- SourceId = Types::String.constrained(
6
- format: /^.+:.+$/
7
- )
5
+ SourceId = Types::String.constrained(format: /^.+:.+$/)
8
6
  end
9
7
  end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- StandardBarcode = Types::String.constrained(
6
- format: /^36105[0-9]{9}$/
7
- )
5
+ StandardBarcode = Types::String.constrained(format: /^36105[0-9]{9}$/)
8
6
  end
9
7
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ UseAndReproductionStatement = Types::String
6
+ end
7
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.88.0'
5
+ VERSION = '0.89.0'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -237,63 +237,24 @@ components:
237
237
  required:
238
238
  - hasAdminPolicy
239
239
  AdminPolicyAccessTemplate:
240
- description: 'Provides the template of access settings that is copied to the items goverend by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
240
+ description: 'Provides the template of access settings that is copied to the items governed by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
241
241
  type: object
242
242
  additionalProperties: false
243
+ oneOf:
244
+ - $ref: '#/components/schemas/DarkAccess'
245
+ - $ref: '#/components/schemas/CitationOnlyAccess'
246
+ - $ref: '#/components/schemas/ControlledDigitalLendingAccess'
247
+ - $ref: '#/components/schemas/LocationBasedAccess'
248
+ - $ref: '#/components/schemas/LocationBasedDownloadAccess'
249
+ - $ref: '#/components/schemas/StanfordAccess'
250
+ - $ref: '#/components/schemas/WorldAccess'
243
251
  properties:
244
- view:
245
- type: string
246
- enum:
247
- - 'world'
248
- - 'stanford'
249
- - 'location-based'
250
- - 'citation-only'
251
- - 'dark'
252
- controlledDigitalLending:
253
- description: Available for controlled digital lending.
254
- type: boolean
255
252
  copyright:
256
- description: The human readable copyright statement that applies
257
- example: Copyright World Trade Organization
258
- type: string
259
- nullable: true
260
- download:
261
- description: >
262
- Download access level. This is used in the transition from Fedora as
263
- a way to set a default download level at registration that is copied
264
- down to all the files.
265
-
266
- type: string
267
- enum:
268
- - 'world'
269
- - 'stanford'
270
- - 'location-based'
271
- - 'none'
272
- location:
273
- description: >
274
- If access or download is "location-based", this indicates which
275
- location should have access. This is used in the transition from
276
- Fedora as a way to set a default location at registration that is
277
- copied down to all the files.
278
-
279
- type: string
280
- nullable: true
281
- enum:
282
- - 'spec'
283
- - 'music'
284
- - 'ars'
285
- - 'art'
286
- - 'hoover'
287
- - 'm&m'
253
+ $ref: "#/components/schemas/Copyright"
288
254
  useAndReproductionStatement:
289
- description: The human readable use and reproduction statement that applies
290
- example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
291
- type: string
292
- nullable: true
255
+ $ref: "#/components/schemas/UseAndReproductionStatement"
293
256
  license:
294
- description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
295
- type: string
296
- nullable: true
257
+ $ref: "#/components/schemas/License"
297
258
  AdminPolicyAdministrative:
298
259
  description: Administrative properties for an AdminPolicy
299
260
  type: object
@@ -455,19 +416,11 @@ components:
455
416
  - 'dark'
456
417
  default: 'dark'
457
418
  copyright:
458
- description: The human readable copyright statement that applies
459
- example: Copyright World Trade Organization
460
- type: string
461
- nullable: true
419
+ $ref: "#/components/schemas/Copyright"
462
420
  useAndReproductionStatement:
463
- description: The human readable use and reproduction statement that applies
464
- example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
465
- type: string
466
- nullable: true
421
+ $ref: "#/components/schemas/UseAndReproductionStatement"
467
422
  license:
468
- description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
469
- type: string
470
- nullable: true
423
+ $ref: "#/components/schemas/License"
471
424
  CollectionIdentification:
472
425
  type: object
473
426
  additionalProperties: false
@@ -554,6 +507,11 @@ components:
554
507
  required:
555
508
  - view
556
509
  - download
510
+ Copyright:
511
+ description: The human readable copyright statement that applies
512
+ example: Copyright World Trade Organization
513
+ type: string
514
+ nullable: true
557
515
  CreatedInFolioIdentifier:
558
516
  description: A record identifier created in Folio
559
517
  type: string
@@ -629,52 +587,13 @@ components:
629
587
  - type: object
630
588
  properties:
631
589
  copyright:
632
- description: The human readable copyright statement that applies
633
- example: Copyright World Trade Organization
634
- type: string
635
- nullable: true
590
+ $ref: "#/components/schemas/Copyright"
636
591
  embargo:
637
592
  $ref: '#/components/schemas/Embargo'
638
593
  useAndReproductionStatement:
639
- description: The human readable use and reproduction statement that applies
640
- example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
641
- type: string
642
- nullable: true
594
+ $ref: "#/components/schemas/UseAndReproductionStatement"
643
595
  license:
644
- description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
645
- type: string
646
- nullable: true
647
- enum:
648
- - 'https://www.gnu.org/licenses/agpl.txt'
649
- - 'https://www.apache.org/licenses/LICENSE-2.0'
650
- - 'https://opensource.org/licenses/BSD-2-Clause'
651
- - 'https://opensource.org/licenses/BSD-3-Clause'
652
- - 'https://creativecommons.org/licenses/by/4.0/legalcode'
653
- - 'https://creativecommons.org/licenses/by-nc/4.0/legalcode'
654
- - 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode'
655
- - 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
656
- - 'https://creativecommons.org/licenses/by-nd/4.0/legalcode'
657
- - 'https://creativecommons.org/licenses/by-sa/4.0/legalcode'
658
- - 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'
659
- - 'https://opensource.org/licenses/cddl1'
660
- - 'https://www.eclipse.org/legal/epl-2.0'
661
- - 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'
662
- - 'https://www.isc.org/downloads/software-support-policy/isc-license/'
663
- - 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
664
- - 'https://opensource.org/licenses/MIT'
665
- - 'https://www.mozilla.org/MPL/2.0/'
666
- - 'https://opendatacommons.org/licenses/by/1-0/'
667
- - 'http://opendatacommons.org/licenses/odbl/1.0/' # Non cannonical, but in some of our data
668
- - 'https://opendatacommons.org/licenses/odbl/1-0/'
669
- - 'https://creativecommons.org/publicdomain/mark/1.0/'
670
- - 'https://opendatacommons.org/licenses/pddl/1-0/'
671
- - 'https://creativecommons.org/licenses/by/3.0/legalcode'
672
- - 'https://creativecommons.org/licenses/by-sa/3.0/legalcode'
673
- - 'https://creativecommons.org/licenses/by-nd/3.0/legalcode'
674
- - 'https://creativecommons.org/licenses/by-nc/3.0/legalcode'
675
- - 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode'
676
- - 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode'
677
- - 'https://cocina.sul.stanford.edu/licenses/none' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs.
596
+ $ref: "#/components/schemas/License"
678
597
  DROStructural:
679
598
  description: Structural metadata
680
599
  type: object
@@ -1046,10 +965,7 @@ components:
1046
965
  format: date-time
1047
966
  example: '2029-06-22T07:00:00.000+00:00'
1048
967
  useAndReproductionStatement:
1049
- description: The human readable use and reproduction statement that applies when the embargo expires.
1050
- example: These materials are in the public domain.
1051
- type: string
1052
- nullable: true
968
+ $ref: "#/components/schemas/UseAndReproductionStatement"
1053
969
  required:
1054
970
  - releaseDate
1055
971
  Event:
@@ -1357,6 +1273,41 @@ components:
1357
1273
  valueLanguage:
1358
1274
  # description: present for mapping to additional schemas in the future and for consistency but not otherwise used
1359
1275
  $ref: "#/components/schemas/DescriptiveValueLanguage"
1276
+ License:
1277
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
1278
+ type: string
1279
+ nullable: true
1280
+ enum:
1281
+ - 'https://www.gnu.org/licenses/agpl.txt'
1282
+ - 'https://www.apache.org/licenses/LICENSE-2.0'
1283
+ - 'https://opensource.org/licenses/BSD-2-Clause'
1284
+ - 'https://opensource.org/licenses/BSD-3-Clause'
1285
+ - 'https://creativecommons.org/licenses/by/4.0/legalcode'
1286
+ - 'https://creativecommons.org/licenses/by-nc/4.0/legalcode'
1287
+ - 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode'
1288
+ - 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
1289
+ - 'https://creativecommons.org/licenses/by-nd/4.0/legalcode'
1290
+ - 'https://creativecommons.org/licenses/by-sa/4.0/legalcode'
1291
+ - 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'
1292
+ - 'https://opensource.org/licenses/cddl1'
1293
+ - 'https://www.eclipse.org/legal/epl-2.0'
1294
+ - 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'
1295
+ - 'https://www.isc.org/downloads/software-support-policy/isc-license/'
1296
+ - 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
1297
+ - 'https://opensource.org/licenses/MIT'
1298
+ - 'https://www.mozilla.org/MPL/2.0/'
1299
+ - 'https://opendatacommons.org/licenses/by/1-0/'
1300
+ - 'http://opendatacommons.org/licenses/odbl/1.0/' # Non cannonical, but in some of our data
1301
+ - 'https://opendatacommons.org/licenses/odbl/1-0/'
1302
+ - 'https://creativecommons.org/publicdomain/mark/1.0/'
1303
+ - 'https://opendatacommons.org/licenses/pddl/1-0/'
1304
+ - 'https://creativecommons.org/licenses/by/3.0/legalcode'
1305
+ - 'https://creativecommons.org/licenses/by-sa/3.0/legalcode'
1306
+ - 'https://creativecommons.org/licenses/by-nd/3.0/legalcode'
1307
+ - 'https://creativecommons.org/licenses/by-nc/3.0/legalcode'
1308
+ - 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode'
1309
+ - 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode'
1310
+ - 'https://cocina.sul.stanford.edu/licenses/none' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs.
1360
1311
  LocationBasedAccess:
1361
1312
  type: object
1362
1313
  properties:
@@ -2068,6 +2019,11 @@ components:
2068
2019
  - type: object
2069
2020
  required:
2070
2021
  - valueAt
2022
+ UseAndReproductionStatement:
2023
+ description: The human readable use and reproduction statement that applies
2024
+ example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
2025
+ type: string
2026
+ nullable: true
2071
2027
  WorldAccess:
2072
2028
  type: object
2073
2029
  properties:
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.88.0
4
+ version: 0.89.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: 2023-02-22 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -387,6 +387,7 @@ files:
387
387
  - lib/cocina/models/collection_with_metadata.rb
388
388
  - lib/cocina/models/contributor.rb
389
389
  - lib/cocina/models/controlled_digital_lending_access.rb
390
+ - lib/cocina/models/copyright.rb
390
391
  - lib/cocina/models/created_in_folio_identifier.rb
391
392
  - lib/cocina/models/dark_access.rb
392
393
  - lib/cocina/models/description.rb
@@ -510,6 +511,7 @@ files:
510
511
  - lib/cocina/models/stanford_access.rb
511
512
  - lib/cocina/models/symphony_catalog_link.rb
512
513
  - lib/cocina/models/title.rb
514
+ - lib/cocina/models/use_and_reproduction_statement.rb
513
515
  - lib/cocina/models/validatable.rb
514
516
  - lib/cocina/models/validators/associated_name_validator.rb
515
517
  - lib/cocina/models/validators/catalog_links_validator.rb
@@ -531,7 +533,7 @@ homepage: https://github.com/sul-dlss/cocina-models
531
533
  licenses: []
532
534
  metadata:
533
535
  rubygems_mfa_required: 'true'
534
- post_install_message:
536
+ post_install_message:
535
537
  rdoc_options: []
536
538
  require_paths:
537
539
  - lib
@@ -547,7 +549,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
547
549
  version: '0'
548
550
  requirements: []
549
551
  rubygems_version: 3.3.7
550
- signing_key:
552
+ signing_key:
551
553
  specification_version: 4
552
554
  summary: Data models for the SDR
553
555
  test_files: []