@crawlora-org/sdk 1.2.0-sdk.15 → 1.2.0-sdk.17
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/CHANGELOG.md +13 -0
- package/README.md +11 -5
- package/docs/recipes.md +7 -1
- package/package.json +22 -2
- package/src/client.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.2.0-sdk.17
|
|
4
|
+
|
|
5
|
+
- Expanded npmjs package keywords for Crawlora SDK, scraping API, data
|
|
6
|
+
extraction, search, marketplace, media, maps, and finance discovery.
|
|
7
|
+
- Kept the generated operation contract unchanged.
|
|
8
|
+
|
|
9
|
+
## v1.2.0-sdk.16
|
|
10
|
+
|
|
11
|
+
- Documented response headers on `CrawloraError`, case-insensitive header
|
|
12
|
+
overrides, strict response modes, `Retry-After` retries, and abort semantics.
|
|
13
|
+
- Added docs coverage checks for the release-polish behavior.
|
|
14
|
+
- Kept the generated operation contract unchanged.
|
|
15
|
+
|
|
3
16
|
## v1.2.0-sdk.15
|
|
4
17
|
|
|
5
18
|
- Added case-insensitive request header overrides across auth, user-agent, and
|
package/README.md
CHANGED
|
@@ -87,7 +87,9 @@ const crawlora = new CrawloraClient({
|
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Per-request options can override headers, timeout, abort signal, and response
|
|
90
|
-
mode
|
|
90
|
+
mode. Header names are matched case-insensitively, so request headers can
|
|
91
|
+
override default auth, user-agent, and content headers without duplicating
|
|
92
|
+
variants such as `x-api-key` and `X-API-KEY`:
|
|
91
93
|
|
|
92
94
|
```js
|
|
93
95
|
const controller = new AbortController();
|
|
@@ -104,8 +106,9 @@ const response = await crawlora.bing.search(
|
|
|
104
106
|
|
|
105
107
|
## Text Responses
|
|
106
108
|
|
|
107
|
-
Most endpoints return JSON.
|
|
108
|
-
as YouTube transcripts, can
|
|
109
|
+
Most endpoints return JSON. `responseType` must be `auto`, `json`, or `text`.
|
|
110
|
+
Endpoints that support alternate text output, such as YouTube transcripts, can
|
|
111
|
+
opt into text mode:
|
|
109
112
|
|
|
110
113
|
```js
|
|
111
114
|
const transcript = await crawlora.youtube.transcript(
|
|
@@ -133,8 +136,11 @@ try {
|
|
|
133
136
|
}
|
|
134
137
|
```
|
|
135
138
|
|
|
136
|
-
The error includes `status`, optional API `code`, parsed `body`,
|
|
137
|
-
`response` when available, and a parser or transport
|
|
139
|
+
The error includes `status`, optional API `code`, parsed `body`, response
|
|
140
|
+
`headers`, the original `response` when available, and a parser or transport
|
|
141
|
+
`cause` when relevant. Retryable responses honor positive `Retry-After`
|
|
142
|
+
headers, capped at 30 seconds. Externally aborted requests fail with
|
|
143
|
+
`Crawlora request aborted` and are not retried.
|
|
138
144
|
|
|
139
145
|
## Examples
|
|
140
146
|
|
package/docs/recipes.md
CHANGED
|
@@ -47,8 +47,14 @@ const result = await crawlora.bing.search(
|
|
|
47
47
|
);
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
Request headers override default auth, user-agent, and content headers
|
|
51
|
+
case-insensitively. Retryable API responses honor positive `Retry-After`
|
|
52
|
+
headers, capped at 30 seconds. Externally aborted requests are not retried.
|
|
53
|
+
|
|
50
54
|
## Text Responses
|
|
51
55
|
|
|
56
|
+
`responseType` must be `auto`, `json`, or `text`.
|
|
57
|
+
|
|
52
58
|
```js
|
|
53
59
|
const text = await crawlora.youtube.transcript(
|
|
54
60
|
{ id: "VIDEO_ID", format: "text" },
|
|
@@ -63,7 +69,7 @@ try {
|
|
|
63
69
|
await crawlora.bing.search({ q: "coffee shops" });
|
|
64
70
|
} catch (error) {
|
|
65
71
|
if (error instanceof CrawloraError) {
|
|
66
|
-
console.log(error.status, error.code, error.body);
|
|
72
|
+
console.log(error.status, error.code, error.body, error.headers);
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
75
|
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlora-org/sdk",
|
|
3
|
-
"version": "1.2.0-sdk.
|
|
3
|
+
"version": "1.2.0-sdk.17",
|
|
4
4
|
"description": "JavaScript and TypeScript SDK for the public Crawlora API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"crawlora",
|
|
7
|
+
"crawlora-sdk",
|
|
7
8
|
"sdk",
|
|
9
|
+
"api-client",
|
|
10
|
+
"rest-api-client",
|
|
11
|
+
"typescript",
|
|
12
|
+
"javascript",
|
|
13
|
+
"node",
|
|
14
|
+
"nodejs",
|
|
15
|
+
"fetch",
|
|
8
16
|
"web-scraping",
|
|
9
|
-
"api
|
|
17
|
+
"web-scraping-api",
|
|
18
|
+
"scraping-api",
|
|
19
|
+
"data-extraction",
|
|
20
|
+
"web-data",
|
|
21
|
+
"crawler",
|
|
22
|
+
"automation",
|
|
23
|
+
"search-api",
|
|
24
|
+
"serp-api",
|
|
25
|
+
"public-data",
|
|
26
|
+
"marketplace-data",
|
|
27
|
+
"media-data",
|
|
28
|
+
"maps-data",
|
|
29
|
+
"finance-data"
|
|
10
30
|
],
|
|
11
31
|
"homepage": "https://crawlora.net",
|
|
12
32
|
"bugs": {
|
package/src/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { operations, groups } from "./operations.js";
|
|
2
2
|
|
|
3
3
|
const DEFAULT_BASE_URL = "https://api.crawlora.net/api/v1";
|
|
4
|
-
export const VERSION = "1.2.0-sdk.
|
|
4
|
+
export const VERSION = "1.2.0-sdk.17";
|
|
5
5
|
const DEFAULT_USER_AGENT = `crawlora-js-sdk/${VERSION}`;
|
|
6
6
|
|
|
7
7
|
export class CrawloraError extends Error {
|