uipath 2.1.3__py3-none-any.whl → 2.1.5__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.
- uipath/_cli/__init__.py +2 -0
- uipath/_cli/_auth/_auth_server.py +28 -9
- uipath/_cli/_auth/auth_config.json +2 -2
- uipath/_cli/_auth/index.html +492 -51
- uipath/_cli/_utils/_constants.py +6 -0
- uipath/_cli/_utils/_project_files.py +361 -0
- uipath/_cli/_utils/_studio_project.py +138 -0
- uipath/_cli/_utils/_uv_helpers.py +114 -0
- uipath/_cli/cli_auth.py +12 -5
- uipath/_cli/cli_pack.py +42 -341
- uipath/_cli/cli_push.py +546 -0
- {uipath-2.1.3.dist-info → uipath-2.1.5.dist-info}/METADATA +1 -1
- {uipath-2.1.3.dist-info → uipath-2.1.5.dist-info}/RECORD +16 -12
- {uipath-2.1.3.dist-info → uipath-2.1.5.dist-info}/WHEEL +0 -0
- {uipath-2.1.3.dist-info → uipath-2.1.5.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.3.dist-info → uipath-2.1.5.dist-info}/licenses/LICENSE +0 -0
uipath/_cli/__init__.py
CHANGED
@@ -10,6 +10,7 @@ from .cli_invoke import invoke as invoke # type: ignore
|
|
10
10
|
from .cli_new import new as new # type: ignore
|
11
11
|
from .cli_pack import pack as pack # type: ignore
|
12
12
|
from .cli_publish import publish as publish # type: ignore
|
13
|
+
from .cli_push import push as push # type: ignore
|
13
14
|
from .cli_run import run as run # type: ignore
|
14
15
|
|
15
16
|
|
@@ -63,3 +64,4 @@ cli.add_command(run)
|
|
63
64
|
cli.add_command(deploy)
|
64
65
|
cli.add_command(auth)
|
65
66
|
cli.add_command(invoke)
|
67
|
+
cli.add_command(push)
|
@@ -1,10 +1,12 @@
|
|
1
|
+
import asyncio
|
1
2
|
import http.server
|
2
3
|
import json
|
3
4
|
import os
|
4
5
|
import socketserver
|
6
|
+
import threading
|
5
7
|
import time
|
8
|
+
from typing import Optional
|
6
9
|
|
7
|
-
import click
|
8
10
|
from dotenv import load_dotenv
|
9
11
|
|
10
12
|
from ._oidc_utils import get_auth_config
|
@@ -117,9 +119,11 @@ class HTTPServer:
|
|
117
119
|
"""
|
118
120
|
self.current_path = os.path.dirname(os.path.abspath(__file__))
|
119
121
|
self.port = port
|
120
|
-
self.httpd = None
|
122
|
+
self.httpd: Optional[socketserver.TCPServer] = None
|
121
123
|
self.token_data = None
|
122
124
|
self.should_shutdown = False
|
125
|
+
self.token_received_event: Optional[asyncio.Event] = None
|
126
|
+
self.loop = None
|
123
127
|
|
124
128
|
def token_received_callback(self, token_data):
|
125
129
|
"""Callback for when a token is received.
|
@@ -128,7 +132,8 @@ class HTTPServer:
|
|
128
132
|
token_data (dict): The received token data.
|
129
133
|
"""
|
130
134
|
self.token_data = token_data
|
131
|
-
self.
|
135
|
+
if self.token_received_event and self.loop:
|
136
|
+
self.loop.call_soon_threadsafe(self.token_received_event.set)
|
132
137
|
|
133
138
|
def create_server(self, state, code_verifier, domain):
|
134
139
|
"""Create and configure the HTTP server.
|
@@ -149,7 +154,16 @@ class HTTPServer:
|
|
149
154
|
self.httpd = socketserver.TCPServer(("", self.port), handler)
|
150
155
|
return self.httpd
|
151
156
|
|
152
|
-
def
|
157
|
+
def _run_server(self):
|
158
|
+
"""Run server loop in thread."""
|
159
|
+
try:
|
160
|
+
while not self.should_shutdown and self.httpd:
|
161
|
+
self.httpd.handle_request()
|
162
|
+
except Exception:
|
163
|
+
# Server might be closed, that's fine
|
164
|
+
pass
|
165
|
+
|
166
|
+
async def start(self, state, code_verifier, domain):
|
153
167
|
"""Start the server.
|
154
168
|
|
155
169
|
Args:
|
@@ -163,12 +177,16 @@ class HTTPServer:
|
|
163
177
|
if not self.httpd:
|
164
178
|
self.create_server(state, code_verifier, domain)
|
165
179
|
|
180
|
+
self.token_received_event = asyncio.Event()
|
181
|
+
self.loop = asyncio.get_event_loop()
|
182
|
+
|
183
|
+
# Run server in daemon thread
|
184
|
+
server_thread = threading.Thread(target=self._run_server, daemon=True)
|
185
|
+
server_thread.start()
|
186
|
+
|
166
187
|
try:
|
167
|
-
|
168
|
-
|
169
|
-
self.httpd.handle_request()
|
170
|
-
except KeyboardInterrupt:
|
171
|
-
click.echo("Process interrupted by user")
|
188
|
+
# Wait indefinitely for token received event or interrupt
|
189
|
+
await self.token_received_event.wait()
|
172
190
|
finally:
|
173
191
|
self.stop()
|
174
192
|
|
@@ -176,6 +194,7 @@ class HTTPServer:
|
|
176
194
|
|
177
195
|
def stop(self):
|
178
196
|
"""Stop the server gracefully and cleanup resources."""
|
197
|
+
self.should_shutdown = True
|
179
198
|
if self.httpd:
|
180
199
|
self.httpd.server_close()
|
181
200
|
self.httpd = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"client_id": "36dea5b8-e8bb-423d-8e7b-c808df8f1c00",
|
3
3
|
"redirect_uri": "http://localhost:__PY_REPLACE_PORT__/oidc/login",
|
4
|
-
"scope": "offline_access OrchestratorApiUserAccess IdentityServerApi ConnectionService DataService DocumentUnderstanding EnterpriseContextService Directory JamJamApi LLMGateway LLMOps OMS RCS.FolderAuthorization TM.Projects TM.TestCases TM.Requirements TM.TestSets",
|
4
|
+
"scope": "offline_access OrchestratorApiUserAccess StudioWebBackend IdentityServerApi ConnectionService DataService DocumentUnderstanding EnterpriseContextService Directory JamJamApi LLMGateway LLMOps OMS RCS.FolderAuthorization TM.Projects TM.TestCases TM.Requirements TM.TestSets",
|
5
5
|
"port": 8104
|
6
|
-
}
|
6
|
+
}
|