uipath 2.1.25__py3-none-any.whl → 2.1.27__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.
@@ -8,7 +8,7 @@ import traceback
8
8
  from abc import ABC, abstractmethod
9
9
  from enum import Enum
10
10
  from functools import cached_property
11
- from typing import Any, Dict, Optional, Union
11
+ from typing import Any, Dict, Generic, Optional, Type, TypeVar, Union
12
12
 
13
13
  from pydantic import BaseModel, Field
14
14
 
@@ -465,3 +465,38 @@ class UiPathBaseRuntime(ABC):
465
465
  os.makedirs(self.context.runtime_dir, exist_ok=True)
466
466
  return os.path.join(self.context.runtime_dir, self.context.state_file)
467
467
  return os.path.join("__uipath", "state.db")
468
+
469
+
470
+ T = TypeVar("T", bound=UiPathBaseRuntime)
471
+ C = TypeVar("C", bound=UiPathRuntimeContext)
472
+
473
+
474
+ class UiPathRuntimeFactory(Generic[T, C]):
475
+ """Generic factory for UiPath runtime classes."""
476
+
477
+ def __init__(self, runtime_class: Type[T], context_class: Type[C]):
478
+ if not issubclass(runtime_class, UiPathBaseRuntime):
479
+ raise TypeError(
480
+ f"runtime_class {runtime_class.__name__} must inherit from UiPathBaseRuntime"
481
+ )
482
+
483
+ if not issubclass(context_class, UiPathRuntimeContext):
484
+ raise TypeError(
485
+ f"context_class {context_class.__name__} must inherit from UiPathRuntimeContext"
486
+ )
487
+
488
+ self.runtime_class = runtime_class
489
+ self.context_class = context_class
490
+
491
+ def new_context(self, **kwargs) -> C:
492
+ """Create a new context instance."""
493
+ return self.context_class(**kwargs)
494
+
495
+ def from_context(self, context: C) -> T:
496
+ """Create runtime instance from context."""
497
+ return self.runtime_class.from_context(context)
498
+
499
+ async def execute(self, context: C) -> Optional[UiPathRuntimeResult]:
500
+ """Execute runtime with context."""
501
+ async with self.from_context(context) as runtime:
502
+ return await runtime.execute()
@@ -107,7 +107,7 @@ class BaseService:
107
107
  scoped_url = self._url.scope_url(str(url), scoped)
108
108
 
109
109
  if infer_content_type:
110
- self._client_async.headers.pop("Content-Type", None)
110
+ self._client.headers.pop("Content-Type", None)
111
111
 
112
112
  response = self._client.request(method, scoped_url, **kwargs)
113
113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.25
3
+ Version: 2.1.27
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
@@ -44,7 +44,7 @@ uipath/_cli/_evals/_models/__init__.py,sha256=Ewjp3u2YeTH2MmzY9LWf7EIbAoIf_nW9fM
44
44
  uipath/_cli/_evals/_models/_evaluation_set.py,sha256=tVHykSget-G3sOCs9bSchMYUTpFqzXVlYYbY8L9SI0c,1518
45
45
  uipath/_cli/_evals/_models/_evaluators.py,sha256=l57NEVyYmzSKuoIXuGkE94Br01hAMg35fiS2MlTkaQM,2115
46
46
  uipath/_cli/_push/sw_file_handler.py,sha256=5zAt03gSlni7RnJmZJP4d4RVC33u8lZWj3W9xwx-CFM,18064
47
- uipath/_cli/_runtime/_contracts.py,sha256=WlpaiQAMWCo-JFHjee35Klf49A3GsKjOU1Mf2IpUGHY,16033
47
+ uipath/_cli/_runtime/_contracts.py,sha256=964pu4PJ29SNKU6I_iJXPEcwPWSZ9u2ab5EDlQX4sPM,17314
48
48
  uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
49
49
  uipath/_cli/_runtime/_hitl.py,sha256=aexwe0dIXvh6SlVS1jVnO_aGZc6e3gLsmGkCyha5AHo,11300
50
50
  uipath/_cli/_runtime/_logging.py,sha256=0_8OeF2w2zcryvozOsB3h4sFktiwnUqJr_fMRxwUFOc,8004
@@ -67,7 +67,7 @@ uipath/_cli/_utils/_studio_project.py,sha256=X4X9HbdbGgLQtJRE-h8rcALCrupWkrpqOfS
67
67
  uipath/_cli/_utils/_tracing.py,sha256=2igb03j3EHjF_A406UhtCKkPfudVfFPjUq5tXUEG4oo,1541
68
68
  uipath/_cli/_utils/_uv_helpers.py,sha256=6SvoLnZPoKIxW0sjMvD1-ENV_HOXDYzH34GjBqwT138,3450
69
69
  uipath/_services/__init__.py,sha256=10xtw3ENC30yR9CCq_b94RMZ3YrUeyfHV33yWYUd8tU,896
70
- uipath/_services/_base_service.py,sha256=d7Rt3w9aPy-LLP7yNSjZr03fy6qijQrlXlI--Id5bLs,6092
70
+ uipath/_services/_base_service.py,sha256=Z81kcx2h0ZH9IYnlKjztmrY7SWhnrdMW2llvG9TFI4A,6086
71
71
  uipath/_services/actions_service.py,sha256=LYKvG4VxNGQgZ46AzGK9kI1Txb-YmVvZj5ScPOue8Ls,15989
72
72
  uipath/_services/api_client.py,sha256=AbRmpXQScrJIVfDQM309G1GNP3ILLKOrusouhxNQZf0,2156
73
73
  uipath/_services/assets_service.py,sha256=acqWogfhZiSO1eeVYqFxmqWGSTmrW46QxI1J0bJe3jo,11918
@@ -116,8 +116,8 @@ uipath/tracing/_traced.py,sha256=qeVDrds2OUnpdUIA0RhtF0kg2dlAZhyC1RRkI-qivTM,185
116
116
  uipath/tracing/_utils.py,sha256=wJRELaPu69iY0AhV432Dk5QYf_N_ViRU4kAUG1BI1ew,10384
117
117
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
118
118
  uipath/utils/_endpoints_manager.py,sha256=iRTl5Q0XAm_YgcnMcJOXtj-8052sr6jpWuPNz6CgT0Q,8408
119
- uipath-2.1.25.dist-info/METADATA,sha256=07yw-KMr0bRb2bR0C7iJrYPf3fi4qEhYyVUeezOackA,6367
120
- uipath-2.1.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
121
- uipath-2.1.25.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
122
- uipath-2.1.25.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
123
- uipath-2.1.25.dist-info/RECORD,,
119
+ uipath-2.1.27.dist-info/METADATA,sha256=jHfcM06Sp1vBb5R2uUdxem7s7zHkmM_B11EI6WJ5fag,6367
120
+ uipath-2.1.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
121
+ uipath-2.1.27.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
122
+ uipath-2.1.27.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
123
+ uipath-2.1.27.dist-info/RECORD,,