cocina-models 0.33.0 → 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +53 -2
- data/cocina-models.gemspec +2 -2
- data/lib/cocina/generator/generator.rb +1 -1
- data/lib/cocina/generator/schema_value.rb +2 -2
- data/lib/cocina/models.rb +1 -2
- data/lib/cocina/models/admin_policy_administrative.rb +1 -1
- data/lib/cocina/models/administrative.rb +1 -1
- data/lib/cocina/models/dro.rb +1 -1
- data/lib/cocina/models/request_collection.rb +1 -1
- data/lib/cocina/models/request_dro.rb +2 -2
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +27 -5
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 258bc916aaaff62a84cd0bd264f8957e3c916310134ef3372cfdd3eca4c1ff4e
|
4
|
+
data.tar.gz: c26a6cc519230a25d19b218ddcec52fa552ea7780f647b6d449aee223be35eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd057f437502f2e54f6b2c689b6aef4c808ac4912c91d87755abfeb13c24100ef3380f262e7ec27f42592ecbd59b16d68669c878a31c55fc2402f069c5142f1e
|
7
|
+
data.tar.gz: 5a27ebb9108e9838117b02ec015bb025120d82e3f90749b12d23b523f3eea4efe865b6e405f649574f10f88ee0a70811334c339e9d522f5f1186b72f59df9240
|
data/.rubocop.yml
CHANGED
@@ -4,7 +4,7 @@ inherit_from: .rubocop_todo.yml
|
|
4
4
|
require:
|
5
5
|
- rubocop-rspec
|
6
6
|
|
7
|
-
|
7
|
+
Layout/LineLength:
|
8
8
|
Max: 114
|
9
9
|
Exclude:
|
10
10
|
- lib/cocina/models/*
|
@@ -26,7 +26,58 @@ RSpec/ExampleLength:
|
|
26
26
|
- spec/cocina/models/description_spec.rb
|
27
27
|
- spec/cocina/models/dro_shared_examples.rb
|
28
28
|
|
29
|
-
|
30
29
|
Style/Documentation:
|
31
30
|
Exclude:
|
32
31
|
- lib/cocina/models/*
|
32
|
+
|
33
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Layout/SpaceAroundMethodCallOperator:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Lint/DeprecatedOpenSSLConstant:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Lint/MixedRegexpCaptureTypes:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Lint/RaiseException:
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
Lint/StructNewOverride:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
Style/AccessorGrouping:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Style/BisectedAttrAccessor:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
Style/ExponentialNotation:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
Style/HashEachMethods:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Style/HashTransformKeys:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Style/HashTransformValues:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Style/RedundantAssignment:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Style/RedundantFetchBlock:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/RedundantRegexpCharacterClass:
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/RedundantRegexpEscape:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/SlicingWithRange:
|
82
|
+
Enabled: true
|
83
|
+
|
data/cocina-models.gemspec
CHANGED
@@ -33,9 +33,9 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
35
35
|
spec.add_development_dependency 'committee'
|
36
|
-
spec.add_development_dependency 'rake', '~>
|
36
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
38
|
+
spec.add_development_dependency 'rubocop', '~> 0.87'
|
39
39
|
spec.add_development_dependency 'rubocop-rspec'
|
40
40
|
spec.add_development_dependency 'simplecov', '~> 0.17.0'
|
41
41
|
end
|
@@ -4,11 +4,11 @@ module Cocina
|
|
4
4
|
module Generator
|
5
5
|
# Class for generating from an openapi value
|
6
6
|
class SchemaValue < SchemaBase
|
7
|
-
# rubocop:disable
|
7
|
+
# rubocop:disable Layout/LineLength
|
8
8
|
def generate
|
9
9
|
"#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
|
10
10
|
end
|
11
|
-
# rubocop:enable
|
11
|
+
# rubocop:enable Layout/LineLength
|
12
12
|
|
13
13
|
private
|
14
14
|
|
data/lib/cocina/models.rb
CHANGED
@@ -14,7 +14,6 @@ require 'thor'
|
|
14
14
|
|
15
15
|
# Help Zeitwerk find some of our classes
|
16
16
|
class CocinaModelsInflector < Zeitwerk::Inflector
|
17
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
18
17
|
# rubocop:disable Metrics/MethodLength
|
19
18
|
def camelize(basename, _abspath)
|
20
19
|
case basename
|
@@ -34,7 +33,7 @@ class CocinaModelsInflector < Zeitwerk::Inflector
|
|
34
33
|
super
|
35
34
|
end
|
36
35
|
end
|
37
|
-
|
36
|
+
|
38
37
|
# rubocop:enable Metrics/MethodLength
|
39
38
|
end
|
40
39
|
|
@@ -5,7 +5,7 @@ module Cocina
|
|
5
5
|
class AdminPolicyAdministrative < Struct
|
6
6
|
attribute :defaultObjectRights, Types::Strict::String.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
|
7
7
|
attribute :registrationWorkflow, Types::Strict::String.meta(omittable: true)
|
8
|
-
attribute :hasAdminPolicy, Types::Strict::String
|
8
|
+
attribute :hasAdminPolicy, Types::Strict::String
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -4,7 +4,7 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class Administrative < Struct
|
6
6
|
# example: druid:bc123df4567
|
7
|
-
attribute :hasAdminPolicy, Types::Strict::String
|
7
|
+
attribute :hasAdminPolicy, Types::Strict::String
|
8
8
|
attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).meta(omittable: true)
|
9
9
|
# Administrative or Internal project this resource is a part of
|
10
10
|
# example: Google Books
|
data/lib/cocina/models/dro.rb
CHANGED
@@ -31,7 +31,7 @@ module Cocina
|
|
31
31
|
# Version for the DRO within SDR.
|
32
32
|
attribute :version, Types::Strict::Integer
|
33
33
|
attribute(:access, DROAccess.default { DROAccess.new })
|
34
|
-
attribute
|
34
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
35
35
|
attribute :description, Description.optional.meta(omittable: true)
|
36
36
|
attribute :identification, Identification.optional.meta(omittable: true)
|
37
37
|
attribute :structural, DROStructural.optional.meta(omittable: true)
|
@@ -16,7 +16,7 @@ module Cocina
|
|
16
16
|
attribute :label, Types::Strict::String
|
17
17
|
attribute :version, Types::Strict::Integer
|
18
18
|
attribute(:access, Access.default { Access.new })
|
19
|
-
attribute
|
19
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
20
20
|
attribute :description, Description.optional.meta(omittable: true)
|
21
21
|
attribute :identification, CollectionIdentification.optional.meta(omittable: true)
|
22
22
|
|
@@ -25,8 +25,8 @@ module Cocina
|
|
25
25
|
attribute :type, Types::Strict::String.enum(*RequestDRO::TYPES)
|
26
26
|
attribute :label, Types::Strict::String
|
27
27
|
attribute :version, Types::Strict::Integer
|
28
|
-
attribute
|
29
|
-
attribute
|
28
|
+
attribute(:access, DROAccess.default { DROAccess.new })
|
29
|
+
attribute(:administrative, Administrative.default { Administrative.new })
|
30
30
|
attribute :description, Description.optional.meta(omittable: true)
|
31
31
|
attribute(:identification, RequestIdentification.default { RequestIdentification.new })
|
32
32
|
attribute :structural, RequestDROStructural.optional.meta(omittable: true)
|
data/openapi.yml
CHANGED
@@ -142,6 +142,8 @@ components:
|
|
142
142
|
description: Administrative or Internal project this resource is a part of
|
143
143
|
example: Google Books
|
144
144
|
type: string
|
145
|
+
required:
|
146
|
+
- hasAdminPolicy
|
145
147
|
AdminPolicy:
|
146
148
|
type: object
|
147
149
|
additionalProperties: false
|
@@ -162,11 +164,11 @@ components:
|
|
162
164
|
description:
|
163
165
|
$ref: '#/components/schemas/Description'
|
164
166
|
required:
|
167
|
+
- administrative
|
165
168
|
- externalIdentifier
|
166
169
|
- label
|
167
170
|
- type
|
168
171
|
- version
|
169
|
-
- administrative
|
170
172
|
AdminPolicyAdministrative:
|
171
173
|
type: object
|
172
174
|
additionalProperties: false
|
@@ -178,6 +180,8 @@ components:
|
|
178
180
|
type: string
|
179
181
|
hasAdminPolicy:
|
180
182
|
type: string
|
183
|
+
required:
|
184
|
+
- hasAdminPolicy
|
181
185
|
AppliesTo:
|
182
186
|
description: Property model for indicating the parts, aspects, or versions of the resource to which a
|
183
187
|
descriptive element is applicable.
|
@@ -461,11 +465,12 @@ components:
|
|
461
465
|
geographic:
|
462
466
|
$ref: '#/components/schemas/Geographic'
|
463
467
|
required:
|
468
|
+
- access
|
469
|
+
- administrative
|
464
470
|
- externalIdentifier
|
465
471
|
- label
|
466
472
|
- type
|
467
473
|
- version
|
468
|
-
- access
|
469
474
|
DROAccess:
|
470
475
|
type: object
|
471
476
|
additionalProperties: false
|
@@ -710,6 +715,13 @@ components:
|
|
710
715
|
properties:
|
711
716
|
sourceId:
|
712
717
|
type: string
|
718
|
+
description: >
|
719
|
+
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
720
|
+
historically and currently, are representations of objects that are also represented in other systems.
|
721
|
+
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
722
|
+
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
723
|
+
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
724
|
+
look for the original item if you're looking at its SDR representation.
|
713
725
|
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
714
726
|
catalogLinks:
|
715
727
|
type: array
|
@@ -790,10 +802,10 @@ components:
|
|
790
802
|
description:
|
791
803
|
$ref: '#/components/schemas/Description'
|
792
804
|
required:
|
805
|
+
- administrative
|
793
806
|
- label
|
794
807
|
- type
|
795
808
|
- version
|
796
|
-
- administrative
|
797
809
|
RequestCollection:
|
798
810
|
description: Same as a Collection, but doesn't have an externalIdentifier as one will be created
|
799
811
|
type: object
|
@@ -821,10 +833,11 @@ components:
|
|
821
833
|
identification:
|
822
834
|
$ref: '#/components/schemas/CollectionIdentification'
|
823
835
|
required:
|
836
|
+
- access
|
837
|
+
- administrative
|
824
838
|
- label
|
825
839
|
- type
|
826
840
|
- version
|
827
|
-
- access
|
828
841
|
RequestDRO:
|
829
842
|
description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy.
|
830
843
|
type: object
|
@@ -866,10 +879,12 @@ components:
|
|
866
879
|
geographic:
|
867
880
|
$ref: '#/components/schemas/Geographic'
|
868
881
|
required:
|
882
|
+
- access
|
883
|
+
- administrative
|
884
|
+
- identification
|
869
885
|
- label
|
870
886
|
- type
|
871
887
|
- version
|
872
|
-
- identification
|
873
888
|
RequestDROStructural:
|
874
889
|
description: Structural metadata
|
875
890
|
type: object
|
@@ -962,6 +977,13 @@ components:
|
|
962
977
|
properties:
|
963
978
|
sourceId:
|
964
979
|
type: string
|
980
|
+
description: >
|
981
|
+
Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
|
982
|
+
historically and currently, are representations of objects that are also represented in other systems.
|
983
|
+
For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
|
984
|
+
in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
|
985
|
+
and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
|
986
|
+
look for the original item if you're looking at its SDR representation.
|
965
987
|
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
966
988
|
catalogLinks:
|
967
989
|
type: array
|
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.34.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-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '13.0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '13.0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rspec
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: '0.87'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: '0.87'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rubocop-rspec
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -314,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
314
|
- !ruby/object:Gem::Version
|
315
315
|
version: '0'
|
316
316
|
requirements: []
|
317
|
-
rubygems_version: 3.
|
317
|
+
rubygems_version: 3.1.2
|
318
318
|
signing_key:
|
319
319
|
specification_version: 4
|
320
320
|
summary: Data models for the SDR
|