bump version to v1.0.11 (#4574)
Some checks failed
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run
Auto Create GitHub Release on Version Change / check-version-change (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / check-version-change (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / check-version-change (push) Has been cancelled
Auto Create GitHub Release on Version Change / create-release (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / run-ci (push) Has been cancelled
Build Skyvern SDK and publish to PyPI / build-sdk (push) Has been cancelled
Build Skyvern TS SDK and publish to npm / build-and-publish-sdk (push) Has been cancelled

This commit is contained in:
Shuchang Zheng 2026-01-28 16:47:21 -08:00 committed by GitHub
parent adf9ad3467
commit 34aadb8c09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
82 changed files with 3077 additions and 304 deletions

View file

@ -1,6 +1,5 @@
# Skyvern TypeScript Library
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FSkyvern-AI%2Fskyvern-typescript)
[![npm shield](https://img.shields.io/npm/v/@skyvern/client)](https://www.npmjs.com/package/@skyvern/client)
The Skyvern TypeScript library provides convenient access to the Skyvern APIs from TypeScript.

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@skyvern/client",
"version": "1.0.10",
"version": "1.0.11",
"private": false,
"repository": {
"type": "git",

View file

@ -7,7 +7,7 @@ importers:
dependencies:
playwright:
specifier: ^1.48.0
version: 1.57.0
version: 1.58.0
devDependencies:
'@biomejs/biome':
specifier: 2.2.5
@ -656,12 +656,12 @@ packages:
picomatch@4.0.3:
resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
engines: {node: '>=12'}
playwright-core@1.57.0:
resolution: {integrity: sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==}
playwright-core@1.58.0:
resolution: {integrity: sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==}
engines: {node: '>=18'}
hasBin: true
playwright@1.57.0:
resolution: {integrity: sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==}
playwright@1.58.0:
resolution: {integrity: sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==}
engines: {node: '>=18'}
hasBin: true
postcss@8.5.6:
@ -1401,10 +1401,10 @@ snapshots:
picocolors@1.1.1: {}
picomatch@2.3.1: {}
picomatch@4.0.3: {}
playwright-core@1.57.0: {}
playwright@1.57.0:
playwright-core@1.58.0: {}
playwright@1.58.0:
dependencies:
playwright-core: 1.57.0
playwright-core: 1.58.0
optionalDependencies:
fsevents: 2.3.2
postcss@8.5.6:

View file

@ -1,5 +1,5 @@
# Reference
<details><summary><code>client.<a href="/src/Client.ts">runSdkAction</a>({ ...params }) -> Skyvern.RunSdkActionResponse</code></summary>
<details><summary><code>client.<a href="/src/Client.ts">changeTierApiV1BillingChangeTierPost</a>({ ...params }) -> Skyvern.ChangeTierResponse</code></summary>
<dl>
<dd>
@ -11,7 +11,10 @@
<dl>
<dd>
Execute a single SDK action with the specified parameters
Redirect to Stripe Portal for tier changes.
Portal handles proration based on configured settings:
- Upgrades: Immediate proration charge
- Downgrades: Apply at end of billing period
</dd>
</dl>
</dd>
@ -26,11 +29,8 @@ Execute a single SDK action with the specified parameters
<dd>
```typescript
await client.runSdkAction({
url: "url",
action: {
type: "ai_act"
}
await client.changeTierApiV1BillingChangeTierPost({
tier: "free"
});
```
@ -47,7 +47,7 @@ await client.runSdkAction({
<dl>
<dd>
**request:** `Skyvern.RunSdkActionRequest`
**request:** `Skyvern.ChangeTierRequest`
</dd>
</dl>

View file

@ -26,8 +26,8 @@ export class SkyvernClient {
"x-api-key": _options?.apiKey,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@skyvern/client",
"X-Fern-SDK-Version": "1.0.10",
"User-Agent": "@skyvern/client/1.0.10",
"X-Fern-SDK-Version": "1.0.11",
"User-Agent": "@skyvern/client/1.0.11",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
@ -2817,4 +2817,329 @@ export class SkyvernClient {
});
}
}
/**
* Create a Stripe Checkout Session for subscribing to a tier.
*
* Frontend should redirect the user to the returned URL.
* After successful checkout, Stripe will send a webhook that we handle
* to store the subscription and initialize billing state.
*
* Returns 400 if org already has an active subscription (use portal instead).
*
* @param {Skyvern.CheckoutSubscriptionRequest} request
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Skyvern.UnprocessableEntityError}
*
* @example
* await client.createCheckoutSessionApiV1BillingCheckoutPost({
* tier: "free"
* })
*/
public createCheckoutSessionApiV1BillingCheckoutPost(
request: Skyvern.CheckoutSubscriptionRequest,
requestOptions?: SkyvernClient.RequestOptions,
): core.HttpResponsePromise<Skyvern.CheckoutSessionResponse> {
return core.HttpResponsePromise.fromPromise(
this.__createCheckoutSessionApiV1BillingCheckoutPost(request, requestOptions),
);
}
private async __createCheckoutSessionApiV1BillingCheckoutPost(
request: Skyvern.CheckoutSubscriptionRequest,
requestOptions?: SkyvernClient.RequestOptions,
): Promise<core.WithRawResponse<Skyvern.CheckoutSessionResponse>> {
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
requestOptions?.headers,
);
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.SkyvernEnvironment.Cloud,
"api/v1/billing/checkout",
),
method: "POST",
headers: _headers,
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return { data: _response.body as Skyvern.CheckoutSessionResponse, rawResponse: _response.rawResponse };
}
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}
switch (_response.error.reason) {
case "non-json":
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/checkout.");
case "unknown":
throw new errors.SkyvernError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
}
/**
* Create a Stripe Customer Portal session for managing subscription.
*
* Frontend should redirect the user to the returned URL.
* The portal allows users to:
* - Update payment methods
* - Upgrade/downgrade plans
* - Cancel subscription
* - View invoices
*
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Skyvern.UnprocessableEntityError}
*
* @example
* await client.createPortalSessionApiV1BillingPortalPost()
*/
public createPortalSessionApiV1BillingPortalPost(
requestOptions?: SkyvernClient.RequestOptions,
): core.HttpResponsePromise<Skyvern.PortalSessionResponse> {
return core.HttpResponsePromise.fromPromise(this.__createPortalSessionApiV1BillingPortalPost(requestOptions));
}
private async __createPortalSessionApiV1BillingPortalPost(
requestOptions?: SkyvernClient.RequestOptions,
): Promise<core.WithRawResponse<Skyvern.PortalSessionResponse>> {
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
requestOptions?.headers,
);
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.SkyvernEnvironment.Cloud,
"api/v1/billing/portal",
),
method: "POST",
headers: _headers,
queryParameters: requestOptions?.queryParams,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return { data: _response.body as Skyvern.PortalSessionResponse, rawResponse: _response.rawResponse };
}
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}
switch (_response.error.reason) {
case "non-json":
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/portal.");
case "unknown":
throw new errors.SkyvernError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
}
/**
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Skyvern.UnprocessableEntityError}
*
* @example
* await client.getOrganizationBillingApiV1BillingStateGet()
*/
public getOrganizationBillingApiV1BillingStateGet(
requestOptions?: SkyvernClient.RequestOptions,
): core.HttpResponsePromise<Skyvern.BillingStateResponse | undefined> {
return core.HttpResponsePromise.fromPromise(this.__getOrganizationBillingApiV1BillingStateGet(requestOptions));
}
private async __getOrganizationBillingApiV1BillingStateGet(
requestOptions?: SkyvernClient.RequestOptions,
): Promise<core.WithRawResponse<Skyvern.BillingStateResponse | undefined>> {
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
requestOptions?.headers,
);
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.SkyvernEnvironment.Cloud,
"api/v1/billing/state",
),
method: "GET",
headers: _headers,
queryParameters: requestOptions?.queryParams,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return {
data: _response.body as Skyvern.BillingStateResponse | undefined,
rawResponse: _response.rawResponse,
};
}
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}
switch (_response.error.reason) {
case "non-json":
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /api/v1/billing/state.");
case "unknown":
throw new errors.SkyvernError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
}
/**
* Redirect to Stripe Portal for tier changes.
* Portal handles proration based on configured settings:
* - Upgrades: Immediate proration charge
* - Downgrades: Apply at end of billing period
*
* @param {Skyvern.ChangeTierRequest} request
* @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Skyvern.UnprocessableEntityError}
*
* @example
* await client.changeTierApiV1BillingChangeTierPost({
* tier: "free"
* })
*/
public changeTierApiV1BillingChangeTierPost(
request: Skyvern.ChangeTierRequest,
requestOptions?: SkyvernClient.RequestOptions,
): core.HttpResponsePromise<Skyvern.ChangeTierResponse> {
return core.HttpResponsePromise.fromPromise(
this.__changeTierApiV1BillingChangeTierPost(request, requestOptions),
);
}
private async __changeTierApiV1BillingChangeTierPost(
request: Skyvern.ChangeTierRequest,
requestOptions?: SkyvernClient.RequestOptions,
): Promise<core.WithRawResponse<Skyvern.ChangeTierResponse>> {
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
this._options?.headers,
mergeOnlyDefinedHeaders({ "x-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
requestOptions?.headers,
);
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.SkyvernEnvironment.Cloud,
"api/v1/billing/change-tier",
),
method: "POST",
headers: _headers,
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return { data: _response.body as Skyvern.ChangeTierResponse, rawResponse: _response.rawResponse };
}
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Skyvern.UnprocessableEntityError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}
switch (_response.error.reason) {
case "non-json":
throw new errors.SkyvernError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/change-tier.");
case "unknown":
throw new errors.SkyvernError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
}
}

View file

@ -0,0 +1,13 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../../index.js";
/**
* @example
* {
* tier: "free"
* }
*/
export interface ChangeTierRequest {
tier: Skyvern.PlanTier;
}

View file

@ -0,0 +1,13 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../../index.js";
/**
* @example
* {
* tier: "free"
* }
*/
export interface CheckoutSubscriptionRequest {
tier: Skyvern.PlanTier;
}

View file

@ -22,16 +22,21 @@ export interface CreateBrowserSessionRequest {
* - RESIDENTIAL_FR: France
* - RESIDENTIAL_DE: Germany
* - RESIDENTIAL_NZ: New Zealand
* - RESIDENTIAL_PH: Philippines
* - RESIDENTIAL_ZA: South Africa
* - RESIDENTIAL_AR: Argentina
* - RESIDENTIAL_AU: Australia
* - RESIDENTIAL_ISP: ISP proxy
* - US-CA: California
* - US-NY: New York
* - US-TX: Texas
* - US-FL: Florida
* - US-WA: Washington
* - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
* - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
* - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
* - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
* - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
* - NONE: No proxy
*/
proxy_location?: Skyvern.ProxyLocation;
/** A list of extensions to install in the browser session. */
extensions?: Skyvern.Extensions[];
/** The type of browser to use for the session. */
browser_type?: Skyvern.PersistentBrowserType;
}

View file

@ -1,5 +1,7 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../../index.js";
/**
* @example
* {
@ -22,4 +24,6 @@ export interface TotpCodeCreate {
content: string;
/** The timestamp when the TOTP code expires */
expired_at?: string;
/** Optional. If provided, forces extraction of this specific OTP type (totp or magic_link). Use this when the content contains multiple OTP types and you want to specify which one to extract. */
type?: Skyvern.OtpType;
}

View file

@ -1,4 +1,6 @@
export type { BodyUploadFileV1UploadFilePost } from "./BodyUploadFileV1UploadFilePost.js";
export type { ChangeTierRequest } from "./ChangeTierRequest.js";
export type { CheckoutSubscriptionRequest } from "./CheckoutSubscriptionRequest.js";
export type { CreateBrowserProfileRequest } from "./CreateBrowserProfileRequest.js";
export type { CreateBrowserSessionRequest } from "./CreateBrowserSessionRequest.js";
export type { CreateCredentialRequest } from "./CreateCredentialRequest.js";

View file

@ -21,6 +21,7 @@ export interface Action {
element_id?: string;
skyvern_element_hash?: string;
skyvern_element_data?: Record<string, unknown>;
screenshot_artifact_id?: string;
tool_call_id?: string;
xpath?: string;
errors?: Skyvern.UserDefinedError[];
@ -28,6 +29,8 @@ export interface Action {
file_name?: string;
file_url?: string;
download?: boolean;
download_triggered?: boolean;
downloaded_files?: string[];
is_upload_file_tag?: boolean;
text?: string;
input_or_select_context?: Skyvern.InputOrSelectContext;

View file

@ -27,5 +27,6 @@ export const ArtifactType = {
Trace: "trace",
Har: "har",
ScriptFile: "script_file",
Pdf: "pdf",
} as const;
export type ArtifactType = (typeof ArtifactType)[keyof typeof ArtifactType];

View file

@ -0,0 +1,22 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export interface BillingStateResponse {
billing_id: string;
organization_id: string;
plan_tier: Skyvern.PlanTier;
current_period_start?: string;
current_period_end?: string;
included_credits_this_period: number;
credits_consumed_this_period: number;
cached_credits_consumed_this_period: number;
overage_enabled: boolean;
browser_uptime_seconds_consumed: number;
topup_credits_total: number;
topup_credits_used: number;
topup_credits_remaining: number;
credits_remaining: number;
created_at: string;
modified_at: string;
}

View file

@ -23,5 +23,6 @@ export const BlockType = {
PdfParser: "pdf_parser",
HttpRequest: "http_request",
HumanInteraction: "human_interaction",
PrintPage: "print_page",
} as const;
export type BlockType = (typeof BlockType)[keyof typeof BlockType];

View file

@ -10,6 +10,8 @@ export interface BrowserSessionResponse {
browser_session_id: string;
/** ID of the organization that owns this session */
organization_id: string;
/** Current status of the browser session */
status?: string;
/** Type of the current runnable associated with this session (workflow, task etc) */
runnable_type?: string;
/** ID of the current runnable */
@ -20,6 +22,10 @@ export interface BrowserSessionResponse {
browser_address?: string;
/** Url for the browser session page */
app_url?: string;
/** A list of extensions installed in the browser session. */
extensions?: Skyvern.Extensions[];
/** The type of browser used for the session. */
browser_type?: Skyvern.PersistentBrowserType;
/** Whether the browser session supports VNC streaming */
vnc_streaming_supported?: boolean;
/** The path where the browser session downloads files */

View file

@ -0,0 +1,7 @@
// This file was auto-generated by Fern from our API Definition.
export interface ChangeTierResponse {
status: string;
tier: string;
redirect_url?: string;
}

View file

@ -0,0 +1,6 @@
// This file was auto-generated by Fern from our API Definition.
export interface CheckoutSessionResponse {
id: string;
url: string;
}

View file

@ -0,0 +1,7 @@
// This file was auto-generated by Fern from our API Definition.
export const Extensions = {
AdBlocker: "ad-blocker",
CaptchaSolver: "captcha-solver",
} as const;
export type Extensions = (typeof Extensions)[keyof typeof Extensions];

View file

@ -18,6 +18,7 @@ export type ForLoopBlockLoopBlocksItem =
| Skyvern.ForLoopBlockLoopBlocksItem.Login
| Skyvern.ForLoopBlockLoopBlocksItem.Navigation
| Skyvern.ForLoopBlockLoopBlocksItem.PdfParser
| Skyvern.ForLoopBlockLoopBlocksItem.PrintPage
| Skyvern.ForLoopBlockLoopBlocksItem.SendEmail
| Skyvern.ForLoopBlockLoopBlocksItem.Task
| Skyvern.ForLoopBlockLoopBlocksItem.TaskV2
@ -87,6 +88,10 @@ export namespace ForLoopBlockLoopBlocksItem {
block_type: "pdf_parser";
}
export interface PrintPage extends Skyvern.PrintPageBlock {
block_type: "print_page";
}
export interface SendEmail extends Skyvern.SendEmailBlock {
block_type: "send_email";
}

View file

@ -24,7 +24,8 @@ export type ForLoopBlockYamlLoopBlocksItem =
| Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser
| Skyvern.ForLoopBlockYamlLoopBlocksItem.TaskV2
| Skyvern.ForLoopBlockYamlLoopBlocksItem.HttpRequest
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Conditional;
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Conditional
| Skyvern.ForLoopBlockYamlLoopBlocksItem.PrintPage;
export namespace ForLoopBlockYamlLoopBlocksItem {
export interface Task extends Skyvern.TaskBlockYaml {
@ -114,4 +115,8 @@ export namespace ForLoopBlockYamlLoopBlocksItem {
export interface Conditional extends Skyvern.ConditionalBlockYaml {
block_type: "conditional";
}
export interface PrintPage extends Skyvern.PrintPageBlockYaml {
block_type: "print_page";
}
}

View file

@ -19,5 +19,7 @@ export interface HttpRequestBlock {
files?: Record<string, string | undefined>;
timeout?: number;
follow_redirects?: boolean;
download_filename?: string;
save_response_as_file?: boolean;
parameters?: Skyvern.HttpRequestBlockParametersItem[];
}

View file

@ -15,5 +15,7 @@ export interface HttpRequestBlockYaml {
files?: Record<string, string | undefined>;
timeout?: number;
follow_redirects?: boolean;
download_filename?: string;
save_response_as_file?: boolean;
parameter_keys?: string[];
}

View file

@ -8,4 +8,5 @@ export interface InputOrSelectContext {
is_location_input?: boolean;
is_date_related?: boolean;
date_format?: string;
is_text_captcha?: boolean;
}

View file

@ -0,0 +1,9 @@
// This file was auto-generated by Fern from our API Definition.
export const PdfFormat = {
A4: "A4",
Letter: "Letter",
Legal: "Legal",
Tabloid: "Tabloid",
} as const;
export type PdfFormat = (typeof PdfFormat)[keyof typeof PdfFormat];

View file

@ -0,0 +1,7 @@
// This file was auto-generated by Fern from our API Definition.
export const PersistentBrowserType = {
Msedge: "msedge",
Chrome: "chrome",
} as const;
export type PersistentBrowserType = (typeof PersistentBrowserType)[keyof typeof PersistentBrowserType];

View file

@ -0,0 +1,9 @@
// This file was auto-generated by Fern from our API Definition.
/** Self-serve subscription tiers. Enterprise customers use manual billing (bypass). */
export const PlanTier = {
Free: "free",
Hobby: "hobby",
Pro: "pro",
} as const;
export type PlanTier = (typeof PlanTier)[keyof typeof PlanTier];

View file

@ -0,0 +1,5 @@
// This file was auto-generated by Fern from our API Definition.
export interface PortalSessionResponse {
url: string;
}

View file

@ -0,0 +1,21 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export interface PrintPageBlock {
/** Author-facing identifier for a block; unique within a workflow. */
label: string;
/** Optional pointer to the next block label when constructing a DAG. Defaults to sequential order when omitted. */
next_block_label?: string;
output_parameter: Skyvern.OutputParameter;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
next_loop_on_failure?: boolean;
include_timestamp?: boolean;
custom_filename?: string;
format?: string;
landscape?: boolean;
print_background?: boolean;
parameters?: Skyvern.PrintPageBlockParametersItem[];
}

View file

@ -0,0 +1,62 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export type PrintPageBlockParametersItem =
| Skyvern.PrintPageBlockParametersItem.AwsSecret
| Skyvern.PrintPageBlockParametersItem.AzureSecret
| Skyvern.PrintPageBlockParametersItem.AzureVaultCredential
| Skyvern.PrintPageBlockParametersItem.BitwardenCreditCardData
| Skyvern.PrintPageBlockParametersItem.BitwardenLoginCredential
| Skyvern.PrintPageBlockParametersItem.BitwardenSensitiveInformation
| Skyvern.PrintPageBlockParametersItem.Context
| Skyvern.PrintPageBlockParametersItem.Credential
| Skyvern.PrintPageBlockParametersItem.Onepassword
| Skyvern.PrintPageBlockParametersItem.Output
| Skyvern.PrintPageBlockParametersItem.Workflow;
export namespace PrintPageBlockParametersItem {
export interface AwsSecret extends Skyvern.AwsSecretParameter {
parameter_type: "aws_secret";
}
export interface AzureSecret extends Skyvern.AzureSecretParameter {
parameter_type: "azure_secret";
}
export interface AzureVaultCredential extends Skyvern.AzureVaultCredentialParameter {
parameter_type: "azure_vault_credential";
}
export interface BitwardenCreditCardData extends Skyvern.BitwardenCreditCardDataParameter {
parameter_type: "bitwarden_credit_card_data";
}
export interface BitwardenLoginCredential extends Skyvern.BitwardenLoginCredentialParameter {
parameter_type: "bitwarden_login_credential";
}
export interface BitwardenSensitiveInformation extends Skyvern.BitwardenSensitiveInformationParameter {
parameter_type: "bitwarden_sensitive_information";
}
export interface Context extends Skyvern.ContextParameter {
parameter_type: "context";
}
export interface Credential extends Skyvern.CredentialParameter {
parameter_type: "credential";
}
export interface Onepassword extends Skyvern.OnePasswordCredentialParameter {
parameter_type: "onepassword";
}
export interface Output extends Skyvern.OutputParameter {
parameter_type: "output";
}
export interface Workflow extends Skyvern.WorkflowParameter {
parameter_type: "workflow";
}
}

View file

@ -0,0 +1,19 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export interface PrintPageBlockYaml {
/** 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;
include_timestamp?: boolean;
custom_filename?: string;
format?: Skyvern.PdfFormat;
landscape?: boolean;
print_background?: boolean;
parameter_keys?: string[];
}

View file

@ -24,6 +24,7 @@ export const ProxyLocation = {
ResidentialMx: "RESIDENTIAL_MX",
ResidentialIt: "RESIDENTIAL_IT",
ResidentialNl: "RESIDENTIAL_NL",
ResidentialPh: "RESIDENTIAL_PH",
ResidentialIsp: "RESIDENTIAL_ISP",
None: "NONE",
} as const;

View file

@ -30,15 +30,16 @@ export interface TaskRunRequest {
* - RESIDENTIAL_FR: France
* - RESIDENTIAL_DE: Germany
* - RESIDENTIAL_NZ: New Zealand
* - RESIDENTIAL_PH: Philippines
* - RESIDENTIAL_ZA: South Africa
* - RESIDENTIAL_AR: Argentina
* - RESIDENTIAL_AU: Australia
* - RESIDENTIAL_ISP: ISP proxy
* - US-CA: California
* - US-NY: New York
* - US-TX: Texas
* - US-FL: Florida
* - US-WA: Washington
* - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
* - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
* - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
* - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
* - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
* - NONE: No proxy
* Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
*/
@ -102,15 +103,16 @@ export namespace TaskRunRequest {
* - RESIDENTIAL_FR: France
* - RESIDENTIAL_DE: Germany
* - RESIDENTIAL_NZ: New Zealand
* - RESIDENTIAL_PH: Philippines
* - RESIDENTIAL_ZA: South Africa
* - RESIDENTIAL_AR: Argentina
* - RESIDENTIAL_AU: Australia
* - RESIDENTIAL_ISP: ISP proxy
* - US-CA: California
* - US-NY: New York
* - US-TX: Texas
* - US-FL: Florida
* - US-WA: Washington
* - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
* - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
* - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
* - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
* - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
* - NONE: No proxy
* Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
*/

View file

@ -39,6 +39,8 @@ export interface TaskRunResponse {
script_run?: Skyvern.ScriptRunResponse;
/** The errors for the run */
errors?: Record<string, unknown>[];
/** Total number of steps executed in this run */
step_count?: number;
/** The original request parameters used to start this task run */
run_request?: Skyvern.TaskRunRequest;
}

View file

@ -17,6 +17,8 @@ export interface TotpCode {
content: string;
/** The timestamp when the TOTP code expires */
expired_at?: string;
/** Optional. If provided, forces extraction of this specific OTP type (totp or magic_link). Use this when the content contains multiple OTP types and you want to specify which one to extract. */
type?: Skyvern.OtpType;
/** The skyvern ID of the TOTP code. */
totp_code_id: string;
/** The TOTP code extracted from the content. */

View file

@ -6,4 +6,5 @@ export interface WorkflowDefinition {
version?: number;
parameters: Skyvern.WorkflowDefinitionParametersItem[];
blocks: Skyvern.WorkflowDefinitionBlocksItem[];
finally_block_label?: string;
}

View file

@ -18,6 +18,7 @@ export type WorkflowDefinitionBlocksItem =
| Skyvern.WorkflowDefinitionBlocksItem.Login
| Skyvern.WorkflowDefinitionBlocksItem.Navigation
| Skyvern.WorkflowDefinitionBlocksItem.PdfParser
| Skyvern.WorkflowDefinitionBlocksItem.PrintPage
| Skyvern.WorkflowDefinitionBlocksItem.SendEmail
| Skyvern.WorkflowDefinitionBlocksItem.Task
| Skyvern.WorkflowDefinitionBlocksItem.TaskV2
@ -87,6 +88,10 @@ export namespace WorkflowDefinitionBlocksItem {
block_type: "pdf_parser";
}
export interface PrintPage extends Skyvern.PrintPageBlock {
block_type: "print_page";
}
export interface SendEmail extends Skyvern.SendEmailBlock {
block_type: "send_email";
}

View file

@ -6,4 +6,5 @@ export interface WorkflowDefinitionYaml {
version?: number;
parameters: Skyvern.WorkflowDefinitionYamlParametersItem[];
blocks: Skyvern.WorkflowDefinitionYamlBlocksItem[];
finally_block_label?: string;
}

View file

@ -18,6 +18,7 @@ export type WorkflowDefinitionYamlBlocksItem =
| Skyvern.WorkflowDefinitionYamlBlocksItem.Login
| Skyvern.WorkflowDefinitionYamlBlocksItem.Navigation
| Skyvern.WorkflowDefinitionYamlBlocksItem.PdfParser
| Skyvern.WorkflowDefinitionYamlBlocksItem.PrintPage
| Skyvern.WorkflowDefinitionYamlBlocksItem.SendEmail
| Skyvern.WorkflowDefinitionYamlBlocksItem.Task
| Skyvern.WorkflowDefinitionYamlBlocksItem.TaskV2
@ -87,6 +88,10 @@ export namespace WorkflowDefinitionYamlBlocksItem {
block_type: "pdf_parser";
}
export interface PrintPage extends Skyvern.PrintPageBlockYaml {
block_type: "print_page";
}
export interface SendEmail extends Skyvern.SendEmailBlockYaml {
block_type: "send_email";
}

View file

@ -22,15 +22,16 @@ export interface WorkflowRunRequest {
* - RESIDENTIAL_FR: France
* - RESIDENTIAL_DE: Germany
* - RESIDENTIAL_NZ: New Zealand
* - RESIDENTIAL_PH: Philippines
* - RESIDENTIAL_ZA: South Africa
* - RESIDENTIAL_AR: Argentina
* - RESIDENTIAL_AU: Australia
* - RESIDENTIAL_ISP: ISP proxy
* - US-CA: California
* - US-NY: New York
* - US-TX: Texas
* - US-FL: Florida
* - US-WA: Washington
* - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
* - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
* - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
* - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
* - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
* - NONE: No proxy
* Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
*/
@ -76,15 +77,16 @@ export namespace WorkflowRunRequest {
* - RESIDENTIAL_FR: France
* - RESIDENTIAL_DE: Germany
* - RESIDENTIAL_NZ: New Zealand
* - RESIDENTIAL_PH: Philippines
* - RESIDENTIAL_ZA: South Africa
* - RESIDENTIAL_AR: Argentina
* - RESIDENTIAL_AU: Australia
* - RESIDENTIAL_ISP: ISP proxy
* - US-CA: California
* - US-NY: New York
* - US-TX: Texas
* - US-FL: Florida
* - US-WA: Washington
* - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
* - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
* - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
* - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
* - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
* - NONE: No proxy
* Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
*/

View file

@ -39,6 +39,8 @@ export interface WorkflowRunResponse {
script_run?: Skyvern.ScriptRunResponse;
/** The errors for the run */
errors?: Record<string, unknown>[];
/** Total number of steps executed in this run */
step_count?: number;
/** Whether the workflow run was executed with agent or code */
run_with?: string;
/** Whether to fallback to AI if code run fails. */

View file

@ -12,6 +12,7 @@ export * from "./AwsSecretParameterYaml.js";
export * from "./AzureSecretParameter.js";
export * from "./AzureVaultCredentialParameter.js";
export * from "./AzureVaultCredentialParameterYaml.js";
export * from "./BillingStateResponse.js";
export * from "./BitwardenCreditCardDataParameter.js";
export * from "./BitwardenCreditCardDataParameterYaml.js";
export * from "./BitwardenLoginCredentialParameter.js";
@ -25,6 +26,8 @@ export * from "./BranchConditionYaml.js";
export * from "./BranchCriteriaYaml.js";
export * from "./BrowserProfile.js";
export * from "./BrowserSessionResponse.js";
export * from "./ChangeTierResponse.js";
export * from "./CheckoutSessionResponse.js";
export * from "./ClickAction.js";
export * from "./ClickContext.js";
export * from "./CodeBlock.js";
@ -43,6 +46,7 @@ export * from "./CredentialTypeOutput.js";
export * from "./CreditCardCredentialResponse.js";
export * from "./DownloadToS3Block.js";
export * from "./DownloadToS3BlockYaml.js";
export * from "./Extensions.js";
export * from "./ExtractAction.js";
export * from "./ExtractionBlock.js";
export * from "./ExtractionBlockParametersItem.js";
@ -91,8 +95,15 @@ export * from "./OtpType.js";
export * from "./OutputParameter.js";
export * from "./OutputParameterYaml.js";
export * from "./PasswordCredentialResponse.js";
export * from "./PdfFormat.js";
export * from "./PdfParserBlock.js";
export * from "./PdfParserBlockYaml.js";
export * from "./PersistentBrowserType.js";
export * from "./PlanTier.js";
export * from "./PortalSessionResponse.js";
export * from "./PrintPageBlock.js";
export * from "./PrintPageBlockParametersItem.js";
export * from "./PrintPageBlockYaml.js";
export * from "./PromptAction.js";
export * from "./PromptBranchCriteria.js";
export * from "./ProxyLocation.js";

View file

@ -1 +1 @@
export const SDK_VERSION = "1.0.10";
export const SDK_VERSION = "1.0.11";

View file

@ -30,6 +30,7 @@ describe("SkyvernClient", () => {
max_screenshot_scrolls: 1,
script_run: { ai_fallback_triggered: true },
errors: [{ key: "value" }],
step_count: 1,
run_request: {
prompt: "Find the top 3 posts on Hacker News.",
url: "url",
@ -101,6 +102,7 @@ describe("SkyvernClient", () => {
key: "value",
},
],
step_count: 1,
run_request: {
prompt: "Find the top 3 posts on Hacker News.",
url: "url",
@ -203,6 +205,7 @@ describe("SkyvernClient", () => {
max_screenshot_scrolls: 1,
script_run: { ai_fallback_triggered: true },
errors: [{ key: "value" }],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -275,6 +278,7 @@ describe("SkyvernClient", () => {
key: "value",
},
],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -372,6 +376,7 @@ describe("SkyvernClient", () => {
max_screenshot_scrolls: 1,
script_run: { ai_fallback_triggered: true },
errors: [{ key: "value" }],
step_count: 1,
run_request: {
prompt: "Find the top 3 posts on Hacker News.",
url: "url",
@ -431,6 +436,7 @@ describe("SkyvernClient", () => {
key: "value",
},
],
step_count: 1,
run_request: {
prompt: "Find the top 3 posts on Hacker News.",
url: "url",
@ -563,6 +569,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -634,6 +641,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -713,6 +721,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -782,6 +791,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -869,6 +879,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -935,6 +946,7 @@ describe("SkyvernClient", () => {
},
},
],
finally_block_label: "finally_block_label",
},
proxy_location: "RESIDENTIAL",
webhook_callback_url: "webhook_callback_url",
@ -1715,11 +1727,14 @@ describe("SkyvernClient", () => {
{
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [{ url: "url" }],
@ -1744,11 +1759,14 @@ describe("SkyvernClient", () => {
{
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [
@ -1813,11 +1831,14 @@ describe("SkyvernClient", () => {
const rawResponseBody = {
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [
@ -1845,11 +1866,14 @@ describe("SkyvernClient", () => {
expect(response).toEqual({
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [
@ -1976,11 +2000,14 @@ describe("SkyvernClient", () => {
const rawResponseBody = {
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [
@ -2007,11 +2034,14 @@ describe("SkyvernClient", () => {
expect(response).toEqual({
browser_session_id: "pbs_123456",
organization_id: "organization_id",
status: "status",
runnable_type: "runnable_type",
runnable_id: "runnable_id",
timeout: 1,
browser_address: "browser_address",
app_url: "app_url",
extensions: ["ad-blocker"],
browser_type: "msedge",
vnc_streaming_supported: true,
download_path: "download_path",
downloaded_files: [
@ -2107,6 +2137,7 @@ describe("SkyvernClient", () => {
source: "source",
content: "Hello, your verification code is 123456",
expired_at: "2024-01-15T09:30:00Z",
type: "totp",
totp_code_id: "totp_code_id",
code: "code",
organization_id: "organization_id",
@ -2135,6 +2166,7 @@ describe("SkyvernClient", () => {
source: "source",
content: "Hello, your verification code is 123456",
expired_at: "2024-01-15T09:30:00Z",
type: "totp",
totp_code_id: "totp_code_id",
code: "code",
organization_id: "organization_id",
@ -2398,6 +2430,7 @@ describe("SkyvernClient", () => {
max_screenshot_scrolls: 1,
script_run: { ai_fallback_triggered: true },
errors: [{ key: "value" }],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -2463,6 +2496,7 @@ describe("SkyvernClient", () => {
key: "value",
},
],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -2534,6 +2568,7 @@ describe("SkyvernClient", () => {
max_screenshot_scrolls: 1,
script_run: { ai_fallback_triggered: true },
errors: [{ key: "value" }],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -2599,6 +2634,7 @@ describe("SkyvernClient", () => {
key: "value",
},
],
step_count: 1,
run_with: "run_with",
ai_fallback: true,
run_request: {
@ -2958,4 +2994,199 @@ describe("SkyvernClient", () => {
});
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
test("create_checkout_session_api_v1_billing_checkout_post (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { tier: "free" };
const rawResponseBody = { id: "id", url: "url" };
server
.mockEndpoint()
.post("/api/v1/billing/checkout")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(200)
.jsonBody(rawResponseBody)
.build();
const response = await client.createCheckoutSessionApiV1BillingCheckoutPost({
tier: "free",
});
expect(response).toEqual({
id: "id",
url: "url",
});
});
test("create_checkout_session_api_v1_billing_checkout_post (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { tier: "free" };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/api/v1/billing/checkout")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(422)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.createCheckoutSessionApiV1BillingCheckoutPost({
tier: "free",
});
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
test("create_portal_session_api_v1_billing_portal_post (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawResponseBody = { url: "url" };
server
.mockEndpoint()
.post("/api/v1/billing/portal")
.respondWith()
.statusCode(200)
.jsonBody(rawResponseBody)
.build();
const response = await client.createPortalSessionApiV1BillingPortalPost();
expect(response).toEqual({
url: "url",
});
});
test("create_portal_session_api_v1_billing_portal_post (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/api/v1/billing/portal")
.respondWith()
.statusCode(422)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.createPortalSessionApiV1BillingPortalPost();
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
test("get_organization_billing_api_v1_billing_state_get (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawResponseBody = {
billing_id: "billing_id",
organization_id: "organization_id",
plan_tier: "free",
current_period_start: "2024-01-15T09:30:00Z",
current_period_end: "2024-01-15T09:30:00Z",
included_credits_this_period: 1,
credits_consumed_this_period: 1,
cached_credits_consumed_this_period: 1,
overage_enabled: true,
browser_uptime_seconds_consumed: 1,
topup_credits_total: 1,
topup_credits_used: 1,
topup_credits_remaining: 1,
credits_remaining: 1,
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
};
server
.mockEndpoint()
.get("/api/v1/billing/state")
.respondWith()
.statusCode(200)
.jsonBody(rawResponseBody)
.build();
const response = await client.getOrganizationBillingApiV1BillingStateGet();
expect(response).toEqual({
billing_id: "billing_id",
organization_id: "organization_id",
plan_tier: "free",
current_period_start: "2024-01-15T09:30:00Z",
current_period_end: "2024-01-15T09:30:00Z",
included_credits_this_period: 1,
credits_consumed_this_period: 1,
cached_credits_consumed_this_period: 1,
overage_enabled: true,
browser_uptime_seconds_consumed: 1,
topup_credits_total: 1,
topup_credits_used: 1,
topup_credits_remaining: 1,
credits_remaining: 1,
created_at: "2024-01-15T09:30:00Z",
modified_at: "2024-01-15T09:30:00Z",
});
});
test("get_organization_billing_api_v1_billing_state_get (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.get("/api/v1/billing/state")
.respondWith()
.statusCode(422)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.getOrganizationBillingApiV1BillingStateGet();
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
test("change_tier_api_v1_billing_change_tier_post (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { tier: "free" };
const rawResponseBody = { status: "status", tier: "tier", redirect_url: "redirect_url" };
server
.mockEndpoint()
.post("/api/v1/billing/change-tier")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(200)
.jsonBody(rawResponseBody)
.build();
const response = await client.changeTierApiV1BillingChangeTierPost({
tier: "free",
});
expect(response).toEqual({
status: "status",
tier: "tier",
redirect_url: "redirect_url",
});
});
test("change_tier_api_v1_billing_change_tier_post (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ apiKey: "test", environment: server.baseUrl });
const rawRequestBody = { tier: "free" };
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/api/v1/billing/change-tier")
.jsonBody(rawRequestBody)
.respondWith()
.statusCode(422)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.changeTierApiV1BillingChangeTierPost({
tier: "free",
});
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
});