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,15 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "parent" => "abstract_name",
6
+ "type" => "object",
7
+
8
+ "properties" => {
9
+ "primary_name" => {"type" => "string", "maxLength" => 65000, "ifmissing" => "error"},
10
+ "subordinate_name_1" => {"type" => "string", "maxLength" => 65000},
11
+ "subordinate_name_2" => {"type" => "string", "maxLength" => 65000},
12
+ "number" => {"type" => "string", "maxLength" => 255},
13
+ },
14
+ },
15
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "parent" => "abstract_name",
6
+ "type" => "object",
7
+
8
+ "properties" => {
9
+ "family_name" => {"type" => "string", "maxLength" => 65000, "ifmissing" => "error"},
10
+ "prefix" => {"type" => "string", "maxLength" => 65000},
11
+ },
12
+ },
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "uri" => "/agents/:agent_id/name_forms",
7
+ "properties" => {
8
+ "uri" => {"type" => "string", "required" => false},
9
+
10
+ "kind" => {"type" => "string", "ifmissing" => "error"},
11
+
12
+ "sort_name" => {"type" => "string", "ifmissing" => "error"}
13
+ },
14
+ },
15
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "parent" => "abstract_name",
6
+ "type" => "object",
7
+
8
+ "properties" => {
9
+ "primary_name" => {"type" => "string", "maxLength" => 255, "ifmissing" => "error"},
10
+ "title" => {"type" => "string", "maxLength" => 16384},
11
+ "name_order" => {"type" => "string", "ifmissing" => "error", "dynamic_enum" => "name_person_name_order"},
12
+ "prefix" => {"type" => "string", "maxLength" => 65000},
13
+ "rest_of_name" => {"type" => "string", "maxLength" => 65000},
14
+ "suffix" => {"type" => "string", "maxLength" => 65000},
15
+ "fuller_form" => {"type" => "string", "maxLength" => 65000},
16
+ "number" => {"type" => "string", "maxLength" => 255},
17
+ },
18
+ },
19
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "parent" => "abstract_name",
6
+ "type" => "object",
7
+
8
+ "properties" => {
9
+ "software_name" => {"type" => "string", "maxLength" => 65000, "ifmissing" => "error"},
10
+ "version" => {"type" => "string", "maxLength" => 65000},
11
+ "manufacturer" => {"type" => "string", "maxLength" => 65000},
12
+ },
13
+ },
14
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+ "content" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "string", "maxLength" => 65000},
12
+ "minItems" => 1,
13
+ "ifmissing" => "error",
14
+ },
15
+ },
16
+ },
17
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+
10
+ "content" => {
11
+ "type" => "array",
12
+ "items" => {"type" => "string", "maxLength" => 65000},
13
+ "minItems" => 0,
14
+ "ifmissing" => nil,
15
+ },
16
+
17
+ "type" => {
18
+ "type" => "string",
19
+ "readonly" => true,
20
+ "dynamic_enum" => "note_bibliography_type"
21
+ },
22
+
23
+ "items" => {
24
+ "type" => "array",
25
+ "items" => {"type" => "string", "maxLength" => 65000}
26
+ },
27
+ },
28
+ },
29
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+
10
+ "subnotes" => {
11
+ "type" => "array",
12
+ "items" => {"type" => [{"type" => "JSONModel(:note_abstract) object"},
13
+ {"type" => "JSONModel(:note_chronology) object"},
14
+ {"type" => "JSONModel(:note_citation) object"},
15
+ {"type" => "JSONModel(:note_orderedlist) object"},
16
+ {"type" => "JSONModel(:note_definedlist) object"},
17
+ {"type" => "JSONModel(:note_text) object"},
18
+ {"type" => "JSONModel(:note_outline) object"}]},
19
+ },
20
+ },
21
+ },
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+
7
+ "properties" => {
8
+
9
+ "title" => {"type" => "string", "maxLength" => 16384},
10
+
11
+ "publish" => {"type" => "boolean"},
12
+
13
+ "items" => {
14
+ "type" => "array",
15
+ "items" => {
16
+ "type" => "object",
17
+ "properties" => {
18
+ "event_date" => {"type" => "string", "maxLength" => 255},
19
+ "events" => {
20
+ "type" => "array",
21
+ "items" => {"type" => "string", "maxLength" => 65000}
22
+ }
23
+ }
24
+ }
25
+ }
26
+ },
27
+ },
28
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+
10
+ "content" => {
11
+ "type" => "array",
12
+ "items" => {"type" => "string", "maxLength" => 65000},
13
+ "minItems" => 1,
14
+ "ifmissing" => "error",
15
+ },
16
+
17
+ "xlink" => {
18
+ "type" => "object",
19
+ "properties" => {
20
+ "actuate" => {"type" => "string", "maxLength" => 65000},
21
+ "arcrole" => {"type" => "string", "maxLength" => 65000},
22
+ "href" => {"type" => "string", "maxLength" => 65000},
23
+ "role" => {"type" => "string", "maxLength" => 65000},
24
+ "show" => {"type" => "string", "maxLength" => 65000},
25
+ "title" => {"type" => "string", "maxLength" => 16384},
26
+ "type" => {"type" => "string", "maxLength" => 65000},
27
+ }
28
+ }
29
+
30
+ },
31
+ },
32
+ }
@@ -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
+
9
+ "title" => {"type" => "string", "maxLength" => 16384},
10
+
11
+ "publish" => {"type" => "boolean"},
12
+
13
+ "items" => {
14
+ "type" => "array",
15
+ "items" => {
16
+ "type" => "object",
17
+ "properties" => {
18
+ "label" => {"type" => "string", "ifmissing" => "error", "maxLength" => 65000},
19
+ "value" => {"type" => "string", "ifmissing" => "error", "maxLength" => 65000}
20
+ }
21
+ }
22
+ }
23
+ },
24
+ },
25
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+ "content" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "string", "maxLength" => 65000},
12
+ "minItems" => 1,
13
+ "ifmissing" => "error",
14
+ },
15
+
16
+ "type" => {
17
+ "type" => "string",
18
+ "ifmissing" => "error",
19
+ "dynamic_enum" => "note_digital_object_type"
20
+ },
21
+ },
22
+ },
23
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+
10
+ "content" => {
11
+ "type" => "array",
12
+ "items" => {"type" => "string", "maxLength" => 65000},
13
+ "minItems" => 0,
14
+ "ifmissing" => nil,
15
+ },
16
+
17
+ "type" => {
18
+ "type" => "string",
19
+ "readonly" => true,
20
+ "dynamic_enum" => "note_index_type"
21
+ },
22
+
23
+ "items" => {
24
+ "type" => "array",
25
+ "items" => {"type" => [{"type" => "JSONModel(:note_index_item) object"}]}
26
+ }
27
+ },
28
+ },
29
+ }
@@ -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
+ "value" => {"type" => "string", "ifmissing" => "error", "maxLength" => 65000},
9
+ "type" => {"type" => "string", "ifmissing" => "error", "dynamic_enum" => "note_index_item_type"},
10
+ "reference" => {"type" => "string", "maxLength" => 65000},
11
+ "reference_text" => {"type" => "string", "maxLength" => 65000},
12
+ "reference_ref" => {
13
+ "type" => "object",
14
+ "subtype" => "ref",
15
+ "properties" => {
16
+ "ref" => {"type" => "string", "readonly" => true},
17
+ "_resolved" => {
18
+ "type" => "object",
19
+ "readonly" => "true"
20
+ }
21
+ }
22
+ }
23
+ },
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+
10
+ "type" => {
11
+ "type" => "string",
12
+ "ifmissing" => "error",
13
+ "dynamic_enum" => "note_multipart_type"
14
+ },
15
+
16
+ "subnotes" => {
17
+ "type" => "array",
18
+ "items" => {"type" => [{"type" => "JSONModel(:note_chronology) object"},
19
+ {"type" => "JSONModel(:note_orderedlist) object"},
20
+ {"type" => "JSONModel(:note_definedlist) object"},
21
+ {"type" => "JSONModel(:note_text) object"}]},
22
+ },
23
+ },
24
+ },
25
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+
7
+ "properties" => {
8
+
9
+ "title" => {"type" => "string", "maxLength" => 16384},
10
+
11
+ "publish" => {"type" => "boolean"},
12
+
13
+ "enumeration" => {
14
+ "type" => "string",
15
+ "dynamic_enum" => "note_orderedlist_enumeration"
16
+ },
17
+
18
+ "items" => {
19
+ "type" => "array",
20
+ "items" => {
21
+ "type" => "string",
22
+ "maxLength" => 65000
23
+ }
24
+ }
25
+ },
26
+ },
27
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+
7
+ "properties" => {
8
+
9
+ "publish" => {"type" => "boolean"},
10
+
11
+ "levels" => {
12
+ "type" => "array",
13
+ "items" => {
14
+ "type" => "JSONModel(:note_outline_level) object",
15
+ }
16
+ },
17
+
18
+ },
19
+ },
20
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+
7
+ "properties" => {
8
+
9
+ "items" => {
10
+ "type" => "array",
11
+ "items" => {
12
+ "type" => [
13
+ {"type" => "string"}, #SONModel(:note_outline_string) object",
14
+ {"type" => "JSONModel(:note_outline_level) object"}
15
+ ]
16
+ }
17
+ },
18
+
19
+ },
20
+ },
21
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ :schema => {
3
+ "$schema" => "http://www.archivesspace.org/archivesspace.json",
4
+ "version" => 1,
5
+ "type" => "object",
6
+ "parent" => "abstract_note",
7
+
8
+ "properties" => {
9
+ "content" => {
10
+ "type" => "array",
11
+ "items" => {"type" => "string", "maxLength" => 65000},
12
+ "minItems" => 1,
13
+ "ifmissing" => "error",
14
+ },
15
+
16
+ "type" => {
17
+ "type" => "string",
18
+ "ifmissing" => "error",
19
+ "dynamic_enum" => "note_singlepart_type"
20
+
21
+ },
22
+ },
23
+ },
24
+ }