browser-use-sdk 2.0.10 → 2.0.11
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/Client.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/browsers/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/browsers/client/Client.js +3 -2
- package/dist/cjs/api/resources/browsers/client/requests/UpdateBrowserSessionRequest.d.ts +5 -1
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/sessions/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/sessions/client/Client.js +3 -2
- package/dist/cjs/api/resources/sessions/client/requests/UpdateSessionRequest.d.ts +5 -1
- package/dist/cjs/api/resources/skills/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/skills/client/Client.js +20 -8
- package/dist/cjs/api/resources/skills/client/requests/CreateSkillRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.ts +4 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.d.ts +60 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/Client.js +281 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/index.js +17 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/CloneSkillMarketplaceSkillsSkillIdClonePostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/CloneSkillMarketplaceSkillsSkillIdClonePostRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillIdGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillIdGetRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.ts +11 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.js +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/skillsMarketplace/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/skillsMarketplace/index.d.ts +1 -0
- package/dist/cjs/api/resources/skillsMarketplace/index.js +17 -0
- package/dist/cjs/api/types/AppApiV2MarketplaceSkillsViewsParameterSchema.d.ts +11 -0
- package/dist/cjs/api/types/AppApiV2MarketplaceSkillsViewsParameterSchema.js +3 -0
- package/dist/cjs/api/types/AppApiV2MarketplaceSkillsViewsParameterType.d.ts +9 -0
- package/dist/cjs/api/types/AppApiV2MarketplaceSkillsViewsParameterType.js +12 -0
- package/dist/cjs/api/types/AppApiV2SkillsViewsParameterSchema.d.ts +11 -0
- package/dist/cjs/api/types/AppApiV2SkillsViewsParameterSchema.js +3 -0
- package/dist/cjs/api/types/AppApiV2SkillsViewsParameterType.d.ts +10 -0
- package/dist/cjs/api/types/AppApiV2SkillsViewsParameterType.js +13 -0
- package/dist/cjs/api/types/BrowserSessionUpdateAction.d.ts +4 -1
- package/dist/cjs/api/types/BrowserSessionUpdateAction.js +10 -0
- package/dist/cjs/api/types/MarketplaceSkillListResponse.d.ts +14 -0
- package/dist/cjs/api/types/MarketplaceSkillListResponse.js +3 -0
- package/dist/cjs/api/types/MarketplaceSkillResponse.d.ts +24 -0
- package/dist/cjs/api/types/MarketplaceSkillResponse.js +3 -0
- package/dist/cjs/api/types/SessionUpdateAction.d.ts +4 -1
- package/dist/cjs/api/types/SessionUpdateAction.js +10 -0
- package/dist/cjs/api/types/SkillResponse.d.ts +3 -1
- package/dist/cjs/api/types/UploadFilePresignedUrlResponse.d.ts +8 -1
- package/dist/cjs/api/types/UploadFilePresignedUrlResponse.js +8 -0
- package/dist/cjs/api/types/WorkflowYamlPresignedUploadResponse.d.ts +8 -1
- package/dist/cjs/api/types/WorkflowYamlPresignedUploadResponse.js +8 -0
- package/dist/cjs/api/types/index.d.ts +6 -2
- package/dist/cjs/api/types/index.js +6 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/browsers/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/browsers/client/Client.mjs +3 -2
- package/dist/esm/api/resources/browsers/client/requests/UpdateBrowserSessionRequest.d.mts +5 -1
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/sessions/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/sessions/client/Client.mjs +3 -2
- package/dist/esm/api/resources/sessions/client/requests/UpdateSessionRequest.d.mts +5 -1
- package/dist/esm/api/resources/skills/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/skills/client/Client.mjs +20 -8
- package/dist/esm/api/resources/skills/client/requests/CreateSkillRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.mts +4 -0
- package/dist/esm/api/resources/skillsMarketplace/client/Client.d.mts +60 -0
- package/dist/esm/api/resources/skillsMarketplace/client/Client.mjs +244 -0
- package/dist/esm/api/resources/skillsMarketplace/client/index.d.mts +1 -0
- package/dist/esm/api/resources/skillsMarketplace/client/index.mjs +1 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/CloneSkillMarketplaceSkillsSkillIdClonePostRequest.d.mts +9 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/CloneSkillMarketplaceSkillsSkillIdClonePostRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillIdGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/GetSkillMarketplaceSkillsSkillIdGetRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.d.mts +11 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/ListSkillsMarketplaceSkillsGetRequest.mjs +2 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/skillsMarketplace/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/skillsMarketplace/index.d.mts +1 -0
- package/dist/esm/api/resources/skillsMarketplace/index.mjs +1 -0
- package/dist/esm/api/types/AppApiV2MarketplaceSkillsViewsParameterSchema.d.mts +11 -0
- package/dist/esm/api/types/AppApiV2MarketplaceSkillsViewsParameterSchema.mjs +2 -0
- package/dist/esm/api/types/AppApiV2MarketplaceSkillsViewsParameterType.d.mts +9 -0
- package/dist/esm/api/types/AppApiV2MarketplaceSkillsViewsParameterType.mjs +9 -0
- package/dist/esm/api/types/AppApiV2SkillsViewsParameterSchema.d.mts +11 -0
- package/dist/esm/api/types/AppApiV2SkillsViewsParameterSchema.mjs +2 -0
- package/dist/esm/api/types/AppApiV2SkillsViewsParameterType.d.mts +10 -0
- package/dist/esm/api/types/AppApiV2SkillsViewsParameterType.mjs +10 -0
- package/dist/esm/api/types/BrowserSessionUpdateAction.d.mts +4 -1
- package/dist/esm/api/types/BrowserSessionUpdateAction.mjs +9 -1
- package/dist/esm/api/types/MarketplaceSkillListResponse.d.mts +14 -0
- package/dist/esm/api/types/MarketplaceSkillListResponse.mjs +2 -0
- package/dist/esm/api/types/MarketplaceSkillResponse.d.mts +24 -0
- package/dist/esm/api/types/MarketplaceSkillResponse.mjs +2 -0
- package/dist/esm/api/types/SessionUpdateAction.d.mts +4 -1
- package/dist/esm/api/types/SessionUpdateAction.mjs +9 -1
- package/dist/esm/api/types/SkillResponse.d.mts +3 -1
- package/dist/esm/api/types/UploadFilePresignedUrlResponse.d.mts +8 -1
- package/dist/esm/api/types/UploadFilePresignedUrlResponse.mjs +7 -1
- package/dist/esm/api/types/WorkflowYamlPresignedUploadResponse.d.mts +8 -1
- package/dist/esm/api/types/WorkflowYamlPresignedUploadResponse.mjs +7 -1
- package/dist/esm/api/types/index.d.mts +6 -2
- package/dist/esm/api/types/index.mjs +6 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +199 -3
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Files } from "./api/resources/files/client/Client.js";
|
|
|
4
4
|
import { Profiles } from "./api/resources/profiles/client/Client.js";
|
|
5
5
|
import { Sessions } from "./api/resources/sessions/client/Client.js";
|
|
6
6
|
import { Skills } from "./api/resources/skills/client/Client.js";
|
|
7
|
+
import { SkillsMarketplace } from "./api/resources/skillsMarketplace/client/Client.js";
|
|
7
8
|
import { Tasks } from "./api/resources/tasks/client/Client.js";
|
|
8
9
|
import { Workflows } from "./api/resources/workflows/client/Client.js";
|
|
9
10
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
@@ -22,6 +23,7 @@ export declare class BrowserUseClient {
|
|
|
22
23
|
protected _profiles: Profiles | undefined;
|
|
23
24
|
protected _browsers: Browsers | undefined;
|
|
24
25
|
protected _skills: Skills | undefined;
|
|
26
|
+
protected _skillsMarketplace: SkillsMarketplace | undefined;
|
|
25
27
|
protected _workflows: Workflows | undefined;
|
|
26
28
|
constructor(_options: BrowserUseClient.Options);
|
|
27
29
|
get billing(): Billing;
|
|
@@ -31,5 +33,6 @@ export declare class BrowserUseClient {
|
|
|
31
33
|
get profiles(): Profiles;
|
|
32
34
|
get browsers(): Browsers;
|
|
33
35
|
get skills(): Skills;
|
|
36
|
+
get skillsMarketplace(): SkillsMarketplace;
|
|
34
37
|
get workflows(): Workflows;
|
|
35
38
|
}
|
package/dist/cjs/Client.js
CHANGED
|
@@ -41,8 +41,9 @@ const Client_js_3 = require("./api/resources/files/client/Client.js");
|
|
|
41
41
|
const Client_js_4 = require("./api/resources/profiles/client/Client.js");
|
|
42
42
|
const Client_js_5 = require("./api/resources/sessions/client/Client.js");
|
|
43
43
|
const Client_js_6 = require("./api/resources/skills/client/Client.js");
|
|
44
|
-
const Client_js_7 = require("./api/resources/
|
|
45
|
-
const Client_js_8 = require("./api/resources/
|
|
44
|
+
const Client_js_7 = require("./api/resources/skillsMarketplace/client/Client.js");
|
|
45
|
+
const Client_js_8 = require("./api/resources/tasks/client/Client.js");
|
|
46
|
+
const Client_js_9 = require("./api/resources/workflows/client/Client.js");
|
|
46
47
|
const headers_js_1 = require("./core/headers.js");
|
|
47
48
|
const core = __importStar(require("./core/index.js"));
|
|
48
49
|
class BrowserUseClient {
|
|
@@ -50,8 +51,8 @@ class BrowserUseClient {
|
|
|
50
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)({
|
|
51
52
|
"X-Fern-Language": "JavaScript",
|
|
52
53
|
"X-Fern-SDK-Name": "browser-use-sdk",
|
|
53
|
-
"X-Fern-SDK-Version": "2.0.
|
|
54
|
-
"User-Agent": "browser-use-sdk/2.0.
|
|
54
|
+
"X-Fern-SDK-Version": "2.0.11",
|
|
55
|
+
"User-Agent": "browser-use-sdk/2.0.11",
|
|
55
56
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
57
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
58
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -62,7 +63,7 @@ class BrowserUseClient {
|
|
|
62
63
|
}
|
|
63
64
|
get tasks() {
|
|
64
65
|
var _a;
|
|
65
|
-
return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new
|
|
66
|
+
return ((_a = this._tasks) !== null && _a !== void 0 ? _a : (this._tasks = new Client_js_8.Tasks(this._options)));
|
|
66
67
|
}
|
|
67
68
|
get sessions() {
|
|
68
69
|
var _a;
|
|
@@ -84,9 +85,13 @@ class BrowserUseClient {
|
|
|
84
85
|
var _a;
|
|
85
86
|
return ((_a = this._skills) !== null && _a !== void 0 ? _a : (this._skills = new Client_js_6.Skills(this._options)));
|
|
86
87
|
}
|
|
88
|
+
get skillsMarketplace() {
|
|
89
|
+
var _a;
|
|
90
|
+
return ((_a = this._skillsMarketplace) !== null && _a !== void 0 ? _a : (this._skillsMarketplace = new Client_js_7.SkillsMarketplace(this._options)));
|
|
91
|
+
}
|
|
87
92
|
get workflows() {
|
|
88
93
|
var _a;
|
|
89
|
-
return ((_a = this._workflows) !== null && _a !== void 0 ? _a : (this._workflows = new
|
|
94
|
+
return ((_a = this._workflows) !== null && _a !== void 0 ? _a : (this._workflows = new Client_js_9.Workflows(this._options)));
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
exports.BrowserUseClient = BrowserUseClient;
|
|
@@ -81,7 +81,8 @@ export declare class Browsers {
|
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* await client.browsers.updateBrowserSession({
|
|
84
|
-
* session_id: "session_id"
|
|
84
|
+
* session_id: "session_id",
|
|
85
|
+
* action: "stop"
|
|
85
86
|
* })
|
|
86
87
|
*/
|
|
87
88
|
updateBrowserSession(request: BrowserUse.UpdateBrowserSessionRequest, requestOptions?: Browsers.RequestOptions): core.HttpResponsePromise<BrowserUse.BrowserSessionView>;
|
|
@@ -305,7 +305,8 @@ class Browsers {
|
|
|
305
305
|
*
|
|
306
306
|
* @example
|
|
307
307
|
* await client.browsers.updateBrowserSession({
|
|
308
|
-
* session_id: "session_id"
|
|
308
|
+
* session_id: "session_id",
|
|
309
|
+
* action: "stop"
|
|
309
310
|
* })
|
|
310
311
|
*/
|
|
311
312
|
updateBrowserSession(request, requestOptions) {
|
|
@@ -323,7 +324,7 @@ class Browsers {
|
|
|
323
324
|
contentType: "application/json",
|
|
324
325
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
325
326
|
requestType: "json",
|
|
326
|
-
body:
|
|
327
|
+
body: _body,
|
|
327
328
|
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,
|
|
328
329
|
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,
|
|
329
330
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
4
|
-
* session_id: "session_id"
|
|
5
|
+
* session_id: "session_id",
|
|
6
|
+
* action: "stop"
|
|
5
7
|
* }
|
|
6
8
|
*/
|
|
7
9
|
export interface UpdateBrowserSessionRequest {
|
|
8
10
|
session_id: string;
|
|
11
|
+
/** The action to perform on the session */
|
|
12
|
+
action: BrowserUse.BrowserSessionUpdateAction;
|
|
9
13
|
}
|
|
@@ -9,6 +9,8 @@ export * from "./sessions/client/requests/index.js";
|
|
|
9
9
|
export * as sessions from "./sessions/index.js";
|
|
10
10
|
export * from "./skills/client/requests/index.js";
|
|
11
11
|
export * as skills from "./skills/index.js";
|
|
12
|
+
export * from "./skillsMarketplace/client/requests/index.js";
|
|
13
|
+
export * as skillsMarketplace from "./skillsMarketplace/index.js";
|
|
12
14
|
export * from "./tasks/client/requests/index.js";
|
|
13
15
|
export * as tasks from "./tasks/index.js";
|
|
14
16
|
export * from "./workflows/client/requests/index.js";
|
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.workflows = exports.tasks = exports.skills = exports.sessions = exports.profiles = exports.files = exports.browsers = exports.billing = void 0;
|
|
39
|
+
exports.workflows = exports.tasks = exports.skillsMarketplace = exports.skills = exports.sessions = exports.profiles = exports.files = exports.browsers = exports.billing = void 0;
|
|
40
40
|
exports.billing = __importStar(require("./billing/index.js"));
|
|
41
41
|
__exportStar(require("./browsers/client/requests/index.js"), exports);
|
|
42
42
|
exports.browsers = __importStar(require("./browsers/index.js"));
|
|
@@ -48,6 +48,8 @@ __exportStar(require("./sessions/client/requests/index.js"), exports);
|
|
|
48
48
|
exports.sessions = __importStar(require("./sessions/index.js"));
|
|
49
49
|
__exportStar(require("./skills/client/requests/index.js"), exports);
|
|
50
50
|
exports.skills = __importStar(require("./skills/index.js"));
|
|
51
|
+
__exportStar(require("./skillsMarketplace/client/requests/index.js"), exports);
|
|
52
|
+
exports.skillsMarketplace = __importStar(require("./skillsMarketplace/index.js"));
|
|
51
53
|
__exportStar(require("./tasks/client/requests/index.js"), exports);
|
|
52
54
|
exports.tasks = __importStar(require("./tasks/index.js"));
|
|
53
55
|
__exportStar(require("./workflows/client/requests/index.js"), exports);
|
|
@@ -81,7 +81,8 @@ export declare class Sessions {
|
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* await client.sessions.updateSession({
|
|
84
|
-
* session_id: "session_id"
|
|
84
|
+
* session_id: "session_id",
|
|
85
|
+
* action: "stop"
|
|
85
86
|
* })
|
|
86
87
|
*/
|
|
87
88
|
updateSession(request: BrowserUse.UpdateSessionRequest, requestOptions?: Sessions.RequestOptions): core.HttpResponsePromise<BrowserUse.SessionView>;
|
|
@@ -351,7 +351,8 @@ class Sessions {
|
|
|
351
351
|
*
|
|
352
352
|
* @example
|
|
353
353
|
* await client.sessions.updateSession({
|
|
354
|
-
* session_id: "session_id"
|
|
354
|
+
* session_id: "session_id",
|
|
355
|
+
* action: "stop"
|
|
355
356
|
* })
|
|
356
357
|
*/
|
|
357
358
|
updateSession(request, requestOptions) {
|
|
@@ -369,7 +370,7 @@ class Sessions {
|
|
|
369
370
|
contentType: "application/json",
|
|
370
371
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
371
372
|
requestType: "json",
|
|
372
|
-
body:
|
|
373
|
+
body: _body,
|
|
373
374
|
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,
|
|
374
375
|
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,
|
|
375
376
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import type * as BrowserUse from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
4
|
-
* session_id: "session_id"
|
|
5
|
+
* session_id: "session_id",
|
|
6
|
+
* action: "stop"
|
|
5
7
|
* }
|
|
6
8
|
*/
|
|
7
9
|
export interface UpdateSessionRequest {
|
|
8
10
|
session_id: string;
|
|
11
|
+
/** The action to perform on the session */
|
|
12
|
+
action: BrowserUse.SessionUpdateAction;
|
|
9
13
|
}
|
|
@@ -11,7 +11,7 @@ export declare class Skills {
|
|
|
11
11
|
protected readonly _options: Skills.Options;
|
|
12
12
|
constructor(_options: Skills.Options);
|
|
13
13
|
/**
|
|
14
|
-
* List all skills owned by the authenticated project with optional filtering
|
|
14
|
+
* List all skills owned by the authenticated project with optional filtering.
|
|
15
15
|
*
|
|
16
16
|
* @param {BrowserUse.ListSkillsSkillsGetRequest} request
|
|
17
17
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -65,7 +65,7 @@ class Skills {
|
|
|
65
65
|
this._options = _options;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* List all skills owned by the authenticated project with optional filtering
|
|
68
|
+
* List all skills owned by the authenticated project with optional filtering.
|
|
69
69
|
*
|
|
70
70
|
* @param {BrowserUse.ListSkillsSkillsGetRequest} request
|
|
71
71
|
* @param {Skills.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -80,8 +80,8 @@ class Skills {
|
|
|
80
80
|
}
|
|
81
81
|
__listSkills() {
|
|
82
82
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
83
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
84
|
-
const { pageSize, pageNumber, isPublic } = request;
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
84
|
+
const { pageSize, pageNumber, isPublic, isEnabled, query, fromDate, toDate } = request;
|
|
85
85
|
const _queryParams = {};
|
|
86
86
|
if (pageSize != null) {
|
|
87
87
|
_queryParams.pageSize = pageSize.toString();
|
|
@@ -92,16 +92,28 @@ class Skills {
|
|
|
92
92
|
if (isPublic !== undefined) {
|
|
93
93
|
_queryParams.isPublic = (_a = isPublic === null || isPublic === void 0 ? void 0 : isPublic.toString()) !== null && _a !== void 0 ? _a : null;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
if (isEnabled !== undefined) {
|
|
96
|
+
_queryParams.isEnabled = (_b = isEnabled === null || isEnabled === void 0 ? void 0 : isEnabled.toString()) !== null && _b !== void 0 ? _b : null;
|
|
97
|
+
}
|
|
98
|
+
if (query !== undefined) {
|
|
99
|
+
_queryParams.query = query;
|
|
100
|
+
}
|
|
101
|
+
if (fromDate !== undefined) {
|
|
102
|
+
_queryParams.fromDate = fromDate;
|
|
103
|
+
}
|
|
104
|
+
if (toDate !== undefined) {
|
|
105
|
+
_queryParams.toDate = toDate;
|
|
106
|
+
}
|
|
107
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
96
108
|
const _response = yield core.fetcher({
|
|
97
|
-
url: core.url.join((
|
|
109
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.BrowserUseEnvironment.Production, "skills"),
|
|
98
110
|
method: "GET",
|
|
99
111
|
headers: _headers,
|
|
100
112
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
101
|
-
timeoutMs: ((
|
|
102
|
-
maxRetries: (
|
|
113
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
114
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
103
115
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
104
|
-
fetchFn: (
|
|
116
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
105
117
|
logging: this._options.logging,
|
|
106
118
|
});
|
|
107
119
|
if (_response.ok) {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
export interface CreateSkillRequest {
|
|
9
9
|
/** Optional title for the skill (will be generated if not provided) */
|
|
10
10
|
title?: string | null;
|
|
11
|
+
/** Optional description for the skill (will be generated if not provided) */
|
|
12
|
+
description?: string | null;
|
|
11
13
|
/** Goal of the skill (description of what the skill does and what the user should expect from it) */
|
|
12
14
|
goal: string;
|
|
13
15
|
/** Prompt for the agent to use when generating the skill automatically */
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import * as BrowserUse from "../../../index.js";
|
|
4
|
+
export declare namespace SkillsMarketplace {
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
6
|
+
}
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class SkillsMarketplace {
|
|
11
|
+
protected readonly _options: SkillsMarketplace.Options;
|
|
12
|
+
constructor(_options: SkillsMarketplace.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List all public skills available in the marketplace with optional filtering.
|
|
15
|
+
*
|
|
16
|
+
* @param {BrowserUse.ListSkillsMarketplaceSkillsGetRequest} request
|
|
17
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.skillsMarketplace.listSkills()
|
|
23
|
+
*/
|
|
24
|
+
listSkills(request?: BrowserUse.ListSkillsMarketplaceSkillsGetRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.MarketplaceSkillListResponse>;
|
|
25
|
+
private __listSkills;
|
|
26
|
+
/**
|
|
27
|
+
* Get details of a specific public skill from the marketplace.
|
|
28
|
+
*
|
|
29
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillIdGetRequest} request
|
|
30
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
+
*
|
|
32
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
33
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.skillsMarketplace.getSkill({
|
|
37
|
+
* skill_id: "skill_id"
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
getSkill(request: BrowserUse.GetSkillMarketplaceSkillsSkillIdGetRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.MarketplaceSkillResponse>;
|
|
41
|
+
private __getSkill;
|
|
42
|
+
/**
|
|
43
|
+
* Clone a public marketplace skill to the user's project.
|
|
44
|
+
*
|
|
45
|
+
* @param {BrowserUse.CloneSkillMarketplaceSkillsSkillIdClonePostRequest} request
|
|
46
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
49
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
50
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* await client.skillsMarketplace.cloneSkill({
|
|
54
|
+
* skill_id: "skill_id"
|
|
55
|
+
* })
|
|
56
|
+
*/
|
|
57
|
+
cloneSkill(request: BrowserUse.CloneSkillMarketplaceSkillsSkillIdClonePostRequest, requestOptions?: SkillsMarketplace.RequestOptions): core.HttpResponsePromise<BrowserUse.MarketplaceSkillResponse>;
|
|
58
|
+
private __cloneSkill;
|
|
59
|
+
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.SkillsMarketplace = void 0;
|
|
47
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
+
const BrowserUse = __importStar(require("../../../index.js"));
|
|
52
|
+
class SkillsMarketplace {
|
|
53
|
+
constructor(_options) {
|
|
54
|
+
this._options = _options;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* List all public skills available in the marketplace with optional filtering.
|
|
58
|
+
*
|
|
59
|
+
* @param {BrowserUse.ListSkillsMarketplaceSkillsGetRequest} request
|
|
60
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.skillsMarketplace.listSkills()
|
|
66
|
+
*/
|
|
67
|
+
listSkills(request = {}, requestOptions) {
|
|
68
|
+
return core.HttpResponsePromise.fromPromise(this.__listSkills(request, requestOptions));
|
|
69
|
+
}
|
|
70
|
+
__listSkills() {
|
|
71
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
|
+
const { pageSize, pageNumber, query, fromDate, toDate } = request;
|
|
74
|
+
const _queryParams = {};
|
|
75
|
+
if (pageSize != null) {
|
|
76
|
+
_queryParams.pageSize = pageSize.toString();
|
|
77
|
+
}
|
|
78
|
+
if (pageNumber != null) {
|
|
79
|
+
_queryParams.pageNumber = pageNumber.toString();
|
|
80
|
+
}
|
|
81
|
+
if (query !== undefined) {
|
|
82
|
+
_queryParams.query = query;
|
|
83
|
+
}
|
|
84
|
+
if (fromDate !== undefined) {
|
|
85
|
+
_queryParams.fromDate = fromDate;
|
|
86
|
+
}
|
|
87
|
+
if (toDate !== undefined) {
|
|
88
|
+
_queryParams.toDate = toDate;
|
|
89
|
+
}
|
|
90
|
+
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);
|
|
91
|
+
const _response = yield core.fetcher({
|
|
92
|
+
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"),
|
|
93
|
+
method: "GET",
|
|
94
|
+
headers: _headers,
|
|
95
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
96
|
+
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,
|
|
97
|
+
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,
|
|
98
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
99
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
100
|
+
logging: this._options.logging,
|
|
101
|
+
});
|
|
102
|
+
if (_response.ok) {
|
|
103
|
+
return {
|
|
104
|
+
data: _response.body,
|
|
105
|
+
rawResponse: _response.rawResponse,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (_response.error.reason === "status-code") {
|
|
109
|
+
switch (_response.error.statusCode) {
|
|
110
|
+
case 422:
|
|
111
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
112
|
+
default:
|
|
113
|
+
throw new errors.BrowserUseError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
switch (_response.error.reason) {
|
|
121
|
+
case "non-json":
|
|
122
|
+
throw new errors.BrowserUseError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills.");
|
|
129
|
+
case "unknown":
|
|
130
|
+
throw new errors.BrowserUseError({
|
|
131
|
+
message: _response.error.errorMessage,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get details of a specific public skill from the marketplace.
|
|
139
|
+
*
|
|
140
|
+
* @param {BrowserUse.GetSkillMarketplaceSkillsSkillIdGetRequest} request
|
|
141
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
144
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* await client.skillsMarketplace.getSkill({
|
|
148
|
+
* skill_id: "skill_id"
|
|
149
|
+
* })
|
|
150
|
+
*/
|
|
151
|
+
getSkill(request, requestOptions) {
|
|
152
|
+
return core.HttpResponsePromise.fromPromise(this.__getSkill(request, requestOptions));
|
|
153
|
+
}
|
|
154
|
+
__getSkill(request, requestOptions) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
157
|
+
const { skill_id: skillId } = request;
|
|
158
|
+
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
|
+
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(skillId)}`),
|
|
161
|
+
method: "GET",
|
|
162
|
+
headers: _headers,
|
|
163
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
164
|
+
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,
|
|
165
|
+
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,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
168
|
+
logging: this._options.logging,
|
|
169
|
+
});
|
|
170
|
+
if (_response.ok) {
|
|
171
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
172
|
+
}
|
|
173
|
+
if (_response.error.reason === "status-code") {
|
|
174
|
+
switch (_response.error.statusCode) {
|
|
175
|
+
case 404:
|
|
176
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
177
|
+
case 422:
|
|
178
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
179
|
+
default:
|
|
180
|
+
throw new errors.BrowserUseError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.body,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
switch (_response.error.reason) {
|
|
188
|
+
case "non-json":
|
|
189
|
+
throw new errors.BrowserUseError({
|
|
190
|
+
statusCode: _response.error.statusCode,
|
|
191
|
+
body: _response.error.rawBody,
|
|
192
|
+
rawResponse: _response.rawResponse,
|
|
193
|
+
});
|
|
194
|
+
case "timeout":
|
|
195
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling GET /marketplace/skills/{skill_id}.");
|
|
196
|
+
case "unknown":
|
|
197
|
+
throw new errors.BrowserUseError({
|
|
198
|
+
message: _response.error.errorMessage,
|
|
199
|
+
rawResponse: _response.rawResponse,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Clone a public marketplace skill to the user's project.
|
|
206
|
+
*
|
|
207
|
+
* @param {BrowserUse.CloneSkillMarketplaceSkillsSkillIdClonePostRequest} request
|
|
208
|
+
* @param {SkillsMarketplace.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
|
+
*
|
|
210
|
+
* @throws {@link BrowserUse.BadRequestError}
|
|
211
|
+
* @throws {@link BrowserUse.NotFoundError}
|
|
212
|
+
* @throws {@link BrowserUse.UnprocessableEntityError}
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* await client.skillsMarketplace.cloneSkill({
|
|
216
|
+
* skill_id: "skill_id"
|
|
217
|
+
* })
|
|
218
|
+
*/
|
|
219
|
+
cloneSkill(request, requestOptions) {
|
|
220
|
+
return core.HttpResponsePromise.fromPromise(this.__cloneSkill(request, requestOptions));
|
|
221
|
+
}
|
|
222
|
+
__cloneSkill(request, requestOptions) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
225
|
+
const { skill_id: skillId } = request;
|
|
226
|
+
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);
|
|
227
|
+
const _response = yield core.fetcher({
|
|
228
|
+
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)}/clone`),
|
|
229
|
+
method: "POST",
|
|
230
|
+
headers: _headers,
|
|
231
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
232
|
+
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,
|
|
233
|
+
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,
|
|
234
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
235
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
236
|
+
logging: this._options.logging,
|
|
237
|
+
});
|
|
238
|
+
if (_response.ok) {
|
|
239
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
240
|
+
}
|
|
241
|
+
if (_response.error.reason === "status-code") {
|
|
242
|
+
switch (_response.error.statusCode) {
|
|
243
|
+
case 400:
|
|
244
|
+
throw new BrowserUse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
245
|
+
case 404:
|
|
246
|
+
throw new BrowserUse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
247
|
+
case 422:
|
|
248
|
+
throw new BrowserUse.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
249
|
+
default:
|
|
250
|
+
throw new errors.BrowserUseError({
|
|
251
|
+
statusCode: _response.error.statusCode,
|
|
252
|
+
body: _response.error.body,
|
|
253
|
+
rawResponse: _response.rawResponse,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
switch (_response.error.reason) {
|
|
258
|
+
case "non-json":
|
|
259
|
+
throw new errors.BrowserUseError({
|
|
260
|
+
statusCode: _response.error.statusCode,
|
|
261
|
+
body: _response.error.rawBody,
|
|
262
|
+
rawResponse: _response.rawResponse,
|
|
263
|
+
});
|
|
264
|
+
case "timeout":
|
|
265
|
+
throw new errors.BrowserUseTimeoutError("Timeout exceeded when calling POST /marketplace/skills/{skill_id}/clone.");
|
|
266
|
+
case "unknown":
|
|
267
|
+
throw new errors.BrowserUseError({
|
|
268
|
+
message: _response.error.errorMessage,
|
|
269
|
+
rawResponse: _response.rawResponse,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
_getCustomAuthorizationHeaders() {
|
|
275
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
276
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
277
|
+
return { "X-Browser-Use-API-Key": apiKeyValue };
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports.SkillsMarketplace = SkillsMarketplace;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|