aidbox-python-sdk 0.1.17__tar.gz → 0.1.19__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 (26) hide show
  1. {aidbox_python_sdk-0.1.17/aidbox_python_sdk.egg-info → aidbox_python_sdk-0.1.19}/PKG-INFO +1 -1
  2. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/__init__.py +1 -1
  3. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/db.py +15 -4
  4. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19/aidbox_python_sdk.egg-info}/PKG-INFO +1 -1
  5. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/LICENSE.md +0 -0
  6. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/MANIFEST.in +0 -0
  7. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/README.md +0 -0
  8. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/aidboxpy.py +0 -0
  9. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/app_keys.py +0 -0
  10. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/db_migrations.py +0 -0
  11. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/exceptions.py +0 -0
  12. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/handlers.py +0 -0
  13. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/main.py +0 -0
  14. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/py.typed +0 -0
  15. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/pytest_plugin.py +0 -0
  16. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/sdk.py +0 -0
  17. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/settings.py +0 -0
  18. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk/types.py +0 -0
  19. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk.egg-info/SOURCES.txt +0 -0
  20. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk.egg-info/dependency_links.txt +0 -0
  21. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk.egg-info/not-zip-safe +0 -0
  22. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk.egg-info/requires.txt +0 -0
  23. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/aidbox_python_sdk.egg-info/top_level.txt +0 -0
  24. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/pyproject.toml +0 -0
  25. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/setup.cfg +0 -0
  26. {aidbox_python_sdk-0.1.17 → aidbox_python_sdk-0.1.19}/tests/test_sdk.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aidbox-python-sdk
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: Aidbox SDK for python
5
5
  Author-email: "beda.software" <aidbox-python-sdk@beda.software>
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  __title__ = "aidbox-python-sdk"
2
- __version__ = "0.1.17"
2
+ __version__ = "0.1.19"
3
3
  __author__ = "beda.software"
4
4
  __license__ = "None"
5
5
  __copyright__ = "Copyright 2024 beda.software"
@@ -136,11 +136,22 @@ class DBProxy:
136
136
  return await self.raw_sql(query, execute=execute)
137
137
 
138
138
  async def _get_all_entities_name(self):
139
- # TODO: refactor using StructureDefintion
140
- query_url = f"{self._settings.APP_INIT_URL}/Entity?type=resource&_elements=id&_count=999"
139
+ result = None
140
+
141
+ query_url = f"{self._settings.APP_INIT_URL}/$resource-types"
141
142
  async with self._client.get(query_url) as resp:
142
- json_resp = await resp.json()
143
- return [entry["resource"]["id"] for entry in json_resp.get("entry", [])]
143
+ if resp.status == 200:
144
+ json_resp = await resp.json()
145
+ result = list(json_resp.keys())
146
+
147
+ if not result:
148
+ # Support legacy instalations with entity attribute data structure
149
+ query_url = f"{self._settings.APP_INIT_URL}/Entity?type=resource&_elements=id&_count=999"
150
+ async with self._client.get(query_url) as resp:
151
+ json_resp = await resp.json()
152
+ result = [entry["resource"]["id"] for entry in json_resp.get("entry", [])]
153
+
154
+ return result or []
144
155
 
145
156
  async def _init_table_cache(self):
146
157
  table_names = await self._get_all_entities_name()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aidbox-python-sdk
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: Aidbox SDK for python
5
5
  Author-email: "beda.software" <aidbox-python-sdk@beda.software>
6
6
  License: MIT License