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

@@ -135,6 +135,30 @@ class PortalService:
135
135
 
136
136
  update_env_file(updated_env_contents)
137
137
 
138
+ def post_auth(self, base_url: str) -> None:
139
+ or_base_url = (
140
+ f"{base_url}/orchestrator_"
141
+ if base_url
142
+ else self.get_uipath_orchestrator_url()
143
+ )
144
+
145
+ url_try_enable_first_run = f"{or_base_url}/api/StudioWeb/TryEnableFirstRun"
146
+ url_acquire_license = f"{or_base_url}/api/StudioWeb/AcquireLicense"
147
+
148
+ [try_enable_first_run_response, acquire_license_response] = [
149
+ requests.post(
150
+ url,
151
+ headers={"Authorization": f"Bearer {self.access_token}"},
152
+ )
153
+ for url in [url_try_enable_first_run, url_acquire_license]
154
+ ]
155
+
156
+ if (
157
+ try_enable_first_run_response.status_code != 200
158
+ or acquire_license_response.status_code != 200
159
+ ):
160
+ raise Exception("Failed to post auth")
161
+
138
162
  def has_initialized_auth(self):
139
163
  try:
140
164
  auth_data = get_auth_data()
@@ -171,3 +195,5 @@ def select_tenant(
171
195
  "UIPATH_ORGANIZATION_ID": tenants_and_organizations["organization"]["id"],
172
196
  }
173
197
  )
198
+
199
+ return f"https://{domain if domain else 'alpha'}.uipath.com/{account_name}/{tenant_name}"
uipath/_cli/cli_auth.py CHANGED
@@ -96,10 +96,16 @@ def auth(domain="alpha"):
96
96
  update_env_file({"UIPATH_ACCESS_TOKEN": access_token})
97
97
 
98
98
  tenants_and_organizations = portal_service.get_tenants_and_organizations()
99
- select_tenant(domain, tenants_and_organizations)
100
- console.success(
101
- "Authentication successful.",
102
- )
99
+ base_url = select_tenant(domain, tenants_and_organizations)
100
+ try:
101
+ portal_service.post_auth(base_url)
102
+ console.success(
103
+ "Authentication successful.",
104
+ )
105
+ except Exception:
106
+ console.error(
107
+ "Could not prepare the environment. Please try again.",
108
+ )
103
109
  else:
104
110
  console.error(
105
111
  "Authentication failed. Please try again.",
uipath/_cli/cli_init.py CHANGED
@@ -20,7 +20,7 @@ def generate_env_file(target_directory):
20
20
 
21
21
  if not os.path.exists(env_path):
22
22
  relative_path = os.path.relpath(env_path, target_directory)
23
- console.success(f"Created {relative_path} file.")
23
+ console.success(f" Created {relative_path} file.")
24
24
  with open(env_path, "w") as f:
25
25
  f.write("UIPATH_ACCESS_TOKEN=YOUR_TOKEN_HERE\n")
26
26
  f.write("UIPATH_URL=https://cloud.uipath.com/ACCOUNT_NAME/TENANT_NAME\n")
@@ -22,10 +22,10 @@ def _create_spec(
22
22
  data: Optional[Dict[str, Any]],
23
23
  action_schema: Optional[ActionSchema],
24
24
  title: str,
25
- app_key: str = "",
26
- app_version: int = -1,
27
- app_folder_key: str = "",
28
- app_folder_path: str = "",
25
+ app_key: Optional[str] = None,
26
+ app_version: Optional[int] = 1,
27
+ app_folder_key: Optional[str] = None,
28
+ app_folder_path: Optional[str] = None,
29
29
  ) -> RequestSpec:
30
30
  field_list = []
31
31
  outcome_list = []
@@ -144,7 +144,9 @@ def _retrieve_app_key_spec(app_name: str) -> RequestSpec:
144
144
  )
145
145
 
146
146
 
147
- def folder_headers(app_folder_key: str, app_folder_path: str) -> Dict[str, str]:
147
+ def folder_headers(
148
+ app_folder_key: Optional[str], app_folder_path: Optional[str]
149
+ ) -> Dict[str, str]:
148
150
  headers = {}
149
151
  if app_folder_key:
150
152
  headers[HEADER_FOLDER_KEY] = app_folder_key
@@ -182,12 +184,12 @@ class ActionsService(FolderContext, BaseService):
182
184
  title: str,
183
185
  data: Optional[Dict[str, Any]] = None,
184
186
  *,
185
- app_name: str = "",
186
- app_key: str = "",
187
- app_folder_path: str = "",
188
- app_folder_key: str = "",
189
- app_version: int = -1,
190
- assignee: str = "",
187
+ app_name: Optional[str] = None,
188
+ app_key: Optional[str] = None,
189
+ app_folder_path: Optional[str] = None,
190
+ app_folder_key: Optional[str] = None,
191
+ app_version: Optional[int] = 1,
192
+ assignee: Optional[str] = None,
191
193
  ) -> Action:
192
194
  """Creates a new action asynchronously.
193
195
 
@@ -210,6 +212,8 @@ class ActionsService(FolderContext, BaseService):
210
212
  Raises:
211
213
  Exception: If neither app_name nor app_key is provided for app-specific actions
212
214
  """
215
+ app_folder_path = app_folder_path if app_folder_path else self._folder_path
216
+
213
217
  (key, action_schema) = (
214
218
  (app_key, None)
215
219
  if app_key
@@ -240,12 +244,12 @@ class ActionsService(FolderContext, BaseService):
240
244
  title: str,
241
245
  data: Optional[Dict[str, Any]] = None,
242
246
  *,
243
- app_name: str = "",
244
- app_key: str = "",
245
- app_folder_path: str = "",
246
- app_folder_key: str = "",
247
- app_version: int = -1,
248
- assignee: str = "",
247
+ app_name: Optional[str] = None,
248
+ app_key: Optional[str] = None,
249
+ app_folder_path: Optional[str] = None,
250
+ app_folder_key: Optional[str] = None,
251
+ app_version: Optional[int] = 1,
252
+ assignee: Optional[str] = None,
249
253
  ) -> Action:
250
254
  """Creates a new action synchronously.
251
255
 
@@ -268,6 +272,8 @@ class ActionsService(FolderContext, BaseService):
268
272
  Raises:
269
273
  Exception: If neither app_name nor app_key is provided for app-specific actions
270
274
  """
275
+ app_folder_path = app_folder_path if app_folder_path else self._folder_path
276
+
271
277
  (key, action_schema) = (
272
278
  (app_key, None)
273
279
  if app_key
@@ -343,7 +349,7 @@ class ActionsService(FolderContext, BaseService):
343
349
  return Action.model_validate(response.json())
344
350
 
345
351
  async def _get_app_key_and_schema_async(
346
- self, app_name: str, app_folder_path: str
352
+ self, app_name: Optional[str], app_folder_path: Optional[str]
347
353
  ) -> Tuple[str, Optional[ActionSchema]]:
348
354
  """Retrieves an application's key and schema asynchronously.
349
355
 
@@ -386,7 +392,7 @@ class ActionsService(FolderContext, BaseService):
386
392
  raise Exception("Failed to deserialize action schema") from KeyError
387
393
 
388
394
  def _get_app_key_and_schema(
389
- self, app_name: str, app_folder_path: str
395
+ self, app_name: Optional[str], app_folder_path: Optional[str]
390
396
  ) -> Tuple[str, Optional[ActionSchema]]:
391
397
  if not app_name:
392
398
  raise Exception("appName or appKey is required")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.0.28
3
+ Version: 2.0.30
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,9 +6,9 @@ uipath/_uipath.py,sha256=D9UWyRInN2Q8HFEQtYaYzT3DCZ3tW_OCBs_4RRqRVuY,2795
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=HYai-JU2uFDMYdLPdi75xKjAGQkcuqDZBwibXQwiM2s,3461
9
+ uipath/_cli/cli_auth.py,sha256=O-hbaYxLXBPXgnjW2gGa1lbvmVh1ui2-U9BzrLUU708,3707
10
10
  uipath/_cli/cli_deploy.py,sha256=lnGwwhDDY6La0fj_-duqx9saGUvY2iNNW28rQCI3hsU,308
11
- uipath/_cli/cli_init.py,sha256=N1f1xfLgeiWSlpOH_oZN5kHemApb9x8kqtjCJeGXpmM,3829
11
+ uipath/_cli/cli_init.py,sha256=vrQoLaN8Ztla8IIIkKkftSTX9wTbl7H8Q8heoUp_jRk,3830
12
12
  uipath/_cli/cli_invoke.py,sha256=Fnoc5_4nWxac-FVxQL-Akrqd-yQb9BwLWSzR9p397Lw,3221
13
13
  uipath/_cli/cli_new.py,sha256=uBWt44ZnNrq6oMYjYm4cCipmat2GRkcJ-g8YP_yP9-0,2024
14
14
  uipath/_cli/cli_pack.py,sha256=FZr7P5WZvPkrP56fjn4dTONv76NuoEhVtQwzG3CxGQs,14667
@@ -19,7 +19,7 @@ uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
19
19
  uipath/_cli/_auth/_auth_server.py,sha256=GRdjXUcvZO2O2GecolFJ8uMv7_DUD_VXeBJpElqmtIQ,7034
20
20
  uipath/_cli/_auth/_models.py,sha256=sYMCfvmprIqnZxStlD_Dxx2bcxgn0Ri4D7uwemwkcNg,948
21
21
  uipath/_cli/_auth/_oidc_utils.py,sha256=WaX9jDlXrlX6yD8i8gsocV8ngjaT72Xd1tvsZMmSbco,2127
22
- uipath/_cli/_auth/_portal_service.py,sha256=7_UtCuyKPxPQu55TPRsG3ioMPfo_Fbx_1Ml-uJ-OP_w,6333
22
+ uipath/_cli/_auth/_portal_service.py,sha256=1rJMATDuVpqU0mRJEq-G4dOkd4lDZa8uOnltEVDLgv4,7272
23
23
  uipath/_cli/_auth/_utils.py,sha256=9nb76xe5XmDZ0TAncp-_1SKqL6FdwRi9eS3C2noN1lY,1591
24
24
  uipath/_cli/_auth/auth_config.json,sha256=NTb_ZZor5xEgya2QbK51GiTL5_yVqG_QpV4VYIp8_mk,342
25
25
  uipath/_cli/_auth/index.html,sha256=ML_xDOcKs0ETYucufJskiYfWSvdrD_E26C0Qd3qpGj8,6280
@@ -41,7 +41,7 @@ uipath/_cli/_utils/_parse_ast.py,sha256=3XVjnhJNnSfjXlitct91VOtqSl0l-sqDpoWww28m
41
41
  uipath/_cli/_utils/_processes.py,sha256=3EPrGqIFWohnbIZ9xLylgWRRHaYaOPBRB1WfLu6tceY,1353
42
42
  uipath/_services/__init__.py,sha256=VPbwLDsvN26nWZgvR-8_-tc3i0rk5doqjTJbSrK0nN4,818
43
43
  uipath/_services/_base_service.py,sha256=3YClCoZBkVQGNJZGy-4NTk-HGsGA61XtwVQFYv9mwWk,7955
44
- uipath/_services/actions_service.py,sha256=RNrR6v42ivpSLtv1W4ctqittScMr9pFUHl9CKOn7tdU,15795
44
+ uipath/_services/actions_service.py,sha256=9mCltOP5CUjzOBe-xqkSOC6Cccxb9ulIWnN2oqn65os,16214
45
45
  uipath/_services/api_client.py,sha256=1hYLc_90dQzCGnqqirEHpPqvL3Gkv2sSKoeOV_iTmlk,2903
46
46
  uipath/_services/assets_service.py,sha256=nuaP-yzObUiB10VLeq4AsEcx75VJokbr3HC9EpW0iXA,9280
47
47
  uipath/_services/buckets_service.py,sha256=m0HMWBkooUhjTtna_ZXcw4QOzKmaibuepWlC8wPGtlA,9330
@@ -78,8 +78,8 @@ uipath/tracing/__init__.py,sha256=GimSzv6qkCOlHOG1WtjYKJsZqcXpA28IgoXfR33JhiA,13
78
78
  uipath/tracing/_otel_exporters.py,sha256=x0PDPmDKJcxashsuehVsSsqBCzRr6WsNFaq_3_HS5F0,3014
79
79
  uipath/tracing/_traced.py,sha256=GFxOp73jk0vGTN_H7YZOOsEl9rVLaEhXGztMiYKIA-8,16634
80
80
  uipath/tracing/_utils.py,sha256=5SwsTGpHkIouXBndw-u8eCLnN4p7LM8DsTCCuf2jJgs,10165
81
- uipath-2.0.28.dist-info/METADATA,sha256=A6ekE658m5_Lbvu_RVH3o2-0k_FQntFZxe2jesmA9us,6106
82
- uipath-2.0.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
83
- uipath-2.0.28.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
84
- uipath-2.0.28.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
85
- uipath-2.0.28.dist-info/RECORD,,
81
+ uipath-2.0.30.dist-info/METADATA,sha256=2ZdgTzpLJWTKKAYCsPJyCjBhjMa2ZK3eG08JpPY2zP4,6106
82
+ uipath-2.0.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
83
+ uipath-2.0.30.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
84
+ uipath-2.0.30.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
85
+ uipath-2.0.30.dist-info/RECORD,,