newscatcher-catchall-sdk 0.3.1 → 1.1.2
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/README.md +284 -286
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +32 -8
- package/dist/cjs/api/resources/jobs/client/Client.js +93 -20
- package/dist/cjs/api/resources/jobs/client/requests/ContinueRequestDto.d.ts +3 -3
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +12 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +17 -6
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/jobs/exports.d.ts +2 -0
- package/dist/cjs/api/resources/jobs/exports.js +21 -0
- package/dist/cjs/api/resources/meta/exports.d.ts +2 -0
- package/dist/cjs/api/resources/meta/exports.js +21 -0
- package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +1 -1
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +23 -33
- package/dist/cjs/api/resources/monitors/client/Client.js +35 -37
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +26 -5
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.ts +17 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/monitors/exports.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/exports.js +21 -0
- package/dist/cjs/api/types/BaseRecord.d.ts +38 -0
- package/dist/cjs/api/types/BaseRecord.js +16 -0
- package/dist/cjs/api/types/Citation.d.ts +3 -3
- package/dist/cjs/api/types/CompanyEnrichmentOutput.d.ts +29 -0
- package/dist/cjs/api/types/CompanyEnrichmentOutput.js +16 -0
- package/dist/cjs/api/types/ContinueResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/EndDate.d.ts +8 -0
- package/dist/cjs/api/types/EndDate.js +3 -0
- package/dist/cjs/api/types/EnrichmentSchema.d.ts +13 -0
- package/dist/cjs/api/types/EnrichmentSchema.js +3 -0
- package/dist/cjs/api/types/EnrichmentType.d.ts +19 -0
- package/dist/cjs/api/types/EnrichmentType.js +22 -0
- package/dist/cjs/api/types/Error_.d.ts +1 -1
- package/dist/cjs/api/types/InitializeResponseDto.d.ts +19 -0
- package/dist/cjs/api/types/InitializeResponseDto.js +3 -0
- package/dist/cjs/api/types/JobStep.d.ts +2 -2
- package/dist/cjs/api/types/Limit.d.ts +6 -0
- package/dist/cjs/api/types/Limit.js +3 -0
- package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
- package/dist/cjs/api/types/ListUserJobsResponseDto.d.ts +11 -8
- package/dist/cjs/api/types/MonitorCitation.d.ts +3 -8
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +7 -7
- package/dist/cjs/api/types/MonitorRecord.d.ts +4 -14
- package/dist/{esm/api/types/JobStatus.d.mts → cjs/api/types/PublicJobStatus.d.ts} +4 -4
- package/dist/cjs/api/types/{JobStatus.js → PublicJobStatus.js} +4 -4
- package/dist/cjs/api/types/PullJobResponseDto.d.ts +28 -23
- package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +12 -12
- package/dist/cjs/api/types/Query.d.ts +1 -1
- package/dist/cjs/api/types/Record_.d.ts +2 -12
- package/dist/cjs/api/types/ReferenceJob.d.ts +3 -3
- package/dist/cjs/api/types/StartDate.d.ts +8 -0
- package/dist/cjs/api/types/StartDate.js +3 -0
- package/dist/cjs/api/types/StatusResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/{SubmitResponseBody.d.ts → SubmitResponseDto.d.ts} +1 -1
- package/dist/cjs/api/types/SubmitResponseDto.js +3 -0
- package/dist/cjs/api/types/UserJob.d.ts +10 -0
- package/dist/cjs/api/types/UserJob.js +3 -0
- package/dist/cjs/api/types/ValidationErrorDetail.d.ts +3 -3
- package/dist/cjs/api/types/ValidationErrorResponse.d.ts +1 -1
- package/dist/cjs/api/types/ValidatorSchema.d.ts +13 -0
- package/dist/cjs/api/types/ValidatorSchema.js +3 -0
- package/dist/cjs/api/types/WebhookDto.d.ts +4 -4
- package/dist/cjs/api/types/WebhookPayload.d.ts +9 -9
- package/dist/cjs/api/types/index.d.ts +12 -3
- package/dist/cjs/api/types/index.js +12 -3
- package/dist/cjs/core/fetcher/Fetcher.js +8 -2
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/runtime/runtime.js +8 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/jobs/client/Client.d.mts +32 -8
- package/dist/esm/api/resources/jobs/client/Client.mjs +93 -20
- package/dist/esm/api/resources/jobs/client/requests/ContinueRequestDto.d.mts +3 -3
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +12 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +17 -6
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/jobs/exports.d.mts +2 -0
- package/dist/esm/api/resources/jobs/exports.mjs +3 -0
- package/dist/esm/api/resources/meta/exports.d.mts +2 -0
- package/dist/esm/api/resources/meta/exports.mjs +3 -0
- package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +1 -1
- package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +1 -1
- package/dist/esm/api/resources/monitors/client/Client.d.mts +23 -33
- package/dist/esm/api/resources/monitors/client/Client.mjs +35 -37
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +26 -5
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.mts +17 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +2 -0
- package/dist/esm/api/resources/monitors/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/monitors/exports.d.mts +2 -0
- package/dist/esm/api/resources/monitors/exports.mjs +3 -0
- package/dist/esm/api/types/BaseRecord.d.mts +38 -0
- package/dist/esm/api/types/BaseRecord.mjs +13 -0
- package/dist/esm/api/types/Citation.d.mts +3 -3
- package/dist/esm/api/types/CompanyEnrichmentOutput.d.mts +29 -0
- package/dist/esm/api/types/CompanyEnrichmentOutput.mjs +13 -0
- package/dist/esm/api/types/ContinueResponseDto.d.mts +2 -2
- package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +1 -1
- package/dist/esm/api/types/EndDate.d.mts +8 -0
- package/dist/esm/api/types/EndDate.mjs +2 -0
- package/dist/esm/api/types/EnrichmentSchema.d.mts +13 -0
- package/dist/esm/api/types/EnrichmentSchema.mjs +2 -0
- package/dist/esm/api/types/EnrichmentType.d.mts +19 -0
- package/dist/esm/api/types/EnrichmentType.mjs +19 -0
- package/dist/esm/api/types/Error_.d.mts +1 -1
- package/dist/esm/api/types/InitializeResponseDto.d.mts +19 -0
- package/dist/esm/api/types/InitializeResponseDto.mjs +2 -0
- package/dist/esm/api/types/JobStep.d.mts +2 -2
- package/dist/esm/api/types/Limit.d.mts +6 -0
- package/dist/esm/api/types/Limit.mjs +2 -0
- package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
- package/dist/esm/api/types/ListUserJobsResponseDto.d.mts +11 -8
- package/dist/esm/api/types/MonitorCitation.d.mts +3 -8
- package/dist/esm/api/types/MonitorListItemDto.d.mts +7 -7
- package/dist/esm/api/types/MonitorRecord.d.mts +4 -14
- package/dist/{cjs/api/types/JobStatus.d.ts → esm/api/types/PublicJobStatus.d.mts} +4 -4
- package/dist/esm/api/types/{JobStatus.mjs → PublicJobStatus.mjs} +3 -3
- package/dist/esm/api/types/PullJobResponseDto.d.mts +28 -23
- package/dist/esm/api/types/PullMonitorResponseDto.d.mts +12 -12
- package/dist/esm/api/types/Query.d.mts +1 -1
- package/dist/esm/api/types/Record_.d.mts +2 -12
- package/dist/esm/api/types/ReferenceJob.d.mts +3 -3
- package/dist/esm/api/types/StartDate.d.mts +8 -0
- package/dist/esm/api/types/StartDate.mjs +2 -0
- package/dist/esm/api/types/StatusResponseDto.d.mts +2 -2
- package/dist/esm/api/types/{SubmitResponseBody.d.mts → SubmitResponseDto.d.mts} +1 -1
- package/dist/esm/api/types/SubmitResponseDto.mjs +2 -0
- package/dist/esm/api/types/UserJob.d.mts +10 -0
- package/dist/esm/api/types/UserJob.mjs +2 -0
- package/dist/esm/api/types/ValidationErrorDetail.d.mts +3 -3
- package/dist/esm/api/types/ValidationErrorResponse.d.mts +1 -1
- package/dist/esm/api/types/ValidatorSchema.d.mts +13 -0
- package/dist/esm/api/types/ValidatorSchema.mjs +2 -0
- package/dist/esm/api/types/WebhookDto.d.mts +4 -4
- package/dist/esm/api/types/WebhookPayload.d.mts +9 -9
- package/dist/esm/api/types/index.d.mts +12 -3
- package/dist/esm/api/types/index.mjs +12 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/runtime/runtime.mjs +8 -7
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +37 -4
- package/reference.md +115 -40
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +0 -10
- package/dist/cjs/api/types/Schema.d.ts +0 -6
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +0 -10
- package/dist/esm/api/types/Schema.d.mts +0 -6
- /package/dist/cjs/api/resources/{monitors/client/requests/EnableMonitorRequest.js → jobs/client/requests/GetUserJobsRequest.js} +0 -0
- /package/dist/cjs/api/{types/Schema.js → resources/jobs/client/requests/InitializeRequestDto.js} +0 -0
- /package/dist/cjs/api/{types/SubmitResponseBody.js → resources/monitors/client/requests/EnableMonitorRequestDto.js} +0 -0
- /package/dist/esm/api/resources/{monitors/client/requests/EnableMonitorRequest.mjs → jobs/client/requests/GetUserJobsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/Schema.mjs → resources/jobs/client/requests/InitializeRequestDto.mjs} +0 -0
- /package/dist/esm/api/{types/SubmitResponseBody.mjs → resources/monitors/client/requests/EnableMonitorRequestDto.mjs} +0 -0
package/README.md
CHANGED
|
@@ -1,286 +1,284 @@
|
|
|
1
|
-
# Newscatcher TypeScript Library
|
|
2
|
-
|
|
3
|
-
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FNewscatcher%2Fnewscatcher-catchall-typescript)
|
|
4
|
-
[](https://www.npmjs.com/package/newscatcher-catchall-sdk)
|
|
5
|
-
|
|
6
|
-
The Newscatcher TypeScript library provides convenient access to the
|
|
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
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
console.log(err.
|
|
85
|
-
console.log(err.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
- [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
controller.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
- `
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
- `logging.LogLevel.
|
|
204
|
-
- `logging.LogLevel.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- Documentation: [https://www.newscatcherapi.com/docs/v3/catch-all](https://www.newscatcherapi.com/docs/v3/catch-all)
|
|
286
|
-
- Support: <support@newscatcherapi.com>
|
|
1
|
+
# Newscatcher CatchAll TypeScript Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FNewscatcher%2Fnewscatcher-catchall-typescript)
|
|
4
|
+
[](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>
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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": "
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/
|
|
46
|
+
"X-Fern-SDK-Version": "1.1.2",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/1.1.2",
|
|
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);
|