botasaurus-desktop-api 4.1.94 → 4.1.96
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/bundle.js +39 -2
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -3001,7 +3001,7 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
|
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
3003
|
async getTasks() {
|
|
3004
|
-
let { page = 1, perPage, withResults = false, parentTaskId } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
3004
|
+
let { page = 1, perPage, withResults = false, parentTaskId, status } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
3005
3005
|
page: 1,
|
|
3006
3006
|
withResults: true
|
|
3007
3007
|
};
|
|
@@ -3012,6 +3012,7 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
|
|
|
3012
3012
|
* @param perPage The number of tasks to return per page.
|
|
3013
3013
|
* @param withResults Whether to include the task results in the response.
|
|
3014
3014
|
* @param parentTaskId Filter tasks by parent task ID.
|
|
3015
|
+
* @param status Filter tasks by status (pending, in_progress, completed, failed, aborted).
|
|
3015
3016
|
* @return A dictionary containing the task results and pagination information.
|
|
3016
3017
|
*/ const url = this._makeApiUrl("tasks");
|
|
3017
3018
|
const params = {
|
|
@@ -3020,6 +3021,7 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
|
|
|
3020
3021
|
if (page !== undefined && page !== null) params.page = page;
|
|
3021
3022
|
if (perPage !== undefined && perPage !== null) params.per_page = perPage;
|
|
3022
3023
|
if (parentTaskId !== undefined && parentTaskId !== null) params.parent_task_id = parentTaskId;
|
|
3024
|
+
if (status !== undefined && status !== null) params.status = status;
|
|
3023
3025
|
try {
|
|
3024
3026
|
const response = await axios__WEBPACK_IMPORTED_MODULE_1__["default"].get(url, {
|
|
3025
3027
|
params
|
|
@@ -3040,6 +3042,19 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
|
|
|
3040
3042
|
throw error;
|
|
3041
3043
|
}
|
|
3042
3044
|
}
|
|
3045
|
+
async getFailedTasks() {
|
|
3046
|
+
let { page = 1, perPage, withResults = false, parentTaskId } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
3047
|
+
page: 1,
|
|
3048
|
+
withResults: true
|
|
3049
|
+
};
|
|
3050
|
+
return this.getTasks({
|
|
3051
|
+
page,
|
|
3052
|
+
perPage,
|
|
3053
|
+
withResults,
|
|
3054
|
+
parentTaskId,
|
|
3055
|
+
status: 'failed'
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3043
3058
|
async getTask(taskId) {
|
|
3044
3059
|
/**
|
|
3045
3060
|
* Retrieves a specific task by ID.
|
|
@@ -3256,6 +3271,28 @@ const api = new Api({ apiUrl: 'https://example.com' })`);
|
|
|
3256
3271
|
throw error;
|
|
3257
3272
|
}
|
|
3258
3273
|
}
|
|
3274
|
+
async retryTasks(param) {
|
|
3275
|
+
let { taskIds } = param;
|
|
3276
|
+
/**
|
|
3277
|
+
* Bulk retries failed tasks.
|
|
3278
|
+
*
|
|
3279
|
+
* @param taskIds A list of task IDs to be retried.
|
|
3280
|
+
* @return A success message.
|
|
3281
|
+
*/ const url = this._makeApiUrl("tasks/bulk-retry");
|
|
3282
|
+
const payload = {
|
|
3283
|
+
task_ids: taskIds
|
|
3284
|
+
};
|
|
3285
|
+
try {
|
|
3286
|
+
const response = await axios__WEBPACK_IMPORTED_MODULE_1__["default"].post(url, payload);
|
|
3287
|
+
this._writeJson("retry_tasks", response.data);
|
|
3288
|
+
return response.data;
|
|
3289
|
+
} catch (error) {
|
|
3290
|
+
if (axios__WEBPACK_IMPORTED_MODULE_1__["default"].isAxiosError(error)) {
|
|
3291
|
+
raiseIfBadException(error.response);
|
|
3292
|
+
}
|
|
3293
|
+
throw error;
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3259
3296
|
constructor({ apiUrl, createResponseFiles = false, apiBasePath = "", enableCache } = {
|
|
3260
3297
|
createResponseFiles: true
|
|
3261
3298
|
}){
|
|
@@ -8015,7 +8052,7 @@ __webpack_require__.hu = (chunkId) => ('' + chunkId + '.' + __webpack_require__.
|
|
|
8015
8052
|
})();
|
|
8016
8053
|
// webpack/runtime/get_full_hash
|
|
8017
8054
|
(() => {
|
|
8018
|
-
__webpack_require__.h = () => ("
|
|
8055
|
+
__webpack_require__.h = () => ("68ecd7a2c0c37c10")
|
|
8019
8056
|
})();
|
|
8020
8057
|
// webpack/runtime/get_main_filename/update manifest
|
|
8021
8058
|
(() => {
|