aspace_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/lib/aspace_client.rb +15 -0
  3. data/lib/aspace_client/archivesspace_json_schema.rb +210 -0
  4. data/lib/aspace_client/asutils.rb +142 -0
  5. data/lib/aspace_client/client_enum_source.rb +30 -0
  6. data/lib/aspace_client/exceptions.rb +15 -0
  7. data/lib/aspace_client/helpers.rb +0 -0
  8. data/lib/aspace_client/json_schema_concurrency_fix.rb +52 -0
  9. data/lib/aspace_client/json_schema_utils.rb +414 -0
  10. data/lib/aspace_client/jsonmodel.rb +342 -0
  11. data/lib/aspace_client/jsonmodel_client.rb +528 -0
  12. data/lib/aspace_client/jsonmodel_i18n_mixin.rb +77 -0
  13. data/lib/aspace_client/jsonmodel_type.rb +478 -0
  14. data/lib/aspace_client/memoryleak.rb +59 -0
  15. data/lib/aspace_client/schemas/abstract_agent.rb +51 -0
  16. data/lib/aspace_client/schemas/abstract_agent_relationship.rb +12 -0
  17. data/lib/aspace_client/schemas/abstract_archival_object.rb +96 -0
  18. data/lib/aspace_client/schemas/abstract_classification.rb +44 -0
  19. data/lib/aspace_client/schemas/abstract_name.rb +23 -0
  20. data/lib/aspace_client/schemas/abstract_note.rb +13 -0
  21. data/lib/aspace_client/schemas/accession.rb +174 -0
  22. data/lib/aspace_client/schemas/accession_parts_relationship.rb +31 -0
  23. data/lib/aspace_client/schemas/accession_sibling_relationship.rb +31 -0
  24. data/lib/aspace_client/schemas/active_edits.rb +23 -0
  25. data/lib/aspace_client/schemas/advanced_query.rb +12 -0
  26. data/lib/aspace_client/schemas/agent_contact.rb +25 -0
  27. data/lib/aspace_client/schemas/agent_corporate_entity.rb +32 -0
  28. data/lib/aspace_client/schemas/agent_family.rb +29 -0
  29. data/lib/aspace_client/schemas/agent_person.rb +31 -0
  30. data/lib/aspace_client/schemas/agent_relationship_associative.rb +28 -0
  31. data/lib/aspace_client/schemas/agent_relationship_earlierlater.rb +28 -0
  32. data/lib/aspace_client/schemas/agent_relationship_parentchild.rb +26 -0
  33. data/lib/aspace_client/schemas/agent_relationship_subordinatesuperior.rb +26 -0
  34. data/lib/aspace_client/schemas/agent_software.rb +22 -0
  35. data/lib/aspace_client/schemas/archival_object.rb +60 -0
  36. data/lib/aspace_client/schemas/archival_record_children.rb +15 -0
  37. data/lib/aspace_client/schemas/boolean_field_query.rb +13 -0
  38. data/lib/aspace_client/schemas/boolean_query.rb +13 -0
  39. data/lib/aspace_client/schemas/classification.rb +10 -0
  40. data/lib/aspace_client/schemas/classification_term.rb +38 -0
  41. data/lib/aspace_client/schemas/classification_tree.rb +17 -0
  42. data/lib/aspace_client/schemas/collection_management.rb +27 -0
  43. data/lib/aspace_client/schemas/container.rb +29 -0
  44. data/lib/aspace_client/schemas/container_location.rb +19 -0
  45. data/lib/aspace_client/schemas/date.rb +19 -0
  46. data/lib/aspace_client/schemas/date_field_query.rb +14 -0
  47. data/lib/aspace_client/schemas/deaccession.rb +20 -0
  48. data/lib/aspace_client/schemas/defaults.rb +104 -0
  49. data/lib/aspace_client/schemas/digital_object.rb +64 -0
  50. data/lib/aspace_client/schemas/digital_object_component.rb +53 -0
  51. data/lib/aspace_client/schemas/digital_object_tree.rb +19 -0
  52. data/lib/aspace_client/schemas/digital_record_children.rb +15 -0
  53. data/lib/aspace_client/schemas/enumeration.rb +29 -0
  54. data/lib/aspace_client/schemas/enumeration_migration.rb +14 -0
  55. data/lib/aspace_client/schemas/event.rb +88 -0
  56. data/lib/aspace_client/schemas/extent.rb +17 -0
  57. data/lib/aspace_client/schemas/external_document.rb +12 -0
  58. data/lib/aspace_client/schemas/external_id.rb +11 -0
  59. data/lib/aspace_client/schemas/field_query.rb +15 -0
  60. data/lib/aspace_client/schemas/file_version.rb +26 -0
  61. data/lib/aspace_client/schemas/group.rb +17 -0
  62. data/lib/aspace_client/schemas/instance.rb +27 -0
  63. data/lib/aspace_client/schemas/job.rb +57 -0
  64. data/lib/aspace_client/schemas/location.rb +36 -0
  65. data/lib/aspace_client/schemas/location_batch.rb +45 -0
  66. data/lib/aspace_client/schemas/merge_request.rb +48 -0
  67. data/lib/aspace_client/schemas/name_corporate_entity.rb +15 -0
  68. data/lib/aspace_client/schemas/name_family.rb +13 -0
  69. data/lib/aspace_client/schemas/name_form.rb +15 -0
  70. data/lib/aspace_client/schemas/name_person.rb +19 -0
  71. data/lib/aspace_client/schemas/name_software.rb +14 -0
  72. data/lib/aspace_client/schemas/note_abstract.rb +17 -0
  73. data/lib/aspace_client/schemas/note_bibliography.rb +29 -0
  74. data/lib/aspace_client/schemas/note_bioghist.rb +22 -0
  75. data/lib/aspace_client/schemas/note_chronology.rb +28 -0
  76. data/lib/aspace_client/schemas/note_citation.rb +32 -0
  77. data/lib/aspace_client/schemas/note_definedlist.rb +25 -0
  78. data/lib/aspace_client/schemas/note_digital_object.rb +23 -0
  79. data/lib/aspace_client/schemas/note_index.rb +29 -0
  80. data/lib/aspace_client/schemas/note_index_item.rb +25 -0
  81. data/lib/aspace_client/schemas/note_multipart.rb +25 -0
  82. data/lib/aspace_client/schemas/note_orderedlist.rb +27 -0
  83. data/lib/aspace_client/schemas/note_outline.rb +20 -0
  84. data/lib/aspace_client/schemas/note_outline_level.rb +21 -0
  85. data/lib/aspace_client/schemas/note_singlepart.rb +24 -0
  86. data/lib/aspace_client/schemas/note_text.rb +17 -0
  87. data/lib/aspace_client/schemas/permission.rb +15 -0
  88. data/lib/aspace_client/schemas/preference.rb +16 -0
  89. data/lib/aspace_client/schemas/record_tree.rb +17 -0
  90. data/lib/aspace_client/schemas/repository.rb +32 -0
  91. data/lib/aspace_client/schemas/repository_with_agent.rb +14 -0
  92. data/lib/aspace_client/schemas/resource.rb +112 -0
  93. data/lib/aspace_client/schemas/resource_tree.rb +20 -0
  94. data/lib/aspace_client/schemas/rights_statement.rb +35 -0
  95. data/lib/aspace_client/schemas/subject.rb +30 -0
  96. data/lib/aspace_client/schemas/term.rb +16 -0
  97. data/lib/aspace_client/schemas/user.rb +56 -0
  98. data/lib/aspace_client/schemas/user_defined.rb +42 -0
  99. data/lib/aspace_client/schemas/vocabulary.rb +15 -0
  100. data/lib/aspace_client/validations.rb +434 -0
  101. data/lib/aspace_client/validator_cache.rb +47 -0
  102. data/lib/aspace_client/version.rb +3 -0
  103. metadata +244 -0
@@ -0,0 +1,31 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "subtype" => "ref",
7
+ "properties" => {
8
+ "relator" => {
9
+ "type" => "string",
10
+ "dynamic_enum" => "accession_parts_relator",
11
+ "ifmissing" => "error"
12
+ },
13
+
14
+ "relator_type" => {
15
+ "type" => "string",
16
+ "dynamic_enum" => "accession_parts_relator_type",
17
+ "ifmissing" => "error"
18
+ },
19
+
20
+ "ref" => {
21
+ "type" => "JSONModel(:accession) uri",
22
+ "ifmissing" => "error"
23
+ },
24
+
25
+ "_resolved" => {
26
+ "type" => "object",
27
+ "readonly" => "true"
28
+ }
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "subtype" => "ref",
7
+ "properties" => {
8
+ "relator" => {
9
+ "type" => "string",
10
+ "dynamic_enum" => "accession_sibling_relator",
11
+ "ifmissing" => "error"
12
+ },
13
+
14
+ "relator_type" => {
15
+ "type" => "string",
16
+ "dynamic_enum" => "accession_sibling_relator_type",
17
+ "ifmissing" => "error"
18
+ },
19
+
20
+ "ref" => {
21
+ "type" => "JSONModel(:accession) uri",
22
+ "ifmissing" => "error"
23
+ },
24
+
25
+ "_resolved" => {
26
+ "type" => "object",
27
+ "readonly" => "true"
28
+ }
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "uri" => "/update_monitor",
6
+ "type" => "object",
7
+ "properties" => {
8
+ "uri" => {"type" => "string", "required" => false},
9
+
10
+ "active_edits" => {
11
+ "type" => "array",
12
+ "items" => {
13
+ "type" => "object",
14
+ "properties" => {
15
+ "user" => {"type" => "string", "maxLength" => 255, "ifmissing" => "error"},
16
+ "uri" => {"type" => "string", "maxLength" => 255, "ifmissing" => "error"},
17
+ "time" => {"type" => "string", "maxLength" => 255, "ifmissing" => "error"},
18
+ }
19
+ }
20
+ }
21
+ },
22
+ },
23
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "properties" => {
7
+
8
+ "query" => {"type" => ["JSONModel(:boolean_query) object", "JSONModel(:field_query) object", "JSONModel(:date_field_query) object", "JSONModel(:boolean_field_query) object"]},
9
+
10
+ },
11
+ },
12
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+
7
+ "properties" => {
8
+ "name" => {"type" => "string", "maxLength" => 65000, "ifmissing" => "error"},
9
+ "salutation" => {"type" => "string", "dynamic_enum" => "agent_contact_salutation"},
10
+ "address_1" => {"type" => "string", "maxLength" => 65000},
11
+ "address_2" => {"type" => "string", "maxLength" => 65000},
12
+ "address_3" => {"type" => "string", "maxLength" => 65000},
13
+ "city" => {"type" => "string", "maxLength" => 65000},
14
+ "region" => {"type" => "string", "maxLength" => 65000},
15
+ "country" => {"type" => "string", "maxLength" => 65000},
16
+ "post_code" => {"type" => "string", "maxLength" => 65000},
17
+ "telephone" => {"type" => "string", "maxLength" => 65000},
18
+ "telephone_ext" => {"type" => "string", "maxLength" => 65000},
19
+ "fax" => {"type" => "string", "maxLength" => 65000},
20
+ "email" => {"type" => "string", "maxLength" => 65000},
21
+ "email_signature" => {"type" => "string", "maxLength" => 65000},
22
+ "note" => {"type" => "string", "maxLength" => 65000},
23
+ },
24
+ },
25
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent",
7
+ "uri" => "/agents/corporate_entities",
8
+ "properties" => {
9
+ "names" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "JSONModel(:name_corporate_entity) object"},
12
+ "ifmissing" => "error",
13
+ "minItems" => 1
14
+ },
15
+
16
+ "display_name" => {
17
+ "type" => "JSONModel(:name_corporate_entity) object",
18
+ "readonly" => true
19
+ },
20
+
21
+ "related_agents" => {
22
+ "type" => "array",
23
+ "items" => {
24
+ "type" => [{"type" => "JSONModel(:agent_relationship_subordinatesuperior) object"},
25
+ {"type" => "JSONModel(:agent_relationship_earlierlater) object"},
26
+ {"type" => "JSONModel(:agent_relationship_associative) object"}],
27
+ }
28
+ }
29
+ },
30
+
31
+ },
32
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent",
7
+ "uri" => "/agents/families",
8
+ "properties" => {
9
+ "names" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "JSONModel(:name_family) object"},
12
+ "ifmissing" => "error",
13
+ "minItems" => 1
14
+ },
15
+
16
+ "display_name" => {
17
+ "type" => "JSONModel(:name_family) object",
18
+ "readonly" => true
19
+ },
20
+
21
+ "related_agents" => {
22
+ "type" => "array",
23
+ "items" => {"type" => [{"type" => "JSONModel(:agent_relationship_earlierlater) object"},
24
+ {"type" => "JSONModel(:agent_relationship_associative) object"}]},
25
+ }
26
+
27
+ },
28
+ },
29
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent",
7
+ "uri" => "/agents/people",
8
+ "properties" => {
9
+ "names" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "JSONModel(:name_person) object"},
12
+ "ifmissing" => "error",
13
+ "minItems" => 1
14
+ },
15
+
16
+ "display_name" => {
17
+ "type" => "JSONModel(:name_person) object",
18
+ "readonly" => true
19
+ },
20
+
21
+ "related_agents" => {
22
+ "type" => "array",
23
+ "items" => {
24
+ "type" => [{"type" => "JSONModel(:agent_relationship_parentchild) object"},
25
+ {"type" => "JSONModel(:agent_relationship_earlierlater) object"},
26
+ {"type" => "JSONModel(:agent_relationship_associative) object"}],
27
+ }
28
+ },
29
+ },
30
+ },
31
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "subtype" => "ref",
7
+ "parent" => "abstract_agent_relationship",
8
+ "properties" => {
9
+ "relator" => {
10
+ "type" => "string",
11
+ "dynamic_enum" => "agent_relationship_associative_relator",
12
+ "ifmissing" => "error"
13
+ },
14
+
15
+ "ref" => {
16
+ "type" => [{"type" => "JSONModel(:agent_person) uri"},
17
+ {"type" => "JSONModel(:agent_family) uri"},
18
+ {"type" => "JSONModel(:agent_corporate_entity) uri"}],
19
+ "ifmissing" => "error"
20
+ },
21
+
22
+ "_resolved" => {
23
+ "type" => "object",
24
+ "readonly" => "true"
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent_relationship",
7
+ "subtype" => "ref",
8
+ "properties" => {
9
+ "relator" => {
10
+ "type" => "string",
11
+ "dynamic_enum" => "agent_relationship_earlierlater_relator",
12
+ "ifmissing" => "error"
13
+ },
14
+
15
+ "ref" => {
16
+ "type" => [{"type" => "JSONModel(:agent_person) uri"},
17
+ {"type" => "JSONModel(:agent_corporate_entity) uri"},
18
+ {"type" => "JSONModel(:agent_family) uri"}],
19
+ "ifmissing" => "error"
20
+ },
21
+
22
+ "_resolved" => {
23
+ "type" => "object",
24
+ "readonly" => "true"
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent_relationship",
7
+ "subtype" => "ref",
8
+ "properties" => {
9
+ "relator" => {
10
+ "type" => "string",
11
+ "dynamic_enum" => "agent_relationship_parentchild_relator",
12
+ "ifmissing" => "error"
13
+ },
14
+
15
+ "ref" => {
16
+ "type" => [{"type" => "JSONModel(:agent_person) uri"}],
17
+ "ifmissing" => "error"
18
+ },
19
+
20
+ "_resolved" => {
21
+ "type" => "object",
22
+ "readonly" => "true"
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent_relationship",
7
+ "subtype" => "ref",
8
+ "properties" => {
9
+ "relator" => {
10
+ "type" => "string",
11
+ "dynamic_enum" => "agent_relationship_subordinatesuperior_relator",
12
+ "ifmissing" => "error"
13
+ },
14
+
15
+ "ref" => {
16
+ "type" => [{"type" => "JSONModel(:agent_corporate_entity) uri"}],
17
+ "ifmissing" => "error"
18
+ },
19
+
20
+ "_resolved" => {
21
+ "type" => "object",
22
+ "readonly" => "true"
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_agent",
7
+ "uri" => "/agents/software",
8
+ "properties" => {
9
+ "display_name" => {
10
+ "type" => "JSONModel(:name_software) object",
11
+ "readonly" => true
12
+ },
13
+
14
+ "names" => {
15
+ "type" => "array",
16
+ "items" => {"type" => "JSONModel(:name_software) object"},
17
+ "ifmissing" => "error",
18
+ "minItems" => 1
19
+ },
20
+ },
21
+ },
22
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_archival_object",
7
+ "uri" => "/repositories/:repo_id/archival_objects",
8
+ "properties" => {
9
+ "ref_id" => {"type" => "string", "maxLength" => 255, "pattern" => "\\A[a-zA-Z0-9\\-_:\\.]*\\z"},
10
+ "component_id" => {"type" => "string", "maxLength" => 255, "required" => false, "default" => ""},
11
+
12
+ "level" => {"type" => "string", "ifmissing" => "error", "dynamic_enum" => "archival_record_level"},
13
+ "other_level" => {"type" => "string", "maxLength" => 255},
14
+
15
+ "title" => {"type" => "string", "maxLength" => 8192, "ifmissing" => nil},
16
+ "display_string" => {"type" => "string", "maxLength" => 8192, "readonly" => true},
17
+
18
+ "restrictions_apply" => {"type" => "boolean", "default" => false},
19
+ "repository_processing_note" => {"type" => "string", "maxLength" => 65000},
20
+
21
+ "parent" => {
22
+ "type" => "object",
23
+ "subtype" => "ref",
24
+ "properties" => {
25
+ "ref" => {"type" => "JSONModel(:archival_object) uri"},
26
+ "_resolved" => {
27
+ "type" => "object",
28
+ "readonly" => "true"
29
+ }
30
+ }
31
+ },
32
+
33
+ "resource" => {
34
+ "type" => "object",
35
+ "subtype" => "ref",
36
+ "properties" => {
37
+ "ref" => {"type" => "JSONModel(:resource) uri"},
38
+ "_resolved" => {
39
+ "type" => "object",
40
+ "readonly" => "true"
41
+ }
42
+ }
43
+ },
44
+
45
+ "position" => {"type" => "integer", "required" => false},
46
+
47
+ "instances" => {"type" => "array", "items" => {"type" => "JSONModel(:instance) object"}},
48
+
49
+ "notes" => {
50
+ "type" => "array",
51
+ "items" => {"type" => [{"type" => "JSONModel(:note_bibliography) object"},
52
+ {"type" => "JSONModel(:note_index) object"},
53
+ {"type" => "JSONModel(:note_multipart) object"},
54
+ {"type" => "JSONModel(:note_singlepart) object"}]},
55
+ },
56
+
57
+ "has_unpublished_ancestor" => {"type" => "boolean", "readonly" => "true"},
58
+ },
59
+ },
60
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "properties" => {
7
+
8
+ "children" => {
9
+ "type" => "array",
10
+ "items" => {"type" => "JSONModel(:archival_object) object"}
11
+ },
12
+
13
+ },
14
+ },
15
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "properties" => {
7
+
8
+ "field" => {"type" => "string", "ifmissing" => "error"},
9
+ "value" => {"type" => "boolean", "ifmissing" => "error", "default" => true},
10
+
11
+ },
12
+ },
13
+ }