newscatcher-catchall-sdk 3.0.0 → 4.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 (77) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/errors/BadRequestError.js +1 -1
  4. package/dist/cjs/api/errors/ForbiddenError.js +1 -1
  5. package/dist/cjs/api/errors/NotFoundError.js +1 -1
  6. package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
  7. package/dist/cjs/api/errors/UnprocessableEntityError.js +1 -1
  8. package/dist/cjs/api/resources/entities/client/requests/UpdateEntityRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/jobs/client/Client.d.ts +16 -0
  10. package/dist/cjs/api/resources/jobs/client/Client.js +55 -0
  11. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.ts +10 -0
  12. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.js +3 -0
  13. package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +7 -0
  14. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +12 -0
  15. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/monitors/client/Client.d.ts +16 -0
  17. package/dist/cjs/api/resources/monitors/client/Client.js +55 -0
  18. package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.ts +10 -0
  19. package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.js +3 -0
  20. package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +1 -0
  21. package/dist/cjs/api/types/ConnectedDataset.d.ts +11 -0
  22. package/dist/cjs/api/types/ConnectedDataset.js +3 -0
  23. package/dist/cjs/api/types/ConnectedEntity.d.ts +4 -0
  24. package/dist/cjs/api/types/CreateEntityRequest.d.ts +2 -0
  25. package/dist/cjs/api/types/EntityAssociationType.d.ts +11 -0
  26. package/dist/cjs/api/types/EntityAssociationType.js +14 -0
  27. package/dist/cjs/api/types/EntityResponse.d.ts +2 -0
  28. package/dist/cjs/api/types/EntitySummary.d.ts +2 -0
  29. package/dist/cjs/api/types/PullJobResponseDto.d.ts +4 -0
  30. package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +4 -0
  31. package/dist/cjs/api/types/index.d.ts +2 -0
  32. package/dist/cjs/api/types/index.js +2 -0
  33. package/dist/cjs/core/fetcher/getResponseBody.js +11 -0
  34. package/dist/cjs/core/fetcher/signals.js +9 -1
  35. package/dist/cjs/errors/CatchAllApiError.js +1 -1
  36. package/dist/cjs/errors/CatchAllApiTimeoutError.js +1 -1
  37. package/dist/cjs/version.d.ts +1 -1
  38. package/dist/cjs/version.js +1 -1
  39. package/dist/esm/BaseClient.mjs +2 -2
  40. package/dist/esm/api/errors/BadRequestError.mjs +1 -1
  41. package/dist/esm/api/errors/ForbiddenError.mjs +1 -1
  42. package/dist/esm/api/errors/NotFoundError.mjs +1 -1
  43. package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
  44. package/dist/esm/api/errors/UnprocessableEntityError.mjs +1 -1
  45. package/dist/esm/api/resources/entities/client/requests/UpdateEntityRequest.d.mts +2 -0
  46. package/dist/esm/api/resources/jobs/client/Client.d.mts +16 -0
  47. package/dist/esm/api/resources/jobs/client/Client.mjs +55 -0
  48. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.mts +10 -0
  49. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.mjs +2 -0
  50. package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +7 -0
  51. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +12 -0
  52. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
  53. package/dist/esm/api/resources/monitors/client/Client.d.mts +16 -0
  54. package/dist/esm/api/resources/monitors/client/Client.mjs +55 -0
  55. package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.mts +10 -0
  56. package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.mjs +2 -0
  57. package/dist/esm/api/resources/monitors/client/requests/index.d.mts +1 -0
  58. package/dist/esm/api/types/ConnectedDataset.d.mts +11 -0
  59. package/dist/esm/api/types/ConnectedDataset.mjs +2 -0
  60. package/dist/esm/api/types/ConnectedEntity.d.mts +4 -0
  61. package/dist/esm/api/types/CreateEntityRequest.d.mts +2 -0
  62. package/dist/esm/api/types/EntityAssociationType.d.mts +11 -0
  63. package/dist/esm/api/types/EntityAssociationType.mjs +11 -0
  64. package/dist/esm/api/types/EntityResponse.d.mts +2 -0
  65. package/dist/esm/api/types/EntitySummary.d.mts +2 -0
  66. package/dist/esm/api/types/PullJobResponseDto.d.mts +4 -0
  67. package/dist/esm/api/types/PullMonitorResponseDto.d.mts +4 -0
  68. package/dist/esm/api/types/index.d.mts +2 -0
  69. package/dist/esm/api/types/index.mjs +2 -0
  70. package/dist/esm/core/fetcher/getResponseBody.mjs +11 -0
  71. package/dist/esm/core/fetcher/signals.mjs +9 -1
  72. package/dist/esm/errors/CatchAllApiError.mjs +1 -1
  73. package/dist/esm/errors/CatchAllApiTimeoutError.mjs +1 -1
  74. package/dist/esm/version.d.mts +1 -1
  75. package/dist/esm/version.mjs +1 -1
  76. package/package.json +1 -1
  77. package/reference.md +130 -0
package/README.md CHANGED
@@ -375,3 +375,5 @@ On the other hand, contributions to the README are always very welcome!
375
375
 
376
376
 
377
377
 
378
+
379
+
@@ -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": "3.0.0",
47
- "User-Agent": "newscatcher-catchall-sdk/3.0.0",
46
+ "X-Fern-SDK-Version": "4.0.0",
47
+ "User-Agent": "newscatcher-catchall-sdk/4.0.0",
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);
@@ -48,7 +48,7 @@ class BadRequestError extends errors.CatchAllApiError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "BadRequestError";
52
52
  }
53
53
  }
54
54
  exports.BadRequestError = BadRequestError;
@@ -48,7 +48,7 @@ class ForbiddenError extends errors.CatchAllApiError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "ForbiddenError";
52
52
  }
53
53
  }
54
54
  exports.ForbiddenError = ForbiddenError;
@@ -48,7 +48,7 @@ class NotFoundError extends errors.CatchAllApiError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "NotFoundError";
52
52
  }
53
53
  }
54
54
  exports.NotFoundError = NotFoundError;
@@ -48,7 +48,7 @@ class UnauthorizedError extends errors.CatchAllApiError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "UnauthorizedError";
52
52
  }
53
53
  }
54
54
  exports.UnauthorizedError = UnauthorizedError;
@@ -48,7 +48,7 @@ class UnprocessableEntityError extends errors.CatchAllApiError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "UnprocessableEntityError";
52
52
  }
53
53
  }
54
54
  exports.UnprocessableEntityError = UnprocessableEntityError;
@@ -18,5 +18,7 @@ export interface UpdateEntityRequest {
18
18
  name?: string;
19
19
  /** Updated description. */
20
20
  description?: string;
21
+ /** Updated external identifier for this entity. */
22
+ external_entity_id?: string;
21
23
  additional_attributes?: CatchAllApi.AdditionalAttributes;
22
24
  }
@@ -117,6 +117,22 @@ export declare class JobsClient {
117
117
  */
118
118
  getJobResults(request: CatchAllApi.GetJobResultsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullJobResponseDto>;
119
119
  private __getJobResults;
120
+ /**
121
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
122
+ *
123
+ * @param {CatchAllApi.GetJobResultsCsvRequest} request
124
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
125
+ *
126
+ * @throws {@link CatchAllApi.ForbiddenError}
127
+ * @throws {@link CatchAllApi.NotFoundError}
128
+ *
129
+ * @example
130
+ * await client.jobs.getJobResultsCsv({
131
+ * job_id: "job_id"
132
+ * })
133
+ */
134
+ getJobResultsCsv(request: CatchAllApi.GetJobResultsCsvRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<string>;
135
+ private __getJobResultsCsv;
120
136
  /**
121
137
  * Continue an existing job to process more records beyond the initial limit.
122
138
  *
@@ -415,6 +415,61 @@ class JobsClient {
415
415
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}");
416
416
  });
417
417
  }
418
+ /**
419
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
420
+ *
421
+ * @param {CatchAllApi.GetJobResultsCsvRequest} request
422
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
423
+ *
424
+ * @throws {@link CatchAllApi.ForbiddenError}
425
+ * @throws {@link CatchAllApi.NotFoundError}
426
+ *
427
+ * @example
428
+ * await client.jobs.getJobResultsCsv({
429
+ * job_id: "job_id"
430
+ * })
431
+ */
432
+ getJobResultsCsv(request, requestOptions) {
433
+ return core.HttpResponsePromise.fromPromise(this.__getJobResultsCsv(request, requestOptions));
434
+ }
435
+ __getJobResultsCsv(request, requestOptions) {
436
+ return __awaiter(this, void 0, void 0, function* () {
437
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
438
+ const { job_id: jobId } = request;
439
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
440
+ 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);
441
+ const _response = yield core.fetcher({
442
+ 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)}/csv`),
443
+ method: "GET",
444
+ headers: _headers,
445
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
446
+ responseType: "text",
447
+ 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,
448
+ 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,
449
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
450
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
451
+ logging: this._options.logging,
452
+ });
453
+ if (_response.ok) {
454
+ return { data: _response.body, rawResponse: _response.rawResponse };
455
+ }
456
+ if (_response.error.reason === "status-code") {
457
+ switch (_response.error.statusCode) {
458
+ case 403:
459
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
460
+ case 404:
461
+ throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
462
+ default:
463
+ throw new errors.CatchAllApiError({
464
+ statusCode: _response.error.statusCode,
465
+ body: _response.error.body,
466
+ rawResponse: _response.rawResponse,
467
+ });
468
+ }
469
+ }
470
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}/csv");
471
+ });
472
+ }
418
473
  /**
419
474
  * Continue an existing job to process more records beyond the initial limit.
420
475
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * job_id: "job_id"
5
+ * }
6
+ */
7
+ export interface GetJobResultsCsvRequest {
8
+ /** Unique job identifier returned from [`POST /catchAll/submit`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/create-job). */
9
+ job_id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,4 +9,11 @@ import type * as CatchAllApi from "../../../../index.js";
9
9
  export interface InitializeRequestDto {
10
10
  query: CatchAllApi.Query;
11
11
  context?: CatchAllApi.Context;
12
+ /** Optional list of watchlist dataset IDs connected to this job. */
13
+ connected_dataset_ids?: string[];
14
+ /**
15
+ * When true, returns generic news validators and enrichments suitable for
16
+ * watchlist-based article collection instead of query-specific fields.
17
+ */
18
+ fetch_all_watchlist_news?: boolean;
12
19
  }
@@ -51,6 +51,18 @@ export interface SubmitRequestDto {
51
51
  project_id?: string;
52
52
  /** IDs of webhooks to notify when the job completes. Maximum 5 per job. */
53
53
  webhook_ids?: string[];
54
+ /**
55
+ * When true, retrieves all news for connected Company Watchlist entities
56
+ * without topic filtering. Requires connected_dataset_ids to be set.
57
+ */
58
+ fetch_all_watchlist_news?: boolean;
59
+ /**
60
+ * Filter events by entity association type. `event_associated` keeps only
61
+ * events where the entity is a direct actor. `mention` keeps only events
62
+ * where the entity is merely referenced. Only relevant when
63
+ * connected_dataset_ids is set.
64
+ */
65
+ ed_association_type?: CatchAllApi.EntityAssociationType;
54
66
  }
55
67
  export declare namespace SubmitRequestDto {
56
68
  /**
@@ -1,5 +1,6 @@
1
1
  export type { ContinueRequestDto } from "./ContinueRequestDto.js";
2
2
  export type { DeleteJobRequest } from "./DeleteJobRequest.js";
3
+ export type { GetJobResultsCsvRequest } from "./GetJobResultsCsvRequest.js";
3
4
  export type { GetJobResultsRequest } from "./GetJobResultsRequest.js";
4
5
  export type { GetJobStatusRequest } from "./GetJobStatusRequest.js";
5
6
  export type { GetUserJobsRequest } from "./GetUserJobsRequest.js";
@@ -65,6 +65,22 @@ export declare class MonitorsClient {
65
65
  */
66
66
  pullMonitorResults(request: CatchAllApi.PullMonitorResultsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullMonitorResponseDto>;
67
67
  private __pullMonitorResults;
68
+ /**
69
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
70
+ *
71
+ * @param {CatchAllApi.PullMonitorResultsCsvRequest} request
72
+ * @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @throws {@link CatchAllApi.ForbiddenError}
75
+ * @throws {@link CatchAllApi.NotFoundError}
76
+ *
77
+ * @example
78
+ * await client.monitors.pullMonitorResultsCsv({
79
+ * monitor_id: "monitor_id"
80
+ * })
81
+ */
82
+ pullMonitorResultsCsv(request: CatchAllApi.PullMonitorResultsCsvRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<string>;
83
+ private __pullMonitorResultsCsv;
68
84
  /**
69
85
  * Return all jobs executed by a monitor.
70
86
  *
@@ -246,6 +246,61 @@ class MonitorsClient {
246
246
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}");
247
247
  });
248
248
  }
249
+ /**
250
+ * Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
251
+ *
252
+ * @param {CatchAllApi.PullMonitorResultsCsvRequest} request
253
+ * @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
254
+ *
255
+ * @throws {@link CatchAllApi.ForbiddenError}
256
+ * @throws {@link CatchAllApi.NotFoundError}
257
+ *
258
+ * @example
259
+ * await client.monitors.pullMonitorResultsCsv({
260
+ * monitor_id: "monitor_id"
261
+ * })
262
+ */
263
+ pullMonitorResultsCsv(request, requestOptions) {
264
+ return core.HttpResponsePromise.fromPromise(this.__pullMonitorResultsCsv(request, requestOptions));
265
+ }
266
+ __pullMonitorResultsCsv(request, requestOptions) {
267
+ return __awaiter(this, void 0, void 0, function* () {
268
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
269
+ const { monitor_id: monitorId } = request;
270
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
271
+ 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);
272
+ const _response = yield core.fetcher({
273
+ 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)}/csv`),
274
+ method: "GET",
275
+ headers: _headers,
276
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
277
+ responseType: "text",
278
+ 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,
279
+ 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,
280
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
281
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
282
+ logging: this._options.logging,
283
+ });
284
+ if (_response.ok) {
285
+ return { data: _response.body, rawResponse: _response.rawResponse };
286
+ }
287
+ if (_response.error.reason === "status-code") {
288
+ switch (_response.error.statusCode) {
289
+ case 403:
290
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
291
+ case 404:
292
+ throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
293
+ default:
294
+ throw new errors.CatchAllApiError({
295
+ statusCode: _response.error.statusCode,
296
+ body: _response.error.body,
297
+ rawResponse: _response.rawResponse,
298
+ });
299
+ }
300
+ }
301
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}/csv");
302
+ });
303
+ }
249
304
  /**
250
305
  * Return all jobs executed by a monitor.
251
306
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * monitor_id: "monitor_id"
5
+ * }
6
+ */
7
+ export interface PullMonitorResultsCsvRequest {
8
+ /** Monitor identifier. */
9
+ monitor_id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,5 +5,6 @@ export type { EnableMonitorRequestDto } from "./EnableMonitorRequestDto.js";
5
5
  export type { GetMonitorStatusHistoryRequest } from "./GetMonitorStatusHistoryRequest.js";
6
6
  export type { ListMonitorJobsRequest } from "./ListMonitorJobsRequest.js";
7
7
  export type { ListMonitorsRequest } from "./ListMonitorsRequest.js";
8
+ export type { PullMonitorResultsCsvRequest } from "./PullMonitorResultsCsvRequest.js";
8
9
  export type { PullMonitorResultsRequest } from "./PullMonitorResultsRequest.js";
9
10
  export type { UpdateMonitorRequestDto } from "./UpdateMonitorRequestDto.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A dataset used to narrow the retrieval scope of a job or monitor, returned with its identifier and name.
3
+ */
4
+ export interface ConnectedDataset {
5
+ /** Dataset identifier. */
6
+ id: string;
7
+ /** Dataset name as stored. Check `is_deleted` to determine whether the dataset is still active. */
8
+ name: string;
9
+ /** True when the dataset has been deleted. */
10
+ is_deleted?: boolean | undefined;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -22,8 +22,12 @@ export interface ConnectedEntity {
22
22
  ed_score: number;
23
23
  /** Short explanation (up to 100 characters) of why this entity is associated with the event. */
24
24
  relation: string;
25
+ /** How the entity relates to the event: `event_associated` if the entity is a direct actor, `mention` if merely referenced. */
26
+ association_type?: string | undefined;
25
27
  /** The entity type. */
26
28
  type: string;
29
+ /** External identifier for this entity. Null when not set. */
30
+ external_entity_id?: (string | null) | undefined;
27
31
  /**
28
32
  * The stored attributes for this entity. Present only when attributes exist in the database.
29
33
  *
@@ -9,5 +9,7 @@ export interface CreateEntityRequest {
9
9
  entity_type?: CatchAllApi.EntityType | undefined;
10
10
  /** Free-text description of the entity used for disambiguation when similar names exist. */
11
11
  description?: string | undefined;
12
+ /** Optional external identifier for this entity. Free-form string, not enforced as unique. Use it to store your own CRM, data warehouse, or internal database ID so you can join CatchAll results back to your systems. */
13
+ external_entity_id?: string | undefined;
12
14
  additional_attributes?: CatchAllApi.AdditionalAttributes | undefined;
13
15
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * How an entity relates to an event.
3
+ *
4
+ * - `event_associated`: The entity is a direct actor in the event (primary subject).
5
+ * - `mention`: The entity is merely referenced in passing.
6
+ */
7
+ export declare const EntityAssociationType: {
8
+ readonly Mention: "mention";
9
+ readonly EventAssociated: "event_associated";
10
+ };
11
+ export type EntityAssociationType = (typeof EntityAssociationType)[keyof typeof EntityAssociationType];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EntityAssociationType = void 0;
5
+ /**
6
+ * How an entity relates to an event.
7
+ *
8
+ * - `event_associated`: The entity is a direct actor in the event (primary subject).
9
+ * - `mention`: The entity is merely referenced in passing.
10
+ */
11
+ exports.EntityAssociationType = {
12
+ Mention: "mention",
13
+ EventAssociated: "event_associated",
14
+ };
@@ -9,6 +9,8 @@ export interface EntityResponse {
9
9
  name: string;
10
10
  /** Free-text description. */
11
11
  description?: (string | null) | undefined;
12
+ /** External identifier for this entity. Null when not set. */
13
+ external_entity_id?: (string | null) | undefined;
12
14
  additional_attributes?: CatchAllApi.AdditionalAttributes | undefined;
13
15
  status: CatchAllApi.EntityStatus;
14
16
  /** ID of the user who created this entity. */
@@ -14,5 +14,7 @@ export interface EntitySummary {
14
14
  status: CatchAllApi.EntityStatus;
15
15
  /** Free-text description. */
16
16
  description?: (string | null) | undefined;
17
+ /** External identifier for this entity. Null when not set. */
18
+ external_entity_id?: (string | null) | undefined;
17
19
  attributes?: CatchAllApi.CompanyAttributes | undefined;
18
20
  }
@@ -37,6 +37,10 @@ export interface PullJobResponseDto {
37
37
  total_pages?: number | undefined;
38
38
  /** Processing mode used for this job. */
39
39
  mode?: PullJobResponseDto.Mode | undefined;
40
+ /** Datasets used to narrow retrieval scope, each with `id` and `name`. */
41
+ connected_datasets?: CatchAllApi.ConnectedDataset[] | undefined;
42
+ /** True when the query was submitted as an all-news (watchlist-generic) query. */
43
+ is_all_news_query?: boolean | undefined;
40
44
  /** Present when the job was shared with the authenticated user by another organization member. `null` when the user owns the job. */
41
45
  sharing_info?: (CatchAllApi.SharingInfo | null) | undefined;
42
46
  /** Array of extracted records with structured data and citations. */
@@ -21,6 +21,10 @@ export interface PullMonitorResponseDto {
21
21
  all_records?: CatchAllApi.MonitorRecord[] | undefined;
22
22
  /** Record limit applied to this monitor's jobs. */
23
23
  limit?: (number | null) | undefined;
24
+ /** Datasets used to narrow retrieval scope, each with `id` and `name`. */
25
+ connected_datasets?: CatchAllApi.ConnectedDataset[] | undefined;
26
+ /** True when the reference job was submitted as an all-news (watchlist-generic) query. */
27
+ is_all_news_query?: boolean | undefined;
24
28
  }
25
29
  export declare namespace PullMonitorResponseDto {
26
30
  /**
@@ -8,6 +8,7 @@ export * from "./BearerAuthDto.js";
8
8
  export * from "./Citation.js";
9
9
  export * from "./CompanyAttributes.js";
10
10
  export * from "./CompanyEnrichmentOutput.js";
11
+ export * from "./ConnectedDataset.js";
11
12
  export * from "./ConnectedEntity.js";
12
13
  export * from "./Context.js";
13
14
  export * from "./ContinueResponseDto.js";
@@ -35,6 +36,7 @@ export * from "./DeliveryStatus.js";
35
36
  export * from "./EndDate.js";
36
37
  export * from "./EnrichmentSchema.js";
37
38
  export * from "./EnrichmentType.js";
39
+ export * from "./EntityAssociationType.js";
38
40
  export * from "./EntityListResponse.js";
39
41
  export * from "./EntityResponse.js";
40
42
  export * from "./EntitySortBy.js";
@@ -24,6 +24,7 @@ __exportStar(require("./BearerAuthDto.js"), exports);
24
24
  __exportStar(require("./Citation.js"), exports);
25
25
  __exportStar(require("./CompanyAttributes.js"), exports);
26
26
  __exportStar(require("./CompanyEnrichmentOutput.js"), exports);
27
+ __exportStar(require("./ConnectedDataset.js"), exports);
27
28
  __exportStar(require("./ConnectedEntity.js"), exports);
28
29
  __exportStar(require("./Context.js"), exports);
29
30
  __exportStar(require("./ContinueResponseDto.js"), exports);
@@ -51,6 +52,7 @@ __exportStar(require("./DeliveryStatus.js"), exports);
51
52
  __exportStar(require("./EndDate.js"), exports);
52
53
  __exportStar(require("./EnrichmentSchema.js"), exports);
53
54
  __exportStar(require("./EnrichmentType.js"), exports);
55
+ __exportStar(require("./EntityAssociationType.js"), exports);
54
56
  __exportStar(require("./EntityListResponse.js"), exports);
55
57
  __exportStar(require("./EntityResponse.js"), exports);
56
58
  __exportStar(require("./EntitySortBy.js"), exports);
@@ -12,6 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getResponseBody = getResponseBody;
13
13
  const json_js_1 = require("../json.js");
14
14
  const BinaryResponse_js_1 = require("./BinaryResponse.js");
15
+ // Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.
16
+ function retainResponse(target, response) {
17
+ Object.defineProperty(target, "__fern_response_ref", {
18
+ value: response,
19
+ enumerable: false,
20
+ configurable: true,
21
+ writable: false,
22
+ });
23
+ }
15
24
  function getResponseBody(response, responseType) {
16
25
  return __awaiter(this, void 0, void 0, function* () {
17
26
  switch (responseType) {
@@ -31,6 +40,7 @@ function getResponseBody(response, responseType) {
31
40
  },
32
41
  };
33
42
  }
43
+ retainResponse(response.body, response);
34
44
  return response.body;
35
45
  case "streaming":
36
46
  if (response.body == null) {
@@ -42,6 +52,7 @@ function getResponseBody(response, responseType) {
42
52
  },
43
53
  };
44
54
  }
55
+ retainResponse(response.body, response);
45
56
  return response.body;
46
57
  case "text":
47
58
  return yield response.text();
@@ -14,11 +14,19 @@ function anySignal(...args) {
14
14
  for (const signal of signals) {
15
15
  if (signal.aborted) {
16
16
  controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
17
- break;
17
+ return controller.signal;
18
18
  }
19
19
  signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
20
20
  signal: controller.signal,
21
21
  });
22
+ // Re-check after adding listener: the signal may have aborted
23
+ // between the initial `signal.aborted` check and the `addEventListener`
24
+ // call above. If it did, the abort event was already dispatched and
25
+ // the listener will never fire — we must manually abort.
26
+ if (signal.aborted) {
27
+ controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
28
+ return controller.signal;
29
+ }
22
30
  }
23
31
  return controller.signal;
24
32
  }
@@ -10,7 +10,7 @@ class CatchAllApiError extends Error {
10
10
  if (Error.captureStackTrace) {
11
11
  Error.captureStackTrace(this, this.constructor);
12
12
  }
13
- this.name = this.constructor.name;
13
+ this.name = "CatchAllApiError";
14
14
  this.statusCode = statusCode;
15
15
  this.body = body;
16
16
  this.rawResponse = rawResponse;
@@ -9,7 +9,7 @@ class CatchAllApiTimeoutError extends Error {
9
9
  if (Error.captureStackTrace) {
10
10
  Error.captureStackTrace(this, this.constructor);
11
11
  }
12
- this.name = this.constructor.name;
12
+ this.name = "CatchAllApiTimeoutError";
13
13
  if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
14
14
  this.cause = opts.cause;
15
15
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.0.0";
1
+ export declare const SDK_VERSION = "4.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 = "3.0.0";
4
+ exports.SDK_VERSION = "4.0.0";
@@ -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": "3.0.0",
10
- "User-Agent": "newscatcher-catchall-sdk/3.0.0",
9
+ "X-Fern-SDK-Version": "4.0.0",
10
+ "User-Agent": "newscatcher-catchall-sdk/4.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);
@@ -12,6 +12,6 @@ export class BadRequestError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "BadRequestError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class ForbiddenError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "ForbiddenError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class NotFoundError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "NotFoundError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class UnauthorizedError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "UnauthorizedError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class UnprocessableEntityError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "UnprocessableEntityError";
16
16
  }
17
17
  }