add download block (#1266)

This commit is contained in:
LawyZheng 2024-11-26 23:36:22 +08:00 committed by GitHub
parent fcc83f6fe4
commit 7bc6ec8e46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 48 additions and 0 deletions

View file

@ -283,6 +283,22 @@ class WaitBlockYAML(BlockYAML):
wait_sec: int = 0
class FileDownloadBlockYAML(BlockYAML):
block_type: Literal[BlockType.FILE_DOWNLOAD] = BlockType.FILE_DOWNLOAD # type: ignore
navigation_goal: str
url: str | None = None
title: str = ""
error_code_mapping: dict[str, str] | None = None
max_retries: int = 0
max_steps_per_run: int | None = None
parameter_keys: list[str] | None = None
download_suffix: str | None = None
totp_verification_url: str | None = None
totp_identifier: str | None = None
cache_actions: bool = False
PARAMETER_YAML_SUBCLASSES = (
AWSSecretParameterYAML
| BitwardenLoginCredentialParameterYAML
@ -309,6 +325,7 @@ BLOCK_YAML_SUBCLASSES = (
| ExtractionBlockYAML
| LoginBlockYAML
| WaitBlockYAML
| FileDownloadBlockYAML
)
BLOCK_YAML_TYPES = Annotated[BLOCK_YAML_SUBCLASSES, Field(discriminator="block_type")]