cocina-models 0.48.0 → 0.53.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocina/models/access_role.rb +11 -0
- data/lib/cocina/models/access_role_member.rb +16 -0
- data/lib/cocina/models/admin_policy_administrative.rb +5 -1
- data/lib/cocina/models/descriptive_parallel_event.rb +19 -0
- data/lib/cocina/models/event.rb +2 -0
- data/lib/cocina/models/validator.rb +2 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +127 -21
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 328b1cc6267ee00ff250c1a255e1639cd99ee687e31ef1eb3644bae1b2b32435
|
4
|
+
data.tar.gz: 0131a0371050510c23a902c5e5dc14c848bb828b00bc3408bd74757c258d4642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98649a23bc16e020e6b8fff14d2ecd86978843ddd113aaafb6857f0dd525c735dc46522a71a3747bc3ac56018578dd1514777ffa8bfb7fcfd965f8fcd8b51f16
|
7
|
+
data.tar.gz: 40508d78201cc8438abea8f5dfcdd04a013df6874bc788d31eb380fd135476defe3643eda79c908c5fdaac6102b0e079c2d779cab976e6262479d6e30bfc4068
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class AccessRole < Struct
|
6
|
+
# Name of role
|
7
|
+
attribute :name, Types::Strict::String.enum('sdr-administrator', 'sdr-viewer', 'dor-apo-manager', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
|
8
|
+
attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class AccessRoleMember < Struct
|
6
|
+
include Checkable
|
7
|
+
|
8
|
+
TYPES = %w[sunetid
|
9
|
+
workgroup].freeze
|
10
|
+
|
11
|
+
# Name of role
|
12
|
+
attribute :type, Types::Strict::String.enum(*AccessRoleMember::TYPES)
|
13
|
+
attribute :identifier, Types::Strict::String
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -4,8 +4,12 @@ module Cocina
|
|
4
4
|
module Models
|
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
|
-
attribute :registrationWorkflow, Types::Strict::String.meta(omittable: true)
|
7
|
+
attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
|
8
|
+
# An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
|
9
|
+
# example: wasCrawlPreassemblyWF
|
10
|
+
attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
|
8
11
|
attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
|
12
|
+
attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
|
9
13
|
attribute :hasAdminPolicy, Types::Strict::String
|
10
14
|
end
|
11
15
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class DescriptiveParallelEvent < Struct
|
6
|
+
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
+
# Description of the event (creation, publication, etc.).
|
8
|
+
attribute :type, Types::Strict::String.meta(omittable: true)
|
9
|
+
# The preferred display label to use for the event in access systems.
|
10
|
+
attribute :displayLabel, Types::Strict::String.meta(omittable: true)
|
11
|
+
attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
12
|
+
attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
|
13
|
+
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
|
+
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
|
+
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/cocina/models/event.rb
CHANGED
@@ -13,6 +13,8 @@ module Cocina
|
|
13
13
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
14
14
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
15
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
|
+
attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
|
17
|
+
attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).meta(omittable: true)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -7,7 +7,8 @@ module Cocina
|
|
7
7
|
def self.validate(clazz, attributes)
|
8
8
|
method_name = clazz.name.split('::').last
|
9
9
|
request_operation = root.request_operation(:post, "/validate/#{method_name}")
|
10
|
-
|
10
|
+
# JSON.parse forces serialization of objects like DateTime.
|
11
|
+
request_operation.validate_request_body('application/json', JSON.parse(attributes.to_json))
|
11
12
|
rescue OpenAPIParser::OpenAPIError => e
|
12
13
|
raise ValidationError, e.message
|
13
14
|
end
|
data/openapi.yml
CHANGED
@@ -118,6 +118,48 @@ components:
|
|
118
118
|
- 'art'
|
119
119
|
- 'hoover'
|
120
120
|
- 'm&m'
|
121
|
+
AccessRole:
|
122
|
+
description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
|
123
|
+
type: object
|
124
|
+
additionalProperties: false
|
125
|
+
properties:
|
126
|
+
name:
|
127
|
+
description: Name of role
|
128
|
+
type: string
|
129
|
+
enum:
|
130
|
+
- 'sdr-administrator'
|
131
|
+
- 'sdr-viewer'
|
132
|
+
- 'dor-apo-manager'
|
133
|
+
- 'hydrus-collection-creator'
|
134
|
+
- 'hydrus-collection-manager'
|
135
|
+
- 'hydrus-collection-depositor'
|
136
|
+
- 'hydrus-collection-item-depositor'
|
137
|
+
- 'hydrus-collection-reviewer'
|
138
|
+
- 'hydrus-collection-viewer'
|
139
|
+
members:
|
140
|
+
description: The users and groups that are members of the role
|
141
|
+
type: array
|
142
|
+
items:
|
143
|
+
$ref: '#/components/schemas/AccessRoleMember'
|
144
|
+
required:
|
145
|
+
- members
|
146
|
+
- name
|
147
|
+
AccessRoleMember:
|
148
|
+
description: Represents a user or group that is a member of an AccessRole
|
149
|
+
type: object
|
150
|
+
additionalProperties: false
|
151
|
+
properties:
|
152
|
+
type:
|
153
|
+
description: Name of role
|
154
|
+
type: string
|
155
|
+
enum:
|
156
|
+
- 'sunetid'
|
157
|
+
- 'workgroup'
|
158
|
+
identifier:
|
159
|
+
type: string
|
160
|
+
required:
|
161
|
+
- identifier
|
162
|
+
- type
|
121
163
|
Administrative:
|
122
164
|
type: object
|
123
165
|
additionalProperties: false
|
@@ -161,6 +203,7 @@ components:
|
|
161
203
|
- type
|
162
204
|
- version
|
163
205
|
AdminPolicyAdministrative:
|
206
|
+
description: Administrative properties for an AdminPolicy
|
164
207
|
type: object
|
165
208
|
additionalProperties: false
|
166
209
|
properties:
|
@@ -168,12 +211,24 @@ components:
|
|
168
211
|
type: string
|
169
212
|
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>
|
170
213
|
registrationWorkflow:
|
214
|
+
description: When you register an item with this admin policy, these are the workflows that are available.
|
215
|
+
type: array
|
216
|
+
items:
|
217
|
+
type: string
|
218
|
+
disseminationWorkflow:
|
219
|
+
description: An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
|
220
|
+
example: wasCrawlPreassemblyWF
|
171
221
|
type: string
|
172
222
|
collectionsForRegistration:
|
173
223
|
description: When you register an item with this admin policy, these are the collections that are available.
|
174
224
|
type: array
|
175
225
|
items:
|
176
226
|
type: string
|
227
|
+
roles:
|
228
|
+
description: The access roles conferred by this AdminPolicy (used by Argo)
|
229
|
+
type: array
|
230
|
+
items:
|
231
|
+
$ref: '#/components/schemas/AccessRole'
|
177
232
|
hasAdminPolicy:
|
178
233
|
type: string
|
179
234
|
required:
|
@@ -521,6 +576,49 @@ components:
|
|
521
576
|
type: array
|
522
577
|
items:
|
523
578
|
$ref: "#/components/schemas/DescriptiveValue"
|
579
|
+
DescriptiveParallelEvent:
|
580
|
+
description: Value model for multiple representations of information about the same event (e.g. in different languages).
|
581
|
+
type: object
|
582
|
+
additionalProperties: false
|
583
|
+
allOf:
|
584
|
+
- $ref: "#/components/schemas/DescriptiveStructuredValue"
|
585
|
+
- type: object
|
586
|
+
additionalProperties: false
|
587
|
+
properties:
|
588
|
+
type:
|
589
|
+
description: Description of the event (creation, publication, etc.).
|
590
|
+
type: string
|
591
|
+
displayLabel:
|
592
|
+
description: The preferred display label to use for the event in access systems.
|
593
|
+
type: string
|
594
|
+
date:
|
595
|
+
description: Dates associated with the event.
|
596
|
+
type: array
|
597
|
+
items:
|
598
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
599
|
+
contributor:
|
600
|
+
description: Contributors associated with the event.
|
601
|
+
type: array
|
602
|
+
items:
|
603
|
+
$ref: "#/components/schemas/Contributor"
|
604
|
+
location:
|
605
|
+
description: Locations associated with the event.
|
606
|
+
type: array
|
607
|
+
items:
|
608
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
609
|
+
identifier:
|
610
|
+
description: Identifiers and URIs associated with the event.
|
611
|
+
type: array
|
612
|
+
items:
|
613
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
614
|
+
note:
|
615
|
+
description: Other information about the event.
|
616
|
+
type: array
|
617
|
+
items:
|
618
|
+
$ref: "#/components/schemas/DescriptiveValue"
|
619
|
+
valueLanguage:
|
620
|
+
# description: Language of the descriptive element value
|
621
|
+
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
524
622
|
DescriptiveParallelValue:
|
525
623
|
description: Value model for multiple representations of the same information (e.g. in different languages).
|
526
624
|
type: object
|
@@ -558,27 +656,6 @@ components:
|
|
558
656
|
$ref: '#/components/schemas/Standard'
|
559
657
|
# description: An alphabet or other notation used to represent a
|
560
658
|
# language or other symbolic system of the descriptive element value.
|
561
|
-
Title:
|
562
|
-
type: object
|
563
|
-
additionalProperties: false
|
564
|
-
allOf:
|
565
|
-
- $ref: "#/components/schemas/DescriptiveValue"
|
566
|
-
- anyOf:
|
567
|
-
- type: object
|
568
|
-
required:
|
569
|
-
- value
|
570
|
-
- type: object
|
571
|
-
required:
|
572
|
-
- structuredValue
|
573
|
-
- type: object
|
574
|
-
required:
|
575
|
-
- parallelValue
|
576
|
-
- type: object
|
577
|
-
required:
|
578
|
-
- groupedValue
|
579
|
-
- type: object
|
580
|
-
required:
|
581
|
-
- valueAt
|
582
659
|
DRO:
|
583
660
|
description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system.
|
584
661
|
type: object
|
@@ -777,6 +854,14 @@ components:
|
|
777
854
|
type: array
|
778
855
|
items:
|
779
856
|
$ref: "#/components/schemas/DescriptiveValue"
|
857
|
+
valueLanguage:
|
858
|
+
# description: Language of the descriptive element value
|
859
|
+
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
860
|
+
parallelEvent:
|
861
|
+
description: For multiple representations of information about the same event (e.g. in different languages)
|
862
|
+
type: array
|
863
|
+
items:
|
864
|
+
$ref: "#/components/schemas/DescriptiveParallelEvent"
|
780
865
|
File:
|
781
866
|
description: Binaries that are the basis of what our domain manages. Binaries here do not include metadata files generated for the domain's own management purposes.
|
782
867
|
type: object
|
@@ -1415,3 +1500,24 @@ components:
|
|
1415
1500
|
type: string
|
1416
1501
|
source:
|
1417
1502
|
$ref: "#/components/schemas/Source"
|
1503
|
+
Title:
|
1504
|
+
type: object
|
1505
|
+
additionalProperties: false
|
1506
|
+
allOf:
|
1507
|
+
- $ref: "#/components/schemas/DescriptiveValue"
|
1508
|
+
- anyOf:
|
1509
|
+
- type: object
|
1510
|
+
required:
|
1511
|
+
- value
|
1512
|
+
- type: object
|
1513
|
+
required:
|
1514
|
+
- structuredValue
|
1515
|
+
- type: object
|
1516
|
+
required:
|
1517
|
+
- parallelValue
|
1518
|
+
- type: object
|
1519
|
+
required:
|
1520
|
+
- groupedValue
|
1521
|
+
- type: object
|
1522
|
+
required:
|
1523
|
+
- valueAt
|
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.53.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: 2021-
|
11
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -254,6 +254,8 @@ files:
|
|
254
254
|
- lib/cocina/generator/vocab.rb
|
255
255
|
- lib/cocina/models.rb
|
256
256
|
- lib/cocina/models/access.rb
|
257
|
+
- lib/cocina/models/access_role.rb
|
258
|
+
- lib/cocina/models/access_role_member.rb
|
257
259
|
- lib/cocina/models/admin_policy.rb
|
258
260
|
- lib/cocina/models/admin_policy_administrative.rb
|
259
261
|
- lib/cocina/models/administrative.rb
|
@@ -269,6 +271,7 @@ files:
|
|
269
271
|
- lib/cocina/models/descriptive_basic_value.rb
|
270
272
|
- lib/cocina/models/descriptive_geographic_metadata.rb
|
271
273
|
- lib/cocina/models/descriptive_grouped_value.rb
|
274
|
+
- lib/cocina/models/descriptive_parallel_event.rb
|
272
275
|
- lib/cocina/models/descriptive_parallel_value.rb
|
273
276
|
- lib/cocina/models/descriptive_structured_value.rb
|
274
277
|
- lib/cocina/models/descriptive_value.rb
|
@@ -326,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
329
|
- !ruby/object:Gem::Version
|
327
330
|
version: '0'
|
328
331
|
requirements: []
|
329
|
-
rubygems_version: 3.1.
|
332
|
+
rubygems_version: 3.1.2
|
330
333
|
signing_key:
|
331
334
|
specification_version: 4
|
332
335
|
summary: Data models for the SDR
|