unique_sdk 0.10.13__tar.gz → 0.10.14__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.
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/CHANGELOG.md +3 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/PKG-INFO +32 -1
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/README.md +28 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/pyproject.toml +1 -1
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_folder.py +110 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/LICENSE +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/__init__.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_api_requestor.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_api_resource.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_api_version.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_error.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_http_client.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_list_object.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_object_classes.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_request_options.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_unique_object.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_unique_ql.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_unique_response.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_util.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_version.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/_webhook.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/__init__.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_acronyms.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_agentic_table.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_chat_completion.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_content.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_embedding.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_event.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_integrated.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_mcp.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_message.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_message_assessment.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_message_execution.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_message_log.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_search.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_search_string.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_short_term_memory.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/api_resources/_space.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/utils/chat_history.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/utils/chat_in_space.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/utils/file_io.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/utils/sources.py +0 -0
- {unique_sdk-0.10.13 → unique_sdk-0.10.14}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.10.14] - 2025-08-28
|
9
|
+
- Add function to delete folders and files recursively
|
10
|
+
|
8
11
|
## [0.10.13] - 2025-08-24
|
9
12
|
- Add functions to create, get and update a message eecution and create and update a message log.
|
10
13
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unique_sdk
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.14
|
4
4
|
Summary:
|
5
5
|
License: MIT
|
6
6
|
Author: Martin Fadler
|
@@ -1080,6 +1080,34 @@ unique_sdk.Folder.remove_access(
|
|
1080
1080
|
)
|
1081
1081
|
```
|
1082
1082
|
|
1083
|
+
#### `unique_sdk.Folder.delete` (Compatible with release >.36)
|
1084
|
+
|
1085
|
+
Given a `scopeId` or `folderPath`, the function deletes the folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
|
1086
|
+
|
1087
|
+
If `recursive` is set to true, the function also deletes its subfolders and its contents, behaving exactly like the `rm -rf`. In case a subfolder has no write access, that folder is considered as failed to delete and the function continues with the other subfolders. At the end, the function returns a list of `successFolders` and `failedFolders`.
|
1088
|
+
|
1089
|
+
Examples:
|
1090
|
+
Deleting recursively by scope id:
|
1091
|
+
|
1092
|
+
```python
|
1093
|
+
unique_sdk.Folder.delete(
|
1094
|
+
user_id=user_id,
|
1095
|
+
company_id=company_id,
|
1096
|
+
scopeId="scope_w78wfn114va9o22s13r03yq",
|
1097
|
+
recursive=True
|
1098
|
+
)
|
1099
|
+
```
|
1100
|
+
|
1101
|
+
Deleting by path (non-recursive):
|
1102
|
+
|
1103
|
+
```python
|
1104
|
+
unique_sdk.Folder.delete(
|
1105
|
+
user_id=user_id,
|
1106
|
+
company_id=company_id,
|
1107
|
+
folderPath="/Company/Atlas/Due Dilligence/Arch",
|
1108
|
+
)
|
1109
|
+
```
|
1110
|
+
|
1083
1111
|
### Space
|
1084
1112
|
|
1085
1113
|
#### `unique_sdk.Space.delete_chat`
|
@@ -1488,6 +1516,9 @@ All notable changes to this project will be documented in this file.
|
|
1488
1516
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
1489
1517
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
1490
1518
|
|
1519
|
+
## [0.10.14] - 2025-08-28
|
1520
|
+
- Add function to delete folders and files recursively
|
1521
|
+
|
1491
1522
|
## [0.10.13] - 2025-08-24
|
1492
1523
|
- Add functions to create, get and update a message eecution and create and update a message log.
|
1493
1524
|
|
@@ -1064,6 +1064,34 @@ unique_sdk.Folder.remove_access(
|
|
1064
1064
|
)
|
1065
1065
|
```
|
1066
1066
|
|
1067
|
+
#### `unique_sdk.Folder.delete` (Compatible with release >.36)
|
1068
|
+
|
1069
|
+
Given a `scopeId` or `folderPath`, the function deletes the folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
|
1070
|
+
|
1071
|
+
If `recursive` is set to true, the function also deletes its subfolders and its contents, behaving exactly like the `rm -rf`. In case a subfolder has no write access, that folder is considered as failed to delete and the function continues with the other subfolders. At the end, the function returns a list of `successFolders` and `failedFolders`.
|
1072
|
+
|
1073
|
+
Examples:
|
1074
|
+
Deleting recursively by scope id:
|
1075
|
+
|
1076
|
+
```python
|
1077
|
+
unique_sdk.Folder.delete(
|
1078
|
+
user_id=user_id,
|
1079
|
+
company_id=company_id,
|
1080
|
+
scopeId="scope_w78wfn114va9o22s13r03yq",
|
1081
|
+
recursive=True
|
1082
|
+
)
|
1083
|
+
```
|
1084
|
+
|
1085
|
+
Deleting by path (non-recursive):
|
1086
|
+
|
1087
|
+
```python
|
1088
|
+
unique_sdk.Folder.delete(
|
1089
|
+
user_id=user_id,
|
1090
|
+
company_id=company_id,
|
1091
|
+
folderPath="/Company/Atlas/Due Dilligence/Arch",
|
1092
|
+
)
|
1093
|
+
```
|
1094
|
+
|
1067
1095
|
### Space
|
1068
1096
|
|
1069
1097
|
#### `unique_sdk.Space.delete_chat`
|
@@ -135,6 +135,15 @@ class Folder(APIResource["Folder"]):
|
|
135
135
|
scopeAccesses: List["Folder.ScopeAccess"]
|
136
136
|
applyToSubScopes: bool
|
137
137
|
|
138
|
+
class DeleteFolderParams(TypedDict):
|
139
|
+
"""
|
140
|
+
Parameters for deleting a folder.
|
141
|
+
"""
|
142
|
+
|
143
|
+
scopeId: NotRequired[str]
|
144
|
+
folderPath: NotRequired[str]
|
145
|
+
recursive: NotRequired[bool]
|
146
|
+
|
138
147
|
class GetParams(RequestOptions):
|
139
148
|
"""
|
140
149
|
Parameters for getting a folder by its Id or path.
|
@@ -152,6 +161,24 @@ class Folder(APIResource["Folder"]):
|
|
152
161
|
take: NotRequired[int]
|
153
162
|
skip: NotRequired[int]
|
154
163
|
|
164
|
+
class DeleteFolderResponse(TypedDict):
|
165
|
+
"""
|
166
|
+
Response for deleting a folder.
|
167
|
+
"""
|
168
|
+
|
169
|
+
id: str
|
170
|
+
name: str
|
171
|
+
path: str
|
172
|
+
failReason: NotRequired[str]
|
173
|
+
|
174
|
+
class DeleteResponse(TypedDict):
|
175
|
+
"""
|
176
|
+
Response for deleting a folder.
|
177
|
+
"""
|
178
|
+
|
179
|
+
successFolders: List["Folder.DeleteFolderResponse"]
|
180
|
+
failedFolders: List["Folder.DeleteFolderResponse"]
|
181
|
+
|
155
182
|
@classmethod
|
156
183
|
def get_info(
|
157
184
|
cls, user_id: str, company_id: str, **params: Unpack["Folder.GetParams"]
|
@@ -379,3 +406,86 @@ class Folder(APIResource["Folder"]):
|
|
379
406
|
params=params,
|
380
407
|
),
|
381
408
|
)
|
409
|
+
|
410
|
+
@classmethod
|
411
|
+
def delete(
|
412
|
+
cls,
|
413
|
+
user_id: str,
|
414
|
+
company_id: str,
|
415
|
+
**params: Unpack["Folder.DeleteFolderParams"],
|
416
|
+
) -> "Folder.DeleteResponse":
|
417
|
+
"""
|
418
|
+
Delete a folder by its ID or path.
|
419
|
+
"""
|
420
|
+
|
421
|
+
scopeId = cls.resolve_scope_id(
|
422
|
+
user_id, company_id, params.get("scopeId"), params.get("folderPath")
|
423
|
+
)
|
424
|
+
params.pop("scopeId", None)
|
425
|
+
params.pop("folderPath", None)
|
426
|
+
|
427
|
+
return cast(
|
428
|
+
"Folder.DeleteResponse",
|
429
|
+
cls._static_request(
|
430
|
+
"delete",
|
431
|
+
f"{cls.RESOURCE_URL}/{scopeId}",
|
432
|
+
user_id,
|
433
|
+
company_id=company_id,
|
434
|
+
params=params,
|
435
|
+
),
|
436
|
+
)
|
437
|
+
|
438
|
+
@classmethod
|
439
|
+
async def delete_async(
|
440
|
+
cls,
|
441
|
+
user_id: str,
|
442
|
+
company_id: str,
|
443
|
+
**params: Unpack["Folder.DeleteFolderParams"],
|
444
|
+
) -> "Folder.DeleteResponse":
|
445
|
+
"""
|
446
|
+
Async delete a folder by its ID or path.
|
447
|
+
"""
|
448
|
+
scopeId = cls.resolve_scope_id(
|
449
|
+
user_id, company_id, params.get("scopeId"), params.get("folderPath")
|
450
|
+
)
|
451
|
+
params.pop("scopeId", None)
|
452
|
+
params.pop("folderPath", None)
|
453
|
+
|
454
|
+
return cast(
|
455
|
+
"Folder.DeleteResponse",
|
456
|
+
await cls._static_request_async(
|
457
|
+
"delete",
|
458
|
+
f"{cls.RESOURCE_URL}/{scopeId}",
|
459
|
+
user_id,
|
460
|
+
company_id=company_id,
|
461
|
+
params=params,
|
462
|
+
),
|
463
|
+
)
|
464
|
+
|
465
|
+
@classmethod
|
466
|
+
def resolve_scope_id(
|
467
|
+
cls,
|
468
|
+
user_id: str,
|
469
|
+
company_id: str,
|
470
|
+
scope_id: str | None = None,
|
471
|
+
folder_path: str | None = None,
|
472
|
+
) -> str | None:
|
473
|
+
"""
|
474
|
+
Returns the scopeId to use: if scope_id is provided, returns it;
|
475
|
+
if not, but folder_path is provided, resolves and returns the id for that folder path.
|
476
|
+
"""
|
477
|
+
if scope_id:
|
478
|
+
return scope_id
|
479
|
+
if folder_path:
|
480
|
+
folder_info = cls.get_info(
|
481
|
+
user_id=user_id,
|
482
|
+
company_id=company_id,
|
483
|
+
folderPath=folder_path,
|
484
|
+
)
|
485
|
+
resolved_id = folder_info.get("id")
|
486
|
+
if not resolved_id:
|
487
|
+
raise ValueError(
|
488
|
+
f"Could not find a folder with folderPath: {folder_path}"
|
489
|
+
)
|
490
|
+
return resolved_id
|
491
|
+
return None
|
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
|
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
|