uipath 2.0.39__py3-none-any.whl → 2.0.41__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.
- uipath/_services/connections_service.py +2 -82
- uipath/_services/context_grounding_service.py +30 -44
- {uipath-2.0.39.dist-info → uipath-2.0.41.dist-info}/METADATA +1 -1
- {uipath-2.0.39.dist-info → uipath-2.0.41.dist-info}/RECORD +7 -8
- uipath/_services/connections_service.pyi +0 -50
- {uipath-2.0.39.dist-info → uipath-2.0.41.dist-info}/WHEEL +0 -0
- {uipath-2.0.39.dist-info → uipath-2.0.41.dist-info}/entry_points.txt +0 -0
- {uipath-2.0.39.dist-info → uipath-2.0.41.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,77 +1,24 @@
|
|
|
1
|
-
import importlib
|
|
2
1
|
import logging
|
|
3
|
-
from typing import Any, Dict, Protocol, TypeVar, Union
|
|
4
2
|
|
|
5
3
|
from .._config import Config
|
|
6
4
|
from .._execution_context import ExecutionContext
|
|
7
5
|
from .._utils import Endpoint, RequestSpec
|
|
8
|
-
from .._utils.constants import ENTRYPOINT
|
|
9
6
|
from ..models import Connection, ConnectionToken
|
|
10
7
|
from ..tracing._traced import traced
|
|
11
8
|
from ._base_service import BaseService
|
|
12
9
|
|
|
13
|
-
T_co = TypeVar("T_co", covariant=True)
|
|
14
|
-
|
|
15
10
|
logger: logging.Logger = logging.getLogger("uipath")
|
|
16
11
|
|
|
17
12
|
|
|
18
|
-
class PluginNotFoundError(AttributeError):
|
|
19
|
-
"""Raised when a plugin is not installed or failed to load."""
|
|
20
|
-
|
|
21
|
-
pass
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class Connector(Protocol[T_co]):
|
|
25
|
-
def __call__(self, *, client: Any, instance_id: Union[str, int]) -> T_co: ...
|
|
26
|
-
|
|
27
|
-
|
|
28
13
|
class ConnectionsService(BaseService):
|
|
29
14
|
"""Service for managing UiPath external service connections.
|
|
30
15
|
|
|
31
|
-
This service provides methods to retrieve
|
|
32
|
-
|
|
33
|
-
both direct connection information retrieval and secure token management.
|
|
34
|
-
|
|
35
|
-
The service implements a flexible connector system that allows for type-safe
|
|
36
|
-
instantiation of specific service connectors, making it easier to interact
|
|
37
|
-
with different types of external services.
|
|
16
|
+
This service provides methods to retrieve direct connection information retrieval
|
|
17
|
+
and secure token management.
|
|
38
18
|
"""
|
|
39
19
|
|
|
40
20
|
def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
|
|
41
21
|
super().__init__(config=config, execution_context=execution_context)
|
|
42
|
-
self._plugins: Dict[str, Any] = {}
|
|
43
|
-
self._plugins_loaded = False
|
|
44
|
-
self._load_connectors()
|
|
45
|
-
|
|
46
|
-
def __call__(self, connector: Connector[T_co], key: str) -> T_co:
|
|
47
|
-
connection = self.retrieve(key)
|
|
48
|
-
return connector(client=self.client, instance_id=connection.element_instance_id)
|
|
49
|
-
|
|
50
|
-
def __getattr__(self, name: str) -> Any:
|
|
51
|
-
"""Get a plugin by name.
|
|
52
|
-
|
|
53
|
-
Args:
|
|
54
|
-
name: The name of the plugin to get
|
|
55
|
-
|
|
56
|
-
Returns:
|
|
57
|
-
The plugin instance
|
|
58
|
-
|
|
59
|
-
Raises:
|
|
60
|
-
PluginNotFoundError: If the plugin is not installed
|
|
61
|
-
ImportError: If the plugin fails to load
|
|
62
|
-
"""
|
|
63
|
-
if not self._plugins_loaded:
|
|
64
|
-
self._load_connectors()
|
|
65
|
-
|
|
66
|
-
if name in self._plugins:
|
|
67
|
-
return self._plugins[name]
|
|
68
|
-
|
|
69
|
-
try:
|
|
70
|
-
plugin: Any = getattr(self.client, name)
|
|
71
|
-
self._plugins[name] = plugin
|
|
72
|
-
return plugin
|
|
73
|
-
except AttributeError as e:
|
|
74
|
-
raise PluginNotFoundError(f"Plugin '{name}' is not installed") from e
|
|
75
22
|
|
|
76
23
|
@traced(
|
|
77
24
|
name="connections_retrieve",
|
|
@@ -177,30 +124,3 @@ class ConnectionsService(BaseService):
|
|
|
177
124
|
endpoint=Endpoint(f"/connections_/api/v1/Connections/{key}/token"),
|
|
178
125
|
params={"type": "direct"},
|
|
179
126
|
)
|
|
180
|
-
|
|
181
|
-
def _load_connectors(self) -> None:
|
|
182
|
-
"""Load all available connector plugins.
|
|
183
|
-
|
|
184
|
-
Raises:
|
|
185
|
-
ImportError: If a plugin fails to load
|
|
186
|
-
"""
|
|
187
|
-
try:
|
|
188
|
-
entry_points: Any = importlib.metadata.entry_points()
|
|
189
|
-
if hasattr(entry_points, "select"):
|
|
190
|
-
connectors = list(entry_points.select(group=ENTRYPOINT))
|
|
191
|
-
else:
|
|
192
|
-
connectors = list(entry_points.get(ENTRYPOINT, []))
|
|
193
|
-
|
|
194
|
-
for entry_point in connectors:
|
|
195
|
-
try:
|
|
196
|
-
register_func = entry_point.load()
|
|
197
|
-
register_func(self)
|
|
198
|
-
except Exception as e:
|
|
199
|
-
logger.error(
|
|
200
|
-
f"[ERROR] Failed to load plugin {entry_point.name}: {str(e)}"
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
self._plugins_loaded = True
|
|
204
|
-
except Exception as e:
|
|
205
|
-
self._plugins_loaded = False
|
|
206
|
-
raise ImportError(f"Failed to load plugins: {str(e)}") from e
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from typing import Any,
|
|
2
|
+
from typing import Any, List, Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import TypeAdapter
|
|
5
5
|
|
|
@@ -8,8 +8,6 @@ from .._execution_context import ExecutionContext
|
|
|
8
8
|
from .._folder_context import FolderContext
|
|
9
9
|
from .._utils import Endpoint, RequestSpec, header_folder
|
|
10
10
|
from .._utils.constants import (
|
|
11
|
-
HEADER_FOLDER_KEY,
|
|
12
|
-
HEADER_FOLDER_PATH,
|
|
13
11
|
ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE,
|
|
14
12
|
)
|
|
15
13
|
from ..models import IngestionInProgressException
|
|
@@ -440,36 +438,19 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
440
438
|
headers=spec.headers,
|
|
441
439
|
)
|
|
442
440
|
|
|
443
|
-
@property
|
|
444
|
-
def custom_headers(self) -> Dict[str, str]:
|
|
445
|
-
self._folder_key = self._folder_key or (
|
|
446
|
-
self._folders_service.retrieve_key_by_folder_path(self._folder_path)
|
|
447
|
-
if self._folder_path
|
|
448
|
-
else None
|
|
449
|
-
)
|
|
450
|
-
|
|
451
|
-
if self._folder_key is None:
|
|
452
|
-
raise ValueError(
|
|
453
|
-
f"Neither the folder key nor the folder path is set ({HEADER_FOLDER_KEY}, {HEADER_FOLDER_PATH})"
|
|
454
|
-
)
|
|
455
|
-
|
|
456
|
-
return self.folder_headers
|
|
457
|
-
|
|
458
441
|
def _ingest_spec(
|
|
459
442
|
self,
|
|
460
443
|
key: str,
|
|
461
444
|
folder_key: Optional[str] = None,
|
|
462
445
|
folder_path: Optional[str] = None,
|
|
463
446
|
) -> RequestSpec:
|
|
464
|
-
|
|
465
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
466
|
-
folder_path = None
|
|
447
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
467
448
|
|
|
468
449
|
return RequestSpec(
|
|
469
450
|
method="POST",
|
|
470
451
|
endpoint=Endpoint(f"/ecs_/v2/indexes/{key}/ingest"),
|
|
471
452
|
headers={
|
|
472
|
-
**header_folder(folder_key,
|
|
453
|
+
**header_folder(folder_key, None),
|
|
473
454
|
},
|
|
474
455
|
)
|
|
475
456
|
|
|
@@ -479,17 +460,14 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
479
460
|
folder_key: Optional[str] = None,
|
|
480
461
|
folder_path: Optional[str] = None,
|
|
481
462
|
) -> RequestSpec:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
485
|
-
folder_path = None
|
|
486
|
-
print("~~~", name, folder_key, folder_path)
|
|
463
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
464
|
+
|
|
487
465
|
return RequestSpec(
|
|
488
466
|
method="GET",
|
|
489
467
|
endpoint=Endpoint("/ecs_/v2/indexes"),
|
|
490
468
|
params={"$filter": f"Name eq '{name}'"},
|
|
491
469
|
headers={
|
|
492
|
-
**header_folder(folder_key,
|
|
470
|
+
**header_folder(folder_key, None),
|
|
493
471
|
},
|
|
494
472
|
)
|
|
495
473
|
|
|
@@ -503,9 +481,7 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
503
481
|
folder_key: Optional[str] = None,
|
|
504
482
|
folder_path: Optional[str] = None,
|
|
505
483
|
) -> RequestSpec:
|
|
506
|
-
|
|
507
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
508
|
-
folder_path = None
|
|
484
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
509
485
|
|
|
510
486
|
storage_bucket_folder_path = (
|
|
511
487
|
storage_bucket_folder_path
|
|
@@ -531,7 +507,7 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
531
507
|
}
|
|
532
508
|
),
|
|
533
509
|
headers={
|
|
534
|
-
**header_folder(folder_key,
|
|
510
|
+
**header_folder(folder_key, None),
|
|
535
511
|
},
|
|
536
512
|
)
|
|
537
513
|
|
|
@@ -541,15 +517,13 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
541
517
|
folder_key: Optional[str] = None,
|
|
542
518
|
folder_path: Optional[str] = None,
|
|
543
519
|
) -> RequestSpec:
|
|
544
|
-
|
|
545
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
546
|
-
folder_path = None
|
|
520
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
547
521
|
|
|
548
522
|
return RequestSpec(
|
|
549
523
|
method="GET",
|
|
550
524
|
endpoint=Endpoint(f"/ecs_/v2/indexes/{id}"),
|
|
551
525
|
headers={
|
|
552
|
-
**header_folder(folder_key,
|
|
526
|
+
**header_folder(folder_key, None),
|
|
553
527
|
},
|
|
554
528
|
)
|
|
555
529
|
|
|
@@ -559,15 +533,13 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
559
533
|
folder_key: Optional[str] = None,
|
|
560
534
|
folder_path: Optional[str] = None,
|
|
561
535
|
) -> RequestSpec:
|
|
562
|
-
|
|
563
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
564
|
-
folder_path = None
|
|
536
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
565
537
|
|
|
566
538
|
return RequestSpec(
|
|
567
539
|
method="DELETE",
|
|
568
540
|
endpoint=Endpoint(f"/ecs_/v2/indexes/{id}"),
|
|
569
541
|
headers={
|
|
570
|
-
**header_folder(folder_key,
|
|
542
|
+
**header_folder(folder_key, None),
|
|
571
543
|
},
|
|
572
544
|
)
|
|
573
545
|
|
|
@@ -579,9 +551,7 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
579
551
|
folder_key: Optional[str] = None,
|
|
580
552
|
folder_path: Optional[str] = None,
|
|
581
553
|
) -> RequestSpec:
|
|
582
|
-
|
|
583
|
-
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
584
|
-
folder_path = None
|
|
554
|
+
folder_key = self._resolve_folder_key(folder_key, folder_path)
|
|
585
555
|
|
|
586
556
|
return RequestSpec(
|
|
587
557
|
method="POST",
|
|
@@ -593,6 +563,22 @@ class ContextGroundingService(FolderContext, BaseService):
|
|
|
593
563
|
}
|
|
594
564
|
),
|
|
595
565
|
headers={
|
|
596
|
-
**header_folder(folder_key,
|
|
566
|
+
**header_folder(folder_key, None),
|
|
597
567
|
},
|
|
598
568
|
)
|
|
569
|
+
|
|
570
|
+
def _resolve_folder_key(self, folder_key, folder_path):
|
|
571
|
+
if folder_key is None and folder_path is not None:
|
|
572
|
+
folder_key = self._folders_service.retrieve_key_by_folder_path(folder_path)
|
|
573
|
+
|
|
574
|
+
if folder_key is None and folder_path is None:
|
|
575
|
+
folder_key = self._folder_key or (
|
|
576
|
+
self._folders_service.retrieve_key_by_folder_path(self._folder_path)
|
|
577
|
+
if self._folder_path
|
|
578
|
+
else None
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
if folder_key is None:
|
|
582
|
+
raise ValueError("Folder key or folder path is required")
|
|
583
|
+
|
|
584
|
+
return folder_key
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.41
|
|
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
|
|
@@ -45,9 +45,8 @@ uipath/_services/actions_service.py,sha256=PQ6HGEfX1vRBkFsjP2ykBRc9xOIf7wVKJC7Dk
|
|
|
45
45
|
uipath/_services/api_client.py,sha256=1hYLc_90dQzCGnqqirEHpPqvL3Gkv2sSKoeOV_iTmlk,2903
|
|
46
46
|
uipath/_services/assets_service.py,sha256=4TsHd_b3VQZlN195ecrCHbQcaNew0GWEk90SFhvNJTU,9352
|
|
47
47
|
uipath/_services/buckets_service.py,sha256=m0HMWBkooUhjTtna_ZXcw4QOzKmaibuepWlC8wPGtlA,9330
|
|
48
|
-
uipath/_services/connections_service.py,sha256=
|
|
49
|
-
uipath/_services/
|
|
50
|
-
uipath/_services/context_grounding_service.py,sha256=nZDntNcpPNHcEfgw-Aq-9t2YpVx1uPTphBnVwnztM6E,19287
|
|
48
|
+
uipath/_services/connections_service.py,sha256=qh-HNL_GJsyPUD0wSJZRF8ZdrTE9l4HrIilmXGK6dDk,4581
|
|
49
|
+
uipath/_services/context_grounding_service.py,sha256=eRBe5a3uubFCYVHwt6KWCYNW8MMjID5ri_uHefIt1KY,18573
|
|
51
50
|
uipath/_services/folder_service.py,sha256=HtsBoBejvMuIZ-9gocAG9B8uKOFsAAD4WUozta-isXk,1673
|
|
52
51
|
uipath/_services/jobs_service.py,sha256=MsJlu1egvHKZhHdammp4Xo9iJzceWquW4qIWT-nPBws,8214
|
|
53
52
|
uipath/_services/llm_gateway_service.py,sha256=ySg3sflIoXmY9K7txlSm7bkuI2qzBT0kAKmGlFBk5KA,12032
|
|
@@ -79,8 +78,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
|
|
|
79
78
|
uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
|
|
80
79
|
uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
|
|
81
80
|
uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
|
|
82
|
-
uipath-2.0.
|
|
83
|
-
uipath-2.0.
|
|
84
|
-
uipath-2.0.
|
|
85
|
-
uipath-2.0.
|
|
86
|
-
uipath-2.0.
|
|
81
|
+
uipath-2.0.41.dist-info/METADATA,sha256=2PnSGExZd8yIYf5BQTQfyaOhcsUuPxaBc8eg_lLOlnw,6254
|
|
82
|
+
uipath-2.0.41.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
83
|
+
uipath-2.0.41.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
84
|
+
uipath-2.0.41.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
85
|
+
uipath-2.0.41.dist-info/RECORD,,
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# This file is generated by the build system. Do not edit it directly.
|
|
2
|
-
from typing import TYPE_CHECKING, Any, Protocol, TypeVar
|
|
3
|
-
|
|
4
|
-
from .._config import Config as Config
|
|
5
|
-
from .._execution_context import ExecutionContext as ExecutionContext
|
|
6
|
-
from .._utils import Endpoint as Endpoint
|
|
7
|
-
from .._utils import RequestSpec as RequestSpec
|
|
8
|
-
from .._utils.constants import ENTRYPOINT as ENTRYPOINT
|
|
9
|
-
from ..models import Connection as Connection
|
|
10
|
-
from ..models import ConnectionToken as ConnectionToken
|
|
11
|
-
from ._base_service import BaseService as BaseService
|
|
12
|
-
|
|
13
|
-
if TYPE_CHECKING:
|
|
14
|
-
from uipath_connectors.atlassian_jira import AtlassianJira # type: ignore
|
|
15
|
-
from uipath_connectors.box_box import BoxBox # type: ignore
|
|
16
|
-
from uipath_connectors.google_drive import GoogleDrive # type: ignore
|
|
17
|
-
from uipath_connectors.google_gmail import GoogleGmail # type: ignore
|
|
18
|
-
from uipath_connectors.google_sheets import GoogleSheets # type: ignore
|
|
19
|
-
from uipath_connectors.microsoft_github import MicrosoftGithub # type: ignore
|
|
20
|
-
from uipath_connectors.microsoft_onedrive import MicrosoftOneDrive # type: ignore
|
|
21
|
-
from uipath_connectors.oracle_netsuite import OracleNetsuite # type: ignore
|
|
22
|
-
from uipath_connectors.salesforce_sfdc import SalesforceSfdc # type: ignore
|
|
23
|
-
from uipath_connectors.salesforce_slack import SalesforceSlack # type: ignore
|
|
24
|
-
from uipath_connectors.uipath_airdk import UipathAirdk # type: ignore
|
|
25
|
-
|
|
26
|
-
T_co = TypeVar("T_co", covariant=True)
|
|
27
|
-
|
|
28
|
-
class Connector(Protocol[T_co]):
|
|
29
|
-
def __call__(self, *, client: Any, instance_id: str | int) -> T_co: ...
|
|
30
|
-
|
|
31
|
-
class ConnectionsService(BaseService):
|
|
32
|
-
def __init__(self, config: Config, execution_context: ExecutionContext) -> None: ...
|
|
33
|
-
def __call__(self, connector: Connector[T_co], key: str) -> T_co: ...
|
|
34
|
-
def __getattr__(self, name: str) -> Any: ...
|
|
35
|
-
def retrieve(self, key: str) -> Connection: ...
|
|
36
|
-
async def retrieve_async(self, key: str) -> Connection: ...
|
|
37
|
-
def retrieve_token(self, key: str) -> ConnectionToken: ...
|
|
38
|
-
async def retrieve_token_async(self, key: str) -> ConnectionToken: ...
|
|
39
|
-
|
|
40
|
-
atlassian_jira: "AtlassianJira"
|
|
41
|
-
box_box: "BoxBox"
|
|
42
|
-
google_drive: "GoogleDrive"
|
|
43
|
-
google_gmail: "GoogleGmail"
|
|
44
|
-
google_sheets: "GoogleSheets"
|
|
45
|
-
microsoft_github: "MicrosoftGithub"
|
|
46
|
-
microsoft_onedrive: "MicrosoftOneDrive"
|
|
47
|
-
oracle_netsuite: "OracleNetsuite"
|
|
48
|
-
salesforce_sfdc: "SalesforceSfdc"
|
|
49
|
-
salesforce_slack: "SalesforceSlack"
|
|
50
|
-
uipath_airdk: "UipathAirdk"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|