invenio-app-ils 1.0.0a54__py2.py3-none-any.whl → 6.1.0__py2.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.
- invenio_app_ils/__init__.py +2 -2
- invenio_app_ils/acquisition/api.py +3 -1
- invenio_app_ils/acquisition/config.py +10 -21
- invenio_app_ils/acquisition/jsonresolvers/order_order_lines.py +1 -0
- invenio_app_ils/acquisition/mappings/os-v1/acq_orders/order-v1.0.0.json +364 -0
- invenio_app_ils/acquisition/mappings/os-v2/__init__.py +0 -0
- invenio_app_ils/acquisition/mappings/os-v2/acq_orders/order-v1.0.0.json +364 -0
- invenio_app_ils/acquisition/mappings/v7/acq_orders/order-v1.0.0.json +14 -0
- invenio_app_ils/acquisition/search.py +5 -15
- invenio_app_ils/assets/semantic-ui/less/theme.config +103 -0
- invenio_app_ils/assets/semantic-ui/templates/.gitkeep +0 -0
- invenio_app_ils/circulation/api.py +153 -67
- invenio_app_ils/circulation/config.py +29 -25
- invenio_app_ils/circulation/indexer.py +14 -19
- invenio_app_ils/circulation/loaders/__init__.py +2 -0
- invenio_app_ils/circulation/loaders/schemas/json/loan_checkout.py +2 -3
- invenio_app_ils/circulation/loaders/schemas/json/loan_request.py +82 -16
- invenio_app_ils/circulation/loaders/schemas/json/loan_self_checkout.py +19 -0
- invenio_app_ils/circulation/notifications/api.py +23 -19
- invenio_app_ils/circulation/notifications/messages.py +6 -6
- invenio_app_ils/circulation/notifications/tasks.py +1 -2
- invenio_app_ils/circulation/receivers.py +2 -5
- invenio_app_ils/circulation/search.py +23 -22
- invenio_app_ils/circulation/serializers/__init__.py +2 -2
- invenio_app_ils/circulation/serializers/csv.py +1 -3
- invenio_app_ils/circulation/serializers/custom_fields.py +5 -9
- invenio_app_ils/circulation/serializers/json.py +2 -6
- invenio_app_ils/circulation/serializers/response.py +12 -12
- invenio_app_ils/circulation/stats/views.py +5 -15
- invenio_app_ils/circulation/tasks.py +2 -6
- invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/self_checkout.html +19 -0
- invenio_app_ils/circulation/templates/invenio_app_ils_circulation/notifications/update_dates.html +19 -0
- invenio_app_ils/circulation/utils.py +23 -17
- invenio_app_ils/circulation/views.py +103 -39
- invenio_app_ils/cli.py +220 -260
- invenio_app_ils/closures/api.py +72 -7
- invenio_app_ils/closures/serializers/__init__.py +16 -0
- invenio_app_ils/closures/serializers/response.py +35 -0
- invenio_app_ils/closures/serializers/schema.py +28 -0
- invenio_app_ils/closures/tasks.py +4 -11
- invenio_app_ils/closures/views.py +66 -0
- invenio_app_ils/config.py +207 -150
- invenio_app_ils/document_requests/api.py +6 -21
- invenio_app_ils/document_requests/loaders/__init__.py +4 -12
- invenio_app_ils/document_requests/mappings/{v6 → os-v1}/__init__.py +2 -2
- invenio_app_ils/document_requests/mappings/os-v1/document_requests/document_request-v1.0.0.json +196 -0
- invenio_app_ils/document_requests/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/document_requests/mappings/os-v2/document_requests/document_request-v1.0.0.json +196 -0
- invenio_app_ils/document_requests/notifications/api.py +2 -7
- invenio_app_ils/document_requests/notifications/messages.py +3 -7
- invenio_app_ils/document_requests/search.py +2 -6
- invenio_app_ils/document_requests/views.py +4 -10
- invenio_app_ils/documents/api.py +19 -25
- invenio_app_ils/documents/indexer.py +13 -20
- invenio_app_ils/documents/jsonresolvers/document_circulation.py +11 -33
- invenio_app_ils/documents/jsonresolvers/document_eitem.py +1 -0
- invenio_app_ils/documents/jsonresolvers/document_item.py +8 -9
- invenio_app_ils/documents/jsonresolvers/document_stock.py +7 -7
- invenio_app_ils/documents/loaders/jsonschemas/document.py +3 -14
- invenio_app_ils/documents/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/documents/mappings/os-v1/documents/document-v1.0.0.json +932 -0
- invenio_app_ils/documents/mappings/os-v1/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/documents/mappings/os-v2/documents/document-v1.0.0.json +932 -0
- invenio_app_ils/documents/mappings/os-v2/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/mappings/v7/documents/document-v1.0.0.json +102 -11
- invenio_app_ils/documents/mappings/v7/documents/document-v2.0.0.json +1066 -0
- invenio_app_ils/documents/schemas/documents/document-v2.0.0.json +732 -0
- invenio_app_ils/eitems/api.py +41 -7
- invenio_app_ils/eitems/loaders/jsonschemas/eitems.py +6 -6
- invenio_app_ils/eitems/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v1.0.0.json +139 -0
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/os-v1/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/{series/mappings/v6 → eitems/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v1.0.0.json +139 -0
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/os-v2/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v1.0.0.json +12 -2
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v2.0.0.json +142 -0
- invenio_app_ils/eitems/mappings/v7/eitems/eitem-v3.0.0.json +179 -0
- invenio_app_ils/eitems/schemas/eitems/eitem-v2.0.0.json +120 -0
- invenio_app_ils/eitems/schemas/eitems/eitem-v3.0.0.json +120 -0
- invenio_app_ils/eitems/search.py +3 -9
- invenio_app_ils/errors.py +119 -6
- invenio_app_ils/ext.py +15 -18
- invenio_app_ils/facets.py +13 -15
- invenio_app_ils/files/receivers.py +1 -1
- invenio_app_ils/files/views.py +1 -2
- invenio_app_ils/ill/api.py +1 -2
- invenio_app_ils/ill/config.py +10 -16
- invenio_app_ils/ill/jsonresolvers/borrowing_request_document.py +2 -3
- invenio_app_ils/ill/jsonresolvers/borrowing_request_patron.py +1 -3
- invenio_app_ils/ill/jsonresolvers/borrowing_request_provider.py +1 -3
- invenio_app_ils/ill/loaders/__init__.py +3 -9
- invenio_app_ils/ill/loaders/jsonschemas/patron_loan_actions.py +1 -8
- invenio_app_ils/ill/loaders/jsonschemas/patron_loan_extension_actions.py +3 -8
- invenio_app_ils/ill/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/ill/mappings/os-v1/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
- invenio_app_ils/{acquisition/mappings/v6 → ill/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/ill/mappings/os-v2/ill_borrowing_requests/borrowing_request-v1.0.0.json +254 -0
- invenio_app_ils/ill/mappings/v7/ill_borrowing_requests/borrowing_request-v1.0.0.json +14 -0
- invenio_app_ils/ill/notifications/api.py +1 -4
- invenio_app_ils/ill/search.py +3 -9
- invenio_app_ils/ill/serializers/__init__.py +1 -3
- invenio_app_ils/ill/views.py +2 -4
- invenio_app_ils/internal_locations/api.py +1 -4
- invenio_app_ils/internal_locations/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/internal_locations/mappings/os-v1/internal_locations/internal_location-v1.0.0.json +108 -0
- invenio_app_ils/internal_locations/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/internal_locations/mappings/os-v2/internal_locations/internal_location-v1.0.0.json +108 -0
- invenio_app_ils/internal_locations/search.py +1 -3
- invenio_app_ils/items/api.py +18 -15
- invenio_app_ils/items/indexer.py +1 -3
- invenio_app_ils/items/jsonresolvers/item_document.py +1 -1
- invenio_app_ils/items/jsonresolvers/item_internal_location.py +2 -6
- invenio_app_ils/items/loaders/jsonschemas/items.py +2 -0
- {tests/api/circulation → invenio_app_ils/items/mappings/os-v1}/__init__.py +1 -1
- invenio_app_ils/items/mappings/os-v1/items/item-v1.0.0.json +285 -0
- invenio_app_ils/items/mappings/os-v1/items/item-v2.0.0.json +326 -0
- {tests/api/ill → invenio_app_ils/items/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/items/mappings/os-v2/items/item-v1.0.0.json +285 -0
- invenio_app_ils/items/mappings/os-v2/items/item-v2.0.0.json +326 -0
- invenio_app_ils/items/mappings/v7/items/item-v1.0.0.json +11 -0
- invenio_app_ils/items/mappings/v7/items/item-v2.0.0.json +326 -0
- invenio_app_ils/items/schemas/items/item-v1.0.0.json +22 -0
- invenio_app_ils/items/schemas/items/item-v2.0.0.json +172 -0
- invenio_app_ils/items/search.py +18 -11
- invenio_app_ils/items/serializers/item.py +7 -6
- invenio_app_ils/literature/api.py +1 -3
- invenio_app_ils/literature/search.py +3 -5
- invenio_app_ils/literature/serializers/csv.py +1 -3
- invenio_app_ils/literature/serializers/json.py +1 -3
- invenio_app_ils/locations/api.py +2 -4
- invenio_app_ils/locations/indexer.py +3 -9
- invenio_app_ils/locations/loaders/__init__.py +1 -3
- invenio_app_ils/locations/loaders/jsonschemas/location.py +4 -11
- invenio_app_ils/locations/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/locations/mappings/os-v1/locations/location-v1.0.0.json +90 -0
- invenio_app_ils/locations/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/locations/mappings/os-v2/locations/location-v1.0.0.json +90 -0
- invenio_app_ils/notifications/messages.py +4 -3
- invenio_app_ils/notifications/tasks.py +1 -3
- invenio_app_ils/notifications/views.py +2 -2
- invenio_app_ils/patrons/anonymization.py +53 -32
- invenio_app_ils/patrons/api.py +3 -5
- invenio_app_ils/patrons/cli.py +1 -2
- invenio_app_ils/patrons/indexer.py +4 -13
- invenio_app_ils/patrons/mappings/os-v1/__init__.py +8 -0
- invenio_app_ils/patrons/mappings/os-v1/patrons/patron-v1.0.0.json +42 -0
- invenio_app_ils/patrons/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/patrons/mappings/os-v2/patrons/patron-v1.0.0.json +42 -0
- invenio_app_ils/patrons/views.py +4 -14
- invenio_app_ils/permissions.py +93 -35
- invenio_app_ils/providers/api.py +2 -6
- invenio_app_ils/providers/config.py +11 -19
- invenio_app_ils/providers/indexer.py +2 -6
- invenio_app_ils/providers/mappings/{v6 → os-v1}/__init__.py +1 -1
- invenio_app_ils/providers/mappings/os-v1/providers/provider-v1.0.0.json +57 -0
- invenio_app_ils/providers/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/providers/mappings/os-v2/providers/provider-v1.0.0.json +57 -0
- invenio_app_ils/providers/mappings/v7/__init__.py +1 -1
- invenio_app_ils/providers/proxies.py +1 -3
- invenio_app_ils/records/api.py +3 -9
- invenio_app_ils/records/loaders/schemas/changed_by.py +1 -3
- invenio_app_ils/records/loaders/schemas/identifiers.py +23 -0
- invenio_app_ils/records/metadata_extensions.py +1 -4
- invenio_app_ils/records/permissions.py +8 -2
- invenio_app_ils/records/serializers/__init__.py +1 -4
- invenio_app_ils/records/views.py +4 -7
- invenio_app_ils/records_relations/api.py +11 -34
- invenio_app_ils/records_relations/indexer.py +1 -3
- invenio_app_ils/records_relations/retriever.py +14 -9
- invenio_app_ils/records_relations/views.py +16 -50
- invenio_app_ils/relations/api.py +17 -16
- invenio_app_ils/search_permissions.py +24 -24
- invenio_app_ils/series/api.py +10 -12
- invenio_app_ils/series/loaders/jsonschemas/series.py +3 -2
- invenio_app_ils/{items/mappings/v6 → series/mappings/os-v1}/__init__.py +1 -1
- invenio_app_ils/series/mappings/os-v1/series/series-v1.0.0.json +324 -0
- invenio_app_ils/series/mappings/os-v1/series/series-v2.0.0.json +396 -0
- {tests/api/acquisition → invenio_app_ils/series/mappings/os-v2}/__init__.py +1 -1
- invenio_app_ils/series/mappings/os-v2/series/series-v1.0.0.json +324 -0
- invenio_app_ils/series/mappings/os-v2/series/series-v2.0.0.json +396 -0
- invenio_app_ils/series/mappings/v7/series/series-v1.0.0.json +35 -3
- invenio_app_ils/series/mappings/v7/series/series-v2.0.0.json +396 -0
- invenio_app_ils/series/schemas/series/series-v2.0.0.json +354 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v1/aggr-file-download-v1.json +60 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/__init__.py +9 -0
- invenio_app_ils/stats/aggregations/aggr_file_download/os-v2/aggr-file-download-v1.json +60 -0
- invenio_app_ils/stats/event_builders.py +73 -0
- invenio_app_ils/stats/file_download/os-v1/file-download-v1.json +72 -0
- invenio_app_ils/stats/file_download/os-v2/__init__.py +9 -0
- invenio_app_ils/stats/file_download/os-v2/file-download-v1.json +72 -0
- invenio_app_ils/stats/processors.py +30 -0
- invenio_app_ils/stats/templates/aggregations/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/__init__.py +8 -0
- invenio_app_ils/stats/templates/aggregations/ils_record_changes/os-v2/aggr-ils-record-changes-v1.json +41 -0
- {tests → invenio_app_ils/stats/templates/events}/__init__.py +2 -2
- invenio_app_ils/stats/templates/events/ils_record_changes/__init__.py +8 -0
- invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/__init__.py +8 -0
- invenio_app_ils/stats/templates/events/ils_record_changes/os-v2/ils-record-changes-v1.json +41 -0
- invenio_app_ils/templates/logged_out.html +12 -0
- invenio_app_ils/views.py +18 -4
- invenio_app_ils/vocabularies/api.py +1 -1
- invenio_app_ils/vocabularies/cli.py +6 -18
- invenio_app_ils/vocabularies/data/acq_order_line_payment_modes.json +5 -0
- invenio_app_ils/vocabularies/data/identifier_schemes.json +5 -0
- invenio_app_ils/vocabularies/indexer.py +1 -4
- invenio_app_ils/vocabularies/jsonresolvers/licenses.py +2 -11
- invenio_app_ils/vocabularies/mappings/os-v1/__init__.py +8 -0
- invenio_app_ils/vocabularies/mappings/os-v1/vocabularies/vocabulary-v1.0.0.json +23 -0
- invenio_app_ils/vocabularies/mappings/os-v2/__init__.py +8 -0
- invenio_app_ils/vocabularies/mappings/os-v2/vocabularies/vocabulary-v1.0.0.json +23 -0
- invenio_app_ils/vocabularies/sources/base.py +1 -3
- invenio_app_ils/webpack.py +27 -0
- invenio_app_ils-6.1.0.dist-info/METADATA +627 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/RECORD +227 -249
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/WHEEL +1 -1
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/entry_points.txt +9 -5
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info}/top_level.txt +0 -1
- invenio_app_ils/acquisition/mappings/v6/acq_orders/order-v1.0.0.json +0 -352
- invenio_app_ils/document_requests/mappings/v6/document_requests/document_request-v1.0.0.json +0 -199
- invenio_app_ils/documents/mappings/v6/documents/document-v1.0.0.json +0 -843
- invenio_app_ils/eitems/mappings/v6/eitems/eitem-v1.0.0.json +0 -131
- invenio_app_ils/ill/mappings/v6/ill_borrowing_requests/borrowing_request-v1.0.0.json +0 -242
- invenio_app_ils/internal_locations/mappings/v6/internal_locations/internal_location-v1.0.0.json +0 -110
- invenio_app_ils/items/mappings/v6/items/item-v1.0.0.json +0 -276
- invenio_app_ils/locations/mappings/v6/locations/location-v1.0.0.json +0 -92
- invenio_app_ils/notifications/admin.py +0 -57
- invenio_app_ils/patrons/mappings/v6/__init__.py +0 -8
- invenio_app_ils/patrons/mappings/v6/patrons/patron-v1.0.0.json +0 -44
- invenio_app_ils/providers/mappings/v6/providers/provider-v1.0.0.json +0 -59
- invenio_app_ils/series/mappings/v6/series/series-v1.0.0.json +0 -298
- invenio_app_ils/stats/aggregations/aggr_file_download/v6/aggr-file-download-v1.json +0 -59
- invenio_app_ils/stats/file_download/v6/file-download-v1.json +0 -74
- invenio_app_ils/version.py +0 -14
- invenio_app_ils/vocabularies/mappings/v6/__init__.py +0 -8
- invenio_app_ils/vocabularies/mappings/v6/vocabularies/vocabulary-v1.0.0.json +0 -25
- invenio_app_ils-1.0.0a54.dist-info/METADATA +0 -95
- tests/api/__init__.py +0 -8
- tests/api/acquisition/test_acq_orders_crud.py +0 -102
- tests/api/acquisition/test_acq_orders_permissions.py +0 -104
- tests/api/acquisition/test_acq_providers_permissions.py +0 -83
- tests/api/circulation/test_expired_loans.py +0 -88
- tests/api/circulation/test_loan_checkout.py +0 -216
- tests/api/circulation/test_loan_default_durations.py +0 -57
- tests/api/circulation/test_loan_document_resolver.py +0 -18
- tests/api/circulation/test_loan_extend.py +0 -132
- tests/api/circulation/test_loan_item_permissions.py +0 -139
- tests/api/circulation/test_loan_item_resolver.py +0 -26
- tests/api/circulation/test_loan_list_permissions.py +0 -104
- tests/api/circulation/test_loan_patron_resolver.py +0 -38
- tests/api/circulation/test_loan_request.py +0 -234
- tests/api/circulation/test_loan_update.py +0 -150
- tests/api/circulation/test_notifications.py +0 -229
- tests/api/conftest.py +0 -236
- tests/api/document_requests/__init__.py +0 -8
- tests/api/document_requests/test_document_requests.py +0 -131
- tests/api/document_requests/test_document_requests_permissions.py +0 -177
- tests/api/document_requests/test_notifications_filter.py +0 -36
- tests/api/ill/test_ill_brw_crud.py +0 -84
- tests/api/ill/test_ill_brw_reqs_patron_loan_create_action.py +0 -207
- tests/api/ill/test_ill_brw_reqs_patron_loan_extension_actions.py +0 -298
- tests/api/ill/test_ill_brw_reqs_permissions.py +0 -169
- tests/api/ill/test_ill_providers_permissions.py +0 -82
- tests/api/ils/__init__.py +0 -8
- tests/api/ils/documents/__init__.py +0 -8
- tests/api/ils/documents/test_document_crud.py +0 -57
- tests/api/ils/documents/test_document_permissions.py +0 -106
- tests/api/ils/documents/test_document_resolvers.py +0 -35
- tests/api/ils/eitems/__init__.py +0 -8
- tests/api/ils/eitems/test_eitems_crud.py +0 -41
- tests/api/ils/eitems/test_eitems_permissions.py +0 -84
- tests/api/ils/eitems/test_files.py +0 -172
- tests/api/ils/items/__init__.py +0 -8
- tests/api/ils/items/test_apis.py +0 -43
- tests/api/ils/items/test_items_crud.py +0 -60
- tests/api/ils/items/test_items_permissions.py +0 -107
- tests/api/ils/items/test_items_update.py +0 -47
- tests/api/ils/records_relations/__init__.py +0 -8
- tests/api/ils/records_relations/helpers.py +0 -115
- tests/api/ils/records_relations/test_records_relations_parentchild.py +0 -560
- tests/api/ils/records_relations/test_records_relations_sequence.py +0 -302
- tests/api/ils/records_relations/test_records_relations_siblings.py +0 -678
- tests/api/ils/series/__init__.py +0 -8
- tests/api/ils/series/test_series_permissions.py +0 -95
- tests/api/ils/test_anonymization.py +0 -189
- tests/api/ils/test_apis.py +0 -76
- tests/api/ils/test_closures.py +0 -324
- tests/api/ils/test_errors.py +0 -126
- tests/api/ils/test_facets.py +0 -84
- tests/api/ils/test_internal_locations.py +0 -96
- tests/api/ils/test_loaders.py +0 -55
- tests/api/ils/test_metadata_extensions.py +0 -205
- tests/api/ils/test_notifications.py +0 -183
- tests/api/ils/test_notifications_mails.py +0 -39
- tests/api/ils/test_notifications_permissions.py +0 -55
- tests/api/ils/test_patrons.py +0 -106
- tests/api/ils/test_record_delete.py +0 -46
- tests/api/ils/test_record_permissions.py +0 -135
- tests/api/ils/test_resolvers.py +0 -207
- tests/api/ils/test_stats.py +0 -160
- tests/api/ils/test_tasks.py +0 -211
- tests/api/ils/test_vocabularies.py +0 -35
- tests/conftest.py +0 -123
- tests/data/acq_orders.json +0 -89
- tests/data/acq_providers.json +0 -12
- tests/data/document_requests.json +0 -77
- tests/data/documents.json +0 -237
- tests/data/eitems.json +0 -66
- tests/data/ill_borrowing_requests.json +0 -77
- tests/data/ill_providers.json +0 -12
- tests/data/internal_locations.json +0 -22
- tests/data/items.json +0 -271
- tests/data/loans.json +0 -133
- tests/data/loans_most_loaned.json +0 -128
- tests/data/locations.json +0 -20
- tests/data/series.json +0 -33
- tests/helpers.py +0 -104
- tests/templates/notifications/title_body.html +0 -8
- tests/templates/notifications/title_body_html.html +0 -13
- tests/templates/notifications/title_body_html_ctx.html +0 -13
- tests/templates/notifications/title_only.html +0 -3
- tests/test_version.py +0 -17
- /tests/templates/notifications/blank.html → /invenio_app_ils/acquisition/mappings/os-v1/__init__.py +0 -0
- /invenio_app_ils/stats/aggregations/aggr_file_download/{v6 → os-v1}/__init__.py +0 -0
- /invenio_app_ils/stats/file_download/{v6 → os-v1}/__init__.py +0 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/AUTHORS.rst +0 -0
- {invenio_app_ils-1.0.0a54.dist-info → invenio_app_ils-6.1.0.dist-info/licenses}/LICENSE +0 -0
invenio_app_ils/config.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2018-
|
|
3
|
+
# Copyright (C) 2018-2025 CERN.
|
|
4
4
|
#
|
|
5
5
|
# invenio-app-ils is free software; you can redistribute it and/or modify it
|
|
6
6
|
# under the terms of the MIT License; see LICENSE file for more details.
|
|
@@ -15,6 +15,7 @@ You overwrite and set instance-specific configuration by either:
|
|
|
15
15
|
|
|
16
16
|
import datetime
|
|
17
17
|
from datetime import timedelta
|
|
18
|
+
from functools import partial
|
|
18
19
|
|
|
19
20
|
from celery.schedules import crontab
|
|
20
21
|
from invenio_accounts.config import (
|
|
@@ -24,7 +25,7 @@ from invenio_records_rest.facets import terms_filter
|
|
|
24
25
|
from invenio_records_rest.utils import allow_all, deny_all
|
|
25
26
|
from invenio_stats.aggregations import StatAggregator
|
|
26
27
|
from invenio_stats.processors import EventsIndexer
|
|
27
|
-
from invenio_stats.queries import ESTermsQuery
|
|
28
|
+
from invenio_stats.queries import DateHistogramQuery, ESTermsQuery
|
|
28
29
|
|
|
29
30
|
from invenio_app_ils.document_requests.indexer import DocumentRequestIndexer
|
|
30
31
|
from invenio_app_ils.documents.indexer import DocumentIndexer
|
|
@@ -41,6 +42,7 @@ from invenio_app_ils.literature.search import LiteratureSearch
|
|
|
41
42
|
from invenio_app_ils.locations.indexer import LocationIndexer
|
|
42
43
|
from invenio_app_ils.patrons.indexer import PatronIndexer
|
|
43
44
|
from invenio_app_ils.series.indexer import SeriesIndexer
|
|
45
|
+
from invenio_app_ils.stats.event_builders import ils_record_changed_event_builder
|
|
44
46
|
from invenio_app_ils.vocabularies.indexer import VocabularyIndexer
|
|
45
47
|
|
|
46
48
|
from .document_requests.api import (
|
|
@@ -49,9 +51,7 @@ from .document_requests.api import (
|
|
|
49
51
|
DOCUMENT_REQUEST_PID_TYPE,
|
|
50
52
|
DocumentRequest,
|
|
51
53
|
)
|
|
52
|
-
from .document_requests.notifications.api import
|
|
53
|
-
document_request_notification_filter,
|
|
54
|
-
)
|
|
54
|
+
from .document_requests.notifications.api import document_request_notification_filter
|
|
55
55
|
from .document_requests.search import DocumentRequestSearch
|
|
56
56
|
from .documents.api import (
|
|
57
57
|
DOCUMENT_PID_FETCHER,
|
|
@@ -60,12 +60,7 @@ from .documents.api import (
|
|
|
60
60
|
Document,
|
|
61
61
|
)
|
|
62
62
|
from .documents.search import DocumentSearch
|
|
63
|
-
from .eitems.api import
|
|
64
|
-
EITEM_PID_FETCHER,
|
|
65
|
-
EITEM_PID_MINTER,
|
|
66
|
-
EITEM_PID_TYPE,
|
|
67
|
-
EItem,
|
|
68
|
-
)
|
|
63
|
+
from .eitems.api import EITEM_PID_FETCHER, EITEM_PID_MINTER, EITEM_PID_TYPE, EItem
|
|
69
64
|
from .eitems.search import EItemSearch
|
|
70
65
|
from .facets import (
|
|
71
66
|
default_value_when_missing_filter,
|
|
@@ -98,18 +93,15 @@ from .patrons.api import (
|
|
|
98
93
|
)
|
|
99
94
|
from .patrons.search import PatronsSearch
|
|
100
95
|
from .permissions import (
|
|
101
|
-
|
|
96
|
+
PatronOwnerReadPermission,
|
|
102
97
|
authenticated_user_permission,
|
|
103
98
|
backoffice_permission,
|
|
99
|
+
backoffice_read_permission,
|
|
100
|
+
superuser_permission,
|
|
104
101
|
views_permissions_factory,
|
|
105
102
|
)
|
|
106
103
|
from .records.permissions import record_read_permission_factory
|
|
107
|
-
from .series.api import
|
|
108
|
-
SERIES_PID_FETCHER,
|
|
109
|
-
SERIES_PID_MINTER,
|
|
110
|
-
SERIES_PID_TYPE,
|
|
111
|
-
Series,
|
|
112
|
-
)
|
|
104
|
+
from .series.api import SERIES_PID_FETCHER, SERIES_PID_MINTER, SERIES_PID_TYPE, Series
|
|
113
105
|
from .series.search import SeriesSearch
|
|
114
106
|
from .views import UserInfoResource
|
|
115
107
|
from .vocabularies.api import (
|
|
@@ -137,7 +129,7 @@ DEBUG_TB_INTERCEPT_REDIRECTS = False
|
|
|
137
129
|
# Rate limiting
|
|
138
130
|
###############################################################################
|
|
139
131
|
#: Storage for rate limiter.
|
|
140
|
-
|
|
132
|
+
RATELIMIT_STORAGE_URI = "redis://localhost:6379/3"
|
|
141
133
|
#: Rate limit for logged in users.
|
|
142
134
|
RATELIMIT_AUTHENTICATED_USER = "5000 per hour;150 per minute"
|
|
143
135
|
#: Rate limit for non logged in users.
|
|
@@ -155,9 +147,13 @@ BABEL_DEFAULT_TIMEZONE = "Europe/Zurich"
|
|
|
155
147
|
# Notifications configuration
|
|
156
148
|
###############################################################################
|
|
157
149
|
# The backends to use when sending notifications.
|
|
158
|
-
ILS_NOTIFICATIONS_BACKENDS_BUILDER =
|
|
150
|
+
ILS_NOTIFICATIONS_BACKENDS_BUILDER = (
|
|
151
|
+
"invenio_app_ils.notifications.backends:notifications_backend_builder" # noqa
|
|
152
|
+
)
|
|
159
153
|
# Notification message creator
|
|
160
|
-
ILS_NOTIFICATIONS_MSG_BUILDER =
|
|
154
|
+
ILS_NOTIFICATIONS_MSG_BUILDER = (
|
|
155
|
+
"invenio_app_ils.notifications.messages:notification_msg_builder" # noqa
|
|
156
|
+
)
|
|
161
157
|
# Override default global common templates
|
|
162
158
|
ILS_NOTIFICATIONS_TEMPLATES = {"footer": "footer.html"}
|
|
163
159
|
# DOCUMENT REQUESTS
|
|
@@ -166,8 +162,7 @@ ILS_NOTIFICATIONS_MSG_BUILDER_DOCUMENT_REQUEST = "invenio_app_ils.document_reque
|
|
|
166
162
|
# Override default document requests templates
|
|
167
163
|
ILS_NOTIFICATIONS_TEMPLATES_DOCUMENT_REQUEST = {}
|
|
168
164
|
# Function to select and filter which notifications should be sent
|
|
169
|
-
ILS_NOTIFICATIONS_FILTER_DOCUMENT_REQUEST =
|
|
170
|
-
document_request_notification_filter
|
|
165
|
+
ILS_NOTIFICATIONS_FILTER_DOCUMENT_REQUEST = document_request_notification_filter
|
|
171
166
|
###############################################################################
|
|
172
167
|
# Email configuration
|
|
173
168
|
###############################################################################
|
|
@@ -230,7 +225,9 @@ CELERY_BEAT_SCHEDULE = {
|
|
|
230
225
|
"schedule": crontab(minute=0, hour=0), # every day, midnight
|
|
231
226
|
},
|
|
232
227
|
"cancel_expired_loan": {
|
|
233
|
-
"task":
|
|
228
|
+
"task": (
|
|
229
|
+
"invenio_app_ils.circulation.tasks.cancel_expired_loan_requests"
|
|
230
|
+
), # noqa
|
|
234
231
|
"schedule": crontab(minute=0, hour=1), # every day, 1am
|
|
235
232
|
},
|
|
236
233
|
"send_overdue_loan_reminders": {
|
|
@@ -240,15 +237,25 @@ CELERY_BEAT_SCHEDULE = {
|
|
|
240
237
|
"stats-process-events": {
|
|
241
238
|
"task": "invenio_stats.tasks.process_events",
|
|
242
239
|
"schedule": timedelta(minutes=30),
|
|
243
|
-
"args": [
|
|
240
|
+
"args": [
|
|
241
|
+
(
|
|
242
|
+
"record-view",
|
|
243
|
+
"file-download",
|
|
244
|
+
"ils-record-changes-updates",
|
|
245
|
+
"ils-record-changes-insertions",
|
|
246
|
+
"ils-record-changes-deletions",
|
|
247
|
+
)
|
|
248
|
+
],
|
|
244
249
|
},
|
|
245
250
|
"stats-aggregate-events": {
|
|
246
251
|
"task": "invenio_stats.tasks.aggregate_events",
|
|
247
252
|
"schedule": timedelta(hours=3),
|
|
248
|
-
"args": [("record-view-agg", "file-download-agg")],
|
|
253
|
+
"args": [("record-view-agg", "file-download-agg", "ils-record-changes-agg")],
|
|
249
254
|
},
|
|
250
255
|
"clean_locations_past_closures_exceptions": {
|
|
251
|
-
"task":
|
|
256
|
+
"task": (
|
|
257
|
+
"invenio_app_ils.closures.tasks.clean_locations_past_closures_exceptions"
|
|
258
|
+
), # noqa
|
|
252
259
|
"schedule": crontab(
|
|
253
260
|
0, 0, day_of_month=31, month_of_year=1
|
|
254
261
|
), # January 31st of every year
|
|
@@ -284,7 +291,7 @@ REST_CSRF_ENABLED = True
|
|
|
284
291
|
###############################################################################
|
|
285
292
|
REST_ENABLE_CORS = True
|
|
286
293
|
CORS_SEND_WILDCARD = False
|
|
287
|
-
CORS_SUPPORTS_CREDENTIALS =
|
|
294
|
+
CORS_SUPPORTS_CREDENTIALS = True
|
|
288
295
|
|
|
289
296
|
###############################################################################
|
|
290
297
|
# Flask configuration
|
|
@@ -304,7 +311,7 @@ SESSION_COOKIE_SAMESITE = "Lax"
|
|
|
304
311
|
#: provided, the allowed hosts variable is set to localhost. In production it
|
|
305
312
|
#: should be set to the correct host and it is strongly recommended to only
|
|
306
313
|
#: route correct hosts to the application.
|
|
307
|
-
|
|
314
|
+
TRUSTED_HOSTS = ["localhost", "127.0.0.1"]
|
|
308
315
|
|
|
309
316
|
#: Single Page Application host and routes, useful in templates/emails
|
|
310
317
|
SPA_HOST = "https://127.0.0.1:3000"
|
|
@@ -324,23 +331,13 @@ OAISERVER_ID_PREFIX = "oai:invenio-app-ils:"
|
|
|
324
331
|
###############################################################################
|
|
325
332
|
# RECORDS REST
|
|
326
333
|
###############################################################################
|
|
327
|
-
_DOCID_CONVERTER = (
|
|
328
|
-
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
'pid(pitmid, record_class="invenio_app_ils.items.api:Item")'
|
|
332
|
-
)
|
|
333
|
-
_EITMID_CONVERTER = (
|
|
334
|
-
'pid(eitmid, record_class="invenio_app_ils.eitems.api:EItem")'
|
|
335
|
-
)
|
|
336
|
-
_LOCID_CONVERTER = (
|
|
337
|
-
'pid(locid, record_class="invenio_app_ils.locations.api:Location")'
|
|
338
|
-
)
|
|
334
|
+
_DOCID_CONVERTER = 'pid(docid, record_class="invenio_app_ils.documents.api:Document")'
|
|
335
|
+
_PITMID_CONVERTER = 'pid(pitmid, record_class="invenio_app_ils.items.api:Item")'
|
|
336
|
+
_EITMID_CONVERTER = 'pid(eitmid, record_class="invenio_app_ils.eitems.api:EItem")'
|
|
337
|
+
_LOCID_CONVERTER = 'pid(locid, record_class="invenio_app_ils.locations.api:Location")'
|
|
339
338
|
_ILOCID_CONVERTER = 'pid(ilocid, record_class="invenio_app_ils.internal_locations.api:InternalLocation")' # noqa
|
|
340
339
|
_DREQID_CONVERTER = 'pid(dreqid, record_class="invenio_app_ils.document_requests.api:DocumentRequest")' # noqa
|
|
341
|
-
_SERID_CONVERTER = (
|
|
342
|
-
'pid(serid, record_class="invenio_app_ils.series.api:Series")'
|
|
343
|
-
)
|
|
340
|
+
_SERID_CONVERTER = 'pid(serid, record_class="invenio_app_ils.series.api:Series")'
|
|
344
341
|
|
|
345
342
|
RECORDS_REST_MAX_RESULT_WINDOW = 10000
|
|
346
343
|
RECORDS_REST_VOCAB_MAX_RESULT_WINDOW = 500
|
|
@@ -358,9 +355,7 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
358
355
|
indexer_class=DocumentIndexer,
|
|
359
356
|
search_factory_imp="invenio_app_ils.search_permissions:ils_search_factory", # noqa
|
|
360
357
|
record_loaders={
|
|
361
|
-
"application/json":
|
|
362
|
-
"invenio_app_ils.documents.loaders:document_loader"
|
|
363
|
-
)
|
|
358
|
+
"application/json": "invenio_app_ils.documents.loaders:document_loader"
|
|
364
359
|
},
|
|
365
360
|
record_serializers={
|
|
366
361
|
"application/json": (
|
|
@@ -368,12 +363,8 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
368
363
|
)
|
|
369
364
|
},
|
|
370
365
|
search_serializers={
|
|
371
|
-
"application/json":
|
|
372
|
-
|
|
373
|
-
),
|
|
374
|
-
"text/csv": (
|
|
375
|
-
"invenio_app_ils.literature.serializers:csv_v1_search"
|
|
376
|
-
),
|
|
366
|
+
"application/json": "invenio_app_ils.literature.serializers:json_v1_search",
|
|
367
|
+
"text/csv": "invenio_app_ils.literature.serializers:csv_v1_search",
|
|
377
368
|
},
|
|
378
369
|
search_serializers_aliases={
|
|
379
370
|
"csv": "text/csv",
|
|
@@ -401,14 +392,10 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
401
392
|
"application/json": "invenio_app_ils.items.loaders:item_loader"
|
|
402
393
|
},
|
|
403
394
|
record_serializers={
|
|
404
|
-
"application/json":
|
|
405
|
-
"invenio_app_ils.items.serializers:json_v1_response"
|
|
406
|
-
)
|
|
395
|
+
"application/json": "invenio_app_ils.items.serializers:json_v1_response"
|
|
407
396
|
},
|
|
408
397
|
search_serializers={
|
|
409
|
-
"application/json":
|
|
410
|
-
"invenio_app_ils.items.serializers:json_v1_search"
|
|
411
|
-
),
|
|
398
|
+
"application/json": "invenio_app_ils.items.serializers:json_v1_search",
|
|
412
399
|
"text/csv": "invenio_app_ils.items.serializers:csv_v1_search",
|
|
413
400
|
},
|
|
414
401
|
search_serializers_aliases={
|
|
@@ -420,8 +407,8 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
420
407
|
default_media_type="application/json",
|
|
421
408
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
422
409
|
error_handlers=dict(),
|
|
423
|
-
read_permission_factory_imp=
|
|
424
|
-
list_permission_factory_imp=
|
|
410
|
+
read_permission_factory_imp=backoffice_read_permission,
|
|
411
|
+
list_permission_factory_imp=backoffice_read_permission,
|
|
425
412
|
create_permission_factory_imp=backoffice_permission,
|
|
426
413
|
update_permission_factory_imp=backoffice_permission,
|
|
427
414
|
delete_permission_factory_imp=backoffice_permission,
|
|
@@ -437,14 +424,10 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
437
424
|
"application/json": "invenio_app_ils.eitems.loaders:eitem_loader"
|
|
438
425
|
},
|
|
439
426
|
record_serializers={
|
|
440
|
-
"application/json":
|
|
441
|
-
"invenio_app_ils.records.serializers:json_v1_response"
|
|
442
|
-
)
|
|
427
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_response"
|
|
443
428
|
},
|
|
444
429
|
search_serializers={
|
|
445
|
-
"application/json":
|
|
446
|
-
"invenio_app_ils.records.serializers:json_v1_search"
|
|
447
|
-
),
|
|
430
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_search",
|
|
448
431
|
"text/csv": "invenio_app_ils.records.serializers:csv_v1_search",
|
|
449
432
|
},
|
|
450
433
|
search_serializers_aliases={
|
|
@@ -456,8 +439,8 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
456
439
|
default_media_type="application/json",
|
|
457
440
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
458
441
|
error_handlers=dict(),
|
|
459
|
-
read_permission_factory_imp=
|
|
460
|
-
list_permission_factory_imp=
|
|
442
|
+
read_permission_factory_imp=backoffice_read_permission,
|
|
443
|
+
list_permission_factory_imp=backoffice_read_permission,
|
|
461
444
|
create_permission_factory_imp=backoffice_permission,
|
|
462
445
|
update_permission_factory_imp=backoffice_permission,
|
|
463
446
|
delete_permission_factory_imp=backoffice_permission,
|
|
@@ -470,19 +453,13 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
470
453
|
record_class=Location,
|
|
471
454
|
indexer_class=LocationIndexer,
|
|
472
455
|
record_loaders={
|
|
473
|
-
"application/json":
|
|
474
|
-
"invenio_app_ils.locations.loaders:location_loader"
|
|
475
|
-
)
|
|
456
|
+
"application/json": "invenio_app_ils.locations.loaders:location_loader"
|
|
476
457
|
},
|
|
477
458
|
record_serializers={
|
|
478
|
-
"application/json":
|
|
479
|
-
"invenio_app_ils.records.serializers:json_v1_response"
|
|
480
|
-
)
|
|
459
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_response"
|
|
481
460
|
},
|
|
482
461
|
search_serializers={
|
|
483
|
-
"application/json":
|
|
484
|
-
"invenio_app_ils.records.serializers:json_v1_search"
|
|
485
|
-
)
|
|
462
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_search"
|
|
486
463
|
},
|
|
487
464
|
search_serializers_aliases={
|
|
488
465
|
"json": "application/json",
|
|
@@ -507,9 +484,7 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
507
484
|
indexer_class=SeriesIndexer,
|
|
508
485
|
search_factory_imp="invenio_app_ils.search_permissions:ils_search_factory", # noqa
|
|
509
486
|
record_loaders={
|
|
510
|
-
"application/json":
|
|
511
|
-
"invenio_app_ils.series.loaders:series_loader"
|
|
512
|
-
)
|
|
487
|
+
"application/json": "invenio_app_ils.series.loaders:series_loader"
|
|
513
488
|
},
|
|
514
489
|
record_serializers={
|
|
515
490
|
"application/json": (
|
|
@@ -517,12 +492,8 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
517
492
|
)
|
|
518
493
|
},
|
|
519
494
|
search_serializers={
|
|
520
|
-
"application/json":
|
|
521
|
-
|
|
522
|
-
),
|
|
523
|
-
"text/csv": (
|
|
524
|
-
"invenio_app_ils.literature.serializers:csv_v1_search"
|
|
525
|
-
),
|
|
495
|
+
"application/json": "invenio_app_ils.literature.serializers:json_v1_search",
|
|
496
|
+
"text/csv": "invenio_app_ils.literature.serializers:csv_v1_search",
|
|
526
497
|
},
|
|
527
498
|
search_serializers_aliases={
|
|
528
499
|
"csv": "text/csv",
|
|
@@ -547,32 +518,24 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
547
518
|
record_class=InternalLocation,
|
|
548
519
|
indexer_class=InternalLocationIndexer,
|
|
549
520
|
record_loaders={
|
|
550
|
-
"application/json":
|
|
551
|
-
"invenio_app_ils.internal_locations.loaders:internal_location_loader" # noqa
|
|
552
|
-
)
|
|
521
|
+
"application/json": "invenio_app_ils.internal_locations.loaders:internal_location_loader" # noqa
|
|
553
522
|
},
|
|
554
523
|
record_serializers={
|
|
555
|
-
"application/json":
|
|
556
|
-
"invenio_app_ils.records.serializers:json_v1_response"
|
|
557
|
-
)
|
|
524
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_response"
|
|
558
525
|
},
|
|
559
526
|
search_serializers={
|
|
560
|
-
"application/json":
|
|
561
|
-
"invenio_records_rest.serializers:json_v1_search"
|
|
562
|
-
)
|
|
527
|
+
"application/json": "invenio_records_rest.serializers:json_v1_search"
|
|
563
528
|
},
|
|
564
529
|
search_serializers_aliases={
|
|
565
530
|
"json": "application/json",
|
|
566
531
|
},
|
|
567
532
|
list_route="/internal-locations/",
|
|
568
|
-
item_route="/internal-locations/<{0}:pid_value>".format(
|
|
569
|
-
_ILOCID_CONVERTER
|
|
570
|
-
),
|
|
533
|
+
item_route="/internal-locations/<{0}:pid_value>".format(_ILOCID_CONVERTER),
|
|
571
534
|
default_media_type="application/json",
|
|
572
535
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
573
536
|
error_handlers=dict(),
|
|
574
|
-
read_permission_factory_imp=
|
|
575
|
-
list_permission_factory_imp=
|
|
537
|
+
read_permission_factory_imp=backoffice_read_permission,
|
|
538
|
+
list_permission_factory_imp=backoffice_read_permission,
|
|
576
539
|
create_permission_factory_imp=backoffice_permission,
|
|
577
540
|
update_permission_factory_imp=backoffice_permission,
|
|
578
541
|
delete_permission_factory_imp=backoffice_permission,
|
|
@@ -585,14 +548,10 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
585
548
|
record_class=Patron,
|
|
586
549
|
indexer_class=PatronIndexer,
|
|
587
550
|
record_serializers={
|
|
588
|
-
"application/json":
|
|
589
|
-
"invenio_records_rest.serializers:json_v1_response"
|
|
590
|
-
)
|
|
551
|
+
"application/json": "invenio_records_rest.serializers:json_v1_response"
|
|
591
552
|
},
|
|
592
553
|
search_serializers={
|
|
593
|
-
"application/json":
|
|
594
|
-
"invenio_app_ils.records.serializers:json_v1_search"
|
|
595
|
-
),
|
|
554
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_search",
|
|
596
555
|
"text/csv": "invenio_app_ils.records.serializers:csv_v1_search",
|
|
597
556
|
},
|
|
598
557
|
search_serializers_aliases={
|
|
@@ -605,7 +564,7 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
605
564
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
606
565
|
error_handlers=dict(),
|
|
607
566
|
read_permission_factory_imp=deny_all,
|
|
608
|
-
list_permission_factory_imp=
|
|
567
|
+
list_permission_factory_imp=backoffice_read_permission,
|
|
609
568
|
create_permission_factory_imp=deny_all,
|
|
610
569
|
update_permission_factory_imp=deny_all,
|
|
611
570
|
delete_permission_factory_imp=deny_all,
|
|
@@ -619,19 +578,13 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
619
578
|
indexer_class=DocumentRequestIndexer,
|
|
620
579
|
search_factory_imp="invenio_app_ils.search_permissions:search_factory_filter_by_patron", # noqa
|
|
621
580
|
record_loaders={
|
|
622
|
-
"application/json":
|
|
623
|
-
"invenio_app_ils.document_requests.loaders:document_request_loader" # noqa
|
|
624
|
-
)
|
|
581
|
+
"application/json": "invenio_app_ils.document_requests.loaders:document_request_loader" # noqa
|
|
625
582
|
},
|
|
626
583
|
record_serializers={
|
|
627
|
-
"application/json":
|
|
628
|
-
"invenio_app_ils.records.serializers:json_v1_response"
|
|
629
|
-
)
|
|
584
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_response"
|
|
630
585
|
},
|
|
631
586
|
search_serializers={
|
|
632
|
-
"application/json":
|
|
633
|
-
"invenio_app_ils.records.serializers:json_v1_search"
|
|
634
|
-
),
|
|
587
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_search",
|
|
635
588
|
"text/csv": "invenio_app_ils.records.serializers:csv_v1_search",
|
|
636
589
|
},
|
|
637
590
|
search_serializers_aliases={
|
|
@@ -639,13 +592,11 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
639
592
|
"json": "application/json",
|
|
640
593
|
},
|
|
641
594
|
list_route="/document-requests/",
|
|
642
|
-
item_route="/document-requests/<{0}:pid_value>".format(
|
|
643
|
-
_DREQID_CONVERTER
|
|
644
|
-
),
|
|
595
|
+
item_route="/document-requests/<{0}:pid_value>".format(_DREQID_CONVERTER),
|
|
645
596
|
default_media_type="application/json",
|
|
646
597
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
647
598
|
error_handlers=dict(),
|
|
648
|
-
read_permission_factory_imp=
|
|
599
|
+
read_permission_factory_imp=PatronOwnerReadPermission,
|
|
649
600
|
# auth via search_factory
|
|
650
601
|
list_permission_factory_imp=authenticated_user_permission,
|
|
651
602
|
create_permission_factory_imp=authenticated_user_permission,
|
|
@@ -660,29 +611,23 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
660
611
|
indexer_class=VocabularyIndexer,
|
|
661
612
|
record_class=Vocabulary,
|
|
662
613
|
record_serializers={
|
|
663
|
-
"application/json":
|
|
664
|
-
"invenio_app_ils.records.serializers:json_v1_response"
|
|
665
|
-
)
|
|
614
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_response"
|
|
666
615
|
},
|
|
667
616
|
search_serializers={
|
|
668
|
-
"application/json":
|
|
669
|
-
"invenio_app_ils.records.serializers:json_v1_search"
|
|
670
|
-
),
|
|
617
|
+
"application/json": "invenio_app_ils.records.serializers:json_v1_search",
|
|
671
618
|
"text/csv": "invenio_app_ils.records.serializers:csv_v1_search",
|
|
672
619
|
},
|
|
673
620
|
search_serializers_aliases={
|
|
674
621
|
"csv": "text/csv",
|
|
675
622
|
"json": "application/json",
|
|
676
623
|
},
|
|
677
|
-
item_route="/vocabularies/<pid({}):pid_value>".format(
|
|
678
|
-
VOCABULARY_PID_TYPE
|
|
679
|
-
),
|
|
624
|
+
item_route="/vocabularies/<pid({}):pid_value>".format(VOCABULARY_PID_TYPE),
|
|
680
625
|
list_route="/vocabularies/",
|
|
681
626
|
default_media_type="application/json",
|
|
682
627
|
max_result_window=RECORDS_REST_VOCAB_MAX_RESULT_WINDOW,
|
|
683
628
|
error_handlers=dict(),
|
|
684
629
|
read_permission_factory_imp=deny_all,
|
|
685
|
-
list_permission_factory_imp=
|
|
630
|
+
list_permission_factory_imp=allow_all,
|
|
686
631
|
create_permission_factory_imp=deny_all,
|
|
687
632
|
update_permission_factory_imp=deny_all,
|
|
688
633
|
delete_permission_factory_imp=deny_all,
|
|
@@ -701,20 +646,14 @@ RECORDS_REST_ENDPOINTS = dict(
|
|
|
701
646
|
)
|
|
702
647
|
},
|
|
703
648
|
search_serializers={
|
|
704
|
-
"application/json":
|
|
705
|
-
|
|
706
|
-
),
|
|
707
|
-
"text/csv": (
|
|
708
|
-
"invenio_app_ils.literature.serializers:csv_v1_search"
|
|
709
|
-
),
|
|
649
|
+
"application/json": "invenio_app_ils.literature.serializers:json_v1_search",
|
|
650
|
+
"text/csv": "invenio_app_ils.literature.serializers:csv_v1_search",
|
|
710
651
|
},
|
|
711
652
|
search_serializers_aliases={
|
|
712
653
|
"csv": "text/csv",
|
|
713
654
|
"json": "application/json",
|
|
714
655
|
},
|
|
715
|
-
item_route="/literature/<pid({}):pid_value>".format(
|
|
716
|
-
LITERATURE_PID_TYPE
|
|
717
|
-
),
|
|
656
|
+
item_route="/literature/<pid({}):pid_value>".format(LITERATURE_PID_TYPE),
|
|
718
657
|
list_route="/literature/",
|
|
719
658
|
default_media_type="application/json",
|
|
720
659
|
max_result_window=RECORDS_REST_MAX_RESULT_WINDOW,
|
|
@@ -902,26 +841,22 @@ RECORDS_REST_FACETS = dict(
|
|
|
902
841
|
eitems=dict(
|
|
903
842
|
aggs=dict(
|
|
904
843
|
access=dict(terms=dict(field="open_access")),
|
|
844
|
+
eitem_type=dict(terms=dict(field="eitem_type")),
|
|
905
845
|
has_files=dict(
|
|
906
846
|
filters=dict(
|
|
907
847
|
filters=dict(
|
|
908
848
|
has_files=dict(exists=dict(field="files.file_id")),
|
|
909
849
|
no_files=dict(
|
|
910
|
-
bool=dict(
|
|
911
|
-
must_not=dict(
|
|
912
|
-
exists=dict(field="files.file_id")
|
|
913
|
-
)
|
|
914
|
-
)
|
|
850
|
+
bool=dict(must_not=dict(exists=dict(field="files.file_id")))
|
|
915
851
|
),
|
|
916
852
|
)
|
|
917
853
|
)
|
|
918
854
|
),
|
|
919
855
|
),
|
|
920
856
|
post_filters=dict(
|
|
857
|
+
eitem_type=terms_filter("eitem_type"),
|
|
921
858
|
access=terms_filter("open_access"),
|
|
922
|
-
has_files=exists_value_filter(
|
|
923
|
-
"files.file_id", filter_value="has_files"
|
|
924
|
-
),
|
|
859
|
+
has_files=exists_value_filter("files.file_id", filter_value="has_files"),
|
|
925
860
|
),
|
|
926
861
|
),
|
|
927
862
|
series=dict( # SeriesSearch.Meta.index
|
|
@@ -942,12 +877,16 @@ RECORDS_REST_FACETS = dict(
|
|
|
942
877
|
|
|
943
878
|
# ILS
|
|
944
879
|
# ===
|
|
880
|
+
|
|
945
881
|
ILS_VIEWS_PERMISSIONS_FACTORY = views_permissions_factory
|
|
946
882
|
"""Permissions factory for ILS views to handle all ILS actions."""
|
|
947
883
|
|
|
948
884
|
ILS_INDEXER_TASK_DELAY = timedelta(seconds=2)
|
|
949
885
|
"""Trigger delay for celery tasks to index referenced records."""
|
|
950
886
|
|
|
887
|
+
INDEXER_DEFAULT_DOC_TYPE = None
|
|
888
|
+
"""Set deprecated doc type to none."""
|
|
889
|
+
|
|
951
890
|
# The HTML tags allowed with invenio_records_rest.schemas.fields.sanitizedhtml
|
|
952
891
|
ALLOWED_HTML_TAGS = []
|
|
953
892
|
|
|
@@ -955,7 +894,7 @@ ALLOWED_HTML_TAGS = []
|
|
|
955
894
|
# =====
|
|
956
895
|
STATS_EVENTS = {
|
|
957
896
|
"file-download": {
|
|
958
|
-
"signal": "
|
|
897
|
+
"signal": "invenio_app_ils.signals.file_downloaded",
|
|
959
898
|
"templates": "invenio_app_ils.stats.file_download",
|
|
960
899
|
"event_builders": [
|
|
961
900
|
"invenio_app_ils.eitems.api:eitem_event_builder",
|
|
@@ -993,6 +932,57 @@ STATS_EVENTS = {
|
|
|
993
932
|
"suffix": "%Y-%m",
|
|
994
933
|
},
|
|
995
934
|
},
|
|
935
|
+
"ils-record-changes-updates": {
|
|
936
|
+
"signal": "invenio_records.signals.after_record_update",
|
|
937
|
+
"templates": "invenio_app_ils.stats.templates.events.ils_record_changes",
|
|
938
|
+
"event_builders": [
|
|
939
|
+
partial(ils_record_changed_event_builder, method="update"),
|
|
940
|
+
"invenio_app_ils.stats.event_builders.add_librarian_user_id_to_event",
|
|
941
|
+
"invenio_app_ils.stats.event_builders.add_record_pid_to_event",
|
|
942
|
+
],
|
|
943
|
+
"cls": EventsIndexer,
|
|
944
|
+
"params": {
|
|
945
|
+
"preprocessors": [
|
|
946
|
+
"invenio_app_ils.stats.processors.add_record_change_ids",
|
|
947
|
+
],
|
|
948
|
+
"double_click_window": 0,
|
|
949
|
+
"suffix": "%Y",
|
|
950
|
+
},
|
|
951
|
+
},
|
|
952
|
+
"ils-record-changes-insertions": {
|
|
953
|
+
"signal": "invenio_records.signals.after_record_insert",
|
|
954
|
+
"templates": "invenio_app_ils.stats.templates.events.ils_record_changes",
|
|
955
|
+
"event_builders": [
|
|
956
|
+
partial(ils_record_changed_event_builder, method="insert"),
|
|
957
|
+
"invenio_app_ils.stats.event_builders.add_librarian_user_id_to_event",
|
|
958
|
+
"invenio_app_ils.stats.event_builders.add_record_pid_to_event",
|
|
959
|
+
],
|
|
960
|
+
"cls": EventsIndexer,
|
|
961
|
+
"params": {
|
|
962
|
+
"preprocessors": [
|
|
963
|
+
"invenio_app_ils.stats.processors.add_record_change_ids",
|
|
964
|
+
],
|
|
965
|
+
"double_click_window": 0,
|
|
966
|
+
"suffix": "%Y",
|
|
967
|
+
},
|
|
968
|
+
},
|
|
969
|
+
"ils-record-changes-deletions": {
|
|
970
|
+
"signal": "invenio_records.signals.after_record_delete",
|
|
971
|
+
"templates": "invenio_app_ils.stats.templates.events.ils_record_changes",
|
|
972
|
+
"event_builders": [
|
|
973
|
+
partial(ils_record_changed_event_builder, method="delete"),
|
|
974
|
+
"invenio_app_ils.stats.event_builders.add_librarian_user_id_to_event",
|
|
975
|
+
"invenio_app_ils.stats.event_builders.add_record_pid_to_event",
|
|
976
|
+
],
|
|
977
|
+
"cls": EventsIndexer,
|
|
978
|
+
"params": {
|
|
979
|
+
"preprocessors": [
|
|
980
|
+
"invenio_app_ils.stats.processors.add_record_change_ids",
|
|
981
|
+
],
|
|
982
|
+
"double_click_window": 0,
|
|
983
|
+
"suffix": "%Y",
|
|
984
|
+
},
|
|
985
|
+
},
|
|
996
986
|
}
|
|
997
987
|
|
|
998
988
|
STATS_AGGREGATIONS = {
|
|
@@ -1039,6 +1029,19 @@ STATS_AGGREGATIONS = {
|
|
|
1039
1029
|
),
|
|
1040
1030
|
),
|
|
1041
1031
|
),
|
|
1032
|
+
"ils-record-changes-agg": dict(
|
|
1033
|
+
templates="invenio_app_ils.stats.templates.aggregations.ils_record_changes",
|
|
1034
|
+
cls=StatAggregator,
|
|
1035
|
+
params=dict(
|
|
1036
|
+
event="ils-record-changes",
|
|
1037
|
+
field="aggregation_id",
|
|
1038
|
+
interval="day",
|
|
1039
|
+
index_interval="year",
|
|
1040
|
+
copy_fields=dict(pid_type="pid_type", method="method", user_id="user_id"),
|
|
1041
|
+
metric_fields=dict(),
|
|
1042
|
+
query_modifiers=[],
|
|
1043
|
+
),
|
|
1044
|
+
),
|
|
1042
1045
|
}
|
|
1043
1046
|
|
|
1044
1047
|
STATS_QUERIES = {
|
|
@@ -1075,6 +1078,44 @@ STATS_QUERIES = {
|
|
|
1075
1078
|
),
|
|
1076
1079
|
),
|
|
1077
1080
|
),
|
|
1081
|
+
"ils-record-changes": dict(
|
|
1082
|
+
cls=DateHistogramQuery,
|
|
1083
|
+
permission_factory=backoffice_read_permission,
|
|
1084
|
+
params=dict(
|
|
1085
|
+
index="stats-ils-record-changes",
|
|
1086
|
+
copy_fields=dict(
|
|
1087
|
+
pid_type="pid_type",
|
|
1088
|
+
method="method",
|
|
1089
|
+
),
|
|
1090
|
+
required_filters=dict(
|
|
1091
|
+
pid_type="pid_type",
|
|
1092
|
+
method="method",
|
|
1093
|
+
),
|
|
1094
|
+
metric_fields=dict(
|
|
1095
|
+
count=("sum", "count", {}),
|
|
1096
|
+
),
|
|
1097
|
+
),
|
|
1098
|
+
),
|
|
1099
|
+
"ils-record-changes-per-user": dict(
|
|
1100
|
+
cls=ESTermsQuery,
|
|
1101
|
+
permission_factory=superuser_permission,
|
|
1102
|
+
params=dict(
|
|
1103
|
+
index="stats-ils-record-changes",
|
|
1104
|
+
copy_fields=dict(
|
|
1105
|
+
pid_type="pid_type",
|
|
1106
|
+
method="method",
|
|
1107
|
+
user_id="user_id",
|
|
1108
|
+
),
|
|
1109
|
+
required_filters=dict(
|
|
1110
|
+
pid_type="pid_type",
|
|
1111
|
+
method="method",
|
|
1112
|
+
),
|
|
1113
|
+
metric_fields=dict(
|
|
1114
|
+
count=("sum", "count", {}),
|
|
1115
|
+
),
|
|
1116
|
+
aggregated_fields=["user_id"],
|
|
1117
|
+
),
|
|
1118
|
+
),
|
|
1078
1119
|
}
|
|
1079
1120
|
|
|
1080
1121
|
# List of available vocabularies
|
|
@@ -1113,7 +1154,9 @@ ILS_VOCABULARIES = [
|
|
|
1113
1154
|
|
|
1114
1155
|
ILS_VOCABULARY_SOURCES = {
|
|
1115
1156
|
"json": "invenio_app_ils.vocabularies.sources:json_source",
|
|
1116
|
-
"opendefinition":
|
|
1157
|
+
"opendefinition": (
|
|
1158
|
+
"invenio_app_ils.vocabularies.sources:opendefinition_source"
|
|
1159
|
+
), # noqa
|
|
1117
1160
|
}
|
|
1118
1161
|
|
|
1119
1162
|
OPENDEFINITION_JSONRESOLVER_HOST = "inveniosoftware.org"
|
|
@@ -1143,3 +1186,17 @@ ILS_PATRON_ANONYMOUS_CLASS = AnonymousPatron
|
|
|
1143
1186
|
ILS_PATRON_SYSTEM_AGENT_CLASS = SystemAgent
|
|
1144
1187
|
|
|
1145
1188
|
DB_VERSIONING_USER_MODEL = None
|
|
1189
|
+
|
|
1190
|
+
# Feature Toggles
|
|
1191
|
+
ILS_SELF_CHECKOUT_ENABLED = False
|
|
1192
|
+
|
|
1193
|
+
# Use default frontpage
|
|
1194
|
+
THEME_FRONTPAGE = False
|
|
1195
|
+
|
|
1196
|
+
# Default template to render.
|
|
1197
|
+
PAGES_DEFAULT_TEMPLATE = "invenio_pages/default.html"
|
|
1198
|
+
# default app theme
|
|
1199
|
+
APP_THEME = ["semantic-ui"]
|
|
1200
|
+
|
|
1201
|
+
# Site name.
|
|
1202
|
+
THEME_SITENAME = _("InvenioILS")
|