add login to skyvern library (#3016)
This commit is contained in:
@@ -22,6 +22,7 @@ from .types import (
|
||||
BitwardenCreditCardDataParameterYaml,
|
||||
BitwardenLoginCredentialParameter,
|
||||
BitwardenLoginCredentialParameterYaml,
|
||||
BitwardenLoginRequest,
|
||||
BitwardenSensitiveInformationParameter,
|
||||
BitwardenSensitiveInformationParameterYaml,
|
||||
BrowserSessionResponse,
|
||||
@@ -180,6 +181,10 @@ from .types import (
|
||||
LoginBlockParametersItem_Output,
|
||||
LoginBlockParametersItem_Workflow,
|
||||
LoginBlockYaml,
|
||||
LoginRequestBody,
|
||||
LoginRequestBody_1Password,
|
||||
LoginRequestBody_Bitwarden,
|
||||
LoginRequestBody_Skyvern,
|
||||
NavigationBlock,
|
||||
NavigationBlockDataSchema,
|
||||
NavigationBlockParametersItem,
|
||||
@@ -197,6 +202,7 @@ from .types import (
|
||||
NonEmptyPasswordCredential,
|
||||
OnePasswordCredentialParameter,
|
||||
OnePasswordCredentialParameterYaml,
|
||||
OnePasswordLoginRequest,
|
||||
OutputParameter,
|
||||
OutputParameterYaml,
|
||||
PasswordCredentialResponse,
|
||||
@@ -207,6 +213,7 @@ from .types import (
|
||||
RunStatus,
|
||||
SendEmailBlock,
|
||||
SendEmailBlockYaml,
|
||||
SkyvernLoginRequest,
|
||||
TaskBlock,
|
||||
TaskBlockDataSchema,
|
||||
TaskBlockParametersItem,
|
||||
@@ -388,6 +395,7 @@ __all__ = [
|
||||
"BitwardenCreditCardDataParameterYaml",
|
||||
"BitwardenLoginCredentialParameter",
|
||||
"BitwardenLoginCredentialParameterYaml",
|
||||
"BitwardenLoginRequest",
|
||||
"BitwardenSensitiveInformationParameter",
|
||||
"BitwardenSensitiveInformationParameterYaml",
|
||||
"BrowserSessionResponse",
|
||||
@@ -547,6 +555,10 @@ __all__ = [
|
||||
"LoginBlockParametersItem_Output",
|
||||
"LoginBlockParametersItem_Workflow",
|
||||
"LoginBlockYaml",
|
||||
"LoginRequestBody",
|
||||
"LoginRequestBody_1Password",
|
||||
"LoginRequestBody_Bitwarden",
|
||||
"LoginRequestBody_Skyvern",
|
||||
"NavigationBlock",
|
||||
"NavigationBlockDataSchema",
|
||||
"NavigationBlockParametersItem",
|
||||
@@ -565,6 +577,7 @@ __all__ = [
|
||||
"NotFoundError",
|
||||
"OnePasswordCredentialParameter",
|
||||
"OnePasswordCredentialParameterYaml",
|
||||
"OnePasswordLoginRequest",
|
||||
"OutputParameter",
|
||||
"OutputParameterYaml",
|
||||
"PasswordCredentialResponse",
|
||||
@@ -577,6 +590,7 @@ __all__ = [
|
||||
"SendEmailBlockYaml",
|
||||
"Skyvern",
|
||||
"SkyvernEnvironment",
|
||||
"SkyvernLoginRequest",
|
||||
"TaskBlock",
|
||||
"TaskBlockDataSchema",
|
||||
"TaskBlockParametersItem",
|
||||
|
||||
@@ -30,6 +30,7 @@ from .types.totp_code import TotpCode
|
||||
from .types.credential_response import CredentialResponse
|
||||
from .types.credential_type import CredentialType
|
||||
from .types.create_credential_request_credential import CreateCredentialRequestCredential
|
||||
from .types.login_request_body import LoginRequestBody
|
||||
from .core.client_wrapper import AsyncClientWrapper
|
||||
|
||||
# this is used as the default value for optional parameters
|
||||
@@ -1145,7 +1146,7 @@ class Skyvern:
|
||||
self, *, timeout: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> BrowserSessionResponse:
|
||||
"""
|
||||
Create a new browser session
|
||||
Create a browser session that persists across multiple runs
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -1220,7 +1221,7 @@ class Skyvern:
|
||||
self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Close a browser session
|
||||
Close a session. Once closed, the session cannot be used again.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -1290,7 +1291,7 @@ class Skyvern:
|
||||
self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> BrowserSessionResponse:
|
||||
"""
|
||||
Get details about a specific browser session by ID
|
||||
Get details about a specific browser session, including the browser address for cdp connection.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -1738,6 +1739,71 @@ class Skyvern:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
def login(
|
||||
self, *, request: LoginRequestBody, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> WorkflowRunResponse:
|
||||
"""
|
||||
Log in to a website using either credential stored in Skyvern, Bitwarden or 1Password
|
||||
|
||||
Parameters
|
||||
----------
|
||||
request : LoginRequestBody
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
WorkflowRunResponse
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import LoginRequestBody_Skyvern, Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
x_api_key="YOUR_X_API_KEY",
|
||||
)
|
||||
client.login(
|
||||
request=LoginRequestBody_Skyvern(
|
||||
credential_id="credential_id",
|
||||
),
|
||||
)
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
"v1/run/tasks/login",
|
||||
method="POST",
|
||||
json=convert_and_respect_annotation_metadata(
|
||||
object_=request, annotation=LoginRequestBody, direction="write"
|
||||
),
|
||||
request_options=request_options,
|
||||
omit=OMIT,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
WorkflowRunResponse,
|
||||
parse_obj_as(
|
||||
type_=WorkflowRunResponse, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
|
||||
class AsyncSkyvern:
|
||||
"""
|
||||
@@ -2946,7 +3012,7 @@ class AsyncSkyvern:
|
||||
self, *, timeout: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> BrowserSessionResponse:
|
||||
"""
|
||||
Create a new browser session
|
||||
Create a browser session that persists across multiple runs
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -3029,7 +3095,7 @@ class AsyncSkyvern:
|
||||
self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> typing.Optional[typing.Any]:
|
||||
"""
|
||||
Close a browser session
|
||||
Close a session. Once closed, the session cannot be used again.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -3107,7 +3173,7 @@ class AsyncSkyvern:
|
||||
self, browser_session_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> BrowserSessionResponse:
|
||||
"""
|
||||
Get details about a specific browser session by ID
|
||||
Get details about a specific browser session, including the browser address for cdp connection.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -3605,6 +3671,79 @@ class AsyncSkyvern:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
async def login(
|
||||
self, *, request: LoginRequestBody, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> WorkflowRunResponse:
|
||||
"""
|
||||
Log in to a website using either credential stored in Skyvern, Bitwarden or 1Password
|
||||
|
||||
Parameters
|
||||
----------
|
||||
request : LoginRequestBody
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
WorkflowRunResponse
|
||||
Successful Response
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern, LoginRequestBody_Skyvern
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
x_api_key="YOUR_X_API_KEY",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.login(
|
||||
request=LoginRequestBody_Skyvern(
|
||||
credential_id="credential_id",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
"v1/run/tasks/login",
|
||||
method="POST",
|
||||
json=convert_and_respect_annotation_metadata(
|
||||
object_=request, annotation=LoginRequestBody, direction="write"
|
||||
),
|
||||
request_options=request_options,
|
||||
omit=OMIT,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return typing.cast(
|
||||
WorkflowRunResponse,
|
||||
parse_obj_as(
|
||||
type_=WorkflowRunResponse, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, body=_response_json)
|
||||
|
||||
|
||||
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str:
|
||||
if base_url is not None:
|
||||
|
||||
@@ -24,7 +24,7 @@ class BaseClientWrapper:
|
||||
headers: typing.Dict[str, str] = {
|
||||
"X-Fern-Language": "Python",
|
||||
"X-Fern-SDK-Name": "skyvern",
|
||||
"X-Fern-SDK-Version": "0.2.2",
|
||||
"X-Fern-SDK-Version": "0.2.6",
|
||||
}
|
||||
if self._api_key is not None:
|
||||
headers["x-api-key"] = self._api_key
|
||||
|
||||
@@ -23,6 +23,7 @@ from .bitwarden_credit_card_data_parameter import BitwardenCreditCardDataParamet
|
||||
from .bitwarden_credit_card_data_parameter_yaml import BitwardenCreditCardDataParameterYaml
|
||||
from .bitwarden_login_credential_parameter import BitwardenLoginCredentialParameter
|
||||
from .bitwarden_login_credential_parameter_yaml import BitwardenLoginCredentialParameterYaml
|
||||
from .bitwarden_login_request import BitwardenLoginRequest
|
||||
from .bitwarden_sensitive_information_parameter import BitwardenSensitiveInformationParameter
|
||||
from .bitwarden_sensitive_information_parameter_yaml import BitwardenSensitiveInformationParameterYaml
|
||||
from .browser_session_response import BrowserSessionResponse
|
||||
@@ -201,6 +202,12 @@ from .login_block_parameters_item import (
|
||||
LoginBlockParametersItem_Workflow,
|
||||
)
|
||||
from .login_block_yaml import LoginBlockYaml
|
||||
from .login_request_body import (
|
||||
LoginRequestBody,
|
||||
LoginRequestBody_1Password,
|
||||
LoginRequestBody_Bitwarden,
|
||||
LoginRequestBody_Skyvern,
|
||||
)
|
||||
from .navigation_block import NavigationBlock
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import (
|
||||
@@ -220,6 +227,7 @@ from .non_empty_credit_card_credential import NonEmptyCreditCardCredential
|
||||
from .non_empty_password_credential import NonEmptyPasswordCredential
|
||||
from .one_password_credential_parameter import OnePasswordCredentialParameter
|
||||
from .one_password_credential_parameter_yaml import OnePasswordCredentialParameterYaml
|
||||
from .one_password_login_request import OnePasswordLoginRequest
|
||||
from .output_parameter import OutputParameter
|
||||
from .output_parameter_yaml import OutputParameterYaml
|
||||
from .password_credential_response import PasswordCredentialResponse
|
||||
@@ -230,6 +238,7 @@ from .run_engine import RunEngine
|
||||
from .run_status import RunStatus
|
||||
from .send_email_block import SendEmailBlock
|
||||
from .send_email_block_yaml import SendEmailBlockYaml
|
||||
from .skyvern_login_request import SkyvernLoginRequest
|
||||
from .task_block import TaskBlock
|
||||
from .task_block_data_schema import TaskBlockDataSchema
|
||||
from .task_block_parameters_item import (
|
||||
@@ -422,6 +431,7 @@ __all__ = [
|
||||
"BitwardenCreditCardDataParameterYaml",
|
||||
"BitwardenLoginCredentialParameter",
|
||||
"BitwardenLoginCredentialParameterYaml",
|
||||
"BitwardenLoginRequest",
|
||||
"BitwardenSensitiveInformationParameter",
|
||||
"BitwardenSensitiveInformationParameterYaml",
|
||||
"BrowserSessionResponse",
|
||||
@@ -580,6 +590,10 @@ __all__ = [
|
||||
"LoginBlockParametersItem_Output",
|
||||
"LoginBlockParametersItem_Workflow",
|
||||
"LoginBlockYaml",
|
||||
"LoginRequestBody",
|
||||
"LoginRequestBody_1Password",
|
||||
"LoginRequestBody_Bitwarden",
|
||||
"LoginRequestBody_Skyvern",
|
||||
"NavigationBlock",
|
||||
"NavigationBlockDataSchema",
|
||||
"NavigationBlockParametersItem",
|
||||
@@ -597,6 +611,7 @@ __all__ = [
|
||||
"NonEmptyPasswordCredential",
|
||||
"OnePasswordCredentialParameter",
|
||||
"OnePasswordCredentialParameterYaml",
|
||||
"OnePasswordLoginRequest",
|
||||
"OutputParameter",
|
||||
"OutputParameterYaml",
|
||||
"PasswordCredentialResponse",
|
||||
@@ -607,6 +622,7 @@ __all__ = [
|
||||
"RunStatus",
|
||||
"SendEmailBlock",
|
||||
"SendEmailBlockYaml",
|
||||
"SkyvernLoginRequest",
|
||||
"TaskBlock",
|
||||
"TaskBlockDataSchema",
|
||||
"TaskBlockParametersItem",
|
||||
|
||||
77
skyvern/client/types/bitwarden_login_request.py
Normal file
77
skyvern/client/types/bitwarden_login_request.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import pydantic
|
||||
from .proxy_location import ProxyLocation
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class BitwardenLoginRequest(UniversalBaseModel):
|
||||
"""
|
||||
Login with password saved in Bitwarden
|
||||
"""
|
||||
|
||||
url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Website url
|
||||
"""
|
||||
|
||||
prompt: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Login instructions. Skyvern has default prompt/instruction for login if this field is not provided.
|
||||
"""
|
||||
|
||||
webhook_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Webhook URL to send login status updates
|
||||
"""
|
||||
|
||||
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
|
||||
"""
|
||||
Proxy location to use
|
||||
"""
|
||||
|
||||
totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Identifier for TOTP (Time-based One-Time Password) if required
|
||||
"""
|
||||
|
||||
totp_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
TOTP URL to fetch one-time passwords
|
||||
"""
|
||||
|
||||
browser_session_id: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456`
|
||||
"""
|
||||
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional HTTP headers to include in requests
|
||||
"""
|
||||
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = pydantic.Field(default=None)
|
||||
"""
|
||||
Maximum number of times to scroll for screenshots
|
||||
"""
|
||||
|
||||
bitwarden_collection_id: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Bitwarden collection ID
|
||||
"""
|
||||
|
||||
bitwarden_item_id: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Bitwarden item ID
|
||||
"""
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
82
skyvern/client/types/login_request_body.py
Normal file
82
skyvern/client/types/login_request_body.py
Normal file
@@ -0,0 +1,82 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .proxy_location import ProxyLocation
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
|
||||
|
||||
class LoginRequestBody_Skyvern(UniversalBaseModel):
|
||||
credential_type: typing.Literal["skyvern"] = "skyvern"
|
||||
url: typing.Optional[str] = None
|
||||
prompt: typing.Optional[str] = None
|
||||
webhook_url: typing.Optional[str] = None
|
||||
proxy_location: typing.Optional[ProxyLocation] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
totp_url: typing.Optional[str] = None
|
||||
browser_session_id: typing.Optional[str] = None
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = None
|
||||
credential_id: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginRequestBody_Bitwarden(UniversalBaseModel):
|
||||
credential_type: typing.Literal["bitwarden"] = "bitwarden"
|
||||
url: typing.Optional[str] = None
|
||||
prompt: typing.Optional[str] = None
|
||||
webhook_url: typing.Optional[str] = None
|
||||
proxy_location: typing.Optional[ProxyLocation] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
totp_url: typing.Optional[str] = None
|
||||
browser_session_id: typing.Optional[str] = None
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = None
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
bitwarden_item_id: typing.Optional[str] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class LoginRequestBody_1Password(UniversalBaseModel):
|
||||
credential_type: typing.Literal["1password"] = "1password"
|
||||
url: typing.Optional[str] = None
|
||||
prompt: typing.Optional[str] = None
|
||||
webhook_url: typing.Optional[str] = None
|
||||
proxy_location: typing.Optional[ProxyLocation] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
totp_url: typing.Optional[str] = None
|
||||
browser_session_id: typing.Optional[str] = None
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = None
|
||||
onepassword_vault_id: str
|
||||
onepassword_item_id: str
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
LoginRequestBody = typing.Union[LoginRequestBody_Skyvern, LoginRequestBody_Bitwarden, LoginRequestBody_1Password]
|
||||
77
skyvern/client/types/one_password_login_request.py
Normal file
77
skyvern/client/types/one_password_login_request.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import pydantic
|
||||
from .proxy_location import ProxyLocation
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class OnePasswordLoginRequest(UniversalBaseModel):
|
||||
"""
|
||||
Login with password saved in 1Password
|
||||
"""
|
||||
|
||||
url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Website url
|
||||
"""
|
||||
|
||||
prompt: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Login instructions. Skyvern has default prompt/instruction for login if this field is not provided.
|
||||
"""
|
||||
|
||||
webhook_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Webhook URL to send login status updates
|
||||
"""
|
||||
|
||||
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
|
||||
"""
|
||||
Proxy location to use
|
||||
"""
|
||||
|
||||
totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Identifier for TOTP (Time-based One-Time Password) if required
|
||||
"""
|
||||
|
||||
totp_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
TOTP URL to fetch one-time passwords
|
||||
"""
|
||||
|
||||
browser_session_id: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456`
|
||||
"""
|
||||
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional HTTP headers to include in requests
|
||||
"""
|
||||
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = pydantic.Field(default=None)
|
||||
"""
|
||||
Maximum number of times to scroll for screenshots
|
||||
"""
|
||||
|
||||
onepassword_vault_id: str = pydantic.Field()
|
||||
"""
|
||||
1Password vault ID.
|
||||
"""
|
||||
|
||||
onepassword_item_id: str = pydantic.Field()
|
||||
"""
|
||||
1Password item ID.
|
||||
"""
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
72
skyvern/client/types/skyvern_login_request.py
Normal file
72
skyvern/client/types/skyvern_login_request.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import pydantic
|
||||
from .proxy_location import ProxyLocation
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class SkyvernLoginRequest(UniversalBaseModel):
|
||||
"""
|
||||
Login with password saved in Skyvern
|
||||
"""
|
||||
|
||||
url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Website url
|
||||
"""
|
||||
|
||||
prompt: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Login instructions. Skyvern has default prompt/instruction for login if this field is not provided.
|
||||
"""
|
||||
|
||||
webhook_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Webhook URL to send login status updates
|
||||
"""
|
||||
|
||||
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
|
||||
"""
|
||||
Proxy location to use
|
||||
"""
|
||||
|
||||
totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Identifier for TOTP (Time-based One-Time Password) if required
|
||||
"""
|
||||
|
||||
totp_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
TOTP URL to fetch one-time passwords
|
||||
"""
|
||||
|
||||
browser_session_id: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456`
|
||||
"""
|
||||
|
||||
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional HTTP headers to include in requests
|
||||
"""
|
||||
|
||||
max_screenshot_scrolling_times: typing.Optional[int] = pydantic.Field(default=None)
|
||||
"""
|
||||
Maximum number of times to scroll for screenshots
|
||||
"""
|
||||
|
||||
credential_id: str = pydantic.Field()
|
||||
"""
|
||||
ID of the Skyvern credential to use for login.
|
||||
"""
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
Reference in New Issue
Block a user