@crawlora-org/sdk 1.2.0-sdk.15 → 1.2.0-sdk.16

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.2.0-sdk.16
4
+
5
+ - Documented response headers on `CrawloraError`, case-insensitive header
6
+ overrides, strict response modes, `Retry-After` retries, and abort semantics.
7
+ - Added docs coverage checks for the release-polish behavior.
8
+ - Kept the generated operation contract unchanged.
9
+
3
10
  ## v1.2.0-sdk.15
4
11
 
5
12
  - 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. Endpoints that support alternate text output, such
108
- as YouTube transcripts, can opt into text mode:
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`, the original
137
- `response` when available, and a parser or transport `cause` when relevant.
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlora-org/sdk",
3
- "version": "1.2.0-sdk.15",
3
+ "version": "1.2.0-sdk.16",
4
4
  "description": "JavaScript and TypeScript SDK for the public Crawlora API.",
5
5
  "keywords": [
6
6
  "crawlora",
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.15";
4
+ export const VERSION = "1.2.0-sdk.16";
5
5
  const DEFAULT_USER_AGENT = `crawlora-js-sdk/${VERSION}`;
6
6
 
7
7
  export class CrawloraError extends Error {