apitally 0.10.0__py3-none-any.whl → 0.10.1__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.
apitally/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.10.0"
1
+ __version__ = "0.10.1"
@@ -98,11 +98,7 @@ class ApitallyClient(ApitallyClientBase):
98
98
  async def _send_app_info(self, client: httpx.AsyncClient, payload: Dict[str, Any]) -> None:
99
99
  logger.debug("Sending app info")
100
100
  response = await client.post(url="/info", json=payload, timeout=REQUEST_TIMEOUT)
101
- if response.status_code == 404:
102
- self.stop_sync_loop()
103
- logger.error(f"Invalid Apitally client ID {self.client_id}")
104
- else:
105
- response.raise_for_status()
101
+ self._handle_hub_response(response)
106
102
  self._app_info_sent = True
107
103
  self._app_info_payload = None
108
104
 
@@ -110,4 +106,11 @@ class ApitallyClient(ApitallyClientBase):
110
106
  async def _send_requests_data(self, client: httpx.AsyncClient, payload: Dict[str, Any]) -> None:
111
107
  logger.debug("Sending requests data")
112
108
  response = await client.post(url="/requests", json=payload)
113
- response.raise_for_status()
109
+ self._handle_hub_response(response)
110
+
111
+ def _handle_hub_response(self, response: httpx.Response) -> None:
112
+ if response.status_code == 404:
113
+ self.stop_sync_loop()
114
+ logger.error(f"Invalid Apitally client ID {self.client_id}")
115
+ else:
116
+ response.raise_for_status()
@@ -112,11 +112,7 @@ class ApitallyClient(ApitallyClientBase):
112
112
  def _send_app_info(self, session: requests.Session, payload: Dict[str, Any]) -> None:
113
113
  logger.debug("Sending app info")
114
114
  response = session.post(url=f"{self.hub_url}/info", json=payload, timeout=REQUEST_TIMEOUT)
115
- if response.status_code == 404:
116
- self.stop_sync_loop()
117
- logger.error(f"Invalid Apitally client ID {self.client_id}")
118
- else:
119
- response.raise_for_status()
115
+ self._handle_hub_response(response)
120
116
  self._app_info_sent = True
121
117
  self._app_info_payload = None
122
118
 
@@ -124,4 +120,11 @@ class ApitallyClient(ApitallyClientBase):
124
120
  def _send_requests_data(self, session: requests.Session, payload: Dict[str, Any]) -> None:
125
121
  logger.debug("Sending requests data")
126
122
  response = session.post(url=f"{self.hub_url}/requests", json=payload, timeout=REQUEST_TIMEOUT)
127
- response.raise_for_status()
123
+ self._handle_hub_response(response)
124
+
125
+ def _handle_hub_response(self, response: requests.Response) -> None:
126
+ if response.status_code == 404:
127
+ self.stop_sync_loop()
128
+ logger.error(f"Invalid Apitally client ID {self.client_id}")
129
+ else:
130
+ response.raise_for_status()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apitally
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Simple API monitoring & analytics for REST APIs built with FastAPI, Flask, Django, Starlette and Litestar.
5
5
  Home-page: https://apitally.io
6
6
  License: MIT
@@ -1,9 +1,9 @@
1
- apitally/__init__.py,sha256=v4zmKjsKOPZbp6BrWoz7iK4ST0sdZdUh9bQSJmluZ5o,23
1
+ apitally/__init__.py,sha256=v7Gyp89umFzDtY45tTjCdXqZnQ2RN01AibdYNxEvxYo,23
2
2
  apitally/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- apitally/client/asyncio.py,sha256=uR5JlH37G6gZvAJ7A1gYOGkjn3zjC-4I6avA1fncXHs,4433
3
+ apitally/client/asyncio.py,sha256=nvW3LcwIJsfE4h-nHiHJLSdnluxdZGu9AyH6l6MJH24,4556
4
4
  apitally/client/base.py,sha256=VWtHTkA6UT5aV37i_CXUvcfmYrabjHGBhzbDU6EeH1A,12785
5
5
  apitally/client/logging.py,sha256=QMsKIIAFo92PNBUleeTgsrsQa7SEal-oJa1oOHUr1wI,507
6
- apitally/client/threading.py,sha256=ihQzUStrSQFynpqXgFpseAXrHuc5Et1QvG-YHlzqDr8,4831
6
+ apitally/client/threading.py,sha256=aEFDXDr5SI2g0Zv1GNcP9PhToeZ5Tp2VhPtPwbPGAIs,4957
7
7
  apitally/common.py,sha256=GbVmnXxhRvV30d7CfCQ9r0AeXj14Mv9Jm_Yd1bRWP28,1088
8
8
  apitally/django.py,sha256=ZsCKTUq4V3nCwIcrO8_3mPQFuPRiriqRSxQ8IPMRoOQ,12922
9
9
  apitally/django_ninja.py,sha256=iMvZd7j04nbOLpJgYxs7tpbsyXlZuhmHjcswXMvyUlU,82
@@ -13,7 +13,7 @@ apitally/flask.py,sha256=iD2mbFqrWoEFFmDNXUtR32OYwlHob4I3tJT90-kwcnw,5691
13
13
  apitally/litestar.py,sha256=fgpdIlOpXS7TYFM02GUXk78H8WuJgDWMePPsQf-Pw1I,8092
14
14
  apitally/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  apitally/starlette.py,sha256=e0PoLTrihHioLGDF1TThjlsiyYtusa6Or6GKCX7Y9NQ,7881
16
- apitally-0.10.0.dist-info/LICENSE,sha256=vbLzC-4TddtXX-_AFEBKMYWRlxC_MN0g66QhPxo8PgY,1065
17
- apitally-0.10.0.dist-info/METADATA,sha256=qS7p_ikNFk2H474nD7yI6KdZ5jPM3IuC7EQ5F9Nrbas,6834
18
- apitally-0.10.0.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
19
- apitally-0.10.0.dist-info/RECORD,,
16
+ apitally-0.10.1.dist-info/LICENSE,sha256=vbLzC-4TddtXX-_AFEBKMYWRlxC_MN0g66QhPxo8PgY,1065
17
+ apitally-0.10.1.dist-info/METADATA,sha256=m6jKQm1yML6RCaURdrSzJsn76em3JYScavaPDyCvxQs,6834
18
+ apitally-0.10.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
19
+ apitally-0.10.1.dist-info/RECORD,,