webcrawlerapi-js 2.0.1 → 2.0.3
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/@types/api.d.ts +2 -2
- package/dist/@types/constants.d.ts +3 -0
- package/dist/@types/model.d.ts +5 -1
- package/dist/api.js +2 -1
- package/dist/constants.js +4 -1
- package/package.json +10 -7
package/dist/@types/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CrawlRequest, Job, JobId, ScrapeRequest, ScrapeResponse, ScrapeResponseError, ScrapeId, Action } from "./model";
|
|
2
|
-
import { JobStatus } from "./constants";
|
|
2
|
+
import { JobStatus, ErrorCode } from "./constants";
|
|
3
3
|
import { WebcrawlerApiError } from "./errors";
|
|
4
|
-
export { WebcrawlerApiError, JobStatus };
|
|
4
|
+
export { WebcrawlerApiError, JobStatus, ErrorCode };
|
|
5
5
|
export * from "./model";
|
|
6
6
|
export declare class WebcrawlerClient {
|
|
7
7
|
protected apiVersion: string;
|
|
@@ -3,6 +3,9 @@ export declare const JobStatus: {
|
|
|
3
3
|
readonly NEW: "new";
|
|
4
4
|
readonly DONE: "done";
|
|
5
5
|
};
|
|
6
|
+
export declare const ErrorCode: {
|
|
7
|
+
readonly BLOCKED_BY_ROBOTS_TXT: "blocked_by_robots_txt";
|
|
8
|
+
};
|
|
6
9
|
export declare const HttpStatus: {
|
|
7
10
|
readonly OK: 200;
|
|
8
11
|
readonly BAD_REQUEST: 400;
|
package/dist/@types/model.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export interface ScrapeRequest {
|
|
2
2
|
url: string;
|
|
3
|
-
output_format
|
|
3
|
+
output_format?: string;
|
|
4
4
|
webhook_url?: string;
|
|
5
5
|
clean_selectors?: string;
|
|
6
6
|
actions?: Action[];
|
|
7
7
|
prompt?: string;
|
|
8
|
+
respect_robots_txt?: boolean;
|
|
9
|
+
main_content_only?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export interface ScrapeId {
|
|
10
12
|
id: string;
|
|
@@ -38,6 +40,8 @@ export interface CrawlRequest {
|
|
|
38
40
|
allow_subdomains?: boolean;
|
|
39
41
|
webhook_url?: string;
|
|
40
42
|
actions?: Action[];
|
|
43
|
+
respect_robots_txt?: boolean;
|
|
44
|
+
main_content_only?: boolean;
|
|
41
45
|
}
|
|
42
46
|
export interface Job {
|
|
43
47
|
id: string;
|
package/dist/api.js
CHANGED
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WebcrawlerClient = exports.JobStatus = exports.WebcrawlerApiError = void 0;
|
|
17
|
+
exports.WebcrawlerClient = exports.ErrorCode = exports.JobStatus = exports.WebcrawlerApiError = void 0;
|
|
18
18
|
const constants_1 = require("./constants");
|
|
19
19
|
Object.defineProperty(exports, "JobStatus", { enumerable: true, get: function () { return constants_1.JobStatus; } });
|
|
20
|
+
Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return constants_1.ErrorCode; } });
|
|
20
21
|
const errors_1 = require("./errors");
|
|
21
22
|
Object.defineProperty(exports, "WebcrawlerApiError", { enumerable: true, get: function () { return errors_1.WebcrawlerApiError; } });
|
|
22
23
|
const BASE_PATH = "https://api.webcrawlerapi.com";
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpStatus = exports.JobStatus = void 0;
|
|
3
|
+
exports.HttpStatus = exports.ErrorCode = exports.JobStatus = void 0;
|
|
4
4
|
exports.JobStatus = {
|
|
5
5
|
IN_PROGRESS: 'in_progress',
|
|
6
6
|
NEW: 'new',
|
|
7
7
|
DONE: 'done'
|
|
8
8
|
};
|
|
9
|
+
exports.ErrorCode = {
|
|
10
|
+
BLOCKED_BY_ROBOTS_TXT: 'blocked_by_robots_txt'
|
|
11
|
+
};
|
|
9
12
|
exports.HttpStatus = {
|
|
10
13
|
OK: 200,
|
|
11
14
|
BAD_REQUEST: 400,
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcrawlerapi-js",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
|
|
3
|
+
"version": "2.0.3",
|
|
5
4
|
"description": "JS client for WebcrawlerAPI",
|
|
6
5
|
"main": "./dist/api.js",
|
|
7
6
|
"types": "./dist/@types/api.d.ts",
|
|
@@ -10,9 +9,6 @@
|
|
|
10
9
|
"README.md",
|
|
11
10
|
"LICENSE"
|
|
12
11
|
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc --outDir dist/"
|
|
15
|
-
},
|
|
16
12
|
"keywords": [
|
|
17
13
|
"scraping",
|
|
18
14
|
"scraper",
|
|
@@ -28,5 +24,12 @@
|
|
|
28
24
|
},
|
|
29
25
|
"author": "WebcrawlerAPI <sdk@webcrawlerapi.com>",
|
|
30
26
|
"license": "MIT",
|
|
31
|
-
"
|
|
32
|
-
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/WebCrawlerAPI/webcrawlerapi-js-sdk"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc --outDir dist/"
|
|
34
|
+
}
|
|
35
|
+
}
|