uipath 2.0.55__py3-none-any.whl → 2.0.57__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.

@@ -68,7 +68,7 @@ class LogsInterceptor:
68
68
  else:
69
69
  # Use stdout handler when not running as a job
70
70
  self.log_handler = logging.StreamHandler(sys.stdout)
71
- formatter = logging.Formatter("[%(asctime)s][%(levelname)s] %(message)s")
71
+ formatter = logging.Formatter("%(message)s")
72
72
  self.log_handler.setFormatter(formatter)
73
73
 
74
74
  self.log_handler.setLevel(self.numeric_min_level)
@@ -1,6 +1,6 @@
1
1
  from typing import Any, Dict, Optional, Union
2
2
 
3
- from httpx import request
3
+ import httpx
4
4
 
5
5
  from .._config import Config
6
6
  from .._execution_context import ExecutionContext
@@ -25,6 +25,8 @@ class BucketsService(FolderContext, BaseService):
25
25
 
26
26
  def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
27
27
  super().__init__(config=config, execution_context=execution_context)
28
+ self.custom_client = httpx.Client()
29
+ self.custom_client_async = httpx.AsyncClient()
28
30
 
29
31
  @traced(name="buckets_download", run_type="uipath")
30
32
  def download(
@@ -78,7 +80,7 @@ class BucketsService(FolderContext, BaseService):
78
80
  if result["RequiresAuth"]:
79
81
  file_content = self.request("GET", read_uri, headers=headers).content
80
82
  else:
81
- file_content = request("GET", read_uri, headers=headers).content
83
+ file_content = self.custom_client.get(read_uri, headers=headers).content
82
84
  file.write(file_content)
83
85
 
84
86
  @traced(name="buckets_upload", run_type="uipath")
@@ -89,7 +91,8 @@ class BucketsService(FolderContext, BaseService):
89
91
  name: Optional[str] = None,
90
92
  blob_file_path: str,
91
93
  content_type: str,
92
- source_path: str,
94
+ source_path: Optional[str] = None,
95
+ content: Optional[Union[str, bytes]] = None,
93
96
  folder_key: Optional[str] = None,
94
97
  folder_path: Optional[str] = None,
95
98
  ) -> None:
@@ -100,7 +103,8 @@ class BucketsService(FolderContext, BaseService):
100
103
  name (Optional[str]): The name of the bucket.
101
104
  blob_file_path (str): The path where the file will be stored in the bucket.
102
105
  content_type (str): The MIME type of the file.
103
- source_path (str): The local path of the file to upload.
106
+ source_path (Optional[str]): The local path of the file to upload.
107
+ content (Optional[Union[str, bytes]]): The content to upload (string or bytes).
104
108
  folder_key (Optional[str]): The key of the folder where the bucket resides.
105
109
  folder_path (Optional[str]): The path of the folder where the bucket resides.
106
110
 
@@ -108,6 +112,11 @@ class BucketsService(FolderContext, BaseService):
108
112
  ValueError: If neither key nor name is provided.
109
113
  Exception: If the bucket with the specified key or name is not found.
110
114
  """
115
+ if content is not None and source_path is not None:
116
+ raise ValueError("Content and source_path are mutually exclusive")
117
+ if content is None and source_path is None:
118
+ raise ValueError("Either content or source_path must be provided")
119
+
111
120
  bucket = self.retrieve(
112
121
  name=name, key=key, folder_key=folder_key, folder_path=folder_path
113
122
  )
@@ -136,11 +145,25 @@ class BucketsService(FolderContext, BaseService):
136
145
  )
137
146
  }
138
147
 
139
- with open(source_path, "rb") as file:
148
+ if content is not None:
149
+ if isinstance(content, str):
150
+ content = content.encode("utf-8")
151
+
140
152
  if result["RequiresAuth"]:
141
- self.request("PUT", write_uri, headers=headers, files={"file": file})
153
+ self.request("PUT", write_uri, headers=headers, content=content)
142
154
  else:
143
- request("PUT", write_uri, headers=headers, files={"file": file})
155
+ self.custom_client.put(write_uri, headers=headers, content=content)
156
+
157
+ if source_path is not None:
158
+ with open(source_path, "rb") as file:
159
+ if result["RequiresAuth"]:
160
+ self.request(
161
+ "PUT", write_uri, headers=headers, files={"file": file}
162
+ )
163
+ else:
164
+ self.custom_client.put(
165
+ write_uri, headers=headers, files={"file": file}
166
+ )
144
167
 
145
168
  @traced(name="buckets_upload", run_type="uipath")
146
169
  async def upload_async(
@@ -150,7 +173,8 @@ class BucketsService(FolderContext, BaseService):
150
173
  name: Optional[str] = None,
151
174
  blob_file_path: str,
152
175
  content_type: str,
153
- source_path: str,
176
+ source_path: Optional[str] = None,
177
+ content: Optional[Union[str, bytes]] = None,
154
178
  folder_key: Optional[str] = None,
155
179
  folder_path: Optional[str] = None,
156
180
  ) -> None:
@@ -169,6 +193,11 @@ class BucketsService(FolderContext, BaseService):
169
193
  ValueError: If neither key nor name is provided.
170
194
  Exception: If the bucket with the specified key or name is not found.
171
195
  """
196
+ if content is not None and source_path is not None:
197
+ raise ValueError("Content and source_path are mutually exclusive")
198
+ if content is None and source_path is None:
199
+ raise ValueError("Either content or source_path must be provided")
200
+
172
201
  bucket = await self.retrieve_async(
173
202
  name=name, key=key, folder_key=folder_key, folder_path=folder_path
174
203
  )
@@ -199,148 +228,29 @@ class BucketsService(FolderContext, BaseService):
199
228
  )
200
229
  }
201
230
 
202
- with open(source_path, "rb") as file:
231
+ if content is not None:
232
+ if isinstance(content, str):
233
+ content = content.encode("utf-8")
234
+
203
235
  if result["RequiresAuth"]:
204
236
  await self.request_async(
205
- "PUT", write_uri, headers=headers, files={"file": file}
237
+ "PUT", write_uri, headers=headers, content=content
206
238
  )
207
239
  else:
208
- request("PUT", write_uri, headers=headers, files={"file": file})
209
-
210
- @traced(
211
- name="buckets_upload_from_memory",
212
- run_type="uipath",
213
- input_processor=_upload_from_memory_input_processor,
214
- )
215
- def upload_from_memory(
216
- self,
217
- *,
218
- key: Optional[str] = None,
219
- name: Optional[str] = None,
220
- blob_file_path: str,
221
- content_type: str,
222
- content: Union[str, bytes],
223
- folder_key: Optional[str] = None,
224
- folder_path: Optional[str] = None,
225
- ) -> None:
226
- """Upload content from memory to a bucket.
227
-
228
- Args:
229
- key (Optional[str]): The key of the bucket.
230
- name (Optional[str]): The name of the bucket.
231
- blob_file_path (str): The path where the content will be stored in the bucket.
232
- content_type (str): The MIME type of the content.
233
- content (Union[str, bytes]): The content to upload (string or bytes).
234
- folder_key (Optional[str]): The key of the folder where the bucket resides.
235
- folder_path (Optional[str]): The path of the folder where the bucket resides.
236
-
237
- Raises:
238
- ValueError: If neither key nor name is provided.
239
- Exception: If the bucket with the specified key or name is not found.
240
- """
241
- bucket = self.retrieve(
242
- name=name, key=key, folder_key=folder_key, folder_path=folder_path
243
- )
244
-
245
- spec = self._retrieve_writeri_spec(
246
- bucket.id,
247
- content_type,
248
- blob_file_path,
249
- folder_key=folder_key,
250
- folder_path=folder_path,
251
- )
252
-
253
- result = self.request(
254
- spec.method,
255
- url=spec.endpoint,
256
- params=spec.params,
257
- headers=spec.headers,
258
- ).json()
259
-
260
- write_uri = result["Uri"]
261
-
262
- headers = {
263
- key: value
264
- for key, value in zip(
265
- result["Headers"]["Keys"], result["Headers"]["Values"], strict=False
266
- )
267
- }
268
-
269
- # Convert string to bytes if needed
270
- if isinstance(content, str):
271
- content = content.encode("utf-8")
272
-
273
- if result["RequiresAuth"]:
274
- self.request("PUT", write_uri, headers=headers, content=content)
275
- else:
276
- request("PUT", write_uri, headers=headers, content=content)
277
-
278
- async def upload_from_memory_async(
279
- self,
280
- *,
281
- key: Optional[str] = None,
282
- name: Optional[str] = None,
283
- blob_file_path: str,
284
- content_type: str,
285
- content: Union[str, bytes],
286
- folder_key: Optional[str] = None,
287
- folder_path: Optional[str] = None,
288
- ) -> None:
289
- """Asynchronously upload content from memory to a bucket.
290
-
291
- Args:
292
- key (Optional[str]): The key of the bucket.
293
- name (Optional[str]): The name of the bucket.
294
- blob_file_path (str): The path where the content will be stored in the bucket.
295
- content_type (str): The MIME type of the content.
296
- content (Union[str, bytes]): The content to upload (string or bytes).
297
- folder_key (Optional[str]): The key of the folder where the bucket resides.
298
- folder_path (Optional[str]): The path of the folder where the bucket resides.
299
-
300
- Raises:
301
- ValueError: If neither key nor name is provided.
302
- Exception: If the bucket with the specified key or name is not found.
303
- """
304
- bucket = await self.retrieve_async(
305
- name=name, key=key, folder_key=folder_key, folder_path=folder_path
306
- )
307
-
308
- bucket_id = bucket["Id"]
309
-
310
- spec = self._retrieve_writeri_spec(
311
- bucket_id,
312
- content_type,
313
- blob_file_path,
314
- folder_key=folder_key,
315
- folder_path=folder_path,
316
- )
317
-
318
- result = (
319
- await self.request_async(
320
- spec.method,
321
- url=spec.endpoint,
322
- params=spec.params,
323
- headers=spec.headers,
324
- )
325
- ).json()
326
-
327
- write_uri = result["Uri"]
328
-
329
- headers = {
330
- key: value
331
- for key, value in zip(
332
- result["Headers"]["Keys"], result["Headers"]["Values"], strict=False
333
- )
334
- }
335
-
336
- # Convert string to bytes if needed
337
- if isinstance(content, str):
338
- content = content.encode("utf-8")
240
+ await self.custom_client_async.put(
241
+ write_uri, headers=headers, content=content
242
+ )
339
243
 
340
- if result["RequiresAuth"]:
341
- await self.request_async("PUT", write_uri, headers=headers, content=content)
342
- else:
343
- request("PUT", write_uri, headers=headers, content=content)
244
+ if source_path is not None:
245
+ with open(source_path, "rb") as file:
246
+ if result["RequiresAuth"]:
247
+ await self.request_async(
248
+ "PUT", write_uri, headers=headers, files={"file": file}
249
+ )
250
+ else:
251
+ await self.custom_client_async.put(
252
+ write_uri, headers=headers, files={"file": file}
253
+ )
344
254
 
345
255
  @infer_bindings()
346
256
  @traced(name="buckets_retrieve", run_type="uipath")
@@ -15,8 +15,8 @@ from ..models import IngestionInProgressException
15
15
  from ..models.context_grounding import ContextGroundingQueryResponse
16
16
  from ..models.context_grounding_index import ContextGroundingIndex
17
17
  from ..tracing._traced import traced
18
- from . import BucketsService
19
18
  from ._base_service import BaseService
19
+ from .buckets_service import BucketsService
20
20
  from .folder_service import FolderService
21
21
 
22
22
 
@@ -85,7 +85,7 @@ class ContextGroundingService(FolderContext, BaseService):
85
85
  content_type=content_type,
86
86
  )
87
87
  else:
88
- self._buckets_service.upload_from_memory(
88
+ self._buckets_service.upload(
89
89
  name=bucket_name,
90
90
  content=content,
91
91
  blob_file_path=blob_file_path,
@@ -137,9 +137,9 @@ class ContextGroundingService(FolderContext, BaseService):
137
137
  content_type=content_type,
138
138
  )
139
139
  else:
140
- await self._buckets_service.upload_from_memory_async(
140
+ await self._buckets_service.upload_async(
141
141
  name=bucket_name,
142
- content=content, # type: ignore
142
+ content=content,
143
143
  blob_file_path=blob_file_path,
144
144
  folder_path=bucket_folder_path,
145
145
  content_type=content_type,
uipath/_utils/_url.py CHANGED
@@ -80,6 +80,23 @@ class UiPathUrl:
80
80
  return org_name, tenant_name
81
81
 
82
82
  def _is_relative_url(self, url: str) -> bool:
83
+ # Empty URLs are considered relative
84
+ if not url:
85
+ return True
86
+
83
87
  parsed = urlparse(url)
84
88
 
85
- return parsed.hostname is None and parsed.path == url
89
+ # Protocol-relative URLs (starting with //) are not relative
90
+ if url.startswith("//"):
91
+ return False
92
+
93
+ # URLs with schemes are not relative (http:, https:, mailto:, etc.)
94
+ if parsed.scheme:
95
+ return False
96
+
97
+ # URLs with network locations are not relative
98
+ if parsed.netloc:
99
+ return False
100
+
101
+ # If we've passed all the checks, it's a relative URL
102
+ return True
@@ -1,4 +1,4 @@
1
- _CONNECTION_STRING = ""
1
+ _CONNECTION_STRING = "InstrumentationKey=d3da6dfc-5231-4d72-9696-f680a64683b8;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=9b73b209-6c6a-4d4a-9549-b922cef418d5"
2
2
 
3
3
  _APP_INSIGHTS_EVENT_MARKER_ATTRIBUTE = "APPLICATION_INSIGHTS_EVENT_MARKER_ATTRIBUTE"
4
4
  _OTEL_RESOURCE_ATTRIBUTES = "OTEL_RESOURCE_ATTRIBUTES"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.55
3
+ Version: 2.0.57
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
@@ -26,7 +26,7 @@ uipath/_cli/_auth/index.html,sha256=ML_xDOcKs0ETYucufJskiYfWSvdrD_E26C0Qd3qpGj8,
26
26
  uipath/_cli/_auth/localhost.crt,sha256=oGl9oLLOiouHubAt39B4zEfylFvKEtbtr_43SIliXJc,1226
27
27
  uipath/_cli/_auth/localhost.key,sha256=X31VYXD8scZtmGA837dGX5l6G-LXHLo5ItWJhZXaz3c,1679
28
28
  uipath/_cli/_runtime/_contracts.py,sha256=Rxs-uEOA490fLPNimB8LqZW7KI-72O0BLY4Jm7Fa1ms,14316
29
- uipath/_cli/_runtime/_logging.py,sha256=rmRBEHNMRK422o_TYk7h2sNfeGfaZdXC6-83VcO5o10,7903
29
+ uipath/_cli/_runtime/_logging.py,sha256=lA2LsakOrcSLnJWgo80-BYzIQBUWfqzzJGI1M61Gu0s,7874
30
30
  uipath/_cli/_runtime/_runtime.py,sha256=K8lQjeUE-qXNshmt0UE2SNdbH-MA9goOSqsReJ-_NF4,9681
31
31
  uipath/_cli/_templates/.psmdcp.template,sha256=C7pBJPt98ovEljcBvGtEUGoWjjQhu9jls1bpYjeLOKA,611
32
32
  uipath/_cli/_templates/.rels.template,sha256=-fTcw7OA1AcymHr0LzBqbMAAtzZTRXLTNa_ljq087Jk,406
@@ -45,9 +45,9 @@ uipath/_services/actions_service.py,sha256=LYKvG4VxNGQgZ46AzGK9kI1Txb-YmVvZj5ScP
45
45
  uipath/_services/api_client.py,sha256=hcof0EMa4-phEHD1WlO7Tdfzq6aL18Sbi2aBE7lJm1w,1821
46
46
  uipath/_services/assets_service.py,sha256=gfQLCchT6evsmhip1-coX6oFbshoKUWlxwGrS6DGcHU,13200
47
47
  uipath/_services/attachments_service.py,sha256=8iRdauPFzhJv65Uus69BBmA3jPckqfwBE4iGbXvktCQ,19653
48
- uipath/_services/buckets_service.py,sha256=xTIAEs7EbpyZYqd7PG1q0emOOBM_Ca0rVoH417g2bl0,17521
48
+ uipath/_services/buckets_service.py,sha256=736isvj01_-Srh0JiorS02pOwjF0_Loaf-xR6u0B7Ww,14932
49
49
  uipath/_services/connections_service.py,sha256=qh-HNL_GJsyPUD0wSJZRF8ZdrTE9l4HrIilmXGK6dDk,4581
50
- uipath/_services/context_grounding_service.py,sha256=wRYPnpTFeZunS88OggRZ9qRaILHKdoEP_6VUCaF-Xw0,24097
50
+ uipath/_services/context_grounding_service.py,sha256=nE-RZuean_DXK7a6pcA4S2fcWcfWmQ-rmOihi5_qErU,24072
51
51
  uipath/_services/folder_service.py,sha256=HtsBoBejvMuIZ-9gocAG9B8uKOFsAAD4WUozta-isXk,1673
52
52
  uipath/_services/jobs_service.py,sha256=Z1CmglIe6pFt0XovPLbuLCp13mWQw92MgjfRivqsodE,16745
53
53
  uipath/_services/llm_gateway_service.py,sha256=ySg3sflIoXmY9K7txlSm7bkuI2qzBT0kAKmGlFBk5KA,12032
@@ -60,7 +60,7 @@ uipath/_utils/_logs.py,sha256=adfX_0UAn3YBeKJ8DQDeZs94rJyHGQO00uDfkaTpNWQ,510
60
60
  uipath/_utils/_read_overwrites.py,sha256=dODvjNnDjcYOxVKnt0KqqqXmysULLBObKaEF8gJteg4,5149
61
61
  uipath/_utils/_request_override.py,sha256=fIVHzgHVXITUlWcp8osNBwIafM1qm4_ejx0ng5UzfJ4,573
62
62
  uipath/_utils/_request_spec.py,sha256=iCtBLqtbWUpFG5g1wtIZBzSupKsfaRLiQFoFc_4B70Q,747
63
- uipath/_utils/_url.py,sha256=2PnINXuEPbhd9mlojJJdupm-sOrgV29o5DbWuaFrc-0,2039
63
+ uipath/_utils/_url.py,sha256=-4eluSrIZCUlnQ3qU17WPJkgaC2KwF9W5NeqGnTNGGo,2512
64
64
  uipath/_utils/_user_agent.py,sha256=pVJkFYacGwaQBomfwWVAvBQgdBUo62e4n3-fLIajWUU,563
65
65
  uipath/_utils/constants.py,sha256=CKv-kTC8Fzu6E_KY9jD_fSt0Gbycn9sZg4O_3pzq2fo,873
66
66
  uipath/models/__init__.py,sha256=Kwqv1LzWNfSxJLMQrInVen3KDJ1z0eCcr6szQa0G0VE,1251
@@ -80,14 +80,14 @@ uipath/models/llm_gateway.py,sha256=0sl5Wtve94V14H3AHwmJSoXAhoc-Fai3wJxP8HrnBPg,
80
80
  uipath/models/processes.py,sha256=Atvfrt6X4TYST3iA62jpS_Uxc3hg6uah11p-RaKZ6dk,2029
81
81
  uipath/models/queues.py,sha256=N_s0GKucbyjh0RnO8SxPk6wlRgvq8KIIYsfaoIY46tM,6446
82
82
  uipath/telemetry/__init__.py,sha256=Wna32UFzZR66D-RzTKlPWlvji9i2HJb82NhHjCCXRjY,61
83
- uipath/telemetry/_constants.py,sha256=UftH_cYzB260IwlDOafDJHYRbIUXL6_K0rdavG6cxjM,432
83
+ uipath/telemetry/_constants.py,sha256=RVymOX07CRzcGMn1OWzh-TR6bZMvLG3vdCA6fvRrrCk,678
84
84
  uipath/telemetry/_track.py,sha256=v0e3hgwtetMsUco4yosBzNU00Ek5SI9RxUTumrTTNyo,3872
85
85
  uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,139
86
86
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
87
87
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
88
88
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
89
- uipath-2.0.55.dist-info/METADATA,sha256=fvYKsM_vqRzxyTDGh_0fK1vNc7_rLxGRQFWvhfwVCik,6304
90
- uipath-2.0.55.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
91
- uipath-2.0.55.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
92
- uipath-2.0.55.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
93
- uipath-2.0.55.dist-info/RECORD,,
89
+ uipath-2.0.57.dist-info/METADATA,sha256=OKwYNKZD-y2kOHlywNqDxh1b-lU0NpUCb1btkd6IwHY,6304
90
+ uipath-2.0.57.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
91
+ uipath-2.0.57.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
92
+ uipath-2.0.57.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
93
+ uipath-2.0.57.dist-info/RECORD,,