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

@@ -8,28 +8,38 @@ from ._console import ConsoleLogger
8
8
 
9
9
  console = ConsoleLogger()
10
10
  client = httpx.Client(follow_redirects=True, timeout=30.0)
11
+ odata_top_filter = 25
11
12
 
12
13
 
13
14
  def get_release_info(
14
- base_url: str, token: str, package_name: str, folder_id: str
15
+ base_url: str,
16
+ token: str,
17
+ package_name: str,
18
+ package_version: str,
19
+ folder_id: str,
15
20
  ) -> None | tuple[Any, Any] | tuple[None, None]:
16
21
  headers = {
17
22
  "Authorization": f"Bearer {token}",
18
23
  "x-uipath-organizationunitid": str(folder_id),
19
24
  }
20
25
 
21
- release_url = f"{base_url}/orchestrator_/odata/Releases/UiPath.Server.Configuration.OData.ListReleases?$select=Id,Key&$top=1&$filter=Name%20eq%20%27{urllib.parse.quote(package_name)}%27"
26
+ release_url = f"{base_url}/orchestrator_/odata/Releases/UiPath.Server.Configuration.OData.ListReleases?$select=Id,Key,ProcessVersion&$top={odata_top_filter}&$filter=ProcessKey%20eq%20%27{urllib.parse.quote(package_name)}%27"
22
27
  response = client.get(release_url, headers=headers)
23
28
  if response.status_code == 200:
24
29
  try:
25
30
  data = json.loads(response.text)
26
- release_id = data["value"][0]["Id"]
27
- release_key = data["value"][0]["Key"]
31
+ process = next(
32
+ process
33
+ for process in data["value"]
34
+ if process["ProcessVersion"] == package_version
35
+ )
36
+ release_id = process["Id"]
37
+ release_key = process["Key"]
28
38
  return release_id, release_key
29
39
  except KeyError:
30
40
  console.warning("Warning: Failed to deserialize release data")
31
41
  return None, None
32
- except IndexError:
42
+ except StopIteration:
33
43
  console.error(
34
44
  f"Error: No process with name '{package_name}' found in your workspace. Please publish the process first."
35
45
  )
uipath/_cli/cli_auth.py CHANGED
@@ -56,25 +56,34 @@ def set_port():
56
56
 
57
57
  @click.command()
58
58
  @environment_options
59
- def auth(domain="alpha"):
59
+ @click.option(
60
+ "-f",
61
+ "--force",
62
+ is_flag=True,
63
+ required=False,
64
+ help="Force new token",
65
+ )
66
+ def auth(domain, force: None | bool = False):
60
67
  """Authenticate with UiPath Cloud Platform."""
61
68
  with console.spinner("Authenticating with UiPath ..."):
62
69
  portal_service = PortalService(domain)
63
- if (
64
- os.getenv("UIPATH_URL")
65
- and os.getenv("UIPATH_TENANT_ID")
66
- and os.getenv("UIPATH_ORGANIZATION_ID")
67
- ):
68
- try:
69
- portal_service.ensure_valid_token()
70
- console.success(
71
- "Authentication successful.",
72
- )
73
- return
74
- except Exception:
75
- console.info(
76
- "Authentication token is invalid. Please reauthenticate.",
77
- )
70
+
71
+ if not force:
72
+ if (
73
+ os.getenv("UIPATH_URL")
74
+ and os.getenv("UIPATH_TENANT_ID")
75
+ and os.getenv("UIPATH_ORGANIZATION_ID")
76
+ ):
77
+ try:
78
+ portal_service.ensure_valid_token()
79
+ console.success(
80
+ "Authentication successful.",
81
+ )
82
+ return
83
+ except Exception:
84
+ console.info(
85
+ "Authentication token is invalid. Please reauthenticate.",
86
+ )
78
87
 
79
88
  auth_url, code_verifier, state = get_auth_url(domain)
80
89
 
uipath/_cli/cli_invoke.py CHANGED
@@ -24,7 +24,7 @@ console = ConsoleLogger()
24
24
  client = httpx.Client(follow_redirects=True, timeout=30.0)
25
25
 
26
26
 
27
- def _read_project_name() -> str:
27
+ def _read_project_details() -> [str, str]:
28
28
  current_path = os.getcwd()
29
29
  toml_path = os.path.join(current_path, "pyproject.toml")
30
30
  if not os.path.isfile(toml_path):
@@ -37,7 +37,7 @@ def _read_project_name() -> str:
37
37
  if "name" not in content["project"]:
38
38
  console.error("pyproject.toml is missing the required field: project.name.")
39
39
 
40
- return content["project"]["name"]
40
+ return content["project"]["name"], content["project"]["version"]
41
41
 
42
42
 
43
43
  @click.command()
@@ -67,7 +67,7 @@ def invoke(
67
67
 
68
68
  url = f"{base_url}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs"
69
69
  _, personal_workspace_folder_id = get_personal_workspace_info(base_url, token)
70
- project_name = _read_project_name()
70
+ project_name, project_version = _read_project_details()
71
71
 
72
72
  if not personal_workspace_folder_id:
73
73
  console.error(
@@ -75,7 +75,7 @@ def invoke(
75
75
  )
76
76
 
77
77
  _, release_key = get_release_info(
78
- base_url, token, project_name, personal_workspace_folder_id
78
+ base_url, token, project_name, project_version, personal_workspace_folder_id
79
79
  )
80
80
  payload = {
81
81
  "StartInfo": {
@@ -129,15 +129,22 @@ def publish(feed):
129
129
  console.success("Package published successfully!")
130
130
 
131
131
  if is_personal_workspace:
132
+ package_name = None
133
+ package_version = None
132
134
  try:
133
- data = json.loads(response.text)
134
- package_name = json.loads(data["value"][0]["Body"])["Id"]
135
+ data = json.loads(response.text)["value"][0]["Body"]
136
+ package_name = json.loads(data)["Id"]
137
+ package_version = json.loads(data)["Version"]
135
138
  except json.decoder.JSONDecodeError:
136
139
  console.warning("Failed to deserialize package name")
137
140
  if package_name is not None:
138
141
  with console.spinner("Getting process information ..."):
139
142
  release_id, _ = get_release_info(
140
- base_url, token, package_name, personal_workspace_feed_id
143
+ base_url,
144
+ token,
145
+ package_name,
146
+ package_version,
147
+ personal_workspace_feed_id,
141
148
  )
142
149
  if release_id:
143
150
  process_url = f"{base_url}/orchestrator_/processes/{release_id}/edit?fid={personal_workspace_folder_id}"
@@ -390,15 +390,10 @@ class BucketsService(FolderContext, BaseService):
390
390
  url=spec.endpoint,
391
391
  params=spec.params,
392
392
  headers=spec.headers,
393
- )
394
- except Exception as e:
393
+ ).json()["value"][0]
394
+ except (KeyError, IndexError) as e:
395
395
  raise Exception(f"Bucket with name '{name}' not found") from e
396
- try:
397
- return Bucket.model_validate(response.json()["value"][0])
398
- except KeyError as e:
399
- raise Exception(
400
- f"Error while deserializing bucket with name '{name}'"
401
- ) from e
396
+ return Bucket.model_validate(response)
402
397
 
403
398
  @infer_bindings()
404
399
  @traced(name="buckets_retrieve", run_type="uipath")
@@ -439,21 +434,17 @@ class BucketsService(FolderContext, BaseService):
439
434
  )
440
435
 
441
436
  try:
442
- response = await self.request_async(
443
- spec.method,
444
- url=spec.endpoint,
445
- params=spec.params,
446
- headers=spec.headers,
447
- )
448
- except Exception as e:
449
- raise Exception(f"Bucket with name {name} not found") from e
450
-
451
- try:
452
- return Bucket.model_validate(response.json()["value"][0])
453
- except KeyError as e:
454
- raise Exception(
455
- f"Error while deserializing bucket with name '{name}'"
456
- ) from e
437
+ response = (
438
+ await self.request_async(
439
+ spec.method,
440
+ url=spec.endpoint,
441
+ params=spec.params,
442
+ headers=spec.headers,
443
+ )
444
+ ).json()["value"][0]
445
+ except (KeyError, IndexError) as e:
446
+ raise Exception(f"Bucket with name '{name}' not found") from e
447
+ return Bucket.model_validate(response)
457
448
 
458
449
  @property
459
450
  def custom_headers(self) -> Dict[str, str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.49
3
+ Version: 2.0.51
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
@@ -6,13 +6,13 @@ uipath/_uipath.py,sha256=6gBDQWyh3u6Nc1q306DERjS_oCKn0VwrfFLaPJqwfYA,3650
6
6
  uipath/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
8
8
  uipath/_cli/__init__.py,sha256=vGz3vJHkUvgK9_lKdzqiwwHkge1TCALRiOzGGwyr-8E,1885
9
- uipath/_cli/cli_auth.py,sha256=O-hbaYxLXBPXgnjW2gGa1lbvmVh1ui2-U9BzrLUU708,3707
9
+ uipath/_cli/cli_auth.py,sha256=Gg6MR1XnDwPV5Kzn3FANDgbG8KZaCplIqWqBbZUFLOU,3918
10
10
  uipath/_cli/cli_deploy.py,sha256=lDqZQOsTPe8UyUApSQyFDMChj5HR6_hrEbn5tXtbHQE,608
11
11
  uipath/_cli/cli_init.py,sha256=qleaHOuXZyqQ001XXFX3m8W2y3pW-miwuvMBl6rHCa4,3699
12
- uipath/_cli/cli_invoke.py,sha256=Lmv-VBl8Mb7a8jsqJJKcnW_0hC-7kfZYAZeDblfsr1A,3684
12
+ uipath/_cli/cli_invoke.py,sha256=QsWqSvwB6vFtgeNQ6kiM682d8gEl2VdHOAUJWDTlNYw,3762
13
13
  uipath/_cli/cli_new.py,sha256=6lLK_p7kRFQPgsc2i9t1v0Su4O1rC7zK55ic3y54QR8,2065
14
14
  uipath/_cli/cli_pack.py,sha256=-rUGw4vB50QpY-oNmVhIUXXmmFmk7_dhtafqZFBDyZg,14981
15
- uipath/_cli/cli_publish.py,sha256=87rVMukQbCRNYn6BTG9MdiBtYQU7q3b4wJQFwBoPmns,5730
15
+ uipath/_cli/cli_publish.py,sha256=f6ClG7L-jAzAs77mEOkQuq61w163yQtOZoUI5ArDg70,5973
16
16
  uipath/_cli/cli_run.py,sha256=ke4UQiqzagv4ST60-mvcC7nh1dQMw_Z6GQ2hAbnspU0,5074
17
17
  uipath/_cli/middlewares.py,sha256=IiJgjsqrJVKSXx4RcIKHWoH-SqWqpHPbhzkQEybmAos,3937
18
18
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
@@ -38,13 +38,13 @@ uipath/_cli/_utils/_console.py,sha256=rj4V3yeR1wnJzFTHnaE6wcY9OoJV-PiIQnLg_p62Cl
38
38
  uipath/_cli/_utils/_folders.py,sha256=usjLNOMdhvelEv0wsJ-v6q-qiUR1tbwXJL4Sd_SOocI,970
39
39
  uipath/_cli/_utils/_input_args.py,sha256=pyQhEcQXHdFHYTVNzvfWp439aii5StojoptnmCv5lfs,4094
40
40
  uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28mMc0,20663
41
- uipath/_cli/_utils/_processes.py,sha256=3lMKUb5ZMbCjkvolfwQKkah91tyBO9MHv5U7YWh4HbY,1410
41
+ uipath/_cli/_utils/_processes.py,sha256=iCGNf1y_K_r3bdmX9VWA70UP20bdUzKlMRrAxkdkdm4,1669
42
42
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
43
43
  uipath/_services/_base_service.py,sha256=i4f-4rkORhEIa6EWiSBUGlfFftAqKrRdjcV7fCGBYSY,8246
44
44
  uipath/_services/actions_service.py,sha256=DaWXbbLHVC-bVtxhMBm3Zfhx6IP8s9mviOTgK5g_CAQ,15883
45
45
  uipath/_services/api_client.py,sha256=1hYLc_90dQzCGnqqirEHpPqvL3Gkv2sSKoeOV_iTmlk,2903
46
46
  uipath/_services/assets_service.py,sha256=TXuL8dHCVLHb3AC2QixrwGz0Rjs70GHKTKg-S20sA_U,11115
47
- uipath/_services/buckets_service.py,sha256=eQgnc97A2iEFqZKDyp0b_udpRIWXPBGUbY7r9BMb-tg,17876
47
+ uipath/_services/buckets_service.py,sha256=VfgupGPeOFH3kBG6LJa7cWkliOuVBgdSEfApnKOcoM4,17619
48
48
  uipath/_services/connections_service.py,sha256=qh-HNL_GJsyPUD0wSJZRF8ZdrTE9l4HrIilmXGK6dDk,4581
49
49
  uipath/_services/context_grounding_service.py,sha256=wRYPnpTFeZunS88OggRZ9qRaILHKdoEP_6VUCaF-Xw0,24097
50
50
  uipath/_services/folder_service.py,sha256=HtsBoBejvMuIZ-9gocAG9B8uKOFsAAD4WUozta-isXk,1673
@@ -80,8 +80,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
80
80
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
81
81
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
82
82
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
83
- uipath-2.0.49.dist-info/METADATA,sha256=x4E5DM2Dw6WstsF8xCyaiIise37CE8JgkJf0IUwctsA,6254
84
- uipath-2.0.49.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
- uipath-2.0.49.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
86
- uipath-2.0.49.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
87
- uipath-2.0.49.dist-info/RECORD,,
83
+ uipath-2.0.51.dist-info/METADATA,sha256=47ZdjgQM8vSG8AUablbu0_DYJ0X518Wsc2BB1F9EYBo,6254
84
+ uipath-2.0.51.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
+ uipath-2.0.51.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
86
+ uipath-2.0.51.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
87
+ uipath-2.0.51.dist-info/RECORD,,