cocina-models 0.49.0 → 0.54.0.beta.1
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 -1
- data/lib/cocina/models/file_administrative.rb +1 -0
- data/lib/cocina/models/validator.rb +2 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +131 -22
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 458d1785e59901fddf5a48498b69f94918438a17eae1b55b3aae4c2566e7dfa5
|
4
|
+
data.tar.gz: 2f8db910031913c252f19e019535877d7d7cbb113ee8e2fdf5e3455866a5ef54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095a80dcc767034269cca494bb97ac2cd2ebfd71c8c08407c22d69e3e39fbd3ec9f61d84259ca74ed09a63f0216832230f8da52de20dc384cc1bccd57f48ce4b'
|
7
|
+
data.tar.gz: fd89991c60f9a90397d250483f6a44aabf0f30ac83f20cc10f34d33dac1b082877a628bcd87465805ba742d143e37e608e5a58759b024ce448826efb3d44b622
|
@@ -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
@@ -4,7 +4,6 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
class Event < Struct
|
6
6
|
attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
7
|
-
attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
8
7
|
# Description of the event (creation, publication, etc.).
|
9
8
|
attribute :type, Types::Strict::String.meta(omittable: true)
|
10
9
|
# The preferred display label to use for the event in access systems.
|
@@ -14,6 +13,8 @@ module Cocina
|
|
14
13
|
attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
15
14
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
|
16
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)
|
17
18
|
end
|
18
19
|
end
|
19
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
|
@@ -743,7 +820,6 @@ components:
|
|
743
820
|
additionalProperties: false
|
744
821
|
allOf:
|
745
822
|
- $ref: "#/components/schemas/DescriptiveStructuredValue"
|
746
|
-
- $ref: "#/components/schemas/DescriptiveParallelValue"
|
747
823
|
- type: object
|
748
824
|
additionalProperties: false
|
749
825
|
properties:
|
@@ -778,6 +854,14 @@ components:
|
|
778
854
|
type: array
|
779
855
|
items:
|
780
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"
|
781
865
|
File:
|
782
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.
|
783
867
|
type: object
|
@@ -870,6 +954,9 @@ components:
|
|
870
954
|
type: object
|
871
955
|
additionalProperties: false
|
872
956
|
properties:
|
957
|
+
publish:
|
958
|
+
type: boolean
|
959
|
+
default: false
|
873
960
|
sdrPreserve:
|
874
961
|
type: boolean
|
875
962
|
default: true
|
@@ -877,6 +964,7 @@ components:
|
|
877
964
|
type: boolean
|
878
965
|
default: false
|
879
966
|
required:
|
967
|
+
- publish
|
880
968
|
- sdrPreserve
|
881
969
|
- shelve
|
882
970
|
FileSet:
|
@@ -1416,3 +1504,24 @@ components:
|
|
1416
1504
|
type: string
|
1417
1505
|
source:
|
1418
1506
|
$ref: "#/components/schemas/Source"
|
1507
|
+
Title:
|
1508
|
+
type: object
|
1509
|
+
additionalProperties: false
|
1510
|
+
allOf:
|
1511
|
+
- $ref: "#/components/schemas/DescriptiveValue"
|
1512
|
+
- anyOf:
|
1513
|
+
- type: object
|
1514
|
+
required:
|
1515
|
+
- value
|
1516
|
+
- type: object
|
1517
|
+
required:
|
1518
|
+
- structuredValue
|
1519
|
+
- type: object
|
1520
|
+
required:
|
1521
|
+
- parallelValue
|
1522
|
+
- type: object
|
1523
|
+
required:
|
1524
|
+
- groupedValue
|
1525
|
+
- type: object
|
1526
|
+
required:
|
1527
|
+
- 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.54.0.beta.1
|
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: 2021-
|
11
|
+
date: 2021-03-10 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
|
@@ -311,7 +314,7 @@ files:
|
|
311
314
|
homepage: https://github.com/sul-dlss/cocina-models
|
312
315
|
licenses: []
|
313
316
|
metadata: {}
|
314
|
-
post_install_message:
|
317
|
+
post_install_message:
|
315
318
|
rdoc_options: []
|
316
319
|
require_paths:
|
317
320
|
- lib
|
@@ -322,12 +325,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
322
325
|
version: '2.5'
|
323
326
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
324
327
|
requirements:
|
325
|
-
- - "
|
328
|
+
- - ">"
|
326
329
|
- !ruby/object:Gem::Version
|
327
|
-
version:
|
330
|
+
version: 1.3.1
|
328
331
|
requirements: []
|
329
|
-
rubygems_version: 3.0.
|
330
|
-
signing_key:
|
332
|
+
rubygems_version: 3.0.6
|
333
|
+
signing_key:
|
331
334
|
specification_version: 4
|
332
335
|
summary: Data models for the SDR
|
333
336
|
test_files: []
|