uipath 2.1.126__py3-none-any.whl → 2.1.127__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/_resources/SDK_REFERENCE.md +2 -2
- uipath/_services/connections_service.py +171 -14
- uipath/models/connections.py +1 -0
- {uipath-2.1.126.dist-info → uipath-2.1.127.dist-info}/METADATA +1 -1
- {uipath-2.1.126.dist-info → uipath-2.1.127.dist-info}/RECORD +8 -8
- {uipath-2.1.126.dist-info → uipath-2.1.127.dist-info}/WHEEL +0 -0
- {uipath-2.1.126.dist-info → uipath-2.1.127.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.126.dist-info → uipath-2.1.127.dist-info}/licenses/LICENSE +0 -0
|
@@ -168,10 +168,10 @@ sdk.connections.list(name: Optional[str]=None, folder_path: Optional[str]=None,
|
|
|
168
168
|
sdk.connections.list_async(name: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, connector_key: Optional[str]=None, skip: Optional[int]=None, top: Optional[int]=None) -> typing.List[uipath.models.connections.Connection]
|
|
169
169
|
|
|
170
170
|
# Synchronously retrieve connection API metadata.
|
|
171
|
-
sdk.connections.metadata(element_instance_id: int, tool_path: str, schema_mode: bool=True) -> uipath.models.connections.ConnectionMetadata
|
|
171
|
+
sdk.connections.metadata(element_instance_id: int, connector_key: str, tool_path: str, parameters: Optional[Dict[str, str]]=None, schema_mode: bool=True, max_jit_depth: int=5) -> uipath.models.connections.ConnectionMetadata
|
|
172
172
|
|
|
173
173
|
# Asynchronously retrieve connection API metadata.
|
|
174
|
-
sdk.connections.metadata_async(element_instance_id: int, tool_path: str, schema_mode: bool=True) -> uipath.models.connections.ConnectionMetadata
|
|
174
|
+
sdk.connections.metadata_async(element_instance_id: int, connector_key: str, tool_path: str, parameters: Optional[Dict[str, str]]=None, schema_mode: bool=True, max_jit_depth: int=5) -> uipath.models.connections.ConnectionMetadata
|
|
175
175
|
|
|
176
176
|
# Retrieve connection details by its key.
|
|
177
177
|
sdk.connections.retrieve(key: str) -> uipath.models.connections.Connection
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
from typing import Any, Dict, List, Optional
|
|
4
|
+
from urllib.parse import parse_qsl, quote, urlsplit
|
|
4
5
|
|
|
5
6
|
from httpx import Response
|
|
6
7
|
|
|
@@ -60,24 +61,77 @@ class ConnectionsService(BaseService):
|
|
|
60
61
|
hide_output=True,
|
|
61
62
|
)
|
|
62
63
|
def metadata(
|
|
63
|
-
self,
|
|
64
|
+
self,
|
|
65
|
+
element_instance_id: int,
|
|
66
|
+
connector_key: str,
|
|
67
|
+
tool_path: str,
|
|
68
|
+
parameters: Optional[Dict[str, str]] = None,
|
|
69
|
+
schema_mode: bool = True,
|
|
70
|
+
max_jit_depth: int = 5,
|
|
64
71
|
) -> ConnectionMetadata:
|
|
65
72
|
"""Synchronously retrieve connection API metadata.
|
|
66
73
|
|
|
67
|
-
This method fetches the metadata for a connection,
|
|
68
|
-
|
|
74
|
+
This method fetches the metadata for a connection. When parameters are provided,
|
|
75
|
+
it automatically fetches JIT (Just-In-Time) metadata for cascading fields in a loop,
|
|
76
|
+
following action URLs up to a maximum depth.
|
|
69
77
|
|
|
70
78
|
Args:
|
|
71
79
|
element_instance_id (int): The element instance ID of the connection.
|
|
80
|
+
connector_key (str): The connector key (e.g., 'uipath-atlassian-jira', 'uipath-slack').
|
|
72
81
|
tool_path (str): The tool path to retrieve metadata for.
|
|
82
|
+
parameters (Optional[Dict[str, str]]): Parameter values. When provided, triggers
|
|
83
|
+
automatic JIT fetching for cascading fields.
|
|
73
84
|
schema_mode (bool): Whether or not to represent the output schema in the response fields.
|
|
85
|
+
max_jit_depth (int): The maximum depth of the JIT resolution loop.
|
|
74
86
|
|
|
75
87
|
Returns:
|
|
76
88
|
ConnectionMetadata: The connection metadata.
|
|
89
|
+
|
|
90
|
+
Examples:
|
|
91
|
+
>>> metadata = sdk.connections.metadata(
|
|
92
|
+
... element_instance_id=123,
|
|
93
|
+
... connector_key="uipath-atlassian-jira",
|
|
94
|
+
... tool_path="Issue",
|
|
95
|
+
... parameters={"projectId": "PROJ-123"} # Optional
|
|
96
|
+
... )
|
|
77
97
|
"""
|
|
78
|
-
spec = self._metadata_spec(
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
spec = self._metadata_spec(
|
|
99
|
+
element_instance_id, connector_key, tool_path, schema_mode
|
|
100
|
+
)
|
|
101
|
+
response = self.request(
|
|
102
|
+
spec.method, url=spec.endpoint, params=spec.params, headers=spec.headers
|
|
103
|
+
)
|
|
104
|
+
data = response.json()
|
|
105
|
+
metadata = ConnectionMetadata.model_validate(data)
|
|
106
|
+
|
|
107
|
+
last_action_url = None
|
|
108
|
+
depth = 0
|
|
109
|
+
|
|
110
|
+
while (
|
|
111
|
+
parameters
|
|
112
|
+
and (action_url := self._get_jit_action_url(metadata))
|
|
113
|
+
and depth < max_jit_depth
|
|
114
|
+
):
|
|
115
|
+
# Stop if we're about to call the same URL template again
|
|
116
|
+
if action_url == last_action_url:
|
|
117
|
+
break
|
|
118
|
+
|
|
119
|
+
last_action_url = action_url
|
|
120
|
+
depth += 1
|
|
121
|
+
|
|
122
|
+
jit_spec = self._metadata_jit_spec(
|
|
123
|
+
element_instance_id, action_url, parameters, schema_mode
|
|
124
|
+
)
|
|
125
|
+
jit_response = self.request(
|
|
126
|
+
jit_spec.method,
|
|
127
|
+
url=jit_spec.endpoint,
|
|
128
|
+
params=jit_spec.params,
|
|
129
|
+
headers=jit_spec.headers,
|
|
130
|
+
)
|
|
131
|
+
data = jit_response.json()
|
|
132
|
+
metadata = ConnectionMetadata.model_validate(data)
|
|
133
|
+
|
|
134
|
+
return metadata
|
|
81
135
|
|
|
82
136
|
@traced(name="connections_list", run_type="uipath")
|
|
83
137
|
def list(
|
|
@@ -217,26 +271,77 @@ class ConnectionsService(BaseService):
|
|
|
217
271
|
hide_output=True,
|
|
218
272
|
)
|
|
219
273
|
async def metadata_async(
|
|
220
|
-
self,
|
|
274
|
+
self,
|
|
275
|
+
element_instance_id: int,
|
|
276
|
+
connector_key: str,
|
|
277
|
+
tool_path: str,
|
|
278
|
+
parameters: Optional[Dict[str, str]] = None,
|
|
279
|
+
schema_mode: bool = True,
|
|
280
|
+
max_jit_depth: int = 5,
|
|
221
281
|
) -> ConnectionMetadata:
|
|
222
282
|
"""Asynchronously retrieve connection API metadata.
|
|
223
283
|
|
|
224
|
-
This method fetches the metadata for a connection,
|
|
225
|
-
|
|
284
|
+
This method fetches the metadata for a connection. When parameters are provided,
|
|
285
|
+
it automatically fetches JIT (Just-In-Time) metadata for cascading fields in a loop,
|
|
286
|
+
following action URLs up to a maximum depth.
|
|
226
287
|
|
|
227
288
|
Args:
|
|
228
289
|
element_instance_id (int): The element instance ID of the connection.
|
|
290
|
+
connector_key (str): The connector key (e.g., 'uipath-atlassian-jira', 'uipath-slack').
|
|
229
291
|
tool_path (str): The tool path to retrieve metadata for.
|
|
292
|
+
parameters (Optional[Dict[str, str]]): Parameter values. When provided, triggers
|
|
293
|
+
automatic JIT fetching for cascading fields.
|
|
230
294
|
schema_mode (bool): Whether or not to represent the output schema in the response fields.
|
|
295
|
+
max_jit_depth (int): The maximum depth of the JIT resolution loop.
|
|
231
296
|
|
|
232
297
|
Returns:
|
|
233
298
|
ConnectionMetadata: The connection metadata.
|
|
299
|
+
|
|
300
|
+
Examples:
|
|
301
|
+
>>> metadata = await sdk.connections.metadata_async(
|
|
302
|
+
... element_instance_id=123,
|
|
303
|
+
... connector_key="uipath-atlassian-jira",
|
|
304
|
+
... tool_path="Issue",
|
|
305
|
+
... parameters={"projectId": "PROJ-123"} # Optional
|
|
306
|
+
... )
|
|
234
307
|
"""
|
|
235
|
-
spec = self._metadata_spec(
|
|
308
|
+
spec = self._metadata_spec(
|
|
309
|
+
element_instance_id, connector_key, tool_path, schema_mode
|
|
310
|
+
)
|
|
236
311
|
response = await self.request_async(
|
|
237
|
-
spec.method, url=spec.endpoint, headers=spec.headers
|
|
312
|
+
spec.method, url=spec.endpoint, params=spec.params, headers=spec.headers
|
|
238
313
|
)
|
|
239
|
-
|
|
314
|
+
data = response.json()
|
|
315
|
+
metadata = ConnectionMetadata.model_validate(data)
|
|
316
|
+
|
|
317
|
+
last_action_url = None
|
|
318
|
+
depth = 0
|
|
319
|
+
|
|
320
|
+
while (
|
|
321
|
+
parameters
|
|
322
|
+
and (action_url := self._get_jit_action_url(metadata))
|
|
323
|
+
and depth < max_jit_depth
|
|
324
|
+
):
|
|
325
|
+
# Stop if we're about to call the same URL template again
|
|
326
|
+
if action_url == last_action_url:
|
|
327
|
+
break
|
|
328
|
+
|
|
329
|
+
last_action_url = action_url
|
|
330
|
+
depth += 1
|
|
331
|
+
|
|
332
|
+
jit_spec = self._metadata_jit_spec(
|
|
333
|
+
element_instance_id, action_url, parameters, schema_mode
|
|
334
|
+
)
|
|
335
|
+
jit_response = await self.request_async(
|
|
336
|
+
jit_spec.method,
|
|
337
|
+
url=jit_spec.endpoint,
|
|
338
|
+
params=jit_spec.params,
|
|
339
|
+
headers=jit_spec.headers,
|
|
340
|
+
)
|
|
341
|
+
data = jit_response.json()
|
|
342
|
+
metadata = ConnectionMetadata.model_validate(data)
|
|
343
|
+
|
|
344
|
+
return metadata
|
|
240
345
|
|
|
241
346
|
@traced(
|
|
242
347
|
name="connections_retrieve_token",
|
|
@@ -377,9 +482,13 @@ class ConnectionsService(BaseService):
|
|
|
377
482
|
)
|
|
378
483
|
|
|
379
484
|
def _metadata_spec(
|
|
380
|
-
self,
|
|
485
|
+
self,
|
|
486
|
+
element_instance_id: int,
|
|
487
|
+
connector_key: str,
|
|
488
|
+
tool_path: str,
|
|
489
|
+
schema_mode: bool,
|
|
381
490
|
) -> RequestSpec:
|
|
382
|
-
metadata_endpoint_url = f"/elements_/v3/element/instances/{element_instance_id}/elements/{tool_path}/metadata"
|
|
491
|
+
metadata_endpoint_url = f"/elements_/v3/element/instances/{element_instance_id}/elements/{connector_key}/objects/{tool_path}/metadata"
|
|
383
492
|
return RequestSpec(
|
|
384
493
|
method="GET",
|
|
385
494
|
endpoint=Endpoint(metadata_endpoint_url),
|
|
@@ -390,6 +499,54 @@ class ConnectionsService(BaseService):
|
|
|
390
499
|
},
|
|
391
500
|
)
|
|
392
501
|
|
|
502
|
+
def _metadata_jit_spec(
|
|
503
|
+
self,
|
|
504
|
+
element_instance_id: int,
|
|
505
|
+
dynamic_path: str,
|
|
506
|
+
parameters: Dict[str, str],
|
|
507
|
+
schema_mode: bool,
|
|
508
|
+
) -> RequestSpec:
|
|
509
|
+
"""Build request spec for JIT metadata with dynamic path parameter substitution.
|
|
510
|
+
|
|
511
|
+
For example, if the dynamic path is "elements/jira/projects/{projectId}/issues", and the parameters
|
|
512
|
+
are {"projectId": "PROJ-123"}, the resolved path will be "elements/jira/projects/PROJ-123/issues".
|
|
513
|
+
"""
|
|
514
|
+
for key, value in parameters.items():
|
|
515
|
+
dynamic_path = dynamic_path.replace(
|
|
516
|
+
f"{{{key}}}", quote(str(value), safe="")
|
|
517
|
+
)
|
|
518
|
+
split = urlsplit(dynamic_path.lstrip("/"))
|
|
519
|
+
query_params = dict(parse_qsl(split.query))
|
|
520
|
+
|
|
521
|
+
return RequestSpec(
|
|
522
|
+
method="GET",
|
|
523
|
+
endpoint=Endpoint(
|
|
524
|
+
f"/elements_/v3/element/instances/{element_instance_id}/{split.path}"
|
|
525
|
+
),
|
|
526
|
+
params=query_params,
|
|
527
|
+
headers={
|
|
528
|
+
"accept": "application/schema+json"
|
|
529
|
+
if schema_mode
|
|
530
|
+
else "application/json"
|
|
531
|
+
},
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
def _get_jit_action_url(
|
|
535
|
+
self, connection_metadata: ConnectionMetadata
|
|
536
|
+
) -> Optional[str]:
|
|
537
|
+
"""Return the URL of the JIT action that should be triggered dynamically."""
|
|
538
|
+
if "method" not in connection_metadata.metadata:
|
|
539
|
+
return None
|
|
540
|
+
|
|
541
|
+
methods = connection_metadata.metadata["method"]
|
|
542
|
+
actions = [
|
|
543
|
+
action
|
|
544
|
+
for method_data in methods.values()
|
|
545
|
+
for action in method_data.get("design", {}).get("actions", [])
|
|
546
|
+
if action.get("actionType") == "api"
|
|
547
|
+
]
|
|
548
|
+
return actions[0].get("apiConfiguration", {}).get("url") if actions else None
|
|
549
|
+
|
|
393
550
|
def _retrieve_token_spec(
|
|
394
551
|
self, key: str, token_type: ConnectionTokenType = ConnectionTokenType.DIRECT
|
|
395
552
|
) -> RequestSpec:
|
uipath/models/connections.py
CHANGED
|
@@ -8,6 +8,7 @@ class ConnectionMetadata(BaseModel):
|
|
|
8
8
|
"""Metadata about a connection."""
|
|
9
9
|
|
|
10
10
|
fields: dict[str, Any] = Field(default_factory=dict, alias="fields")
|
|
11
|
+
metadata: dict[str, Any] = Field(default_factory=dict, alias="metadata")
|
|
11
12
|
|
|
12
13
|
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
13
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.127
|
|
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
|
|
@@ -109,7 +109,7 @@ uipath/_resources/AGENTS.md,sha256=nRQNAVeEBaBvuMzXw8uXtMnGebLClUgwIMlgb8_qU9o,1
|
|
|
109
109
|
uipath/_resources/CLAUDE.md,sha256=kYsckFWTVe948z_fNWLysCHvi9_YpchBXl3s1Ek03lU,10
|
|
110
110
|
uipath/_resources/CLI_REFERENCE.md,sha256=PNVZINTXDSW4XN8QtxV3kS2WLreR7UyLfSso1_VXWBg,6758
|
|
111
111
|
uipath/_resources/REQUIRED_STRUCTURE.md,sha256=3laqGiNa3kauJ7jRI1d7w_fWKUDkqYBjcTT_6_8FAGk,1417
|
|
112
|
-
uipath/_resources/SDK_REFERENCE.md,sha256
|
|
112
|
+
uipath/_resources/SDK_REFERENCE.md,sha256=-KvQ6MFVVssuFfWEc6j05f0Uuexn8Kl84w-iQsZU5Po,27388
|
|
113
113
|
uipath/_services/__init__.py,sha256=_LNy4u--VlhVtTO66bULbCoBjyJBTuyh9jnzjWrv-h4,1140
|
|
114
114
|
uipath/_services/_base_service.py,sha256=6yGNEZ-px6lVR9l4wiMr8NDSeLrZU6nmjUlRp3lMDi8,5665
|
|
115
115
|
uipath/_services/actions_service.py,sha256=2RPMR-hFMsOlqEyjIf3aF7-lrf57jdrSD0pBjj0Kyko,16040
|
|
@@ -117,7 +117,7 @@ uipath/_services/api_client.py,sha256=kGm04ijk9AOEQd2BMxvQg-2QoB8dmyoDwFFDPyutAG
|
|
|
117
117
|
uipath/_services/assets_service.py,sha256=Z46_Nm4X7R0JcwF_Fph-5GwQ_qhQHRKJltCtwo3J8Yo,12090
|
|
118
118
|
uipath/_services/attachments_service.py,sha256=NPQYK7CGjfBaNT_1S5vEAfODmOChTbQZforllFM2ofU,26678
|
|
119
119
|
uipath/_services/buckets_service.py,sha256=FGWhJ3ewMEAahcSPY60wtFB0_qwAfaQAaAjqrC52VDk,44603
|
|
120
|
-
uipath/_services/connections_service.py,sha256=
|
|
120
|
+
uipath/_services/connections_service.py,sha256=SoOV8ZFn0AenhyodfqgO8oF7VmnWx9RdccCm0qosbxI,24059
|
|
121
121
|
uipath/_services/context_grounding_service.py,sha256=Pjx-QQQEiSKD-hY6ityj3QUSALN3fIcKLLHr_NZ0d_g,37117
|
|
122
122
|
uipath/_services/documents_service.py,sha256=2mPZzmOl2r5i8RYvdeRSJtEFWSSsiXqIauTgNTW75s4,45341
|
|
123
123
|
uipath/_services/entities_service.py,sha256=QKCLE6wRgq3HZraF-M2mljy-8il4vsNHrQhUgkewVVk,14028
|
|
@@ -201,7 +201,7 @@ uipath/models/assets.py,sha256=7x3swJRnG_a4VgjdXKKwraJLT5TF0u4wHsl6coOjX0g,2762
|
|
|
201
201
|
uipath/models/attachment.py,sha256=lI6BxBY6DY5U6qZbxhkNu-usseA1zovYSTRtLq50ubI,1029
|
|
202
202
|
uipath/models/auth.py,sha256=-CEo5KZVtZZgbAMatN6B1vBmGp8lTTumR8sMthRmL8I,345
|
|
203
203
|
uipath/models/buckets.py,sha256=7uDonM5ddfhunP6Vn24kEa-iW_ZluJU4SaWEqB2dWu8,2754
|
|
204
|
-
uipath/models/connections.py,sha256=
|
|
204
|
+
uipath/models/connections.py,sha256=g51K2zHnOz6_IRJ5YYMfrEav7PPwQzRO5FH8KjYUYo8,2822
|
|
205
205
|
uipath/models/context_grounding.py,sha256=3MaF2Fv2QYle8UUWvKGkCN5XGpx2T4a34fdbBqJ2fCs,1137
|
|
206
206
|
uipath/models/context_grounding_index.py,sha256=OhRyxZDHDSrEmBFK0-JLqMMMT64jir4XkHtQ54IKtc0,2683
|
|
207
207
|
uipath/models/documents.py,sha256=gh063bG0pl4YGThWQIgprwRCKxnKVoMOZrXDfDEVnQw,7337
|
|
@@ -224,8 +224,8 @@ uipath/tracing/_utils.py,sha256=emsQRgYu-P1gj1q7XUPJD94mOa12JvhheRkuZJpLd9Y,1505
|
|
|
224
224
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
|
225
225
|
uipath/utils/_endpoints_manager.py,sha256=tnF_FiCx8qI2XaJDQgYkMN_gl9V0VqNR1uX7iawuLp8,8230
|
|
226
226
|
uipath/utils/dynamic_schema.py,sha256=w0u_54MoeIAB-mf3GmwX1A_X8_HDrRy6p998PvX9evY,3839
|
|
227
|
-
uipath-2.1.
|
|
228
|
-
uipath-2.1.
|
|
229
|
-
uipath-2.1.
|
|
230
|
-
uipath-2.1.
|
|
231
|
-
uipath-2.1.
|
|
227
|
+
uipath-2.1.127.dist-info/METADATA,sha256=2oA6gGyXHLX8-Cr7G2onsb1-XXfeY6G4_iXQlZgcK-E,6626
|
|
228
|
+
uipath-2.1.127.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
229
|
+
uipath-2.1.127.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
|
230
|
+
uipath-2.1.127.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
231
|
+
uipath-2.1.127.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|