SDK: download files improments (#4198)

This commit is contained in:
Stanislav Novosad
2025-12-04 13:44:47 -07:00
committed by GitHub
parent 4665f8907d
commit 4b9c89e22b
114 changed files with 1084 additions and 143 deletions

View File

@@ -0,0 +1,40 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../../index.js";
/**
* @example
* {
* navigation_goal: "navigation_goal"
* }
*/
export interface DownloadFilesRequest {
/** Website URL */
url?: string;
/** Webhook URL to send status updates */
webhook_url?: string;
/** Proxy location to use */
proxy_location?: Skyvern.ProxyLocation;
/** Identifier for TOTP (Time-based One-Time Password) if required */
totp_identifier?: string;
/** TOTP URL to fetch one-time passwords */
totp_url?: string;
/** ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456` */
browser_session_id?: string;
/** ID of a browser profile to reuse for this run */
browser_profile_id?: string;
/** The CDP address for the task. */
browser_address?: string;
/** Additional HTTP headers to include in requests */
extra_http_headers?: Record<string, string | undefined>;
/** Maximum number of times to scroll for screenshots */
max_screenshot_scrolling_times?: number;
/** Instructions for navigating to and downloading the file */
navigation_goal: string;
/** Suffix or complete filename for the downloaded file */
download_suffix?: string;
/** Timeout in seconds for the download operation */
download_timeout?: number;
/** Maximum number of steps to execute */
max_steps_per_run?: number;
}

View File

@@ -9,13 +9,9 @@ import type * as Skyvern from "../../index.js";
* }
*/
export interface LoginRequest {
/** Where to get the credential from */
credential_type: Skyvern.SkyvernSchemasRunBlocksCredentialType;
/** Website url */
/** Website URL */
url?: string;
/** Login instructions. Skyvern has default prompt/instruction for login if this field is not provided. */
prompt?: string;
/** Webhook URL to send login status updates */
/** Webhook URL to send status updates */
webhook_url?: string;
/** Proxy location to use */
proxy_location?: Skyvern.ProxyLocation;
@@ -33,6 +29,10 @@ export interface LoginRequest {
extra_http_headers?: Record<string, string | undefined>;
/** Maximum number of times to scroll for screenshots */
max_screenshot_scrolling_times?: number;
/** Where to get the credential from */
credential_type: Skyvern.SkyvernSchemasRunBlocksCredentialType;
/** Login instructions. Skyvern has default prompt/instruction for login if this field is not provided. */
prompt?: string;
/** ID of the Skyvern credential to use for login. */
credential_id?: string;
/** Bitwarden collection ID. You can find it in the Bitwarden collection URL. e.g. `https://vault.bitwarden.com/vaults/collection_id/items` */

View File

@@ -4,6 +4,7 @@ export type { CreateCredentialRequest } from "./CreateCredentialRequest.js";
export type { CreateScriptRequest } from "./CreateScriptRequest.js";
export type { CreateWorkflowRequest } from "./CreateWorkflowRequest.js";
export type { DeployScriptRequest } from "./DeployScriptRequest.js";
export type { DownloadFilesRequest } from "./DownloadFilesRequest.js";
export type { GetCredentialsRequest } from "./GetCredentialsRequest.js";
export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
export type { GetScriptsRequest } from "./GetScriptsRequest.js";

View File

@@ -11,6 +11,7 @@ export interface ActionBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface ActionBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
url?: string;
title?: string;
engine?: Skyvern.RunEngine;

View File

@@ -6,7 +6,7 @@ import type * as Skyvern from "../index.js";
* Represents a single conditional branch edge within a ConditionalBlock.
*/
export interface BranchCondition {
criteria?: Skyvern.BranchCriteria;
criteria?: Skyvern.BranchConditionCriteria;
next_block_label?: string;
description?: string;
is_default?: boolean;

View File

@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export type BranchConditionCriteria = Skyvern.BranchConditionCriteria.Jinja2Template;
export namespace BranchConditionCriteria {
export interface Jinja2Template extends Skyvern.JinjaBranchCriteria {
criteria_type: "jinja2_template";
}
}

View File

@@ -0,0 +1,10 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export interface BranchConditionYaml {
criteria?: Skyvern.BranchCriteriaYaml;
next_block_label?: string;
description?: string;
is_default?: boolean;
}

View File

@@ -1,10 +0,0 @@
// This file was auto-generated by Fern from our API Definition.
/**
* Abstract interface describing how a branch condition should be evaluated.
*/
export interface BranchCriteria {
criteria_type: string;
expression: string;
description?: string;
}

View File

@@ -0,0 +1,7 @@
// This file was auto-generated by Fern from our API Definition.
export interface BranchCriteriaYaml {
criteria_type?: "jinja2_template";
expression: string;
description?: string;
}

View File

@@ -11,6 +11,7 @@ export interface CodeBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
code: string;
parameters?: Skyvern.CodeBlockParametersItem[];
}

View File

@@ -7,6 +7,7 @@ export interface CodeBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
code: string;
parameter_keys?: string[];
}

View File

@@ -14,5 +14,6 @@ export interface ConditionalBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
branch_conditions?: Skyvern.BranchCondition[];
}

View File

@@ -0,0 +1,14 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export interface ConditionalBlockYaml {
/** Author-facing identifier; must be unique per workflow. */
label: string;
/** Optional pointer to the label of the next block. When omitted, it will default to sequential order. See [[s-4bnl]]. */
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
branch_conditions?: Skyvern.BranchConditionYaml[];
}

View File

@@ -11,5 +11,6 @@ export interface DownloadToS3Block {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
url: string;
}

View File

@@ -7,5 +7,6 @@ export interface DownloadToS3BlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
url: string;
}

View File

@@ -11,6 +11,7 @@ export interface ExtractionBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface ExtractionBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
data_extraction_goal: string;
url?: string;
title?: string;

View File

@@ -11,6 +11,7 @@ export interface FileDownloadBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface FileDownloadBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
navigation_goal: string;
url?: string;
title?: string;

View File

@@ -11,6 +11,7 @@ export interface FileParserBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
file_url: string;
file_type: Skyvern.FileType;
json_schema?: Record<string, unknown>;

View File

@@ -9,6 +9,7 @@ export interface FileParserBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
file_url: string;
file_type: Skyvern.FileType;
json_schema?: Record<string, unknown>;

View File

@@ -11,6 +11,7 @@ export interface FileUploadBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
storage_type?: Skyvern.FileStorageType;
s3_bucket?: string;
aws_access_key_id?: string;

View File

@@ -9,6 +9,7 @@ export interface FileUploadBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
storage_type?: Skyvern.FileStorageType;
s3_bucket?: string;
aws_access_key_id?: string;

View File

@@ -11,6 +11,7 @@ export interface ForLoopBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
loop_blocks: Skyvern.ForLoopBlockLoopBlocksItem[];
loop_over?: Skyvern.ForLoopBlockLoopOver;
loop_variable_reference?: string;

View File

@@ -9,6 +9,7 @@ export interface ForLoopBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
loop_blocks: Skyvern.ForLoopBlockYamlLoopBlocksItem[];
loop_over_parameter_key?: string;
loop_variable_reference?: string;

View File

@@ -23,7 +23,8 @@ export type ForLoopBlockYamlLoopBlocksItem =
| Skyvern.ForLoopBlockYamlLoopBlocksItem.GotoUrl
| Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser
| Skyvern.ForLoopBlockYamlLoopBlocksItem.TaskV2
| Skyvern.ForLoopBlockYamlLoopBlocksItem.HttpRequest;
| Skyvern.ForLoopBlockYamlLoopBlocksItem.HttpRequest
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Conditional;
export namespace ForLoopBlockYamlLoopBlocksItem {
export interface Task extends Skyvern.TaskBlockYaml {
@@ -109,4 +110,8 @@ export namespace ForLoopBlockYamlLoopBlocksItem {
export interface HttpRequest extends Skyvern.HttpRequestBlockYaml {
block_type: "http_request";
}
export interface Conditional extends Skyvern.ConditionalBlockYaml {
block_type: "conditional";
}
}

View File

@@ -11,6 +11,7 @@ export interface HttpRequestBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
method?: string;
url?: string;
headers?: Record<string, string | undefined>;

View File

@@ -7,6 +7,7 @@ export interface HttpRequestBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
method?: string;
url?: string;
headers?: Record<string, string | undefined>;

View File

@@ -22,6 +22,7 @@ export interface HumanInteractionBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -7,6 +7,7 @@ export interface HumanInteractionBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
instructions?: string;
positive_descriptor?: string;
negative_descriptor?: string;

View File

@@ -0,0 +1,9 @@
// This file was auto-generated by Fern from our API Definition.
/**
* Jinja2-templated branch criteria (only supported criteria type for now).
*/
export interface JinjaBranchCriteria {
expression: string;
description?: string;
}

View File

@@ -11,6 +11,7 @@ export interface LoginBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface LoginBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
url?: string;
title?: string;
engine?: Skyvern.RunEngine;

View File

@@ -11,6 +11,7 @@ export interface NavigationBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface NavigationBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
navigation_goal: string;
url?: string;
title?: string;

View File

@@ -15,6 +15,7 @@ export interface PdfParserBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
file_url: string;
json_schema?: Record<string, unknown>;
}

View File

@@ -7,6 +7,7 @@ export interface PdfParserBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
file_url: string;
json_schema?: Record<string, unknown>;
}

View File

@@ -11,6 +11,7 @@ export interface SendEmailBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
smtp_host: Skyvern.AwsSecretParameter;
smtp_port: Skyvern.AwsSecretParameter;
smtp_username: Skyvern.AwsSecretParameter;

View File

@@ -7,6 +7,7 @@ export interface SendEmailBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
smtp_host_secret_parameter_key: string;
smtp_port_secret_parameter_key: string;
smtp_username_secret_parameter_key: string;

View File

@@ -11,6 +11,7 @@ export interface TaskBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -9,6 +9,7 @@ export interface TaskBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
url?: string;
title?: string;
engine?: Skyvern.RunEngine;

View File

@@ -11,6 +11,7 @@ export interface TaskV2Block {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
prompt: string;
url?: string;
totp_verification_url?: string;

View File

@@ -7,6 +7,7 @@ export interface TaskV2BlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
prompt: string;
url?: string;
totp_verification_url?: string;

View File

@@ -11,6 +11,7 @@ export interface TextPromptBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
llm_key?: string;
prompt: string;
parameters?: Skyvern.TextPromptBlockParametersItem[];

View File

@@ -7,6 +7,7 @@ export interface TextPromptBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
llm_key?: string;
prompt: string;
parameter_keys?: string[];

View File

@@ -11,5 +11,6 @@ export interface UploadToS3Block {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
path?: string;
}

View File

@@ -7,5 +7,6 @@ export interface UploadToS3BlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
path?: string;
}

View File

@@ -11,6 +11,7 @@ export interface UrlBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url: string;
title?: string;

View File

@@ -7,5 +7,6 @@ export interface UrlBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
url: string;
}

View File

@@ -11,6 +11,7 @@ export interface ValidationBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
task_type?: string;
url?: string;
title?: string;

View File

@@ -7,6 +7,7 @@ export interface ValidationBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
complete_criterion?: string;
terminate_criterion?: string;
error_code_mapping?: Record<string, string | undefined>;

View File

@@ -11,6 +11,7 @@ export interface WaitBlock {
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
wait_sec: number;
parameters?: Skyvern.WaitBlockParametersItem[];
}

View File

@@ -7,5 +7,6 @@ export interface WaitBlockYaml {
next_block_label?: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
next_loop_on_failure?: boolean;
wait_sec?: number;
}

View File

@@ -5,6 +5,7 @@ import type * as Skyvern from "../index.js";
export type WorkflowDefinitionYamlBlocksItem =
| Skyvern.WorkflowDefinitionYamlBlocksItem.Action
| Skyvern.WorkflowDefinitionYamlBlocksItem.Code
| Skyvern.WorkflowDefinitionYamlBlocksItem.Conditional
| Skyvern.WorkflowDefinitionYamlBlocksItem.DownloadToS3
| Skyvern.WorkflowDefinitionYamlBlocksItem.Extraction
| Skyvern.WorkflowDefinitionYamlBlocksItem.FileDownload
@@ -34,6 +35,10 @@ export namespace WorkflowDefinitionYamlBlocksItem {
block_type: "code";
}
export interface Conditional extends Skyvern.ConditionalBlockYaml {
block_type: "conditional";
}
export interface DownloadToS3 extends Skyvern.DownloadToS3BlockYaml {
block_type: "download_to_s3";
}

View File

@@ -20,7 +20,9 @@ export * from "./BitwardenSensitiveInformationParameter.js";
export * from "./BitwardenSensitiveInformationParameterYaml.js";
export * from "./BlockType.js";
export * from "./BranchCondition.js";
export * from "./BranchCriteria.js";
export * from "./BranchConditionCriteria.js";
export * from "./BranchConditionYaml.js";
export * from "./BranchCriteriaYaml.js";
export * from "./BrowserProfile.js";
export * from "./BrowserSessionResponse.js";
export * from "./ClickAction.js";
@@ -29,6 +31,7 @@ export * from "./CodeBlock.js";
export * from "./CodeBlockParametersItem.js";
export * from "./CodeBlockYaml.js";
export * from "./ConditionalBlock.js";
export * from "./ConditionalBlockYaml.js";
export * from "./ContextParameter.js";
export * from "./ContextParameterSource.js";
export * from "./ContextParameterYaml.js";
@@ -73,6 +76,7 @@ export * from "./HumanInteractionBlockParametersItem.js";
export * from "./HumanInteractionBlockYaml.js";
export * from "./InputOrSelectContext.js";
export * from "./InputTextAction.js";
export * from "./JinjaBranchCriteria.js";
export * from "./LocateElementAction.js";
export * from "./LoginBlock.js";
export * from "./LoginBlockParametersItem.js";