browser-use-sdk 2.0.10 → 2.0.12
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 +20 -3
- package/dist/cjs/api/resources/skills/client/Client.js +93 -11
- 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/CreateSkillRequest.d.ts +2 -0
- package/dist/cjs/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.ts +4 -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/index.d.ts +2 -1
- 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/CannotRollbackPublicSkillError.d.ts +6 -0
- package/dist/cjs/api/types/CannotRollbackPublicSkillError.js +3 -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/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/SessionUpdateAction.d.ts +4 -1
- package/dist/cjs/api/types/SessionUpdateAction.js +10 -0
- package/dist/cjs/api/types/SkillResponse.d.ts +6 -0
- 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 +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- 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 +20 -3
- package/dist/esm/api/resources/skills/client/Client.mjs +93 -11
- 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/CreateSkillRequest.d.mts +2 -0
- package/dist/esm/api/resources/skills/client/requests/ListSkillsSkillsGetRequest.d.mts +4 -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/index.d.mts +2 -1
- 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/CannotRollbackPublicSkillError.d.mts +6 -0
- package/dist/esm/api/types/CannotRollbackPublicSkillError.mjs +2 -0
- 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/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/SessionUpdateAction.d.mts +4 -1
- package/dist/esm/api/types/SessionUpdateAction.mjs +9 -1
- package/dist/esm/api/types/SkillResponse.d.mts +6 -0
- 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 +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +265 -4
|
@@ -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);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { CloneSkillMarketplaceSkillsSkillIdClonePostRequest } from "./CloneSkillMarketplaceSkillsSkillIdClonePostRequest.js";
|
|
2
|
+
export type { GetSkillMarketplaceSkillsSkillIdGetRequest } from "./GetSkillMarketplaceSkillsSkillIdGetRequest.js";
|
|
3
|
+
export type { ListSkillsMarketplaceSkillsGetRequest } from "./ListSkillsMarketplaceSkillsGetRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/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("./client/index.js"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as BrowserUse from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for a skill parameter.
|
|
4
|
+
*/
|
|
5
|
+
export interface AppApiV2MarketplaceSkillsViewsParameterSchema {
|
|
6
|
+
name: string;
|
|
7
|
+
type: BrowserUse.AppApiV2MarketplaceSkillsViewsParameterType;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
default?: unknown | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Type of a skill parameter. */
|
|
2
|
+
export declare const AppApiV2MarketplaceSkillsViewsParameterType: {
|
|
3
|
+
readonly String: "string";
|
|
4
|
+
readonly Number: "number";
|
|
5
|
+
readonly Boolean: "boolean";
|
|
6
|
+
readonly Object: "object";
|
|
7
|
+
readonly Array: "array";
|
|
8
|
+
};
|
|
9
|
+
export type AppApiV2MarketplaceSkillsViewsParameterType = (typeof AppApiV2MarketplaceSkillsViewsParameterType)[keyof typeof AppApiV2MarketplaceSkillsViewsParameterType];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AppApiV2MarketplaceSkillsViewsParameterType = void 0;
|
|
5
|
+
/** Type of a skill parameter. */
|
|
6
|
+
exports.AppApiV2MarketplaceSkillsViewsParameterType = {
|
|
7
|
+
String: "string",
|
|
8
|
+
Number: "number",
|
|
9
|
+
Boolean: "boolean",
|
|
10
|
+
Object: "object",
|
|
11
|
+
Array: "array",
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as BrowserUse from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for a skill parameter.
|
|
4
|
+
*/
|
|
5
|
+
export interface AppApiV2SkillsViewsParameterSchema {
|
|
6
|
+
name: string;
|
|
7
|
+
type: BrowserUse.AppApiV2SkillsViewsParameterType;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
default?: unknown | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Type of a skill parameter. */
|
|
2
|
+
export declare const AppApiV2SkillsViewsParameterType: {
|
|
3
|
+
readonly String: "string";
|
|
4
|
+
readonly Number: "number";
|
|
5
|
+
readonly Boolean: "boolean";
|
|
6
|
+
readonly Object: "object";
|
|
7
|
+
readonly Array: "array";
|
|
8
|
+
readonly Cookie: "cookie";
|
|
9
|
+
};
|
|
10
|
+
export type AppApiV2SkillsViewsParameterType = (typeof AppApiV2SkillsViewsParameterType)[keyof typeof AppApiV2SkillsViewsParameterType];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AppApiV2SkillsViewsParameterType = void 0;
|
|
5
|
+
/** Type of a skill parameter. */
|
|
6
|
+
exports.AppApiV2SkillsViewsParameterType = {
|
|
7
|
+
String: "string",
|
|
8
|
+
Number: "number",
|
|
9
|
+
Boolean: "boolean",
|
|
10
|
+
Object: "object",
|
|
11
|
+
Array: "array",
|
|
12
|
+
Cookie: "cookie",
|
|
13
|
+
};
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* Attributes:
|
|
5
5
|
* STOP: Stop the browser session (cannot be undone)
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare const BrowserSessionUpdateAction: {
|
|
8
|
+
readonly Stop: "stop";
|
|
9
|
+
};
|
|
10
|
+
export type BrowserSessionUpdateAction = (typeof BrowserSessionUpdateAction)[keyof typeof BrowserSessionUpdateAction];
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BrowserSessionUpdateAction = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Available actions that can be performed on a browser session
|
|
7
|
+
*
|
|
8
|
+
* Attributes:
|
|
9
|
+
* STOP: Stop the browser session (cannot be undone)
|
|
10
|
+
*/
|
|
11
|
+
exports.BrowserSessionUpdateAction = {
|
|
12
|
+
Stop: "stop",
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as BrowserUse from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Response for listing skills.
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketplaceSkillListResponse {
|
|
6
|
+
/** List of skills */
|
|
7
|
+
items: BrowserUse.MarketplaceSkillResponse[];
|
|
8
|
+
/** Total number of items in the list */
|
|
9
|
+
totalItems: number;
|
|
10
|
+
/** Page number */
|
|
11
|
+
pageNumber: number;
|
|
12
|
+
/** Number of items per page */
|
|
13
|
+
pageSize: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as BrowserUse from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Skill information returned by the API.
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketplaceSkillResponse {
|
|
6
|
+
/** Unique identifier for the skill */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Title of the skill (shows up in the public view) */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Description of the skill (shows up in the public view) */
|
|
11
|
+
description: string;
|
|
12
|
+
/** Input parameters of the skill */
|
|
13
|
+
parameters: BrowserUse.ParameterSchema[];
|
|
14
|
+
/** Output schema of the skill */
|
|
15
|
+
outputSchema: Record<string, unknown>;
|
|
16
|
+
/** Current version of the skill */
|
|
17
|
+
currentVersion: number | null;
|
|
18
|
+
/** Whether the skill is official (verified by Browser Use) */
|
|
19
|
+
isOfficial: boolean;
|
|
20
|
+
/** Creation timestamp */
|
|
21
|
+
createdAt: string;
|
|
22
|
+
/** Last update timestamp */
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* Attributes:
|
|
5
5
|
* STOP: Stop the session and all its associated tasks (cannot be undone)
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare const SessionUpdateAction: {
|
|
8
|
+
readonly Stop: "stop";
|
|
9
|
+
};
|
|
10
|
+
export type SessionUpdateAction = (typeof SessionUpdateAction)[keyof typeof SessionUpdateAction];
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SessionUpdateAction = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Available actions that can be performed on a session
|
|
7
|
+
*
|
|
8
|
+
* Attributes:
|
|
9
|
+
* STOP: Stop the session and all its associated tasks (cannot be undone)
|
|
10
|
+
*/
|
|
11
|
+
exports.SessionUpdateAction = {
|
|
12
|
+
Stop: "stop",
|
|
13
|
+
};
|
|
@@ -27,6 +27,12 @@ export interface SkillResponse {
|
|
|
27
27
|
isOwner: boolean;
|
|
28
28
|
/** Current version of the skill */
|
|
29
29
|
currentVersion: number | null;
|
|
30
|
+
/** When the current version started generating */
|
|
31
|
+
currentVersionStartedAt?: string | null;
|
|
32
|
+
/** When the current version finished generating */
|
|
33
|
+
currentVersionFinishedAt?: string | null;
|
|
34
|
+
/** Base64 encoded generated code (contact support@browser-use.com to get access) - ENTERPRISE ONLY */
|
|
35
|
+
code?: string | null;
|
|
30
36
|
/** Creation timestamp */
|
|
31
37
|
createdAt: string;
|
|
32
38
|
/** Last update timestamp */
|
|
@@ -5,7 +5,7 @@ export interface UploadFilePresignedUrlResponse {
|
|
|
5
5
|
/** The URL to upload the file to. */
|
|
6
6
|
url: string;
|
|
7
7
|
/** The HTTP method to use for the upload. */
|
|
8
|
-
method:
|
|
8
|
+
method: UploadFilePresignedUrlResponse.Method;
|
|
9
9
|
/** The form fields to include in the upload request. */
|
|
10
10
|
fields: Record<string, string>;
|
|
11
11
|
/** The name of the file to upload (should be referenced when user wants to use the file in a task). */
|
|
@@ -13,3 +13,10 @@ export interface UploadFilePresignedUrlResponse {
|
|
|
13
13
|
/** The number of seconds until the presigned URL expires. */
|
|
14
14
|
expiresIn: number;
|
|
15
15
|
}
|
|
16
|
+
export declare namespace UploadFilePresignedUrlResponse {
|
|
17
|
+
/** The HTTP method to use for the upload. */
|
|
18
|
+
const Method: {
|
|
19
|
+
readonly Post: "POST";
|
|
20
|
+
};
|
|
21
|
+
type Method = (typeof Method)[keyof typeof Method];
|
|
22
|
+
}
|