logs-py 3.0.2__py3-none-any.whl → 3.0.4__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.

Potentially problematic release.


This version of logs-py might be problematic. Click here for more details.

@@ -26,6 +26,14 @@ class CustomFieldValueConverter:
26
26
  if isinstance(value, CustomFieldValue):
27
27
  return cast(Any, value)
28
28
 
29
+ if isinstance(value, CustomSectionValue):
30
+ if value.content:
31
+ value.content = [
32
+ cls.convert(v, f"{fieldName}.content[{i}]")
33
+ for i, v in enumerate(value.content)
34
+ ]
35
+ return cast(Any, value)
36
+
29
37
  if isinstance(value, dict):
30
38
  if "type" not in value:
31
39
  raise Exception(
LOGS/Entity/IdIterator.py CHANGED
@@ -1,6 +1,4 @@
1
- from calendar import c
2
- import dataclasses
3
- from typing import Any, Generic, List, Optional, Type, TypeVar, Union, cast
1
+ from typing import Generic, List, Optional, Type, TypeVar, Union, cast
4
2
 
5
3
  from LOGS.Auxiliary.Exceptions import LOGSException
6
4
  from LOGS.Auxiliary.Tools import Tools
LOGS/LOGS.py CHANGED
@@ -213,6 +213,8 @@ class LOGS:
213
213
  _url = config["url"]
214
214
  if "apiKey" in config:
215
215
  _apiKey = config["apiKey"]
216
+ if "proxyTargetUrl" in config:
217
+ self._options.proxyTargetUrl = config["proxyTargetUrl"]
216
218
 
217
219
  if url:
218
220
  _url = url
LOGS/LOGSConnection.py CHANGED
@@ -253,6 +253,8 @@ class LOGSConnection:
253
253
  self.promptPrefix,
254
254
  "GET: %s %s" % (url, "{" + paramString + "}" if paramString else ""),
255
255
  )
256
+ if self._options.showRequestHeader:
257
+ print(self.promptPrefix, "HEADER: %s" % self.getHeader())
256
258
 
257
259
  # print("params", params)
258
260
  response = requests.get(
@@ -266,10 +268,15 @@ class LOGSConnection:
266
268
  return self.__convertResponse(response, responseType, includeUrl)
267
269
 
268
270
  def getHeader(self) -> Dict[str, str]:
271
+ header = {"X-Api-Key": self.apiKey}
272
+
269
273
  if self._useInternal:
270
- return {"X-Api-Key": self.apiKey, "X-LOGS-internal": "true"}
271
- else:
272
- return {"X-Api-Key": self.apiKey}
274
+ header["X-LOGS-internal"] = "true"
275
+
276
+ if self._options.proxyTargetUrl:
277
+ header["X-Target-Backend"] = self._options.proxyTargetUrl
278
+
279
+ return header
273
280
 
274
281
  def deleteUrl(
275
282
  self,
@@ -289,6 +296,8 @@ class LOGSConnection:
289
296
 
290
297
  if self._options.showRequestUrl:
291
298
  print(self.promptPrefix, "DELETE: %s" % url)
299
+ if self._options.showRequestHeader:
300
+ print(self.promptPrefix, "HEADER: %s" % self.getHeader())
292
301
 
293
302
  response = requests.delete(
294
303
  url, headers=self.getHeader(), params=parameters, verify=self._verify
@@ -312,6 +321,8 @@ class LOGSConnection:
312
321
 
313
322
  if self._options.showRequestUrl:
314
323
  print(self.promptPrefix, "PUT: %s" % url)
324
+ if self._options.showRequestHeader:
325
+ print(self.promptPrefix, "HEADER: %s" % self.getHeader())
315
326
 
316
327
  if self._options.showRequestBody:
317
328
  print(self.promptPrefix, "BODY: %s" % self.__convertBody(data))
@@ -346,6 +357,8 @@ class LOGSConnection:
346
357
  ):
347
358
  if self._options.showRequestUrl:
348
359
  print(self.promptPrefix, "POST: %s" % url)
360
+ if self._options.showRequestHeader:
361
+ print(self.promptPrefix, "HEADER: %s" % self.getHeader())
349
362
 
350
363
  if self._options.showRequestBody:
351
364
  seperator = "-" * 29 + "".join(
@@ -419,6 +432,8 @@ class LOGSConnection:
419
432
  self.promptPrefix,
420
433
  "POST: %s %s" % (url, "{" + paramString + "}" if paramString else ""),
421
434
  )
435
+ if self._options.showRequestHeader:
436
+ print(self.promptPrefix, "HEADER: %s" % self.getHeader())
422
437
 
423
438
  if self._options.showRequestBody:
424
439
  print(self.promptPrefix, "BODY: %s" % self.__convertBody(data))
LOGS/LOGSOptions.py CHANGED
@@ -1,8 +1,11 @@
1
1
  from dataclasses import dataclass
2
+ from typing import Optional
2
3
 
3
4
 
4
5
  @dataclass
5
6
  class LOGSOptions:
6
7
  showRequestUrl: bool = False
8
+ showRequestHeader: bool = False
7
9
  showRequestBody: bool = False
8
10
  showServerInfo: bool = False
11
+ proxyTargetUrl: Optional[str] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logs-py
3
- Version: 3.0.2
3
+ Version: 3.0.4
4
4
  Summary: A python interface for the LOGS public API
5
5
  Home-page: https://docs.logs-python.com
6
6
  Author: Sina Kazemi
@@ -1,6 +1,6 @@
1
- LOGS/LOGS.py,sha256=qLeYWnxMyoWOgwM-mKEeoTEcWmOd_4UWS0ekUBrdQf4,45284
2
- LOGS/LOGSConnection.py,sha256=vy_Eda7-oAskPN1Zb-Y_6ZG4NZ62FFfT4OP7yfjBBzE,20917
3
- LOGS/LOGSOptions.py,sha256=jgJjLycBh9AOq0YtTpXWuaGz5afQcldZHEye3XaH3ZI,166
1
+ LOGS/LOGS.py,sha256=O0XpA1m7uashHuBIKmowYI6ZeeX_d7p2jS_dUpbhVXU,45399
2
+ LOGS/LOGSConnection.py,sha256=T8C9vTk4nyy0qJjs3Ee2_pkFyDPMoKapOGTUszP_htY,21581
3
+ LOGS/LOGSOptions.py,sha256=eDymNMLvms_DcM_71poUxcn7FkUH5K-zSZw28gMsVzs,271
4
4
  LOGS/ServerMetaData.py,sha256=WdXCCiCSFqER6s9c3N3v0O273OvxygxBzmE6_C8FmXs,3361
5
5
  LOGS/__init__.py,sha256=J5-bGgXlm7MxYhTAhLtqWLn612_rarRRxblT5n5O2bY,280
6
6
  LOGS/Auxiliary/Constants.py,sha256=jKsThb6TS6b1adgnv1uAoqohBJi8ySGo7fULHlE2Es0,2504
@@ -35,7 +35,7 @@ LOGS/Entities/CustomFieldModels.py,sha256=65nExcAPiY32fvp3VdQtBaOQ8VZDxky34C7Vas
35
35
  LOGS/Entities/CustomFieldRelations.py,sha256=yQO1LKeamyB-E3dNhL9pVVKvT6ZMIzEf0Xjop4Cfl2M,221
36
36
  LOGS/Entities/CustomFieldRequestParameter.py,sha256=rYzBKAILmX64WY2Ngist85FTa6EPEBoBJtN17Q1eXFE,2373
37
37
  LOGS/Entities/CustomFieldValue.py,sha256=dutOo_SPR4oLLw8ZFesCn2d-A7FzqUW2Oy4FLbbeqmM,2507
38
- LOGS/Entities/CustomFieldValueConverter.py,sha256=tYxnK0ZGxNvA8mzLOw054NY50aA4T-MOVueEG3h6gNU,2236
38
+ LOGS/Entities/CustomFieldValueConverter.py,sha256=9U32OJ_RFdLWWm5FOio8MZsJyLVOBj7zYLPCp8X5fBU,2526
39
39
  LOGS/Entities/CustomFields.py,sha256=-LVjEtaKvyzVFcT7JkhPUnaoKu6-7TvZEB6kl2ZLnM0,470
40
40
  LOGS/Entities/CustomSchema.py,sha256=LD2PIpWKSBd8b9bMBZXdNqIMBGtMgcMVVOwMfE5I0R4,2223
41
41
  LOGS/Entities/CustomSchemaParameter.py,sha256=hU7bB0QiKHM9bSjunZePqB5Xvmm01g1cGP3H-6QHxi8,1195
@@ -230,7 +230,7 @@ LOGS/Entity/EntityRelations.py,sha256=zaAASS5SVDwPVMUyNgUH8DcZhWdErRulrZjD6MAWlh
230
230
  LOGS/Entity/EntityRequestParameter.py,sha256=RH6-Sh8ug3aeq_AOFHs0Lp2J94cKI9Ts3slAATZ1tNA,828
231
231
  LOGS/Entity/EntityWithIntId.py,sha256=B79VqAQ9I0uEQwbf3DMHXoi064gCw4fv3vCKoXwrHQM,631
232
232
  LOGS/Entity/EntityWithStrId.py,sha256=5hz8-F_t_X4kf85DMwW3DJ2NqH_RiRV1Io1WiMN11yk,631
233
- LOGS/Entity/IdIterator.py,sha256=GwQj6XmDfEqeQFIGje2nOURLcl5OYuNXImDXGrzoBL8,6263
233
+ LOGS/Entity/IdIterator.py,sha256=syaf7ygWPhbpSM3Sa5oukGi4wW9KiYInK8Ry61U85N8,6216
234
234
  LOGS/Entity/SerializeableContent.py,sha256=iN_rW3zorXnvL1RBjyQvwxEJwvx5d3RqZKRtPSlScXk,22203
235
235
  LOGS/Entity/__init__.py,sha256=8q6dB_AqlLGx-6PexFn8QH7LWOnSGRhgPfFVkYAghR0,749
236
236
  LOGS/Interfaces/ICreationRecord.py,sha256=SpACPwz2zA60pkApErZelUOsPq40fHAfiFW3vm9qW9k,1461
@@ -258,7 +258,7 @@ LOGS/Parameters/ParameterElement.py,sha256=fr6AlO_flKRygZZFx1OILP4P-2lV2Tx4PAe6W
258
258
  LOGS/Parameters/ParameterList.py,sha256=ijukB1__iKI5cefmOIIWz0wKaPz9Cx8KpD7Y7Gz2Pn0,1478
259
259
  LOGS/Parameters/ParameterTable.py,sha256=7Lew4DPgWmKcpV1T-1Pvt00kEI05FB383QqO-LHAjds,1758
260
260
  LOGS/Parameters/__init__.py,sha256=jNF_VnD9u6V7usDFymzvDx5kzvcYssnpASICiKW0wdU,341
261
- logs_py-3.0.2.dist-info/METADATA,sha256=b2jgXrwXDx1KMAlz7IW0heyPHiWKzT1RBMZlvLd6WdI,2072
262
- logs_py-3.0.2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
263
- logs_py-3.0.2.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
264
- logs_py-3.0.2.dist-info/RECORD,,
261
+ logs_py-3.0.4.dist-info/METADATA,sha256=Orq03RgPS8rejpL-1wp-4iuaWXLT341UScuQFmc36fA,2072
262
+ logs_py-3.0.4.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
263
+ logs_py-3.0.4.dist-info/top_level.txt,sha256=Ckn2LiAmGaR7k3tdEnKAc04z_uboMD4gLreYghRNdCs,5
264
+ logs_py-3.0.4.dist-info/RECORD,,