geek-cafe-saas-sdk 0.6.0__py3-none-any.whl → 0.7.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 geek-cafe-saas-sdk might be problematic. Click here for more details.
- geek_cafe_saas_sdk/__init__.py +2 -2
- geek_cafe_saas_sdk/domains/files/handlers/README.md +446 -0
- geek_cafe_saas_sdk/domains/files/handlers/__init__.py +6 -0
- geek_cafe_saas_sdk/domains/files/handlers/files/create/app.py +121 -0
- geek_cafe_saas_sdk/domains/files/handlers/files/download/app.py +80 -0
- geek_cafe_saas_sdk/domains/files/handlers/files/get/app.py +62 -0
- geek_cafe_saas_sdk/domains/files/handlers/files/list/app.py +72 -0
- geek_cafe_saas_sdk/domains/files/handlers/lineage/create_derived/app.py +99 -0
- geek_cafe_saas_sdk/domains/files/handlers/lineage/create_main/app.py +104 -0
- geek_cafe_saas_sdk/domains/files/handlers/lineage/download_bundle/app.py +99 -0
- geek_cafe_saas_sdk/domains/files/handlers/lineage/get_lineage/app.py +68 -0
- geek_cafe_saas_sdk/domains/files/handlers/lineage/prepare_bundle/app.py +76 -0
- geek_cafe_saas_sdk/domains/files/models/__init__.py +17 -0
- geek_cafe_saas_sdk/domains/files/models/file.py +118 -12
- geek_cafe_saas_sdk/domains/files/services/__init__.py +21 -0
- geek_cafe_saas_sdk/domains/files/services/file_lineage_service.py +487 -0
- geek_cafe_saas_sdk/domains/files/services/file_system_service.py +27 -1
- geek_cafe_saas_sdk/utilities/cognito_utility.py +16 -26
- {geek_cafe_saas_sdk-0.6.0.dist-info → geek_cafe_saas_sdk-0.7.0.dist-info}/METADATA +11 -11
- {geek_cafe_saas_sdk-0.6.0.dist-info → geek_cafe_saas_sdk-0.7.0.dist-info}/RECORD +22 -10
- {geek_cafe_saas_sdk-0.6.0.dist-info → geek_cafe_saas_sdk-0.7.0.dist-info}/WHEEL +0 -0
- {geek_cafe_saas_sdk-0.6.0.dist-info → geek_cafe_saas_sdk-0.7.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -62,6 +62,12 @@ class FileSystemService(DatabaseService[File]):
|
|
|
62
62
|
versioning_strategy: str = "explicit",
|
|
63
63
|
description: Optional[str] = None,
|
|
64
64
|
tags: Optional[List[str]] = None,
|
|
65
|
+
file_role: Optional[str] = None,
|
|
66
|
+
parent_file_id: Optional[str] = None,
|
|
67
|
+
original_file_id: Optional[str] = None,
|
|
68
|
+
transformation_type: Optional[str] = None,
|
|
69
|
+
transformation_operation: Optional[str] = None,
|
|
70
|
+
transformation_metadata: Optional[Dict[str, Any]] = None,
|
|
65
71
|
**kwargs
|
|
66
72
|
) -> ServiceResult[File]:
|
|
67
73
|
"""
|
|
@@ -77,6 +83,12 @@ class FileSystemService(DatabaseService[File]):
|
|
|
77
83
|
versioning_strategy: "s3_native" or "explicit"
|
|
78
84
|
description: Optional description
|
|
79
85
|
tags: Optional tags
|
|
86
|
+
file_role: Optional lineage role ("standalone", "original", "main", "derived")
|
|
87
|
+
parent_file_id: Optional parent file ID for lineage
|
|
88
|
+
original_file_id: Optional original file ID for lineage
|
|
89
|
+
transformation_type: Optional transformation type ("convert", "clean", "process")
|
|
90
|
+
transformation_operation: Optional operation name
|
|
91
|
+
transformation_metadata: Optional transformation metadata dict
|
|
80
92
|
|
|
81
93
|
Returns:
|
|
82
94
|
ServiceResult with File model
|
|
@@ -109,6 +121,20 @@ class FileSystemService(DatabaseService[File]):
|
|
|
109
121
|
file.tags = tags or []
|
|
110
122
|
file.status = "active"
|
|
111
123
|
|
|
124
|
+
# Set lineage fields if provided
|
|
125
|
+
if file_role:
|
|
126
|
+
file.file_role = file_role
|
|
127
|
+
if parent_file_id:
|
|
128
|
+
file.parent_file_id = parent_file_id
|
|
129
|
+
if original_file_id:
|
|
130
|
+
file.original_file_id = original_file_id
|
|
131
|
+
if transformation_type:
|
|
132
|
+
file.transformation_type = transformation_type
|
|
133
|
+
if transformation_operation:
|
|
134
|
+
file.transformation_operation = transformation_operation
|
|
135
|
+
if transformation_metadata:
|
|
136
|
+
file.transformation_metadata = transformation_metadata
|
|
137
|
+
|
|
112
138
|
# Extract file extension
|
|
113
139
|
file_path = Path(file_name)
|
|
114
140
|
file.file_extension = file_path.suffix if file_path.suffix else None
|
|
@@ -278,7 +304,7 @@ class FileSystemService(DatabaseService[File]):
|
|
|
278
304
|
# Apply updates (only allowed fields)
|
|
279
305
|
allowed_fields = [
|
|
280
306
|
"file_name", "description", "tags", "directory_id",
|
|
281
|
-
"status"
|
|
307
|
+
"status", "derived_file_count"
|
|
282
308
|
]
|
|
283
309
|
|
|
284
310
|
for field, value in updates.items():
|
|
@@ -349,29 +349,19 @@ class CognitoUtility:
|
|
|
349
349
|
|
|
350
350
|
def create_resource_server(
|
|
351
351
|
self,
|
|
352
|
-
user_pool_id,
|
|
353
|
-
resource_server_name
|
|
354
|
-
resource_server_identifier
|
|
355
|
-
scopes
|
|
352
|
+
user_pool_id: str,
|
|
353
|
+
resource_server_name: str,
|
|
354
|
+
resource_server_identifier: str,
|
|
355
|
+
scopes: list[dict[str, str]],
|
|
356
356
|
) -> dict:
|
|
357
357
|
if not resource_server_name:
|
|
358
|
-
resource_server_name
|
|
358
|
+
raise ValueError("resource_server_name is required")
|
|
359
359
|
|
|
360
360
|
if not resource_server_identifier:
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
raise ValueError("resource_server_identifier is required")
|
|
362
|
+
|
|
363
363
|
if scopes is None or len(scopes) == 0:
|
|
364
|
-
scopes
|
|
365
|
-
scopes.append(
|
|
366
|
-
{
|
|
367
|
-
"ScopeName": "analysis:execution",
|
|
368
|
-
"ScopeDescription": "ability to execute an analysis",
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
"ScopeName": "analysis:download",
|
|
372
|
-
"ScopeDescription": "ability to download an analysis",
|
|
373
|
-
},
|
|
374
|
-
)
|
|
364
|
+
raise ValueError("scopes is required")
|
|
375
365
|
|
|
376
366
|
response = self.client.create_resource_server(
|
|
377
367
|
UserPoolId=user_pool_id,
|
|
@@ -384,14 +374,14 @@ class CognitoUtility:
|
|
|
384
374
|
|
|
385
375
|
def create_client_app_machine_to_machine(
|
|
386
376
|
self,
|
|
387
|
-
user_pool_id,
|
|
388
|
-
client_name,
|
|
389
|
-
id_token_time_out=60,
|
|
390
|
-
id_token_units="minutes",
|
|
391
|
-
access_token_time_out=60,
|
|
392
|
-
access_token_units="minutes",
|
|
393
|
-
refresh_token_time_out=60,
|
|
394
|
-
refresh_token_units="minutes",
|
|
377
|
+
user_pool_id: str,
|
|
378
|
+
client_name: str,
|
|
379
|
+
id_token_time_out: int = 60,
|
|
380
|
+
id_token_units: str = "minutes",
|
|
381
|
+
access_token_time_out: int = 60,
|
|
382
|
+
access_token_units: str = "minutes",
|
|
383
|
+
refresh_token_time_out: int = 60,
|
|
384
|
+
refresh_token_units: str = "minutes",
|
|
395
385
|
) -> dict:
|
|
396
386
|
# valid units: 'seconds'|'minutes'|'hours'|'days'
|
|
397
387
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: geek_cafe_saas_sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Base Reusable Services for SaaS
|
|
5
5
|
Project-URL: Homepage, https://github.com/geekcafe/geek-cafe-services
|
|
6
6
|
Project-URL: Documentation, https://github.com/geekcafe/geek-cafe-services/blob/main/README.md
|
|
@@ -87,20 +87,20 @@ Description-Content-Type: text/markdown
|
|
|
87
87
|
<!-- COVERAGE-BADGE:START -->
|
|
88
88
|
## Test Coverage
|
|
89
89
|
|
|
90
|
-

|
|
91
|
+

|
|
92
92
|
|
|
93
|
-
**Overall Coverage:**
|
|
93
|
+
**Overall Coverage:** 83.1% (9646/11611 statements)
|
|
94
94
|
|
|
95
95
|
### Coverage Summary
|
|
96
96
|
|
|
97
97
|
| Metric | Value |
|
|
98
98
|
|--------|-------|
|
|
99
|
-
| Total Statements | 11,
|
|
100
|
-
| Covered Statements | 9,
|
|
101
|
-
| Missing Statements | 1,
|
|
102
|
-
| Coverage Percentage |
|
|
103
|
-
| Total Tests |
|
|
99
|
+
| Total Statements | 11,611 |
|
|
100
|
+
| Covered Statements | 9,646 |
|
|
101
|
+
| Missing Statements | 1,965 |
|
|
102
|
+
| Coverage Percentage | 83.1% |
|
|
103
|
+
| Total Tests | 1145 |
|
|
104
104
|
| Test Status | ✅ All Passing |
|
|
105
105
|
|
|
106
106
|
### Files Needing Attention (< 80% coverage)
|
|
@@ -118,7 +118,7 @@ Description-Content-Type: text/markdown
|
|
|
118
118
|
| 63.4% | 86 | `domains/communities/services/community_service.py` |
|
|
119
119
|
| 64.0% | 41 | `domains/files/services/s3_file_service.py` |
|
|
120
120
|
|
|
121
|
-
*... and
|
|
121
|
+
*... and 22 more files with < 80% coverage*
|
|
122
122
|
|
|
123
123
|
### Running Tests
|
|
124
124
|
|
|
@@ -130,7 +130,7 @@ Description-Content-Type: text/markdown
|
|
|
130
130
|
open reports/coverage/index.html
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
*Last updated: 2025-10-
|
|
133
|
+
*Last updated: 2025-10-16 13:22:11*
|
|
134
134
|
|
|
135
135
|
---
|
|
136
136
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
geek_cafe_saas_sdk/__init__.py,sha256=
|
|
1
|
+
geek_cafe_saas_sdk/__init__.py,sha256=W_-98hKN9kfgAi5-A7cwcowaAeEK9B1VZuwzxW0EoeA,187
|
|
2
2
|
geek_cafe_saas_sdk/core/__init__.py,sha256=3o3-n1ojO_a_X2bEfzhnxmcjAzuzAU73VTcuRva_f5U,279
|
|
3
3
|
geek_cafe_saas_sdk/core/audit_mixin.py,sha256=hQz0XYUr_Trqpv4JXxywVNxqJJehQwLu79Y1NBpRwzo,1150
|
|
4
4
|
geek_cafe_saas_sdk/core/error_codes.py,sha256=vf82TDaJ0qIQLzgjTu96nK9cAaSWK7pYfnOW8HCvSxE,5010
|
|
@@ -67,15 +67,27 @@ geek_cafe_saas_sdk/domains/events/services/__init__.py,sha256=ljLhtJACoh8x_lWDcQ
|
|
|
67
67
|
geek_cafe_saas_sdk/domains/events/services/event_attendee_service.py,sha256=JN20x5WT4JNGDGoagVJXIGSoZTXCyQ18x6RQ-V8Wjh8,22410
|
|
68
68
|
geek_cafe_saas_sdk/domains/events/services/event_service.py,sha256=F2oJBg-ygnJnkevk9y9gaSUonIf0hw2UJ-fJoQGw87Q,25618
|
|
69
69
|
geek_cafe_saas_sdk/domains/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
-
geek_cafe_saas_sdk/domains/files/
|
|
70
|
+
geek_cafe_saas_sdk/domains/files/handlers/README.md,sha256=4FlkQS2qFXvHDUbU8pZaPYwp5xCXfxBKrakh6dqjdj4,9528
|
|
71
|
+
geek_cafe_saas_sdk/domains/files/handlers/__init__.py,sha256=3LN08oyRuLaxmO0MCcxRdkhmYVpcXm-kotqE11Vvkt8,98
|
|
72
|
+
geek_cafe_saas_sdk/domains/files/handlers/files/create/app.py,sha256=Mn7gcxPU62MDomN5cbBUTNSa-cNdDi_TEv4ZSIQVTcY,3929
|
|
73
|
+
geek_cafe_saas_sdk/domains/files/handlers/files/download/app.py,sha256=0wSGb46sRs2gqtD-GJG4og2tMHXhsC8YrX3suyqnFRE,2220
|
|
74
|
+
geek_cafe_saas_sdk/domains/files/handlers/files/get/app.py,sha256=19-Y3kKXKOwaPFAfHlVvXcjEgUqfbKc2uGvtN3K25zk,1577
|
|
75
|
+
geek_cafe_saas_sdk/domains/files/handlers/files/list/app.py,sha256=ID9U1KtMApkhHKP7K_KqpdEIDmqWrnFQYqTfvro9D7E,1993
|
|
76
|
+
geek_cafe_saas_sdk/domains/files/handlers/lineage/create_derived/app.py,sha256=FV2Z-ABv91Ao9TR6qjbK2olJ0dbPe7fZMJTMbOwXmA4,3043
|
|
77
|
+
geek_cafe_saas_sdk/domains/files/handlers/lineage/create_main/app.py,sha256=Spkopihudh8WxIwE8A_ujjH8Adady2ktdVj49K6LvAY,3207
|
|
78
|
+
geek_cafe_saas_sdk/domains/files/handlers/lineage/download_bundle/app.py,sha256=CoPdi1iARRT9SdnmEsCARZ1kXl8x1cs5HLqDs-HA7Ak,2892
|
|
79
|
+
geek_cafe_saas_sdk/domains/files/handlers/lineage/get_lineage/app.py,sha256=NIyxbTqrEJ7cC27jZ_0my4efCU4-RfXfe4-3TQn5iNI,1794
|
|
80
|
+
geek_cafe_saas_sdk/domains/files/handlers/lineage/prepare_bundle/app.py,sha256=S7Uh0cDKOxNyaEkRfsJNGMGoctzsX2e4KfTu8moWR7A,2263
|
|
81
|
+
geek_cafe_saas_sdk/domains/files/models/__init__.py,sha256=9c0hy2Q6ogJdSRxv3X4bpTQ1g_q8AIEuw5ndakpMNYM,304
|
|
71
82
|
geek_cafe_saas_sdk/domains/files/models/directory.py,sha256=ByN2J7vHv10XwS-UNIfHGkEjThpsXUbZnTpM2we4OO0,8237
|
|
72
|
-
geek_cafe_saas_sdk/domains/files/models/file.py,sha256=
|
|
83
|
+
geek_cafe_saas_sdk/domains/files/models/file.py,sha256=CpOFsQBPmZ3NCe_m1BKBIfR750GS8LMQ1s77ZjIt9ik,14114
|
|
73
84
|
geek_cafe_saas_sdk/domains/files/models/file_share.py,sha256=JwkNFD9YAeQUjjp1W1_sUyOMRK7EpnHfG0TL-kPraiI,8909
|
|
74
85
|
geek_cafe_saas_sdk/domains/files/models/file_version.py,sha256=WXnjrBjYT4zK0VVnA3xWHKkd9ofcsUmBtLNghiybJQ4,6687
|
|
75
|
-
geek_cafe_saas_sdk/domains/files/services/__init__.py,sha256=
|
|
86
|
+
geek_cafe_saas_sdk/domains/files/services/__init__.py,sha256=tzbye87Sk50h7XZJtcvhFF9uAKQr-HgckPfh0wsYVyk,556
|
|
76
87
|
geek_cafe_saas_sdk/domains/files/services/directory_service.py,sha256=WdCv7yVYFkcrhVc5jI-gjqu5NVGghtgrDIlb9P_BBdQ,25082
|
|
88
|
+
geek_cafe_saas_sdk/domains/files/services/file_lineage_service.py,sha256=TdYPTu0fun71RtGaFzrnMI0ONSb1Je7NE8qSkBZz0eM,17545
|
|
77
89
|
geek_cafe_saas_sdk/domains/files/services/file_share_service.py,sha256=_lBybLdsnjUNfpIA-zuPd1eLXMipxgWt3PLUig9o_Wo,22985
|
|
78
|
-
geek_cafe_saas_sdk/domains/files/services/file_system_service.py,sha256=
|
|
90
|
+
geek_cafe_saas_sdk/domains/files/services/file_system_service.py,sha256=JQJ9jNjv8iUk2ykgSXAehPg9kvlBMkwC1jt4sSpjWFo,21183
|
|
79
91
|
geek_cafe_saas_sdk/domains/files/services/file_version_service.py,sha256=KFnH0URWVahnd3HKQ3GLfy6wmBC_NbHe2RlZxqOdfZE,26009
|
|
80
92
|
geek_cafe_saas_sdk/domains/files/services/s3_file_service.py,sha256=T0lyUK97w-L-PrqzTRhdqxKmiW_w15k2y3BslE6WvQw,16920
|
|
81
93
|
geek_cafe_saas_sdk/domains/messaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -172,7 +184,7 @@ geek_cafe_saas_sdk/models/base_model.py,sha256=H-t7ZQEUwmkvV9xPyd0jVbbieAUwu9n5M
|
|
|
172
184
|
geek_cafe_saas_sdk/services/__init__.py,sha256=guO3SxaTEy7NAWNG0orrsjRaUT25XvP0pY7W3lRwePY,614
|
|
173
185
|
geek_cafe_saas_sdk/services/database_service.py,sha256=-LxhRXFf3YfICrUEip9LvcfhjX4v0F7tEYCpfSp9IPA,16581
|
|
174
186
|
geek_cafe_saas_sdk/utilities/__init__.py,sha256=g8voZ8KYeFJQ6HKYhrp5q6mMHgP-AV0ezmouXRiGbDU,2064
|
|
175
|
-
geek_cafe_saas_sdk/utilities/cognito_utility.py,sha256=
|
|
187
|
+
geek_cafe_saas_sdk/utilities/cognito_utility.py,sha256=S36jAwtJAgeBMN6bL7WKjfLU97f78lRptzpISAQb1kQ,20208
|
|
176
188
|
geek_cafe_saas_sdk/utilities/custom_exceptions.py,sha256=Yc5Kg2kYXeYZEzuX1u48WczT9jtBZYUiWyTv7NsNDPs,5173
|
|
177
189
|
geek_cafe_saas_sdk/utilities/datetime_utility.py,sha256=adMD2yKwvCz5t38glQZr0HXzddy3Ee2o7U3tWJ60Uq8,13232
|
|
178
190
|
geek_cafe_saas_sdk/utilities/dictionary_utility.py,sha256=8EbeKMOfAoJgMw3WJmFXr5EbmlepQONcF__JTzKjzlM,2461
|
|
@@ -188,7 +200,7 @@ geek_cafe_saas_sdk/utilities/logging_utility.py,sha256=ECP5vPb7BSSR55yi1ARPVqqIR
|
|
|
188
200
|
geek_cafe_saas_sdk/utilities/message_query_helper.py,sha256=8iMuacRPfom_T06-VMhaSp-90D8604q7waM-GVcpPNQ,11500
|
|
189
201
|
geek_cafe_saas_sdk/utilities/response.py,sha256=0sylVbm_ieIsNGsm9mWXSIdLSyOeoACwFZQQUxyim3s,5964
|
|
190
202
|
geek_cafe_saas_sdk/utilities/string_functions.py,sha256=_1F4dGyzuD3fAcV1w7A8bv1e-3p0DbNAv_i6-fsekg8,5973
|
|
191
|
-
geek_cafe_saas_sdk-0.
|
|
192
|
-
geek_cafe_saas_sdk-0.
|
|
193
|
-
geek_cafe_saas_sdk-0.
|
|
194
|
-
geek_cafe_saas_sdk-0.
|
|
203
|
+
geek_cafe_saas_sdk-0.7.0.dist-info/METADATA,sha256=l66gJxUihWsfmPLs5RNyaR2_AxksGbrtPvycTvn2wMo,16068
|
|
204
|
+
geek_cafe_saas_sdk-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
205
|
+
geek_cafe_saas_sdk-0.7.0.dist-info/licenses/LICENSE,sha256=EHsHc4GFN0U63LgqDSY2aQRKRupbq6QgixCwopdIU2E,2097
|
|
206
|
+
geek_cafe_saas_sdk-0.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|