trovesuite 1.0.1__py3-none-any.whl → 1.0.31__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trovesuite
3
- Version: 1.0.1
4
- Summary: TroveSuite services package providing authentication, authorization, notifications, and other enterprise services for TroveSuite applications
3
+ Version: 1.0.31
4
+ Summary: TroveSuite services package providing authentication, authorization, notifications, Azure Storage, and other enterprise services for TroveSuite applications
5
5
  Home-page: https://dev.azure.com/brightgclt/trovesuite/_git/packages
6
6
  Author: Bright Debrah Owusu
7
7
  Author-email: Bright Debrah Owusu <owusu.debrah@deladetech.com>
@@ -11,7 +11,7 @@ Project-URL: Homepage, https://dev.azure.com/brightgclt/trovesuite/_git/packages
11
11
  Project-URL: Repository, https://dev.azure.com/brightgclt/trovesuite/_git/packages
12
12
  Project-URL: Documentation, https://dev.azure.com/brightgclt/trovesuite/_git/packages
13
13
  Project-URL: Bug Tracker, https://dev.azure.com/brightgclt/trovesuite/_workitems/create
14
- Keywords: authentication,authorization,notifications,jwt,trovesuite,fastapi,security,tenant,permissions,enterprise,services
14
+ Keywords: authentication,authorization,notifications,jwt,trovesuite,fastapi,security,tenant,permissions,enterprise,services,azure,storage,blob,cloud-storage
15
15
  Classifier: Development Status :: 5 - Production/Stable
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: License :: OSI Approved :: MIT License
@@ -34,6 +34,10 @@ Requires-Dist: python-multipart>=0.0.6
34
34
  Requires-Dist: python-jose[cryptography]>=3.3.0
35
35
  Requires-Dist: passlib[bcrypt]>=1.7.4
36
36
  Requires-Dist: passlib[argon2]<2.0.0,>=1.7.4
37
+ Requires-Dist: uvicorn<0.39.0,>=0.38.0
38
+ Requires-Dist: pyjwt<3.0.0,>=2.10.1
39
+ Requires-Dist: azure-storage-blob>=12.19.0
40
+ Requires-Dist: azure-identity>=1.15.0
37
41
  Provides-Extra: dev
38
42
  Requires-Dist: pytest>=8.4.2; extra == "dev"
39
43
  Requires-Dist: pytest-asyncio>=0.21.1; extra == "dev"
@@ -49,9 +53,9 @@ Dynamic: home-page
49
53
  Dynamic: license-file
50
54
  Dynamic: requires-python
51
55
 
52
- # TroveSuite Services
56
+ # TroveSuite Packages
53
57
 
54
- TroveSuite services package providing authentication, authorization, notifications, and other enterprise services for TroveSuite applications.
58
+ TroveSuite package providing authentication, authorization, notifications, and other enterprise services for TroveSuite applications.
55
59
 
56
60
  ## Features
57
61
 
@@ -117,10 +121,28 @@ poetry install --with dev
117
121
 
118
122
  ## Quick Start
119
123
 
124
+ > **✅ Package Status**: All import issues have been resolved in version 1.0.5. The package now works correctly when installed from PyPI or wheel files.
125
+
126
+ ### Import Patterns
127
+
128
+ The package provides clean, simplified import patterns:
129
+
130
+ ```python
131
+ # Import services and DTOs from main package
132
+ from trovesuite import AuthService, NotificationService
133
+ from trovesuite.auth import AuthServiceWriteDto
134
+ from trovesuite.notification import NotificationEmailServiceWriteDto, NotificationSMSServiceWriteDto
135
+
136
+ # Or import everything you need in one line
137
+ from trovesuite import AuthService, NotificationService
138
+ from trovesuite.auth import AuthServiceWriteDto
139
+ from trovesuite.notification import NotificationEmailServiceWriteDto
140
+ ```
141
+
120
142
  ### Basic Usage
121
143
 
122
144
  ```python
123
- from trovesuite import AuthService
145
+ from trovesuite import AuthService, NotificationService
124
146
  from trovesuite.configs.settings import db_settings
125
147
 
126
148
  # Configure your database settings
@@ -135,7 +157,7 @@ db_settings.SECRET_KEY = "your-secret-key"
135
157
  auth_service = AuthService()
136
158
 
137
159
  # Authorize a user
138
- from trovesuite.auth.auth_write_dto import AuthServiceWriteDto
160
+ from trovesuite.auth import AuthServiceWriteDto
139
161
  auth_data = AuthServiceWriteDto(user_id="user123", tenant="tenant456")
140
162
  result = AuthService.authorize(auth_data)
141
163
 
@@ -147,6 +169,30 @@ else:
147
169
  print(f"Authorization failed: {result.detail}")
148
170
  ```
149
171
 
172
+ ### Notification Service Usage
173
+
174
+ ```python
175
+ from trovesuite import NotificationService
176
+ from trovesuite.notification import NotificationEmailServiceWriteDto
177
+
178
+ # Send an email notification
179
+ email_data = NotificationEmailServiceWriteDto(
180
+ sender_email="your-email@gmail.com",
181
+ receiver_email=["recipient1@example.com", "recipient2@example.com"],
182
+ password="your-app-password", # Gmail app password
183
+ subject="Test Notification",
184
+ text_message="This is a plain text message",
185
+ html_message="<h1>This is an HTML message</h1><p>With rich formatting!</p>"
186
+ )
187
+
188
+ result = NotificationService.send_email(email_data)
189
+
190
+ if result.success:
191
+ print(f"Email sent successfully: {result.detail}")
192
+ else:
193
+ print(f"Email failed: {result.error}")
194
+ ```
195
+
150
196
  ### JWT Token Decoding
151
197
 
152
198
  ```python
@@ -164,7 +210,7 @@ async def protected_route(token: str = Depends(oauth2_scheme)):
164
210
  tenant_id = user_data["tenant_id"]
165
211
 
166
212
  # Authorize user
167
- from trovesuite.auth.auth_write_dto import AuthServiceWriteDto
213
+ from trovesuite.auth import AuthServiceWriteDto
168
214
  auth_data = AuthServiceWriteDto(user_id=user_id, tenant=tenant_id)
169
215
  auth_result = AuthService.authorize(auth_data)
170
216
  return auth_result
@@ -393,8 +439,84 @@ Check if user has all of the required permissions.
393
439
  **Returns:**
394
440
  - `bool`: True if user has all of the required permissions
395
441
 
442
+ ### NotificationService
443
+
444
+ #### `send_email(data: NotificationEmailServiceWriteDto) -> Respons[NotificationEmailServiceReadDto]`
445
+
446
+ Sends an email notification via Gmail SMTP. Supports both plain text and HTML email bodies.
447
+
448
+ **Parameters:**
449
+ - `data`: Email notification data including sender, recipients, subject, and message content
450
+
451
+ **Returns:**
452
+ - `Respons[NotificationEmailServiceReadDto]`: Email sending result with success status and details
453
+
454
+ **Example:**
455
+ ```python
456
+ from trovesuite import NotificationService
457
+ from trovesuite.notification import NotificationEmailServiceWriteDto
458
+
459
+ email_data = NotificationEmailServiceWriteDto(
460
+ sender_email="sender@gmail.com",
461
+ receiver_email=["user1@example.com", "user2@example.com"],
462
+ password="your-gmail-app-password",
463
+ subject="Welcome to TroveSuite",
464
+ text_message="Welcome! This is a plain text message.",
465
+ html_message="<h1>Welcome!</h1><p>This is an <strong>HTML</strong> message.</p>"
466
+ )
467
+
468
+ result = NotificationService.send_email(email_data)
469
+ if result.success:
470
+ print("Email sent successfully!")
471
+ else:
472
+ print(f"Failed to send email: {result.error}")
473
+ ```
474
+
475
+ #### `send_sms(data: NotificationSMSServiceWriteDto) -> Respons[NotificationSMSServiceReadDto]`
476
+
477
+ Sends an SMS notification (currently not implemented).
478
+
479
+ **Parameters:**
480
+ - `data`: SMS notification data
481
+
482
+ **Returns:**
483
+ - `Respons[NotificationSMSServiceReadDto]`: SMS sending result
484
+
396
485
  ### Data Models
397
486
 
487
+ #### `NotificationEmailServiceWriteDto`
488
+
489
+ ```python
490
+ class NotificationEmailServiceWriteDto(BaseModel):
491
+ sender_email: str
492
+ receiver_email: Union[str, List[str]] # Single email or list of emails
493
+ password: str # Gmail app password
494
+ subject: str
495
+ text_message: str
496
+ html_message: Optional[str] = None # Optional HTML content
497
+ ```
498
+
499
+ #### `NotificationEmailServiceReadDto`
500
+
501
+ ```python
502
+ class NotificationEmailServiceReadDto(BaseModel):
503
+ pass # Empty response model for email service
504
+ ```
505
+
506
+ #### `NotificationSMSServiceWriteDto`
507
+
508
+ ```python
509
+ class NotificationSMSServiceWriteDto(BaseModel):
510
+ pass # To be implemented for SMS functionality
511
+ ```
512
+
513
+ #### `NotificationSMSServiceReadDto`
514
+
515
+ ```python
516
+ class NotificationSMSServiceReadDto(BaseModel):
517
+ pass # To be implemented for SMS functionality
518
+ ```
519
+
398
520
  #### `AuthServiceReadDto`
399
521
 
400
522
  ```python
@@ -555,15 +677,65 @@ poetry install
555
677
 
556
678
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
557
679
 
680
+ ## Troubleshooting
681
+
682
+ ### Import Issues
683
+
684
+ If you encounter import errors, make sure you're using the correct import patterns:
685
+
686
+ ```python
687
+ # ✅ Correct imports
688
+ from trovesuite import AuthService, NotificationService
689
+ from trovesuite.auth import AuthServiceWriteDto
690
+ from trovesuite.notification import NotificationEmailServiceWriteDto
691
+
692
+ # ❌ Incorrect imports (will fail)
693
+ from trovesuite.auth.auth_write_dto import AuthServiceWriteDto # Too specific
694
+ from trovesuite.notification.notification_write_dto import NotificationEmailServiceWriteDto # Too specific
695
+ ```
696
+
697
+ ### Package Installation
698
+
699
+ If you're having issues with the package installation:
700
+
701
+ 1. **Make sure you have the latest version**:
702
+ ```bash
703
+ pip install --upgrade trovesuite
704
+ ```
705
+
706
+ 2. **Force reinstall if needed**:
707
+ ```bash
708
+ pip install --force-reinstall trovesuite
709
+ ```
710
+
711
+ 3. **Check your Python environment**:
712
+ ```bash
713
+ python -c "import trovesuite; print('Package installed successfully')"
714
+ ```
715
+
716
+ ### Common Issues
717
+
718
+ - **ImportError: No module named 'src'**: This was fixed in version 1.0.5. Update to the latest version.
719
+ - **AttributeError: module has no attribute 'AuthServiceWriteDto'**: Use `from trovesuite.auth import AuthServiceWriteDto` instead of importing from the main package.
720
+
558
721
  ## Support
559
722
 
560
723
  For support, email brightgclt@gmail.com or create a work item in the [Azure DevOps repository](https://dev.azure.com/brightgclt/trovesuite/_workitems/create).
561
724
 
562
725
  ## Changelog
563
726
 
727
+ ### 1.0.5
728
+ - Fixed all import issues across auth, notification, and entities modules
729
+ - Changed absolute imports (`from src.trovesuite.`) to relative imports (`from .` and `from ..`)
730
+ - Ensured package works correctly when installed from PyPI or wheel
731
+ - Added service write DTOs to module exports for easier usage
732
+ - Updated documentation with simplified import patterns
733
+ - All services and DTOs now import correctly in clean environments
734
+ - Package builds and installs without import errors
735
+
564
736
  ### 1.0.8
565
737
  - Restructured package for direct service imports
566
- - Added notification services
738
+ - Added comprehensive notification services with email support
567
739
  - Excluded controllers from package build
568
740
  - Updated import paths for better usability
569
741
  - JWT token validation
@@ -572,3 +744,6 @@ For support, email brightgclt@gmail.com or create a work item in the [Azure DevO
572
744
  - PostgreSQL database integration
573
745
  - Comprehensive logging
574
746
  - Azure integration support
747
+ - Email notification service with Gmail SMTP support
748
+ - Support for both plain text and HTML email content
749
+ - Multiple recipient support for email notifications
@@ -0,0 +1,34 @@
1
+ trovesuite/__init__.py,sha256=tcNxxwRpfYZ23yCEn4b5EHqGL5zRe_BqQHLcNAP23PQ,646
2
+ trovesuite/auth/__init__.py,sha256=OjZllVvjul1glDazJ-d5TrNjgHFigFlQQi1G99DYshk,239
3
+ trovesuite/auth/auth_base.py,sha256=rZHQVLeJRBQ8GClgF5UwG-er4_HXVX5-nt8o6_Z29uY,75
4
+ trovesuite/auth/auth_controller.py,sha256=PAgaVlf5TYEfkSfK4vGGsvO84i8zEmeVVXyUF2YBppI,420
5
+ trovesuite/auth/auth_read_dto.py,sha256=e27JqKVPVUM83A_mYF452QCflsvGNo7aKje7q_urwFc,571
6
+ trovesuite/auth/auth_service.py,sha256=TQOJFG0AzhPGwZBAXVxMkHxyG2wyct4Zcoq4z0cVBO4,22201
7
+ trovesuite/auth/auth_write_dto.py,sha256=rdwI7w6-9QZGv1H0PAGrjkLBCzaMHjgPIXeLb9RmNec,234
8
+ trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
9
+ trovesuite/configs/database.py,sha256=83lckIpRLNLKgLNzXdzczlGjCRAM6DDFLyJTMxleyfw,15008
10
+ trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
+ trovesuite/configs/settings.py,sha256=s-RvzFI7IR8-Q_A0ZRxlTr-iDoY6MvbxM0RkbhmJOL4,6915
12
+ trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
13
+ trovesuite/entities/health.py,sha256=KaW7yxTQdymIPlnkJJkDqEebBXkD0a7A66i5GgNZLoE,2700
14
+ trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
15
+ trovesuite/notification/__init__.py,sha256=mjglzmlk29SREP6LfvBYGmCSc-K1SKKAEx_OJdJ2Vrs,394
16
+ trovesuite/notification/notification_base.py,sha256=6Xo0Gnnpg3RgN1_SRkAcH-K4l7DwNDZvn1gRm3oMWyk,320
17
+ trovesuite/notification/notification_controller.py,sha256=VVy1xj4GL8_Wj7wMMTwozXXX8i_2WSJqC_NyNse35TI,847
18
+ trovesuite/notification/notification_read_dto.py,sha256=K0DFLyAArvtqOGS7q1VzmqO28StTMbcNCgpmhzhad8E,423
19
+ trovesuite/notification/notification_service.py,sha256=sf_lJWcrmRIUeEabdEYLaSdRz2H1D3RBEwKMOA1h2pY,2433
20
+ trovesuite/notification/notification_write_dto.py,sha256=PGpww3PomrmJgXTgpwGhXasv_fC8mgUQvTloaTqaSTA,452
21
+ trovesuite/storage/__init__.py,sha256=lO9E2QvzNFOfUocfITnIBuSR6-eg1zVYLrEVIEq3SXc,1334
22
+ trovesuite/storage/storage_base.py,sha256=nOdnjlwP4xiGdbpdeh5rLDAzkWHZd9M_7lznvNlqsV4,1899
23
+ trovesuite/storage/storage_controller.py,sha256=Yzki0L-jmSPbiw8spFm6Z84Bq-WZfih_0GsfbNRHssM,6569
24
+ trovesuite/storage/storage_read_dto.py,sha256=o7EVJdwrwVZAaeyGU9O01WMECGVaytkvLRwruA256hQ,1471
25
+ trovesuite/storage/storage_service.py,sha256=V7LIePIV6b_iuhm-9x8r4zwpZHgeRPL1YIe5IBnxhco,19768
26
+ trovesuite/storage/storage_write_dto.py,sha256=vl1iCZ93bpFmpvkCrn587QtMtOA_TPDseXSoTuj9RTQ,1355
27
+ trovesuite/utils/__init__.py,sha256=mDZuY77BphvQFYLmcWxjP5Tcq9ZZ3WXJWBKB1v6wzHU,185
28
+ trovesuite/utils/helper.py,sha256=qpd-EWPaX3-QJA5xvxb4s9rEb9W2RKPCDXcdAKSUwSM,30858
29
+ trovesuite/utils/templates.py,sha256=_92k4-EkqWs-h0LNJxPgorbspmp24kDngS7O3qWIFyQ,20388
30
+ trovesuite-1.0.31.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
31
+ trovesuite-1.0.31.dist-info/METADATA,sha256=gPt59uOFfKxbY9v0WuWclaw4ex4l-UVO-GyNte45apo,21737
32
+ trovesuite-1.0.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ trovesuite-1.0.31.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
34
+ trovesuite-1.0.31.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- trovesuite/__init__.py,sha256=a9jSrjmrhOey6yE2I83TO_rVJDogIwGDyL3HJBGiGqM,347
2
- trovesuite/auth/__init__.py,sha256=d8d5POjq9lGe7GVbc7Qm6hUpx1bgLqEVQFG1iYafdxI,337
3
- trovesuite/auth/auth_base.py,sha256=rZHQVLeJRBQ8GClgF5UwG-er4_HXVX5-nt8o6_Z29uY,75
4
- trovesuite/auth/auth_controller.py,sha256=47LsxPvE2wCqpadLPf_m68M8eR7Zu9HxfSSxZQZKQyM,412
5
- trovesuite/auth/auth_read_dto.py,sha256=3gSyz6YrdXvH6yPSPnqDpOmccWnSY-oH_c7izX96_LA,578
6
- trovesuite/auth/auth_service.py,sha256=ZsR6LXE6c0ej4U8rb5SdccL6cyk2t_LicIESe98sUE8,14260
7
- trovesuite/auth/auth_write_dto.py,sha256=TkZw78-XNSr5Gy4sCl6DBs1CFsX2V2yMttpSQiXsDqE,231
8
- trovesuite/configs/__init__.py,sha256=h1mSZOaZ3kUy1ZMO_m9O9KklsxywM0RfMVZLh9h9WvQ,328
9
- trovesuite/configs/database.py,sha256=tXj-AYIUs-gjYrgioTnQafbDhsaIsgimWWLXR3ru-1A,7580
10
- trovesuite/configs/logging.py,sha256=mGjR2d4urVNry9l5_aXycMMtcY2RAFIpEL35hw33KZg,9308
11
- trovesuite/configs/settings.py,sha256=7Z9b-yWLSCL_NA28JfOGisQIrOvGb5PhcriQJvnZURk,7189
12
- trovesuite/entities/__init__.py,sha256=Dbl_03Bueyh2vOP2hykd40MmNMrl5nNHSRGP-kqwwNo,160
13
- trovesuite/entities/health.py,sha256=H8-XUywzvMfZy2dZwDyJGAUbmuULuZYvYIUWhiaVGdY,2729
14
- trovesuite/entities/sh_response.py,sha256=1_sw3PpVaDxWsNiBU0W9YLHZgTFxEj4JJBLBfSY63Ho,1579
15
- trovesuite/utils/__init__.py,sha256=3UPKTz9cluTgAM-ldNsJxsnoPTZiqacXlAmzUEHy6q8,143
16
- trovesuite/utils/helper.py,sha256=lvZ1mvaqY84dkIPB5Ov0uwYDOWBziAS8twobEJZh2Ik,1002
17
- trovesuite-1.0.1.dist-info/licenses/LICENSE,sha256=EJT35ct-Q794JYPdAQy3XNczQGKkU1HzToLeK1YVw2s,1070
18
- trovesuite-1.0.1.dist-info/METADATA,sha256=O6mOV8hVuZrtls25nyCc3fQJMU_sVnsUpI5A3IS91ug,15934
19
- trovesuite-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- trovesuite-1.0.1.dist-info/top_level.txt,sha256=GzKhG_-MTaxeHrIgkGkBH_nof2vroGFBrjeHKWUIwNc,11
21
- trovesuite-1.0.1.dist-info/RECORD,,