newscatcher-catchall-sdk 1.5.0 → 2.0.0

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 (63) hide show
  1. package/README.md +12 -2
  2. package/dist/cjs/BaseClient.d.ts +3 -0
  3. package/dist/cjs/BaseClient.js +17 -2
  4. package/dist/cjs/api/resources/datasets/client/Client.d.ts +30 -31
  5. package/dist/cjs/api/resources/datasets/client/Client.js +64 -75
  6. package/dist/cjs/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.ts +28 -0
  7. package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +0 -1
  8. package/dist/cjs/api/resources/datasets/client/requests/index.d.ts +1 -1
  9. package/dist/cjs/api/resources/entities/client/Client.d.ts +3 -7
  10. package/dist/cjs/api/resources/entities/client/Client.js +8 -13
  11. package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -4
  12. package/dist/cjs/api/resources/jobs/client/Client.js +7 -11
  13. package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +0 -1
  14. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +7 -1
  15. package/dist/cjs/api/resources/meta/client/Client.js +3 -3
  16. package/dist/cjs/api/resources/monitors/client/Client.d.ts +2 -1
  17. package/dist/cjs/api/resources/monitors/client/Client.js +16 -17
  18. package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +7 -4
  19. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +0 -1
  20. package/dist/cjs/api/types/ConnectedEntity.d.ts +12 -9
  21. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  22. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  23. package/dist/cjs/core/auth/index.d.ts +1 -1
  24. package/dist/cjs/core/auth/index.js +3 -1
  25. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -0
  26. package/dist/cjs/core/fetcher/Fetcher.js +2 -7
  27. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  28. package/dist/cjs/version.d.ts +1 -1
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/esm/BaseClient.d.mts +3 -0
  31. package/dist/esm/BaseClient.mjs +17 -2
  32. package/dist/esm/api/resources/datasets/client/Client.d.mts +30 -31
  33. package/dist/esm/api/resources/datasets/client/Client.mjs +64 -75
  34. package/dist/esm/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.mts +28 -0
  35. package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +0 -1
  36. package/dist/esm/api/resources/datasets/client/requests/index.d.mts +1 -1
  37. package/dist/esm/api/resources/entities/client/Client.d.mts +3 -7
  38. package/dist/esm/api/resources/entities/client/Client.mjs +8 -13
  39. package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -4
  40. package/dist/esm/api/resources/jobs/client/Client.mjs +7 -11
  41. package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +0 -1
  42. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +7 -1
  43. package/dist/esm/api/resources/meta/client/Client.mjs +3 -3
  44. package/dist/esm/api/resources/monitors/client/Client.d.mts +2 -1
  45. package/dist/esm/api/resources/monitors/client/Client.mjs +16 -17
  46. package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +7 -4
  47. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +0 -1
  48. package/dist/esm/api/types/ConnectedEntity.d.mts +12 -9
  49. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  50. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  51. package/dist/esm/core/auth/index.d.mts +1 -1
  52. package/dist/esm/core/auth/index.mjs +1 -0
  53. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -0
  54. package/dist/esm/core/fetcher/Fetcher.mjs +2 -7
  55. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  56. package/dist/esm/version.d.mts +1 -1
  57. package/dist/esm/version.mjs +1 -1
  58. package/package.json +2 -2
  59. package/reference.md +35 -42
  60. package/dist/cjs/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.ts +0 -21
  61. package/dist/esm/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.mts +0 -21
  62. /package/dist/cjs/api/resources/datasets/client/requests/{ListEntitiesInDatasetRequest.js → ListDatasetEntitiesRequest.js} +0 -0
  63. /package/dist/esm/api/resources/datasets/client/requests/{ListEntitiesInDatasetRequest.mjs → ListDatasetEntitiesRequest.mjs} +0 -0
@@ -74,9 +74,7 @@ class EntitiesClient {
74
74
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
75
75
  }
76
76
  /**
77
- * Returns a paginated list of entities belonging to the authenticated
78
- * organization. Supports filtering by status and entity type, and
79
- * sorting by name, status, or creation date.
77
+ * Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
80
78
  *
81
79
  * @param {CatchAllApi.ListEntitiesRequest} request
82
80
  * @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -110,7 +108,6 @@ class EntitiesClient {
110
108
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/entities"),
111
109
  method: "GET",
112
110
  headers: _headers,
113
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
114
111
  queryString: core.url
115
112
  .queryBuilder()
116
113
  .addMany(_queryParams)
@@ -181,7 +178,7 @@ class EntitiesClient {
181
178
  method: "POST",
182
179
  headers: _headers,
183
180
  contentType: "application/json",
184
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
181
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
185
182
  requestType: "json",
186
183
  body: request,
187
184
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -211,11 +208,9 @@ class EntitiesClient {
211
208
  });
212
209
  }
213
210
  /**
214
- * Creates multiple entities in a single request. Each entity is
215
- * processed independently — a failure in one does not affect others.
211
+ * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
216
212
  *
217
- * Returns an array of `{id, status}` objects in the same order as
218
- * the input array.
213
+ * Returns an array of `{id, status}` objects in the same order as the input array.
219
214
  *
220
215
  * @param {CatchAllApi.CreateEntitiesBatchRequest} request
221
216
  * @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -262,7 +257,7 @@ class EntitiesClient {
262
257
  method: "POST",
263
258
  headers: _headers,
264
259
  contentType: "application/json",
265
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
260
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
266
261
  requestType: "json",
267
262
  body: request,
268
263
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -321,7 +316,7 @@ class EntitiesClient {
321
316
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/entities/${core.url.encodePathParam(entityId)}`),
322
317
  method: "GET",
323
318
  headers: _headers,
324
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
319
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
325
320
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
326
321
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
327
322
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -376,7 +371,7 @@ class EntitiesClient {
376
371
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/entities/${core.url.encodePathParam(entityId)}`),
377
372
  method: "DELETE",
378
373
  headers: _headers,
379
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
374
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
380
375
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
381
376
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
382
377
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -438,7 +433,7 @@ class EntitiesClient {
438
433
  method: "PATCH",
439
434
  headers: _headers,
440
435
  contentType: "application/json",
441
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
436
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
442
437
  requestType: "json",
443
438
  body: _body,
444
439
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -116,11 +116,9 @@ export declare class JobsClient {
116
116
  continueJob(request: CatchAllApi.ContinueRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ContinueResponseDto>;
117
117
  private __continueJob;
118
118
  /**
119
- * Soft-deletes a job. The job is flagged as deleted and no longer
120
- * appears in list results. The underlying data is retained.
119
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
121
120
  *
122
- * Only the job owner can delete a job. Returns `404` if the job is not
123
- * found or does not belong to the authenticated user.
121
+ * Only the job owner can delete a job. Returns `404` if the job is not found or does not belong to the authenticated user.
124
122
  *
125
123
  * Deleting an already-deleted job returns `200`.
126
124
  *
@@ -88,7 +88,6 @@ class JobsClient {
88
88
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/jobs/user"),
89
89
  method: "GET",
90
90
  headers: _headers,
91
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
92
91
  queryString: core.url
93
92
  .queryBuilder()
94
93
  .addMany(_queryParams)
@@ -146,7 +145,7 @@ class JobsClient {
146
145
  method: "POST",
147
146
  headers: _headers,
148
147
  contentType: "application/json",
149
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
148
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
150
149
  requestType: "json",
151
150
  body: request,
152
151
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -208,7 +207,7 @@ class JobsClient {
208
207
  method: "POST",
209
208
  headers: _headers,
210
209
  contentType: "application/json",
211
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
210
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
212
211
  requestType: "json",
213
212
  body: request,
214
213
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -266,7 +265,7 @@ class JobsClient {
266
265
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/status/${core.url.encodePathParam(jobId)}`),
267
266
  method: "GET",
268
267
  headers: _headers,
269
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
268
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
270
269
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
271
270
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
272
271
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -324,7 +323,6 @@ class JobsClient {
324
323
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/pull/${core.url.encodePathParam(jobId)}`),
325
324
  method: "GET",
326
325
  headers: _headers,
327
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
328
326
  queryString: core.url
329
327
  .queryBuilder()
330
328
  .addMany(_queryParams)
@@ -385,7 +383,7 @@ class JobsClient {
385
383
  method: "POST",
386
384
  headers: _headers,
387
385
  contentType: "application/json",
388
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
386
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
389
387
  requestType: "json",
390
388
  body: request,
391
389
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -417,11 +415,9 @@ class JobsClient {
417
415
  });
418
416
  }
419
417
  /**
420
- * Soft-deletes a job. The job is flagged as deleted and no longer
421
- * appears in list results. The underlying data is retained.
418
+ * Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
422
419
  *
423
- * Only the job owner can delete a job. Returns `404` if the job is not
424
- * found or does not belong to the authenticated user.
420
+ * Only the job owner can delete a job. Returns `404` if the job is not found or does not belong to the authenticated user.
425
421
  *
426
422
  * Deleting an already-deleted job returns `200`.
427
423
  *
@@ -449,7 +445,7 @@ class JobsClient {
449
445
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/jobs/${core.url.encodePathParam(jobId)}`),
450
446
  method: "DELETE",
451
447
  headers: _headers,
452
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
448
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
453
449
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
454
450
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
455
451
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -10,6 +10,5 @@ export interface GetUserJobsRequest {
10
10
  page_size?: number;
11
11
  /** Filter results by text (case-insensitive substring match). */
12
12
  search?: string;
13
- /** Filter results by ownership. Defaults to `all`. */
14
13
  ownership?: CatchAllApi.OwnershipFilter;
15
14
  }
@@ -36,11 +36,17 @@ export interface SubmitRequestDto {
36
36
  */
37
37
  mode?: SubmitRequestDto.Mode;
38
38
  /**
39
- * Dataset IDs to connect to this job. When provided, activates Company Watchlist mode — the job returns only events relevant to companies in the connected datasets with each record including a `connected_entities` array scored per company.
39
+ * Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use `ed_score_min`.
40
40
  *
41
41
  * The dataset must have `latest_status: ready` before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns `400`.
42
42
  */
43
43
  connected_dataset_ids?: string[];
44
+ /**
45
+ * The minimum relevance score a connected entity must reach for its record to be included in results.
46
+ *
47
+ * Only valid when `connected_dataset_ids` is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
48
+ */
49
+ ed_score_min?: number;
44
50
  }
45
51
  export declare namespace SubmitRequestDto {
46
52
  /**
@@ -77,7 +77,7 @@ class MetaClient {
77
77
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "health"),
78
78
  method: "GET",
79
79
  headers: _headers,
80
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
80
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
81
81
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
82
82
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
83
83
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -116,7 +116,7 @@ class MetaClient {
116
116
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "version"),
117
117
  method: "GET",
118
118
  headers: _headers,
119
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
119
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
120
120
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
121
121
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
122
122
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -158,7 +158,7 @@ class MetaClient {
158
158
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/user/limits"),
159
159
  method: "POST",
160
160
  headers: _headers,
161
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
161
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
162
162
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
163
163
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
164
164
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -38,7 +38,8 @@ export declare class MonitorsClient {
38
38
  * @example
39
39
  * await client.monitors.createMonitor({
40
40
  * reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
41
- * schedule: "every day at 12 PM UTC",
41
+ * schedule: "every day at 12 PM",
42
+ * timezone: "UTC",
42
43
  * webhook: {
43
44
  * url: "https://your-endpoint.com/webhook",
44
45
  * method: "POST",
@@ -100,7 +100,6 @@ class MonitorsClient {
100
100
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/monitors"),
101
101
  method: "GET",
102
102
  headers: _headers,
103
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
104
103
  queryString: core.url
105
104
  .queryBuilder()
106
105
  .addMany(_queryParams)
@@ -143,7 +142,8 @@ class MonitorsClient {
143
142
  * @example
144
143
  * await client.monitors.createMonitor({
145
144
  * reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
146
- * schedule: "every day at 12 PM UTC",
145
+ * schedule: "every day at 12 PM",
146
+ * timezone: "UTC",
147
147
  * webhook: {
148
148
  * url: "https://your-endpoint.com/webhook",
149
149
  * method: "POST",
@@ -168,7 +168,7 @@ class MonitorsClient {
168
168
  method: "POST",
169
169
  headers: _headers,
170
170
  contentType: "application/json",
171
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
171
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
172
172
  requestType: "json",
173
173
  body: request,
174
174
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -222,7 +222,7 @@ class MonitorsClient {
222
222
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/pull/${core.url.encodePathParam(monitorId)}`),
223
223
  method: "GET",
224
224
  headers: _headers,
225
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
225
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
226
226
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
227
227
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
228
228
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -268,27 +268,26 @@ class MonitorsClient {
268
268
  }
269
269
  __listMonitorJobs(request, requestOptions) {
270
270
  return __awaiter(this, void 0, void 0, function* () {
271
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
271
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
272
272
  const { monitor_id: monitorId, sort } = request;
273
273
  const _queryParams = {
274
- sort: (_a = (sort != null ? sort : undefined)) !== null && _a !== void 0 ? _a : "asc",
274
+ sort: sort != null ? sort : undefined,
275
275
  };
276
276
  const _authRequest = yield this._options.authProvider.getAuthRequest();
277
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
278
278
  const _response = yield core.fetcher({
279
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/jobs`),
279
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/jobs`),
280
280
  method: "GET",
281
281
  headers: _headers,
282
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
283
282
  queryString: core.url
284
283
  .queryBuilder()
285
284
  .addMany(_queryParams)
286
285
  .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
287
286
  .build(),
288
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
289
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
287
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
288
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
290
289
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
291
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
290
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
292
291
  logging: this._options.logging,
293
292
  });
294
293
  if (_response.ok) {
@@ -338,7 +337,7 @@ class MonitorsClient {
338
337
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/status`),
339
338
  method: "GET",
340
339
  headers: _headers,
341
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
340
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
342
341
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
343
342
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
344
343
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -398,7 +397,7 @@ class MonitorsClient {
398
397
  method: "POST",
399
398
  headers: _headers,
400
399
  contentType: "application/json",
401
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
400
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
402
401
  requestType: "json",
403
402
  body: _body,
404
403
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -457,7 +456,7 @@ class MonitorsClient {
457
456
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/disable`),
458
457
  method: "POST",
459
458
  headers: _headers,
460
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
459
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
461
460
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
462
461
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
463
462
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -520,7 +519,7 @@ class MonitorsClient {
520
519
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}`),
521
520
  method: "DELETE",
522
521
  headers: _headers,
523
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
522
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
524
523
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
525
524
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
526
525
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -583,7 +582,7 @@ class MonitorsClient {
583
582
  method: "PATCH",
584
583
  headers: _headers,
585
584
  contentType: "application/json",
586
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
585
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
587
586
  requestType: "json",
588
587
  body: _body,
589
588
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
@@ -3,7 +3,8 @@ import type * as CatchAllApi from "../../../../index.js";
3
3
  * @example
4
4
  * {
5
5
  * reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
6
- * schedule: "every day at 12 PM UTC",
6
+ * schedule: "every day at 12 PM",
7
+ * timezone: "UTC",
7
8
  * webhook: {
8
9
  * url: "https://your-endpoint.com/webhook",
9
10
  * method: "POST",
@@ -22,12 +23,14 @@ export interface CreateMonitorRequestDto {
22
23
  * If [`backfill`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/monitors/create-monitor#body-backfill) is true, the job's `end_date` must be within the last 7 days.
23
24
  */
24
25
  reference_job_id: string;
26
+ /** Monitor schedule in plain text format. Minimum frequency depends on your plan. */
27
+ schedule: string;
25
28
  /**
26
- * Monitor schedule in plain text format (e.g. 'every day at 12 PM UTC', 'every 48 hours').
29
+ * The IANA timezone identifier used as the fallback when the `schedule` string does not include an explicit timezone.
27
30
  *
28
- * Minimum frequency depends on your plan.
31
+ * If the schedule includes a timezone abbreviation (for example, `"every day at 9am EST"`), the parsed timezone takes priority and this value is ignored.
29
32
  */
30
- schedule: string;
33
+ timezone?: string;
31
34
  /** Optional webhook to receive notifications when jobs complete. */
32
35
  webhook?: CatchAllApi.WebhookDto;
33
36
  /** Maximum number of records per monitor run. If not provided, defaults to the plan limit. */
@@ -10,6 +10,5 @@ export interface ListMonitorsRequest {
10
10
  page_size?: number;
11
11
  /** Filter results by text (case-insensitive substring match). */
12
12
  search?: string;
13
- /** Filter results by ownership. Defaults to `all`. */
14
13
  ownership?: CatchAllApi.OwnershipFilter;
15
14
  }
@@ -1,9 +1,8 @@
1
+ import type * as CatchAllApi from "../index.js";
1
2
  /**
2
- * A company entity matched to a record in a Company Watchlist job, with
3
- * a relevance score and explanation.
3
+ * A company entity matched to a record in a Company Watchlist job, with a relevance score and explanation.
4
4
  *
5
- * Only entities with `ed_score` ≥ 1 appear in results. Entities scored
6
- * 0 are filtered out before the response is returned.
5
+ * Only entities with `ed_score` ≥ 1 appear in results. Entities scored 0 are filtered out before the response is returned. When `ed_score_min` is set at submission time, entities below that threshold are excluded.
7
6
  */
8
7
  export interface ConnectedEntity {
9
8
  /** Unique identifier of the matched entity. */
@@ -11,8 +10,7 @@ export interface ConnectedEntity {
11
10
  /** Name of the matched entity. */
12
11
  name: string;
13
12
  /**
14
- * Relevance score indicating how directly the entity is associated
15
- * with this event.
13
+ * Relevance score indicating how directly the entity is associated with this event.
16
14
  *
17
15
  * | Score | Meaning |
18
16
  * |-------|---------|
@@ -22,9 +20,14 @@ export interface ConnectedEntity {
22
20
  * | 1–3 | Indirect mention (listed with others, stock noise) |
23
21
  */
24
22
  ed_score: number;
23
+ /** Short explanation (up to 100 characters) of why this entity is associated with the event. */
24
+ relation: string;
25
+ /** The entity type. */
26
+ type: string;
25
27
  /**
26
- * Short explanation (up to 100 characters) of why this entity is
27
- * associated with the event.
28
+ * The stored attributes for this entity. Present only when attributes exist in the database.
29
+ *
30
+ * The field name matches the value of `type` — for example, `"company"` type entities have a `company` field.
28
31
  */
29
- relation: string;
32
+ company?: CatchAllApi.CompanyAttributes | undefined;
30
33
  }
@@ -5,3 +5,4 @@ export interface AuthProvider {
5
5
  endpointMetadata?: EndpointMetadata;
6
6
  }): Promise<AuthRequest>;
7
7
  }
8
+ export declare function isAuthProvider(value: unknown): value is AuthProvider;
@@ -1,2 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAuthProvider = isAuthProvider;
4
+ function isAuthProvider(value) {
5
+ return (typeof value === "object" &&
6
+ value !== null &&
7
+ "getAuthRequest" in value &&
8
+ typeof value.getAuthRequest === "function");
9
+ }
@@ -1,4 +1,4 @@
1
- export type { AuthProvider } from "./AuthProvider.js";
1
+ export { type AuthProvider, isAuthProvider } from "./AuthProvider.js";
2
2
  export type { AuthRequest } from "./AuthRequest.js";
3
3
  export { BasicAuth } from "./BasicAuth.js";
4
4
  export { BearerToken } from "./BearerToken.js";
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoOpAuthProvider = exports.BearerToken = exports.BasicAuth = void 0;
3
+ exports.NoOpAuthProvider = exports.BearerToken = exports.BasicAuth = exports.isAuthProvider = void 0;
4
+ var AuthProvider_js_1 = require("./AuthProvider.js");
5
+ Object.defineProperty(exports, "isAuthProvider", { enumerable: true, get: function () { return AuthProvider_js_1.isAuthProvider; } });
4
6
  var BasicAuth_js_1 = require("./BasicAuth.js");
5
7
  Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_js_1.BasicAuth; } });
6
8
  var BearerToken_js_1 = require("./BearerToken.js");
@@ -8,6 +8,11 @@ export declare namespace Fetcher {
8
8
  method: string;
9
9
  contentType?: string;
10
10
  headers?: Record<string, unknown>;
11
+ /**
12
+ * @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
13
+ * Retained for backwards compatibility with custom fetchers and callers that
14
+ * still construct request args with a query-parameter object.
15
+ */
11
16
  queryParameters?: Record<string, unknown>;
12
17
  queryString?: string;
13
18
  body?: unknown;
@@ -75,16 +75,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
75
75
  ]);
76
76
  function redactQueryParameters(queryParameters) {
77
77
  if (queryParameters == null) {
78
- return queryParameters;
78
+ return undefined;
79
79
  }
80
80
  const redacted = {};
81
81
  for (const [key, value] of Object.entries(queryParameters)) {
82
- if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) {
83
- redacted[key] = "[REDACTED]";
84
- }
85
- else {
86
- redacted[key] = value;
87
- }
82
+ redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
88
83
  }
89
84
  return redacted;
90
85
  }
@@ -14,6 +14,9 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
14
14
  const MAX_RETRY_DELAY = 60000; // in milliseconds
15
15
  const DEFAULT_MAX_RETRIES = 2;
16
16
  const JITTER_FACTOR = 0.2; // 20% random jitter
17
+ function isRetryableStatusCode(statusCode) {
18
+ return [408, 429].includes(statusCode) || statusCode >= 500;
19
+ }
17
20
  function addPositiveJitter(delay) {
18
21
  const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
19
22
  return delay * jitterMultiplier;
@@ -53,7 +56,7 @@ function requestWithRetries(requestFn_1) {
53
56
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
54
57
  let response = yield requestFn();
55
58
  for (let i = 0; i < maxRetries; ++i) {
56
- if ([408, 429].includes(response.status) || response.status >= 500) {
59
+ if (isRetryableStatusCode(response.status)) {
57
60
  const delay = getRetryDelayFromHeaders(response, i);
58
61
  yield new Promise((resolve) => setTimeout(resolve, delay));
59
62
  response = yield requestFn();
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.5.0";
1
+ export declare const SDK_VERSION = "2.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.5.0";
4
+ exports.SDK_VERSION = "2.0.0";
@@ -1,6 +1,7 @@
1
1
  import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
2
2
  import * as core from "./core/index.mjs";
3
3
  import type * as environments from "./environments.mjs";
4
+ export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | HeaderAuthProvider.AuthOptions;
4
5
  export type BaseClientOptions = {
5
6
  environment?: core.Supplier<environments.CatchAllApiEnvironment | string>;
6
7
  /** Specify a custom URL to connect the client to. */
@@ -15,6 +16,8 @@ export type BaseClientOptions = {
15
16
  fetch?: typeof fetch;
16
17
  /** Configure logging for the client. */
17
18
  logging?: core.logging.LogConfig | core.logging.Logger;
19
+ /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
20
+ auth?: AuthOption;
18
21
  } & HeaderAuthProvider.AuthOptions;
19
22
  export interface BaseRequestOptions {
20
23
  /** The maximum time to wait for a response in seconds. */
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "newscatcher-catchall-sdk",
9
- "X-Fern-SDK-Version": "1.5.0",
10
- "User-Agent": "newscatcher-catchall-sdk/1.5.0",
9
+ "X-Fern-SDK-Version": "2.0.0",
10
+ "User-Agent": "newscatcher-catchall-sdk/2.0.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -16,6 +16,21 @@ export function normalizeClientOptions(options) {
16
16
  export function normalizeClientOptionsWithAuth(options) {
17
17
  var _a;
18
18
  const normalized = normalizeClientOptions(options);
19
+ if (options.auth === false) {
20
+ normalized.authProvider = new core.NoOpAuthProvider();
21
+ return normalized;
22
+ }
23
+ if (options.auth != null) {
24
+ if (typeof options.auth === "function") {
25
+ normalized.authProvider = { getAuthRequest: options.auth };
26
+ return normalized;
27
+ }
28
+ if (core.isAuthProvider(options.auth)) {
29
+ normalized.authProvider = options.auth;
30
+ return normalized;
31
+ }
32
+ Object.assign(normalized, options.auth);
33
+ }
19
34
  const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
20
35
  (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new HeaderAuthProvider(normalizedWithNoOpAuthProvider));
21
36
  return normalized;