oarepo-runtime 1.10.3__py3-none-any.whl → 2.0.0.dev4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. oarepo_runtime/__init__.py +24 -0
  2. oarepo_runtime/api.py +210 -0
  3. oarepo_runtime/cli/__init__.py +10 -21
  4. oarepo_runtime/cli/search.py +34 -0
  5. oarepo_runtime/config.py +98 -13
  6. oarepo_runtime/ext.py +64 -82
  7. oarepo_runtime/proxies.py +21 -5
  8. oarepo_runtime/records/__init__.py +11 -50
  9. oarepo_runtime/records/drafts.py +24 -18
  10. oarepo_runtime/records/mapping.py +84 -0
  11. oarepo_runtime/records/pid_providers.py +43 -7
  12. oarepo_runtime/records/systemfields/__init__.py +15 -33
  13. oarepo_runtime/records/systemfields/mapping.py +41 -24
  14. oarepo_runtime/records/systemfields/publication_status.py +61 -0
  15. oarepo_runtime/services/__init__.py +12 -0
  16. oarepo_runtime/services/config/__init__.py +15 -21
  17. oarepo_runtime/services/config/link_conditions.py +69 -75
  18. oarepo_runtime/services/config/permissions.py +62 -0
  19. oarepo_runtime/services/facets/__init__.py +12 -33
  20. oarepo_runtime/services/facets/params.py +45 -110
  21. oarepo_runtime/services/records/__init__.py +14 -1
  22. oarepo_runtime/services/records/links.py +21 -11
  23. oarepo_runtime/services/records/mapping.py +42 -0
  24. oarepo_runtime/services/results.py +98 -109
  25. oarepo_runtime/services/schema/__init__.py +12 -44
  26. oarepo_runtime/services/schema/i18n.py +47 -22
  27. oarepo_runtime/services/schema/i18n_ui.py +61 -24
  28. {oarepo_runtime-1.10.3.dist-info → oarepo_runtime-2.0.0.dev4.dist-info}/METADATA +10 -21
  29. oarepo_runtime-2.0.0.dev4.dist-info/RECORD +32 -0
  30. {oarepo_runtime-1.10.3.dist-info → oarepo_runtime-2.0.0.dev4.dist-info}/WHEEL +1 -2
  31. oarepo_runtime-2.0.0.dev4.dist-info/entry_points.txt +5 -0
  32. oarepo_runtime/cli/assets.py +0 -145
  33. oarepo_runtime/cli/base.py +0 -25
  34. oarepo_runtime/cli/cf.py +0 -15
  35. oarepo_runtime/cli/check.py +0 -167
  36. oarepo_runtime/cli/configuration.py +0 -51
  37. oarepo_runtime/cli/fixtures.py +0 -167
  38. oarepo_runtime/cli/index.py +0 -272
  39. oarepo_runtime/cli/permissions/__init__.py +0 -6
  40. oarepo_runtime/cli/permissions/base.py +0 -26
  41. oarepo_runtime/cli/permissions/evaluate.py +0 -63
  42. oarepo_runtime/cli/permissions/list.py +0 -239
  43. oarepo_runtime/cli/permissions/search.py +0 -121
  44. oarepo_runtime/cli/validate.py +0 -150
  45. oarepo_runtime/datastreams/__init__.py +0 -38
  46. oarepo_runtime/datastreams/asynchronous.py +0 -247
  47. oarepo_runtime/datastreams/catalogue.py +0 -150
  48. oarepo_runtime/datastreams/datastreams.py +0 -152
  49. oarepo_runtime/datastreams/errors.py +0 -54
  50. oarepo_runtime/datastreams/ext.py +0 -41
  51. oarepo_runtime/datastreams/fixtures.py +0 -265
  52. oarepo_runtime/datastreams/json.py +0 -4
  53. oarepo_runtime/datastreams/readers/__init__.py +0 -39
  54. oarepo_runtime/datastreams/readers/attachments.py +0 -51
  55. oarepo_runtime/datastreams/readers/excel.py +0 -123
  56. oarepo_runtime/datastreams/readers/json.py +0 -27
  57. oarepo_runtime/datastreams/readers/service.py +0 -54
  58. oarepo_runtime/datastreams/readers/yaml.py +0 -14
  59. oarepo_runtime/datastreams/semi_asynchronous.py +0 -91
  60. oarepo_runtime/datastreams/synchronous.py +0 -70
  61. oarepo_runtime/datastreams/transformers.py +0 -18
  62. oarepo_runtime/datastreams/types.py +0 -323
  63. oarepo_runtime/datastreams/utils.py +0 -131
  64. oarepo_runtime/datastreams/writers/__init__.py +0 -21
  65. oarepo_runtime/datastreams/writers/attachments_file.py +0 -92
  66. oarepo_runtime/datastreams/writers/attachments_service.py +0 -118
  67. oarepo_runtime/datastreams/writers/publish.py +0 -70
  68. oarepo_runtime/datastreams/writers/service.py +0 -175
  69. oarepo_runtime/datastreams/writers/utils.py +0 -30
  70. oarepo_runtime/datastreams/writers/validation_errors.py +0 -20
  71. oarepo_runtime/datastreams/writers/yaml.py +0 -56
  72. oarepo_runtime/ext_config.py +0 -67
  73. oarepo_runtime/i18n/__init__.py +0 -3
  74. oarepo_runtime/info/__init__.py +0 -0
  75. oarepo_runtime/info/check.py +0 -95
  76. oarepo_runtime/info/permissions/__init__.py +0 -0
  77. oarepo_runtime/info/permissions/debug.py +0 -191
  78. oarepo_runtime/info/views.py +0 -586
  79. oarepo_runtime/profile.py +0 -60
  80. oarepo_runtime/records/dumpers/__init__.py +0 -8
  81. oarepo_runtime/records/dumpers/edtf_interval.py +0 -38
  82. oarepo_runtime/records/dumpers/multilingual_dumper.py +0 -34
  83. oarepo_runtime/records/entity_resolvers/__init__.py +0 -13
  84. oarepo_runtime/records/entity_resolvers/proxies.py +0 -57
  85. oarepo_runtime/records/mappings/__init__.py +0 -0
  86. oarepo_runtime/records/mappings/rdm_parent_mapping.json +0 -483
  87. oarepo_runtime/records/owners/__init__.py +0 -3
  88. oarepo_runtime/records/owners/registry.py +0 -22
  89. oarepo_runtime/records/relations/__init__.py +0 -22
  90. oarepo_runtime/records/relations/base.py +0 -296
  91. oarepo_runtime/records/relations/internal.py +0 -46
  92. oarepo_runtime/records/relations/lookup.py +0 -28
  93. oarepo_runtime/records/relations/pid_relation.py +0 -102
  94. oarepo_runtime/records/systemfields/featured_file.py +0 -45
  95. oarepo_runtime/records/systemfields/has_draftcheck.py +0 -47
  96. oarepo_runtime/records/systemfields/icu.py +0 -371
  97. oarepo_runtime/records/systemfields/owner.py +0 -115
  98. oarepo_runtime/records/systemfields/record_status.py +0 -35
  99. oarepo_runtime/records/systemfields/selectors.py +0 -98
  100. oarepo_runtime/records/systemfields/synthetic.py +0 -130
  101. oarepo_runtime/resources/__init__.py +0 -4
  102. oarepo_runtime/resources/config.py +0 -12
  103. oarepo_runtime/resources/file_resource.py +0 -15
  104. oarepo_runtime/resources/json_serializer.py +0 -27
  105. oarepo_runtime/resources/localized_ui_json_serializer.py +0 -54
  106. oarepo_runtime/resources/resource.py +0 -53
  107. oarepo_runtime/resources/responses.py +0 -20
  108. oarepo_runtime/services/components.py +0 -429
  109. oarepo_runtime/services/config/draft_link.py +0 -23
  110. oarepo_runtime/services/config/permissions_presets.py +0 -174
  111. oarepo_runtime/services/config/service.py +0 -117
  112. oarepo_runtime/services/custom_fields/__init__.py +0 -80
  113. oarepo_runtime/services/custom_fields/mappings.py +0 -188
  114. oarepo_runtime/services/entity/__init__.py +0 -0
  115. oarepo_runtime/services/entity/config.py +0 -14
  116. oarepo_runtime/services/entity/schema.py +0 -9
  117. oarepo_runtime/services/entity/service.py +0 -48
  118. oarepo_runtime/services/expansions/__init__.py +0 -0
  119. oarepo_runtime/services/expansions/expandable_fields.py +0 -21
  120. oarepo_runtime/services/expansions/service.py +0 -4
  121. oarepo_runtime/services/facets/base.py +0 -12
  122. oarepo_runtime/services/facets/date.py +0 -72
  123. oarepo_runtime/services/facets/enum.py +0 -11
  124. oarepo_runtime/services/facets/facet_groups_names.py +0 -17
  125. oarepo_runtime/services/facets/max_facet.py +0 -13
  126. oarepo_runtime/services/facets/multilingual_facet.py +0 -33
  127. oarepo_runtime/services/facets/nested_facet.py +0 -32
  128. oarepo_runtime/services/facets/year_histogram.py +0 -200
  129. oarepo_runtime/services/files/__init__.py +0 -8
  130. oarepo_runtime/services/files/components.py +0 -62
  131. oarepo_runtime/services/files/service.py +0 -16
  132. oarepo_runtime/services/generators.py +0 -10
  133. oarepo_runtime/services/permissions/__init__.py +0 -3
  134. oarepo_runtime/services/permissions/generators.py +0 -103
  135. oarepo_runtime/services/relations/__init__.py +0 -0
  136. oarepo_runtime/services/relations/components.py +0 -15
  137. oarepo_runtime/services/relations/errors.py +0 -18
  138. oarepo_runtime/services/relations/mapping.py +0 -38
  139. oarepo_runtime/services/schema/cf.py +0 -13
  140. oarepo_runtime/services/schema/i18n_validation.py +0 -7
  141. oarepo_runtime/services/schema/marshmallow.py +0 -44
  142. oarepo_runtime/services/schema/marshmallow_to_json_schema.py +0 -72
  143. oarepo_runtime/services/schema/oneofschema.py +0 -192
  144. oarepo_runtime/services/schema/polymorphic.py +0 -21
  145. oarepo_runtime/services/schema/rdm.py +0 -146
  146. oarepo_runtime/services/schema/rdm_ui.py +0 -156
  147. oarepo_runtime/services/schema/ui.py +0 -251
  148. oarepo_runtime/services/schema/validation.py +0 -70
  149. oarepo_runtime/services/search.py +0 -282
  150. oarepo_runtime/services/service.py +0 -61
  151. oarepo_runtime/tasks.py +0 -6
  152. oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo +0 -0
  153. oarepo_runtime/translations/cs/LC_MESSAGES/messages.po +0 -95
  154. oarepo_runtime/translations/default_translations.py +0 -6
  155. oarepo_runtime/translations/en/LC_MESSAGES/messages.mo +0 -0
  156. oarepo_runtime/translations/en/LC_MESSAGES/messages.po +0 -97
  157. oarepo_runtime/translations/messages.pot +0 -100
  158. oarepo_runtime/uow.py +0 -146
  159. oarepo_runtime/utils/__init__.py +0 -0
  160. oarepo_runtime/utils/functools.py +0 -37
  161. oarepo_runtime/utils/identity_utils.py +0 -35
  162. oarepo_runtime/utils/index.py +0 -11
  163. oarepo_runtime/utils/path.py +0 -97
  164. oarepo_runtime-1.10.3.dist-info/RECORD +0 -163
  165. oarepo_runtime-1.10.3.dist-info/entry_points.txt +0 -16
  166. oarepo_runtime-1.10.3.dist-info/top_level.txt +0 -2
  167. tests/marshmallow_to_json/__init__.py +0 -0
  168. tests/marshmallow_to_json/test_datacite_ui_schema.py +0 -1410
  169. tests/marshmallow_to_json/test_simple_schema.py +0 -52
  170. tests/pkg_data/__init__.py +0 -0
  171. {oarepo_runtime-1.10.3.dist-info → oarepo_runtime-2.0.0.dev4.dist-info}/licenses/LICENSE +0 -0
@@ -1,34 +0,0 @@
1
- from invenio_records.dumpers import SearchDumperExt
2
- from sqlalchemy.util import classproperty
3
-
4
- from oarepo_runtime.utils.path import PathTraversal
5
-
6
-
7
- class MultilingualDumper(SearchDumperExt):
8
- paths = []
9
- SUPPORTED_LANGS = []
10
- _path_traversal = None
11
-
12
- @classproperty
13
- def path_traversal(cls):
14
- if cls._path_traversal is None:
15
- cls._path_traversal = PathTraversal(cls.paths)
16
- return cls._path_traversal
17
-
18
- def dump(self, record, data):
19
- for path in self.path_traversal.iter(data):
20
- rec = path[-1].current
21
- lang = rec.get("lang", None)
22
- if lang and lang in self.SUPPORTED_LANGS:
23
- el_name = path[-1].key + "_" + lang
24
- path[-1].parent_data.setdefault(el_name, []).append(rec["value"])
25
- return data
26
-
27
- def load(self, data, record_cls):
28
- for path in self.path_traversal.iter(data):
29
- rec = path[-1].current
30
- lang = rec.get("lang", None)
31
- if lang and lang in self.SUPPORTED_LANGS:
32
- el_name = path[-1].key + "_" + lang
33
- path[-1].parent_data.pop(el_name, None)
34
- return data
@@ -1,13 +0,0 @@
1
- from invenio_records_resources.references import EntityResolver, RecordResolver
2
- from invenio_users_resources.entity_resolvers import GroupResolver, UserResolver
3
-
4
- from oarepo_runtime.records.entity_resolvers.proxies import DraftProxy, RecordProxy
5
-
6
- __all__ = [
7
- "DraftProxy",
8
- "UserResolver",
9
- "GroupResolver",
10
- "RecordResolver",
11
- "EntityResolver",
12
- "RecordProxy",
13
- ]
@@ -1,57 +0,0 @@
1
- from invenio_pidstore.errors import PIDUnregistered, PIDDoesNotExistError
2
- from invenio_records_resources.references.entity_resolvers.records import (
3
- RecordProxy as InvenioRecordProxy,
4
- )
5
- from sqlalchemy.exc import NoResultFound
6
- from invenio_access.permissions import system_identity
7
- from invenio_records_resources.references.entity_resolvers.results import ServiceResultProxy as InvenioServiceResultProxy
8
-
9
-
10
- def set_field(result, resolved_dict, field_name):
11
- from_metadata = resolved_dict.get("metadata", {}).get(field_name)
12
- from_data = resolved_dict.get(field_name)
13
-
14
- if from_metadata:
15
- result.setdefault("metadata", {})[field_name] = from_metadata
16
- if from_data:
17
- result[field_name] = from_data
18
-
19
-
20
- class RecordProxy(InvenioRecordProxy):
21
- picked_fields = ["title", "creators", "contributors"]
22
-
23
- def pick_resolved_fields(self, identity, resolved_dict):
24
- """Select which fields to return when resolving the reference."""
25
- resolved_fields = super().pick_resolved_fields(identity, resolved_dict)
26
-
27
- for fld in self.picked_fields:
28
- set_field(resolved_fields, resolved_dict, fld)
29
-
30
- return resolved_fields
31
-
32
- def ghost_record(self, value):
33
- return {
34
- **value,
35
- "metadata": {
36
- "title": "Deleted record",
37
- },
38
- }
39
-
40
- class WithDeletedServiceResultProxy(InvenioServiceResultProxy):
41
- """Resolver proxy for a result item entity."""
42
-
43
- def _resolve(self):
44
- """Resolve the result item from the proxy's reference dict."""
45
- id_ = self._parse_ref_dict_id()
46
- # TODO: Make identity customizable
47
- return self.service.read(system_identity, id_, include_deleted=True).to_dict()
48
-
49
-
50
- class DraftProxy(RecordProxy):
51
- def _resolve(self):
52
- pid_value = self._parse_ref_dict_id()
53
- try:
54
- return self.record_cls.pid.resolve(pid_value, registered_only=False)
55
- except (PIDUnregistered, NoResultFound):
56
- # try checking if it is a published record before failing
57
- return self.record_cls.pid.resolve(pid_value)
File without changes
@@ -1,483 +0,0 @@
1
- {
2
- "access": {
3
- "properties": {
4
- "owned_by": {
5
- "properties": {
6
- "user": {
7
- "type": "keyword"
8
- }
9
- }
10
- },
11
- "grants": {
12
- "properties": {
13
- "subject": {
14
- "properties": {
15
- "type": {
16
- "type": "keyword"
17
- },
18
- "id": {
19
- "type": "keyword"
20
- }
21
- }
22
- },
23
- "permission": {
24
- "type": "keyword"
25
- },
26
- "origin": {
27
- "type": "keyword"
28
- }
29
- }
30
- },
31
- "grant_tokens": {
32
- "type": "keyword"
33
- },
34
- "links": {
35
- "properties": {
36
- "id": {
37
- "type": "keyword"
38
- }
39
- }
40
- },
41
- "settings": {
42
- "properties": {
43
- "allow_user_requests": {
44
- "type": "boolean"
45
- },
46
- "allow_guest_requests": {
47
- "type": "boolean"
48
- },
49
- "accept_conditions_text": {
50
- "type": "text"
51
- },
52
- "secret_link_expiration": {
53
- "type": "integer"
54
- }
55
- }
56
- }
57
- }
58
- },
59
- "is_verified": {
60
- "type": "boolean"
61
- },
62
- "communities": {
63
- "properties": {
64
- "ids": {
65
- "type": "keyword"
66
- },
67
- "default": {
68
- "type": "keyword"
69
- },
70
- "entries": {
71
- "type": "object",
72
- "properties": {
73
- "uuid": {
74
- "type": "keyword"
75
- },
76
- "created": {
77
- "type": "date"
78
- },
79
- "updated": {
80
- "type": "date"
81
- },
82
- "version_id": {
83
- "type": "long"
84
- },
85
- "id": {
86
- "type": "keyword"
87
- },
88
- "is_verified": {
89
- "type": "boolean"
90
- },
91
- "@v": {
92
- "type": "keyword"
93
- },
94
- "slug": {
95
- "type": "keyword"
96
- },
97
- "children": {
98
- "properties": {
99
- "allow": {
100
- "type": "boolean"
101
- }
102
- }
103
- },
104
- "metadata": {
105
- "properties": {
106
- "title": {
107
- "type": "text"
108
- },
109
- "type": {
110
- "type": "object",
111
- "properties": {
112
- "@v": {
113
- "type": "keyword"
114
- },
115
- "id": {
116
- "type": "keyword"
117
- },
118
- "title": {
119
- "type": "object",
120
- "dynamic": "true",
121
- "properties": {
122
- "en": {
123
- "type": "text"
124
- }
125
- }
126
- }
127
- }
128
- },
129
- "organizations": {
130
- "type": "object",
131
- "properties": {
132
- "@v": {
133
- "type": "keyword"
134
- },
135
- "id": {
136
- "type": "keyword"
137
- },
138
- "name": {
139
- "type": "text"
140
- },
141
- "identifiers": {
142
- "properties": {
143
- "identifier": {
144
- "type": "text",
145
- "fields": {
146
- "keyword": {
147
- "type": "keyword"
148
- }
149
- }
150
- },
151
- "scheme": {
152
- "type": "keyword"
153
- }
154
- }
155
- }
156
- }
157
- },
158
- "funding": {
159
- "properties": {
160
- "award": {
161
- "type": "object",
162
- "properties": {
163
- "@v": {
164
- "type": "keyword"
165
- },
166
- "id": {
167
- "type": "keyword"
168
- },
169
- "title": {
170
- "type": "object",
171
- "dynamic": "true"
172
- },
173
- "number": {
174
- "type": "text",
175
- "fields": {
176
- "keyword": {
177
- "type": "keyword"
178
- }
179
- }
180
- },
181
- "program": {
182
- "type": "keyword"
183
- },
184
- "acronym": {
185
- "type": "keyword",
186
- "fields": {
187
- "text": {
188
- "type": "text"
189
- }
190
- }
191
- },
192
- "identifiers": {
193
- "properties": {
194
- "identifier": {
195
- "type": "keyword"
196
- },
197
- "scheme": {
198
- "type": "keyword"
199
- }
200
- }
201
- },
202
- "subjects": {
203
- "properties": {
204
- "@v": {
205
- "type": "keyword"
206
- },
207
- "id": {
208
- "type": "keyword"
209
- },
210
- "subject": {
211
- "type": "keyword"
212
- },
213
- "scheme": {
214
- "type": "keyword"
215
- },
216
- "props": {
217
- "type": "object",
218
- "dynamic": "true"
219
- }
220
- }
221
- },
222
- "organizations": {
223
- "properties": {
224
- "scheme": {
225
- "type": "keyword"
226
- },
227
- "id": {
228
- "type": "keyword"
229
- },
230
- "organization": {
231
- "type": "keyword"
232
- }
233
- }
234
- }
235
- }
236
- },
237
- "funder": {
238
- "type": "object",
239
- "properties": {
240
- "@v": {
241
- "type": "keyword"
242
- },
243
- "id": {
244
- "type": "keyword"
245
- },
246
- "name": {
247
- "type": "text"
248
- }
249
- }
250
- }
251
- }
252
- },
253
- "website": {
254
- "type": "keyword"
255
- }
256
- }
257
- },
258
- "theme": {
259
- "type": "object",
260
- "properties": {
261
- "enabled": {
262
- "type": "boolean"
263
- },
264
- "brand": {
265
- "type": "keyword"
266
- },
267
- "style": {
268
- "type": "object",
269
- "enabled": false
270
- }
271
- }
272
- },
273
- "parent": {
274
- "type": "object",
275
- "properties": {
276
- "uuid": {
277
- "type": "keyword"
278
- },
279
- "created": {
280
- "type": "date"
281
- },
282
- "updated": {
283
- "type": "date"
284
- },
285
- "version_id": {
286
- "type": "long"
287
- },
288
- "id": {
289
- "type": "keyword"
290
- },
291
- "@v": {
292
- "type": "keyword"
293
- },
294
- "is_verified": {
295
- "type": "boolean"
296
- },
297
- "slug": {
298
- "type": "keyword"
299
- },
300
- "children": {
301
- "properties": {
302
- "allow": {
303
- "type": "boolean"
304
- }
305
- }
306
- },
307
- "metadata": {
308
- "type": "object",
309
- "properties": {
310
- "title": {
311
- "type": "text"
312
- },
313
- "type": {
314
- "type": "object",
315
- "properties": {
316
- "@v": {
317
- "type": "keyword"
318
- },
319
- "id": {
320
- "type": "keyword"
321
- },
322
- "title": {
323
- "type": "object",
324
- "dynamic": "true",
325
- "properties": {
326
- "en": {
327
- "type": "text"
328
- }
329
- }
330
- }
331
- }
332
- },
333
- "website": {
334
- "type": "keyword"
335
- },
336
- "organizations": {
337
- "type": "object",
338
- "properties": {
339
- "@v": {
340
- "type": "keyword"
341
- },
342
- "id": {
343
- "type": "keyword"
344
- },
345
- "name": {
346
- "type": "text"
347
- },
348
- "identifiers": {
349
- "properties": {
350
- "identifier": {
351
- "type": "text",
352
- "fields": {
353
- "keyword": {
354
- "type": "keyword"
355
- }
356
- }
357
- },
358
- "scheme": {
359
- "type": "keyword"
360
- }
361
- }
362
- }
363
- }
364
- },
365
- "funding": {
366
- "properties": {
367
- "award": {
368
- "type": "object",
369
- "properties": {
370
- "@v": {
371
- "type": "keyword"
372
- },
373
- "id": {
374
- "type": "keyword"
375
- },
376
- "title": {
377
- "type": "object",
378
- "dynamic": "true"
379
- },
380
- "number": {
381
- "type": "text",
382
- "fields": {
383
- "keyword": {
384
- "type": "keyword"
385
- }
386
- }
387
- },
388
- "program": {
389
- "type": "keyword"
390
- },
391
- "acronym": {
392
- "type": "keyword",
393
- "fields": {
394
- "text": {
395
- "type": "text"
396
- }
397
- }
398
- },
399
- "identifiers": {
400
- "properties": {
401
- "identifier": {
402
- "type": "keyword"
403
- },
404
- "scheme": {
405
- "type": "keyword"
406
- }
407
- }
408
- },
409
- "subjects": {
410
- "properties": {
411
- "@v": {
412
- "type": "keyword"
413
- },
414
- "id": {
415
- "type": "keyword"
416
- },
417
- "subject": {
418
- "type": "keyword"
419
- },
420
- "scheme": {
421
- "type": "keyword"
422
- },
423
- "props": {
424
- "type": "object",
425
- "dynamic": "true"
426
- }
427
- }
428
- },
429
- "organizations": {
430
- "properties": {
431
- "scheme": {
432
- "type": "keyword"
433
- },
434
- "id": {
435
- "type": "keyword"
436
- },
437
- "organization": {
438
- "type": "keyword"
439
- }
440
- }
441
- }
442
- }
443
- },
444
- "funder": {
445
- "type": "object",
446
- "properties": {
447
- "@v": {
448
- "type": "keyword"
449
- },
450
- "id": {
451
- "type": "keyword"
452
- },
453
- "name": {
454
- "type": "text"
455
- }
456
- }
457
- }
458
- }
459
- }
460
- }
461
- },
462
- "theme": {
463
- "type": "object",
464
- "properties": {
465
- "enabled": {
466
- "type": "boolean"
467
- },
468
- "brand": {
469
- "type": "keyword"
470
- },
471
- "style": {
472
- "type": "object",
473
- "enabled": false
474
- }
475
- }
476
- }
477
- }
478
- }
479
- }
480
- }
481
- }
482
- }
483
- }
@@ -1,3 +0,0 @@
1
- from .registry import OwnerEntityResolverRegistry
2
-
3
- __all__ = ["OwnerEntityResolverRegistry"]
@@ -1,22 +0,0 @@
1
- from invenio_records_resources.references.registry import ResolverRegistryBase
2
-
3
- from oarepo_runtime.proxies import current_oarepo
4
-
5
-
6
- class OwnerEntityResolverRegistry(ResolverRegistryBase):
7
- """Entity Resolver registry for owners."""
8
-
9
- @classmethod
10
- def get_registered_resolvers(cls):
11
- """Get all currently registered resolvers."""
12
- return iter(current_oarepo.owner_entity_resolvers)
13
-
14
- @classmethod
15
- def resolve_reference(cls, reference):
16
- for resolver in cls.get_registered_resolvers():
17
- try:
18
- if resolver.matches_reference_dict(reference):
19
- return resolver.get_entity_proxy(reference).resolve()
20
- except ValueError:
21
- # Value error ignored from matches_reference_dict
22
- pass
@@ -1,22 +0,0 @@
1
- from .base import (
2
- InvalidCheckValue,
3
- InvalidRelationValue,
4
- Relation,
5
- RelationResult,
6
- RelationsField,
7
- UnstrictRelationResult
8
- )
9
- from .internal import InternalRelation
10
- from .pid_relation import PIDRelation, UnstrictPIDRelation
11
-
12
- __all__ = (
13
- "Relation",
14
- "RelationResult",
15
- "InvalidRelationValue",
16
- "InvalidCheckValue",
17
- "RelationsField",
18
- "InternalRelation",
19
- "PIDRelation",
20
- "UnstrictPIDRelation",
21
- "UnstrictRelationResult"
22
- )