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
@@ -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
  *
@@ -379,6 +379,61 @@ export class JobsClient {
379
379
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}");
380
380
  });
381
381
  }
382
+ /**
383
+ * 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.
384
+ *
385
+ * @param {CatchAllApi.GetJobResultsCsvRequest} request
386
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
387
+ *
388
+ * @throws {@link CatchAllApi.ForbiddenError}
389
+ * @throws {@link CatchAllApi.NotFoundError}
390
+ *
391
+ * @example
392
+ * await client.jobs.getJobResultsCsv({
393
+ * job_id: "job_id"
394
+ * })
395
+ */
396
+ getJobResultsCsv(request, requestOptions) {
397
+ return core.HttpResponsePromise.fromPromise(this.__getJobResultsCsv(request, requestOptions));
398
+ }
399
+ __getJobResultsCsv(request, requestOptions) {
400
+ return __awaiter(this, void 0, void 0, function* () {
401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
402
+ const { job_id: jobId } = request;
403
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
404
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
405
+ const _response = yield core.fetcher({
406
+ 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`),
407
+ method: "GET",
408
+ headers: _headers,
409
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
410
+ responseType: "text",
411
+ 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,
412
+ 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,
413
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
414
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
415
+ logging: this._options.logging,
416
+ });
417
+ if (_response.ok) {
418
+ return { data: _response.body, rawResponse: _response.rawResponse };
419
+ }
420
+ if (_response.error.reason === "status-code") {
421
+ switch (_response.error.statusCode) {
422
+ case 403:
423
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
424
+ case 404:
425
+ throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
426
+ default:
427
+ throw new errors.CatchAllApiError({
428
+ statusCode: _response.error.statusCode,
429
+ body: _response.error.body,
430
+ rawResponse: _response.rawResponse,
431
+ });
432
+ }
433
+ }
434
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}/csv");
435
+ });
436
+ }
382
437
  /**
383
438
  * Continue an existing job to process more records beyond the initial limit.
384
439
  *
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -9,4 +9,11 @@ import type * as CatchAllApi from "../../../../index.mjs";
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.mjs";
2
2
  export type { DeleteJobRequest } from "./DeleteJobRequest.mjs";
3
+ export type { GetJobResultsCsvRequest } from "./GetJobResultsCsvRequest.mjs";
3
4
  export type { GetJobResultsRequest } from "./GetJobResultsRequest.mjs";
4
5
  export type { GetJobStatusRequest } from "./GetJobStatusRequest.mjs";
5
6
  export type { GetUserJobsRequest } from "./GetUserJobsRequest.mjs";
@@ -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
  *
@@ -210,6 +210,61 @@ export class MonitorsClient {
210
210
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}");
211
211
  });
212
212
  }
213
+ /**
214
+ * 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.
215
+ *
216
+ * @param {CatchAllApi.PullMonitorResultsCsvRequest} request
217
+ * @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
218
+ *
219
+ * @throws {@link CatchAllApi.ForbiddenError}
220
+ * @throws {@link CatchAllApi.NotFoundError}
221
+ *
222
+ * @example
223
+ * await client.monitors.pullMonitorResultsCsv({
224
+ * monitor_id: "monitor_id"
225
+ * })
226
+ */
227
+ pullMonitorResultsCsv(request, requestOptions) {
228
+ return core.HttpResponsePromise.fromPromise(this.__pullMonitorResultsCsv(request, requestOptions));
229
+ }
230
+ __pullMonitorResultsCsv(request, requestOptions) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
233
+ const { monitor_id: monitorId } = request;
234
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
235
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
236
+ const _response = yield core.fetcher({
237
+ 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`),
238
+ method: "GET",
239
+ headers: _headers,
240
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
241
+ responseType: "text",
242
+ 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,
243
+ 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,
244
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
245
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
246
+ logging: this._options.logging,
247
+ });
248
+ if (_response.ok) {
249
+ return { data: _response.body, rawResponse: _response.rawResponse };
250
+ }
251
+ if (_response.error.reason === "status-code") {
252
+ switch (_response.error.statusCode) {
253
+ case 403:
254
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
255
+ case 404:
256
+ throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
257
+ default:
258
+ throw new errors.CatchAllApiError({
259
+ statusCode: _response.error.statusCode,
260
+ body: _response.error.body,
261
+ rawResponse: _response.rawResponse,
262
+ });
263
+ }
264
+ }
265
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}/csv");
266
+ });
267
+ }
213
268
  /**
214
269
  * Return all jobs executed by a monitor.
215
270
  *
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -5,5 +5,6 @@ export type { EnableMonitorRequestDto } from "./EnableMonitorRequestDto.mjs";
5
5
  export type { GetMonitorStatusHistoryRequest } from "./GetMonitorStatusHistoryRequest.mjs";
6
6
  export type { ListMonitorJobsRequest } from "./ListMonitorJobsRequest.mjs";
7
7
  export type { ListMonitorsRequest } from "./ListMonitorsRequest.mjs";
8
+ export type { PullMonitorResultsCsvRequest } from "./PullMonitorResultsCsvRequest.mjs";
8
9
  export type { PullMonitorResultsRequest } from "./PullMonitorResultsRequest.mjs";
9
10
  export type { UpdateMonitorRequestDto } from "./UpdateMonitorRequestDto.mjs";
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,11 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /**
3
+ * How an entity relates to an event.
4
+ *
5
+ * - `event_associated`: The entity is a direct actor in the event (primary subject).
6
+ * - `mention`: The entity is merely referenced in passing.
7
+ */
8
+ export const EntityAssociationType = {
9
+ Mention: "mention",
10
+ EventAssociated: "event_associated",
11
+ };
@@ -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.mjs";
8
8
  export * from "./Citation.mjs";
9
9
  export * from "./CompanyAttributes.mjs";
10
10
  export * from "./CompanyEnrichmentOutput.mjs";
11
+ export * from "./ConnectedDataset.mjs";
11
12
  export * from "./ConnectedEntity.mjs";
12
13
  export * from "./Context.mjs";
13
14
  export * from "./ContinueResponseDto.mjs";
@@ -35,6 +36,7 @@ export * from "./DeliveryStatus.mjs";
35
36
  export * from "./EndDate.mjs";
36
37
  export * from "./EnrichmentSchema.mjs";
37
38
  export * from "./EnrichmentType.mjs";
39
+ export * from "./EntityAssociationType.mjs";
38
40
  export * from "./EntityListResponse.mjs";
39
41
  export * from "./EntityResponse.mjs";
40
42
  export * from "./EntitySortBy.mjs";
@@ -8,6 +8,7 @@ export * from "./BearerAuthDto.mjs";
8
8
  export * from "./Citation.mjs";
9
9
  export * from "./CompanyAttributes.mjs";
10
10
  export * from "./CompanyEnrichmentOutput.mjs";
11
+ export * from "./ConnectedDataset.mjs";
11
12
  export * from "./ConnectedEntity.mjs";
12
13
  export * from "./Context.mjs";
13
14
  export * from "./ContinueResponseDto.mjs";
@@ -35,6 +36,7 @@ export * from "./DeliveryStatus.mjs";
35
36
  export * from "./EndDate.mjs";
36
37
  export * from "./EnrichmentSchema.mjs";
37
38
  export * from "./EnrichmentType.mjs";
39
+ export * from "./EntityAssociationType.mjs";
38
40
  export * from "./EntityListResponse.mjs";
39
41
  export * from "./EntityResponse.mjs";
40
42
  export * from "./EntitySortBy.mjs";
@@ -9,6 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { fromJson } from "../json.mjs";
11
11
  import { getBinaryResponse } from "./BinaryResponse.mjs";
12
+ // Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.
13
+ function retainResponse(target, response) {
14
+ Object.defineProperty(target, "__fern_response_ref", {
15
+ value: response,
16
+ enumerable: false,
17
+ configurable: true,
18
+ writable: false,
19
+ });
20
+ }
12
21
  export function getResponseBody(response, responseType) {
13
22
  return __awaiter(this, void 0, void 0, function* () {
14
23
  switch (responseType) {
@@ -28,6 +37,7 @@ export function getResponseBody(response, responseType) {
28
37
  },
29
38
  };
30
39
  }
40
+ retainResponse(response.body, response);
31
41
  return response.body;
32
42
  case "streaming":
33
43
  if (response.body == null) {
@@ -39,6 +49,7 @@ export function getResponseBody(response, responseType) {
39
49
  },
40
50
  };
41
51
  }
52
+ retainResponse(response.body, response);
42
53
  return response.body;
43
54
  case "text":
44
55
  return yield response.text();
@@ -10,11 +10,19 @@ export function anySignal(...args) {
10
10
  for (const signal of signals) {
11
11
  if (signal.aborted) {
12
12
  controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
13
- break;
13
+ return controller.signal;
14
14
  }
15
15
  signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
16
16
  signal: controller.signal,
17
17
  });
18
+ // Re-check after adding listener: the signal may have aborted
19
+ // between the initial `signal.aborted` check and the `addEventListener`
20
+ // call above. If it did, the abort event was already dispatched and
21
+ // the listener will never fire — we must manually abort.
22
+ if (signal.aborted) {
23
+ controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
24
+ return controller.signal;
25
+ }
18
26
  }
19
27
  return controller.signal;
20
28
  }
@@ -7,7 +7,7 @@ export class CatchAllApiError extends Error {
7
7
  if (Error.captureStackTrace) {
8
8
  Error.captureStackTrace(this, this.constructor);
9
9
  }
10
- this.name = this.constructor.name;
10
+ this.name = "CatchAllApiError";
11
11
  this.statusCode = statusCode;
12
12
  this.body = body;
13
13
  this.rawResponse = rawResponse;
@@ -6,7 +6,7 @@ export class CatchAllApiTimeoutError extends Error {
6
6
  if (Error.captureStackTrace) {
7
7
  Error.captureStackTrace(this, this.constructor);
8
8
  }
9
- this.name = this.constructor.name;
9
+ this.name = "CatchAllApiTimeoutError";
10
10
  if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
11
11
  this.cause = opts.cause;
12
12
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.0.0";
1
+ export declare const SDK_VERSION = "4.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "3.0.0";
1
+ export const SDK_VERSION = "4.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newscatcher-catchall-sdk",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -394,6 +394,71 @@ await client.jobs.getJobResults({
394
394
  </dl>
395
395
 
396
396
 
397
+ </dd>
398
+ </dl>
399
+ </details>
400
+
401
+ <details><summary><code>client.jobs.<a href="/src/api/resources/jobs/client/Client.ts">getJobResultsCsv</a>({ ...params }) -> string</code></summary>
402
+ <dl>
403
+ <dd>
404
+
405
+ #### 📝 Description
406
+
407
+ <dl>
408
+ <dd>
409
+
410
+ <dl>
411
+ <dd>
412
+
413
+ 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.
414
+ </dd>
415
+ </dl>
416
+ </dd>
417
+ </dl>
418
+
419
+ #### 🔌 Usage
420
+
421
+ <dl>
422
+ <dd>
423
+
424
+ <dl>
425
+ <dd>
426
+
427
+ ```typescript
428
+ await client.jobs.getJobResultsCsv({
429
+ job_id: "job_id"
430
+ });
431
+
432
+ ```
433
+ </dd>
434
+ </dl>
435
+ </dd>
436
+ </dl>
437
+
438
+ #### ⚙️ Parameters
439
+
440
+ <dl>
441
+ <dd>
442
+
443
+ <dl>
444
+ <dd>
445
+
446
+ **request:** `CatchAllApi.GetJobResultsCsvRequest`
447
+
448
+ </dd>
449
+ </dl>
450
+
451
+ <dl>
452
+ <dd>
453
+
454
+ **requestOptions:** `JobsClient.RequestOptions`
455
+
456
+ </dd>
457
+ </dl>
458
+ </dd>
459
+ </dl>
460
+
461
+
397
462
  </dd>
398
463
  </dl>
399
464
  </details>
@@ -730,6 +795,71 @@ await client.monitors.pullMonitorResults({
730
795
  </dl>
731
796
 
732
797
 
798
+ </dd>
799
+ </dl>
800
+ </details>
801
+
802
+ <details><summary><code>client.monitors.<a href="/src/api/resources/monitors/client/Client.ts">pullMonitorResultsCsv</a>({ ...params }) -> string</code></summary>
803
+ <dl>
804
+ <dd>
805
+
806
+ #### 📝 Description
807
+
808
+ <dl>
809
+ <dd>
810
+
811
+ <dl>
812
+ <dd>
813
+
814
+ 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.
815
+ </dd>
816
+ </dl>
817
+ </dd>
818
+ </dl>
819
+
820
+ #### 🔌 Usage
821
+
822
+ <dl>
823
+ <dd>
824
+
825
+ <dl>
826
+ <dd>
827
+
828
+ ```typescript
829
+ await client.monitors.pullMonitorResultsCsv({
830
+ monitor_id: "monitor_id"
831
+ });
832
+
833
+ ```
834
+ </dd>
835
+ </dl>
836
+ </dd>
837
+ </dl>
838
+
839
+ #### ⚙️ Parameters
840
+
841
+ <dl>
842
+ <dd>
843
+
844
+ <dl>
845
+ <dd>
846
+
847
+ **request:** `CatchAllApi.PullMonitorResultsCsvRequest`
848
+
849
+ </dd>
850
+ </dl>
851
+
852
+ <dl>
853
+ <dd>
854
+
855
+ **requestOptions:** `MonitorsClient.RequestOptions`
856
+
857
+ </dd>
858
+ </dl>
859
+ </dd>
860
+ </dl>
861
+
862
+
733
863
  </dd>
734
864
  </dl>
735
865
  </details>