browser-use-sdk 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +1 -1
- package/dist/cjs/Client.d.ts +1 -1
- package/dist/cjs/Client.js +3 -3
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/cjs/api/resources/billing/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/billing/client/Client.js +2 -2
- package/dist/cjs/api/resources/browsers/client/Client.d.ts +9 -7
- package/dist/cjs/api/resources/browsers/client/Client.js +9 -7
- package/dist/cjs/api/resources/browsers/client/requests/CreateBrowserSessionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/files/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/files/client/Client.js +1 -1
- package/dist/cjs/api/resources/profiles/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/profiles/client/Client.js +1 -1
- package/dist/cjs/api/resources/sessions/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/sessions/client/Client.js +1 -1
- package/dist/cjs/api/resources/sessions/client/requests/CreateSessionRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/skills/client/Client.js +12 -5
- package/dist/cjs/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.d.ts +12 -0
- package/dist/cjs/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.js +3 -0
- package/dist/cjs/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/requests/UpdateSkillRequest.d.ts +5 -2
- package/dist/cjs/api/resources/skills/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.d.ts +24 -5
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.js +87 -7
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.d.ts +12 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/tasks/client/Client.d.ts +9 -3
- package/dist/cjs/api/resources/tasks/client/Client.js +9 -3
- package/dist/cjs/api/resources/tasks/client/requests/CreateTaskRequest.d.ts +2 -0
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +29 -1
- package/dist/cjs/api/resources/workflows/client/Client.js +85 -1
- package/dist/cjs/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.d.ts +18 -0
- package/dist/cjs/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.js +3 -0
- package/dist/cjs/api/resources/workflows/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/AccountNotFoundError.d.ts +1 -1
- package/dist/cjs/api/types/AccountView.d.ts +5 -5
- package/dist/cjs/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/CommonUtilsErrorsInsufficientCreditsError.d.ts +6 -0
- package/dist/cjs/api/types/CommonUtilsErrorsInsufficientCreditsError.js +3 -0
- package/dist/cjs/api/types/EnabledSkillsLimitExceededError.d.ts +6 -0
- package/dist/cjs/api/types/EnabledSkillsLimitExceededError.js +3 -0
- package/dist/cjs/api/types/ExecuteSkillRequest.d.ts +7 -0
- package/dist/cjs/api/types/ExecuteSkillRequest.js +3 -0
- package/dist/cjs/api/types/MarketplaceSkillResponse.d.ts +14 -0
- package/dist/cjs/api/types/SessionItemView.d.ts +2 -0
- package/dist/cjs/api/types/SessionStatus.d.ts +3 -3
- package/dist/cjs/api/types/SessionStatus.js +3 -3
- package/dist/cjs/api/types/SessionTimeoutLimitExceededError.d.ts +1 -1
- package/dist/cjs/api/types/SessionView.d.ts +2 -0
- package/dist/cjs/api/types/SkillCategory.d.ts +20 -0
- package/dist/cjs/api/types/SkillCategory.js +23 -0
- package/dist/cjs/api/types/SkillResponse.d.ts +14 -2
- package/dist/cjs/api/types/SkillsGenerationStatus.d.ts +1 -0
- package/dist/cjs/api/types/SkillsGenerationStatus.js +1 -0
- package/dist/cjs/api/types/WorkflowCreateFromTaskResponse.d.ts +11 -0
- package/dist/cjs/api/types/WorkflowCreateFromTaskResponse.js +3 -0
- package/dist/cjs/api/types/WorkflowExecutionResponse.d.ts +4 -0
- package/dist/cjs/api/types/WorkflowExecutionStateView.d.ts +4 -0
- package/dist/cjs/api/types/WorkflowExecutionStepView.d.ts +4 -4
- package/dist/cjs/api/types/WorkflowGenerationStateView.d.ts +6 -0
- package/dist/cjs/api/types/WorkflowItemView.d.ts +7 -0
- package/dist/cjs/api/types/WorkflowResponse.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +7 -2
- package/dist/cjs/api/types/index.js +7 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +1 -1
- package/dist/esm/Client.d.mts +1 -1
- package/dist/esm/Client.mjs +3 -3
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -2
- package/dist/esm/api/resources/billing/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/billing/client/Client.mjs +2 -2
- package/dist/esm/api/resources/browsers/client/Client.d.mts +9 -7
- package/dist/esm/api/resources/browsers/client/Client.mjs +9 -7
- package/dist/esm/api/resources/browsers/client/requests/CreateBrowserSessionRequest.d.mts +1 -1
- package/dist/esm/api/resources/files/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/files/client/Client.mjs +1 -1
- package/dist/esm/api/resources/profiles/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/profiles/client/Client.mjs +1 -1
- package/dist/esm/api/resources/sessions/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/sessions/client/Client.mjs +1 -1
- package/dist/esm/api/resources/sessions/client/requests/CreateSessionRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/skills/client/Client.mjs +12 -5
- package/dist/esm/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.d.mts +12 -0
- package/dist/esm/api/resources/skills/client/requests/ExecuteSkillSkillsSkillIdExecutePostRequest.mjs +2 -0
- package/dist/esm/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/requests/UpdateSkillRequest.d.mts +5 -2
- package/dist/esm/api/resources/skills/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/skillsMarketplace/client/Client.d.mts +24 -5
- package/dist/esm/api/resources/skillsMarketplace/client/Client.mjs +87 -7
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.d.mts +12 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillSlugGetRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/tasks/client/Client.d.mts +9 -3
- package/dist/esm/api/resources/tasks/client/Client.mjs +9 -3
- package/dist/esm/api/resources/tasks/client/requests/CreateTaskRequest.d.mts +2 -0
- package/dist/esm/api/resources/workflows/client/Client.d.mts +29 -1
- package/dist/esm/api/resources/workflows/client/Client.mjs +85 -1
- package/dist/esm/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.d.mts +18 -0
- package/dist/esm/api/resources/workflows/client/requests/WorkflowCreateFromTaskRequest.mjs +2 -0
- package/dist/esm/api/resources/workflows/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/AccountNotFoundError.d.mts +1 -1
- package/dist/esm/api/types/AccountView.d.mts +5 -5
- package/dist/esm/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/AppEndpointsApiV2MarketplaceSkillsViewsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/AppEndpointsApiV2SkillsViewsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/CommonUtilsErrorsInsufficientCreditsError.d.mts +6 -0
- package/dist/esm/api/types/CommonUtilsErrorsInsufficientCreditsError.mjs +2 -0
- package/dist/esm/api/types/EnabledSkillsLimitExceededError.d.mts +6 -0
- package/dist/esm/api/types/EnabledSkillsLimitExceededError.mjs +2 -0
- package/dist/esm/api/types/ExecuteSkillRequest.d.mts +7 -0
- package/dist/esm/api/types/ExecuteSkillRequest.mjs +2 -0
- package/dist/esm/api/types/MarketplaceSkillResponse.d.mts +14 -0
- package/dist/esm/api/types/SessionItemView.d.mts +2 -0
- package/dist/esm/api/types/SessionStatus.d.mts +3 -3
- package/dist/esm/api/types/SessionStatus.mjs +3 -3
- package/dist/esm/api/types/SessionTimeoutLimitExceededError.d.mts +1 -1
- package/dist/esm/api/types/SessionView.d.mts +2 -0
- package/dist/esm/api/types/SkillCategory.d.mts +20 -0
- package/dist/esm/api/types/SkillCategory.mjs +20 -0
- package/dist/esm/api/types/SkillResponse.d.mts +14 -2
- package/dist/esm/api/types/SkillsGenerationStatus.d.mts +1 -0
- package/dist/esm/api/types/SkillsGenerationStatus.mjs +1 -0
- package/dist/esm/api/types/WorkflowCreateFromTaskResponse.d.mts +11 -0
- package/dist/esm/api/types/WorkflowCreateFromTaskResponse.mjs +2 -0
- package/dist/esm/api/types/WorkflowExecutionResponse.d.mts +4 -0
- package/dist/esm/api/types/WorkflowExecutionStateView.d.mts +4 -0
- package/dist/esm/api/types/WorkflowExecutionStepView.d.mts +4 -4
- package/dist/esm/api/types/WorkflowGenerationStateView.d.mts +6 -0
- package/dist/esm/api/types/WorkflowItemView.d.mts +7 -0
- package/dist/esm/api/types/WorkflowResponse.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +7 -2
- package/dist/esm/api/types/index.mjs +7 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +83 -82
- package/reference.md +166 -14
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface BaseClientOptions {
|
|
|
4
4
|
environment?: core.Supplier<environments.BrowserUseEnvironment | string>;
|
|
5
5
|
/** Specify a custom URL to connect the client to. */
|
|
6
6
|
baseUrl?: core.Supplier<string>;
|
|
7
|
-
apiKey
|
|
7
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
8
8
|
/** Additional headers to include in requests. */
|
|
9
9
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
10
|
/** The default maximum time to wait for a response in seconds. */
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class BrowserUseClient {
|
|
|
25
25
|
protected _skills: Skills | undefined;
|
|
26
26
|
protected _skillsMarketplace: SkillsMarketplace | undefined;
|
|
27
27
|
protected _workflows: Workflows | undefined;
|
|
28
|
-
constructor(_options
|
|
28
|
+
constructor(_options?: BrowserUseClient.Options);
|
|
29
29
|
get billing(): Billing;
|
|
30
30
|
get tasks(): Tasks;
|
|
31
31
|
get sessions(): Sessions;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -47,12 +47,12 @@ const Client_js_9 = require("./api/resources/workflows/client/Client.js");
|
|
|
47
47
|
const headers_js_1 = require("./core/headers.js");
|
|
48
48
|
const core = __importStar(require("./core/index.js"));
|
|
49
49
|
class BrowserUseClient {
|
|
50
|
-
constructor(_options) {
|
|
50
|
+
constructor(_options = {}) {
|
|
51
51
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: (0, headers_js_1.mergeHeaders)({
|
|
52
52
|
"X-Fern-Language": "JavaScript",
|
|
53
53
|
"X-Fern-SDK-Name": "browser-use-sdk",
|
|
54
|
-
"X-Fern-SDK-Version": "2.0.
|
|
55
|
-
"User-Agent": "browser-use-sdk/2.0.
|
|
54
|
+
"X-Fern-SDK-Version": "2.0.13",
|
|
55
|
+
"User-Agent": "browser-use-sdk/2.0.13",
|
|
56
56
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
57
57
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
58
58
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as core from "../../core/index.js";
|
|
2
2
|
import * as errors from "../../errors/index.js";
|
|
3
|
-
import type * as BrowserUse from "../index.js";
|
|
4
3
|
export declare class ForbiddenError extends errors.BrowserUseError {
|
|
5
|
-
constructor(body
|
|
4
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
6
5
|
}
|
|
@@ -9,9 +9,9 @@ export declare namespace Billing {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Billing {
|
|
11
11
|
protected readonly _options: Billing.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Billing.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Get authenticated account information including credit
|
|
14
|
+
* Get authenticated account information including credit balance and account details.
|
|
15
15
|
*
|
|
16
16
|
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
17
|
*
|
|
@@ -50,11 +50,11 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
52
52
|
class Billing {
|
|
53
|
-
constructor(_options) {
|
|
53
|
+
constructor(_options = {}) {
|
|
54
54
|
this._options = _options;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Get authenticated account information including credit
|
|
57
|
+
* Get authenticated account information including credit balance and account details.
|
|
58
58
|
*
|
|
59
59
|
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
60
|
*
|
|
@@ -9,7 +9,7 @@ export declare namespace Browsers {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Browsers {
|
|
11
11
|
protected readonly _options: Browsers.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Browsers.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get paginated list of browser sessions with optional status filtering.
|
|
15
15
|
*
|
|
@@ -26,16 +26,18 @@ export declare class Browsers {
|
|
|
26
26
|
/**
|
|
27
27
|
* Create a new browser session.
|
|
28
28
|
*
|
|
29
|
-
* **Pricing:** Browser sessions are charged
|
|
30
|
-
*
|
|
29
|
+
* **Pricing:** Browser sessions are charged per hour with tiered pricing:
|
|
30
|
+
* - Pay As You Go users: $0.06/hour
|
|
31
|
+
* - Business/Scaleup subscribers: $0.03/hour (50% discount)
|
|
32
|
+
*
|
|
33
|
+
* The full rate is charged upfront when the session starts.
|
|
31
34
|
* When you stop the session, any unused time is automatically refunded proportionally.
|
|
32
35
|
*
|
|
33
|
-
* Billing is rounded to the
|
|
34
|
-
* For example, if you stop a session after 30 minutes, you'll be refunded
|
|
36
|
+
* Billing is rounded up to the minute (minimum 1 minute).
|
|
37
|
+
* For example, if you stop a session after 30 minutes, you'll be refunded half the charged amount.
|
|
35
38
|
*
|
|
36
39
|
* **Session Limits:**
|
|
37
|
-
* -
|
|
38
|
-
* - Paid subscribers: Up to 4 hours per session
|
|
40
|
+
* - All users: Up to 4 hours per session
|
|
39
41
|
*
|
|
40
42
|
* @param {BrowserUse.CreateBrowserSessionRequest} request
|
|
41
43
|
* @param {Browsers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Browsers {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -142,16 +142,18 @@ class Browsers {
|
|
|
142
142
|
/**
|
|
143
143
|
* Create a new browser session.
|
|
144
144
|
*
|
|
145
|
-
* **Pricing:** Browser sessions are charged
|
|
146
|
-
*
|
|
145
|
+
* **Pricing:** Browser sessions are charged per hour with tiered pricing:
|
|
146
|
+
* - Pay As You Go users: $0.06/hour
|
|
147
|
+
* - Business/Scaleup subscribers: $0.03/hour (50% discount)
|
|
148
|
+
*
|
|
149
|
+
* The full rate is charged upfront when the session starts.
|
|
147
150
|
* When you stop the session, any unused time is automatically refunded proportionally.
|
|
148
151
|
*
|
|
149
|
-
* Billing is rounded to the
|
|
150
|
-
* For example, if you stop a session after 30 minutes, you'll be refunded
|
|
152
|
+
* Billing is rounded up to the minute (minimum 1 minute).
|
|
153
|
+
* For example, if you stop a session after 30 minutes, you'll be refunded half the charged amount.
|
|
151
154
|
*
|
|
152
155
|
* **Session Limits:**
|
|
153
|
-
* -
|
|
154
|
-
* - Paid subscribers: Up to 4 hours per session
|
|
156
|
+
* - All users: Up to 4 hours per session
|
|
155
157
|
*
|
|
156
158
|
* @param {BrowserUse.CreateBrowserSessionRequest} request
|
|
157
159
|
* @param {Browsers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8,7 +8,7 @@ export interface CreateBrowserSessionRequest {
|
|
|
8
8
|
profileId?: string | null;
|
|
9
9
|
/** Country code for proxy location. */
|
|
10
10
|
proxyCountryCode?: BrowserUse.ProxyCountryCode | null;
|
|
11
|
-
/** The timeout for the session in minutes.
|
|
11
|
+
/** The timeout for the session in minutes. All users can use up to 240 minutes (4 hours). Pay As You Go users are charged $0.06/hour, subscribers get 50% off. */
|
|
12
12
|
timeout?: number;
|
|
13
13
|
/** Custom screen width in pixels for the browser. */
|
|
14
14
|
browserScreenWidth?: number | null;
|
|
@@ -9,7 +9,7 @@ export declare namespace Files {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Files {
|
|
11
11
|
protected readonly _options: Files.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Files.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Generate a secure presigned URL for uploading files to an agent session.
|
|
15
15
|
*
|
|
@@ -50,7 +50,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
52
52
|
class Files {
|
|
53
|
-
constructor(_options) {
|
|
53
|
+
constructor(_options = {}) {
|
|
54
54
|
this._options = _options;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Profiles {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace Sessions {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Sessions {
|
|
11
11
|
protected readonly _options: Sessions.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Sessions.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get paginated list of AI agent sessions with optional status filtering.
|
|
15
15
|
*
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Sessions {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -14,4 +14,6 @@ export interface CreateSessionRequest {
|
|
|
14
14
|
browserScreenWidth?: number | null;
|
|
15
15
|
/** Custom screen height in pixels for the browser. */
|
|
16
16
|
browserScreenHeight?: number | null;
|
|
17
|
+
/** If True (default), tasks in this session share memory and history with each other, allowing follow-up tasks to continue from previous context. If False, each task runs as a standalone task without any previous task context. */
|
|
18
|
+
persistMemory?: boolean;
|
|
17
19
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace Skills {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Skills {
|
|
11
11
|
protected readonly _options: Skills.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Skills.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all skills owned by the authenticated project with optional filtering.
|
|
15
15
|
*
|
|
@@ -79,6 +79,7 @@ export declare class Skills {
|
|
|
79
79
|
* @param {BrowserUse.UpdateSkillRequest} request
|
|
80
80
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
81
|
*
|
|
82
|
+
* @throws {@link BrowserUse.ForbiddenError}
|
|
82
83
|
* @throws {@link BrowserUse.NotFoundError}
|
|
83
84
|
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
84
85
|
*
|
|
@@ -126,7 +127,7 @@ export declare class Skills {
|
|
|
126
127
|
/**
|
|
127
128
|
* Execute a skill with the provided parameters.
|
|
128
129
|
*
|
|
129
|
-
* @param {BrowserUse.
|
|
130
|
+
* @param {BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest} request
|
|
130
131
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
131
132
|
*
|
|
132
133
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -136,10 +137,11 @@ export declare class Skills {
|
|
|
136
137
|
*
|
|
137
138
|
* @example
|
|
138
139
|
* await client.skills.executeSkill({
|
|
139
|
-
* skill_id: "skill_id"
|
|
140
|
+
* skill_id: "skill_id",
|
|
141
|
+
* body: {}
|
|
140
142
|
* })
|
|
141
143
|
*/
|
|
142
|
-
executeSkill(request: BrowserUse.
|
|
144
|
+
executeSkill(request: BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest, requestOptions?: Skills.RequestOptions): core.HttpResponsePromise<BrowserUse.ExecuteSkillResponse>;
|
|
143
145
|
private __executeSkill;
|
|
144
146
|
/**
|
|
145
147
|
* Refine a skill based on feedback.
|
|
@@ -61,7 +61,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
61
61
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
62
62
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
63
63
|
class Skills {
|
|
64
|
-
constructor(_options) {
|
|
64
|
+
constructor(_options = {}) {
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -81,7 +81,7 @@ class Skills {
|
|
|
81
81
|
__listSkills() {
|
|
82
82
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
83
83
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
84
|
-
const { pageSize, pageNumber, isPublic, isEnabled, query, fromDate, toDate } = request;
|
|
84
|
+
const { pageSize, pageNumber, isPublic, isEnabled, category, query, fromDate, toDate } = request;
|
|
85
85
|
const _queryParams = {};
|
|
86
86
|
if (pageSize != null) {
|
|
87
87
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -95,6 +95,9 @@ class Skills {
|
|
|
95
95
|
if (isEnabled !== undefined) {
|
|
96
96
|
_queryParams.isEnabled = (_b = isEnabled === null || isEnabled === void 0 ? void 0 : isEnabled.toString()) !== null && _b !== void 0 ? _b : null;
|
|
97
97
|
}
|
|
98
|
+
if (category !== undefined) {
|
|
99
|
+
_queryParams.category = category;
|
|
100
|
+
}
|
|
98
101
|
if (query !== undefined) {
|
|
99
102
|
_queryParams.query = query;
|
|
100
103
|
}
|
|
@@ -361,6 +364,7 @@ class Skills {
|
|
|
361
364
|
* @param {BrowserUse.UpdateSkillRequest} request
|
|
362
365
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
363
366
|
*
|
|
367
|
+
* @throws {@link BrowserUse.ForbiddenError}
|
|
364
368
|
* @throws {@link BrowserUse.NotFoundError}
|
|
365
369
|
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
366
370
|
*
|
|
@@ -396,6 +400,8 @@ class Skills {
|
|
|
396
400
|
}
|
|
397
401
|
if (_response.error.reason === "status-code") {
|
|
398
402
|
switch (_response.error.statusCode) {
|
|
403
|
+
case 403:
|
|
404
|
+
throw new BrowserUse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
399
405
|
case 404:
|
|
400
406
|
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
401
407
|
case 422:
|
|
@@ -568,7 +574,7 @@ class Skills {
|
|
|
568
574
|
/**
|
|
569
575
|
* Execute a skill with the provided parameters.
|
|
570
576
|
*
|
|
571
|
-
* @param {BrowserUse.
|
|
577
|
+
* @param {BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest} request
|
|
572
578
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
573
579
|
*
|
|
574
580
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -578,7 +584,8 @@ class Skills {
|
|
|
578
584
|
*
|
|
579
585
|
* @example
|
|
580
586
|
* await client.skills.executeSkill({
|
|
581
|
-
* skill_id: "skill_id"
|
|
587
|
+
* skill_id: "skill_id",
|
|
588
|
+
* body: {}
|
|
582
589
|
* })
|
|
583
590
|
*/
|
|
584
591
|
executeSkill(request, requestOptions) {
|
|
@@ -587,7 +594,7 @@ class Skills {
|
|
|
587
594
|
__executeSkill(request, requestOptions) {
|
|
588
595
|
return __awaiter(this, void 0, void 0, function* () {
|
|
589
596
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
590
|
-
const { skill_id: skillId
|
|
597
|
+
const { skill_id: skillId, body: _body } = request;
|
|
591
598
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
592
599
|
const _response = yield core.fetcher({
|
|
593
600
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `skills/${core.url.encodePathParam(skillId)}/execute`),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* skill_id: "skill_id",
|
|
6
|
+
* body: {}
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecuteSkillSkillsSkillIdExecutePostRequest {
|
|
10
|
+
skill_id: string;
|
|
11
|
+
body: BrowserUse.ExecuteSkillRequest;
|
|
12
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
@@ -7,6 +8,7 @@ export interface ListSkillsSkillsGetRequest {
|
|
|
7
8
|
pageNumber?: number;
|
|
8
9
|
isPublic?: boolean | null;
|
|
9
10
|
isEnabled?: boolean | null;
|
|
11
|
+
category?: BrowserUse.SkillCategory | null;
|
|
10
12
|
query?: string | null;
|
|
11
13
|
fromDate?: string | null;
|
|
12
14
|
toDate?: string | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -10,8 +11,10 @@ export interface UpdateSkillRequest {
|
|
|
10
11
|
title?: string | null;
|
|
11
12
|
/** Description of what the skill does (shows up in the public view) */
|
|
12
13
|
description?: string | null;
|
|
14
|
+
/** Categories to assign to the skill */
|
|
15
|
+
categories?: BrowserUse.SkillCategory[] | null;
|
|
16
|
+
/** Domains/websites this skill interacts with */
|
|
17
|
+
domains?: string[] | null;
|
|
13
18
|
/** Whether the skill is enabled for execution */
|
|
14
19
|
isEnabled?: boolean | null;
|
|
15
|
-
/** Whether the skill is publicly available */
|
|
16
|
-
isPublic?: boolean | null;
|
|
17
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { CancelGenerationSkillsSkillIdCancelPostRequest } from "./CancelGenerationSkillsSkillIdCancelPostRequest.js";
|
|
2
2
|
export type { CreateSkillRequest } from "./CreateSkillRequest.js";
|
|
3
3
|
export type { DeleteSkillSkillsSkillIdDeleteRequest } from "./DeleteSkillSkillsSkillIdDeleteRequest.js";
|
|
4
|
-
export type {
|
|
4
|
+
export type { ExecuteSkillSkillsSkillIdExecutePostRequest } from "./ExecuteSkillSkillsSkillIdExecutePostRequest.js";
|
|
5
5
|
export type { GetSkillSkillsSkillIdGetRequest } from "./GetSkillSkillsSkillIdGetRequest.js";
|
|
6
6
|
export type { ListSkillsSkillsGetRequest } from "./ListSkillsSkillsGetRequest.js";
|
|
7
7
|
export type { RefineSkillRequest } from "./RefineSkillRequest.js";
|
|
@@ -9,7 +9,7 @@ export declare namespace SkillsMarketplace {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class SkillsMarketplace {
|
|
11
11
|
protected readonly _options: SkillsMarketplace.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: SkillsMarketplace.Options);
|
|
13
13
|
/**
|
|
14
14
|
* List all public skills available in the marketplace with optional filtering.
|
|
15
15
|
*
|
|
@@ -26,7 +26,7 @@ export declare class SkillsMarketplace {
|
|
|
26
26
|
/**
|
|
27
27
|
* Get details of a specific public skill from the marketplace.
|
|
28
28
|
*
|
|
29
|
-
* @param {BrowserUse.
|
|
29
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest} request
|
|
30
30
|
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
31
|
*
|
|
32
32
|
* @throws {@link BrowserUse.NotFoundError}
|
|
@@ -34,10 +34,10 @@ export declare class SkillsMarketplace {
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* await client.skillsMarketplace.getSkill({
|
|
37
|
-
*
|
|
37
|
+
* skill_slug: "skill_slug"
|
|
38
38
|
* })
|
|
39
39
|
*/
|
|
40
|
-
getSkill(request: BrowserUse.
|
|
40
|
+
getSkill(request: BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.MarketplaceSkillResponse>;
|
|
41
41
|
private __getSkill;
|
|
42
42
|
/**
|
|
43
43
|
* Clone a public marketplace skill to the user's project.
|
|
@@ -54,7 +54,26 @@ export declare class SkillsMarketplace {
|
|
|
54
54
|
* skill_id: "skill_id"
|
|
55
55
|
* })
|
|
56
56
|
*/
|
|
57
|
-
cloneSkill(request: BrowserUse.CloneSkillMarketplaceSkillsSkillIdClonePostRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.
|
|
57
|
+
cloneSkill(request: BrowserUse.CloneSkillMarketplaceSkillsSkillIdClonePostRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.SkillResponse>;
|
|
58
58
|
private __cloneSkill;
|
|
59
|
+
/**
|
|
60
|
+
* Execute a skill with the provided parameters.
|
|
61
|
+
*
|
|
62
|
+
* @param {BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest} request
|
|
63
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
66
|
+
* @throws {@link BrowserUse.PaymentRequiredError}
|
|
67
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
68
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.skillsMarketplace.executeSkill({
|
|
72
|
+
* skill_id: "skill_id",
|
|
73
|
+
* body: {}
|
|
74
|
+
* })
|
|
75
|
+
*/
|
|
76
|
+
executeSkill(request: BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.ExecuteSkillResponse>;
|
|
77
|
+
private __executeSkill;
|
|
59
78
|
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
60
79
|
}
|
|
@@ -50,7 +50,7 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const BrowserUse = __importStar(require("../../../index.js"));
|
|
52
52
|
class SkillsMarketplace {
|
|
53
|
-
constructor(_options) {
|
|
53
|
+
constructor(_options = {}) {
|
|
54
54
|
this._options = _options;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -70,7 +70,7 @@ class SkillsMarketplace {
|
|
|
70
70
|
__listSkills() {
|
|
71
71
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
72
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
|
-
const { pageSize, pageNumber, query, fromDate, toDate } = request;
|
|
73
|
+
const { pageSize, pageNumber, query, category, fromDate, toDate } = request;
|
|
74
74
|
const _queryParams = {};
|
|
75
75
|
if (pageSize != null) {
|
|
76
76
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -81,6 +81,9 @@ class SkillsMarketplace {
|
|
|
81
81
|
if (query !== undefined) {
|
|
82
82
|
_queryParams.query = query;
|
|
83
83
|
}
|
|
84
|
+
if (category !== undefined) {
|
|
85
|
+
_queryParams.category = category;
|
|
86
|
+
}
|
|
84
87
|
if (fromDate !== undefined) {
|
|
85
88
|
_queryParams.fromDate = fromDate;
|
|
86
89
|
}
|
|
@@ -137,7 +140,7 @@ class SkillsMarketplace {
|
|
|
137
140
|
/**
|
|
138
141
|
* Get details of a specific public skill from the marketplace.
|
|
139
142
|
*
|
|
140
|
-
* @param {BrowserUse.
|
|
143
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest} request
|
|
141
144
|
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
145
|
*
|
|
143
146
|
* @throws {@link BrowserUse.NotFoundError}
|
|
@@ -145,7 +148,7 @@ class SkillsMarketplace {
|
|
|
145
148
|
*
|
|
146
149
|
* @example
|
|
147
150
|
* await client.skillsMarketplace.getSkill({
|
|
148
|
-
*
|
|
151
|
+
* skill_slug: "skill_slug"
|
|
149
152
|
* })
|
|
150
153
|
*/
|
|
151
154
|
getSkill(request, requestOptions) {
|
|
@@ -154,10 +157,10 @@ class SkillsMarketplace {
|
|
|
154
157
|
__getSkill(request, requestOptions) {
|
|
155
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
159
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
157
|
-
const {
|
|
160
|
+
const { skill_slug: skillSlug } = request;
|
|
158
161
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
162
|
const _response = yield core.fetcher({
|
|
160
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(
|
|
163
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(skillSlug)}`),
|
|
161
164
|
method: "GET",
|
|
162
165
|
headers: _headers,
|
|
163
166
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -192,7 +195,7 @@ class SkillsMarketplace {
|
|
|
192
195
|
rawResponse: _response.rawResponse,
|
|
193
196
|
});
|
|
194
197
|
case "timeout":
|
|
195
|
-
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{
|
|
198
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{skill_slug}.");
|
|
196
199
|
case "unknown":
|
|
197
200
|
throw new errors.BrowserUseError({
|
|
198
201
|
message: _response.error.errorMessage,
|
|
@@ -271,6 +274,83 @@ class SkillsMarketplace {
|
|
|
271
274
|
}
|
|
272
275
|
});
|
|
273
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Execute a skill with the provided parameters.
|
|
279
|
+
*
|
|
280
|
+
* @param {BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest} request
|
|
281
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
282
|
+
*
|
|
283
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
284
|
+
* @throws {@link BrowserUse.PaymentRequiredError}
|
|
285
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
286
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* await client.skillsMarketplace.executeSkill({
|
|
290
|
+
* skill_id: "skill_id",
|
|
291
|
+
* body: {}
|
|
292
|
+
* })
|
|
293
|
+
*/
|
|
294
|
+
executeSkill(request, requestOptions) {
|
|
295
|
+
return core.HttpResponsePromise.fromPromise(this.__executeSkill(request, requestOptions));
|
|
296
|
+
}
|
|
297
|
+
__executeSkill(request, requestOptions) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
300
|
+
const { skill_id: skillId, body: _body } = request;
|
|
301
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
302
|
+
const _response = yield core.fetcher({
|
|
303
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.BrowserUseEnvironment.Production, `marketplace/skills/${core.url.encodePathParam(skillId)}/execute`),
|
|
304
|
+
method: "POST",
|
|
305
|
+
headers: _headers,
|
|
306
|
+
contentType: "application/json",
|
|
307
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
308
|
+
requestType: "json",
|
|
309
|
+
body: _body,
|
|
310
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
311
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
312
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
313
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
314
|
+
logging: this._options.logging,
|
|
315
|
+
});
|
|
316
|
+
if (_response.ok) {
|
|
317
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
318
|
+
}
|
|
319
|
+
if (_response.error.reason === "status-code") {
|
|
320
|
+
switch (_response.error.statusCode) {
|
|
321
|
+
case 400:
|
|
322
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
323
|
+
case 402:
|
|
324
|
+
throw new BrowserUse.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
325
|
+
case 404:
|
|
326
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
327
|
+
case 422:
|
|
328
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
329
|
+
default:
|
|
330
|
+
throw new errors.BrowserUseError({
|
|
331
|
+
statusCode: _response.error.statusCode,
|
|
332
|
+
body: _response.error.body,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
switch (_response.error.reason) {
|
|
338
|
+
case "non-json":
|
|
339
|
+
throw new errors.BrowserUseError({
|
|
340
|
+
statusCode: _response.error.statusCode,
|
|
341
|
+
body: _response.error.rawBody,
|
|
342
|
+
rawResponse: _response.rawResponse,
|
|
343
|
+
});
|
|
344
|
+
case "timeout":
|
|
345
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /marketplace/skills/{skill_id}/execute.");
|
|
346
|
+
case "unknown":
|
|
347
|
+
throw new errors.BrowserUseError({
|
|
348
|
+
message: _response.error.errorMessage,
|
|
349
|
+
rawResponse: _response.rawResponse,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
274
354
|
_getCustomAuthorizationHeaders() {
|
|
275
355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
276
356
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* skill_id: "skill_id",
|
|
6
|
+
* body: {}
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest {
|
|
10
|
+
skill_id: string;
|
|
11
|
+
body: BrowserUse.ExecuteSkillRequest;
|
|
12
|
+
}
|