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.
Files changed (489) hide show
  1. dmart/__init__.py +7 -0
  2. dmart/alembic/README +1 -0
  3. dmart/alembic/__init__.py +0 -0
  4. dmart/alembic/env.py +91 -0
  5. dmart/alembic/notes.txt +11 -0
  6. dmart/alembic/script.py.mako +28 -0
  7. dmart/alembic/scripts/__init__.py +0 -0
  8. dmart/alembic/scripts/calculate_checksums.py +77 -0
  9. dmart/alembic/scripts/migration_f7a4949eed19.py +28 -0
  10. dmart/alembic/versions/0f3d2b1a7c21_add_authz_materialized_views.py +87 -0
  11. dmart/alembic/versions/10d2041b94d4_last_checksum_history.py +62 -0
  12. dmart/alembic/versions/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.py +33 -0
  13. dmart/alembic/versions/26bfe19b49d4_rm_failedloginattempts.py +42 -0
  14. dmart/alembic/versions/3c8bca2219cc_add_otp_table.py +38 -0
  15. dmart/alembic/versions/6675fd9dfe42_remove_unique_from_sessions_table.py +36 -0
  16. dmart/alembic/versions/71bc1df82e6a_adding_user_last_login_at.py +43 -0
  17. dmart/alembic/versions/74288ccbd3b5_initial.py +264 -0
  18. dmart/alembic/versions/7520a89a8467_rm_activesession_table.py +39 -0
  19. dmart/alembic/versions/848b623755a4_make_created_nd_updated_at_required.py +138 -0
  20. dmart/alembic/versions/8640dcbebf85_add_notes_to_users.py +32 -0
  21. dmart/alembic/versions/91c94250232a_adding_fk_on_owner_shortname.py +104 -0
  22. dmart/alembic/versions/98ecd6f56f9a_ext_meta_with_owner_group_shortname.py +66 -0
  23. dmart/alembic/versions/9aae9138c4ef_indexing_created_at_updated_at.py +80 -0
  24. dmart/alembic/versions/__init__.py +0 -0
  25. dmart/alembic/versions/b53f916b3f6d_json_to_jsonb.py +492 -0
  26. dmart/alembic/versions/eb5f1ec65156_adding_user_locked_to_device.py +36 -0
  27. dmart/alembic/versions/f7a4949eed19_adding_query_policies_to_meta.py +60 -0
  28. dmart/alembic.ini +117 -0
  29. dmart/api/__init__.py +0 -0
  30. dmart/api/info/__init__.py +0 -0
  31. dmart/api/info/router.py +109 -0
  32. dmart/api/managed/__init__.py +0 -0
  33. dmart/api/managed/router.py +1541 -0
  34. dmart/api/managed/utils.py +1879 -0
  35. dmart/api/public/__init__.py +0 -0
  36. dmart/api/public/router.py +758 -0
  37. dmart/api/qr/__init__.py +0 -0
  38. dmart/api/qr/router.py +108 -0
  39. dmart/api/user/__init__.py +0 -0
  40. dmart/api/user/model/__init__.py +0 -0
  41. dmart/api/user/model/errors.py +14 -0
  42. dmart/api/user/model/requests.py +165 -0
  43. dmart/api/user/model/responses.py +11 -0
  44. dmart/api/user/router.py +1413 -0
  45. dmart/api/user/service.py +270 -0
  46. dmart/bundler.py +52 -0
  47. dmart/cli.py +1133 -0
  48. dmart/config/__init__.py +0 -0
  49. dmart/config/channels.json +11 -0
  50. dmart/config/notification.json +17 -0
  51. dmart/config.env.sample +27 -0
  52. dmart/config.ini.sample +7 -0
  53. dmart/conftest.py +13 -0
  54. dmart/curl.sh +196 -0
  55. dmart/cxb/__init__.py +0 -0
  56. dmart/cxb/assets/@codemirror-Rn7_6DkE.js +10 -0
  57. dmart/cxb/assets/@edraj-CS4NwVbD.js +1 -0
  58. dmart/cxb/assets/@floating-ui-BwwcF-xh.js +1 -0
  59. dmart/cxb/assets/@formatjs-yKEsAtjs.js +1 -0
  60. dmart/cxb/assets/@fortawesome-DRW1UCdr.js +9 -0
  61. dmart/cxb/assets/@jsonquerylang-laKNoFFq.js +12 -0
  62. dmart/cxb/assets/@lezer-za4Q-8Ew.js +1 -0
  63. dmart/cxb/assets/@marijn-DXwl3gUT.js +1 -0
  64. dmart/cxb/assets/@popperjs-l0sNRNKZ.js +1 -0
  65. dmart/cxb/assets/@replit--ERk53eB.js +1 -0
  66. dmart/cxb/assets/@roxi-CGMFK4i8.js +6 -0
  67. dmart/cxb/assets/@typewriter-cCzskkIv.js +17 -0
  68. dmart/cxb/assets/@zerodevx-BlBZjKxu.js +1 -0
  69. dmart/cxb/assets/@zerodevx-CVEpe6WZ.css +1 -0
  70. dmart/cxb/assets/BreadCrumbLite-DAhOx38v.js +1 -0
  71. dmart/cxb/assets/EntryRenderer-CCqV8Rkg.js +32 -0
  72. dmart/cxb/assets/EntryRenderer-DXytdFp9.css +1 -0
  73. dmart/cxb/assets/ListView-BQelo7vZ.js +16 -0
  74. dmart/cxb/assets/ListView-U8of-_c-.css +1 -0
  75. dmart/cxb/assets/Prism--hMplq-p.js +3 -0
  76. dmart/cxb/assets/Prism-Uh6uStUw.css +1 -0
  77. dmart/cxb/assets/Table2Cols-BsbwicQm.js +1 -0
  78. dmart/cxb/assets/_..-BvT6vdHa.css +1 -0
  79. dmart/cxb/assets/_...404_-fuLH_rX9.js +2 -0
  80. dmart/cxb/assets/_...fallback_-Ba_NLmAE.js +1 -0
  81. dmart/cxb/assets/_module-3HrtKAWo.js +3 -0
  82. dmart/cxb/assets/_module-DFKFq0AM.js +4 -0
  83. dmart/cxb/assets/_module-Dgq0ZVtz.js +1 -0
  84. dmart/cxb/assets/ajv-Cpj98o6Y.js +1 -0
  85. dmart/cxb/assets/axios-CG2WSiiR.js +6 -0
  86. dmart/cxb/assets/clsx-B-dksMZM.js +1 -0
  87. dmart/cxb/assets/codemirror-wrapped-line-indent-DPhKvljI.js +1 -0
  88. dmart/cxb/assets/compare-C3AjiGFR.js +1 -0
  89. dmart/cxb/assets/compute-scroll-into-view-Bl8rNFhg.js +1 -0
  90. dmart/cxb/assets/consolite-DlCuI0F9.js +1 -0
  91. dmart/cxb/assets/crelt-C8TCjufn.js +1 -0
  92. dmart/cxb/assets/date-fns-l0sNRNKZ.js +1 -0
  93. dmart/cxb/assets/deepmerge-rn4rBaHU.js +1 -0
  94. dmart/cxb/assets/dmart_services-AL6-IdDE.js +1 -0
  95. dmart/cxb/assets/downloadFile-D08i0YDh.js +1 -0
  96. dmart/cxb/assets/easy-signal-BiPFIK3O.js +1 -0
  97. dmart/cxb/assets/esm-env-rsSWfq8L.js +1 -0
  98. dmart/cxb/assets/export-OF_rTiXu.js +1 -0
  99. dmart/cxb/assets/fast-deep-equal-l0sNRNKZ.js +1 -0
  100. dmart/cxb/assets/fast-diff-C-IidNf4.js +1 -0
  101. dmart/cxb/assets/fast-uri-l0sNRNKZ.js +1 -0
  102. dmart/cxb/assets/flowbite-svelte-BLvjb-sa.js +1 -0
  103. dmart/cxb/assets/flowbite-svelte-CD54FDqW.css +1 -0
  104. dmart/cxb/assets/flowbite-svelte-icons-BI8GVhw_.js +1 -0
  105. dmart/cxb/assets/github-slugger-CQ4oX9Ud.js +1 -0
  106. dmart/cxb/assets/global-igKv-1g9.js +1 -0
  107. dmart/cxb/assets/hookar-BMRD9G9H.js +1 -0
  108. dmart/cxb/assets/immutable-json-patch-DtRO2E_S.js +1 -0
  109. dmart/cxb/assets/import-1vE3gBat.js +1 -0
  110. dmart/cxb/assets/index-B-eTh-ZX.js +1 -0
  111. dmart/cxb/assets/index-BSsK-X71.js +1 -0
  112. dmart/cxb/assets/index-BVyxzKtH.js +1 -0
  113. dmart/cxb/assets/index-BdeNM69f.js +1 -0
  114. dmart/cxb/assets/index-CC-A1ipE.js +1 -0
  115. dmart/cxb/assets/index-CQohGiYB.js +1 -0
  116. dmart/cxb/assets/index-ChjnkpdZ.js +4 -0
  117. dmart/cxb/assets/index-DLP7csA4.js +1 -0
  118. dmart/cxb/assets/index-DTfhnhwd.js +1 -0
  119. dmart/cxb/assets/index-DdXRK7n9.js +2 -0
  120. dmart/cxb/assets/index-DtiCmB4o.js +1 -0
  121. dmart/cxb/assets/index-NBrXBlLA.css +2 -0
  122. dmart/cxb/assets/index-X1uNehO7.js +1 -0
  123. dmart/cxb/assets/index-nrQW6Nrr.js +1 -0
  124. dmart/cxb/assets/info-B986lRiM.js +1 -0
  125. dmart/cxb/assets/intl-messageformat-Dc5UU-HB.js +3 -0
  126. dmart/cxb/assets/jmespath-l0sNRNKZ.js +1 -0
  127. dmart/cxb/assets/json-schema-traverse-l0sNRNKZ.js +1 -0
  128. dmart/cxb/assets/json-source-map-DRgZidqy.js +5 -0
  129. dmart/cxb/assets/jsonpath-plus-l0sNRNKZ.js +1 -0
  130. dmart/cxb/assets/jsonrepair-B30Dx381.js +8 -0
  131. dmart/cxb/assets/lodash-es-DZVAA2ox.js +1 -0
  132. dmart/cxb/assets/marked-DKjyhwJX.js +56 -0
  133. dmart/cxb/assets/marked-gfm-heading-id-U5zO829x.js +2 -0
  134. dmart/cxb/assets/marked-mangle-CDMeiHC6.js +1 -0
  135. dmart/cxb/assets/memoize-one-BdPwpGay.js +1 -0
  136. dmart/cxb/assets/natural-compare-lite-Bg2Xcf-o.js +7 -0
  137. dmart/cxb/assets/pagination-svelte-D5CyoiE_.js +13 -0
  138. dmart/cxb/assets/pagination-svelte-v10nAbbM.css +1 -0
  139. dmart/cxb/assets/plantuml-encoder-C47mzt9T.js +1 -0
  140. dmart/cxb/assets/prismjs-DTUiLGJu.js +9 -0
  141. dmart/cxb/assets/profile-BUf-tKMe.js +1 -0
  142. dmart/cxb/assets/query-CNmXTsgf.js +1 -0
  143. dmart/cxb/assets/queryHelpers-C9iBWwqe.js +1 -0
  144. dmart/cxb/assets/scroll-into-view-if-needed-KR58zyjF.js +1 -0
  145. dmart/cxb/assets/spaces-0oyGvpii.js +1 -0
  146. dmart/cxb/assets/style-mod-Bs6eFhZE.js +3 -0
  147. dmart/cxb/assets/svelte-B2XmcTi_.js +4 -0
  148. dmart/cxb/assets/svelte-awesome-COLlx0DN.css +1 -0
  149. dmart/cxb/assets/svelte-awesome-DhnMA6Q_.js +1 -0
  150. dmart/cxb/assets/svelte-datatables-net-CY7LBj6I.js +1 -0
  151. dmart/cxb/assets/svelte-floating-ui-BlS3sOAQ.js +1 -0
  152. dmart/cxb/assets/svelte-i18n-CT2KkQaN.js +3 -0
  153. dmart/cxb/assets/svelte-jsoneditor-BzfX6Usi.css +1 -0
  154. dmart/cxb/assets/svelte-jsoneditor-CUGSvWId.js +25 -0
  155. dmart/cxb/assets/svelte-select-CegQKzqH.css +1 -0
  156. dmart/cxb/assets/svelte-select-CjHAt_85.js +6 -0
  157. dmart/cxb/assets/tailwind-merge-CJvxXMcu.js +1 -0
  158. dmart/cxb/assets/tailwind-variants-Cj20BoQ3.js +1 -0
  159. dmart/cxb/assets/toast-B9WDyfyI.js +1 -0
  160. dmart/cxb/assets/tslib-pJfR_DrR.js +1 -0
  161. dmart/cxb/assets/typewriter-editor-DkTVIJdm.js +25 -0
  162. dmart/cxb/assets/user-DeK_NB5v.js +1 -0
  163. dmart/cxb/assets/vanilla-picker-l5rcX3cq.js +8 -0
  164. dmart/cxb/assets/w3c-keyname-Vcq4gwWv.js +1 -0
  165. dmart/cxb/config.json +11 -0
  166. dmart/cxb/config.sample.json +11 -0
  167. dmart/cxb/favicon.ico +0 -0
  168. dmart/cxb/favicon.png +0 -0
  169. dmart/cxb/index.html +28 -0
  170. dmart/data_adapters/__init__.py +0 -0
  171. dmart/data_adapters/adapter.py +16 -0
  172. dmart/data_adapters/base_data_adapter.py +467 -0
  173. dmart/data_adapters/file/__init__.py +0 -0
  174. dmart/data_adapters/file/adapter.py +2043 -0
  175. dmart/data_adapters/file/adapter_helpers.py +1013 -0
  176. dmart/data_adapters/file/archive.py +150 -0
  177. dmart/data_adapters/file/create_index.py +331 -0
  178. dmart/data_adapters/file/create_users_folders.py +52 -0
  179. dmart/data_adapters/file/custom_validations.py +68 -0
  180. dmart/data_adapters/file/drop_index.py +40 -0
  181. dmart/data_adapters/file/health_check.py +560 -0
  182. dmart/data_adapters/file/redis_services.py +1110 -0
  183. dmart/data_adapters/helpers.py +27 -0
  184. dmart/data_adapters/sql/__init__.py +0 -0
  185. dmart/data_adapters/sql/adapter.py +3218 -0
  186. dmart/data_adapters/sql/adapter_helpers.py +491 -0
  187. dmart/data_adapters/sql/create_tables.py +451 -0
  188. dmart/data_adapters/sql/create_users_folders.py +53 -0
  189. dmart/data_adapters/sql/db_to_json_migration.py +485 -0
  190. dmart/data_adapters/sql/health_check_sql.py +232 -0
  191. dmart/data_adapters/sql/json_to_db_migration.py +454 -0
  192. dmart/data_adapters/sql/update_query_policies.py +101 -0
  193. dmart/data_generator.py +81 -0
  194. dmart/dmart.py +761 -0
  195. dmart/get_settings.py +7 -0
  196. dmart/hypercorn_config.toml +3 -0
  197. dmart/info.json +1 -0
  198. dmart/languages/__init__.py +0 -0
  199. dmart/languages/arabic.json +15 -0
  200. dmart/languages/english.json +16 -0
  201. dmart/languages/kurdish.json +14 -0
  202. dmart/languages/loader.py +12 -0
  203. dmart/login_creds.sh +7 -0
  204. dmart/login_creds.sh.sample +7 -0
  205. dmart/main.py +563 -0
  206. dmart/manifest.sh +12 -0
  207. dmart/migrate.py +24 -0
  208. dmart/models/__init__.py +0 -0
  209. dmart/models/api.py +203 -0
  210. dmart/models/core.py +597 -0
  211. dmart/models/enums.py +255 -0
  212. dmart/password_gen.py +8 -0
  213. dmart/plugins/__init__.py +0 -0
  214. dmart/plugins/action_log/__init__.py +0 -0
  215. dmart/plugins/action_log/config.json +13 -0
  216. dmart/plugins/action_log/plugin.py +121 -0
  217. dmart/plugins/admin_notification_sender/__init__.py +0 -0
  218. dmart/plugins/admin_notification_sender/config.json +13 -0
  219. dmart/plugins/admin_notification_sender/plugin.py +124 -0
  220. dmart/plugins/ldap_manager/__init__.py +0 -0
  221. dmart/plugins/ldap_manager/config.json +12 -0
  222. dmart/plugins/ldap_manager/dmart.schema +146 -0
  223. dmart/plugins/ldap_manager/plugin.py +100 -0
  224. dmart/plugins/ldap_manager/slapd.conf +53 -0
  225. dmart/plugins/local_notification/__init__.py +0 -0
  226. dmart/plugins/local_notification/config.json +13 -0
  227. dmart/plugins/local_notification/plugin.py +123 -0
  228. dmart/plugins/realtime_updates_notifier/__init__.py +0 -0
  229. dmart/plugins/realtime_updates_notifier/config.json +12 -0
  230. dmart/plugins/realtime_updates_notifier/plugin.py +58 -0
  231. dmart/plugins/redis_db_update/__init__.py +0 -0
  232. dmart/plugins/redis_db_update/config.json +13 -0
  233. dmart/plugins/redis_db_update/plugin.py +188 -0
  234. dmart/plugins/resource_folders_creation/__init__.py +0 -0
  235. dmart/plugins/resource_folders_creation/config.json +12 -0
  236. dmart/plugins/resource_folders_creation/plugin.py +81 -0
  237. dmart/plugins/system_notification_sender/__init__.py +0 -0
  238. dmart/plugins/system_notification_sender/config.json +13 -0
  239. dmart/plugins/system_notification_sender/plugin.py +188 -0
  240. dmart/plugins/update_access_controls/__init__.py +0 -0
  241. dmart/plugins/update_access_controls/config.json +12 -0
  242. dmart/plugins/update_access_controls/plugin.py +9 -0
  243. dmart/publish.sh +57 -0
  244. dmart/pylint.sh +16 -0
  245. dmart/pyrightconfig.json +7 -0
  246. dmart/redis_connections.sh +13 -0
  247. dmart/reload.sh +56 -0
  248. dmart/run.sh +3 -0
  249. dmart/run_notification_campaign.py +85 -0
  250. dmart/sample/spaces/applications/.dm/meta.space.json +30 -0
  251. dmart/sample/spaces/applications/api/.dm/meta.folder.json +1 -0
  252. dmart/sample/spaces/applications/api/.dm/query_all_applications/meta.content.json +1 -0
  253. dmart/sample/spaces/applications/api/.dm/test_by_saad/attachments.media/meta.warframe.json +1 -0
  254. dmart/sample/spaces/applications/api/.dm/test_by_saad/attachments.media/warframe.png +0 -0
  255. dmart/sample/spaces/applications/api/.dm/test_by_saad/meta.content.json +1 -0
  256. dmart/sample/spaces/applications/api/.dm/user_profile/meta.content.json +1 -0
  257. dmart/sample/spaces/applications/api/applications/.dm/create_log/meta.content.json +1 -0
  258. dmart/sample/spaces/applications/api/applications/.dm/create_public_logs/meta.content.json +1 -0
  259. dmart/sample/spaces/applications/api/applications/.dm/meta.folder.json +1 -0
  260. dmart/sample/spaces/applications/api/applications/.dm/query_all_translated_data/meta.content.json +1 -0
  261. dmart/sample/spaces/applications/api/applications/.dm/query_logs/meta.content.json +1 -0
  262. dmart/sample/spaces/applications/api/applications/.dm/query_translated_enums/meta.content.json +1 -0
  263. dmart/sample/spaces/applications/api/applications/.dm/query_translated_others/meta.content.json +1 -0
  264. dmart/sample/spaces/applications/api/applications/.dm/query_translated_resolution/meta.content.json +1 -0
  265. dmart/sample/spaces/applications/api/applications/create_log.json +1 -0
  266. dmart/sample/spaces/applications/api/applications/create_public_logs.json +1 -0
  267. dmart/sample/spaces/applications/api/applications/query_all_translated_data.json +1 -0
  268. dmart/sample/spaces/applications/api/applications/query_logs.json +1 -0
  269. dmart/sample/spaces/applications/api/applications/query_translated_enums.json +1 -0
  270. dmart/sample/spaces/applications/api/applications/query_translated_others.json +1 -0
  271. dmart/sample/spaces/applications/api/applications/query_translated_resolution.json +1 -0
  272. dmart/sample/spaces/applications/api/applications.json +1 -0
  273. dmart/sample/spaces/applications/api/management/.dm/create_subaccount/meta.content.json +1 -0
  274. dmart/sample/spaces/applications/api/management/.dm/meta.folder.json +1 -0
  275. dmart/sample/spaces/applications/api/management/.dm/update_password/meta.content.json +1 -0
  276. dmart/sample/spaces/applications/api/management/create_subaccount.json +53 -0
  277. dmart/sample/spaces/applications/api/management/update_password.json +1 -0
  278. dmart/sample/spaces/applications/api/management.json +1 -0
  279. dmart/sample/spaces/applications/api/query_all_applications.json +15 -0
  280. dmart/sample/spaces/applications/api/test_by_saad.json +1 -0
  281. dmart/sample/spaces/applications/api/user/.dm/meta.folder.json +1 -0
  282. dmart/sample/spaces/applications/api/user/.dm/test_by_saad/meta.content.json +1 -0
  283. dmart/sample/spaces/applications/api/user/.dm/user_profile/meta.content.json +1 -0
  284. dmart/sample/spaces/applications/api/user/test_by_saad.json +1 -0
  285. dmart/sample/spaces/applications/api/user/user_profile.json +1 -0
  286. dmart/sample/spaces/applications/api/user_profile.json +1 -0
  287. dmart/sample/spaces/applications/api.json +1 -0
  288. dmart/sample/spaces/applications/collections/.dm/meta.folder.json +19 -0
  289. dmart/sample/spaces/applications/collections.json +1 -0
  290. dmart/sample/spaces/applications/configurations/.dm/meta.folder.json +1 -0
  291. dmart/sample/spaces/applications/configurations/time_out.json +1 -0
  292. dmart/sample/spaces/applications/configurations.json +19 -0
  293. dmart/sample/spaces/applications/errors.json +1 -0
  294. dmart/sample/spaces/applications/logs/.dm/meta.folder.json +1 -0
  295. dmart/sample/spaces/applications/logs.json +1 -0
  296. dmart/sample/spaces/applications/queries/.dm/meta.folder.json +1 -0
  297. dmart/sample/spaces/applications/queries/.dm/order/meta.content.json +1 -0
  298. dmart/sample/spaces/applications/queries/order.json +1 -0
  299. dmart/sample/spaces/applications/queries.json +1 -0
  300. dmart/sample/spaces/applications/schema/.dm/api/meta.schema.json +1 -0
  301. dmart/sample/spaces/applications/schema/.dm/configuration/meta.schema.json +1 -0
  302. dmart/sample/spaces/applications/schema/.dm/error/meta.schema.json +1 -0
  303. dmart/sample/spaces/applications/schema/.dm/log/meta.schema.json +1 -0
  304. dmart/sample/spaces/applications/schema/.dm/meta.folder.json +1 -0
  305. dmart/sample/spaces/applications/schema/.dm/query/meta.schema.json +16 -0
  306. dmart/sample/spaces/applications/schema/.dm/translation/meta.schema.json +1 -0
  307. dmart/sample/spaces/applications/schema/api.json +28 -0
  308. dmart/sample/spaces/applications/schema/configuration.json +1 -0
  309. dmart/sample/spaces/applications/schema/error.json +43 -0
  310. dmart/sample/spaces/applications/schema/log.json +1 -0
  311. dmart/sample/spaces/applications/schema/query.json +118 -0
  312. dmart/sample/spaces/applications/schema/translation.json +26 -0
  313. dmart/sample/spaces/applications/schema.json +1 -0
  314. dmart/sample/spaces/applications/translations/.dm/meta.folder.json +1 -0
  315. dmart/sample/spaces/applications/translations.json +1 -0
  316. dmart/sample/spaces/archive/.dm/meta.space.json +27 -0
  317. dmart/sample/spaces/custom_plugins/dummy/__pycache__/plugin.cpython-314.pyc +0 -0
  318. dmart/sample/spaces/custom_plugins/dummy/config.json +28 -0
  319. dmart/sample/spaces/custom_plugins/dummy/plugin.py +6 -0
  320. dmart/sample/spaces/custom_plugins/missed_entry/config.json +12 -0
  321. dmart/sample/spaces/custom_plugins/missed_entry/plugin.py +119 -0
  322. dmart/sample/spaces/custom_plugins/own_changed_notification/__pycache__/plugin.cpython-314.pyc +0 -0
  323. dmart/sample/spaces/custom_plugins/own_changed_notification/config.json +12 -0
  324. dmart/sample/spaces/custom_plugins/own_changed_notification/plugin.py +65 -0
  325. dmart/sample/spaces/custom_plugins/reports_stats/config.json +14 -0
  326. dmart/sample/spaces/custom_plugins/reports_stats/plugin.py +82 -0
  327. dmart/sample/spaces/custom_plugins/system_notification_sender/config.json +22 -0
  328. dmart/sample/spaces/custom_plugins/system_notification_sender/notification.py +268 -0
  329. dmart/sample/spaces/custom_plugins/system_notification_sender/plugin.py +98 -0
  330. dmart/sample/spaces/management/.dm/events.jsonl +32 -0
  331. dmart/sample/spaces/management/.dm/meta.space.json +48 -0
  332. dmart/sample/spaces/management/.dm/notifications/attachments.view.json/admin.json +36 -0
  333. dmart/sample/spaces/management/.dm/notifications/attachments.view.json/meta.admin.json +1 -0
  334. dmart/sample/spaces/management/.dm/notifications/attachments.view.json/meta.system.json +1 -0
  335. dmart/sample/spaces/management/.dm/notifications/attachments.view.json/system.json +32 -0
  336. dmart/sample/spaces/management/collections/.dm/meta.folder.json +1 -0
  337. dmart/sample/spaces/management/collections.json +1 -0
  338. dmart/sample/spaces/management/groups/.dm/meta.folder.json +1 -0
  339. dmart/sample/spaces/management/groups.json +1 -0
  340. dmart/sample/spaces/management/health_check/.dm/meta.folder.json +1 -0
  341. dmart/sample/spaces/management/health_check.json +1 -0
  342. dmart/sample/spaces/management/notifications/.dm/meta.folder.json +1 -0
  343. dmart/sample/spaces/management/notifications/admin/.dm/meta.folder.json +9 -0
  344. dmart/sample/spaces/management/notifications/system/.dm/meta.folder.json +9 -0
  345. dmart/sample/spaces/management/notifications.json +1 -0
  346. dmart/sample/spaces/management/permissions/.dm/access_applications/meta.permission.json +31 -0
  347. dmart/sample/spaces/management/permissions/.dm/access_applications_world/meta.permission.json +31 -0
  348. dmart/sample/spaces/management/permissions/.dm/access_messages/meta.permission.json +23 -0
  349. dmart/sample/spaces/management/permissions/.dm/access_personal/meta.permission.json +40 -0
  350. dmart/sample/spaces/management/permissions/.dm/access_protected/meta.permission.json +33 -0
  351. dmart/sample/spaces/management/permissions/.dm/access_public/meta.permission.json +24 -0
  352. dmart/sample/spaces/management/permissions/.dm/browse_all_folders/meta.permission.json +23 -0
  353. dmart/sample/spaces/management/permissions/.dm/create_log/meta.permission.json +24 -0
  354. dmart/sample/spaces/management/permissions/.dm/interviewer/meta.permission.json +1 -0
  355. dmart/sample/spaces/management/permissions/.dm/manage_applications/meta.permission.json +1 -0
  356. dmart/sample/spaces/management/permissions/.dm/manage_debug/meta.permission.json +25 -0
  357. dmart/sample/spaces/management/permissions/.dm/manage_spaces/meta.permission.json +24 -0
  358. dmart/sample/spaces/management/permissions/.dm/meta.folder.json +1 -0
  359. dmart/sample/spaces/management/permissions/.dm/rules_management_default/meta.permission.json +32 -0
  360. dmart/sample/spaces/management/permissions/.dm/super_manager/meta.permission.json +52 -0
  361. dmart/sample/spaces/management/permissions/.dm/view_activity_log/meta.permission.json +26 -0
  362. dmart/sample/spaces/management/permissions/.dm/view_collections/meta.permission.json +29 -0
  363. dmart/sample/spaces/management/permissions/.dm/view_logs/meta.permission.json +30 -0
  364. dmart/sample/spaces/management/permissions/.dm/view_roles/meta.permission.json +29 -0
  365. dmart/sample/spaces/management/permissions/.dm/view_users/meta.permission.json +25 -0
  366. dmart/sample/spaces/management/permissions/.dm/view_world/meta.permission.json +31 -0
  367. dmart/sample/spaces/management/permissions/.dm/world/meta.permission.json +35 -0
  368. dmart/sample/spaces/management/permissions.json +1 -0
  369. dmart/sample/spaces/management/requests.json +1 -0
  370. dmart/sample/spaces/management/roles/.dm/dummy/meta.role.json +12 -0
  371. dmart/sample/spaces/management/roles/.dm/logged_in/meta.role.json +18 -0
  372. dmart/sample/spaces/management/roles/.dm/manager/meta.role.json +13 -0
  373. dmart/sample/spaces/management/roles/.dm/meta.folder.json +1 -0
  374. dmart/sample/spaces/management/roles/.dm/moderator/meta.role.json +13 -0
  375. dmart/sample/spaces/management/roles/.dm/super_admin/meta.role.json +14 -0
  376. dmart/sample/spaces/management/roles/.dm/test_role/meta.role.json +13 -0
  377. dmart/sample/spaces/management/roles/.dm/world/meta.role.json +15 -0
  378. dmart/sample/spaces/management/roles.json +1 -0
  379. dmart/sample/spaces/management/schema/.dm/admin_notification_request/attachments.media/meta.ui_schema.json +10 -0
  380. dmart/sample/spaces/management/schema/.dm/admin_notification_request/attachments.media/ui_schema.json +32 -0
  381. dmart/sample/spaces/management/schema/.dm/admin_notification_request/meta.schema.json +1 -0
  382. dmart/sample/spaces/management/schema/.dm/api/meta.schema.json +1 -0
  383. dmart/sample/spaces/management/schema/.dm/folder_rendering/meta.schema.json +1 -0
  384. dmart/sample/spaces/management/schema/.dm/health_check/meta.schema.json +17 -0
  385. dmart/sample/spaces/management/schema/.dm/meta.folder.json +1 -0
  386. dmart/sample/spaces/management/schema/.dm/meta_schema/meta.schema.json +1 -0
  387. dmart/sample/spaces/management/schema/.dm/metafile/meta.schema.json +14 -0
  388. dmart/sample/spaces/management/schema/.dm/notification/meta.schema.json +1 -0
  389. dmart/sample/spaces/management/schema/.dm/system_notification_request/attachments.media/meta.ui_schema.json +10 -0
  390. dmart/sample/spaces/management/schema/.dm/system_notification_request/attachments.media/ui_schema.json +32 -0
  391. dmart/sample/spaces/management/schema/.dm/system_notification_request/meta.schema.json +1 -0
  392. dmart/sample/spaces/management/schema/.dm/view/meta.schema.json +1 -0
  393. dmart/sample/spaces/management/schema/.dm/workflow/meta.schema.json +1 -0
  394. dmart/sample/spaces/management/schema/admin_notification_request.json +89 -0
  395. dmart/sample/spaces/management/schema/api.json +1 -0
  396. dmart/sample/spaces/management/schema/folder_rendering.json +238 -0
  397. dmart/sample/spaces/management/schema/health_check.json +8 -0
  398. dmart/sample/spaces/management/schema/meta_schema.json +74 -0
  399. dmart/sample/spaces/management/schema/metafile.json +153 -0
  400. dmart/sample/spaces/management/schema/notification.json +28 -0
  401. dmart/sample/spaces/management/schema/system_notification_request.json +57 -0
  402. dmart/sample/spaces/management/schema/view.json +23 -0
  403. dmart/sample/spaces/management/schema/workflow.json +87 -0
  404. dmart/sample/spaces/management/schema.json +1 -0
  405. dmart/sample/spaces/management/users/.dm/alibaba/meta.user.json +23 -0
  406. dmart/sample/spaces/management/users/.dm/anonymous/meta.user.json +18 -0
  407. dmart/sample/spaces/management/users/.dm/dmart/meta.user.json +26 -0
  408. dmart/sample/spaces/management/users/.dm/meta.folder.json +14 -0
  409. dmart/sample/spaces/management/workflows/.dm/channel/meta.content.json +1 -0
  410. dmart/sample/spaces/management/workflows/.dm/meta.folder.json +1 -0
  411. dmart/sample/spaces/management/workflows/channel.json +148 -0
  412. dmart/sample/spaces/management/workflows.json +1 -0
  413. dmart/sample/spaces/maqola/.dm/meta.space.json +33 -0
  414. dmart/sample/spaces/personal/.dm/meta.space.json +24 -0
  415. dmart/sample/spaces/personal/people/.dm/meta.folder.json +1 -0
  416. dmart/sample/spaces/personal/people/dmart/.dm/meta.folder.json +1 -0
  417. dmart/sample/spaces/personal/people/dmart/messages/.dm/0b5f7e7f/meta.content.json +1 -0
  418. dmart/sample/spaces/personal/people/dmart/messages/.dm/meta.folder.json +1 -0
  419. dmart/sample/spaces/personal/people/dmart/messages/.dm/mytest/meta.content.json +1 -0
  420. dmart/sample/spaces/personal/people/dmart/messages/0b5f7e7f.json +1 -0
  421. dmart/sample/spaces/personal/people/dmart/messages/mytest.json +1 -0
  422. dmart/sample/spaces/personal/people/dmart/notifications/.dm/meta.folder.json +1 -0
  423. dmart/sample/spaces/personal/people/dmart/private/.dm/inner/meta.content.json +1 -0
  424. dmart/sample/spaces/personal/people/dmart/private/.dm/meta.folder.json +1 -0
  425. dmart/sample/spaces/personal/people/dmart/private/inner.json +1 -0
  426. dmart/sample/spaces/personal/people/dmart/protected/.dm/avatar/meta.content.json +1 -0
  427. dmart/sample/spaces/personal/people/dmart/protected/.dm/meta.folder.json +1 -0
  428. dmart/sample/spaces/personal/people/dmart/protected/avatar.png +0 -0
  429. dmart/sample/spaces/personal/people/dmart/public/.dm/meta.folder.json +1 -0
  430. dmart/sample/test/.gitignore +2 -0
  431. dmart/sample/test/createcontent.json +9 -0
  432. dmart/sample/test/createmedia.json +9 -0
  433. dmart/sample/test/createmedia_entry.json +6 -0
  434. dmart/sample/test/createschema.json +8 -0
  435. dmart/sample/test/createschemawork.json +11 -0
  436. dmart/sample/test/createticket.json +13 -0
  437. dmart/sample/test/data.json +4 -0
  438. dmart/sample/test/deletecontent.json +12 -0
  439. dmart/sample/test/logo.jpeg +0 -0
  440. dmart/sample/test/my.jpg +0 -0
  441. dmart/sample/test/myticket.json +23 -0
  442. dmart/sample/test/resources.csv +12 -0
  443. dmart/sample/test/schema.json +16 -0
  444. dmart/sample/test/temp.json +1 -0
  445. dmart/sample/test/test.dmart +45 -0
  446. dmart/sample/test/ticket_schema.json +23 -0
  447. dmart/sample/test/ticket_workflow.json +85 -0
  448. dmart/sample/test/ticketbody.json +4 -0
  449. dmart/sample/test/ticketcontent.json +14 -0
  450. dmart/sample/test/updatecontent.json +20 -0
  451. dmart/sample/test/workflow_schema.json +68 -0
  452. dmart/scheduled_notification_handler.py +121 -0
  453. dmart/schema_migration.py +208 -0
  454. dmart/schema_modulate.py +192 -0
  455. dmart/set_admin_passwd.py +75 -0
  456. dmart/sync.py +202 -0
  457. dmart/test_utils.py +34 -0
  458. dmart/utils/__init__.py +0 -0
  459. dmart/utils/access_control.py +306 -0
  460. dmart/utils/async_request.py +8 -0
  461. dmart/utils/exporter.py +309 -0
  462. dmart/utils/firebase_notifier.py +57 -0
  463. dmart/utils/generate_email.py +37 -0
  464. dmart/utils/helpers.py +352 -0
  465. dmart/utils/hypercorn_config.py +12 -0
  466. dmart/utils/internal_error_code.py +60 -0
  467. dmart/utils/jwt.py +124 -0
  468. dmart/utils/logger.py +167 -0
  469. dmart/utils/middleware.py +99 -0
  470. dmart/utils/notification.py +75 -0
  471. dmart/utils/password_hashing.py +16 -0
  472. dmart/utils/plugin_manager.py +202 -0
  473. dmart/utils/query_policies_helper.py +128 -0
  474. dmart/utils/regex.py +44 -0
  475. dmart/utils/repository.py +529 -0
  476. dmart/utils/router_helper.py +19 -0
  477. dmart/utils/settings.py +212 -0
  478. dmart/utils/sms_notifier.py +21 -0
  479. dmart/utils/social_sso.py +67 -0
  480. dmart/utils/templates/activation.html.j2 +26 -0
  481. dmart/utils/templates/reminder.html.j2 +17 -0
  482. dmart/utils/ticket_sys_utils.py +203 -0
  483. dmart/utils/web_notifier.py +29 -0
  484. dmart/websocket.py +231 -0
  485. dmart-1.4.40.post8.dist-info/METADATA +75 -0
  486. dmart-1.4.40.post8.dist-info/RECORD +489 -0
  487. dmart-1.4.40.post8.dist-info/WHEEL +5 -0
  488. dmart-1.4.40.post8.dist-info/entry_points.txt +2 -0
  489. 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"}}