unique_sdk 0.10.13__py3-none-any.whl → 0.10.15__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.
@@ -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
@@ -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
 
@@ -20,13 +20,13 @@ unique_sdk/api_resources/_chat_completion.py,sha256=ILCAffxkbkfh2iV9L4KKnfe80gZm
20
20
  unique_sdk/api_resources/_content.py,sha256=WQiNdBSE7pe9QV15NXy_kqhEHCqrjH7Xzk3eSK-456c,10723
21
21
  unique_sdk/api_resources/_embedding.py,sha256=C6qak7cCUBMBINfPhgH8taCJZ9n6w1MUElqDJJ8dG10,1281
22
22
  unique_sdk/api_resources/_event.py,sha256=bpWF9vstdoAWbUzr-iiGP713ceP0zPk77GJXiImf9zg,374
23
- unique_sdk/api_resources/_folder.py,sha256=rDO3rHNddvVWBhM4gaut9WN1A_hASJHiFiAS6a8MszU,9772
23
+ unique_sdk/api_resources/_folder.py,sha256=u_x6g8g_LQsRiJm7ExYuFBxNywfbhOtnSIVK0HwcDws,12820
24
24
  unique_sdk/api_resources/_integrated.py,sha256=z_DrftwjgVCi10QQqRYnG5_-95kD7Kfjogbb-dmnJuA,5854
25
25
  unique_sdk/api_resources/_mcp.py,sha256=zKh0dyn0QnkKk57N2zlGVN_GQoxEp5T2CS38vVm6jQY,3341
26
26
  unique_sdk/api_resources/_message.py,sha256=gEDIzg3METZU2k7m69meAuf0IWmZxnYOjbBKPRMwPYE,7688
27
27
  unique_sdk/api_resources/_message_assessment.py,sha256=SSfx6eW7zb_GKe8cFJzCqW-t-_eWEXxKP5cnIb0DhIc,2276
28
28
  unique_sdk/api_resources/_message_execution.py,sha256=YzNy7l_BWs8mlEi9TlZL3D_KaecNNRpLmPLUnKeNoQ4,4425
29
- unique_sdk/api_resources/_message_log.py,sha256=ImBz-b_WDT98NZf8W-gEP4YmjONkpCmX_iZoOjOJQwo,3541
29
+ unique_sdk/api_resources/_message_log.py,sha256=p7sqU-wSXDJ9EGv0zW8PFEO88trOim2RnLnrzwMmQaE,3583
30
30
  unique_sdk/api_resources/_search.py,sha256=GQItZKoGNOVZfkLLltBmsRZYBIreRKU0lGW8Kgpj1_Q,1959
31
31
  unique_sdk/api_resources/_search_string.py,sha256=4Idw6exgZdA8qksz9WkiA68k1hTU-7yFkgT_OLU_GkE,1662
32
32
  unique_sdk/api_resources/_short_term_memory.py,sha256=vPRN-Y0WPx74E6y-A3LocGc0TxJdzT-xGL66WzZwKRg,2820
@@ -36,7 +36,7 @@ unique_sdk/utils/chat_in_space.py,sha256=3NeBjOu7p43V_6PrjwxyaTkgknUS10KE4QRuTlF
36
36
  unique_sdk/utils/file_io.py,sha256=YY8B7VJcTLOPmCXByiOfNerXGlAtjCC5EVNmAbQJ3dQ,4306
37
37
  unique_sdk/utils/sources.py,sha256=DoxxhMLcLhmDfNarjXa41H4JD2GSSDywr71hiC-4pYc,4952
38
38
  unique_sdk/utils/token.py,sha256=AzKuAA1AwBtnvSFxGcsHLpxXr_wWE5Mj4jYBbOz2ljA,1740
39
- unique_sdk-0.10.13.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
- unique_sdk-0.10.13.dist-info/METADATA,sha256=m2UzEd84j7UkS2d7kGngeeQ1cXFKM0uCUzo3ICs9r-M,50967
41
- unique_sdk-0.10.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
- unique_sdk-0.10.13.dist-info/RECORD,,
39
+ unique_sdk-0.10.15.dist-info/LICENSE,sha256=EJCWoHgrXVBUb47PnjeV4MFIEOR71MAdCOIgv61J-4k,1065
40
+ unique_sdk-0.10.15.dist-info/METADATA,sha256=u4BkT3XbxcWZ6d0Em3QtURDWrdo85KfHWGqhTvfJ3sA,52058
41
+ unique_sdk-0.10.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
42
+ unique_sdk-0.10.15.dist-info/RECORD,,