liberty-framework 6.0.45__tar.gz → 6.0.46__tar.gz

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 (224) hide show
  1. {liberty_framework-6.0.45/liberty_framework.egg-info → liberty_framework-6.0.46}/PKG-INFO +4 -1
  2. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/README.md +3 -0
  3. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__pycache__/api_controller.cpython-312.pyc +0 -0
  4. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__pycache__/setup_controller.cpython-312.pyc +0 -0
  5. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/api_controller.py +3 -1
  6. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/setup_controller.py +7 -1
  7. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/files/logs-frontend-json.log +3 -0
  8. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/files/logs-frontend-text.log +12 -0
  9. liberty_framework-6.0.46/app/models/__pycache__/setup.cpython-312.pyc +0 -0
  10. liberty_framework-6.0.46/app/models/setup.py +44 -0
  11. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/__pycache__/api_routes.cpython-312.pyc +0 -0
  12. liberty_framework-6.0.46/app/routes/__pycache__/setup_routes.cpython-312.pyc +0 -0
  13. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/api_routes.py +63 -1
  14. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/setup_routes.py +40 -2
  15. liberty_framework-6.0.46/app/services/__pycache__/api_rest.cpython-312.pyc +0 -0
  16. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/api_rest.py +96 -5
  17. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/install.cpython-312.pyc +0 -0
  18. liberty_framework-6.0.46/app/setup/services/__pycache__/setup.cpython-312.pyc +0 -0
  19. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/install.py +4 -0
  20. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/setup.py +141 -8
  21. {liberty_framework-6.0.45 → liberty_framework-6.0.46/liberty_framework.egg-info}/PKG-INFO +4 -1
  22. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/setup.py +1 -1
  23. liberty_framework-6.0.45/app/models/__pycache__/setup.cpython-312.pyc +0 -0
  24. liberty_framework-6.0.45/app/models/setup.py +0 -17
  25. liberty_framework-6.0.45/app/routes/__pycache__/setup_routes.cpython-312.pyc +0 -0
  26. liberty_framework-6.0.45/app/services/__pycache__/api_rest.cpython-312.pyc +0 -0
  27. liberty_framework-6.0.45/app/setup/services/__pycache__/setup.cpython-312.pyc +0 -0
  28. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/LICENSE +0 -0
  29. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/MANIFEST.in +0 -0
  30. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/.DS_Store +0 -0
  31. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/__init__.py +0 -0
  32. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/__pycache__/__init__.cpython-312.pyc +0 -0
  33. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/__pycache__/main.cpython-312.pyc +0 -0
  34. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/__pycache__/test.cpython-312.pyc +0 -0
  35. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/README +0 -0
  36. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/__pycache__/__init__.cpython-312.pyc +0 -0
  37. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/__pycache__/env.cpython-312.pyc +0 -0
  38. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/env.py +0 -0
  39. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/script.py.mako +0 -0
  40. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/README +0 -0
  41. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/07301a1e0a40_upgrade.cpython-312.pyc +0 -0
  42. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/6d15b02a5d62_upgrade.cpython-312.pyc +0 -0
  43. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/97ce2af21b7b_upgrade.cpython-312.pyc +0 -0
  44. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/abebaaa0b8b5_upgrade.cpython-312.pyc +0 -0
  45. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/dd5d460a6436_upgrade.cpython-312.pyc +0 -0
  46. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/ecb84318e633_upgrade.cpython-312.pyc +0 -0
  47. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/f93e0f531f2a_upgrade.cpython-312.pyc +0 -0
  48. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic/versions/__pycache__/feb86bf02dac_upgrade.cpython-312.pyc +0 -0
  49. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/alembic.ini +0 -0
  50. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/__init__.py +0 -0
  51. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/__pycache__/__init__.cpython-312.pyc +0 -0
  52. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/__pycache__/oracle.cpython-312.pyc +0 -0
  53. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/__pycache__/postgres.cpython-312.pyc +0 -0
  54. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/oracle.py +0 -0
  55. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/business/postgres.py +0 -0
  56. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/config/__init__.py +0 -0
  57. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/config/__pycache__/__init__.cpython-312.pyc +0 -0
  58. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/config/__pycache__/config.cpython-312.pyc +0 -0
  59. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/config/files/liberty.ini +0 -0
  60. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__init__.py +0 -0
  61. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__pycache__/__init__.cpython-312.pyc +0 -0
  62. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__pycache__/react_controller.cpython-312.pyc +0 -0
  63. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/__pycache__/socket_controller.cpython-312.pyc +0 -0
  64. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/controllers/socket_controller.py +0 -0
  65. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__init__.py +0 -0
  66. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/__init__.cpython-312.pyc +0 -0
  67. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/base_dao.cpython-312.pyc +0 -0
  68. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/config.cpython-312.pyc +0 -0
  69. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/dao_factory.cpython-312.pyc +0 -0
  70. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/ora_dao.cpython-312.pyc +0 -0
  71. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/oracle_dao.cpython-312.pyc +0 -0
  72. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/pg_dao.cpython-312.pyc +0 -0
  73. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/__pycache__/postgres_dao.cpython-312.pyc +0 -0
  74. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/base_dao.py +0 -0
  75. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/ora_dao.py +0 -0
  76. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/database/pg_dao.py +0 -0
  77. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/.DS_Store +0 -0
  78. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/__init__.py +0 -0
  79. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/__pycache__/__init__.cpython-312.pyc +0 -0
  80. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/logs/__pycache__/logs.cpython-312.pyc +0 -0
  81. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/main.py +0 -0
  82. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__init__.py +0 -0
  83. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/__init__.cpython-312.pyc +0 -0
  84. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/ai.cpython-312.pyc +0 -0
  85. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/apidb.cpython-312.pyc +0 -0
  86. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/applications.cpython-312.pyc +0 -0
  87. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/auth.cpython-312.pyc +0 -0
  88. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/base.cpython-312.pyc +0 -0
  89. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/checkdb.cpython-312.pyc +0 -0
  90. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/modules.cpython-312.pyc +0 -0
  91. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/pool.cpython-312.pyc +0 -0
  92. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/__pycache__/themes.cpython-312.pyc +0 -0
  93. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/ai.py +0 -0
  94. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/apidb.py +0 -0
  95. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/applications.py +0 -0
  96. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/auth.py +0 -0
  97. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/base.py +0 -0
  98. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/modules.py +0 -0
  99. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/pool.py +0 -0
  100. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/models/themes.py +0 -0
  101. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/.DS_Store +0 -0
  102. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/__init__.py +0 -0
  103. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/__pycache__/__init__.cpython-312.pyc +0 -0
  104. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/__init__.py +0 -0
  105. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/__pycache__/__init__.cpython-312.pyc +0 -0
  106. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/__pycache__/dump.cpython-312.pyc +0 -0
  107. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/airflow.dump +0 -0
  108. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/gitea.dump +0 -0
  109. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/keycloak.dump +0 -0
  110. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/liberty.dump +0 -0
  111. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/libnetl.dump +0 -0
  112. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/libnjde.dump +0 -0
  113. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/libnsx1.dump +0 -0
  114. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/nomajde.dump +0 -0
  115. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/postgres/dump/nomasx1.dump +0 -0
  116. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/__init__.py +0 -0
  117. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/__pycache__/__init__.cpython-312.pyc +0 -0
  118. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/background_ly-VdfFMP8a.jpg +0 -0
  119. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/index-CBVjFKmW.js +0 -0
  120. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/index-CBVjFKmW.js.map +0 -0
  121. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/index.es-8R5QRthQ-drU8K1aL.js +0 -0
  122. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/index.es-8R5QRthQ-drU8K1aL.js.map +0 -0
  123. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/logo_ly-HGj2PB94.svg +0 -0
  124. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/purify.es-CKk_t3XZ-CHJWMLL4.js +0 -0
  125. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/assets/purify.es-CKk_t3XZ-CHJWMLL4.js.map +0 -0
  126. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/frontend/index.html +0 -0
  127. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/offline/assets/logo_ly.png +0 -0
  128. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/offline/offline.html +0 -0
  129. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/index.html +0 -0
  130. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/setup/assets/background_ly-VdfFMP8a.jpg +0 -0
  131. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/setup/assets/index-BBGAGXd2.css +0 -0
  132. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/setup/assets/index-BnpY-7P6.js +0 -0
  133. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/setup/assets/index-BnpY-7P6.js.map +0 -0
  134. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/public/setup/setup/assets/logo_ly-HGj2PB94.svg +0 -0
  135. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/__init__.py +0 -0
  136. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/__pycache__/__init__.cpython-312.pyc +0 -0
  137. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/__pycache__/react_routes.cpython-312.pyc +0 -0
  138. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/__pycache__/socket_routes.cpython-312.pyc +0 -0
  139. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/react_routes.py +0 -0
  140. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/routes/socket_routes.py +0 -0
  141. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/__init__.py +0 -0
  142. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/__pycache__/__init__.cpython-312.pyc +0 -0
  143. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/__pycache__/alembic.cpython-312.pyc +0 -0
  144. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/__pycache__/db_pool.cpython-312.pyc +0 -0
  145. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/__pycache__/db_query.cpython-312.pyc +0 -0
  146. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/db_pool.py +0 -0
  147. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/services/db_query.py +0 -0
  148. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/__init__.py +0 -0
  149. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/__pycache__/__init__.cpython-312.pyc +0 -0
  150. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/__init__.py +0 -0
  151. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/__pycache__/__init__.cpython-312.pyc +0 -0
  152. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/__pycache__/data.cpython-312.pyc +0 -0
  153. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/liberty.json +0 -0
  154. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/libnetl.json +0 -0
  155. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/libnjde.json +0 -0
  156. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/libnsx1.json +0 -0
  157. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/data/nomasx1.json +0 -0
  158. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__init__.py +0 -0
  159. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/__init__.cpython-312.pyc +0 -0
  160. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/airflow.cpython-312.pyc +0 -0
  161. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/liberty.cpython-312.pyc +0 -0
  162. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/libnetl.cpython-312.pyc +0 -0
  163. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/libnjde.cpython-312.pyc +0 -0
  164. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/libnsx1.cpython-312.pyc +0 -0
  165. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/models.cpython-312.pyc +0 -0
  166. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/__pycache__/nomasx1.cpython-312.pyc +0 -0
  167. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/liberty.py +0 -0
  168. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/models/nomasx1.py +0 -0
  169. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__init__.py +0 -0
  170. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/__init__.cpython-312.pyc +0 -0
  171. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/alembic.cpython-312.pyc +0 -0
  172. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/dump.cpython-312.pyc +0 -0
  173. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/init.cpython-312.pyc +0 -0
  174. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/__pycache__/models.cpython-312.pyc +0 -0
  175. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/alembic.py +0 -0
  176. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/dump.py +0 -0
  177. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/setup/services/models.py +0 -0
  178. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__init__.py +0 -0
  179. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  180. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/common.cpython-312.pyc +0 -0
  181. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/encrypt.cpython-312.pyc +0 -0
  182. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/jwt.cpython-312.pyc +0 -0
  183. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/logs.cpython-312.pyc +0 -0
  184. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/__pycache__/models.cpython-312.pyc +0 -0
  185. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/common.py +0 -0
  186. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/encrypt.py +0 -0
  187. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/jwt.py +0 -0
  188. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/logs.py +0 -0
  189. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/app/utils/test.py +0 -0
  190. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/liberty_framework.egg-info/SOURCES.txt +0 -0
  191. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/liberty_framework.egg-info/dependency_links.txt +0 -0
  192. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/liberty_framework.egg-info/entry_points.txt +0 -0
  193. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/liberty_framework.egg-info/requires.txt +0 -0
  194. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/liberty_framework.egg-info/top_level.txt +0 -0
  195. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/pyproject.toml +0 -0
  196. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/requirements.txt +0 -0
  197. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/setup.cfg +0 -0
  198. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/__init__.py +0 -0
  199. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  200. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/__pycache__/conftest.cpython-312-pytest-8.3.4.pyc +0 -0
  201. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/__pycache__/main.cpython-312.pyc +0 -0
  202. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/__pycache__/test.cpython-312.pyc +0 -0
  203. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/conftest.py +0 -0
  204. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/main.py +0 -0
  205. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__init__.py +0 -0
  206. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/__init__.cpython-312.pyc +0 -0
  207. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_auth_token.cpython-312-pytest-8.3.4.pyc +0 -0
  208. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_auth_user.cpython-312-pytest-8.3.4.pyc +0 -0
  209. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_db_check.cpython-312-pytest-8.3.4.pyc +0 -0
  210. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_db_close.cpython-312-pytest-8.3.4.pyc +0 -0
  211. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_db_open.cpython-312-pytest-8.3.4.pyc +0 -0
  212. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_fmw_applications.cpython-312-pytest-8.3.4.pyc +0 -0
  213. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_fmw_encrypt.cpython-312-pytest-8.3.4.pyc +0 -0
  214. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_fmw_modules.cpython-312-pytest-8.3.4.pyc +0 -0
  215. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/__pycache__/test_fmw_themes.cpython-312-pytest-8.3.4.pyc +0 -0
  216. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_auth_token.py +0 -0
  217. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_auth_user.py +0 -0
  218. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_db_check.py +0 -0
  219. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_db_close.py +0 -0
  220. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_db_open.py +0 -0
  221. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_fmw_applications.py +0 -0
  222. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_fmw_encrypt.py +0 -0
  223. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_fmw_modules.py +0 -0
  224. {liberty_framework-6.0.45 → liberty_framework-6.0.46}/tests/scenarios/test_fmw_themes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: liberty-framework
3
- Version: 6.0.45
3
+ Version: 6.0.46
4
4
  Summary: Liberty Framework
5
5
  Author: Franck Blettner
6
6
  Author-email: franck.blettner@nomana-it.fr
@@ -84,6 +84,9 @@ Dynamic: summary
84
84
  # 📖 Liberty Framework
85
85
  ### A Scalable and Extensible FastAPI and React Framework for Business Applications
86
86
 
87
+ ## Announcements
88
+ - **Release 6.0.46**: Implement call for custom rest api, add drop and create database for framework
89
+
87
90
  🚀 **Liberty Framework** is a powerful, modular, and extensible **FastAPI-based and React-based framework** designed to streamline backend development for business applications. It provides **database management, authentication, real-time socket communication, and more**, making it easy to deploy and scale enterprise solutions.
88
91
 
89
92
  - Online demo is available at [https://liberty.nomana-it.fr](https://liberty.nomana-it.fr)
@@ -1,6 +1,9 @@
1
1
  # 📖 Liberty Framework
2
2
  ### A Scalable and Extensible FastAPI and React Framework for Business Applications
3
3
 
4
+ ## Announcements
5
+ - **Release 6.0.46**: Implement call for custom rest api, add drop and create database for framework
6
+
4
7
  🚀 **Liberty Framework** is a powerful, modular, and extensible **FastAPI-based and React-based framework** designed to streamline backend development for business applications. It provides **database management, authentication, real-time socket communication, and more**, making it easy to deploy and scale enterprise solutions.
5
8
 
6
9
  - Online demo is available at [https://liberty.nomana-it.fr](https://liberty.nomana-it.fr)
@@ -76,4 +76,6 @@ class ApiController:
76
76
 
77
77
  async def ai_welcome(self, req: Request):
78
78
  return await self.apiRest.ai_welcome(req)
79
-
79
+
80
+ async def rest(self, req: Request):
81
+ return await self.apiRest.rest(req)
@@ -37,4 +37,10 @@ class SetupController:
37
37
  return self.alembic.revision(req)
38
38
 
39
39
  def current(self, req: Request):
40
- return self.alembic.current(req)
40
+ return self.alembic.current(req)
41
+
42
+ async def create(self, req: Request):
43
+ return await self.setupRest.create_database(req)
44
+
45
+ async def drop(self, req: Request):
46
+ return await self.setupRest.drop_database(req)
@@ -201,3 +201,6 @@
201
201
  {"timestamp": "2025-02-20T09:15:08.302464+00:00", "transactionName": "QueryDAO.applications", "level": "info", "method": "GET", "url": "http://localhost:5173/api/fmw/applications", "data": {"message": "Request failed with status code 500: undefined"}, "message": "Framework: Load Applications", "category": "http", "feature": "database-api", "isException": true}
202
202
  {"timestamp": "2025-02-20T09:15:08.303872+00:00", "transactionName": "loginUtils.getApplications", "level": "info", "method": null, "url": null, "data": {"status": "error", "items": [{"message": "Request failed with status code 500: undefined"}]}, "message": "Login: Failed to fetch applications", "category": "debug", "feature": "console", "isException": true}
203
203
  {"timestamp": "2025-02-20T09:20:53.819597+00:00", "transactionName": "QueryDAO.login", "level": "info", "method": "GET", "url": "http://localhost:5173/api/auth/user?user=admin&pool=libnsx1&mode=session", "data": {"message": "Request failed with status code 500: Error creating pool: Error creating pool: [Errno 8] nodename nor servname provided, or not known"}, "message": "User Login: Get User Properties", "category": "http", "feature": "database-api", "isException": true}
204
+ {"timestamp": "2025-02-26T15:16:17.684769+00:00", "transactionName": "APIDAO.post", "level": "info", "method": "POST", "url": "http://localhost:5173/api/rest?pool=default&mode=session&api=1", "data": null, "message": "REST: Failed POST API call", "category": "http", "feature": "rest-api", "isException": true}
205
+ {"timestamp": "2025-02-26T16:00:40.041233+00:00", "transactionName": "APIDAO.post", "level": "info", "method": "POST", "url": "http://localhost:5173/api/rest?pool=default&mode=session&api=1", "data": null, "message": "REST: Failed POST API call", "category": "http", "feature": "rest-api", "isException": true}
206
+ {"timestamp": "2025-02-26T16:27:09.583000+00:00", "transactionName": "APIDAO.post", "level": "info", "method": "POST", "url": "http://localhost:5173/api/rest?pool=default&mode=session&api=1", "data": null, "message": "REST: Failed POST API call", "category": "http", "feature": "rest-api", "isException": true}
@@ -810,3 +810,15 @@ Category: debug, Feature: console, IsException: True
810
810
  Method: GET, URL: http://localhost:5173/api/auth/user?user=admin&pool=libnsx1&mode=session
811
811
  Category: http, Feature: database-api, IsException: True
812
812
 
813
+ [2025-02-26T15:16:17.684769+00:00] [info] APIDAO.post - REST: Failed POST API call
814
+ Method: POST, URL: http://localhost:5173/api/rest?pool=default&mode=session&api=1
815
+ Category: http, Feature: rest-api, IsException: True
816
+
817
+ [2025-02-26T16:00:40.041233+00:00] [info] APIDAO.post - REST: Failed POST API call
818
+ Method: POST, URL: http://localhost:5173/api/rest?pool=default&mode=session&api=1
819
+ Category: http, Feature: rest-api, IsException: True
820
+
821
+ [2025-02-26T16:27:09.583000+00:00] [info] APIDAO.post - REST: Failed POST API call
822
+ Method: POST, URL: http://localhost:5173/api/rest?pool=default&mode=session&api=1
823
+ Category: http, Feature: rest-api, IsException: True
824
+
@@ -0,0 +1,44 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class SetupRequest(BaseModel):
5
+ host: str
6
+ port: int
7
+ database: str
8
+ user: str
9
+ password: str
10
+
11
+ SETUP_ERROR_MESSAGE = "Setup failed"
12
+ SETUP_RESPONSE_DESCRIPTION = "Installation successful"
13
+ SETUP_RESPONSE_EXAMPLE = {
14
+ "items": [],
15
+ "status": "success",
16
+ "count": 0
17
+ }
18
+
19
+ class CreateRequest(BaseModel):
20
+ host: str
21
+ port: int
22
+ database: str
23
+ user: str
24
+ password: str
25
+
26
+ CREATE_ERROR_MESSAGE = "Create database failed"
27
+ CREATE_RESPONSE_DESCRIPTION = "Create database successful"
28
+ CREATE_RESPONSE_EXAMPLE = {
29
+ "items": [],
30
+ "status": "success",
31
+ "count": 0
32
+ }
33
+
34
+ class DropRequest(BaseModel):
35
+ database: str
36
+ user: str
37
+
38
+ DROP_ERROR_MESSAGE = "Drop database failed"
39
+ DROP_RESPONSE_DESCRIPTION = "Drop Database successful"
40
+ DROP_RESPONSE_EXAMPLE = {
41
+ "items": [],
42
+ "status": "success",
43
+ "count": 0
44
+ }
@@ -230,7 +230,7 @@ def setup_api_routes(app, controller: ApiController, jwt: JWT):
230
230
  ):
231
231
  return await controller.close(req)
232
232
 
233
-
233
+
234
234
  @router.get(
235
235
  "/db/query",
236
236
  response_model=GetSuccessResponse, # Specify the success response schema
@@ -426,4 +426,66 @@ def setup_api_routes(app, controller: ApiController, jwt: JWT):
426
426
  return await controller.ai_welcome(req)
427
427
 
428
428
 
429
+ @router.post(
430
+ "/rest",
431
+ response_model=PostSuccessResponse, # Specify the success response schema
432
+ responses={
433
+ 200: response_200(PostSuccessResponse, POST_APIDB_RESPONSE_DESCRIPTION, POST_APIDB_RESPONSE_EXAMPLE),
434
+ 400: response_400("Request body cannot be empty."),
435
+ 422: response_422(),
436
+ 500: response_500(PostErrorResponse, POST_APIDB_ERROR_EXAMPLE),
437
+ },
438
+ summary="REST - Call Post Api",
439
+ description="Call a rest api (post).",
440
+ tags=["Query"],
441
+ )
442
+ async def post(
443
+ req: Request,
444
+ jwt: str = Depends(jwt.is_valid_jwt),
445
+ source: QuerySource = Query(None, description="The source to retrieve the query definition. Valid values: `framework`, `query`"),
446
+ type: QueryType = Query(None, description="The type of query, get data or metadata. Valid values: `table`, `columns`."),
447
+ pool: str = Query(None, description="The database pool alias to retrieve the query definition. (e.g., `default`, `libnsx1`)"),
448
+ mode: SessionMode = Query(None, description="The session mode, retrieve data from framework table or pool. Valid values: `framework`, `session`"),
449
+ query: int = Query(None, description="The query ID to execute. (e.g., `1`, `2`)"),
450
+ override_pool: Optional[str] = Query(None, description="Override the default pool set in the query definition. (e.g., `default`, `libnsx1`)"),
451
+ body: Dict[str, Any] = Body(..., description="JSON object with key-value pairs is required.")
452
+ ):
453
+ if not body: # Check if the body is empty
454
+ raise HTTPException(
455
+ status_code=400,
456
+ detail="Request body cannot be empty. JSON object with key-value pairs is required.",
457
+ )
458
+ return await controller.rest(req)
459
+
460
+ @router.get(
461
+ "/rest",
462
+ response_model=PostSuccessResponse, # Specify the success response schema
463
+ responses={
464
+ 200: response_200(PostSuccessResponse, POST_APIDB_RESPONSE_DESCRIPTION, POST_APIDB_RESPONSE_EXAMPLE),
465
+ 400: response_400("Request body cannot be empty."),
466
+ 422: response_422(),
467
+ 500: response_500(PostErrorResponse, POST_APIDB_ERROR_EXAMPLE),
468
+ },
469
+ summary="REST - Call Post Api",
470
+ description="Call a rest api (post).",
471
+ tags=["Query"],
472
+ )
473
+ async def get(
474
+ req: Request,
475
+ jwt: str = Depends(jwt.is_valid_jwt),
476
+ source: QuerySource = Query(None, description="The source to retrieve the query definition. Valid values: `framework`, `query`"),
477
+ type: QueryType = Query(None, description="The type of query, get data or metadata. Valid values: `table`, `columns`."),
478
+ pool: str = Query(None, description="The database pool alias to retrieve the query definition. (e.g., `default`, `libnsx1`)"),
479
+ mode: SessionMode = Query(None, description="The session mode, retrieve data from framework table or pool. Valid values: `framework`, `session`"),
480
+ query: int = Query(None, description="The query ID to execute. (e.g., `1`, `2`)"),
481
+ override_pool: Optional[str] = Query(None, description="Override the default pool set in the query definition. (e.g., `default`, `libnsx1`)"),
482
+ body: Dict[str, Any] = Body(..., description="JSON object with key-value pairs is required.")
483
+ ):
484
+ if not body: # Check if the body is empty
485
+ raise HTTPException(
486
+ status_code=400,
487
+ detail="Request body cannot be empty. JSON object with key-value pairs is required.",
488
+ )
489
+ return await controller.rest(req)
490
+
429
491
  app.include_router(router, prefix="/api")
@@ -8,7 +8,7 @@ from fastapi import APIRouter, Request
8
8
 
9
9
  from app.controllers.setup_controller import SetupController
10
10
  from app.models.base import ErrorResponse, SuccessResponse, response_200, response_422, response_500
11
- from app.models.setup import SETUP_ERROR_MESSAGE, SETUP_RESPONSE_DESCRIPTION, SETUP_RESPONSE_EXAMPLE, SetupRequest
11
+ from app.models.setup import CREATE_ERROR_MESSAGE, CREATE_RESPONSE_DESCRIPTION, CREATE_RESPONSE_EXAMPLE, DROP_ERROR_MESSAGE, DROP_RESPONSE_DESCRIPTION, DROP_RESPONSE_EXAMPLE, SETUP_ERROR_MESSAGE, SETUP_RESPONSE_DESCRIPTION, SETUP_RESPONSE_EXAMPLE, CreateRequest, DropRequest, SetupRequest
12
12
 
13
13
 
14
14
  def setup_setup_routes(app, controller: SetupController):
@@ -205,4 +205,42 @@ def setup_setup_routes(app, controller: SetupController):
205
205
  ):
206
206
  return controller.current(req)
207
207
 
208
- app.include_router(router, prefix="/api")
208
+
209
+ @router.post(
210
+ "/db/create",
211
+ summary="DATABASE - Create",
212
+ description="Create database for new application",
213
+ tags=["Database"],
214
+ response_model=SuccessResponse,
215
+ responses={
216
+ 200: response_200(SuccessResponse, CREATE_RESPONSE_DESCRIPTION, CREATE_RESPONSE_EXAMPLE),
217
+ 422: response_422(),
218
+ 500: response_500(ErrorResponse, CREATE_ERROR_MESSAGE),
219
+ },
220
+ )
221
+ async def create(
222
+ req: Request,
223
+ body: CreateRequest,
224
+ ):
225
+ return await controller.create(req)
226
+
227
+ @router.post(
228
+ "/db/drop",
229
+ summary="DATABASE - Drop",
230
+ description="Drop an existing database",
231
+ tags=["Database"],
232
+ response_model=SuccessResponse,
233
+ responses={
234
+ 200: response_200(SuccessResponse, DROP_RESPONSE_EXAMPLE, DROP_RESPONSE_DESCRIPTION),
235
+ 422: response_422(),
236
+ 500: response_500(ErrorResponse, DROP_ERROR_MESSAGE),
237
+ },
238
+ )
239
+ async def drop(
240
+ req: Request,
241
+ body: DropRequest,
242
+ ):
243
+ return await controller.drop(req)
244
+
245
+ app.include_router(router, prefix="/api")
246
+
@@ -1,11 +1,15 @@
1
1
  # Description: API REST service for handling REST API requests.
2
2
  import logging
3
3
  import os
4
+ import re
5
+ from urllib.parse import urljoin, urlparse
4
6
 
7
+ from fastapi.responses import JSONResponse
5
8
  import httpx
6
9
  from pydantic import BaseModel
7
10
 
8
- from app.services.db_query import Query
11
+ from app.services.db_query import Query, SessionMode
12
+ from app.utils.encrypt import Encryption
9
13
  logger = logging.getLogger(__name__)
10
14
 
11
15
  import json
@@ -14,14 +18,12 @@ from datetime import datetime, timezone
14
18
  from app.utils.logs import LogHandler
15
19
  from app.logs import get_logs_json_path, get_logs_text_path
16
20
 
21
+ defaultPool = "default"
22
+
17
23
  class ApiType:
18
24
  internal = "INTERNAL"
19
25
  external = "EXTERNAL"
20
26
 
21
- class ApiFramework:
22
- CreateFrameworkDatabase = "CreateFrameworkDatabase"
23
- DropFrameworkDatabase = "DropFrameworkDatabase"
24
-
25
27
  class AIResponse(BaseModel):
26
28
  message: str
27
29
  is_truncated: bool
@@ -32,6 +34,95 @@ class Rest:
32
34
  self.logs_handler = LogHandler()
33
35
  self.queryRest = queryRest
34
36
 
37
+ async def rest(self, req: Request):
38
+ try:
39
+ query_params = req.query_params
40
+
41
+ """Extracts OpenAI API URL and Key from MODULE_ID = 'AI'."""
42
+ query = {
43
+ "QUERY": 34,
44
+ "POOL": query_params.get("mode") == SessionMode.framework and defaultPool or query_params.get("pool"),
45
+ "CRUD": "GET",
46
+ }
47
+ context = {
48
+ "row_offset": 0,
49
+ "row_limit": 1000,
50
+ "where": {"API_ID":query_params.get("api")},
51
+ }
52
+ # Get the target query using the framework query method
53
+ target_query = await self.queryRest.db_pools.get_pool("default").db_dao.get_framework_query(
54
+ query, self.queryRest.db_pools.get_pool("default").db_type
55
+ )
56
+
57
+ api = await self.queryRest.db_pools.get_pool("default").db_dao.get(target_query, context)
58
+ rows = api.get("rows")
59
+
60
+ if not api.get("rows"):
61
+ raise ValueError("No API found")
62
+
63
+ row = rows[0] # Extract the first row (dictionary)
64
+
65
+ api_type = row.get("API_SOURCE")
66
+ method = row.get("API_METHOD")
67
+ url = row.get("API_URL")
68
+ user = row.get("API_USER")
69
+ password = row.get("API_PASSWORD")
70
+ body = row.get("API_BODY")
71
+
72
+ # Convert API_BODY from JSON string format to a Python dictionary
73
+ body_dict = json.loads(body)
74
+
75
+ # 🔹 Ensure request body is retrieved properly
76
+ req_body = await req.json()
77
+
78
+ # Perform variable substitution in body
79
+ body_str = json.dumps(body_dict) # Convert dictionary to string for replacement
80
+ for key, value in req_body.items():
81
+ variable = rf"\${key.upper()}"
82
+ body_str = re.sub(variable, str(value), body_str)
83
+
84
+ # Convert back to dictionary
85
+ parsed_body = json.loads(body_str)
86
+ if api_type == ApiType.internal:
87
+ base_url = str(req.base_url)
88
+ full_url = urljoin(base_url, url)
89
+ else:
90
+ # Check if `url` is already a full external URL
91
+ parsed_url = urlparse(url)
92
+ if parsed_url.scheme and parsed_url.netloc:
93
+ full_url = url # Use the full external URL as is
94
+ else:
95
+ raise ValueError(f"Invalid external URL: {url}")
96
+
97
+ # 🔹 Make the API call
98
+ async with httpx.AsyncClient(timeout=60.0) as client:
99
+ response = await client.post(full_url, json=parsed_body)
100
+ if response.status_code == 200:
101
+ response_data = response.json()
102
+ else:
103
+ response_data = {
104
+ "error": f"Failed request with status code {response.status_code}",
105
+ "details": response.text
106
+ }
107
+ response_data = response.json()
108
+
109
+ return JSONResponse({
110
+ "items": response_data,
111
+ "status": "success",
112
+ "count": 0,
113
+ })
114
+ except Exception as err:
115
+ message = str(err)
116
+ return JSONResponse({
117
+ "items": [{"message": f"Error: {message}"}],
118
+ "status": "error",
119
+ "hasMore": False,
120
+ "limit": context.get("row_limit", 1000),
121
+ "offset": context.get("row_offset", 0),
122
+ "count": 0,
123
+ })
124
+
125
+
35
126
 
36
127
  async def push_log(self, req: Request):
37
128
  """
@@ -191,3 +191,7 @@ class Install:
191
191
  except Exception as e:
192
192
  logging.error(f"Update failed: {e}")
193
193
 
194
+
195
+
196
+
197
+
@@ -1,4 +1,6 @@
1
1
  import logging
2
+
3
+ from app.setup.models.liberty import Base
2
4
  logger = logging.getLogger(__name__)
3
5
 
4
6
  from sqlalchemy import create_engine, text
@@ -35,13 +37,6 @@ class Setup:
35
37
  admin_password = data.get("admin_password")
36
38
  load_data = data.get("load_data", False)
37
39
 
38
- # Create all tables in the database
39
- # for table in Base.metadata.tables.values():
40
- # if not table.schema:
41
- # table.schema = database # 🔹 Assign schema to tables
42
- # Base.metadata.create_all(engine)
43
- # logging.warning("All tables have been successfully created!")
44
-
45
40
  # Database configuration
46
41
  ADMIN_DATABASE_URL = f"postgresql+psycopg2://{user}:{current_password}@{host}:{port}/{admin_database}"
47
42
 
@@ -423,4 +418,142 @@ pool_alias=default
423
418
  "items": [{"message": f"Error: {message}"}],
424
419
  "status": "error",
425
420
  "count": 0
426
- })
421
+ })
422
+
423
+
424
+ async def create_database(self, req: Request):
425
+ try:
426
+ data = await req.json()
427
+ host = data.get("host")
428
+ port = data.get("port")
429
+ database = data.get("database")
430
+ user = data.get("user")
431
+ password = data.get("password")
432
+
433
+ # Database configuration
434
+ db_properties_path = get_db_properties_path()
435
+ config = self.apiController.queryRest.load_db_properties(db_properties_path)
436
+ # Database configuration
437
+ ADMIN_DATABASE_URL = f"postgresql+psycopg2://{config["user"]}:{config["password"]}@{config["host"]}:{config["port"]}/{config["database"]}"
438
+
439
+ # Create an engine
440
+ admin_engine = create_engine(ADMIN_DATABASE_URL, isolation_level="AUTOCOMMIT")
441
+ with admin_engine.connect() as conn:
442
+ result = conn.execute(text(f"SELECT 1 FROM pg_database WHERE datname = '{database}'"))
443
+ db_exists = result.scalar()
444
+
445
+ if not db_exists:
446
+ logging.warning(f"Creating database '{database}'...")
447
+ conn.execute(text(f'CREATE DATABASE "{database}"'))
448
+ else:
449
+ logging.warning(f"Database '{database}' already exists. Skipping creation.")
450
+ # 🚀 Check if the role exists
451
+ result = conn.execute(text(f"SELECT 1 FROM pg_roles WHERE rolname = '{user}'"))
452
+ role_exists = result.scalar()
453
+
454
+ if not role_exists:
455
+ logging.warning(f"Creating role '{user}' with password...")
456
+ conn.execute(text(f"CREATE ROLE {user} WITH LOGIN PASSWORD '{password}'"))
457
+ else:
458
+ logging.warning(f"Role '{user}' already exists. Skipping creation.")
459
+
460
+ # 🚀 Grant privileges to the role
461
+ conn.execute(text(f'GRANT ALL PRIVILEGES ON DATABASE "{database}" TO {user}'))
462
+ logging.warning(f"Granted privileges to role '{user}' on database '{database}'.")
463
+
464
+ # Create all tables in the database
465
+ DATABASE_URL = f"postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}"
466
+ engine = create_engine(DATABASE_URL, echo=False, isolation_level="AUTOCOMMIT")
467
+
468
+ with engine.connect() as conn:
469
+ result = conn.execute(text(f"SELECT 1 FROM information_schema.schemata WHERE schema_name = '{database}'"))
470
+ schema_exists = result.scalar()
471
+
472
+ if not schema_exists:
473
+ logging.warning(f"Creating schema '{user}'...")
474
+ conn.execute(text(f'CREATE SCHEMA "{user}" AUTHORIZATION {user}'))
475
+ else:
476
+ logging.warning(f"Schema '{user}' already exists. Skipping creation.")
477
+
478
+ for table in Base.metadata.tables.values():
479
+ if not table.schema:
480
+ table.schema = database
481
+ Base.metadata.create_all(engine)
482
+
483
+ logging.warning("All tables have been successfully created!")
484
+ # Return the response
485
+ return JSONResponse({
486
+ "items": [],
487
+ "status": "success",
488
+ "count": 0
489
+ })
490
+
491
+ except Exception as err:
492
+ message = str(err)
493
+ return JSONResponse({
494
+ "items": [{"message": f"Error: {message}"}],
495
+ "status": "error",
496
+ "count": 0
497
+ })
498
+
499
+ async def drop_database(self, req: Request):
500
+ try:
501
+ data = await req.json()
502
+ database = data.get("database")
503
+ user = data.get("user")
504
+
505
+ # Database configuration
506
+ db_properties_path = get_db_properties_path()
507
+ config = self.apiController.queryRest.load_db_properties(db_properties_path)
508
+ # Database configuration
509
+ ADMIN_DATABASE_URL = f"postgresql+psycopg2://{config["user"]}:{config["password"]}@{config["host"]}:{config["port"]}/{config["database"]}"
510
+
511
+ # Create an engine
512
+ admin_engine = create_engine(ADMIN_DATABASE_URL, isolation_level="AUTOCOMMIT")
513
+ with admin_engine.connect() as conn:
514
+ # 🚀 Check if database exists
515
+ result = conn.execute(text(f"SELECT 1 FROM pg_database WHERE datname = '{database}'"))
516
+ db_exists = result.scalar()
517
+
518
+ if db_exists:
519
+ logging.warning(f"Revoking new connections to database '{database}'...")
520
+ conn.execute(text(f"UPDATE pg_database SET datallowconn = FALSE WHERE datname = '{database}'"))
521
+
522
+ logging.warning(f"Terminating active connections to database '{database}'...")
523
+ conn.execute(text(f"""
524
+ SELECT pg_terminate_backend(pg_stat_activity.pid)
525
+ FROM pg_stat_activity
526
+ WHERE pg_stat_activity.datname = '{database}'
527
+ AND pid <> pg_backend_pid();
528
+ """))
529
+
530
+ logging.warning(f"Dropping database '{database}'...")
531
+ conn.execute(text(f'DROP DATABASE "{database}"'))
532
+ else:
533
+ logging.warning(f"Database '{database}' does not exist. Skipping drop.")
534
+
535
+ # 🚀 Check if the role exists
536
+ result = conn.execute(text(f"SELECT 1 FROM pg_roles WHERE rolname = '{user}'"))
537
+ role_exists = result.scalar()
538
+
539
+ if role_exists:
540
+ logging.warning(f"Dropping role '{user}'...")
541
+ conn.execute(text(f"DROP ROLE {user}"))
542
+ else:
543
+ logging.warning(f"Role '{user}' does not exist. Skipping drop.")
544
+
545
+ logging.warning("Database successfully dropped!")
546
+ # Return the response
547
+ return JSONResponse({
548
+ "items": [],
549
+ "status": "success",
550
+ "count": 0
551
+ })
552
+
553
+ except Exception as err:
554
+ message = str(err)
555
+ return JSONResponse({
556
+ "items": [{"message": f"Error: {message}"}],
557
+ "status": "error",
558
+ "count": 0
559
+ })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: liberty-framework
3
- Version: 6.0.45
3
+ Version: 6.0.46
4
4
  Summary: Liberty Framework
5
5
  Author: Franck Blettner
6
6
  Author-email: franck.blettner@nomana-it.fr
@@ -84,6 +84,9 @@ Dynamic: summary
84
84
  # 📖 Liberty Framework
85
85
  ### A Scalable and Extensible FastAPI and React Framework for Business Applications
86
86
 
87
+ ## Announcements
88
+ - **Release 6.0.46**: Implement call for custom rest api, add drop and create database for framework
89
+
87
90
  🚀 **Liberty Framework** is a powerful, modular, and extensible **FastAPI-based and React-based framework** designed to streamline backend development for business applications. It provides **database management, authentication, real-time socket communication, and more**, making it easy to deploy and scale enterprise solutions.
88
91
 
89
92
  - Online demo is available at [https://liberty.nomana-it.fr](https://liberty.nomana-it.fr)
@@ -17,7 +17,7 @@ def read_readme():
17
17
 
18
18
  setup(
19
19
  name="liberty-framework",
20
- version="6.0.45",
20
+ version="6.0.46",
21
21
  description="Liberty Framework",
22
22
  author="Franck Blettner",
23
23
  author_email="franck.blettner@nomana-it.fr",
@@ -1,17 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class SetupRequest(BaseModel):
5
- host: str
6
- port: int
7
- database: str
8
- user: str
9
- password: str
10
-
11
- SETUP_ERROR_MESSAGE = "Setup failed"
12
- SETUP_RESPONSE_DESCRIPTION = "Installation successful"
13
- SETUP_RESPONSE_EXAMPLE = {
14
- "items": [],
15
- "status": "success",
16
- "count": 0
17
- }