From a089aa5ad1dec3c8bdf2a37b5804645b79093aa1 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:07:40 +0000 Subject: [PATCH 01/20] SDK regeneration --- package.json | 2 +- reference.md | 414 +++++++++++++++++- src/Client.ts | 106 ++++- .../client/requests/DeleteAuthStateRequest.ts | 13 + src/api/client/requests/DeploymentConfig.ts | 2 + src/api/client/requests/index.ts | 1 + .../betaVmManagement/client/Client.ts | 283 ++++++++++++ .../betaVmManagement/client/index.ts | 1 + src/api/resources/betaVmManagement/index.ts | 1 + src/api/resources/browser/client/Client.ts | 117 ++++- .../client/requests/BrowserStartRequest.ts | 11 + .../browser/client/requests/index.ts | 1 + src/api/resources/code/client/Client.ts | 4 +- src/api/resources/env/client/Client.ts | 12 +- src/api/resources/index.ts | 1 + src/api/resources/instance/client/Client.ts | 219 ++++++++- .../client/requests/ExposePortRequest.ts | 13 + .../client/requests/NetlifyDeployRequest.ts | 13 + .../instance/client/requests/index.ts | 2 + src/api/resources/notebook/client/Client.ts | 28 +- src/api/types/BrowserGetStreamUrlResponse.ts | 7 + src/api/types/DeleteBrowserAuthResponse.ts | 8 + src/api/types/ExposePortResponse.ts | 8 + src/api/types/NetlifyDeployResponse.ts | 12 + src/api/types/SnapshotResponse.ts | 7 + src/api/types/StartBrowserResponse.ts | 1 + src/api/types/SuccessResponse.ts | 8 + .../client/requests/DeploymentConfig.ts | 4 + .../client/requests/ExposePortRequest.ts | 20 + .../client/requests/NetlifyDeployRequest.ts | 20 + .../instance/client/requests/index.ts | 2 + .../types/BrowserGetStreamUrlResponse.ts | 20 + .../types/DeleteBrowserAuthResponse.ts | 22 + src/serialization/types/ExposePortResponse.ts | 22 + .../types/NetlifyDeployResponse.ts | 24 + src/serialization/types/SnapshotResponse.ts | 20 + .../types/StartBrowserResponse.ts | 2 + src/serialization/types/SuccessResponse.ts | 22 + src/serialization/types/index.ts | 6 + src/version.ts | 2 +- yarn.lock | 40 +- 41 files changed, 1432 insertions(+), 89 deletions(-) create mode 100644 src/api/client/requests/DeleteAuthStateRequest.ts create mode 100644 src/api/resources/betaVmManagement/client/Client.ts create mode 100644 src/api/resources/betaVmManagement/client/index.ts create mode 100644 src/api/resources/betaVmManagement/index.ts create mode 100644 src/api/resources/browser/client/requests/BrowserStartRequest.ts create mode 100644 src/api/resources/instance/client/requests/ExposePortRequest.ts create mode 100644 src/api/resources/instance/client/requests/NetlifyDeployRequest.ts create mode 100644 src/api/types/BrowserGetStreamUrlResponse.ts create mode 100644 src/api/types/DeleteBrowserAuthResponse.ts create mode 100644 src/api/types/ExposePortResponse.ts create mode 100644 src/api/types/NetlifyDeployResponse.ts create mode 100644 src/api/types/SnapshotResponse.ts create mode 100644 src/api/types/SuccessResponse.ts create mode 100644 src/serialization/resources/instance/client/requests/ExposePortRequest.ts create mode 100644 src/serialization/resources/instance/client/requests/NetlifyDeployRequest.ts create mode 100644 src/serialization/types/BrowserGetStreamUrlResponse.ts create mode 100644 src/serialization/types/DeleteBrowserAuthResponse.ts create mode 100644 src/serialization/types/ExposePortResponse.ts create mode 100644 src/serialization/types/NetlifyDeployResponse.ts create mode 100644 src/serialization/types/SnapshotResponse.ts create mode 100644 src/serialization/types/SuccessResponse.ts diff --git a/package.json b/package.json index eff0bfb..ef9d384 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "2.5.0", + "version": "2.6.0-beta.0", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", diff --git a/reference.md b/reference.md index 2ad5ea0..87da3c7 100644 --- a/reference.md +++ b/reference.md @@ -1,6 +1,6 @@ # Reference -
client.getAuthStates() -> Scrapybara.AuthStateResponse[] +
client.deleteAuthState({ ...params }) -> Scrapybara.DeleteBrowserAuthResponse
@@ -13,7 +13,9 @@
```typescript -await client.getAuthStates(); +await client.deleteAuthState({ + authStateId: "auth_state_id", +}); ```
@@ -29,6 +31,14 @@ await client.getAuthStates();
+**request:** `Scrapybara.DeleteAuthStateRequest` + +
+
+ +
+
+ **requestOptions:** `ScrapybaraClient.RequestOptions`
@@ -605,9 +615,160 @@ await client.instance.resume("instance_id");
+
client.instance.exposePort(instanceId, { ...params }) -> Scrapybara.ExposePortResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Expose a port on the instance with a public-facing URL. + +This endpoint creates a temporary public URL that routes traffic to the specified port on the instance. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.instance.exposePort("instance_id", { + port: 1, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**instanceId:** `string` + +
+
+ +
+
+ +**request:** `Scrapybara.ExposePortRequest` + +
+
+ +
+
+ +**requestOptions:** `Instance.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.instance.deployToNetlify(instanceId, { ...params }) -> Scrapybara.NetlifyDeployResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deploy a directory from the instance to Netlify. + +Args: +directory_path: Path to the directory on the instance to deploy + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.instance.deployToNetlify("instance_id", { + directoryPath: "directory_path", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**instanceId:** `string` + +
+
+ +
+
+ +**request:** `Scrapybara.NetlifyDeployRequest` + +
+
+ +
+
+ +**requestOptions:** `Instance.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Browser -
client.browser.start(instanceId) -> Scrapybara.StartBrowserResponse +
client.browser.start(instanceId, { ...params }) -> Scrapybara.StartBrowserResponse
@@ -644,6 +805,14 @@ await client.browser.start("instance_id");
+**request:** `Scrapybara.BrowserStartRequest` + +
+
+ +
+
+ **requestOptions:** `Browser.RequestOptions`
@@ -703,6 +872,54 @@ await client.browser.getCdpUrl("instance_id");
+
client.browser.getStreamUrl(instanceId) -> Scrapybara.BrowserGetStreamUrlResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.browser.getStreamUrl("instance_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**instanceId:** `string` + +
+
+ +
+
+ +**requestOptions:** `Browser.RequestOptions` + +
+
+
+
+ +
+
+
+
client.browser.getCurrentUrl(instanceId) -> Scrapybara.BrowserGetCurrentUrlResponse
@@ -1621,3 +1838,194 @@ await client.env.delete("instance_id", {
+ +## BetaVmManagement + +
client.betaVmManagement.takeSnapshot(instanceId) -> Scrapybara.SnapshotResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Take a snapshot of an instance + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.betaVmManagement.takeSnapshot("instance_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**instanceId:** `string` + +
+
+ +
+
+ +**requestOptions:** `BetaVmManagement.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.betaVmManagement.warmupSnapshot(snapshotId) -> Scrapybara.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Warmup a snapshot + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.betaVmManagement.warmupSnapshot("snapshot_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**snapshotId:** `string` + +
+
+ +
+
+ +**requestOptions:** `BetaVmManagement.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.betaVmManagement.deleteSnapshot(snapshotId) -> Scrapybara.SuccessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a snapshot + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.betaVmManagement.deleteSnapshot("snapshot_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**snapshotId:** `string` + +
+
+ +
+
+ +**requestOptions:** `BetaVmManagement.RequestOptions` + +
+
+
+
+ +
+
+
diff --git a/src/Client.ts b/src/Client.ts index 2c3a8f9..4493751 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -13,6 +13,7 @@ import { Browser } from "./api/resources/browser/client/Client"; import { Code } from "./api/resources/code/client/Client"; import { Notebook } from "./api/resources/notebook/client/Client"; import { Env } from "./api/resources/env/client/Client"; +import { BetaVmManagement } from "./api/resources/betaVmManagement/client/Client"; export declare namespace ScrapybaraClient { export interface Options { @@ -38,6 +39,7 @@ export class ScrapybaraClient { protected _code: Code | undefined; protected _notebook: Notebook | undefined; protected _env: Env | undefined; + protected _betaVmManagement: BetaVmManagement | undefined; constructor(protected readonly _options: ScrapybaraClient.Options = {}) {} @@ -61,6 +63,10 @@ export class ScrapybaraClient { return (this._env ??= new Env(this._options)); } + public get betaVmManagement(): BetaVmManagement { + return (this._betaVmManagement ??= new BetaVmManagement(this._options)); + } + /** * @param {Scrapybara.DeploymentConfig} request * @param {ScrapybaraClient.RequestOptions} requestOptions - Request-specific configuration. @@ -83,8 +89,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -162,8 +168,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -238,8 +244,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -300,8 +306,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -344,6 +350,90 @@ export class ScrapybaraClient { } } + /** + * @param {Scrapybara.DeleteAuthStateRequest} request + * @param {ScrapybaraClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.deleteAuthState({ + * authStateId: "auth_state_id" + * }) + */ + public async deleteAuthState( + request: Scrapybara.DeleteAuthStateRequest, + requestOptions?: ScrapybaraClient.RequestOptions, + ): Promise { + const { authStateId } = request; + const _queryParams: Record = {}; + _queryParams["auth_state_id"] = authStateId; + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + "v1/delete_auth_state", + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.DeleteBrowserAuthResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError("Timeout exceeded when calling POST /v1/delete_auth_state."); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["SCRAPYBARA_API_KEY"]; return { "x-api-key": apiKeyValue }; diff --git a/src/api/client/requests/DeleteAuthStateRequest.ts b/src/api/client/requests/DeleteAuthStateRequest.ts new file mode 100644 index 0000000..ac8b1b4 --- /dev/null +++ b/src/api/client/requests/DeleteAuthStateRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * authStateId: "auth_state_id" + * } + */ +export interface DeleteAuthStateRequest { + authStateId: string; +} diff --git a/src/api/client/requests/DeploymentConfig.ts b/src/api/client/requests/DeploymentConfig.ts index a62aa00..fbb472f 100644 --- a/src/api/client/requests/DeploymentConfig.ts +++ b/src/api/client/requests/DeploymentConfig.ts @@ -13,4 +13,6 @@ export interface DeploymentConfig { timeoutHours?: number; blockedDomains?: string[]; resolution?: number[]; + backend?: string; + snapshotId?: string; } diff --git a/src/api/client/requests/index.ts b/src/api/client/requests/index.ts index 85daf8a..fad0faa 100644 --- a/src/api/client/requests/index.ts +++ b/src/api/client/requests/index.ts @@ -1 +1,2 @@ export { type DeploymentConfig } from "./DeploymentConfig"; +export { type DeleteAuthStateRequest } from "./DeleteAuthStateRequest"; diff --git a/src/api/resources/betaVmManagement/client/Client.ts b/src/api/resources/betaVmManagement/client/Client.ts new file mode 100644 index 0000000..8069021 --- /dev/null +++ b/src/api/resources/betaVmManagement/client/Client.ts @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as Scrapybara from "../../../index"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace BetaVmManagement { + export interface Options { + environment?: core.Supplier; + apiKey?: core.Supplier; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; + } +} + +export class BetaVmManagement { + constructor(protected readonly _options: BetaVmManagement.Options = {}) {} + + /** + * Take a snapshot of an instance + * + * @param {string} instanceId + * @param {BetaVmManagement.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.betaVmManagement.takeSnapshot("instance_id") + */ + public async takeSnapshot( + instanceId: string, + requestOptions?: BetaVmManagement.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/beta/instances/${encodeURIComponent(instanceId)}/snapshot`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SnapshotResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/beta/instances/{instance_id}/snapshot.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Warmup a snapshot + * + * @param {string} snapshotId + * @param {BetaVmManagement.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.betaVmManagement.warmupSnapshot("snapshot_id") + */ + public async warmupSnapshot( + snapshotId: string, + requestOptions?: BetaVmManagement.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/beta/snapshots/${encodeURIComponent(snapshotId)}/warmup`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/beta/snapshots/{snapshot_id}/warmup.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Delete a snapshot + * + * @param {string} snapshotId + * @param {BetaVmManagement.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.betaVmManagement.deleteSnapshot("snapshot_id") + */ + public async deleteSnapshot( + snapshotId: string, + requestOptions?: BetaVmManagement.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/beta/snapshots/${encodeURIComponent(snapshotId)}/delete`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SuccessResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/beta/snapshots/{snapshot_id}/delete.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getCustomAuthorizationHeaders() { + const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["SCRAPYBARA_API_KEY"]; + return { "x-api-key": apiKeyValue }; + } +} diff --git a/src/api/resources/betaVmManagement/client/index.ts b/src/api/resources/betaVmManagement/client/index.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/src/api/resources/betaVmManagement/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/betaVmManagement/index.ts b/src/api/resources/betaVmManagement/index.ts new file mode 100644 index 0000000..5ec7692 --- /dev/null +++ b/src/api/resources/betaVmManagement/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/browser/client/Client.ts b/src/api/resources/browser/client/Client.ts index 7b786cb..7f092ed 100644 --- a/src/api/resources/browser/client/Client.ts +++ b/src/api/resources/browser/client/Client.ts @@ -32,6 +32,7 @@ export class Browser { /** * @param {string} instanceId + * @param {Scrapybara.BrowserStartRequest} request * @param {Browser.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Scrapybara.UnprocessableEntityError} @@ -41,8 +42,15 @@ export class Browser { */ public async start( instanceId: string, + request: Scrapybara.BrowserStartRequest = {}, requestOptions?: Browser.RequestOptions, ): Promise { + const { separateStream } = request; + const _queryParams: Record = {}; + if (separateStream != null) { + _queryParams["separate_stream"] = separateStream.toString(); + } + const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, @@ -52,14 +60,15 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), ...requestOptions?.headers, }, contentType: "application/json", + queryParameters: _queryParams, requestType: "json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, maxRetries: requestOptions?.maxRetries, @@ -132,8 +141,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -190,6 +199,86 @@ export class Browser { } } + /** + * @param {string} instanceId + * @param {Browser.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.browser.getStreamUrl("instance_id") + */ + public async getStreamUrl( + instanceId: string, + requestOptions?: Browser.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/instance/${encodeURIComponent(instanceId)}/browser/stream_url`, + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.BrowserGetStreamUrlResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling GET /v1/instance/{instance_id}/browser/stream_url.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + /** * @param {string} instanceId * @param {Browser.RequestOptions} requestOptions - Request-specific configuration. @@ -212,8 +301,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -300,8 +389,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -392,8 +481,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -480,8 +569,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -561,8 +650,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/browser/client/requests/BrowserStartRequest.ts b/src/api/resources/browser/client/requests/BrowserStartRequest.ts new file mode 100644 index 0000000..2b4bcb7 --- /dev/null +++ b/src/api/resources/browser/client/requests/BrowserStartRequest.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface BrowserStartRequest { + separateStream?: boolean; +} diff --git a/src/api/resources/browser/client/requests/index.ts b/src/api/resources/browser/client/requests/index.ts index 612773b..252755c 100644 --- a/src/api/resources/browser/client/requests/index.ts +++ b/src/api/resources/browser/client/requests/index.ts @@ -1,3 +1,4 @@ +export { type BrowserStartRequest } from "./BrowserStartRequest"; export { type BrowserSaveAuthRequest } from "./BrowserSaveAuthRequest"; export { type BrowserModifyAuthRequest } from "./BrowserModifyAuthRequest"; export { type BrowserAuthenticateRequest } from "./BrowserAuthenticateRequest"; diff --git a/src/api/resources/code/client/Client.ts b/src/api/resources/code/client/Client.ts index 5867af5..38fae5c 100644 --- a/src/api/resources/code/client/Client.ts +++ b/src/api/resources/code/client/Client.ts @@ -56,8 +56,8 @@ export class Code { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/env/client/Client.ts b/src/api/resources/env/client/Client.ts index a0c70e1..8281904 100644 --- a/src/api/resources/env/client/Client.ts +++ b/src/api/resources/env/client/Client.ts @@ -49,8 +49,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -135,8 +135,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -220,8 +220,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 2b556c5..adabd70 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -4,6 +4,7 @@ export * as browser from "./browser"; export * as code from "./code"; export * as notebook from "./notebook"; export * as env from "./env"; +export * as betaVmManagement from "./betaVmManagement"; export * from "./instance/client/requests"; export * from "./browser/client/requests"; export * from "./code/client/requests"; diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index ba4008b..6494615 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -54,8 +54,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -134,8 +134,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -473,8 +473,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -566,8 +566,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -648,8 +648,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -728,8 +728,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -816,8 +816,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -875,6 +875,185 @@ export class Instance { } } + /** + * Expose a port on the instance with a public-facing URL. + * + * This endpoint creates a temporary public URL that routes traffic to the specified port on the instance. + * + * @param {string} instanceId + * @param {Scrapybara.ExposePortRequest} request + * @param {Instance.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.instance.exposePort("instance_id", { + * port: 1 + * }) + */ + public async exposePort( + instanceId: string, + request: Scrapybara.ExposePortRequest, + requestOptions?: Instance.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/instance/${encodeURIComponent(instanceId)}/expose_port`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.ExposePortRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ExposePortResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/instance/{instance_id}/expose_port.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Deploy a directory from the instance to Netlify. + * + * Args: + * directory_path: Path to the directory on the instance to deploy + * + * @param {string} instanceId + * @param {Scrapybara.NetlifyDeployRequest} request + * @param {Instance.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.instance.deployToNetlify("instance_id", { + * directoryPath: "directory_path" + * }) + */ + public async deployToNetlify( + instanceId: string, + request: Scrapybara.NetlifyDeployRequest, + requestOptions?: Instance.RequestOptions, + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/instance/${encodeURIComponent(instanceId)}/deploy_to_netlify`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.NetlifyDeployRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.NetlifyDeployResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/instance/{instance_id}/deploy_to_netlify.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["SCRAPYBARA_API_KEY"]; return { "x-api-key": apiKeyValue }; diff --git a/src/api/resources/instance/client/requests/ExposePortRequest.ts b/src/api/resources/instance/client/requests/ExposePortRequest.ts new file mode 100644 index 0000000..3c1f955 --- /dev/null +++ b/src/api/resources/instance/client/requests/ExposePortRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * port: 1 + * } + */ +export interface ExposePortRequest { + port: number; +} diff --git a/src/api/resources/instance/client/requests/NetlifyDeployRequest.ts b/src/api/resources/instance/client/requests/NetlifyDeployRequest.ts new file mode 100644 index 0000000..aeba43f --- /dev/null +++ b/src/api/resources/instance/client/requests/NetlifyDeployRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * directoryPath: "directory_path" + * } + */ +export interface NetlifyDeployRequest { + directoryPath: string; +} diff --git a/src/api/resources/instance/client/requests/index.ts b/src/api/resources/instance/client/requests/index.ts index e7ad8d7..98534da 100644 --- a/src/api/resources/instance/client/requests/index.ts +++ b/src/api/resources/instance/client/requests/index.ts @@ -3,3 +3,5 @@ export { type EditRequest } from "./EditRequest"; export { type FileRequest } from "./FileRequest"; export { type BodyUploadV1InstanceInstanceIdUploadPost } from "./BodyUploadV1InstanceInstanceIdUploadPost"; export { type InstanceResumeRequest } from "./InstanceResumeRequest"; +export { type ExposePortRequest } from "./ExposePortRequest"; +export { type NetlifyDeployRequest } from "./NetlifyDeployRequest"; diff --git a/src/api/resources/notebook/client/Client.ts b/src/api/resources/notebook/client/Client.ts index 112c9b2..df61ed6 100644 --- a/src/api/resources/notebook/client/Client.ts +++ b/src/api/resources/notebook/client/Client.ts @@ -52,8 +52,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -560,8 +560,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.0", - "User-Agent": "scrapybara/2.5.0", + "X-Fern-SDK-Version": "2.6.0-beta.0", + "User-Agent": "scrapybara/2.6.0-beta.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/types/BrowserGetStreamUrlResponse.ts b/src/api/types/BrowserGetStreamUrlResponse.ts new file mode 100644 index 0000000..6b328a1 --- /dev/null +++ b/src/api/types/BrowserGetStreamUrlResponse.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface BrowserGetStreamUrlResponse { + streamUrl: string; +} diff --git a/src/api/types/DeleteBrowserAuthResponse.ts b/src/api/types/DeleteBrowserAuthResponse.ts new file mode 100644 index 0000000..5af5bde --- /dev/null +++ b/src/api/types/DeleteBrowserAuthResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface DeleteBrowserAuthResponse { + status: string; + authStateId: string; +} diff --git a/src/api/types/ExposePortResponse.ts b/src/api/types/ExposePortResponse.ts new file mode 100644 index 0000000..3134cd8 --- /dev/null +++ b/src/api/types/ExposePortResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ExposePortResponse { + status: string; + publicUrl: string; +} diff --git a/src/api/types/NetlifyDeployResponse.ts b/src/api/types/NetlifyDeployResponse.ts new file mode 100644 index 0000000..b8bb8c4 --- /dev/null +++ b/src/api/types/NetlifyDeployResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Response model for netlify deployment. + */ +export interface NetlifyDeployResponse { + output?: string; + error?: string; + siteUrl?: string; +} diff --git a/src/api/types/SnapshotResponse.ts b/src/api/types/SnapshotResponse.ts new file mode 100644 index 0000000..8a119e8 --- /dev/null +++ b/src/api/types/SnapshotResponse.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SnapshotResponse { + snapshotId: string; +} diff --git a/src/api/types/StartBrowserResponse.ts b/src/api/types/StartBrowserResponse.ts index 5cc6d12..c94b414 100644 --- a/src/api/types/StartBrowserResponse.ts +++ b/src/api/types/StartBrowserResponse.ts @@ -4,4 +4,5 @@ export interface StartBrowserResponse { cdpUrl: string; + streamUrl?: string; } diff --git a/src/api/types/SuccessResponse.ts b/src/api/types/SuccessResponse.ts new file mode 100644 index 0000000..e489bd0 --- /dev/null +++ b/src/api/types/SuccessResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SuccessResponse { + success: boolean; + message: string; +} diff --git a/src/serialization/client/requests/DeploymentConfig.ts b/src/serialization/client/requests/DeploymentConfig.ts index eabcdfc..9c9eb02 100644 --- a/src/serialization/client/requests/DeploymentConfig.ts +++ b/src/serialization/client/requests/DeploymentConfig.ts @@ -18,6 +18,8 @@ export const DeploymentConfig: core.serialization.Schema< core.serialization.list(core.serialization.string()).optional(), ), resolution: core.serialization.list(core.serialization.number()).optional(), + backend: core.serialization.string().optional(), + snapshotId: core.serialization.property("snapshot_id", core.serialization.string().optional()), }); export declare namespace DeploymentConfig { @@ -26,5 +28,7 @@ export declare namespace DeploymentConfig { timeout_hours?: number | null; blocked_domains?: string[] | null; resolution?: number[] | null; + backend?: string | null; + snapshot_id?: string | null; } } diff --git a/src/serialization/resources/instance/client/requests/ExposePortRequest.ts b/src/serialization/resources/instance/client/requests/ExposePortRequest.ts new file mode 100644 index 0000000..6218f74 --- /dev/null +++ b/src/serialization/resources/instance/client/requests/ExposePortRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Scrapybara from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const ExposePortRequest: core.serialization.Schema< + serializers.ExposePortRequest.Raw, + Scrapybara.ExposePortRequest +> = core.serialization.object({ + port: core.serialization.number(), +}); + +export declare namespace ExposePortRequest { + export interface Raw { + port: number; + } +} diff --git a/src/serialization/resources/instance/client/requests/NetlifyDeployRequest.ts b/src/serialization/resources/instance/client/requests/NetlifyDeployRequest.ts new file mode 100644 index 0000000..6529eb1 --- /dev/null +++ b/src/serialization/resources/instance/client/requests/NetlifyDeployRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Scrapybara from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const NetlifyDeployRequest: core.serialization.Schema< + serializers.NetlifyDeployRequest.Raw, + Scrapybara.NetlifyDeployRequest +> = core.serialization.object({ + directoryPath: core.serialization.property("directory_path", core.serialization.string()), +}); + +export declare namespace NetlifyDeployRequest { + export interface Raw { + directory_path: string; + } +} diff --git a/src/serialization/resources/instance/client/requests/index.ts b/src/serialization/resources/instance/client/requests/index.ts index 761c04a..76c1b5a 100644 --- a/src/serialization/resources/instance/client/requests/index.ts +++ b/src/serialization/resources/instance/client/requests/index.ts @@ -1,3 +1,5 @@ export { BashRequest } from "./BashRequest"; export { EditRequest } from "./EditRequest"; export { FileRequest } from "./FileRequest"; +export { ExposePortRequest } from "./ExposePortRequest"; +export { NetlifyDeployRequest } from "./NetlifyDeployRequest"; diff --git a/src/serialization/types/BrowserGetStreamUrlResponse.ts b/src/serialization/types/BrowserGetStreamUrlResponse.ts new file mode 100644 index 0000000..2ae7f58 --- /dev/null +++ b/src/serialization/types/BrowserGetStreamUrlResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const BrowserGetStreamUrlResponse: core.serialization.ObjectSchema< + serializers.BrowserGetStreamUrlResponse.Raw, + Scrapybara.BrowserGetStreamUrlResponse +> = core.serialization.object({ + streamUrl: core.serialization.property("stream_url", core.serialization.string()), +}); + +export declare namespace BrowserGetStreamUrlResponse { + export interface Raw { + stream_url: string; + } +} diff --git a/src/serialization/types/DeleteBrowserAuthResponse.ts b/src/serialization/types/DeleteBrowserAuthResponse.ts new file mode 100644 index 0000000..aad6a49 --- /dev/null +++ b/src/serialization/types/DeleteBrowserAuthResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const DeleteBrowserAuthResponse: core.serialization.ObjectSchema< + serializers.DeleteBrowserAuthResponse.Raw, + Scrapybara.DeleteBrowserAuthResponse +> = core.serialization.object({ + status: core.serialization.string(), + authStateId: core.serialization.property("auth_state_id", core.serialization.string()), +}); + +export declare namespace DeleteBrowserAuthResponse { + export interface Raw { + status: string; + auth_state_id: string; + } +} diff --git a/src/serialization/types/ExposePortResponse.ts b/src/serialization/types/ExposePortResponse.ts new file mode 100644 index 0000000..4afe7d6 --- /dev/null +++ b/src/serialization/types/ExposePortResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const ExposePortResponse: core.serialization.ObjectSchema< + serializers.ExposePortResponse.Raw, + Scrapybara.ExposePortResponse +> = core.serialization.object({ + status: core.serialization.string(), + publicUrl: core.serialization.property("public_url", core.serialization.string()), +}); + +export declare namespace ExposePortResponse { + export interface Raw { + status: string; + public_url: string; + } +} diff --git a/src/serialization/types/NetlifyDeployResponse.ts b/src/serialization/types/NetlifyDeployResponse.ts new file mode 100644 index 0000000..d69725e --- /dev/null +++ b/src/serialization/types/NetlifyDeployResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const NetlifyDeployResponse: core.serialization.ObjectSchema< + serializers.NetlifyDeployResponse.Raw, + Scrapybara.NetlifyDeployResponse +> = core.serialization.object({ + output: core.serialization.string().optional(), + error: core.serialization.string().optional(), + siteUrl: core.serialization.property("site_url", core.serialization.string().optional()), +}); + +export declare namespace NetlifyDeployResponse { + export interface Raw { + output?: string | null; + error?: string | null; + site_url?: string | null; + } +} diff --git a/src/serialization/types/SnapshotResponse.ts b/src/serialization/types/SnapshotResponse.ts new file mode 100644 index 0000000..a9c2149 --- /dev/null +++ b/src/serialization/types/SnapshotResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const SnapshotResponse: core.serialization.ObjectSchema< + serializers.SnapshotResponse.Raw, + Scrapybara.SnapshotResponse +> = core.serialization.object({ + snapshotId: core.serialization.property("snapshot_id", core.serialization.string()), +}); + +export declare namespace SnapshotResponse { + export interface Raw { + snapshot_id: string; + } +} diff --git a/src/serialization/types/StartBrowserResponse.ts b/src/serialization/types/StartBrowserResponse.ts index e25a1c0..0a857ff 100644 --- a/src/serialization/types/StartBrowserResponse.ts +++ b/src/serialization/types/StartBrowserResponse.ts @@ -11,10 +11,12 @@ export const StartBrowserResponse: core.serialization.ObjectSchema< Scrapybara.StartBrowserResponse > = core.serialization.object({ cdpUrl: core.serialization.property("cdp_url", core.serialization.string()), + streamUrl: core.serialization.property("stream_url", core.serialization.string().optional()), }); export declare namespace StartBrowserResponse { export interface Raw { cdp_url: string; + stream_url?: string | null; } } diff --git a/src/serialization/types/SuccessResponse.ts b/src/serialization/types/SuccessResponse.ts new file mode 100644 index 0000000..1cf46fa --- /dev/null +++ b/src/serialization/types/SuccessResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Scrapybara from "../../api/index"; +import * as core from "../../core"; + +export const SuccessResponse: core.serialization.ObjectSchema< + serializers.SuccessResponse.Raw, + Scrapybara.SuccessResponse +> = core.serialization.object({ + success: core.serialization.boolean(), + message: core.serialization.string(), +}); + +export declare namespace SuccessResponse { + export interface Raw { + success: boolean; + message: string; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 706c909..10ddfd5 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -4,16 +4,19 @@ export * from "./BashResponse"; export * from "./BrowserAuthenticateResponse"; export * from "./BrowserGetCdpUrlResponse"; export * from "./BrowserGetCurrentUrlResponse"; +export * from "./BrowserGetStreamUrlResponse"; export * from "./CellType"; export * from "./Button"; export * from "./ClickMouseActionClickType"; export * from "./ClickMouseAction"; export * from "./ComputerResponse"; +export * from "./DeleteBrowserAuthResponse"; export * from "./DragMouseAction"; export * from "./EditResponse"; export * from "./EnvGetResponse"; export * from "./EnvResponse"; export * from "./ExecuteCellRequest"; +export * from "./ExposePortResponse"; export * from "./FileResponse"; export * from "./GetCursorPositionAction"; export * from "./GetInstanceResponseInstanceType"; @@ -25,14 +28,17 @@ export * from "./InstanceScreenshotResponse"; export * from "./KernelInfo"; export * from "./ModifyBrowserAuthResponse"; export * from "./MoveMouseAction"; +export * from "./NetlifyDeployResponse"; export * from "./Notebook"; export * from "./NotebookCell"; export * from "./PressKeyAction"; export * from "./SaveBrowserAuthResponse"; export * from "./ScrollAction"; +export * from "./SnapshotResponse"; export * from "./StartBrowserResponse"; export * from "./StopBrowserResponse"; export * from "./StopInstanceResponse"; +export * from "./SuccessResponse"; export * from "./TakeScreenshotAction"; export * from "./TypeTextAction"; export * from "./UploadResponse"; diff --git a/src/version.ts b/src/version.ts index b54c0db..94285ee 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.5.0"; +export const SDK_VERSION = "2.6.0-beta.0"; diff --git a/yarn.lock b/yarn.lock index c959aca..4298a63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -656,9 +656,9 @@ form-data "^4.0.0" "@types/node@*": - version "22.14.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.14.0.tgz#d3bfa3936fef0dbacd79ea3eb17d521c628bb47e" - integrity sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA== + version "22.14.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.14.1.tgz#53b54585cec81c21eee3697521e31312d6ca1e6f" + integrity sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw== dependencies: undici-types "~6.21.0" @@ -1114,9 +1114,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001688: - version "1.0.30001712" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001712.tgz#41ee150f12de11b5f57c5889d4f30deb451deedf" - integrity sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig== + version "1.0.30001714" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001714.tgz#cfd27ff07e6fa20a0f45c7a10d28a0ffeaba2122" + integrity sha512-mtgapdwDLSSBnCI3JokHM7oEQBLxiJKVRtg10AxM1AyeiKcM96f0Mkbqeq+1AbiCtvMcHRulAAEMu693JrSWqg== chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0: version "4.1.2" @@ -1308,9 +1308,9 @@ ejs@^3.1.10: jake "^10.8.5" electron-to-chromium@^1.5.73: - version "1.5.134" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.134.tgz#d90008c4f8a506c1a6d1b329f922d83e18904101" - integrity sha512-zSwzrLg3jNP3bwsLqWHmS5z2nIOQ5ngMnfMZOWWtXnqqQkPVyOipxK98w+1beLw1TB+EImPNcG8wVP/cLVs2Og== + version "1.5.137" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.137.tgz#53a7fef3ea9f7eb5fcf704454050ff930c43ed92" + integrity sha512-/QSJaU2JyIuTbbABAo/crOs+SuAZLS+fVVS10PVrIT9hrRkmZl8Hb0xPSkKRUUWHQtYzXHpQUW3Dy5hwMzGZkA== emittery@^0.13.1: version "0.13.1" @@ -2947,9 +2947,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.1.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.3.1.tgz#2e459e1f94a833bd8216ba4b045fac948e265937" - integrity sha512-FT2PIRtZABwl6+ZCry8IY7JZ3xMuppsEV9qFVHOVe8jDzggwUZ9TsM4chyJxL9yi6LvkqcZYU3LmapEE454zBQ== + version "29.3.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.3.2.tgz#0576cdf0a507f811fe73dcd16d135ce89f8156cb" + integrity sha512-bJJkrWc6PjFVz5g2DGCNUo8z7oFEYaz1xP1NpeDU7KNLMWPpEyV8Chbpkn8xjzgRDpQhnGMyvyldoL7h8JXyug== dependencies: bs-logger "^0.2.6" ejs "^3.1.10" @@ -2959,7 +2959,7 @@ ts-jest@^29.1.1: lodash.memoize "^4.1.2" make-error "^1.3.6" semver "^7.7.1" - type-fest "^4.38.0" + type-fest "^4.39.1" yargs-parser "^21.1.1" ts-loader@^9.5.1: @@ -2983,10 +2983,10 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^4.38.0: - version "4.39.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.39.1.tgz#7521f6944e279abaf79cf60cfbc4823f4858083e" - integrity sha512-uW9qzd66uyHYxwyVBYiwS4Oi0qZyUqwjU+Oevr6ZogYiXt99EOYtwvzMSLw1c3lYo2HzJsep/NB23iEVEgjG/w== +type-fest@^4.39.1: + version "4.40.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.40.0.tgz#62bc09caccb99a75e1ad6b9b4653e8805e5e1eee" + integrity sha512-ABHZ2/tS2JkvH1PEjxFDTUWC8dB5OsIGZP4IFLhR293GqT5Y5qB1WwL2kMPYhQW9DVgVD8Hd7I8gjwPIf5GFkw== typescript@~5.7.2: version "5.7.3" @@ -3071,9 +3071,9 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.97.1: - version "5.99.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.99.3.tgz#b22c8e824c700c5470c4a9027a7cf9a4242807c6" - integrity sha512-Sb8csGqLL9kY7nqHyJq9Yw1sx+/mpBLXuqM6edfjFOpODiFjzkLUKF08s5WxDxWg9akMklrbTsVsoj7jBULhfw== + version "5.99.5" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.99.5.tgz#86e3b3a5a03377ea5da271c929934003f5ac5dd8" + integrity sha512-q+vHBa6H9qwBLUlHL4Y7L0L1/LlyBKZtS9FHNCQmtayxjI5RKC9yD8gpvLeqGv5lCQp1Re04yi0MF40pf30Pvg== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.6" From 715d9ba5b5fe2625f0df04f7f396ed03bde551a7 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:11:46 -0700 Subject: [PATCH 02/20] add types --- src/api/types/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 0625fda..4851755 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -41,3 +41,9 @@ export * from "./TypeTextAction"; export * from "./ValidationErrorLocItem"; export * from "./ValidationError"; export * from "./WaitAction"; +export * from "./SnapshotResponse"; +export * from "./SuccessResponse"; +export * from "./BrowserGetStreamUrlResponse"; +export * from "./ExposePortResponse"; +export * from "./NetlifyDeployResponse"; +export * from "./DeleteBrowserAuthResponse"; From 587e8b975a655e8a47a267eda9d93e36a51732ea Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:18:20 -0700 Subject: [PATCH 03/20] update browser start --- src/ScrapybaraClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 287ffb5..827a4b8 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -690,8 +690,8 @@ export class Browser { private readonly fern: FernClient, ) {} - public async start(requestOptions?: FernClient.RequestOptions): Promise { - return await this.fern.browser.start(this.instanceId, requestOptions); + public async start(request: Scrapybara.BrowserStartRequest, requestOptions?: FernClient.RequestOptions): Promise { + return await this.fern.browser.start(this.instanceId, request, requestOptions); } public async getCdpUrl(requestOptions?: FernClient.RequestOptions): Promise { From 64b1ab636451404e3fe76b0e4b5f483488352cf8 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:21:05 -0700 Subject: [PATCH 04/20] getstreamurl (and stop?) --- src/ScrapybaraClient.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 827a4b8..249671a 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -676,6 +676,16 @@ export class BrowserInstance extends BaseInstance { ): Promise { return await this.fern.browser.authenticate(this.id, request, requestOptions); } + + public async getStreamUrl( + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.browser.getStreamUrl(this.id, requestOptions); + } + + public async stop(requestOptions?: FernClient.RequestOptions): Promise { + return await this.fern.browser.stop(this.id, requestOptions); + } } export class WindowsInstance extends BaseInstance { @@ -725,6 +735,12 @@ export class Browser { return await this.fern.browser.authenticate(this.instanceId, request, requestOptions); } + public async getStreamUrl( + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.browser.getStreamUrl(this.instanceId, requestOptions); + } + public async stop(requestOptions?: FernClient.RequestOptions): Promise { return await this.fern.browser.stop(this.instanceId, requestOptions); } From 47ac72e58ef718a7dd9fe8b1b937ab7007937c3e Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:23:51 -0700 Subject: [PATCH 05/20] fix browser start --- src/ScrapybaraClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 249671a..3d1fbbc 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -700,7 +700,7 @@ export class Browser { private readonly fern: FernClient, ) {} - public async start(request: Scrapybara.BrowserStartRequest, requestOptions?: FernClient.RequestOptions): Promise { + public async start(request: Scrapybara.BrowserStartRequest = {}, requestOptions?: FernClient.RequestOptions): Promise { return await this.fern.browser.start(this.instanceId, request, requestOptions); } From fd9332f462a5c98b59270688152a00b5f63063d9 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:31:59 -0700 Subject: [PATCH 06/20] separate stream --- tests/custom.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 219927e..9a05abd 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -42,7 +42,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start(); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -75,7 +75,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start(); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -198,7 +198,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start(); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); From 0d07817e20040a8969767ee60a79040ffb29d4fb Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 10:48:23 -0700 Subject: [PATCH 07/20] beta class --- src/ScrapybaraClient.ts | 32 +++++++++++++ tests/custom.test.ts | 100 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 128 insertions(+), 4 deletions(-) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 3d1fbbc..0b44bc3 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -53,13 +53,45 @@ export declare namespace ScrapybaraClient { type RequestOptions = FernClient.RequestOptions; } +export class Beta { + constructor( + private readonly fern: FernClient, + ) {} + + public async takeSnapshot( + instanceId: string, + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.betaVmManagement.takeSnapshot(instanceId, requestOptions); + } + + public async warmupSnapshot( + snapshotId: string, + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.betaVmManagement.warmupSnapshot(snapshotId, requestOptions); + } + + public async deleteSnapshot( + snapshotId: string, + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.betaVmManagement.deleteSnapshot(snapshotId, requestOptions); + } +} + export class ScrapybaraClient { private _fern: FernClient; + private _beta: Beta | undefined; constructor(readonly _options?: ScrapybaraClient.Options) { this._fern = new FernClient(_options); } + public get beta(): Beta { + return (this._beta ??= new Beta(this._fern)); + } + public async startUbuntu( request: Omit = {}, requestOptions?: ScrapybaraClient.RequestOptions, diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 9a05abd..bf87e6f 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -1,4 +1,4 @@ -import { ScrapybaraClient } from "../src"; +import { ScrapybaraClient, UbuntuInstance } from "../src"; import { anthropic, UBUNTU_SYSTEM_PROMPT as ANTHROPIC_UBUNTU_SYSTEM_PROMPT, @@ -42,7 +42,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: true }); + await ubuntuInstance.browser.start({ separateStream: false }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -75,7 +75,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: true }); + await ubuntuInstance.browser.start({ separateStream: false }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -198,7 +198,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: true }); + await ubuntuInstance.browser.start({ separateStream: false }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -305,4 +305,96 @@ describe("test", () => { fs.unlinkSync(testFilePath); await instance.stop(); }, 60000); + + it("test beta vm management", async () => { + // Start a rodent instance + const instance = await client.startUbuntu({ backend: "rodent" }); + assert(instance.id !== undefined); + + try { + // Take a snapshot + const snapshotResponse = await client.beta.takeSnapshot(instance.id); + assert(snapshotResponse !== undefined); + assert(snapshotResponse.snapshotId !== undefined); + const snapshotId = snapshotResponse.snapshotId; + console.log(`Created snapshot with ID: ${snapshotId}`); + + // Warmup the snapshot + const warmupResponse = await client.beta.warmupSnapshot(snapshotId); + assert(warmupResponse !== undefined); + assert(warmupResponse.success === true); + + // Delete the snapshot + const deleteResponse = await client.beta.deleteSnapshot(snapshotId); + assert(deleteResponse !== undefined); + assert(deleteResponse.success === true); + } finally { + await instance.stop(); + } + }, 120000); + + it("test restore from snapshot", async () => { + // Start original instance + const originalInstance = await client.startUbuntu({ backend: "rodent" }); + assert(originalInstance.id !== undefined); + console.log(`Started original instance: ${originalInstance.id}`); + + let snapshotId: string | null = null; + let restoredInstance: UbuntuInstance | null = null; + + try { + // Create a file to verify restoration later + const testMarker = `test-marker-${Date.now()}`; + await originalInstance.bash({ command: `echo '${testMarker}' > /tmp/snapshot-test-file` }); + + // Take a snapshot + const snapshotResponse = await client.beta.takeSnapshot(originalInstance.id); + assert(snapshotResponse !== undefined); + assert(snapshotResponse.snapshotId !== undefined); + + snapshotId = snapshotResponse.snapshotId; + console.log(`Created snapshot with ID: ${snapshotId}`); + + // Warmup the snapshot (optional but recommended) + await client.beta.warmupSnapshot(snapshotId); + + // Stop the original instance + await originalInstance.stop(); + + // Start a new instance from the snapshot + restoredInstance = await client.startUbuntu({ snapshotId: snapshotId, backend: "rodent" }); + assert(restoredInstance.id !== undefined); + console.log(`Started restored instance: ${restoredInstance.id}`); + + // Verify the test file exists with our marker + const fileContent = await restoredInstance.bash({ command: "cat /tmp/snapshot-test-file" }); + assert(fileContent.output?.includes(testMarker)); + console.log("Successfully verified snapshot restoration!"); + } finally { + // Clean up resources + if (originalInstance) { + try { + await originalInstance.stop(); + } catch (error) { + console.error("Error stopping original instance:", error); + } + } + + if (restoredInstance) { + try { + await restoredInstance.stop(); + } catch (error) { + console.error("Error stopping restored instance:", error); + } + } + + if (snapshotId) { + try { + await client.beta.deleteSnapshot(snapshotId); + } catch (error) { + console.error("Error deleting snapshot:", error); + } + } + } + }, 240000); }); From 5b5f174801b1138f6d42ae94ba5531c1ccf0fe3d Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 12:21:57 -0700 Subject: [PATCH 08/20] remove stop --- src/ScrapybaraClient.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 0b44bc3..9b47f91 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -714,10 +714,6 @@ export class BrowserInstance extends BaseInstance { ): Promise { return await this.fern.browser.getStreamUrl(this.id, requestOptions); } - - public async stop(requestOptions?: FernClient.RequestOptions): Promise { - return await this.fern.browser.stop(this.id, requestOptions); - } } export class WindowsInstance extends BaseInstance { From b1753a550310c75f32bce8e454642c72c21f272b Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 12:51:25 -0700 Subject: [PATCH 09/20] skip all tests but snapshotting --- tests/custom.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/custom.test.ts b/tests/custom.test.ts index bf87e6f..723bd23 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -31,7 +31,7 @@ describe("test", () => { } }); - it("ubuntu test", async () => { + it.skip("ubuntu test", async () => { const ubuntuInstance = await client.startUbuntu(); console.log((await ubuntuInstance.getStreamUrl()).streamUrl); assert(ubuntuInstance.id !== undefined); @@ -42,7 +42,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: false }); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -75,7 +75,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: false }); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -97,7 +97,7 @@ describe("test", () => { await ubuntuInstance.stop(); }, 600000); - it("browser test", async () => { + it.skip("browser test", async () => { const browserInstance = await client.startBrowser(); console.log((await browserInstance.getStreamUrl()).streamUrl); assert(browserInstance.id !== undefined); @@ -187,7 +187,7 @@ describe("test", () => { await windowsInstance.stop(); }, 600000); - it("ubuntu test with openai", async () => { + it.skip("ubuntu test with openai", async () => { const ubuntuInstance = await client.startUbuntu(); console.log((await ubuntuInstance.getStreamUrl()).streamUrl); assert(ubuntuInstance.id !== undefined); @@ -198,7 +198,7 @@ describe("test", () => { const screenshotResponse = await ubuntuInstance.screenshot(); assert(screenshotResponse.base64Image !== undefined); - await ubuntuInstance.browser.start({ separateStream: false }); + await ubuntuInstance.browser.start({ separateStream: true }); const cdpUrl = await ubuntuInstance.browser.getCdpUrl(); assert(cdpUrl.cdpUrl !== undefined); @@ -220,7 +220,7 @@ describe("test", () => { await ubuntuInstance.stop(); }, 600000); - it("browser test with openai", async () => { + it.skip("browser test with openai", async () => { const browserInstance = await client.startBrowser(); console.log((await browserInstance.getStreamUrl()).streamUrl); assert(browserInstance.id !== undefined); @@ -279,7 +279,7 @@ describe("test", () => { await windowsInstance.stop(); }, 600000); - it("test file upload and download", async () => { + it.skip("test file upload and download", async () => { // Start an Ubuntu instance const instance = await client.startUbuntu(); From 528db83121fe03eee03f8664b32c2e7e375f09e3 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 12:54:28 -0700 Subject: [PATCH 10/20] skip tests --- tests/custom.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 723bd23..6c5bbe3 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -306,7 +306,7 @@ describe("test", () => { await instance.stop(); }, 60000); - it("test beta vm management", async () => { + it.skip("test beta vm management", async () => { // Start a rodent instance const instance = await client.startUbuntu({ backend: "rodent" }); assert(instance.id !== undefined); @@ -333,7 +333,7 @@ describe("test", () => { } }, 120000); - it("test restore from snapshot", async () => { + it.skip("test restore from snapshot", async () => { // Start original instance const originalInstance = await client.startUbuntu({ backend: "rodent" }); assert(originalInstance.id !== undefined); From 707be37348ec1b4d5db9b83ca0658bddf7a02fc1 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 16 Apr 2025 12:57:34 -0700 Subject: [PATCH 11/20] dont skip --- tests/custom.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 6c5bbe3..723bd23 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -306,7 +306,7 @@ describe("test", () => { await instance.stop(); }, 60000); - it.skip("test beta vm management", async () => { + it("test beta vm management", async () => { // Start a rodent instance const instance = await client.startUbuntu({ backend: "rodent" }); assert(instance.id !== undefined); @@ -333,7 +333,7 @@ describe("test", () => { } }, 120000); - it.skip("test restore from snapshot", async () => { + it("test restore from snapshot", async () => { // Start original instance const originalInstance = await client.startUbuntu({ backend: "rodent" }); assert(originalInstance.id !== undefined); From f5c1797dcafd1d12a43ab46562e5bc9e261c5e9c Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Fri, 18 Apr 2025 11:50:28 -0700 Subject: [PATCH 12/20] fix package json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c391ebf..1906c7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "-beta.0", + "version": "2.6.0-beta.1", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", From d4ce3d3ed45e0543f862945a3ad1c802e1dd4413 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Fri, 18 Apr 2025 14:56:27 -0700 Subject: [PATCH 13/20] expose and deploy --- src/ScrapybaraClient.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 9b47f91..0ac2b75 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -635,6 +635,26 @@ export class BaseInstance { ): Promise { return await this.fern.instance.upload(file, this.id, request, requestOptions); } + + /** + * Expose a port on the instance with a public-facing URL. + */ + public async exposePort( + request: Scrapybara.ExposePortRequest, + requestOptions?: FernClient.RequestOptions + ): Promise { + return await this.fern.instance.exposePort(this.id, request, requestOptions); + } + + /** + * Deploy a directory from the instance to Netlify. + */ + public async deployToNetlify( + request: Scrapybara.NetlifyDeployRequest, + requestOptions?: FernClient.RequestOptions + ): Promise { + return await this.fern.instance.deployToNetlify(this.id, request, requestOptions); + } } export class UbuntuInstance extends BaseInstance { From e31ed93d35c62b85528c98e65d47d2d71ab23129 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Fri, 18 Apr 2025 15:12:23 -0700 Subject: [PATCH 14/20] 2.6.0-beta.2 --- package.json | 2 +- src/Client.ts | 20 ++++---- .../betaVmManagement/client/Client.ts | 12 ++--- src/api/resources/browser/client/Client.ts | 32 ++++++------- src/api/resources/code/client/Client.ts | 4 +- src/api/resources/env/client/Client.ts | 12 ++--- src/api/resources/instance/client/Client.ts | 48 +++++++++---------- src/api/resources/notebook/client/Client.ts | 28 +++++------ src/version.ts | 2 +- 9 files changed, 80 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index 1906c7c..c9a7256 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "2.6.0-beta.1", + "version": "2.6.0-beta.2", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index a176769..01f6128 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -89,8 +89,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -168,8 +168,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -244,8 +244,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -306,8 +306,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -377,8 +377,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/betaVmManagement/client/Client.ts b/src/api/resources/betaVmManagement/client/Client.ts index bd857df..8348248 100644 --- a/src/api/resources/betaVmManagement/client/Client.ts +++ b/src/api/resources/betaVmManagement/client/Client.ts @@ -54,8 +54,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -218,8 +218,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/browser/client/Client.ts b/src/api/resources/browser/client/Client.ts index 0cd0f69..79c271d 100644 --- a/src/api/resources/browser/client/Client.ts +++ b/src/api/resources/browser/client/Client.ts @@ -60,8 +60,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -141,8 +141,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -221,8 +221,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -389,8 +389,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -481,8 +481,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -569,8 +569,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -650,8 +650,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/code/client/Client.ts b/src/api/resources/code/client/Client.ts index 5a857b3..56c4306 100644 --- a/src/api/resources/code/client/Client.ts +++ b/src/api/resources/code/client/Client.ts @@ -56,8 +56,8 @@ export class Code { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/env/client/Client.ts b/src/api/resources/env/client/Client.ts index cdd7d29..0f4fc30 100644 --- a/src/api/resources/env/client/Client.ts +++ b/src/api/resources/env/client/Client.ts @@ -49,8 +49,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -135,8 +135,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -220,8 +220,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index d36c41d..721e6b9 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -54,8 +54,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -134,8 +134,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -473,8 +473,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -566,8 +566,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -648,8 +648,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -728,8 +728,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -816,8 +816,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -905,8 +905,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -995,8 +995,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/notebook/client/Client.ts b/src/api/resources/notebook/client/Client.ts index 8096243..caf28be 100644 --- a/src/api/resources/notebook/client/Client.ts +++ b/src/api/resources/notebook/client/Client.ts @@ -52,8 +52,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -560,8 +560,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.1", - "User-Agent": "scrapybara/2.6.0-beta.1", + "X-Fern-SDK-Version": "2.6.0-beta.2", + "User-Agent": "scrapybara/2.6.0-beta.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/version.ts b/src/version.ts index 8ed7192..dcd93ec 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.6.0-beta.1"; +export const SDK_VERSION = "2.6.0-beta.2"; From 674fc4770b930182ff621752ae2e1116e3d2f7e6 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Fri, 18 Apr 2025 15:13:49 -0700 Subject: [PATCH 15/20] 2.6.0-beta.3 lol --- package.json | 2 +- src/Client.ts | 20 ++++---- .../betaVmManagement/client/Client.ts | 12 ++--- src/api/resources/browser/client/Client.ts | 32 ++++++------- src/api/resources/code/client/Client.ts | 4 +- src/api/resources/env/client/Client.ts | 12 ++--- src/api/resources/instance/client/Client.ts | 48 +++++++++---------- src/api/resources/notebook/client/Client.ts | 28 +++++------ src/version.ts | 2 +- 9 files changed, 80 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index c9a7256..1ce5b5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "2.6.0-beta.2", + "version": "2.6.0-beta.3", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 01f6128..29a523f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -89,8 +89,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -168,8 +168,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -244,8 +244,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -306,8 +306,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -377,8 +377,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/betaVmManagement/client/Client.ts b/src/api/resources/betaVmManagement/client/Client.ts index 8348248..99db864 100644 --- a/src/api/resources/betaVmManagement/client/Client.ts +++ b/src/api/resources/betaVmManagement/client/Client.ts @@ -54,8 +54,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -218,8 +218,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/browser/client/Client.ts b/src/api/resources/browser/client/Client.ts index 79c271d..2c83918 100644 --- a/src/api/resources/browser/client/Client.ts +++ b/src/api/resources/browser/client/Client.ts @@ -60,8 +60,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -141,8 +141,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -221,8 +221,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -389,8 +389,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -481,8 +481,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -569,8 +569,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -650,8 +650,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/code/client/Client.ts b/src/api/resources/code/client/Client.ts index 56c4306..dba6e25 100644 --- a/src/api/resources/code/client/Client.ts +++ b/src/api/resources/code/client/Client.ts @@ -56,8 +56,8 @@ export class Code { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/env/client/Client.ts b/src/api/resources/env/client/Client.ts index 0f4fc30..2b5c452 100644 --- a/src/api/resources/env/client/Client.ts +++ b/src/api/resources/env/client/Client.ts @@ -49,8 +49,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -135,8 +135,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -220,8 +220,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index 721e6b9..5f8a4df 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -54,8 +54,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -134,8 +134,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -473,8 +473,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -566,8 +566,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -648,8 +648,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -728,8 +728,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -816,8 +816,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -905,8 +905,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -995,8 +995,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/notebook/client/Client.ts b/src/api/resources/notebook/client/Client.ts index caf28be..942e26c 100644 --- a/src/api/resources/notebook/client/Client.ts +++ b/src/api/resources/notebook/client/Client.ts @@ -52,8 +52,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -560,8 +560,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.2", - "User-Agent": "scrapybara/2.6.0-beta.2", + "X-Fern-SDK-Version": "2.6.0-beta.3", + "User-Agent": "scrapybara/2.6.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/version.ts b/src/version.ts index dcd93ec..395881b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.6.0-beta.2"; +export const SDK_VERSION = "2.6.0-beta.3"; From f3e565a09dff2e27eb727b93137e4fd66863e704 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 18:55:13 +0000 Subject: [PATCH 16/20] SDK regeneration --- package.json | 2 +- reference.md | 56 ++++++++ src/Client.ts | 16 +-- src/api/resources/browser/client/Client.ts | 28 ++-- src/api/resources/code/client/Client.ts | 4 +- src/api/resources/env/client/Client.ts | 12 +- src/api/resources/instance/client/Client.ts | 129 +++++++++++++++--- .../InstanceRescheduleTerminationRequest.ts | 11 ++ .../instance/client/requests/index.ts | 1 + src/api/resources/notebook/client/Client.ts | 28 ++-- src/version.ts | 2 +- yarn.lock | 40 +++--- 12 files changed, 243 insertions(+), 86 deletions(-) create mode 100644 src/api/resources/instance/client/requests/InstanceRescheduleTerminationRequest.ts diff --git a/package.json b/package.json index 59e846a..91f6fa6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "2.5.1", + "version": "2.6.0-beta.4", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", diff --git a/reference.md b/reference.md index 2ad5ea0..984e07c 100644 --- a/reference.md +++ b/reference.md @@ -605,6 +605,62 @@ await client.instance.resume("instance_id");
+
client.instance.rescheduleTermination(instanceId, { ...params }) -> Scrapybara.StopInstanceResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.instance.rescheduleTermination("instance_id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**instanceId:** `string` + +
+
+ +
+
+ +**request:** `Scrapybara.InstanceRescheduleTerminationRequest` + +
+
+ +
+
+ +**requestOptions:** `Instance.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Browser
client.browser.start(instanceId) -> Scrapybara.StartBrowserResponse diff --git a/src/Client.ts b/src/Client.ts index 8894257..4af4754 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -83,8 +83,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -162,8 +162,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -238,8 +238,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -300,8 +300,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/browser/client/Client.ts b/src/api/resources/browser/client/Client.ts index 03cde8b..8d9adfc 100644 --- a/src/api/resources/browser/client/Client.ts +++ b/src/api/resources/browser/client/Client.ts @@ -52,8 +52,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -132,8 +132,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -212,8 +212,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -300,8 +300,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -392,8 +392,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -480,8 +480,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -561,8 +561,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/code/client/Client.ts b/src/api/resources/code/client/Client.ts index 63ede2e..b83a5e8 100644 --- a/src/api/resources/code/client/Client.ts +++ b/src/api/resources/code/client/Client.ts @@ -56,8 +56,8 @@ export class Code { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/env/client/Client.ts b/src/api/resources/env/client/Client.ts index dc308b9..547cb2d 100644 --- a/src/api/resources/env/client/Client.ts +++ b/src/api/resources/env/client/Client.ts @@ -49,8 +49,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -135,8 +135,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -220,8 +220,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index e7b9c22..f305f4f 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -54,8 +54,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -134,8 +134,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -473,8 +473,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -566,8 +566,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -648,8 +648,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -728,8 +728,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -816,8 +816,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -875,6 +875,95 @@ export class Instance { } } + /** + * @param {string} instanceId + * @param {Scrapybara.InstanceRescheduleTerminationRequest} request + * @param {Instance.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Scrapybara.UnprocessableEntityError} + * + * @example + * await client.instance.rescheduleTermination("instance_id") + */ + public async rescheduleTermination( + instanceId: string, + request: Scrapybara.InstanceRescheduleTerminationRequest = {}, + requestOptions?: Instance.RequestOptions, + ): Promise { + const { newTimeoutHours } = request; + const _queryParams: Record = {}; + if (newTimeoutHours != null) { + _queryParams["new_timeout_hours"] = newTimeoutHours.toString(); + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.ScrapybaraEnvironment.Production, + `v1/instance/${encodeURIComponent(instanceId)}/reschedule_termination`, + ), + method: "POST", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "scrapybara", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...(await this._getCustomAuthorizationHeaders()), + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 600000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.StopInstanceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Scrapybara.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + ); + default: + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.ScrapybaraError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.ScrapybaraTimeoutError( + "Timeout exceeded when calling POST /v1/instance/{instance_id}/reschedule_termination.", + ); + case "unknown": + throw new errors.ScrapybaraError({ + message: _response.error.errorMessage, + }); + } + } + protected async _getCustomAuthorizationHeaders() { const apiKeyValue = (await core.Supplier.get(this._options.apiKey)) ?? process?.env["SCRAPYBARA_API_KEY"]; return { "x-api-key": apiKeyValue }; diff --git a/src/api/resources/instance/client/requests/InstanceRescheduleTerminationRequest.ts b/src/api/resources/instance/client/requests/InstanceRescheduleTerminationRequest.ts new file mode 100644 index 0000000..c542c05 --- /dev/null +++ b/src/api/resources/instance/client/requests/InstanceRescheduleTerminationRequest.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface InstanceRescheduleTerminationRequest { + newTimeoutHours?: number; +} diff --git a/src/api/resources/instance/client/requests/index.ts b/src/api/resources/instance/client/requests/index.ts index e7ad8d7..2e8e595 100644 --- a/src/api/resources/instance/client/requests/index.ts +++ b/src/api/resources/instance/client/requests/index.ts @@ -3,3 +3,4 @@ export { type EditRequest } from "./EditRequest"; export { type FileRequest } from "./FileRequest"; export { type BodyUploadV1InstanceInstanceIdUploadPost } from "./BodyUploadV1InstanceInstanceIdUploadPost"; export { type InstanceResumeRequest } from "./InstanceResumeRequest"; +export { type InstanceRescheduleTerminationRequest } from "./InstanceRescheduleTerminationRequest"; diff --git a/src/api/resources/notebook/client/Client.ts b/src/api/resources/notebook/client/Client.ts index c49daf7..9441c0a 100644 --- a/src/api/resources/notebook/client/Client.ts +++ b/src/api/resources/notebook/client/Client.ts @@ -52,8 +52,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -560,8 +560,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.5.1", - "User-Agent": "scrapybara/2.5.1", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/version.ts b/src/version.ts index c52870a..f238aaa 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.5.1"; +export const SDK_VERSION = "2.6.0-beta.4"; diff --git a/yarn.lock b/yarn.lock index b8f74e5..e98c6a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1114,9 +1114,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001688: - version "1.0.30001714" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001714.tgz#cfd27ff07e6fa20a0f45c7a10d28a0ffeaba2122" - integrity sha512-mtgapdwDLSSBnCI3JokHM7oEQBLxiJKVRtg10AxM1AyeiKcM96f0Mkbqeq+1AbiCtvMcHRulAAEMu693JrSWqg== + version "1.0.30001715" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001715.tgz#bd325a37ad366e3fe90827d74062807a34fbaeb2" + integrity sha512-7ptkFGMm2OAOgvZpwgA4yjQ5SQbrNVGdRjzH0pBdy1Fasvcr+KAeECmbCAECzTuDuoX0FCY8KzUxjf9+9kfZEw== chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0: version "4.1.2" @@ -1308,9 +1308,9 @@ ejs@^3.1.10: jake "^10.8.5" electron-to-chromium@^1.5.73: - version "1.5.138" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.138.tgz#319e775179bd0889ed96a04d4390d355fb315a44" - integrity sha512-FWlQc52z1dXqm+9cCJ2uyFgJkESd+16j6dBEjsgDNuHjBpuIzL8/lRc0uvh1k8RNI6waGo6tcy2DvwkTBJOLDg== + version "1.5.140" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.140.tgz#91d9279fe72963f22c5784cc7f3461b5fed34786" + integrity sha512-o82Rj+ONp4Ip7Cl1r7lrqx/pXhbp/lh9DpKcMNscFJdh8ebyRofnc7Sh01B4jx403RI0oqTBvlZ7OBIZLMr2+Q== emittery@^0.13.1: version "0.13.1" @@ -1330,10 +1330,10 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1: graceful-fs "^4.2.4" tapable "^2.2.0" -entities@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== +entities@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-6.0.0.tgz#09c9e29cb79b0a6459a9b9db9efb418ac5bb8e51" + integrity sha512-aKstq2TDOndCn4diEyp9Uq/Flu2i1GlLkc6XIDQSDMuaFE3OPW5OphLCyQ5SpSJZTb4reN+kTcYru5yIfXoRPw== error-ex@^1.3.1: version "1.3.2" @@ -1353,9 +1353,9 @@ es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-module-lexer@^1.2.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" - integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== + version "1.7.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz#9159601561880a85f2734560a9099b2c31e5372a" + integrity sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA== es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: version "1.1.1" @@ -2485,11 +2485,11 @@ parse-json@^5.2.0: lines-and-columns "^1.1.6" parse5@^7.0.0, parse5@^7.1.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" - integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== + version "7.3.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.3.0.tgz#d7e224fa72399c7a175099f45fc2ad024b05ec05" + integrity sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw== dependencies: - entities "^4.5.0" + entities "^6.0.0" path-exists@^4.0.0: version "4.0.0" @@ -2676,9 +2676,9 @@ saxes@^6.0.0: xmlchars "^2.2.0" schema-utils@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" - integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== + version "4.3.2" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.2.tgz#0c10878bf4a73fd2b1dfd14b9462b26788c806ae" + integrity sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ== dependencies: "@types/json-schema" "^7.0.9" ajv "^8.9.0" From 9520dcc4fd0af21f19699207b43863cfde65ea35 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 23 Apr 2025 11:56:11 -0700 Subject: [PATCH 17/20] 2.6.0-beta.4 --- package.json | 2 +- src/Client.ts | 20 ++++---- .../betaVmManagement/client/Client.ts | 12 ++--- src/api/resources/browser/client/Client.ts | 32 ++++++------- src/api/resources/code/client/Client.ts | 4 +- src/api/resources/env/client/Client.ts | 12 ++--- src/api/resources/instance/client/Client.ts | 48 +++++++++---------- src/api/resources/notebook/client/Client.ts | 28 +++++------ src/version.ts | 2 +- 9 files changed, 80 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index 1ce5b5e..91f6fa6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapybara", - "version": "2.6.0-beta.3", + "version": "2.6.0-beta.4", "private": false, "repository": "https://github.com/scrapybara/scrapybara-ts", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 29a523f..4c3f90c 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -89,8 +89,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -168,8 +168,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -244,8 +244,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -306,8 +306,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -377,8 +377,8 @@ export class ScrapybaraClient { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/betaVmManagement/client/Client.ts b/src/api/resources/betaVmManagement/client/Client.ts index 99db864..faded79 100644 --- a/src/api/resources/betaVmManagement/client/Client.ts +++ b/src/api/resources/betaVmManagement/client/Client.ts @@ -54,8 +54,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -218,8 +218,8 @@ export class BetaVmManagement { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/browser/client/Client.ts b/src/api/resources/browser/client/Client.ts index 2c83918..e0b858b 100644 --- a/src/api/resources/browser/client/Client.ts +++ b/src/api/resources/browser/client/Client.ts @@ -60,8 +60,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -141,8 +141,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -221,8 +221,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -389,8 +389,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -481,8 +481,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -569,8 +569,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -650,8 +650,8 @@ export class Browser { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/code/client/Client.ts b/src/api/resources/code/client/Client.ts index dba6e25..b83a5e8 100644 --- a/src/api/resources/code/client/Client.ts +++ b/src/api/resources/code/client/Client.ts @@ -56,8 +56,8 @@ export class Code { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/env/client/Client.ts b/src/api/resources/env/client/Client.ts index 2b5c452..547cb2d 100644 --- a/src/api/resources/env/client/Client.ts +++ b/src/api/resources/env/client/Client.ts @@ -49,8 +49,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -135,8 +135,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -220,8 +220,8 @@ export class Env { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index 5f8a4df..e917b5a 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -54,8 +54,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -134,8 +134,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -302,8 +302,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -473,8 +473,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -566,8 +566,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -648,8 +648,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -728,8 +728,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -816,8 +816,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -905,8 +905,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -995,8 +995,8 @@ export class Instance { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/api/resources/notebook/client/Client.ts b/src/api/resources/notebook/client/Client.ts index 942e26c..9441c0a 100644 --- a/src/api/resources/notebook/client/Client.ts +++ b/src/api/resources/notebook/client/Client.ts @@ -52,8 +52,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -136,8 +136,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -219,8 +219,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -301,8 +301,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -388,8 +388,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -475,8 +475,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), @@ -560,8 +560,8 @@ export class Notebook { headers: { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scrapybara", - "X-Fern-SDK-Version": "2.6.0-beta.3", - "User-Agent": "scrapybara/2.6.0-beta.3", + "X-Fern-SDK-Version": "2.6.0-beta.4", + "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), diff --git a/src/version.ts b/src/version.ts index 395881b..f238aaa 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.6.0-beta.3"; +export const SDK_VERSION = "2.6.0-beta.4"; From 467400c267434891a6f3b2c665873c3fee3bc4e1 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 23 Apr 2025 12:07:47 -0700 Subject: [PATCH 18/20] dup bug --- src/api/resources/instance/client/Client.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/api/resources/instance/client/Client.ts b/src/api/resources/instance/client/Client.ts index 4d10cab..9ffc575 100644 --- a/src/api/resources/instance/client/Client.ts +++ b/src/api/resources/instance/client/Client.ts @@ -56,8 +56,6 @@ export class Instance { "X-Fern-SDK-Name": "scrapybara", "X-Fern-SDK-Version": "2.6.0-beta.4", "User-Agent": "scrapybara/2.6.0-beta.4", - "X-Fern-SDK-Version": "2.6.0-beta.4", - "User-Agent": "scrapybara/2.6.0-beta.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await this._getCustomAuthorizationHeaders()), From 3b221632693f91ad356e3222df13f524d75546a6 Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 23 Apr 2025 12:09:42 -0700 Subject: [PATCH 19/20] reschedule in scrapy client --- src/ScrapybaraClient.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ScrapybaraClient.ts b/src/ScrapybaraClient.ts index 0ac2b75..5c65050 100644 --- a/src/ScrapybaraClient.ts +++ b/src/ScrapybaraClient.ts @@ -625,6 +625,16 @@ export class BaseInstance { return await this.fern.instance.resume(this.id, request, requestOptions); } + /** + * Reschedule the termination time for the instance. + */ + public async rescheduleTermination( + request: Scrapybara.InstanceRescheduleTerminationRequest = {}, + requestOptions?: FernClient.RequestOptions, + ): Promise { + return await this.fern.instance.rescheduleTermination(this.id, request, requestOptions); + } + /** * Upload a file to the instance */ From 3c58c28a098a5c2092c4f5476efccd2fefd1a09b Mon Sep 17 00:00:00 2001 From: Cooper Miller Date: Wed, 28 May 2025 11:13:51 -0700 Subject: [PATCH 20/20] skip tests --- tests/custom.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 0051e57..e307ffe 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -306,7 +306,7 @@ describe("test", () => { await instance.stop(); }, 60000); - it("test beta vm management", async () => { + it.skip("test beta vm management", async () => { // Start a rodent instance const instance = await client.startUbuntu({ backend: "rodent" }); assert(instance.id !== undefined); @@ -333,7 +333,7 @@ describe("test", () => { } }, 120000); - it("test restore from snapshot", async () => { + it.skip("test restore from snapshot", async () => { // Start original instance const originalInstance = await client.startUbuntu({ backend: "rodent" }); assert(originalInstance.id !== undefined);