mgraph-ai-service-cache-client 0.3.0__py3-none-any.whl → 0.5.0__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 mgraph-ai-service-cache-client might be problematic. Click here for more details.

@@ -0,0 +1,25 @@
1
+ import re
2
+ from osbot_utils.type_safe.primitives.core.Safe_Str import Safe_Str
3
+
4
+ TYPE_SAFE_STR__FIELD_PATH__REGEX = re.compile(r'[^a-zA-Z0-9_\-.]') # Allow dots for nesting
5
+ TYPE_SAFE_STR__FIELD_PATH__MAX_LENGTH = 256 # Longer to support deep nesting
6
+
7
+ class Safe_Str__Json__Field_Path(Safe_Str):
8
+ regex = TYPE_SAFE_STR__FIELD_PATH__REGEX
9
+ max_length = TYPE_SAFE_STR__FIELD_PATH__MAX_LENGTH
10
+ trim_whitespace = True
11
+
12
+ def __new__(cls, value: str = None):
13
+ if value:
14
+ if '..' in value: # Don't allow consecutive dots
15
+ raise ValueError(f"Field path cannot contain consecutive dots: '{value}'")
16
+
17
+ if value.startswith('.') or value.endswith('.'): # Don't allow leading/trailing dots
18
+ raise ValueError(f"Field path cannot start or end with a dot: '{value}'")
19
+
20
+ segments = value.split('.') # Each segment should be non-empty after splitting
21
+ for segment in segments:
22
+ if not segment:
23
+ raise ValueError(f"Field path has empty segment: '{value}'")
24
+
25
+ return Safe_Str.__new__(cls, value)
@@ -4,8 +4,9 @@ from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid
4
4
  from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
5
5
  from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now import Timestamp_Now
6
6
  from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Cache_Hash import Safe_Str__Cache_Hash
7
- from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__File_Type import Enum__Cache__File_Type
8
- from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
7
+ from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__File_Type import Enum__Cache__File_Type
8
+ from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
9
+ from mgraph_ai_service_cache_client.schemas.cache.safe_str.Safe_Str__Json__Field_Path import Safe_Str__Json__Field_Path
9
10
 
10
11
 
11
12
  class Schema__Cache__Store__Metadata(Type_Safe): # Metadata for stored cache entries
@@ -14,7 +15,9 @@ class Schema__Cache__Store__Metadata(Type_Safe):
14
15
  cache_id : Random_Guid = None # Cache entry ID
15
16
  content_encoding : Safe_Str__Id = None # Optional encoding
16
17
  file_id : Safe_Str__Id = None # File ID used for storage
18
+ file_type : Enum__Cache__File_Type = None # Type: 'json' or 'binary'
19
+ json_field_path : Safe_Str__Json__Field_Path = None # Field Path used to calculate the hash of a Json object
20
+ namespace : Safe_Str__Id = None # Namespace
17
21
  stored_at : Timestamp_Now = None # When stored
18
22
  strategy : Enum__Cache__Store__Strategy = None # Storage strategy used
19
- namespace : Safe_Str__Id = None # Namespace
20
- file_type : Enum__Cache__File_Type = None # Type: 'json' or 'binary'
23
+
@@ -1,23 +1,25 @@
1
- from typing import Union, Dict, List
1
+ from typing import Union, Dict
2
2
  from osbot_utils.type_safe.Type_Safe import Type_Safe
3
3
  from osbot_utils.type_safe.primitives.domains.cryptography.safe_str.Safe_Str__Cache_Hash import Safe_Str__Cache_Hash
4
4
  from osbot_utils.type_safe.primitives.domains.files.safe_str.Safe_Str__File__Path import Safe_Str__File__Path
5
5
  from osbot_utils.type_safe.primitives.domains.identifiers.Random_Guid import Random_Guid
6
6
  from osbot_utils.type_safe.primitives.domains.identifiers.safe_int.Timestamp_Now import Timestamp_Now
7
7
  from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id
8
- from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
9
- from mgraph_ai_service_cache_client.schemas.cache.file.Schema__Cache__File__Paths import Schema__Cache__File__Paths
10
- from mgraph_ai_service_cache_client.schemas.cache.store.Schema__Cache__Store__Metadata import Schema__Cache__Store__Metadata
11
- from mgraph_ai_service_cache_client.schemas.cache.store.Schema__Cache__Store__Paths import Schema__Cache__Store__Paths
8
+ from mgraph_ai_service_cache_client.schemas.cache.enums.Enum__Cache__Store__Strategy import Enum__Cache__Store__Strategy
9
+ from mgraph_ai_service_cache_client.schemas.cache.file.Schema__Cache__File__Paths import Schema__Cache__File__Paths
10
+ from mgraph_ai_service_cache_client.schemas.cache.safe_str.Safe_Str__Json__Field_Path import Safe_Str__Json__Field_Path
11
+ from mgraph_ai_service_cache_client.schemas.cache.store.Schema__Cache__Store__Metadata import Schema__Cache__Store__Metadata
12
+ from mgraph_ai_service_cache_client.schemas.cache.store.Schema__Cache__Store__Paths import Schema__Cache__Store__Paths
12
13
  from mgraph_ai_service_cache.service.cache.Cache__Handler import Cache__Handler
13
14
 
14
15
 
15
- class Schema__Store__Context(Type_Safe): # Context object to pass data between store operations
16
+ class Schema__Store__Context(Type_Safe): # Context object to pass data between store operations
16
17
  storage_data : Union[str, Dict, bytes] # Data to be stored (string, dict, or bytes)
17
18
  cache_hash : Safe_Str__Cache_Hash = None # Hash of the data or cache key
18
19
  cache_id : Random_Guid = None # Unique ID for this cache entry
19
20
  cache_key : Safe_Str__File__Path = None # Optional semantic cache key
20
21
  file_id : Safe_Str__Id = None # Optional file ID (defaults to cache_id)
22
+ json_field_path : Safe_Str__Json__Field_Path = None # Field Path used to calculate the hash of a Json object
21
23
  namespace : Safe_Str__Id = None # Namespace for isolation
22
24
  strategy : Enum__Cache__Store__Strategy = None # Storage strategy to use
23
25
  content_encoding : Safe_Str__Id = None # Optional encoding (e.g., 'gzip')
@@ -1 +1 @@
1
- v0.3.0
1
+ v0.5.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mgraph_ai_service_cache__client
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: MGraph-AI__Service__Cache__Client
5
5
  Home-page: https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client
6
6
  License: Apache 2.0
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
17
17
 
18
18
  # MGraph AI Service Cache Client
19
19
 
20
- [![Current Release](https://img.shields.io/badge/release-v0.3.0-blue)](https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client/releases)
20
+ [![Current Release](https://img.shields.io/badge/release-v0.5.0-blue)](https://github.com/the-cyber-boardroom/MGraph-AI__Service__Cache__Client/releases)
21
21
  [![Python](https://img.shields.io/badge/python-3.12-blue)](https://www.python.org/downloads/)
22
22
  [![FastAPI](https://img.shields.io/badge/FastAPI-0.116.1-009688)](https://fastapi.tiangolo.com/)
23
23
  [![AWS Lambda](https://img.shields.io/badge/AWS-Lambda-orange)](https://aws.amazon.com/lambda/)
@@ -52,11 +52,13 @@ mgraph_ai_service_cache_client/schemas/cache/enums/__init__.py,sha256=47DEQpj8HB
52
52
  mgraph_ai_service_cache_client/schemas/cache/file/Schema__Cache__File__Paths.py,sha256=8MuRXyOtcWMcJ1z9SFesB5-vgoACDxkEpgeeR3S5tFU,506
53
53
  mgraph_ai_service_cache_client/schemas/cache/file/Schema__Cache__File__Refs.py,sha256=3k2tJPeHcK0dyoBs2HNev-dVAQG4fKPpxMFMff5WImQ,1901
54
54
  mgraph_ai_service_cache_client/schemas/cache/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ mgraph_ai_service_cache_client/schemas/cache/safe_str/Safe_Str__Json__Field_Path.py,sha256=NZZ-6oHgRInqyTIUicrxlz0NZbvcWhEZGTxgK-KvFW0,1325
56
+ mgraph_ai_service_cache_client/schemas/cache/safe_str/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
57
  mgraph_ai_service_cache_client/schemas/cache/store/Schema__Cache__Hash__Entry.py,sha256=TZ_X4ZGB0aqhaH7Hrts8raV-q1fJogUheVy_qLrQQo0,514
56
58
  mgraph_ai_service_cache_client/schemas/cache/store/Schema__Cache__Hash__Reference.py,sha256=vCoduQezCOJnS9OUPfmHU2IZa4U9qDJPPqo7RsrFlIE,1040
57
- mgraph_ai_service_cache_client/schemas/cache/store/Schema__Cache__Store__Metadata.py,sha256=P4HufeteFtiPVdOmVWiNDhuiDNRDVMnpe5nRoyo48iE,2070
59
+ mgraph_ai_service_cache_client/schemas/cache/store/Schema__Cache__Store__Metadata.py,sha256=dKEI87QOmj8sUmi0m95jMaYOsJPhO1eVloc-5CGn_Sw,2331
58
60
  mgraph_ai_service_cache_client/schemas/cache/store/Schema__Cache__Store__Paths.py,sha256=oH1CewYuyShdkzKpCoaUQH3qMvwju7Gp7dD04Hf6YWo,666
59
- mgraph_ai_service_cache_client/schemas/cache/store/Schema__Store__Context.py,sha256=JuzMqATcAjZbjyem7EbZzRNQuW2CY0hasjqE3za9Lbg,3454
61
+ mgraph_ai_service_cache_client/schemas/cache/store/Schema__Store__Context.py,sha256=coCKBJw-oINPx0bwvwclrLIaYWeFBWGW3c35Tsq_rjc,3778
60
62
  mgraph_ai_service_cache_client/schemas/cache/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
63
  mgraph_ai_service_cache_client/schemas/cache/zip/Schema__Cache__Zip__Batch__Request.py,sha256=a1AfQbZF9ByA6GD3TpGpYQS7TbhwAWzPFgDkeDqClKY,1497
62
64
  mgraph_ai_service_cache_client/schemas/cache/zip/Schema__Cache__Zip__Batch__Response.py,sha256=ibuddxNLSUEespCdwfeBJeJjX16VvqgqH_ZjY8K6g0Q,2723
@@ -93,8 +95,8 @@ mgraph_ai_service_cache_client/schemas/errors/Schema__Cache__Error__Unsupported_
93
95
  mgraph_ai_service_cache_client/schemas/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
96
  mgraph_ai_service_cache_client/utils/Version.py,sha256=-iKgWjUzrm9eGMdLFsvKPuxZFckmfNE5Y5bw6vSydhY,797
95
97
  mgraph_ai_service_cache_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- mgraph_ai_service_cache_client/version,sha256=4apo-i85Xj_wQXKgNhV_C-B8om5MrdAetyEDJ1TebHE,7
97
- mgraph_ai_service_cache_client-0.3.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
98
- mgraph_ai_service_cache_client-0.3.0.dist-info/METADATA,sha256=QLYE3qNavA1fx8eQsCSAOYm6NgJp9inoVtp3UgiFSw0,9885
99
- mgraph_ai_service_cache_client-0.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
100
- mgraph_ai_service_cache_client-0.3.0.dist-info/RECORD,,
98
+ mgraph_ai_service_cache_client/version,sha256=t4EsP2MovsUPk4AcvqyXVRa1SaSu4B5pMAUNv1Cd1qU,7
99
+ mgraph_ai_service_cache_client-0.5.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
100
+ mgraph_ai_service_cache_client-0.5.0.dist-info/METADATA,sha256=4WbladUuCAmdHEJljmo5Of8O4dSinZdzErgLM9ugSf4,9885
101
+ mgraph_ai_service_cache_client-0.5.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
102
+ mgraph_ai_service_cache_client-0.5.0.dist-info/RECORD,,