intuned-runtime 1.2.1__py3-none-any.whl → 1.2.2__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.
- intuned_cli/__init__.py +12 -2
- intuned_cli/commands/__init__.py +1 -0
- intuned_cli/commands/attempt_api_command.py +1 -1
- intuned_cli/commands/attempt_authsession_check_command.py +1 -1
- intuned_cli/commands/attempt_authsession_create_command.py +1 -1
- intuned_cli/commands/deploy_command.py +4 -4
- intuned_cli/commands/run_api_command.py +1 -1
- intuned_cli/commands/run_authsession_create_command.py +1 -1
- intuned_cli/commands/run_authsession_update_command.py +1 -1
- intuned_cli/commands/run_authsession_validate_command.py +1 -1
- intuned_cli/commands/save_command.py +47 -0
- intuned_cli/controller/__test__/test_api.py +0 -1
- intuned_cli/controller/api.py +0 -1
- intuned_cli/controller/authsession.py +0 -1
- intuned_cli/controller/deploy.py +8 -210
- intuned_cli/controller/save.py +260 -0
- intuned_cli/utils/backend.py +26 -0
- intuned_cli/utils/error.py +7 -3
- intuned_internal_cli/commands/project/auth_session/check.py +0 -1
- intuned_internal_cli/commands/project/run.py +0 -2
- intuned_runtime/__init__.py +2 -1
- {intuned_runtime-1.2.1.dist-info → intuned_runtime-1.2.2.dist-info}/METADATA +4 -2
- {intuned_runtime-1.2.1.dist-info → intuned_runtime-1.2.2.dist-info}/RECORD +43 -36
- {intuned_runtime-1.2.1.dist-info → intuned_runtime-1.2.2.dist-info}/WHEEL +1 -1
- runtime/backend_functions/_call_backend_function.py +18 -2
- runtime/browser/helpers.py +22 -0
- runtime/browser/launch_browser.py +43 -15
- runtime/browser/launch_chromium.py +26 -22
- runtime/constants.py +1 -0
- runtime/context/context.py +1 -0
- runtime/env.py +15 -1
- runtime/errors/run_api_errors.py +8 -0
- runtime/helpers/__init__.py +2 -1
- runtime/helpers/attempt_store.py +14 -0
- runtime/run/playwright_context.py +147 -0
- runtime/run/playwright_tracing.py +27 -0
- runtime/run/run_api.py +71 -91
- runtime/run/setup_context_hook.py +40 -0
- runtime/run/types.py +14 -0
- runtime/types/run_types.py +0 -1
- runtime_helpers/__init__.py +2 -1
- runtime/run/playwright_constructs.py +0 -20
- {intuned_runtime-1.2.1.dist-info → intuned_runtime-1.2.2.dist-info}/entry_points.txt +0 -0
- {intuned_runtime-1.2.1.dist-info → intuned_runtime-1.2.2.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
from collections.abc import Callable
|
2
|
+
from typing import Any
|
3
|
+
from typing import Awaitable
|
4
|
+
from typing import cast
|
5
|
+
from typing import Protocol
|
6
|
+
from typing import TYPE_CHECKING
|
7
|
+
from typing import Union
|
8
|
+
|
9
|
+
from runtime.errors.run_api_errors import ApiNotFoundError
|
10
|
+
|
11
|
+
from .types import ImportFunction
|
12
|
+
|
13
|
+
if TYPE_CHECKING:
|
14
|
+
from playwright.async_api import BrowserContext
|
15
|
+
from playwright.async_api import Page
|
16
|
+
|
17
|
+
|
18
|
+
setup_context_hook_path = "hooks/setup_context"
|
19
|
+
setup_context_hook_function_name = "setup_context"
|
20
|
+
|
21
|
+
SetupContextHookReturn = Union[
|
22
|
+
"None",
|
23
|
+
"BrowserContext",
|
24
|
+
"tuple[BrowserContext, Page | None]",
|
25
|
+
"tuple[BrowserContext, Page | None, Callable[..., Awaitable[None]]]",
|
26
|
+
]
|
27
|
+
|
28
|
+
|
29
|
+
class SetupContextHook(Protocol):
|
30
|
+
def __call__(self, *, cdp_url: str, api_name: str, api_parameters: Any) -> Awaitable[SetupContextHookReturn]: ...
|
31
|
+
|
32
|
+
|
33
|
+
def load_setup_context_hook(*, import_function: ImportFunction):
|
34
|
+
try:
|
35
|
+
setup_context_hook = cast(
|
36
|
+
SetupContextHook, import_function(setup_context_hook_path, setup_context_hook_function_name)
|
37
|
+
)
|
38
|
+
return setup_context_hook
|
39
|
+
except ApiNotFoundError:
|
40
|
+
return None
|
runtime/run/types.py
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
from collections.abc import Callable
|
2
|
+
from typing import Any
|
3
|
+
from typing import Awaitable
|
4
|
+
from typing import Optional
|
5
|
+
from typing import Protocol
|
6
|
+
|
7
|
+
from git import TYPE_CHECKING
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
pass
|
11
|
+
|
12
|
+
|
13
|
+
class ImportFunction(Protocol):
|
14
|
+
def __call__(self, file_path: str, name: Optional[str] = None, /) -> Callable[..., Awaitable[Any]]: ...
|
runtime/types/run_types.py
CHANGED
runtime_helpers/__init__.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from runtime.helpers import extend_payload
|
2
2
|
from runtime.helpers import extend_timeout
|
3
|
+
from runtime.helpers.attempt_store import attempt_store
|
3
4
|
from runtime.helpers.get_auth_session_parameters import get_auth_session_parameters
|
4
5
|
|
5
|
-
__all__ = ["extend_payload", "extend_timeout", "get_auth_session_parameters"]
|
6
|
+
__all__ = ["extend_payload", "extend_timeout", "get_auth_session_parameters", "attempt_store"]
|
@@ -1,20 +0,0 @@
|
|
1
|
-
from contextlib import asynccontextmanager
|
2
|
-
from typing import TYPE_CHECKING
|
3
|
-
|
4
|
-
if TYPE_CHECKING:
|
5
|
-
from playwright.async_api import ProxySettings
|
6
|
-
from ..browser import launch_browser
|
7
|
-
|
8
|
-
|
9
|
-
@asynccontextmanager
|
10
|
-
async def get_production_playwright_constructs(
|
11
|
-
proxy: "ProxySettings | None" = None,
|
12
|
-
headless: bool = False,
|
13
|
-
*,
|
14
|
-
cdp_address: str | None = None,
|
15
|
-
):
|
16
|
-
async with launch_browser(headless=headless, cdp_address=cdp_address, proxy=proxy) as (context, page):
|
17
|
-
try:
|
18
|
-
yield context, page
|
19
|
-
finally:
|
20
|
-
await context.close()
|
File without changes
|
File without changes
|