newscatcher-catchall-sdk 1.1.2 → 1.3.1

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.
Files changed (61) hide show
  1. package/README.md +305 -284
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +12 -0
  4. package/dist/cjs/Client.js +67 -0
  5. package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -1
  6. package/dist/cjs/api/resources/jobs/client/Client.js +2 -1
  7. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +22 -1
  8. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +14 -0
  9. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -1
  10. package/dist/cjs/api/resources/jobs/client/requests/index.js +3 -0
  11. package/dist/cjs/api/resources/meta/client/Client.d.ts +15 -3
  12. package/dist/cjs/api/resources/meta/client/Client.js +49 -1
  13. package/dist/cjs/api/types/GetPlanLimitsResponseDto.d.ts +5 -0
  14. package/dist/cjs/api/types/GetPlanLimitsResponseDto.js +3 -0
  15. package/dist/cjs/api/types/MonitorListItemDto.d.ts +4 -2
  16. package/dist/cjs/api/types/PlanFeature.d.ts +12 -0
  17. package/dist/cjs/api/types/PlanFeature.js +3 -0
  18. package/dist/cjs/api/types/PullJobResponseDto.d.ts +12 -8
  19. package/dist/cjs/api/types/PullJobResponseDto.js +9 -0
  20. package/dist/cjs/api/types/UserJob.d.ts +12 -0
  21. package/dist/cjs/api/types/UserJob.js +9 -0
  22. package/dist/cjs/api/types/index.d.ts +2 -0
  23. package/dist/cjs/api/types/index.js +2 -0
  24. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  25. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  26. package/dist/cjs/core/fetcher/index.js +3 -1
  27. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  28. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/BaseClient.mjs +2 -2
  32. package/dist/esm/Client.d.mts +12 -0
  33. package/dist/esm/Client.mjs +34 -0
  34. package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -1
  35. package/dist/esm/api/resources/jobs/client/Client.mjs +2 -1
  36. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +22 -1
  37. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +13 -1
  38. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -1
  39. package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -1
  40. package/dist/esm/api/resources/meta/client/Client.d.mts +15 -3
  41. package/dist/esm/api/resources/meta/client/Client.mjs +50 -2
  42. package/dist/esm/api/types/GetPlanLimitsResponseDto.d.mts +5 -0
  43. package/dist/esm/api/types/GetPlanLimitsResponseDto.mjs +2 -0
  44. package/dist/esm/api/types/MonitorListItemDto.d.mts +4 -2
  45. package/dist/esm/api/types/PlanFeature.d.mts +12 -0
  46. package/dist/esm/api/types/PlanFeature.mjs +2 -0
  47. package/dist/esm/api/types/PullJobResponseDto.d.mts +12 -8
  48. package/dist/esm/api/types/PullJobResponseDto.mjs +8 -1
  49. package/dist/esm/api/types/UserJob.d.mts +12 -0
  50. package/dist/esm/api/types/UserJob.mjs +8 -1
  51. package/dist/esm/api/types/index.d.mts +2 -0
  52. package/dist/esm/api/types/index.mjs +2 -0
  53. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  54. package/dist/esm/core/fetcher/index.d.mts +2 -0
  55. package/dist/esm/core/fetcher/index.mjs +1 -0
  56. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  57. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  58. package/dist/esm/version.d.mts +1 -1
  59. package/dist/esm/version.mjs +1 -1
  60. package/package.json +1 -1
  61. package/reference.md +57 -1
package/README.md CHANGED
@@ -1,284 +1,305 @@
1
- # Newscatcher CatchAll TypeScript Library
2
-
3
- [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FNewscatcher%2Fnewscatcher-catchall-typescript)
4
- [![npm shield](https://img.shields.io/npm/v/newscatcher-catchall-sdk)](https://www.npmjs.com/package/newscatcher-catchall-sdk)
5
-
6
- The Newscatcher CatchAll TypeScript library provides convenient access to the Web Search APIs from TypeScript.
7
-
8
- ## Table of Contents
9
-
10
- - [Documentation](#documentation)
11
- - [Installation](#installation)
12
- - [Reference](#reference)
13
- - [Usage](#usage)
14
- - [Request and Response Types](#request-and-response-types)
15
- - [Exception Handling](#exception-handling)
16
- - [Advanced](#advanced)
17
- - [Additional Headers](#additional-headers)
18
- - [Additional Query String Parameters](#additional-query-string-parameters)
19
- - [Retries](#retries)
20
- - [Timeouts](#timeouts)
21
- - [Aborting Requests](#aborting-requests)
22
- - [Access Raw Response Data](#access-raw-response-data)
23
- - [Logging](#logging)
24
- - [Runtime Compatibility](#runtime-compatibility)
25
- - [Contributing](#contributing)
26
- - [Support](#support)
27
-
28
- ## Documentation
29
-
30
- API reference documentation is available [here](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/initialize-job).
31
-
32
- ## Installation
33
-
34
- ```sh
35
- npm i -s newscatcher-catchall-sdk
36
- ```
37
-
38
- ## Reference
39
-
40
- A full reference for this library is available [here](https://github.com/Newscatcher/newscatcher-catchall-typescript/blob/HEAD/./reference.md).
41
-
42
- ## Usage
43
-
44
- Instantiate and use the client with the following:
45
-
46
- ```typescript
47
- import { CatchAllApiClient } from "newscatcher-catchall-sdk";
48
-
49
- const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
50
- await client.jobs.createJob({
51
- query: "AI company acquisitions",
52
- context: "Focus on deal size and acquiring company details",
53
- limit: 10,
54
- start_date: "2026-01-30T00:00:00Z",
55
- end_date: "2026-02-05T00:00:00Z"
56
- });
57
- ```
58
-
59
- ## Request and Response Types
60
-
61
- The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
62
- following namespace:
63
-
64
- ```typescript
65
- import { CatchAllApi } from "newscatcher-catchall-sdk";
66
-
67
- const request: CatchAllApi.InitializeRequestDto = {
68
- ...
69
- };
70
- ```
71
-
72
- ## Exception Handling
73
-
74
- When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
75
- will be thrown.
76
-
77
- ```typescript
78
- import { CatchAllApiError } from "newscatcher-catchall-sdk";
79
-
80
- try {
81
- await client.jobs.createJob(...);
82
- } catch (err) {
83
- if (err instanceof CatchAllApiError) {
84
- console.log(err.statusCode);
85
- console.log(err.message);
86
- console.log(err.body);
87
- console.log(err.rawResponse);
88
- }
89
- }
90
- ```
91
-
92
- ## Advanced
93
-
94
- ### Additional Headers
95
-
96
- If you would like to send additional headers as part of the request, use the `headers` request option.
97
-
98
- ```typescript
99
- import { CatchAllApiClient } from "newscatcher-catchall-sdk";
100
-
101
- const client = new CatchAllApiClient({
102
- ...
103
- headers: {
104
- 'X-Custom-Header': 'custom value'
105
- }
106
- });
107
-
108
- const response = await client.jobs.createJob(..., {
109
- headers: {
110
- 'X-Custom-Header': 'custom value'
111
- }
112
- });
113
- ```
114
-
115
- ### Additional Query String Parameters
116
-
117
- If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
118
-
119
- ```typescript
120
- const response = await client.jobs.createJob(..., {
121
- queryParams: {
122
- 'customQueryParamKey': 'custom query param value'
123
- }
124
- });
125
- ```
126
-
127
- ### Retries
128
-
129
- The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
130
- as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
131
- retry limit (default: 2).
132
-
133
- A request is deemed retryable when any of the following HTTP status codes is returned:
134
-
135
- - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
136
- - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
137
- - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
138
-
139
- Use the `maxRetries` request option to configure this behavior.
140
-
141
- ```typescript
142
- const response = await client.jobs.createJob(..., {
143
- maxRetries: 0 // override maxRetries at the request level
144
- });
145
- ```
146
-
147
- ### Timeouts
148
-
149
- The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
150
-
151
- ```typescript
152
- const response = await client.jobs.createJob(..., {
153
- timeoutInSeconds: 30 // override timeout to 30s
154
- });
155
- ```
156
-
157
- ### Aborting Requests
158
-
159
- The SDK allows users to abort requests at any point by passing in an abort signal.
160
-
161
- ```typescript
162
- const controller = new AbortController();
163
- const response = await client.jobs.createJob(..., {
164
- abortSignal: controller.signal
165
- });
166
- controller.abort(); // aborts the request
167
- ```
168
-
169
- ### Access Raw Response Data
170
-
171
- The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
172
- The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
173
-
174
- ```typescript
175
- const { data, rawResponse } = await client.jobs.createJob(...).withRawResponse();
176
-
177
- console.log(data);
178
- console.log(rawResponse.headers['X-My-Header']);
179
- ```
180
-
181
- ### Logging
182
-
183
- The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
184
-
185
- ```typescript
186
- import { CatchAllApiClient, logging } from "newscatcher-catchall-sdk";
187
-
188
- const client = new CatchAllApiClient({
189
- ...
190
- logging: {
191
- level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
192
- logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
193
- silent: false, // defaults to true, set to false to enable logging
194
- }
195
- });
196
- ```
197
- The `logging` object can have the following properties:
198
- - `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
199
- - `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
200
- - `silent`: Whether to silence the logger. Defaults to `true`.
201
-
202
- The `level` property can be one of the following values:
203
- - `logging.LogLevel.Debug`
204
- - `logging.LogLevel.Info`
205
- - `logging.LogLevel.Warn`
206
- - `logging.LogLevel.Error`
207
-
208
- To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
209
-
210
- <details>
211
- <summary>Custom logger examples</summary>
212
-
213
- Here's an example using the popular `winston` logging library.
214
- ```ts
215
- import winston from 'winston';
216
-
217
- const winstonLogger = winston.createLogger({...});
218
-
219
- const logger: logging.ILogger = {
220
- debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
221
- info: (msg, ...args) => winstonLogger.info(msg, ...args),
222
- warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
223
- error: (msg, ...args) => winstonLogger.error(msg, ...args),
224
- };
225
- ```
226
-
227
- Here's an example using the popular `pino` logging library.
228
-
229
- ```ts
230
- import pino from 'pino';
231
-
232
- const pinoLogger = pino({...});
233
-
234
- const logger: logging.ILogger = {
235
- debug: (msg, ...args) => pinoLogger.debug(args, msg),
236
- info: (msg, ...args) => pinoLogger.info(args, msg),
237
- warn: (msg, ...args) => pinoLogger.warn(args, msg),
238
- error: (msg, ...args) => pinoLogger.error(args, msg),
239
- };
240
- ```
241
- </details>
242
-
243
-
244
- ### Runtime Compatibility
245
-
246
-
247
- The SDK works in the following runtimes:
248
-
249
-
250
-
251
- - Node.js 18+
252
- - Vercel
253
- - Cloudflare Workers
254
- - Deno v1.25+
255
- - Bun 1.0+
256
- - React Native
257
-
258
- ### Customizing Fetch Client
259
-
260
- The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
261
- unsupported environment, this provides a way for you to break glass and ensure the SDK works.
262
-
263
- ```typescript
264
- import { CatchAllApiClient } from "newscatcher-catchall-sdk";
265
-
266
- const client = new CatchAllApiClient({
267
- ...
268
- fetcher: // provide your implementation here
269
- });
270
- ```
271
-
272
- ## Contributing
273
-
274
- While we value open-source contributions to this SDK, this library is generated programmatically.
275
- Additions made directly to this library would have to be moved over to our generation code,
276
- otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
277
- a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
278
- an issue first to discuss with us!
279
-
280
- On the other hand, contributions to the README are always very welcome!
281
- ## Support
282
-
283
- - Documentation: [www.newscatcherapi.com/docs/web-search-api](https://www.newscatcherapi.com/docs/web-search-api/get-started/introduction)
284
- - Support: <support@newscatcherapi.com>
1
+ # Newscatcher TypeScript Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FNewscatcher%2Fnewscatcher-catchall-typescript)
4
+ [![npm shield](https://img.shields.io/npm/v/newscatcher-catchall-sdk)](https://www.npmjs.com/package/newscatcher-catchall-sdk)
5
+
6
+ The Newscatcher TypeScript library provides convenient access to the Newscatcher APIs from TypeScript.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Documentation](#documentation)
11
+ - [Installation](#installation)
12
+ - [Reference](#reference)
13
+ - [Usage](#usage)
14
+ - [Request and Response Types](#request-and-response-types)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Subpackage Exports](#subpackage-exports)
18
+ - [Additional Headers](#additional-headers)
19
+ - [Additional Query String Parameters](#additional-query-string-parameters)
20
+ - [Retries](#retries)
21
+ - [Timeouts](#timeouts)
22
+ - [Aborting Requests](#aborting-requests)
23
+ - [Access Raw Response Data](#access-raw-response-data)
24
+ - [Logging](#logging)
25
+ - [Custom Fetch](#custom-fetch)
26
+ - [Runtime Compatibility](#runtime-compatibility)
27
+ - [Contributing](#contributing)
28
+ - [Support](#support)
29
+
30
+ ## Documentation
31
+
32
+ API reference documentation is available [here](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/initialize-job).
33
+
34
+ ## Installation
35
+
36
+ ```sh
37
+ npm i -s newscatcher-catchall-sdk
38
+ ```
39
+
40
+ ## Reference
41
+
42
+ A full reference for this library is available [here](https://github.com/Newscatcher/newscatcher-catchall-typescript/blob/HEAD/./reference.md).
43
+
44
+ ## Usage
45
+
46
+ Instantiate and use the client with the following:
47
+
48
+ ```typescript
49
+ import { CatchAllApiClient } from "newscatcher-catchall-sdk";
50
+
51
+ const client = new CatchAllApiClient({ apiKey: "YOUR_API_KEY" });
52
+ await client.jobs.createJob({
53
+ query: "Series B funding rounds for SaaS startups",
54
+ context: "Focus on funding amount and company name",
55
+ limit: 10,
56
+ start_date: "2026-02-18T00:00:00Z",
57
+ end_date: "2026-02-23T00:00:00Z",
58
+ mode: "base"
59
+ });
60
+ ```
61
+
62
+ ## Request and Response Types
63
+
64
+ The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
65
+ following namespace:
66
+
67
+ ```typescript
68
+ import { CatchAllApi } from "newscatcher-catchall-sdk";
69
+
70
+ const request: CatchAllApi.InitializeRequestDto = {
71
+ ...
72
+ };
73
+ ```
74
+
75
+ ## Exception Handling
76
+
77
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
78
+ will be thrown.
79
+
80
+ ```typescript
81
+ import { CatchAllApiError } from "newscatcher-catchall-sdk";
82
+
83
+ try {
84
+ await client.jobs.createJob(...);
85
+ } catch (err) {
86
+ if (err instanceof CatchAllApiError) {
87
+ console.log(err.statusCode);
88
+ console.log(err.message);
89
+ console.log(err.body);
90
+ console.log(err.rawResponse);
91
+ }
92
+ }
93
+ ```
94
+
95
+ ## Advanced
96
+
97
+ ### Subpackage Exports
98
+
99
+ This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes.
100
+
101
+ ```typescript
102
+ import { JobsClient } from 'newscatcher-catchall-sdk/jobs';
103
+
104
+ const client = new JobsClient({...});
105
+ ```
106
+
107
+ ### Additional Headers
108
+
109
+ If you would like to send additional headers as part of the request, use the `headers` request option.
110
+
111
+ ```typescript
112
+ import { CatchAllApiClient } from "newscatcher-catchall-sdk";
113
+
114
+ const client = new CatchAllApiClient({
115
+ ...
116
+ headers: {
117
+ 'X-Custom-Header': 'custom value'
118
+ }
119
+ });
120
+
121
+ const response = await client.jobs.createJob(..., {
122
+ headers: {
123
+ 'X-Custom-Header': 'custom value'
124
+ }
125
+ });
126
+ ```
127
+
128
+ ### Additional Query String Parameters
129
+
130
+ If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
131
+
132
+ ```typescript
133
+ const response = await client.jobs.createJob(..., {
134
+ queryParams: {
135
+ 'customQueryParamKey': 'custom query param value'
136
+ }
137
+ });
138
+ ```
139
+
140
+ ### Retries
141
+
142
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
143
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
144
+ retry limit (default: 2).
145
+
146
+ A request is deemed retryable when any of the following HTTP status codes is returned:
147
+
148
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
149
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
150
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
151
+
152
+ Use the `maxRetries` request option to configure this behavior.
153
+
154
+ ```typescript
155
+ const response = await client.jobs.createJob(..., {
156
+ maxRetries: 0 // override maxRetries at the request level
157
+ });
158
+ ```
159
+
160
+ ### Timeouts
161
+
162
+ The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
163
+
164
+ ```typescript
165
+ const response = await client.jobs.createJob(..., {
166
+ timeoutInSeconds: 30 // override timeout to 30s
167
+ });
168
+ ```
169
+
170
+ ### Aborting Requests
171
+
172
+ The SDK allows users to abort requests at any point by passing in an abort signal.
173
+
174
+ ```typescript
175
+ const controller = new AbortController();
176
+ const response = await client.jobs.createJob(..., {
177
+ abortSignal: controller.signal
178
+ });
179
+ controller.abort(); // aborts the request
180
+ ```
181
+
182
+ ### Access Raw Response Data
183
+
184
+ The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
185
+ The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
186
+
187
+ ```typescript
188
+ const { data, rawResponse } = await client.jobs.createJob(...).withRawResponse();
189
+
190
+ console.log(data);
191
+ console.log(rawResponse.headers['X-My-Header']);
192
+ ```
193
+
194
+ ### Logging
195
+
196
+ The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options.
197
+
198
+ ```typescript
199
+ import { CatchAllApiClient, logging } from "newscatcher-catchall-sdk";
200
+
201
+ const client = new CatchAllApiClient({
202
+ ...
203
+ logging: {
204
+ level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info
205
+ logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger
206
+ silent: false, // defaults to true, set to false to enable logging
207
+ }
208
+ });
209
+ ```
210
+ The `logging` object can have the following properties:
211
+ - `level`: The log level to use. Defaults to `logging.LogLevel.Info`.
212
+ - `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`.
213
+ - `silent`: Whether to silence the logger. Defaults to `true`.
214
+
215
+ The `level` property can be one of the following values:
216
+ - `logging.LogLevel.Debug`
217
+ - `logging.LogLevel.Info`
218
+ - `logging.LogLevel.Warn`
219
+ - `logging.LogLevel.Error`
220
+
221
+ To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface.
222
+
223
+ <details>
224
+ <summary>Custom logger examples</summary>
225
+
226
+ Here's an example using the popular `winston` logging library.
227
+ ```ts
228
+ import winston from 'winston';
229
+
230
+ const winstonLogger = winston.createLogger({...});
231
+
232
+ const logger: logging.ILogger = {
233
+ debug: (msg, ...args) => winstonLogger.debug(msg, ...args),
234
+ info: (msg, ...args) => winstonLogger.info(msg, ...args),
235
+ warn: (msg, ...args) => winstonLogger.warn(msg, ...args),
236
+ error: (msg, ...args) => winstonLogger.error(msg, ...args),
237
+ };
238
+ ```
239
+
240
+ Here's an example using the popular `pino` logging library.
241
+
242
+ ```ts
243
+ import pino from 'pino';
244
+
245
+ const pinoLogger = pino({...});
246
+
247
+ const logger: logging.ILogger = {
248
+ debug: (msg, ...args) => pinoLogger.debug(args, msg),
249
+ info: (msg, ...args) => pinoLogger.info(args, msg),
250
+ warn: (msg, ...args) => pinoLogger.warn(args, msg),
251
+ error: (msg, ...args) => pinoLogger.error(args, msg),
252
+ };
253
+ ```
254
+ </details>
255
+
256
+
257
+ ### Custom Fetch
258
+
259
+ The SDK provides a low-level `fetch` method for making custom HTTP requests while still
260
+ benefiting from SDK-level configuration like authentication, retries, timeouts, and logging.
261
+ This is useful for calling API endpoints not yet supported in the SDK.
262
+
263
+ ```typescript
264
+ const response = await client.fetch("/v1/custom/endpoint", {
265
+ method: "GET",
266
+ }, {
267
+ timeoutInSeconds: 30,
268
+ maxRetries: 3,
269
+ headers: {
270
+ "X-Custom-Header": "custom-value",
271
+ },
272
+ });
273
+
274
+ const data = await response.json();
275
+ ```
276
+
277
+ ### Runtime Compatibility
278
+
279
+
280
+ The SDK works in the following runtimes:
281
+
282
+
283
+
284
+ - Node.js 18+
285
+ - Vercel
286
+ - Cloudflare Workers
287
+ - Deno v1.25+
288
+ - Bun 1.0+
289
+ - React Native
290
+
291
+
292
+ ## Contributing
293
+
294
+ While we value open-source contributions to this SDK, this library is generated programmatically.
295
+ Additions made directly to this library would have to be moved over to our generation code,
296
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
297
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
298
+ an issue first to discuss with us!
299
+
300
+ On the other hand, contributions to the README are always very welcome!
301
+ ## Support
302
+
303
+ - Documentation: [www.newscatcherapi.com/docs/web-search-api](https://www.newscatcherapi.com/docs/web-search-api/get-started/introduction)
304
+ - Support: <support@newscatcherapi.com>
305
+
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "newscatcher-catchall-sdk",
46
- "X-Fern-SDK-Version": "1.1.2",
47
- "User-Agent": "newscatcher-catchall-sdk/1.1.2",
46
+ "X-Fern-SDK-Version": "1.3.1",
47
+ "User-Agent": "newscatcher-catchall-sdk/1.3.1",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -3,6 +3,7 @@ import { MetaClient } from "./api/resources/meta/client/Client.js";
3
3
  import { MonitorsClient } from "./api/resources/monitors/client/Client.js";
4
4
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
5
5
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
6
+ import * as core from "./core/index.js";
6
7
  export declare namespace CatchAllApiClient {
7
8
  type Options = BaseClientOptions;
8
9
  interface RequestOptions extends BaseRequestOptions {
@@ -17,4 +18,15 @@ export declare class CatchAllApiClient {
17
18
  get jobs(): JobsClient;
18
19
  get monitors(): MonitorsClient;
19
20
  get meta(): MetaClient;
21
+ /**
22
+ * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
23
+ * This is useful for making requests to endpoints not yet supported in the SDK.
24
+ * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
25
+ *
26
+ * @param {Request | string | URL} input - The URL, path, or Request object.
27
+ * @param {RequestInit} init - Standard fetch RequestInit options.
28
+ * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
29
+ * @returns {Promise<Response>} A standard Response object.
30
+ */
31
+ fetch(input: Request | string | URL, init?: RequestInit, requestOptions?: core.PassthroughRequest.RequestOptions): Promise<Response>;
20
32
  }