uipath 2.0.14__py3-none-any.whl → 2.0.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.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import uuid
3
3
  from json import dumps
4
- from typing import Any, Dict, Optional, Tuple
4
+ from typing import Any, Dict, List, Optional, Tuple
5
5
 
6
6
  from .._config import Config
7
7
  from .._execution_context import ExecutionContext
@@ -213,7 +213,7 @@ class ActionsService(FolderContext, BaseService):
213
213
  (key, action_schema) = (
214
214
  (app_key, None)
215
215
  if app_key
216
- else await self.__get_app_key_and_schema_async(app_name)
216
+ else await self._get_app_key_and_schema_async(app_name, app_folder_path)
217
217
  )
218
218
  spec = _create_spec(
219
219
  title=title,
@@ -269,7 +269,9 @@ class ActionsService(FolderContext, BaseService):
269
269
  Exception: If neither app_name nor app_key is provided for app-specific actions
270
270
  """
271
271
  (key, action_schema) = (
272
- (app_key, None) if app_key else self.__get_app_key_and_schema(app_name)
272
+ (app_key, None)
273
+ if app_key
274
+ else self._get_app_key_and_schema(app_name, app_folder_path)
273
275
  )
274
276
  spec = _create_spec(
275
277
  title=title,
@@ -340,8 +342,8 @@ class ActionsService(FolderContext, BaseService):
340
342
 
341
343
  return Action.model_validate(response.json())
342
344
 
343
- async def __get_app_key_and_schema_async(
344
- self, app_name: str
345
+ async def _get_app_key_and_schema_async(
346
+ self, app_name: str, app_folder_path: str
345
347
  ) -> Tuple[str, Optional[ActionSchema]]:
346
348
  """Retrieves an application's key and schema asynchronously.
347
349
 
@@ -362,7 +364,9 @@ class ActionsService(FolderContext, BaseService):
362
364
  spec.method, spec.endpoint, params=spec.params, headers=spec.headers
363
365
  )
364
366
  try:
365
- deployed_app = response.json()["deployed"][0]
367
+ deployed_app = self._extract_deployed_app(
368
+ response.json()["deployed"], app_folder_path
369
+ )
366
370
  action_schema = deployed_app["actionSchema"]
367
371
  deployed_app_key = deployed_app["systemName"]
368
372
  except (KeyError, IndexError):
@@ -381,8 +385,8 @@ class ActionsService(FolderContext, BaseService):
381
385
  except KeyError:
382
386
  raise Exception("Failed to deserialize action schema") from KeyError
383
387
 
384
- def __get_app_key_and_schema(
385
- self, app_name: str
388
+ def _get_app_key_and_schema(
389
+ self, app_name: str, app_folder_path: str
386
390
  ) -> Tuple[str, Optional[ActionSchema]]:
387
391
  if not app_name:
388
392
  raise Exception("appName or appKey is required")
@@ -394,7 +398,9 @@ class ActionsService(FolderContext, BaseService):
394
398
  )
395
399
 
396
400
  try:
397
- deployed_app = response.json()["deployed"][0]
401
+ deployed_app = self._extract_deployed_app(
402
+ response.json()["deployed"], app_folder_path
403
+ )
398
404
  action_schema = deployed_app["actionSchema"]
399
405
  deployed_app_key = deployed_app["systemName"]
400
406
  except (KeyError, IndexError):
@@ -413,6 +419,21 @@ class ActionsService(FolderContext, BaseService):
413
419
  except KeyError:
414
420
  raise Exception("Failed to deserialize action schema") from KeyError
415
421
 
422
+ # should be removed after folder filtering support is added on apps API
423
+ def _extract_deployed_app(
424
+ self, deployed_apps: List[Dict[str, Any]], app_folder_path: Optional[str]
425
+ ) -> Dict[str, Any]:
426
+ if len(deployed_apps) > 1 and not app_folder_path:
427
+ raise Exception("Multiple app schemas found")
428
+ try:
429
+ return next(
430
+ app
431
+ for app in deployed_apps
432
+ if app["deploymentFolder"]["fullyQualifiedName"] == app_folder_path
433
+ )
434
+ except StopIteration:
435
+ raise KeyError from StopIteration
436
+
416
437
  @property
417
438
  def custom_headers(self) -> Dict[str, str]:
418
439
  return self.folder_headers
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.14
3
+ Version: 2.0.15
4
4
  Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-python
@@ -36,7 +36,7 @@ uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv
36
36
  uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28mMc0,20663
37
37
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
38
38
  uipath/_services/_base_service.py,sha256=3YClCoZBkVQGNJZGy-4NTk-HGsGA61XtwVQFYv9mwWk,7955
39
- uipath/_services/actions_service.py,sha256=Dl0ppz4lLiTMAvaS44Qp20FBjRIZbL-58FlifYIoXI8,14986
39
+ uipath/_services/actions_service.py,sha256=tOu3EwzLrDGXHwqzUsgKI4tbhJHDlumleGywnKH1sAs,15839
40
40
  uipath/_services/api_client.py,sha256=1hYLc_90dQzCGnqqirEHpPqvL3Gkv2sSKoeOV_iTmlk,2903
41
41
  uipath/_services/assets_service.py,sha256=UUWzQiYruNAWk3P8qPrccDDWRUD_ycfqf3eRM-E9N44,9080
42
42
  uipath/_services/buckets_service.py,sha256=h1Rx9H4XV2cxIZ1xIcYjNYFa1YZEHgIhQpQ10jZIinU,9154
@@ -73,8 +73,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
73
73
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
74
74
  uipath/tracing/_traced.py,sha256=9nEjFjGuxPlJ_4OXoClJ79xcbFK6C8iyI03kQQSDaJg,14834
75
75
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
76
- uipath-2.0.14.dist-info/METADATA,sha256=IaNBRJ_zhb0K7FfqtxqwtiH5LspaDLhgEZ45H93Pv8U,6078
77
- uipath-2.0.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
78
- uipath-2.0.14.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
79
- uipath-2.0.14.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
80
- uipath-2.0.14.dist-info/RECORD,,
76
+ uipath-2.0.15.dist-info/METADATA,sha256=_UQmbebHY9fYHwgZlLJWiBpKFnm-EokoN4wFmI-BJXg,6078
77
+ uipath-2.0.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
78
+ uipath-2.0.15.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
79
+ uipath-2.0.15.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
80
+ uipath-2.0.15.dist-info/RECORD,,