documente_shared 0.1.92__py3-none-any.whl → 0.1.94__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 documente_shared might be problematic. Click here for more details.

@@ -31,6 +31,14 @@ class ProcessingEvent(object):
31
31
  def is_document(self) -> bool:
32
32
  return self.processing_type == ProcessingType.DOCUMENT
33
33
 
34
+ @property
35
+ def uuid(self) -> Optional[str]:
36
+ if self.is_document:
37
+ return self.instance.digest
38
+ elif self.is_processing_case:
39
+ return self.instance.uuid
40
+ return None
41
+
34
42
  @property
35
43
  def to_dict(self) -> dict:
36
44
  return {
@@ -7,16 +7,21 @@ from typing import Optional
7
7
  class DocumenteClientMixin(object):
8
8
  api_url: str
9
9
  api_key: str
10
+ tenant: Optional[str] = None
10
11
  session: Optional[Session] = None
11
12
 
12
13
  def __post_init__(self):
13
- self.session = Session()
14
+ if self.session is None:
15
+ self.session = Session()
14
16
  self.session.headers.update(self.get_common_headers())
15
17
 
16
18
 
17
19
  def get_common_headers(self) -> dict:
18
- return {
20
+ common_headers = {
19
21
  "X-Api-Key": self.api_key,
20
22
  "Content-Type": "application/json"
21
23
  }
24
+ if self.tenant:
25
+ common_headers.update({"X-Tenant": self.tenant})
26
+ return common_headers
22
27
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.92
3
+ Version: 0.1.94
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -19,7 +19,7 @@ documente_shared/domain/entities/processing_case.py,sha256=3zq70K9bMhhWDX-r2sGDD
19
19
  documente_shared/domain/entities/processing_case_filters.py,sha256=harKyu7QEuL1bI_Z8_UxkVCMo5r9vHeNHyi_Ja07vjs,1953
20
20
  documente_shared/domain/entities/processing_case_item.py,sha256=U_g99AJdlRRJpJ0NPfmXzlr2x04l5hc53oNLxx_Q7XQ,9734
21
21
  documente_shared/domain/entities/processing_case_item_filters.py,sha256=R_AvDCB496Lww1qn2OwtltqULKE3IpcJB0ejnmRkg7Q,2009
22
- documente_shared/domain/entities/processing_event.py,sha256=AMkW4dJjW6ss-uvDeWzVMBIJtax8JNWy-zPo1R-TiWY,1963
22
+ documente_shared/domain/entities/processing_event.py,sha256=izdBXEz0TMNjxxZVjcM3YclzOv250JOV-amSpqmtQ9c,2180
23
23
  documente_shared/domain/entities/scaling.py,sha256=Me1z3X-5NjzPMX-TBQ4xHwE_44tIJegi1QSCHQRNtx4,745
24
24
  documente_shared/domain/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  documente_shared/domain/enums/common.py,sha256=wJWYhh98sdCGL_1WodhYLpoT_IYTzkTDOexclpaIM-0,2827
@@ -32,7 +32,7 @@ documente_shared/domain/repositories/document.py,sha256=vJzr6c92gqBzyhaEdjrvnone
32
32
  documente_shared/domain/repositories/processing_case.py,sha256=QcY0LumRokRLmL3IWkOZTgN-LQ-Kku5_v7DWujO1Dfw,778
33
33
  documente_shared/domain/repositories/processing_case_item.py,sha256=uBgJN2fJnZDcKUk018P_Fv25dQRZD5FBxFxsCQNaGAQ,948
34
34
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- documente_shared/infrastructure/documente_client.py,sha256=paO66zNelDyA6D6iqTXXFVQ9ERRZoJCGWR3T3hySsaM,503
35
+ documente_shared/infrastructure/documente_client.py,sha256=u6k73yIefuEkCsHULMpVCydFzrSXclf_5oQd2D7CkKU,698
36
36
  documente_shared/infrastructure/dynamo_table.py,sha256=TMQbcuty7wjDMbuhI8PbT0IGXelgELsNTtqTEQeZ824,2112
37
37
  documente_shared/infrastructure/lambdas.py,sha256=sGgkw7Mhvuq2TpbW_RNdf5JvQnuzxWYH6gPOVtQ4DtE,357
38
38
  documente_shared/infrastructure/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -48,6 +48,6 @@ documente_shared/infrastructure/services/http_scaling.py,sha256=cIo-61nfIwbtO86E
48
48
  documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
49
49
  documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
51
- documente_shared-0.1.92.dist-info/METADATA,sha256=BS6MCzhVgiZcUQN6mHTElvYKrun2avuFinp_OKb7RcM,920
52
- documente_shared-0.1.92.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
53
- documente_shared-0.1.92.dist-info/RECORD,,
51
+ documente_shared-0.1.94.dist-info/METADATA,sha256=yMOwslRgPg3e61wpNd7-3KFUsSngl_aFBUFch39L7xs,920
52
+ documente_shared-0.1.94.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
53
+ documente_shared-0.1.94.dist-info/RECORD,,