cocina-models 0.21.0 → 0.22.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: 6579b5a67f571fcdc927fc706ede76393f43ebd308afa239c5af2b51d002cbc7
4
- data.tar.gz: 3cf796d0d505cece4aa1f168ce3d7fdc5d3f3430cc452aec55678e0fad756c4f
3
+ metadata.gz: 4da1f34a862366edd3a370ae52e3d9cecb29dc1f1f4938196444db5071870a56
4
+ data.tar.gz: f8a2b7fc4d308bbf884a46b5f2c765f7989f2467a3749742faad34112a5b30d7
5
5
  SHA512:
6
- metadata.gz: dfd14169ccf6c62d828642dd806030bc456f1838e3891b8205570f72782e47cbe3bc10b50fa175ae52bbaeafb5fd6b0bd9d756d42f08c22ef41075b682c9629b
7
- data.tar.gz: 1503063b275634492bd6bd050c170989c01cd0051fa133bc2c9a6999b71eede591a1a3da7040d57f19ff62fe2c71f39d9c77cffbf59e1f4a510b2ee87d1d80f6
6
+ metadata.gz: b9ade72909e628f07fdbddd8ab673482410e92571897543b2266194ee5c5d060f3efc003dcf1431c0583ee73f6a31a06b1a4b0d93b9e2818b4ec169fb665bffc
7
+ data.tar.gz: fda63f0e397f9f9778e5ae957bc8bd9866038cb82d649f11e09d64d0d89d618878ddac1ade3659b5786ce83ab73605b56fdf874c34212edf2d7d054f5e24ea0d
data/.rubocop_todo.yml CHANGED
@@ -1,18 +1,14 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-01-13 15:35:17 -0800 using RuboCop version 0.74.0.
3
+ # on 2020-02-13 12:54:33 -0500 using RuboCop version 0.79.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- Metrics/AbcSize:
11
- Max: 18
12
-
13
- # Offense count: 2
9
+ # Offense count: 3
14
10
  # Configuration parameters: Max.
15
11
  RSpec/ExampleLength:
16
12
  Exclude:
17
13
  - 'spec/cocina/models/dro_spec.rb'
18
- - 'spec/cocina/models/file_spec.rb'
14
+ - 'spec/cocina/models/request_dro_spec.rb'
data/README.md CHANGED
@@ -22,10 +22,10 @@ cd docs
22
22
  prmd combine --meta meta.json maps/ > schema.json
23
23
 
24
24
  # Check it’s all good
25
- $ prmd verify schema.json
25
+ prmd verify schema.json
26
26
 
27
27
  # Build docs
28
- $ prmd doc schema.json > schema.md
28
+ prmd doc schema.json > schema.md
29
29
  ```
30
30
 
31
31
  Then check in the resulting changes to `docs/schema.json` and `docs/schema.md`
data/docs/maps/DRO.json CHANGED
@@ -86,10 +86,22 @@
86
86
  "type": "string",
87
87
  "enum": ["world", "stanford", "location-based", "citation-only", "dark"]
88
88
  },
89
- "embargoReleaseDate": {
90
- "description": "Date when the DRO is released from an embargo, if an embargo exists.",
91
- "type": "string",
92
- "format": "date-time"
89
+ "embargo": {
90
+ "description": "Embargo metadata",
91
+ "type": "object",
92
+ "required": ["releaseDate", "access"],
93
+ "properties": {
94
+ "releaseDate": {
95
+ "description": "Date when the DRO is released from an embargo.",
96
+ "type": "string",
97
+ "format": "date-time"
98
+ },
99
+ "access": {
100
+ "description": "Access level for the DRO when released from embargo.",
101
+ "type": "string",
102
+ "enum": ["world", "stanford", "location-based", "citation-only", "dark"]
103
+ }
104
+ }
93
105
  },
94
106
  "license": {
95
107
  "description": "The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).",
data/docs/schema.json CHANGED
@@ -557,12 +557,37 @@
557
557
  "dark"
558
558
  ]
559
559
  },
560
- "embargoReleaseDate": {
561
- "description": "Date when the DRO is released from an embargo, if an embargo exists.",
560
+ "embargo": {
561
+ "description": "Embargo metadata",
562
562
  "type": [
563
- "string"
563
+ "object"
564
564
  ],
565
- "format": "date-time"
565
+ "required": [
566
+ "releaseDate",
567
+ "access"
568
+ ],
569
+ "properties": {
570
+ "releaseDate": {
571
+ "description": "Date when the DRO is released from an embargo.",
572
+ "type": [
573
+ "string"
574
+ ],
575
+ "format": "date-time"
576
+ },
577
+ "access": {
578
+ "description": "Access level for the DRO when released from embargo.",
579
+ "type": [
580
+ "string"
581
+ ],
582
+ "enum": [
583
+ "world",
584
+ "stanford",
585
+ "location-based",
586
+ "citation-only",
587
+ "dark"
588
+ ]
589
+ }
590
+ }
566
591
  },
567
592
  "license": {
568
593
  "description": "The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).",
data/docs/schema.md CHANGED
@@ -81,7 +81,8 @@ Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction
81
81
  | **access:access** | *string* | Access level for the DRO.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
82
82
  | **access:copyright** | *string* | The human readable copyright statement that applies to the DRO. | `"example"` |
83
83
  | **access:download** | *string* | Download level for the DRO metadata.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
84
- | **access:embargoReleaseDate** | *date-time* | Date when the DRO is released from an embargo, if an embargo exists. | `"2015-01-01T12:00:00Z"` |
84
+ | **access:embargo:access** | *string* | Access level for the DRO when released from embargo.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
85
+ | **access:embargo:releaseDate** | *date-time* | Date when the DRO is released from an embargo. | `"2015-01-01T12:00:00Z"` |
85
86
  | **access:license** | *string* | The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.). | `"example"` |
86
87
  | **access:reuseAndReproductionStatement** | *string* | The human readable reuse and reproduction statement that applies to the DRO. | `"example"` |
87
88
  | **access:termsOfUse** | *string* | License or terms of use governing reuse of the DRO. Should be a text statement. | `"example"` |
@@ -26,7 +26,14 @@ module Cocina
26
26
 
27
27
  # Subschema for access concerns
28
28
  class Access < Struct
29
- attribute :embargoReleaseDate, Types::Params::DateTime.meta(omittable: true)
29
+ # Subschema for embargo concerns
30
+ class Embargo < Struct
31
+ attribute :releaseDate, Types::Params::DateTime
32
+ attribute :access, Types::String.default('dark')
33
+ .enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
34
+ end
35
+
36
+ attribute :embargo, Embargo.optional.default(nil)
30
37
  end
31
38
 
32
39
  # Subschema for administrative concerns
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.21.0'
5
+ VERSION = '0.22.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.0.3
212
+ rubygems_version: 3.1.2
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Data models for the SDR