oarepo-runtime 1.5.135__py3-none-any.whl → 1.5.136__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.
@@ -1,21 +1,6 @@
1
- import marshmallow as ma
2
- from flask_resources import (
3
- JSONDeserializer,
4
- JSONSerializer,
5
- RequestBodyParser,
6
- ResponseHandler,
7
- )
8
- from invenio_drafts_resources.resources import RecordResourceConfig
9
- from invenio_rdm_records.resources.args import RDMSearchRequestArgsSchema
10
1
  from invenio_rdm_records.resources.config import (
11
2
  RDMRecordResourceConfig,
12
3
  )
13
- from invenio_records_resources.resources.records.headers import etag_headers
14
-
15
- record_serializers = {
16
- "application/json": ResponseHandler(JSONSerializer(), headers=etag_headers),
17
- }
18
-
19
4
 
20
5
  class BaseRecordResourceConfig(RDMRecordResourceConfig):
21
6
  """Record resource configuration."""
@@ -23,28 +8,5 @@ class BaseRecordResourceConfig(RDMRecordResourceConfig):
23
8
  blueprint_name = None
24
9
  url_prefix = None
25
10
 
26
- routes = RecordResourceConfig.routes
27
-
28
- routes["delete-record"] = "/<pid_value>/delete"
29
- routes["restore-record"] = "/<pid_value>/restore"
30
- routes["set-record-quota"] = "/<pid_value>/quota"
31
- routes["set-user-quota"] = "/users/<pid_value>/quota"
32
- routes["all-prefix"] = "/all"
33
-
34
- request_view_args = {
35
- "pid_value": ma.fields.Str(),
36
- }
37
-
38
- request_read_args = {
39
- "style": ma.fields.Str(),
40
- "locale": ma.fields.Str(),
41
- "include_deleted": ma.fields.Bool(),
42
- }
43
-
44
- request_body_parsers = {
45
- "application/json": RequestBodyParser(JSONDeserializer()),
46
- }
47
-
48
- request_search_args = RDMSearchRequestArgsSchema
49
-
50
- response_handlers = record_serializers
11
+ routes = RDMRecordResourceConfig.routes
12
+ routes["all-prefix"] = "/all"
@@ -12,7 +12,6 @@ from invenio_records_resources.resources.records.resource import (
12
12
  )
13
13
  from invenio_records_resources.resources.records.utils import search_preference
14
14
 
15
-
16
15
  class BaseRecordResource(RDMRecordResource):
17
16
 
18
17
  def create_url_rules(self):
@@ -29,11 +28,6 @@ class BaseRecordResource(RDMRecordResource):
29
28
  routes = self.config.routes
30
29
  url_rules = super(RDMRecordResource, self).create_url_rules()
31
30
  url_rules += [
32
- route("DELETE", p(routes["delete-record"]), self.delete_record),
33
- route("POST", p(routes["restore-record"]), self.restore_record),
34
- route("POST", p(routes["set-record-quota"]), self.set_record_quota),
35
- # TODO: move to users?
36
- route("POST", routes["set-user-quota"], self.set_user_quota),
37
31
  route("GET", s(routes["all-prefix"]), self.search_all_records),
38
32
  ]
39
33
 
@@ -100,3 +100,18 @@ class PermissionsPresetsConfigMixin:
100
100
  name = name[:-6]
101
101
  name = re.sub(r"(?<!^)(?=[A-Z])", "_", name).upper()
102
102
  return f"{name}_PERMISSIONS_PRESETS"
103
+
104
+ class SearchAllConfigMixin:
105
+ @property
106
+ def search_all(self):
107
+ from invenio_rdm_records.services.search_params import MyDraftsParam
108
+ if hasattr(self, "search_drafts"):
109
+ class AllSearchOptions(self.search_drafts):
110
+ @class_property
111
+ def params_interpreters_cls(cls):
112
+ param_interpreters = [*super().params_interpreters_cls]
113
+ param_interpreters.remove(MyDraftsParam)
114
+ return param_interpreters
115
+ return AllSearchOptions
116
+ else:
117
+ return self.search
@@ -30,7 +30,7 @@ class SearchAllRecordsService(RDMRecordService):
30
30
  params = params or {}
31
31
 
32
32
  search_opts = (
33
- getattr(self.config, "search_all", None) or self.config.search_drafts
33
+ getattr(self.config, "search_all", None) or self.config.search
34
34
  )
35
35
 
36
36
  search_result = self._search(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 1.5.135
3
+ Version: 1.5.136
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -79,23 +79,23 @@ oarepo_runtime/records/systemfields/record_status.py,sha256=U3kem4-JkNsT17e0iAl3
79
79
  oarepo_runtime/records/systemfields/selectors.py,sha256=Q9jE1smSN3heT2LIpK_jB6bIRjll1kX0AW9AhTsIYiU,2830
80
80
  oarepo_runtime/records/systemfields/synthetic.py,sha256=UustvhzcDGuaNZLDeHbWwshoxQR-qRIuHDCct5RXmrI,4287
81
81
  oarepo_runtime/resources/__init__.py,sha256=v8BGrOTu_FjKzd0eozV7Q4GoGxyfybsL2cI-tbP5Pys,185
82
- oarepo_runtime/resources/config.py,sha256=GEM3A7lvGgWUdhBR85uJbaQDKg2-Xk5U-Jm4JmogfFg,1414
82
+ oarepo_runtime/resources/config.py,sha256=34kfNh2hVYYS9q1CYziiNdFzTvDuSXKd4W1n1OQtm-c,308
83
83
  oarepo_runtime/resources/file_resource.py,sha256=Ta3bFce7l0xwqkkOMOEu9mxbB8BbKj5HUHRHmidhnl8,414
84
84
  oarepo_runtime/resources/json_serializer.py,sha256=82_-xQEtxKaPakv8R1oBAFbGnxskF_Ve4tcfcy4PetI,963
85
85
  oarepo_runtime/resources/localized_ui_json_serializer.py,sha256=3V9cJaG_e1PMXKVX_wKfBp1LmbeForwHyBNYdyha4uQ,1878
86
- oarepo_runtime/resources/resource.py,sha256=GK5yGnJIjH60wGqqDoOfwMQQFQDLZhJpU4zBJOmABI8,2063
86
+ oarepo_runtime/resources/resource.py,sha256=dSpaPW6l_kTTzaq5LkZODyOzbL_T3-lU2uX65SQ46gE,1718
87
87
  oarepo_runtime/resources/responses.py,sha256=Pj-K_r-QO9B2n9STcfqsrBQu1e3iYhdEBFSVTeWR7cM,738
88
88
  oarepo_runtime/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
89
  oarepo_runtime/services/components.py,sha256=0aqmuNbGCQhfOI22f6mM2DxuKSTqstGOGyisOiqw9KE,15481
90
90
  oarepo_runtime/services/generators.py,sha256=j87HitHA_w2awsz0C5IAAJ0qjg9JMtvdO3dvh6FQyfg,250
91
91
  oarepo_runtime/services/results.py,sha256=MxkoMkquISMKyP6De_xOF-IzQE9wRYtq3d_OFAqqIVo,6156
92
92
  oarepo_runtime/services/search.py,sha256=t0WEe2VrbCzZ06-Jgz7C9-pc9y27BqAgTEXldEHskfk,9409
93
- oarepo_runtime/services/service.py,sha256=TI2ulEVlSR7HZnfPYltLl8Vf4O9fhJ7rHaV6G4HWbrc,1893
93
+ oarepo_runtime/services/service.py,sha256=-Cd7R6Y8UW01Gsyprhtm4-iyBVBKFs4kOaka7mUGH7o,1886
94
94
  oarepo_runtime/services/config/__init__.py,sha256=aRxCBLN9pqCgdYlF-KJYtDzt2mwJ66npdceOAZkMfa0,888
95
95
  oarepo_runtime/services/config/draft_link.py,sha256=Hq541t33F3lEZo6XTexzdxneKJOmLBLujFdyT1w1TbE,698
96
96
  oarepo_runtime/services/config/link_conditions.py,sha256=5hDEtCaQt1tzjb9gGdeimsmKNoWWPicIeYKfI8Fg8Qw,3866
97
97
  oarepo_runtime/services/config/permissions_presets.py,sha256=b1wm3JjL8KgkaH7VMkNfdMk5fXtf3X87rB7gkvaNxns,7369
98
- oarepo_runtime/services/config/service.py,sha256=s-dVbGkLICpsce6jgu7b5kzYFz9opWjSQFDBgbIhKio,4002
98
+ oarepo_runtime/services/config/service.py,sha256=KS1eKXjRzusD_UAKanzKezua2lmo9vObwqd63dky1ik,4593
99
99
  oarepo_runtime/services/custom_fields/__init__.py,sha256=_gqMcA_I3rdEZcBtCuDjO4wdVCqFML5NzaccuPx5a3o,2565
100
100
  oarepo_runtime/services/custom_fields/mappings.py,sha256=3CIvjWzVRO3fZ2r-3taK1rwuLH9wj5Lguo-GvsbLBf4,7515
101
101
  oarepo_runtime/services/entity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -148,13 +148,13 @@ oarepo_runtime/translations/en/LC_MESSAGES/messages.po,sha256=7-5S3iINOSFSI5gVdR
148
148
  oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
149
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
150
150
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
151
- oarepo_runtime-1.5.135.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
151
+ oarepo_runtime-1.5.136.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
152
  tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
154
154
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
155
155
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
156
- oarepo_runtime-1.5.135.dist-info/METADATA,sha256=uMODFmdnyZJqbJaDsyHQN7LTXl0UHs2vL0OJfehbees,4743
157
- oarepo_runtime-1.5.135.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
158
- oarepo_runtime-1.5.135.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
159
- oarepo_runtime-1.5.135.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
160
- oarepo_runtime-1.5.135.dist-info/RECORD,,
156
+ oarepo_runtime-1.5.136.dist-info/METADATA,sha256=foAVOZLkwGL0Cy5jxIjhykmpwEkVxTHp8ry3C2zBIR4,4743
157
+ oarepo_runtime-1.5.136.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
158
+ oarepo_runtime-1.5.136.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
159
+ oarepo_runtime-1.5.136.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
160
+ oarepo_runtime-1.5.136.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5