unique_sdk 0.10.13__tar.gz → 0.10.15__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.
Files changed (43) hide show
  1. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/CHANGELOG.md +6 -0
  2. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/PKG-INFO +35 -1
  3. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/README.md +28 -0
  4. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/pyproject.toml +1 -1
  5. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_folder.py +110 -0
  6. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_message_log.py +6 -6
  7. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/LICENSE +0 -0
  8. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/__init__.py +0 -0
  9. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_api_requestor.py +0 -0
  10. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_api_resource.py +0 -0
  11. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_api_version.py +0 -0
  12. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_error.py +0 -0
  13. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_http_client.py +0 -0
  14. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_list_object.py +0 -0
  15. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_object_classes.py +0 -0
  16. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_request_options.py +0 -0
  17. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_unique_object.py +0 -0
  18. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_unique_ql.py +0 -0
  19. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_unique_response.py +0 -0
  20. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_util.py +0 -0
  21. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_version.py +0 -0
  22. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/_webhook.py +0 -0
  23. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/__init__.py +0 -0
  24. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_acronyms.py +0 -0
  25. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_agentic_table.py +0 -0
  26. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_chat_completion.py +0 -0
  27. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_content.py +0 -0
  28. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_embedding.py +0 -0
  29. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_event.py +0 -0
  30. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_integrated.py +0 -0
  31. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_mcp.py +0 -0
  32. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_message.py +0 -0
  33. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_message_assessment.py +0 -0
  34. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_message_execution.py +0 -0
  35. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_search.py +0 -0
  36. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_search_string.py +0 -0
  37. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  38. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/api_resources/_space.py +0 -0
  39. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/utils/chat_history.py +0 -0
  40. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/utils/chat_in_space.py +0 -0
  41. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/utils/file_io.py +0 -0
  42. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/utils/sources.py +0 -0
  43. {unique_sdk-0.10.13 → unique_sdk-0.10.15}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,12 @@ 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.15] - 2025-08-28
9
+ - Add default values for message log types
10
+
11
+ ## [0.10.14] - 2025-08-28
12
+ - Add function to delete folders and files recursively
13
+
8
14
  ## [0.10.13] - 2025-08-24
9
15
  - Add functions to create, get and update a message eecution and create and update a message log.
10
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.13
3
+ Version: 0.10.15
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,12 @@ 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.15] - 2025-08-28
1520
+ - Add default values for message log types
1521
+
1522
+ ## [0.10.14] - 2025-08-28
1523
+ - Add function to delete folders and files recursively
1524
+
1491
1525
  ## [0.10.13] - 2025-08-24
1492
1526
  - Add functions to create, get and update a message eecution and create and update a message log.
1493
1527
 
@@ -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`
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.10.13"
3
+ version = "0.10.15"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -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
@@ -25,9 +25,9 @@ class MessageLog(APIResource["MessageLog"]):
25
25
  text: str
26
26
  status: Literal["RUNNING", "COMPLETED", "FAILED"]
27
27
  order: int
28
- details: dict | None
29
- uncitedReferences: dict | None
30
- references: list["MessageLog.Reference"] | None
28
+ details: dict | None = None
29
+ uncitedReferences: dict | None = None
30
+ references: list["MessageLog.Reference"] | None = None
31
31
 
32
32
  class UpdateMessageLogParams(RequestOptions):
33
33
  """
@@ -37,9 +37,9 @@ class MessageLog(APIResource["MessageLog"]):
37
37
  text: str | None
38
38
  status: Literal["RUNNING", "COMPLETED", "FAILED"] | None
39
39
  order: int
40
- details: dict | None
41
- uncitedReferences: dict | None
42
- references: list["MessageLog.Reference"] | None
40
+ details: dict | None = None
41
+ uncitedReferences: dict | None = None
42
+ references: list["MessageLog.Reference"] | None = None
43
43
 
44
44
  messageLogId: str | None
45
45
  messageId: str | None
File without changes