ipulse-shared-core-ftredge 6.5.1__tar.gz → 6.7.1__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.
Potentially problematic release.
This version of ipulse-shared-core-ftredge might be problematic. Click here for more details.
- {ipulse_shared_core_ftredge-6.5.1/src/ipulse_shared_core_ftredge.egg-info → ipulse_shared_core_ftredge-6.7.1}/PKG-INFO +2 -2
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/setup.py +2 -2
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/__init__.py +1 -1
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/dependencies/auth_router.py +8 -8
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/base_api_response.py +1 -1
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/base_data_model.py +1 -1
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/user_status.py +7 -7
- ipulse_shared_core_ftredge-6.7.1/src/ipulse_shared_core_ftredge/utils/__init__.py +1 -0
- ipulse_shared_core_ftredge-6.7.1/src/ipulse_shared_core_ftredge/utils/json_encoder.py +13 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1/src/ipulse_shared_core_ftredge.egg-info}/PKG-INFO +2 -2
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge.egg-info/SOURCES.txt +3 -1
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge.egg-info/requires.txt +1 -1
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/LICENCE +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/README.md +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/pyproject.toml +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/setup.cfg +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/dependencies/__init__.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/dependencies/authorization_api.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/dependencies/database.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/dependencies/token_validation.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/__init__.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/organization_profile.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/resource_catalog_item.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/subscription.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/user_auth.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/user_profile.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/models/user_profile_update.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/services/__init__.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/services/base_exceptions.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/services/base_firestore_service.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/services/fastapiservicemon.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge/services/servicemon.py +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge.egg-info/dependency_links.txt +0 -0
- {ipulse_shared_core_ftredge-6.5.1 → ipulse_shared_core_ftredge-6.7.1}/src/ipulse_shared_core_ftredge.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.7.1
|
|
4
4
|
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
5
|
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
6
|
Author: Russlan Ramdowar
|
|
@@ -9,7 +9,7 @@ Requires-Dist: pydantic[email]~=2.5
|
|
|
9
9
|
Requires-Dist: python-dateutil~=2.8
|
|
10
10
|
Requires-Dist: fastapi~=0.115.8
|
|
11
11
|
Requires-Dist: pytest~=7.1
|
|
12
|
-
Requires-Dist: ipulse_shared_base_ftredge>=5.
|
|
12
|
+
Requires-Dist: ipulse_shared_base_ftredge>=5.6.1
|
|
13
13
|
Dynamic: author
|
|
14
14
|
Dynamic: home-page
|
|
15
15
|
Dynamic: requires-dist
|
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
|
3
3
|
|
|
4
4
|
setup(
|
|
5
5
|
name='ipulse_shared_core_ftredge',
|
|
6
|
-
version='6.
|
|
6
|
+
version='6.7.1',
|
|
7
7
|
package_dir={'': 'src'}, # Specify the source directory
|
|
8
8
|
packages=find_packages(where='src'), # Look for packages in 'src'
|
|
9
9
|
install_requires=[
|
|
@@ -12,7 +12,7 @@ setup(
|
|
|
12
12
|
'python-dateutil~=2.8',
|
|
13
13
|
'fastapi~=0.115.8',
|
|
14
14
|
'pytest~=7.1',
|
|
15
|
-
'ipulse_shared_base_ftredge>=5.
|
|
15
|
+
'ipulse_shared_base_ftredge>=5.6.1',
|
|
16
16
|
],
|
|
17
17
|
author='Russlan Ramdowar',
|
|
18
18
|
description='Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.',
|
|
@@ -10,12 +10,12 @@ def create_protected_router(
|
|
|
10
10
|
) -> APIRouter:
|
|
11
11
|
"""
|
|
12
12
|
Creates an APIRouter with authentication enabled by default.
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
Args:
|
|
15
15
|
prefix: Router prefix
|
|
16
16
|
tags: OpenAPI tags
|
|
17
17
|
public_paths: List of paths that should be public (no auth required)
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
Example:
|
|
20
20
|
router = create_protected_router(
|
|
21
21
|
prefix="/api/v1",
|
|
@@ -25,10 +25,10 @@ def create_protected_router(
|
|
|
25
25
|
"""
|
|
26
26
|
public_paths = public_paths or []
|
|
27
27
|
router = APIRouter(prefix=prefix, tags=tags)
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
# Store the original route registration method
|
|
30
30
|
original_add_api_route = router.add_api_route
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
def add_api_route_with_auth(
|
|
33
33
|
path: str,
|
|
34
34
|
endpoint: Callable,
|
|
@@ -40,10 +40,10 @@ def create_protected_router(
|
|
|
40
40
|
if path not in public_paths:
|
|
41
41
|
dependencies = dependencies or []
|
|
42
42
|
# Fix: Check if verify_firebase_token is already in dependencies
|
|
43
|
-
if not any(getattr(dep.dependency, '__name__', None) == 'verify_firebase_token'
|
|
43
|
+
if not any(getattr(dep.dependency, '__name__', None) == 'verify_firebase_token'
|
|
44
44
|
for dep in dependencies):
|
|
45
45
|
dependencies.append(Depends(verify_firebase_token))
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
return original_add_api_route(
|
|
48
48
|
path,
|
|
49
49
|
endpoint,
|
|
@@ -51,8 +51,8 @@ def create_protected_router(
|
|
|
51
51
|
dependencies=dependencies,
|
|
52
52
|
**kwargs
|
|
53
53
|
)
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
# Replace the route registration method with our custom one
|
|
56
56
|
router.add_api_route = add_api_route_with_auth # type: ignore
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
return router
|
|
@@ -2,7 +2,7 @@ from typing import Generic, TypeVar, Optional, Any, Dict, List
|
|
|
2
2
|
from pydantic import BaseModel, ConfigDict
|
|
3
3
|
import datetime as dt
|
|
4
4
|
from fastapi.responses import JSONResponse
|
|
5
|
-
from ipulse_shared_core_ftredge.utils
|
|
5
|
+
from ipulse_shared_core_ftredge.utils import CustomJSONEncoder
|
|
6
6
|
import json
|
|
7
7
|
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ class UserStatus(BaseDataModel):
|
|
|
20
20
|
VERSION: ClassVar[float] = 4.1
|
|
21
21
|
DOMAIN: ClassVar[str] = "_".join(list_as_lower_strings(Layer.PULSE_APP, Module.CORE.name, Subject.USER.name))
|
|
22
22
|
OBJ_REF: ClassVar[str] = "userstatus"
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
# Default values as class variables
|
|
25
25
|
DEFAULT_IAM_GROUPS: ClassVar[Dict[str, List[str]]] = {"pulseroot": ["full_open_read"]}
|
|
26
26
|
DEFAULT_SUBSCRIPTION_PLAN: ClassVar[str] = "subscription_free"
|
|
@@ -28,7 +28,7 @@ class UserStatus(BaseDataModel):
|
|
|
28
28
|
DEFAULT_SUBSCRIPTION_INSIGHT_CREDITS: ClassVar[int] = 10
|
|
29
29
|
DEFAULT_VOTING_CREDITS: ClassVar[int] = 0
|
|
30
30
|
DEFAULT_EXTRA_INSIGHT_CREDITS: ClassVar[int] = 0
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
|
|
33
33
|
# System-managed fields
|
|
34
34
|
schema_version: float = Field(
|
|
@@ -52,7 +52,7 @@ class UserStatus(BaseDataModel):
|
|
|
52
52
|
default_factory=lambda: UserStatus.DEFAULT_IAM_GROUPS,
|
|
53
53
|
description="User's Groups, with a default one for all authenticated Pulse users"
|
|
54
54
|
)
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
# Subscription Management
|
|
57
57
|
subscriptions: Dict[str, Subscription] = Field(
|
|
58
58
|
default_factory=dict,
|
|
@@ -79,13 +79,13 @@ class UserStatus(BaseDataModel):
|
|
|
79
79
|
)
|
|
80
80
|
|
|
81
81
|
voting_credits: int = Field(
|
|
82
|
-
|
|
82
|
+
default_factory=lambda: UserStatus.DEFAULT_VOTING_CREDITS, # Changed default to default_factory
|
|
83
83
|
description="Voting credits for user"
|
|
84
84
|
)
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
# Optional fields
|
|
87
87
|
payment_refs_uids: Optional[Set[str]] = None
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
# Remove audit fields as they're inherited from BaseDataModel
|
|
90
90
|
|
|
91
91
|
@field_validator('id', mode='before')
|
|
@@ -97,7 +97,7 @@ class UserStatus(BaseDataModel):
|
|
|
97
97
|
# If id is already provided (Firebase Auth case), return it
|
|
98
98
|
if v:
|
|
99
99
|
return v
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
# Fallback: generate from user_uid if needed
|
|
102
102
|
values = info.data
|
|
103
103
|
user_uid = values.get('user_uid')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .json_encoder import CustomJSONEncoder
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from google.cloud.firestore_v1._helpers import DatetimeWithNanoseconds
|
|
4
|
+
from google.api_core import datetime_helpers
|
|
5
|
+
|
|
6
|
+
class CustomJSONEncoder(json.JSONEncoder):
|
|
7
|
+
"""Custom JSON encoder that handles Firestore datetime types."""
|
|
8
|
+
def default(self, obj):
|
|
9
|
+
if isinstance(obj, (datetime, DatetimeWithNanoseconds)):
|
|
10
|
+
return obj.isoformat()
|
|
11
|
+
if isinstance(obj, datetime_helpers.DatetimeWithNanoseconds):
|
|
12
|
+
return obj.isoformat()
|
|
13
|
+
return super().default(obj)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: ipulse_shared_core_ftredge
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.7.1
|
|
4
4
|
Summary: Shared Core models and Logger util for the Pulse platform project. Using AI for financial advisory and investment management.
|
|
5
5
|
Home-page: https://github.com/TheFutureEdge/ipulse_shared_core
|
|
6
6
|
Author: Russlan Ramdowar
|
|
@@ -9,7 +9,7 @@ Requires-Dist: pydantic[email]~=2.5
|
|
|
9
9
|
Requires-Dist: python-dateutil~=2.8
|
|
10
10
|
Requires-Dist: fastapi~=0.115.8
|
|
11
11
|
Requires-Dist: pytest~=7.1
|
|
12
|
-
Requires-Dist: ipulse_shared_base_ftredge>=5.
|
|
12
|
+
Requires-Dist: ipulse_shared_base_ftredge>=5.6.1
|
|
13
13
|
Dynamic: author
|
|
14
14
|
Dynamic: home-page
|
|
15
15
|
Dynamic: requires-dist
|
|
@@ -27,4 +27,6 @@ src/ipulse_shared_core_ftredge/services/__init__.py
|
|
|
27
27
|
src/ipulse_shared_core_ftredge/services/base_exceptions.py
|
|
28
28
|
src/ipulse_shared_core_ftredge/services/base_firestore_service.py
|
|
29
29
|
src/ipulse_shared_core_ftredge/services/fastapiservicemon.py
|
|
30
|
-
src/ipulse_shared_core_ftredge/services/servicemon.py
|
|
30
|
+
src/ipulse_shared_core_ftredge/services/servicemon.py
|
|
31
|
+
src/ipulse_shared_core_ftredge/utils/__init__.py
|
|
32
|
+
src/ipulse_shared_core_ftredge/utils/json_encoder.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|