browser-use-sdk 2.0.11 → 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 +25 -6
- package/dist/cjs/api/resources/skills/client/Client.js +85 -8
- package/dist/cjs/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.js +3 -0
- 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/RollbackSkillSkillsSkillIdRollbackPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skills/client/requests/RollbackSkillSkillsSkillIdRollbackPostRequest.js +3 -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 +3 -2
- 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/CannotRollbackPublicSkillError.d.ts +6 -0
- package/dist/cjs/api/types/CannotRollbackPublicSkillError.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 +15 -1
- package/dist/cjs/api/types/ParameterSchema.d.ts +1 -0
- package/dist/cjs/api/types/ParameterType.d.ts +1 -0
- package/dist/cjs/api/types/ParameterType.js +1 -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 +19 -3
- 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 +10 -6
- package/dist/cjs/api/types/index.js +10 -6
- 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 +25 -6
- package/dist/esm/api/resources/skills/client/Client.mjs +85 -8
- package/dist/esm/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/skills/client/requests/CancelGenerationSkillsSkillIdCancelPostRequest.mjs +2 -0
- 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/RollbackSkillSkillsSkillIdRollbackPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/skills/client/requests/RollbackSkillSkillsSkillIdRollbackPostRequest.mjs +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 +3 -2
- 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/CannotRollbackPublicSkillError.d.mts +6 -0
- package/dist/esm/api/types/CannotRollbackPublicSkillError.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 +15 -1
- package/dist/esm/api/types/ParameterSchema.d.mts +1 -0
- package/dist/esm/api/types/ParameterType.d.mts +1 -0
- package/dist/esm/api/types/ParameterType.mjs +1 -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 +19 -3
- 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 +10 -6
- package/dist/esm/api/types/index.mjs +10 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +83 -82
- package/reference.md +232 -15
|
@@ -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
|
*
|
|
@@ -92,7 +93,7 @@ export declare class Skills {
|
|
|
92
93
|
/**
|
|
93
94
|
* Cancel the current in-progress generation for a skill.
|
|
94
95
|
*
|
|
95
|
-
* @param {BrowserUse.
|
|
96
|
+
* @param {BrowserUse.CancelGenerationSkillsSkillIdCancelPostRequest} request
|
|
96
97
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
97
98
|
*
|
|
98
99
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -104,12 +105,29 @@ export declare class Skills {
|
|
|
104
105
|
* skill_id: "skill_id"
|
|
105
106
|
* })
|
|
106
107
|
*/
|
|
107
|
-
cancelGeneration(request: BrowserUse.
|
|
108
|
+
cancelGeneration(request: BrowserUse.CancelGenerationSkillsSkillIdCancelPostRequest, requestOptions?: Skills.RequestOptions): core.HttpResponsePromise<BrowserUse.SkillResponse>;
|
|
108
109
|
private __cancelGeneration;
|
|
110
|
+
/**
|
|
111
|
+
* Rollback to the previous version (cannot be undone).
|
|
112
|
+
*
|
|
113
|
+
* @param {BrowserUse.RollbackSkillSkillsSkillIdRollbackPostRequest} request
|
|
114
|
+
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
|
+
*
|
|
116
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
117
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
118
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* await client.skills.rollbackSkill({
|
|
122
|
+
* skill_id: "skill_id"
|
|
123
|
+
* })
|
|
124
|
+
*/
|
|
125
|
+
rollbackSkill(request: BrowserUse.RollbackSkillSkillsSkillIdRollbackPostRequest, requestOptions?: Skills.RequestOptions): core.HttpResponsePromise<BrowserUse.SkillResponse>;
|
|
126
|
+
private __rollbackSkill;
|
|
109
127
|
/**
|
|
110
128
|
* Execute a skill with the provided parameters.
|
|
111
129
|
*
|
|
112
|
-
* @param {BrowserUse.
|
|
130
|
+
* @param {BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest} request
|
|
113
131
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
132
|
*
|
|
115
133
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -119,10 +137,11 @@ export declare class Skills {
|
|
|
119
137
|
*
|
|
120
138
|
* @example
|
|
121
139
|
* await client.skills.executeSkill({
|
|
122
|
-
* skill_id: "skill_id"
|
|
140
|
+
* skill_id: "skill_id",
|
|
141
|
+
* body: {}
|
|
123
142
|
* })
|
|
124
143
|
*/
|
|
125
|
-
executeSkill(request: BrowserUse.
|
|
144
|
+
executeSkill(request: BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest, requestOptions?: Skills.RequestOptions): core.HttpResponsePromise<BrowserUse.ExecuteSkillResponse>;
|
|
126
145
|
private __executeSkill;
|
|
127
146
|
/**
|
|
128
147
|
* Refine a skill based on feedback.
|
|
@@ -25,7 +25,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
25
25
|
import * as errors from "../../../../errors/index.mjs";
|
|
26
26
|
import * as BrowserUse from "../../../index.mjs";
|
|
27
27
|
export class Skills {
|
|
28
|
-
constructor(_options) {
|
|
28
|
+
constructor(_options = {}) {
|
|
29
29
|
this._options = _options;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -45,7 +45,7 @@ export class Skills {
|
|
|
45
45
|
__listSkills() {
|
|
46
46
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
47
47
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
48
|
-
const { pageSize, pageNumber, isPublic, isEnabled, query, fromDate, toDate } = request;
|
|
48
|
+
const { pageSize, pageNumber, isPublic, isEnabled, category, query, fromDate, toDate } = request;
|
|
49
49
|
const _queryParams = {};
|
|
50
50
|
if (pageSize != null) {
|
|
51
51
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -59,6 +59,9 @@ export class Skills {
|
|
|
59
59
|
if (isEnabled !== undefined) {
|
|
60
60
|
_queryParams.isEnabled = (_b = isEnabled === null || isEnabled === void 0 ? void 0 : isEnabled.toString()) !== null && _b !== void 0 ? _b : null;
|
|
61
61
|
}
|
|
62
|
+
if (category !== undefined) {
|
|
63
|
+
_queryParams.category = category;
|
|
64
|
+
}
|
|
62
65
|
if (query !== undefined) {
|
|
63
66
|
_queryParams.query = query;
|
|
64
67
|
}
|
|
@@ -325,6 +328,7 @@ export class Skills {
|
|
|
325
328
|
* @param {BrowserUse.UpdateSkillRequest} request
|
|
326
329
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
327
330
|
*
|
|
331
|
+
* @throws {@link BrowserUse.ForbiddenError}
|
|
328
332
|
* @throws {@link BrowserUse.NotFoundError}
|
|
329
333
|
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
330
334
|
*
|
|
@@ -360,6 +364,8 @@ export class Skills {
|
|
|
360
364
|
}
|
|
361
365
|
if (_response.error.reason === "status-code") {
|
|
362
366
|
switch (_response.error.statusCode) {
|
|
367
|
+
case 403:
|
|
368
|
+
throw new BrowserUse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
363
369
|
case 404:
|
|
364
370
|
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
365
371
|
case 422:
|
|
@@ -392,7 +398,7 @@ export class Skills {
|
|
|
392
398
|
/**
|
|
393
399
|
* Cancel the current in-progress generation for a skill.
|
|
394
400
|
*
|
|
395
|
-
* @param {BrowserUse.
|
|
401
|
+
* @param {BrowserUse.CancelGenerationSkillsSkillIdCancelPostRequest} request
|
|
396
402
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
397
403
|
*
|
|
398
404
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -413,7 +419,77 @@ export class Skills {
|
|
|
413
419
|
const { skill_id: skillId } = request;
|
|
414
420
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
415
421
|
const _response = yield core.fetcher({
|
|
416
|
-
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)}/cancel
|
|
422
|
+
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)}/cancel`),
|
|
423
|
+
method: "POST",
|
|
424
|
+
headers: _headers,
|
|
425
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
426
|
+
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,
|
|
427
|
+
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,
|
|
428
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
429
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
430
|
+
logging: this._options.logging,
|
|
431
|
+
});
|
|
432
|
+
if (_response.ok) {
|
|
433
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
434
|
+
}
|
|
435
|
+
if (_response.error.reason === "status-code") {
|
|
436
|
+
switch (_response.error.statusCode) {
|
|
437
|
+
case 400:
|
|
438
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
439
|
+
case 404:
|
|
440
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
441
|
+
case 422:
|
|
442
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
443
|
+
default:
|
|
444
|
+
throw new errors.BrowserUseError({
|
|
445
|
+
statusCode: _response.error.statusCode,
|
|
446
|
+
body: _response.error.body,
|
|
447
|
+
rawResponse: _response.rawResponse,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
switch (_response.error.reason) {
|
|
452
|
+
case "non-json":
|
|
453
|
+
throw new errors.BrowserUseError({
|
|
454
|
+
statusCode: _response.error.statusCode,
|
|
455
|
+
body: _response.error.rawBody,
|
|
456
|
+
rawResponse: _response.rawResponse,
|
|
457
|
+
});
|
|
458
|
+
case "timeout":
|
|
459
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /skills/{skill_id}/cancel.");
|
|
460
|
+
case "unknown":
|
|
461
|
+
throw new errors.BrowserUseError({
|
|
462
|
+
message: _response.error.errorMessage,
|
|
463
|
+
rawResponse: _response.rawResponse,
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Rollback to the previous version (cannot be undone).
|
|
470
|
+
*
|
|
471
|
+
* @param {BrowserUse.RollbackSkillSkillsSkillIdRollbackPostRequest} request
|
|
472
|
+
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
473
|
+
*
|
|
474
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
475
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
476
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* await client.skills.rollbackSkill({
|
|
480
|
+
* skill_id: "skill_id"
|
|
481
|
+
* })
|
|
482
|
+
*/
|
|
483
|
+
rollbackSkill(request, requestOptions) {
|
|
484
|
+
return core.HttpResponsePromise.fromPromise(this.__rollbackSkill(request, requestOptions));
|
|
485
|
+
}
|
|
486
|
+
__rollbackSkill(request, requestOptions) {
|
|
487
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
488
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
489
|
+
const { skill_id: skillId } = request;
|
|
490
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
491
|
+
const _response = yield core.fetcher({
|
|
492
|
+
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)}/rollback`),
|
|
417
493
|
method: "POST",
|
|
418
494
|
headers: _headers,
|
|
419
495
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -450,7 +526,7 @@ export class Skills {
|
|
|
450
526
|
rawResponse: _response.rawResponse,
|
|
451
527
|
});
|
|
452
528
|
case "timeout":
|
|
453
|
-
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /skills/{skill_id}/
|
|
529
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /skills/{skill_id}/rollback.");
|
|
454
530
|
case "unknown":
|
|
455
531
|
throw new errors.BrowserUseError({
|
|
456
532
|
message: _response.error.errorMessage,
|
|
@@ -462,7 +538,7 @@ export class Skills {
|
|
|
462
538
|
/**
|
|
463
539
|
* Execute a skill with the provided parameters.
|
|
464
540
|
*
|
|
465
|
-
* @param {BrowserUse.
|
|
541
|
+
* @param {BrowserUse.ExecuteSkillSkillsSkillIdExecutePostRequest} request
|
|
466
542
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
467
543
|
*
|
|
468
544
|
* @throws {@link BrowserUse.BadRequestError}
|
|
@@ -472,7 +548,8 @@ export class Skills {
|
|
|
472
548
|
*
|
|
473
549
|
* @example
|
|
474
550
|
* await client.skills.executeSkill({
|
|
475
|
-
* skill_id: "skill_id"
|
|
551
|
+
* skill_id: "skill_id",
|
|
552
|
+
* body: {}
|
|
476
553
|
* })
|
|
477
554
|
*/
|
|
478
555
|
executeSkill(request, requestOptions) {
|
|
@@ -481,7 +558,7 @@ export class Skills {
|
|
|
481
558
|
__executeSkill(request, requestOptions) {
|
|
482
559
|
return __awaiter(this, void 0, void 0, function* () {
|
|
483
560
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
484
|
-
const { skill_id: skillId
|
|
561
|
+
const { skill_id: skillId, body: _body } = request;
|
|
485
562
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
486
563
|
const _response = yield core.fetcher({
|
|
487
564
|
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.mjs";
|
|
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.mjs";
|
|
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.mjs";
|
|
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,8 +1,9 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { CancelGenerationSkillsSkillIdCancelPostRequest } from "./CancelGenerationSkillsSkillIdCancelPostRequest.mjs";
|
|
2
2
|
export type { CreateSkillRequest } from "./CreateSkillRequest.mjs";
|
|
3
3
|
export type { DeleteSkillSkillsSkillIdDeleteRequest } from "./DeleteSkillSkillsSkillIdDeleteRequest.mjs";
|
|
4
|
-
export type {
|
|
4
|
+
export type { ExecuteSkillSkillsSkillIdExecutePostRequest } from "./ExecuteSkillSkillsSkillIdExecutePostRequest.mjs";
|
|
5
5
|
export type { GetSkillSkillsSkillIdGetRequest } from "./GetSkillSkillsSkillIdGetRequest.mjs";
|
|
6
6
|
export type { ListSkillsSkillsGetRequest } from "./ListSkillsSkillsGetRequest.mjs";
|
|
7
7
|
export type { RefineSkillRequest } from "./RefineSkillRequest.mjs";
|
|
8
|
+
export type { RollbackSkillSkillsSkillIdRollbackPostRequest } from "./RollbackSkillSkillsSkillIdRollbackPostRequest.mjs";
|
|
8
9
|
export type { UpdateSkillRequest } from "./UpdateSkillRequest.mjs";
|
|
@@ -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
|
}
|
|
@@ -14,7 +14,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
14
14
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
15
|
import * as BrowserUse from "../../../index.mjs";
|
|
16
16
|
export class SkillsMarketplace {
|
|
17
|
-
constructor(_options) {
|
|
17
|
+
constructor(_options = {}) {
|
|
18
18
|
this._options = _options;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -34,7 +34,7 @@ export class SkillsMarketplace {
|
|
|
34
34
|
__listSkills() {
|
|
35
35
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
36
36
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
37
|
-
const { pageSize, pageNumber, query, fromDate, toDate } = request;
|
|
37
|
+
const { pageSize, pageNumber, query, category, fromDate, toDate } = request;
|
|
38
38
|
const _queryParams = {};
|
|
39
39
|
if (pageSize != null) {
|
|
40
40
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -45,6 +45,9 @@ export class SkillsMarketplace {
|
|
|
45
45
|
if (query !== undefined) {
|
|
46
46
|
_queryParams.query = query;
|
|
47
47
|
}
|
|
48
|
+
if (category !== undefined) {
|
|
49
|
+
_queryParams.category = category;
|
|
50
|
+
}
|
|
48
51
|
if (fromDate !== undefined) {
|
|
49
52
|
_queryParams.fromDate = fromDate;
|
|
50
53
|
}
|
|
@@ -101,7 +104,7 @@ export class SkillsMarketplace {
|
|
|
101
104
|
/**
|
|
102
105
|
* Get details of a specific public skill from the marketplace.
|
|
103
106
|
*
|
|
104
|
-
* @param {BrowserUse.
|
|
107
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillSlugGetRequest} request
|
|
105
108
|
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
106
109
|
*
|
|
107
110
|
* @throws {@link BrowserUse.NotFoundError}
|
|
@@ -109,7 +112,7 @@ export class SkillsMarketplace {
|
|
|
109
112
|
*
|
|
110
113
|
* @example
|
|
111
114
|
* await client.skillsMarketplace.getSkill({
|
|
112
|
-
*
|
|
115
|
+
* skill_slug: "skill_slug"
|
|
113
116
|
* })
|
|
114
117
|
*/
|
|
115
118
|
getSkill(request, requestOptions) {
|
|
@@ -118,10 +121,10 @@ export class SkillsMarketplace {
|
|
|
118
121
|
__getSkill(request, requestOptions) {
|
|
119
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
123
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
|
-
const {
|
|
124
|
+
const { skill_slug: skillSlug } = request;
|
|
122
125
|
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
123
126
|
const _response = yield core.fetcher({
|
|
124
|
-
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(
|
|
127
|
+
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)}`),
|
|
125
128
|
method: "GET",
|
|
126
129
|
headers: _headers,
|
|
127
130
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -156,7 +159,7 @@ export class SkillsMarketplace {
|
|
|
156
159
|
rawResponse: _response.rawResponse,
|
|
157
160
|
});
|
|
158
161
|
case "timeout":
|
|
159
|
-
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{
|
|
162
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{skill_slug}.");
|
|
160
163
|
case "unknown":
|
|
161
164
|
throw new errors.BrowserUseError({
|
|
162
165
|
message: _response.error.errorMessage,
|
|
@@ -235,6 +238,83 @@ export class SkillsMarketplace {
|
|
|
235
238
|
}
|
|
236
239
|
});
|
|
237
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Execute a skill with the provided parameters.
|
|
243
|
+
*
|
|
244
|
+
* @param {BrowserUse.ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest} request
|
|
245
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
246
|
+
*
|
|
247
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
248
|
+
* @throws {@link BrowserUse.PaymentRequiredError}
|
|
249
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
250
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* await client.skillsMarketplace.executeSkill({
|
|
254
|
+
* skill_id: "skill_id",
|
|
255
|
+
* body: {}
|
|
256
|
+
* })
|
|
257
|
+
*/
|
|
258
|
+
executeSkill(request, requestOptions) {
|
|
259
|
+
return core.HttpResponsePromise.fromPromise(this.__executeSkill(request, requestOptions));
|
|
260
|
+
}
|
|
261
|
+
__executeSkill(request, requestOptions) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
264
|
+
const { skill_id: skillId, body: _body } = request;
|
|
265
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
266
|
+
const _response = yield core.fetcher({
|
|
267
|
+
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`),
|
|
268
|
+
method: "POST",
|
|
269
|
+
headers: _headers,
|
|
270
|
+
contentType: "application/json",
|
|
271
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
272
|
+
requestType: "json",
|
|
273
|
+
body: _body,
|
|
274
|
+
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,
|
|
275
|
+
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,
|
|
276
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
277
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
278
|
+
logging: this._options.logging,
|
|
279
|
+
});
|
|
280
|
+
if (_response.ok) {
|
|
281
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
282
|
+
}
|
|
283
|
+
if (_response.error.reason === "status-code") {
|
|
284
|
+
switch (_response.error.statusCode) {
|
|
285
|
+
case 400:
|
|
286
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
287
|
+
case 402:
|
|
288
|
+
throw new BrowserUse.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
289
|
+
case 404:
|
|
290
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 422:
|
|
292
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
293
|
+
default:
|
|
294
|
+
throw new errors.BrowserUseError({
|
|
295
|
+
statusCode: _response.error.statusCode,
|
|
296
|
+
body: _response.error.body,
|
|
297
|
+
rawResponse: _response.rawResponse,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
switch (_response.error.reason) {
|
|
302
|
+
case "non-json":
|
|
303
|
+
throw new errors.BrowserUseError({
|
|
304
|
+
statusCode: _response.error.statusCode,
|
|
305
|
+
body: _response.error.rawBody,
|
|
306
|
+
rawResponse: _response.rawResponse,
|
|
307
|
+
});
|
|
308
|
+
case "timeout":
|
|
309
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /marketplace/skills/{skill_id}/execute.");
|
|
310
|
+
case "unknown":
|
|
311
|
+
throw new errors.BrowserUseError({
|
|
312
|
+
message: _response.error.errorMessage,
|
|
313
|
+
rawResponse: _response.rawResponse,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
238
318
|
_getCustomAuthorizationHeaders() {
|
|
239
319
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
320
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.mjs";
|
|
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
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {}
|
|
@@ -6,6 +7,7 @@ export interface ListSkillsMarketplaceSkillsGetRequest {
|
|
|
6
7
|
pageSize?: number;
|
|
7
8
|
pageNumber?: number;
|
|
8
9
|
query?: string | null;
|
|
10
|
+
category?: BrowserUse.SkillCategory | null;
|
|
9
11
|
fromDate?: string | null;
|
|
10
12
|
toDate?: string | null;
|
|
11
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { CloneSkillMarketplaceSkillsSkillIdClonePostRequest } from "./CloneSkillMarketplaceSkillsSkillIdClonePostRequest.mjs";
|
|
2
|
-
export type {
|
|
2
|
+
export type { ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest } from "./ExecuteSkillMarketplaceSkillsSkillIdExecutePostRequest.mjs";
|
|
3
|
+
export type { GetSkillMarketplaceSkillsSkillSlugGetRequest } from "./GetSkillMarketplaceSkillsSkillSlugGetRequest.mjs";
|
|
3
4
|
export type { ListSkillsMarketplaceSkillsGetRequest } from "./ListSkillsMarketplaceSkillsGetRequest.mjs";
|
|
@@ -9,7 +9,7 @@ export declare namespace Tasks {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Tasks {
|
|
11
11
|
protected readonly _options: Tasks.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options?: Tasks.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Get paginated list of AI agent tasks with optional filtering by session and status.
|
|
15
15
|
*
|
|
@@ -24,9 +24,15 @@ export declare class Tasks {
|
|
|
24
24
|
listTasks(request?: BrowserUse.ListTasksTasksGetRequest, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<BrowserUse.TaskListResponse>;
|
|
25
25
|
private __listTasks;
|
|
26
26
|
/**
|
|
27
|
+
* Create and start a new task.
|
|
28
|
+
*
|
|
27
29
|
* You can either:
|
|
28
|
-
* 1. Start a new task (auto
|
|
29
|
-
* 2. Start a new task in an existing session (
|
|
30
|
+
* 1. Start a new task without a sessionId (auto-creates a session with US proxy by default)
|
|
31
|
+
* 2. Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
|
|
32
|
+
*
|
|
33
|
+
* Important: Proxy configuration (proxyCountryCode) is a session-level setting, not a task-level setting.
|
|
34
|
+
* To use a custom proxy location, create a session first via POST /sessions with your desired proxyCountryCode,
|
|
35
|
+
* then pass that sessionId when creating tasks.
|
|
30
36
|
*
|
|
31
37
|
* @param {BrowserUse.CreateTaskRequest} request
|
|
32
38
|
* @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -25,7 +25,7 @@ import * as environments from "../../../../environments.mjs";
|
|
|
25
25
|
import * as errors from "../../../../errors/index.mjs";
|
|
26
26
|
import * as BrowserUse from "../../../index.mjs";
|
|
27
27
|
export class Tasks {
|
|
28
|
-
constructor(_options) {
|
|
28
|
+
constructor(_options = {}) {
|
|
29
29
|
this._options = _options;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -110,9 +110,15 @@ export class Tasks {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
+
* Create and start a new task.
|
|
114
|
+
*
|
|
113
115
|
* You can either:
|
|
114
|
-
* 1. Start a new task (auto
|
|
115
|
-
* 2. Start a new task in an existing session (
|
|
116
|
+
* 1. Start a new task without a sessionId (auto-creates a session with US proxy by default)
|
|
117
|
+
* 2. Start a new task in an existing session (reuse for follow-up tasks or custom configuration)
|
|
118
|
+
*
|
|
119
|
+
* Important: Proxy configuration (proxyCountryCode) is a session-level setting, not a task-level setting.
|
|
120
|
+
* To use a custom proxy location, create a session first via POST /sessions with your desired proxyCountryCode,
|
|
121
|
+
* then pass that sessionId when creating tasks.
|
|
116
122
|
*
|
|
117
123
|
* @param {BrowserUse.CreateTaskRequest} request
|
|
118
124
|
* @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
|