dmart 1.4.40.post8__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.
- dmart/__init__.py +7 -0
- dmart/alembic/README +1 -0
- dmart/alembic/__init__.py +0 -0
- dmart/alembic/env.py +91 -0
- dmart/alembic/notes.txt +11 -0
- dmart/alembic/script.py.mako +28 -0
- dmart/alembic/scripts/__init__.py +0 -0
- dmart/alembic/scripts/calculate_checksums.py +77 -0
- dmart/alembic/scripts/migration_f7a4949eed19.py +28 -0
- dmart/alembic/versions/0f3d2b1a7c21_add_authz_materialized_views.py +87 -0
- dmart/alembic/versions/10d2041b94d4_last_checksum_history.py +62 -0
- dmart/alembic/versions/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.py +33 -0
- dmart/alembic/versions/26bfe19b49d4_rm_failedloginattempts.py +42 -0
- dmart/alembic/versions/3c8bca2219cc_add_otp_table.py +38 -0
- dmart/alembic/versions/6675fd9dfe42_remove_unique_from_sessions_table.py +36 -0
- dmart/alembic/versions/71bc1df82e6a_adding_user_last_login_at.py +43 -0
- dmart/alembic/versions/74288ccbd3b5_initial.py +264 -0
- dmart/alembic/versions/7520a89a8467_rm_activesession_table.py +39 -0
- dmart/alembic/versions/848b623755a4_make_created_nd_updated_at_required.py +138 -0
- dmart/alembic/versions/8640dcbebf85_add_notes_to_users.py +32 -0
- dmart/alembic/versions/91c94250232a_adding_fk_on_owner_shortname.py +104 -0
- dmart/alembic/versions/98ecd6f56f9a_ext_meta_with_owner_group_shortname.py +66 -0
- dmart/alembic/versions/9aae9138c4ef_indexing_created_at_updated_at.py +80 -0
- dmart/alembic/versions/__init__.py +0 -0
- dmart/alembic/versions/b53f916b3f6d_json_to_jsonb.py +492 -0
- dmart/alembic/versions/eb5f1ec65156_adding_user_locked_to_device.py +36 -0
- dmart/alembic/versions/f7a4949eed19_adding_query_policies_to_meta.py +60 -0
- dmart/alembic.ini +117 -0
- dmart/api/__init__.py +0 -0
- dmart/api/info/__init__.py +0 -0
- dmart/api/info/router.py +109 -0
- dmart/api/managed/__init__.py +0 -0
- dmart/api/managed/router.py +1541 -0
- dmart/api/managed/utils.py +1879 -0
- dmart/api/public/__init__.py +0 -0
- dmart/api/public/router.py +758 -0
- dmart/api/qr/__init__.py +0 -0
- dmart/api/qr/router.py +108 -0
- dmart/api/user/__init__.py +0 -0
- dmart/api/user/model/__init__.py +0 -0
- dmart/api/user/model/errors.py +14 -0
- dmart/api/user/model/requests.py +165 -0
- dmart/api/user/model/responses.py +11 -0
- dmart/api/user/router.py +1413 -0
- dmart/api/user/service.py +270 -0
- dmart/bundler.py +52 -0
- dmart/cli.py +1133 -0
- dmart/config/__init__.py +0 -0
- dmart/config/channels.json +11 -0
- dmart/config/notification.json +17 -0
- dmart/config.env.sample +27 -0
- dmart/config.ini.sample +7 -0
- dmart/conftest.py +13 -0
- dmart/curl.sh +196 -0
- dmart/cxb/__init__.py +0 -0
- dmart/cxb/assets/@codemirror-Rn7_6DkE.js +10 -0
- dmart/cxb/assets/@edraj-CS4NwVbD.js +1 -0
- dmart/cxb/assets/@floating-ui-BwwcF-xh.js +1 -0
- dmart/cxb/assets/@formatjs-yKEsAtjs.js +1 -0
- dmart/cxb/assets/@fortawesome-DRW1UCdr.js +9 -0
- dmart/cxb/assets/@jsonquerylang-laKNoFFq.js +12 -0
- dmart/cxb/assets/@lezer-za4Q-8Ew.js +1 -0
- dmart/cxb/assets/@marijn-DXwl3gUT.js +1 -0
- dmart/cxb/assets/@popperjs-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/@replit--ERk53eB.js +1 -0
- dmart/cxb/assets/@roxi-CGMFK4i8.js +6 -0
- dmart/cxb/assets/@typewriter-cCzskkIv.js +17 -0
- dmart/cxb/assets/@zerodevx-BlBZjKxu.js +1 -0
- dmart/cxb/assets/@zerodevx-CVEpe6WZ.css +1 -0
- dmart/cxb/assets/BreadCrumbLite-DAhOx38v.js +1 -0
- dmart/cxb/assets/EntryRenderer-CCqV8Rkg.js +32 -0
- dmart/cxb/assets/EntryRenderer-DXytdFp9.css +1 -0
- dmart/cxb/assets/ListView-BQelo7vZ.js +16 -0
- dmart/cxb/assets/ListView-U8of-_c-.css +1 -0
- dmart/cxb/assets/Prism--hMplq-p.js +3 -0
- dmart/cxb/assets/Prism-Uh6uStUw.css +1 -0
- dmart/cxb/assets/Table2Cols-BsbwicQm.js +1 -0
- dmart/cxb/assets/_..-BvT6vdHa.css +1 -0
- dmart/cxb/assets/_...404_-fuLH_rX9.js +2 -0
- dmart/cxb/assets/_...fallback_-Ba_NLmAE.js +1 -0
- dmart/cxb/assets/_module-3HrtKAWo.js +3 -0
- dmart/cxb/assets/_module-DFKFq0AM.js +4 -0
- dmart/cxb/assets/_module-Dgq0ZVtz.js +1 -0
- dmart/cxb/assets/ajv-Cpj98o6Y.js +1 -0
- dmart/cxb/assets/axios-CG2WSiiR.js +6 -0
- dmart/cxb/assets/clsx-B-dksMZM.js +1 -0
- dmart/cxb/assets/codemirror-wrapped-line-indent-DPhKvljI.js +1 -0
- dmart/cxb/assets/compare-C3AjiGFR.js +1 -0
- dmart/cxb/assets/compute-scroll-into-view-Bl8rNFhg.js +1 -0
- dmart/cxb/assets/consolite-DlCuI0F9.js +1 -0
- dmart/cxb/assets/crelt-C8TCjufn.js +1 -0
- dmart/cxb/assets/date-fns-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/deepmerge-rn4rBaHU.js +1 -0
- dmart/cxb/assets/dmart_services-AL6-IdDE.js +1 -0
- dmart/cxb/assets/downloadFile-D08i0YDh.js +1 -0
- dmart/cxb/assets/easy-signal-BiPFIK3O.js +1 -0
- dmart/cxb/assets/esm-env-rsSWfq8L.js +1 -0
- dmart/cxb/assets/export-OF_rTiXu.js +1 -0
- dmart/cxb/assets/fast-deep-equal-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/fast-diff-C-IidNf4.js +1 -0
- dmart/cxb/assets/fast-uri-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/flowbite-svelte-BLvjb-sa.js +1 -0
- dmart/cxb/assets/flowbite-svelte-CD54FDqW.css +1 -0
- dmart/cxb/assets/flowbite-svelte-icons-BI8GVhw_.js +1 -0
- dmart/cxb/assets/github-slugger-CQ4oX9Ud.js +1 -0
- dmart/cxb/assets/global-igKv-1g9.js +1 -0
- dmart/cxb/assets/hookar-BMRD9G9H.js +1 -0
- dmart/cxb/assets/immutable-json-patch-DtRO2E_S.js +1 -0
- dmart/cxb/assets/import-1vE3gBat.js +1 -0
- dmart/cxb/assets/index-B-eTh-ZX.js +1 -0
- dmart/cxb/assets/index-BSsK-X71.js +1 -0
- dmart/cxb/assets/index-BVyxzKtH.js +1 -0
- dmart/cxb/assets/index-BdeNM69f.js +1 -0
- dmart/cxb/assets/index-CC-A1ipE.js +1 -0
- dmart/cxb/assets/index-CQohGiYB.js +1 -0
- dmart/cxb/assets/index-ChjnkpdZ.js +4 -0
- dmart/cxb/assets/index-DLP7csA4.js +1 -0
- dmart/cxb/assets/index-DTfhnhwd.js +1 -0
- dmart/cxb/assets/index-DdXRK7n9.js +2 -0
- dmart/cxb/assets/index-DtiCmB4o.js +1 -0
- dmart/cxb/assets/index-NBrXBlLA.css +2 -0
- dmart/cxb/assets/index-X1uNehO7.js +1 -0
- dmart/cxb/assets/index-nrQW6Nrr.js +1 -0
- dmart/cxb/assets/info-B986lRiM.js +1 -0
- dmart/cxb/assets/intl-messageformat-Dc5UU-HB.js +3 -0
- dmart/cxb/assets/jmespath-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/json-schema-traverse-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/json-source-map-DRgZidqy.js +5 -0
- dmart/cxb/assets/jsonpath-plus-l0sNRNKZ.js +1 -0
- dmart/cxb/assets/jsonrepair-B30Dx381.js +8 -0
- dmart/cxb/assets/lodash-es-DZVAA2ox.js +1 -0
- dmart/cxb/assets/marked-DKjyhwJX.js +56 -0
- dmart/cxb/assets/marked-gfm-heading-id-U5zO829x.js +2 -0
- dmart/cxb/assets/marked-mangle-CDMeiHC6.js +1 -0
- dmart/cxb/assets/memoize-one-BdPwpGay.js +1 -0
- dmart/cxb/assets/natural-compare-lite-Bg2Xcf-o.js +7 -0
- dmart/cxb/assets/pagination-svelte-D5CyoiE_.js +13 -0
- dmart/cxb/assets/pagination-svelte-v10nAbbM.css +1 -0
- dmart/cxb/assets/plantuml-encoder-C47mzt9T.js +1 -0
- dmart/cxb/assets/prismjs-DTUiLGJu.js +9 -0
- dmart/cxb/assets/profile-BUf-tKMe.js +1 -0
- dmart/cxb/assets/query-CNmXTsgf.js +1 -0
- dmart/cxb/assets/queryHelpers-C9iBWwqe.js +1 -0
- dmart/cxb/assets/scroll-into-view-if-needed-KR58zyjF.js +1 -0
- dmart/cxb/assets/spaces-0oyGvpii.js +1 -0
- dmart/cxb/assets/style-mod-Bs6eFhZE.js +3 -0
- dmart/cxb/assets/svelte-B2XmcTi_.js +4 -0
- dmart/cxb/assets/svelte-awesome-COLlx0DN.css +1 -0
- dmart/cxb/assets/svelte-awesome-DhnMA6Q_.js +1 -0
- dmart/cxb/assets/svelte-datatables-net-CY7LBj6I.js +1 -0
- dmart/cxb/assets/svelte-floating-ui-BlS3sOAQ.js +1 -0
- dmart/cxb/assets/svelte-i18n-CT2KkQaN.js +3 -0
- dmart/cxb/assets/svelte-jsoneditor-BzfX6Usi.css +1 -0
- dmart/cxb/assets/svelte-jsoneditor-CUGSvWId.js +25 -0
- dmart/cxb/assets/svelte-select-CegQKzqH.css +1 -0
- dmart/cxb/assets/svelte-select-CjHAt_85.js +6 -0
- dmart/cxb/assets/tailwind-merge-CJvxXMcu.js +1 -0
- dmart/cxb/assets/tailwind-variants-Cj20BoQ3.js +1 -0
- dmart/cxb/assets/toast-B9WDyfyI.js +1 -0
- dmart/cxb/assets/tslib-pJfR_DrR.js +1 -0
- dmart/cxb/assets/typewriter-editor-DkTVIJdm.js +25 -0
- dmart/cxb/assets/user-DeK_NB5v.js +1 -0
- dmart/cxb/assets/vanilla-picker-l5rcX3cq.js +8 -0
- dmart/cxb/assets/w3c-keyname-Vcq4gwWv.js +1 -0
- dmart/cxb/config.json +11 -0
- dmart/cxb/config.sample.json +11 -0
- dmart/cxb/favicon.ico +0 -0
- dmart/cxb/favicon.png +0 -0
- dmart/cxb/index.html +28 -0
- dmart/data_adapters/__init__.py +0 -0
- dmart/data_adapters/adapter.py +16 -0
- dmart/data_adapters/base_data_adapter.py +467 -0
- dmart/data_adapters/file/__init__.py +0 -0
- dmart/data_adapters/file/adapter.py +2043 -0
- dmart/data_adapters/file/adapter_helpers.py +1013 -0
- dmart/data_adapters/file/archive.py +150 -0
- dmart/data_adapters/file/create_index.py +331 -0
- dmart/data_adapters/file/create_users_folders.py +52 -0
- dmart/data_adapters/file/custom_validations.py +68 -0
- dmart/data_adapters/file/drop_index.py +40 -0
- dmart/data_adapters/file/health_check.py +560 -0
- dmart/data_adapters/file/redis_services.py +1110 -0
- dmart/data_adapters/helpers.py +27 -0
- dmart/data_adapters/sql/__init__.py +0 -0
- dmart/data_adapters/sql/adapter.py +3218 -0
- dmart/data_adapters/sql/adapter_helpers.py +491 -0
- dmart/data_adapters/sql/create_tables.py +451 -0
- dmart/data_adapters/sql/create_users_folders.py +53 -0
- dmart/data_adapters/sql/db_to_json_migration.py +485 -0
- dmart/data_adapters/sql/health_check_sql.py +232 -0
- dmart/data_adapters/sql/json_to_db_migration.py +454 -0
- dmart/data_adapters/sql/update_query_policies.py +101 -0
- dmart/data_generator.py +81 -0
- dmart/dmart.py +761 -0
- dmart/get_settings.py +7 -0
- dmart/hypercorn_config.toml +3 -0
- dmart/info.json +1 -0
- dmart/languages/__init__.py +0 -0
- dmart/languages/arabic.json +15 -0
- dmart/languages/english.json +16 -0
- dmart/languages/kurdish.json +14 -0
- dmart/languages/loader.py +12 -0
- dmart/login_creds.sh +7 -0
- dmart/login_creds.sh.sample +7 -0
- dmart/main.py +563 -0
- dmart/manifest.sh +12 -0
- dmart/migrate.py +24 -0
- dmart/models/__init__.py +0 -0
- dmart/models/api.py +203 -0
- dmart/models/core.py +597 -0
- dmart/models/enums.py +255 -0
- dmart/password_gen.py +8 -0
- dmart/plugins/__init__.py +0 -0
- dmart/plugins/action_log/__init__.py +0 -0
- dmart/plugins/action_log/config.json +13 -0
- dmart/plugins/action_log/plugin.py +121 -0
- dmart/plugins/admin_notification_sender/__init__.py +0 -0
- dmart/plugins/admin_notification_sender/config.json +13 -0
- dmart/plugins/admin_notification_sender/plugin.py +124 -0
- dmart/plugins/ldap_manager/__init__.py +0 -0
- dmart/plugins/ldap_manager/config.json +12 -0
- dmart/plugins/ldap_manager/dmart.schema +146 -0
- dmart/plugins/ldap_manager/plugin.py +100 -0
- dmart/plugins/ldap_manager/slapd.conf +53 -0
- dmart/plugins/local_notification/__init__.py +0 -0
- dmart/plugins/local_notification/config.json +13 -0
- dmart/plugins/local_notification/plugin.py +123 -0
- dmart/plugins/realtime_updates_notifier/__init__.py +0 -0
- dmart/plugins/realtime_updates_notifier/config.json +12 -0
- dmart/plugins/realtime_updates_notifier/plugin.py +58 -0
- dmart/plugins/redis_db_update/__init__.py +0 -0
- dmart/plugins/redis_db_update/config.json +13 -0
- dmart/plugins/redis_db_update/plugin.py +188 -0
- dmart/plugins/resource_folders_creation/__init__.py +0 -0
- dmart/plugins/resource_folders_creation/config.json +12 -0
- dmart/plugins/resource_folders_creation/plugin.py +81 -0
- dmart/plugins/system_notification_sender/__init__.py +0 -0
- dmart/plugins/system_notification_sender/config.json +13 -0
- dmart/plugins/system_notification_sender/plugin.py +188 -0
- dmart/plugins/update_access_controls/__init__.py +0 -0
- dmart/plugins/update_access_controls/config.json +12 -0
- dmart/plugins/update_access_controls/plugin.py +9 -0
- dmart/publish.sh +57 -0
- dmart/pylint.sh +16 -0
- dmart/pyrightconfig.json +7 -0
- dmart/redis_connections.sh +13 -0
- dmart/reload.sh +56 -0
- dmart/run.sh +3 -0
- dmart/run_notification_campaign.py +85 -0
- dmart/sample/spaces/applications/.dm/meta.space.json +30 -0
- dmart/sample/spaces/applications/api/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/api/.dm/query_all_applications/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/.dm/test_by_saad/attachments.media/meta.warframe.json +1 -0
- dmart/sample/spaces/applications/api/.dm/test_by_saad/attachments.media/warframe.png +0 -0
- dmart/sample/spaces/applications/api/.dm/test_by_saad/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/.dm/user_profile/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/create_log/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/create_public_logs/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/query_all_translated_data/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/query_logs/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/query_translated_enums/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/query_translated_others/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/.dm/query_translated_resolution/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/applications/create_log.json +1 -0
- dmart/sample/spaces/applications/api/applications/create_public_logs.json +1 -0
- dmart/sample/spaces/applications/api/applications/query_all_translated_data.json +1 -0
- dmart/sample/spaces/applications/api/applications/query_logs.json +1 -0
- dmart/sample/spaces/applications/api/applications/query_translated_enums.json +1 -0
- dmart/sample/spaces/applications/api/applications/query_translated_others.json +1 -0
- dmart/sample/spaces/applications/api/applications/query_translated_resolution.json +1 -0
- dmart/sample/spaces/applications/api/applications.json +1 -0
- dmart/sample/spaces/applications/api/management/.dm/create_subaccount/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/management/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/api/management/.dm/update_password/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/management/create_subaccount.json +53 -0
- dmart/sample/spaces/applications/api/management/update_password.json +1 -0
- dmart/sample/spaces/applications/api/management.json +1 -0
- dmart/sample/spaces/applications/api/query_all_applications.json +15 -0
- dmart/sample/spaces/applications/api/test_by_saad.json +1 -0
- dmart/sample/spaces/applications/api/user/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/api/user/.dm/test_by_saad/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/user/.dm/user_profile/meta.content.json +1 -0
- dmart/sample/spaces/applications/api/user/test_by_saad.json +1 -0
- dmart/sample/spaces/applications/api/user/user_profile.json +1 -0
- dmart/sample/spaces/applications/api/user_profile.json +1 -0
- dmart/sample/spaces/applications/api.json +1 -0
- dmart/sample/spaces/applications/collections/.dm/meta.folder.json +19 -0
- dmart/sample/spaces/applications/collections.json +1 -0
- dmart/sample/spaces/applications/configurations/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/configurations/time_out.json +1 -0
- dmart/sample/spaces/applications/configurations.json +19 -0
- dmart/sample/spaces/applications/errors.json +1 -0
- dmart/sample/spaces/applications/logs/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/logs.json +1 -0
- dmart/sample/spaces/applications/queries/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/queries/.dm/order/meta.content.json +1 -0
- dmart/sample/spaces/applications/queries/order.json +1 -0
- dmart/sample/spaces/applications/queries.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/api/meta.schema.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/configuration/meta.schema.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/error/meta.schema.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/log/meta.schema.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/schema/.dm/query/meta.schema.json +16 -0
- dmart/sample/spaces/applications/schema/.dm/translation/meta.schema.json +1 -0
- dmart/sample/spaces/applications/schema/api.json +28 -0
- dmart/sample/spaces/applications/schema/configuration.json +1 -0
- dmart/sample/spaces/applications/schema/error.json +43 -0
- dmart/sample/spaces/applications/schema/log.json +1 -0
- dmart/sample/spaces/applications/schema/query.json +118 -0
- dmart/sample/spaces/applications/schema/translation.json +26 -0
- dmart/sample/spaces/applications/schema.json +1 -0
- dmart/sample/spaces/applications/translations/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/applications/translations.json +1 -0
- dmart/sample/spaces/archive/.dm/meta.space.json +27 -0
- dmart/sample/spaces/custom_plugins/dummy/__pycache__/plugin.cpython-314.pyc +0 -0
- dmart/sample/spaces/custom_plugins/dummy/config.json +28 -0
- dmart/sample/spaces/custom_plugins/dummy/plugin.py +6 -0
- dmart/sample/spaces/custom_plugins/missed_entry/config.json +12 -0
- dmart/sample/spaces/custom_plugins/missed_entry/plugin.py +119 -0
- dmart/sample/spaces/custom_plugins/own_changed_notification/__pycache__/plugin.cpython-314.pyc +0 -0
- dmart/sample/spaces/custom_plugins/own_changed_notification/config.json +12 -0
- dmart/sample/spaces/custom_plugins/own_changed_notification/plugin.py +65 -0
- dmart/sample/spaces/custom_plugins/reports_stats/config.json +14 -0
- dmart/sample/spaces/custom_plugins/reports_stats/plugin.py +82 -0
- dmart/sample/spaces/custom_plugins/system_notification_sender/config.json +22 -0
- dmart/sample/spaces/custom_plugins/system_notification_sender/notification.py +268 -0
- dmart/sample/spaces/custom_plugins/system_notification_sender/plugin.py +98 -0
- dmart/sample/spaces/management/.dm/events.jsonl +32 -0
- dmart/sample/spaces/management/.dm/meta.space.json +48 -0
- dmart/sample/spaces/management/.dm/notifications/attachments.view.json/admin.json +36 -0
- dmart/sample/spaces/management/.dm/notifications/attachments.view.json/meta.admin.json +1 -0
- dmart/sample/spaces/management/.dm/notifications/attachments.view.json/meta.system.json +1 -0
- dmart/sample/spaces/management/.dm/notifications/attachments.view.json/system.json +32 -0
- dmart/sample/spaces/management/collections/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/collections.json +1 -0
- dmart/sample/spaces/management/groups/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/groups.json +1 -0
- dmart/sample/spaces/management/health_check/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/health_check.json +1 -0
- dmart/sample/spaces/management/notifications/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/notifications/admin/.dm/meta.folder.json +9 -0
- dmart/sample/spaces/management/notifications/system/.dm/meta.folder.json +9 -0
- dmart/sample/spaces/management/notifications.json +1 -0
- dmart/sample/spaces/management/permissions/.dm/access_applications/meta.permission.json +31 -0
- dmart/sample/spaces/management/permissions/.dm/access_applications_world/meta.permission.json +31 -0
- dmart/sample/spaces/management/permissions/.dm/access_messages/meta.permission.json +23 -0
- dmart/sample/spaces/management/permissions/.dm/access_personal/meta.permission.json +40 -0
- dmart/sample/spaces/management/permissions/.dm/access_protected/meta.permission.json +33 -0
- dmart/sample/spaces/management/permissions/.dm/access_public/meta.permission.json +24 -0
- dmart/sample/spaces/management/permissions/.dm/browse_all_folders/meta.permission.json +23 -0
- dmart/sample/spaces/management/permissions/.dm/create_log/meta.permission.json +24 -0
- dmart/sample/spaces/management/permissions/.dm/interviewer/meta.permission.json +1 -0
- dmart/sample/spaces/management/permissions/.dm/manage_applications/meta.permission.json +1 -0
- dmart/sample/spaces/management/permissions/.dm/manage_debug/meta.permission.json +25 -0
- dmart/sample/spaces/management/permissions/.dm/manage_spaces/meta.permission.json +24 -0
- dmart/sample/spaces/management/permissions/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/permissions/.dm/rules_management_default/meta.permission.json +32 -0
- dmart/sample/spaces/management/permissions/.dm/super_manager/meta.permission.json +52 -0
- dmart/sample/spaces/management/permissions/.dm/view_activity_log/meta.permission.json +26 -0
- dmart/sample/spaces/management/permissions/.dm/view_collections/meta.permission.json +29 -0
- dmart/sample/spaces/management/permissions/.dm/view_logs/meta.permission.json +30 -0
- dmart/sample/spaces/management/permissions/.dm/view_roles/meta.permission.json +29 -0
- dmart/sample/spaces/management/permissions/.dm/view_users/meta.permission.json +25 -0
- dmart/sample/spaces/management/permissions/.dm/view_world/meta.permission.json +31 -0
- dmart/sample/spaces/management/permissions/.dm/world/meta.permission.json +35 -0
- dmart/sample/spaces/management/permissions.json +1 -0
- dmart/sample/spaces/management/requests.json +1 -0
- dmart/sample/spaces/management/roles/.dm/dummy/meta.role.json +12 -0
- dmart/sample/spaces/management/roles/.dm/logged_in/meta.role.json +18 -0
- dmart/sample/spaces/management/roles/.dm/manager/meta.role.json +13 -0
- dmart/sample/spaces/management/roles/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/roles/.dm/moderator/meta.role.json +13 -0
- dmart/sample/spaces/management/roles/.dm/super_admin/meta.role.json +14 -0
- dmart/sample/spaces/management/roles/.dm/test_role/meta.role.json +13 -0
- dmart/sample/spaces/management/roles/.dm/world/meta.role.json +15 -0
- dmart/sample/spaces/management/roles.json +1 -0
- dmart/sample/spaces/management/schema/.dm/admin_notification_request/attachments.media/meta.ui_schema.json +10 -0
- dmart/sample/spaces/management/schema/.dm/admin_notification_request/attachments.media/ui_schema.json +32 -0
- dmart/sample/spaces/management/schema/.dm/admin_notification_request/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/api/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/folder_rendering/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/health_check/meta.schema.json +17 -0
- dmart/sample/spaces/management/schema/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/schema/.dm/meta_schema/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/metafile/meta.schema.json +14 -0
- dmart/sample/spaces/management/schema/.dm/notification/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/system_notification_request/attachments.media/meta.ui_schema.json +10 -0
- dmart/sample/spaces/management/schema/.dm/system_notification_request/attachments.media/ui_schema.json +32 -0
- dmart/sample/spaces/management/schema/.dm/system_notification_request/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/view/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/.dm/workflow/meta.schema.json +1 -0
- dmart/sample/spaces/management/schema/admin_notification_request.json +89 -0
- dmart/sample/spaces/management/schema/api.json +1 -0
- dmart/sample/spaces/management/schema/folder_rendering.json +238 -0
- dmart/sample/spaces/management/schema/health_check.json +8 -0
- dmart/sample/spaces/management/schema/meta_schema.json +74 -0
- dmart/sample/spaces/management/schema/metafile.json +153 -0
- dmart/sample/spaces/management/schema/notification.json +28 -0
- dmart/sample/spaces/management/schema/system_notification_request.json +57 -0
- dmart/sample/spaces/management/schema/view.json +23 -0
- dmart/sample/spaces/management/schema/workflow.json +87 -0
- dmart/sample/spaces/management/schema.json +1 -0
- dmart/sample/spaces/management/users/.dm/alibaba/meta.user.json +23 -0
- dmart/sample/spaces/management/users/.dm/anonymous/meta.user.json +18 -0
- dmart/sample/spaces/management/users/.dm/dmart/meta.user.json +26 -0
- dmart/sample/spaces/management/users/.dm/meta.folder.json +14 -0
- dmart/sample/spaces/management/workflows/.dm/channel/meta.content.json +1 -0
- dmart/sample/spaces/management/workflows/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/management/workflows/channel.json +148 -0
- dmart/sample/spaces/management/workflows.json +1 -0
- dmart/sample/spaces/maqola/.dm/meta.space.json +33 -0
- dmart/sample/spaces/personal/.dm/meta.space.json +24 -0
- dmart/sample/spaces/personal/people/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/messages/.dm/0b5f7e7f/meta.content.json +1 -0
- dmart/sample/spaces/personal/people/dmart/messages/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/messages/.dm/mytest/meta.content.json +1 -0
- dmart/sample/spaces/personal/people/dmart/messages/0b5f7e7f.json +1 -0
- dmart/sample/spaces/personal/people/dmart/messages/mytest.json +1 -0
- dmart/sample/spaces/personal/people/dmart/notifications/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/private/.dm/inner/meta.content.json +1 -0
- dmart/sample/spaces/personal/people/dmart/private/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/private/inner.json +1 -0
- dmart/sample/spaces/personal/people/dmart/protected/.dm/avatar/meta.content.json +1 -0
- dmart/sample/spaces/personal/people/dmart/protected/.dm/meta.folder.json +1 -0
- dmart/sample/spaces/personal/people/dmart/protected/avatar.png +0 -0
- dmart/sample/spaces/personal/people/dmart/public/.dm/meta.folder.json +1 -0
- dmart/sample/test/.gitignore +2 -0
- dmart/sample/test/createcontent.json +9 -0
- dmart/sample/test/createmedia.json +9 -0
- dmart/sample/test/createmedia_entry.json +6 -0
- dmart/sample/test/createschema.json +8 -0
- dmart/sample/test/createschemawork.json +11 -0
- dmart/sample/test/createticket.json +13 -0
- dmart/sample/test/data.json +4 -0
- dmart/sample/test/deletecontent.json +12 -0
- dmart/sample/test/logo.jpeg +0 -0
- dmart/sample/test/my.jpg +0 -0
- dmart/sample/test/myticket.json +23 -0
- dmart/sample/test/resources.csv +12 -0
- dmart/sample/test/schema.json +16 -0
- dmart/sample/test/temp.json +1 -0
- dmart/sample/test/test.dmart +45 -0
- dmart/sample/test/ticket_schema.json +23 -0
- dmart/sample/test/ticket_workflow.json +85 -0
- dmart/sample/test/ticketbody.json +4 -0
- dmart/sample/test/ticketcontent.json +14 -0
- dmart/sample/test/updatecontent.json +20 -0
- dmart/sample/test/workflow_schema.json +68 -0
- dmart/scheduled_notification_handler.py +121 -0
- dmart/schema_migration.py +208 -0
- dmart/schema_modulate.py +192 -0
- dmart/set_admin_passwd.py +75 -0
- dmart/sync.py +202 -0
- dmart/test_utils.py +34 -0
- dmart/utils/__init__.py +0 -0
- dmart/utils/access_control.py +306 -0
- dmart/utils/async_request.py +8 -0
- dmart/utils/exporter.py +309 -0
- dmart/utils/firebase_notifier.py +57 -0
- dmart/utils/generate_email.py +37 -0
- dmart/utils/helpers.py +352 -0
- dmart/utils/hypercorn_config.py +12 -0
- dmart/utils/internal_error_code.py +60 -0
- dmart/utils/jwt.py +124 -0
- dmart/utils/logger.py +167 -0
- dmart/utils/middleware.py +99 -0
- dmart/utils/notification.py +75 -0
- dmart/utils/password_hashing.py +16 -0
- dmart/utils/plugin_manager.py +202 -0
- dmart/utils/query_policies_helper.py +128 -0
- dmart/utils/regex.py +44 -0
- dmart/utils/repository.py +529 -0
- dmart/utils/router_helper.py +19 -0
- dmart/utils/settings.py +212 -0
- dmart/utils/sms_notifier.py +21 -0
- dmart/utils/social_sso.py +67 -0
- dmart/utils/templates/activation.html.j2 +26 -0
- dmart/utils/templates/reminder.html.j2 +17 -0
- dmart/utils/ticket_sys_utils.py +203 -0
- dmart/utils/web_notifier.py +29 -0
- dmart/websocket.py +231 -0
- dmart-1.4.40.post8.dist-info/METADATA +75 -0
- dmart-1.4.40.post8.dist-info/RECORD +489 -0
- dmart-1.4.40.post8.dist-info/WHEEL +5 -0
- dmart-1.4.40.post8.dist-info/entry_points.txt +2 -0
- dmart-1.4.40.post8.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import requests
|
|
3
|
+
from uuid import uuid4
|
|
4
|
+
from api.user.service import send_sms
|
|
5
|
+
from api.user.router import MANAGEMENT_SPACE, USERS_SUBPATH
|
|
6
|
+
from models.core import Notification, Locator, Translation, User
|
|
7
|
+
from models.enums import NotificationType
|
|
8
|
+
from utils.db import save
|
|
9
|
+
from re import sub as res_sub
|
|
10
|
+
from firebase_admin import credentials, messaging, initialize_app
|
|
11
|
+
from utils.helpers import divide_chunks, flatten_dict, lang_code
|
|
12
|
+
from utils.redis_services import RedisServices
|
|
13
|
+
from utils.settings import settings
|
|
14
|
+
from utils.regex import FILENAME
|
|
15
|
+
import os
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
import utils.db as db
|
|
18
|
+
from fastapi.logger import logger
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
async def send_notification(
|
|
22
|
+
notification_dict: dict,
|
|
23
|
+
receivers: set,
|
|
24
|
+
entry: dict = {},
|
|
25
|
+
):
|
|
26
|
+
notification_required_keys = [
|
|
27
|
+
"displayname",
|
|
28
|
+
"description",
|
|
29
|
+
"priority",
|
|
30
|
+
"types",
|
|
31
|
+
]
|
|
32
|
+
if not all(key in notification_dict for key in notification_required_keys):
|
|
33
|
+
raise Exception(
|
|
34
|
+
"One or more of the Main keys 'displayname', 'description', or 'priority' are missing"
|
|
35
|
+
)
|
|
36
|
+
if isinstance(notification_dict["displayname"], Translation):
|
|
37
|
+
notification_dict["displayname"] = notification_dict["displayname"].dict()
|
|
38
|
+
if isinstance(notification_dict["description"], Translation):
|
|
39
|
+
notification_dict["description"] = notification_dict["description"].dict()
|
|
40
|
+
|
|
41
|
+
for locale in ["ar", "en", "ku"]:
|
|
42
|
+
notification_dict["displayname"][locale] = translate_message_vars(
|
|
43
|
+
notification_dict["displayname"][locale], entry, locale
|
|
44
|
+
)
|
|
45
|
+
notification_dict["description"][locale] = translate_message_vars(
|
|
46
|
+
notification_dict["description"][locale], entry, locale
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
for receiver in receivers:
|
|
50
|
+
if "web" in notification_dict["types"]:
|
|
51
|
+
try:
|
|
52
|
+
if not notification_dict.get("push_only", False):
|
|
53
|
+
await store_notification(notification_dict, receiver, entry)
|
|
54
|
+
|
|
55
|
+
# Send push notification
|
|
56
|
+
requests.post(
|
|
57
|
+
url=f"{settings.websocket_url}/send-message/{receiver}",
|
|
58
|
+
data=json.dumps(
|
|
59
|
+
{
|
|
60
|
+
"title": notification_dict["displayname"],
|
|
61
|
+
"description": notification_dict["description"],
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
except Exception as e:
|
|
66
|
+
logger.error(
|
|
67
|
+
"Notification",
|
|
68
|
+
extra={
|
|
69
|
+
"props": {"title": "FAIL at store_notification", "message": e}
|
|
70
|
+
},
|
|
71
|
+
)
|
|
72
|
+
user = None
|
|
73
|
+
if "mobile" in notification_dict["types"]:
|
|
74
|
+
try:
|
|
75
|
+
user = await db.load(
|
|
76
|
+
space_name=MANAGEMENT_SPACE,
|
|
77
|
+
subpath=USERS_SUBPATH,
|
|
78
|
+
shortname=receiver,
|
|
79
|
+
class_type=User,
|
|
80
|
+
user_shortname="dmart",
|
|
81
|
+
)
|
|
82
|
+
await send_notification_firebase(user, notification_dict, entry)
|
|
83
|
+
except Exception as e:
|
|
84
|
+
logger.error(
|
|
85
|
+
"Notification",
|
|
86
|
+
extra={
|
|
87
|
+
"props": {
|
|
88
|
+
"title": "FAIL at send_notification_firebase",
|
|
89
|
+
"message": e,
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
)
|
|
93
|
+
if "sms" in notification_dict["types"]:
|
|
94
|
+
try:
|
|
95
|
+
user = (
|
|
96
|
+
user
|
|
97
|
+
if user
|
|
98
|
+
else await db.load(
|
|
99
|
+
space_name=MANAGEMENT_SPACE,
|
|
100
|
+
subpath=USERS_SUBPATH,
|
|
101
|
+
shortname=receiver,
|
|
102
|
+
class_type=User,
|
|
103
|
+
user_shortname="dmart",
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
user_lang_code = lang_code(user.language)
|
|
107
|
+
await send_sms(
|
|
108
|
+
user.msisdn or "",
|
|
109
|
+
notification_dict["displayname"][user_lang_code],
|
|
110
|
+
)
|
|
111
|
+
except Exception as e:
|
|
112
|
+
logger.error(
|
|
113
|
+
"Notification",
|
|
114
|
+
extra={"props": {"title": "FAIL at send_sms", "message": e}},
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def translate_message_vars(message: str, entry: dict, locale: str):
|
|
119
|
+
entry_dict = flatten_dict(entry)
|
|
120
|
+
for field, value in entry_dict.items():
|
|
121
|
+
if type(value) == dict and locale in value:
|
|
122
|
+
value = value[locale]
|
|
123
|
+
if field in ["created_at", "updated_at"]:
|
|
124
|
+
message = message.replace(
|
|
125
|
+
f"{{{field}}}", str(value.strftime("%Y-%m-%d %H:%M:%S"))
|
|
126
|
+
)
|
|
127
|
+
else:
|
|
128
|
+
message = message.replace(f"{{{field}}}", str(value))
|
|
129
|
+
|
|
130
|
+
return res_sub(r"\{\w*.*\}", "", message)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
async def store_notification(
|
|
134
|
+
notification_dict: dict, receiver_shortname: str, entry: dict = {}
|
|
135
|
+
):
|
|
136
|
+
if notification_dict["payload"]["schema_shortname"] == "admin_notification_request":
|
|
137
|
+
notification_type = NotificationType.admin
|
|
138
|
+
else:
|
|
139
|
+
notification_type = NotificationType.system
|
|
140
|
+
|
|
141
|
+
entry_locator = None
|
|
142
|
+
if entry:
|
|
143
|
+
entry_locator = Locator(
|
|
144
|
+
space_name=entry["space_name"],
|
|
145
|
+
type=entry["resource_type"],
|
|
146
|
+
schema_shortname=entry["payload"]["schema_shortname"],
|
|
147
|
+
subpath=entry["subpath"],
|
|
148
|
+
shortname=entry["shortname"],
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
uuid = uuid4()
|
|
152
|
+
notification_obj = Notification(
|
|
153
|
+
uuid=uuid,
|
|
154
|
+
shortname=str(uuid)[:8],
|
|
155
|
+
is_active=True,
|
|
156
|
+
displayname=notification_dict["displayname"],
|
|
157
|
+
description=notification_dict["description"],
|
|
158
|
+
owner_shortname=notification_dict["owner_shortname"],
|
|
159
|
+
type=notification_type,
|
|
160
|
+
is_read=False,
|
|
161
|
+
priority=notification_dict["priority"],
|
|
162
|
+
entry=entry_locator,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
await save(
|
|
166
|
+
space_name="personal",
|
|
167
|
+
subpath=f"people/{receiver_shortname}/notifications",
|
|
168
|
+
meta=notification_obj,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
async with await RedisServices() as redis:
|
|
172
|
+
await redis.save_meta_doc(
|
|
173
|
+
"personal",
|
|
174
|
+
f"people/{receiver_shortname}/notifications",
|
|
175
|
+
notification_obj,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
firebase_app = None
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def init_firbase_app():
|
|
183
|
+
global firebase_app
|
|
184
|
+
firebase_cred = credentials.Certificate(settings.google_application_credentials)
|
|
185
|
+
firebase_app = initialize_app(firebase_cred, name="[DEFAULT]")
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
async def send_notification_firebase(user: User, data, entry):
|
|
189
|
+
users_fcm_tokens = {}
|
|
190
|
+
|
|
191
|
+
firebase_token, msisdn = user.firebase_token, user.msisdn
|
|
192
|
+
|
|
193
|
+
lang = lang_code(user.language)
|
|
194
|
+
# if lang not in users_fcm_tokens:
|
|
195
|
+
users_fcm_tokens[lang] = {}
|
|
196
|
+
users_fcm_tokens[lang][msisdn] = firebase_token
|
|
197
|
+
|
|
198
|
+
images: dict = {}
|
|
199
|
+
images_folder = Path(
|
|
200
|
+
f"{settings.spaces_folder}/{settings.management_space}/{data['subpath']}/.dm/{data['shortname']}/attachments.media"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
if images_folder.is_dir():
|
|
204
|
+
images_files = os.scandir(images_folder)
|
|
205
|
+
for image_file in images_files:
|
|
206
|
+
match = FILENAME.search(str(image_file.name))
|
|
207
|
+
if not match or not image_file.is_file():
|
|
208
|
+
continue
|
|
209
|
+
|
|
210
|
+
images[
|
|
211
|
+
image_file.name.split("_")[0]
|
|
212
|
+
] = f"{settings.listening_host}/public/payload/media/{settings.management_space}/{data['subpath']}/{data['shortname']}/{image_file.name}"
|
|
213
|
+
|
|
214
|
+
for lang, fcm_token_per_lang in users_fcm_tokens.items():
|
|
215
|
+
res = send_multiple_notifications(
|
|
216
|
+
tokens=list(fcm_token_per_lang.values()),
|
|
217
|
+
title=data.get("displayname", {}).get(lang, ""),
|
|
218
|
+
body=data.get("description", {}).get(lang, ""),
|
|
219
|
+
image=images.get(lang, ""),
|
|
220
|
+
data={
|
|
221
|
+
**data.get("deep_link"),
|
|
222
|
+
"id": entry.get("shortname"),
|
|
223
|
+
"space_name": entry.get("space_name"),
|
|
224
|
+
"subpath": entry.get("subpath"),
|
|
225
|
+
},
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def send_multiple_notifications(
|
|
230
|
+
tokens: list, title: str, body: str, data: dict, image: str, sound="default"
|
|
231
|
+
) -> list:
|
|
232
|
+
if not firebase_app:
|
|
233
|
+
init_firbase_app()
|
|
234
|
+
alert = messaging.ApsAlert(title=title, body=body)
|
|
235
|
+
aps = messaging.Aps(alert=alert, sound="default", content_available=True)
|
|
236
|
+
apns = messaging.APNSConfig(
|
|
237
|
+
payload=messaging.APNSPayload(aps),
|
|
238
|
+
fcm_options=messaging.APNSFCMOptions(image=image),
|
|
239
|
+
)
|
|
240
|
+
android_notification_settings = messaging.AndroidNotification(
|
|
241
|
+
priority="high", channel_id="FCM_CHANNEL_ID", visibility="public", image=image
|
|
242
|
+
)
|
|
243
|
+
android_config = messaging.AndroidConfig(
|
|
244
|
+
priority="high", notification=android_notification_settings
|
|
245
|
+
)
|
|
246
|
+
web_push = messaging.WebpushConfig(headers={"image": image})
|
|
247
|
+
# Firebase sends message to max of 500 registration tokens.
|
|
248
|
+
tokens_chunks = divide_chunks(tokens, 500)
|
|
249
|
+
failed_tokens = []
|
|
250
|
+
for tokens in tokens_chunks:
|
|
251
|
+
message = messaging.MulticastMessage(
|
|
252
|
+
notification=messaging.Notification(title=title, body=body),
|
|
253
|
+
tokens=tokens,
|
|
254
|
+
data=data,
|
|
255
|
+
apns=apns,
|
|
256
|
+
android=android_config,
|
|
257
|
+
webpush=web_push,
|
|
258
|
+
)
|
|
259
|
+
response = messaging.send_multicast(message)
|
|
260
|
+
|
|
261
|
+
if response.failure_count > 0:
|
|
262
|
+
responses = response.responses
|
|
263
|
+
for idx, resp in enumerate(responses):
|
|
264
|
+
if not resp.success:
|
|
265
|
+
# The order of responses corresponds to the order of the registration tokens.
|
|
266
|
+
failed_tokens.append(tokens[idx])
|
|
267
|
+
|
|
268
|
+
return failed_tokens
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from sys import modules as sys_modules
|
|
3
|
+
from models.enums import ContentType
|
|
4
|
+
from models.core import ActionType, PluginBase, Event
|
|
5
|
+
from utils.helpers import camel_case
|
|
6
|
+
from .notification import send_notification
|
|
7
|
+
from utils.redis_services import RedisServices
|
|
8
|
+
from utils.repository import get_group_users
|
|
9
|
+
from utils.settings import settings
|
|
10
|
+
from fastapi.logger import logger
|
|
11
|
+
from utils.db import load, load_resource_payload
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Plugin(PluginBase):
|
|
15
|
+
async def hook(self, data: Event):
|
|
16
|
+
"""
|
|
17
|
+
after any action
|
|
18
|
+
1- get the matching SystemNotificationRequest for this action
|
|
19
|
+
2- generate list of users to send the notification to (based on the action entry):
|
|
20
|
+
2.1- entry.owner_shortname, entry.group.members?, and entry.collaborators?
|
|
21
|
+
3- send the notification to the list of generated users
|
|
22
|
+
"""
|
|
23
|
+
# Type narrowing for PyRight
|
|
24
|
+
if not isinstance(data.shortname, str):
|
|
25
|
+
logger.error(
|
|
26
|
+
f"data.shortname is None and str is required at system_notification_sender"
|
|
27
|
+
)
|
|
28
|
+
return
|
|
29
|
+
if data.action_type == ActionType.delete:
|
|
30
|
+
entry = data.attributes["entry"].dict()
|
|
31
|
+
else:
|
|
32
|
+
entry = (
|
|
33
|
+
await load(
|
|
34
|
+
data.space_name,
|
|
35
|
+
data.subpath,
|
|
36
|
+
data.shortname,
|
|
37
|
+
getattr(sys_modules["models.core"], camel_case(data.resource_type)),
|
|
38
|
+
data.user_shortname,
|
|
39
|
+
)
|
|
40
|
+
).dict()
|
|
41
|
+
if (
|
|
42
|
+
entry["payload"]
|
|
43
|
+
and entry["payload"]["content_type"] == ContentType.json
|
|
44
|
+
):
|
|
45
|
+
entry["payload"]["body"] = load_resource_payload(
|
|
46
|
+
space_name=data.space_name,
|
|
47
|
+
subpath=data.subpath,
|
|
48
|
+
filename=entry["payload"]["body"],
|
|
49
|
+
class_type=getattr(
|
|
50
|
+
sys_modules["models.core"], camel_case(data.resource_type)
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
entry["space_name"] = data.space_name
|
|
54
|
+
entry["resource_type"] = str(data.resource_type)
|
|
55
|
+
entry["subpath"] = data.subpath
|
|
56
|
+
|
|
57
|
+
# 1- get the matching SystemNotificationRequests
|
|
58
|
+
search_subpaths = list(filter(None, data.subpath.split("/")))
|
|
59
|
+
async with RedisServices() as redis:
|
|
60
|
+
matching_notification_requests = await redis.search(
|
|
61
|
+
space_name=settings.management_space,
|
|
62
|
+
schema_name="system_notification_request",
|
|
63
|
+
filters={"subpath": ["notifications/system"]},
|
|
64
|
+
limit=30,
|
|
65
|
+
offset=0,
|
|
66
|
+
search=f"@on_space:{data.space_name} @on_subpath:({'|'.join(search_subpaths)}) @on_action:{data.action_type}",
|
|
67
|
+
)
|
|
68
|
+
if not matching_notification_requests.get("data", {}):
|
|
69
|
+
return True
|
|
70
|
+
|
|
71
|
+
# 2- get list of subscribed users
|
|
72
|
+
notification_subscribers = [entry["owner_shortname"]]
|
|
73
|
+
# if entry.get("collaborators", None):
|
|
74
|
+
# notification_subscribers.extend(entry["collaborators"].values()) # type: ignore
|
|
75
|
+
if entry.get("owner_group_shortname", None):
|
|
76
|
+
group_users = await get_group_users(entry["owner_group_shortname"])
|
|
77
|
+
group_members = [
|
|
78
|
+
json.loads(user_doc.json)["shortname"] for user_doc in group_users
|
|
79
|
+
]
|
|
80
|
+
notification_subscribers.extend(group_members)
|
|
81
|
+
|
|
82
|
+
if data.user_shortname in notification_subscribers:
|
|
83
|
+
notification_subscribers.remove(data.user_shortname)
|
|
84
|
+
|
|
85
|
+
# 3- send the notification
|
|
86
|
+
for redis_document in matching_notification_requests["data"]:
|
|
87
|
+
matching_notification_request = json.loads(redis_document.json)
|
|
88
|
+
if (
|
|
89
|
+
"state" in entry
|
|
90
|
+
and "on_state" in matching_notification_request
|
|
91
|
+
and matching_notification_request["on_state"] != entry["state"]
|
|
92
|
+
):
|
|
93
|
+
continue
|
|
94
|
+
await send_notification(
|
|
95
|
+
notification_dict=matching_notification_request,
|
|
96
|
+
entry=entry,
|
|
97
|
+
receivers=set(notification_subscribers),
|
|
98
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{"resource":{"uuid":"692bffbb-04ef-4be1-a2ef-bf89860a9c50","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:24:19.612759","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
2
|
+
{"resource":{"uuid":"0e44b870-e104-4158-8a39-14f44a80ab8b","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:24:19.763301","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
3
|
+
{"resource":{"uuid":"2d4a1248-8b9e-42ec-8fb7-56e435526b89","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:33:37.293378","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
4
|
+
{"resource":{"uuid":"50751887-004b-40d6-8233-641e24df52d2","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:33:37.379302","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
5
|
+
{"resource":{"uuid":"10a5ae55-7aed-401c-b071-767dd78c7319","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:52.897990","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
6
|
+
{"resource":{"uuid":"e5dad3f6-bc9d-48d7-bdca-2390c3e8c97d","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:52.960324","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
7
|
+
{"resource":{"uuid":"10a5ae55-7aed-401c-b071-767dd78c7319","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:53.587347","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
8
|
+
{"resource":{"uuid":"e5dad3f6-bc9d-48d7-bdca-2390c3e8c97d","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:53.635545","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
9
|
+
{"resource":{"uuid":"982ff233-0c5b-4a17-8ffb-aa09be5c4a83","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:53.698832","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
10
|
+
{"resource":{"uuid":"7b467bd6-a367-4358-8027-562d41cd9db9","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:53.757682","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
11
|
+
{"resource":{"uuid":"982ff233-0c5b-4a17-8ffb-aa09be5c4a83","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:54.095525","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
12
|
+
{"resource":{"uuid":"7b467bd6-a367-4358-8027-562d41cd9db9","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:54.141638","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
13
|
+
{"resource":{"uuid":"bc139749-2fc1-4143-8d5a-ef34b5af55fd","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:54.206018","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
14
|
+
{"resource":{"uuid":"cecd42cd-aa01-446b-ac50-025797b7ae90","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:54.284631","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
15
|
+
{"resource":{"uuid":"bc139749-2fc1-4143-8d5a-ef34b5af55fd","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:54.739530","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
16
|
+
{"resource":{"uuid":"cecd42cd-aa01-446b-ac50-025797b7ae90","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:54.785151","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
17
|
+
{"resource":{"uuid":"a699c560-7439-4cc8-8937-d686c34914fc","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:54.850960","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
18
|
+
{"resource":{"uuid":"ee3ea152-8aa6-4730-8fb4-5ca31bb37b61","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:54.910843","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
19
|
+
{"resource":{"uuid":"a699c560-7439-4cc8-8937-d686c34914fc","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:55.741306","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
20
|
+
{"resource":{"uuid":"ee3ea152-8aa6-4730-8fb4-5ca31bb37b61","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:55.786577","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
21
|
+
{"resource":{"uuid":"e858f8e1-2414-4956-a9ff-3a46c38127ad","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:55.854039","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
22
|
+
{"resource":{"uuid":"60a3b637-b77b-483c-aea8-bae0e48bd451","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:55.923684","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
23
|
+
{"resource":{"uuid":"e858f8e1-2414-4956-a9ff-3a46c38127ad","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.100957","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
24
|
+
{"resource":{"uuid":"60a3b637-b77b-483c-aea8-bae0e48bd451","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.147927","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
25
|
+
{"resource":{"uuid":"4fd79028-2463-40c1-90d4-f8996606bd2e","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:56.213200","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
26
|
+
{"resource":{"uuid":"166c5961-47cc-4771-bcf9-0ba15f2a6427","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:56.273130","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
27
|
+
{"resource":{"uuid":"4fd79028-2463-40c1-90d4-f8996606bd2e","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.566010","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
28
|
+
{"resource":{"uuid":"166c5961-47cc-4771-bcf9-0ba15f2a6427","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.615319","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
29
|
+
{"resource":{"uuid":"a9c8d4e1-d9d8-49b2-8916-497698236f2d","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:56.682340","attributes":{"password":null,"email":"user1@example.com","msisdn":"1123456789","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"bot","roles":["manager","moderator"],"groups":[],"firebase_token":null,"language":"kurdish","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"5f8a64ce8356a5a6c9ef79e68a4dd35a0882407f","body":{"rating":"5","user_gender":"male","account_type":"business","is_subscribed":false,"account_number":100,"allowed_categories":["analytics","reviews"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"487","content-type":"application/json"}}}
|
|
30
|
+
{"resource":{"uuid":"948661b8-dd65-4594-95f9-e720ec60491e","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"create","timestamp":"2026-01-11T22:35:56.741794","attributes":{"password":null,"email":"user2@example.com","msisdn":"9876543210","locked_to_device":false,"is_email_verified":false,"is_msisdn_verified":false,"force_password_change":false,"type":"mobile","roles":["manager"],"groups":[],"firebase_token":null,"language":"english","google_id":null,"facebook_id":null,"social_avatar_url":null,"last_login":null,"notes":null,"payload":{"content_type":"json","content_sub_type":null,"schema_shortname":null,"client_checksum":null,"checksum":"a6fa77e06f4801869d385878b567e5c7f7f89509","body":{"x":{"y":{"z":5}},"rating":"4","user_gender":"female","account_type":"personal","is_subscribed":true,"account_number":200,"allowed_categories":["posts","edits"]}},"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"491","content-type":"application/json"}}}
|
|
31
|
+
{"resource":{"uuid":"a9c8d4e1-d9d8-49b2-8916-497698236f2d","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user1","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.854712","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
32
|
+
{"resource":{"uuid":"948661b8-dd65-4594-95f9-e720ec60491e","domain":null,"type":"user","space_name":"management","subpath":"/users","shortname":"user2","schema_shortname":null,"displayname":null,"description":null,"tags":["test_user"]},"user_shortname":"dmart","request":"delete","timestamp":"2026-01-11T22:35:56.902695","attributes":{"request_headers":{"host":"localhost","accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"python-httpx/0.28.1","content-length":"142","content-type":"application/json"}}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uuid": "69ab4e02-b9ce-41e4-ada4-1e0869ccdc8f",
|
|
3
|
+
"shortname": "management",
|
|
4
|
+
"is_active": false,
|
|
5
|
+
"displayname": {
|
|
6
|
+
"en": "Management",
|
|
7
|
+
"ar": "Management",
|
|
8
|
+
"ku": "Management"
|
|
9
|
+
},
|
|
10
|
+
"description": {
|
|
11
|
+
"en": "A management / sample space",
|
|
12
|
+
"ar": "A managment / sample space",
|
|
13
|
+
"ku": "A managment / sample space"
|
|
14
|
+
},
|
|
15
|
+
"tags": [],
|
|
16
|
+
"created_at": "2023-08-14T12:18:22.732102",
|
|
17
|
+
"updated_at": "2023-08-15T13:37:49.135334",
|
|
18
|
+
"owner_shortname": "dmart",
|
|
19
|
+
"root_registration_signature": "",
|
|
20
|
+
"primary_website": "https://dmart.cc",
|
|
21
|
+
"indexing_enabled": true,
|
|
22
|
+
"capture_misses": false,
|
|
23
|
+
"check_health": true,
|
|
24
|
+
"languages": [
|
|
25
|
+
"english"
|
|
26
|
+
],
|
|
27
|
+
"icon": "",
|
|
28
|
+
"mirrors": [],
|
|
29
|
+
"hide_folders": [
|
|
30
|
+
"schema",
|
|
31
|
+
"workflows",
|
|
32
|
+
"visits",
|
|
33
|
+
"health_check",
|
|
34
|
+
"collections",
|
|
35
|
+
"groups"
|
|
36
|
+
],
|
|
37
|
+
"active_plugins": [
|
|
38
|
+
"action_log",
|
|
39
|
+
"update_access_controls",
|
|
40
|
+
"system_notification_sender",
|
|
41
|
+
"admin_notification_sender",
|
|
42
|
+
"redis_db_update",
|
|
43
|
+
"reports_stats",
|
|
44
|
+
"realtime_updates_notifier",
|
|
45
|
+
"resource_folders_creation"
|
|
46
|
+
],
|
|
47
|
+
"ordinal": 1
|
|
48
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortname": "admin",
|
|
3
|
+
"displayname": {
|
|
4
|
+
"en": "Admin"
|
|
5
|
+
},
|
|
6
|
+
"columns": [
|
|
7
|
+
{
|
|
8
|
+
"key": "shortname",
|
|
9
|
+
"name": "Name"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"key": "priority",
|
|
13
|
+
"name": "Priority"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"key": "status",
|
|
17
|
+
"name": "Status"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"key": "types",
|
|
21
|
+
"name": "Types"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"query": {
|
|
25
|
+
"type": "search",
|
|
26
|
+
"filter_schema_names": [
|
|
27
|
+
"admin_notification_request"
|
|
28
|
+
],
|
|
29
|
+
"filter_types": [
|
|
30
|
+
"content"
|
|
31
|
+
],
|
|
32
|
+
"search": "",
|
|
33
|
+
"sort_by": "created_at",
|
|
34
|
+
"sort_type": "descending"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid": "388b5f0f-4d0a-44f2-9146-b138092f5fa9", "shortname": "admin", "is_active": false, "tags": [], "created_at": "2022-11-30T14:31:44.450038", "updated_at": "2023-02-23T11:22:42.827386", "owner_shortname": "dmart", "payload": {"content_type": "json", "schema_shortname": "view", "body": "admin.json"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid": "bc36fedd-00bf-48dc-9723-2ec8cf656706", "shortname": "system", "is_active": false, "tags": [], "created_at": "2022-11-30T14:31:44.450038", "updated_at": "2023-02-23T11:22:55.434664", "owner_shortname": "dmart", "payload": {"content_type": "json", "schema_shortname": "view", "body": "system.json"}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortname": "system",
|
|
3
|
+
"displayname": {
|
|
4
|
+
"en": "system"
|
|
5
|
+
},
|
|
6
|
+
"columns": [
|
|
7
|
+
{
|
|
8
|
+
"key": "shortname",
|
|
9
|
+
"name": "name"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"key": "priority",
|
|
13
|
+
"name": "Priority"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"key": "types",
|
|
17
|
+
"name": "Types"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"query": {
|
|
21
|
+
"type": "search",
|
|
22
|
+
"filter_schema_names": [
|
|
23
|
+
"system_notification_request"
|
|
24
|
+
],
|
|
25
|
+
"filter_types": [
|
|
26
|
+
"content"
|
|
27
|
+
],
|
|
28
|
+
"search": "",
|
|
29
|
+
"sort_by": "created_at",
|
|
30
|
+
"sort_type": "descending"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid": "cc675fbe-e11f-46b0-beb2-a7a473a2eeb6", "shortname": "collections", "is_active": true, "tags": [], "created_at": "2022-11-29T14:05:46.485769", "updated_at": "2023-08-14T12:27:07.997484", "owner_shortname": "dmart", "payload": {"content_type": "json", "schema_shortname": "folder_rendering", "body": "collections.json"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"shortname_title": "collections", "index_attributes": [{"key": "shortname", "name": "id"}, {"key": "schema_shortname", "name": "type"}, {"key": "displayname", "name": "name"}], "allow_create": true, "allow_update": false, "allow_delete": false, "use_media": false, "content_schema_shortnames": ["channel"], "expand_children": true, "icon": "BSICons508", "filter": [], "content_resource_types": ["content"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid": "74f1766d-e00f-43ec-9b50-161075528d72", "shortname": "groups", "is_active": true, "tags": [], "created_at": "2022-08-23T07:44:36.399780", "updated_at": "2023-04-10T03:47:17.396214", "owner_shortname": "dmart", "payload": {"content_type": "json", "schema_shortname": "folder_rendering", "body": "groups.json"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"shortname_title": "Group Shortname", "content_schema_shortnames": [], "index_attributes": [{"key": "shortname", "name": "Name"}, {"key": "members[0]", "name": "Members"}], "allow_create": false, "allow_update": false, "allow_delete": false, "use_media": false, "filter": [], "allow_view": true}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid": "f299801d-b889-450c-aa22-c8c5d1ea46fe", "shortname": "health_check", "is_active": true, "tags": [], "created_at": "2023-02-27T15:13:07.854234", "updated_at": "2023-07-26T12:44:50.587168", "owner_shortname": "dmart", "payload": {"content_type": "json", "schema_shortname": "folder_rendering", "body": "health_check.json"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"enable_pdf_schema_shortnames": [], "content_schema_shortnames": [], "content_resource_types": [], "workflow_shortnames": [], "index_attributes": [{"key": "shortname", "name": "name"}], "search_columns": [], "filter": [], "shortname_title": "", "icon_closed": "", "icon_opened": "", "icon": "", "allow_create_category": false, "expand_children": false, "allow_create": false, "disable_filter": false, "allow_update": false, "allow_delete": false, "allow_view": false, "use_media": false, "allow_csv": false, "append_subpath": "", "sort_by": "created_at", "sort_type": "ascending", "query": {"search": "", "type": "search"}}
|