newscatcher-catchall-sdk 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +7 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +12 -0
- package/dist/cjs/api/types/ConnectedEntity.d.ts +2 -0
- package/dist/cjs/api/types/EntityAssociationType.d.ts +11 -0
- package/dist/cjs/api/types/EntityAssociationType.js +14 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +11 -0
- package/dist/cjs/core/fetcher/signals.js +9 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +7 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +12 -0
- package/dist/esm/api/types/ConnectedEntity.d.mts +2 -0
- package/dist/esm/api/types/EntityAssociationType.d.mts +11 -0
- package/dist/esm/api/types/EntityAssociationType.mjs +11 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +11 -0
- package/dist/esm/core/fetcher/signals.mjs +9 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "3.0.
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/3.0.
|
|
46
|
+
"X-Fern-SDK-Version": "3.0.1",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/3.0.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -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
|
/**
|
|
@@ -22,6 +22,8 @@ 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;
|
|
27
29
|
/**
|
|
@@ -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
|
+
};
|
|
@@ -35,6 +35,7 @@ export * from "./DeliveryStatus.js";
|
|
|
35
35
|
export * from "./EndDate.js";
|
|
36
36
|
export * from "./EnrichmentSchema.js";
|
|
37
37
|
export * from "./EnrichmentType.js";
|
|
38
|
+
export * from "./EntityAssociationType.js";
|
|
38
39
|
export * from "./EntityListResponse.js";
|
|
39
40
|
export * from "./EntityResponse.js";
|
|
40
41
|
export * from "./EntitySortBy.js";
|
|
@@ -51,6 +51,7 @@ __exportStar(require("./DeliveryStatus.js"), exports);
|
|
|
51
51
|
__exportStar(require("./EndDate.js"), exports);
|
|
52
52
|
__exportStar(require("./EnrichmentSchema.js"), exports);
|
|
53
53
|
__exportStar(require("./EnrichmentType.js"), exports);
|
|
54
|
+
__exportStar(require("./EntityAssociationType.js"), exports);
|
|
54
55
|
__exportStar(require("./EntityListResponse.js"), exports);
|
|
55
56
|
__exportStar(require("./EntityResponse.js"), exports);
|
|
56
57
|
__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
|
-
|
|
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
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.0.
|
|
1
|
+
export declare const SDK_VERSION = "3.0.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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.
|
|
10
|
-
"User-Agent": "newscatcher-catchall-sdk/3.0.
|
|
9
|
+
"X-Fern-SDK-Version": "3.0.1",
|
|
10
|
+
"User-Agent": "newscatcher-catchall-sdk/3.0.1",
|
|
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);
|
|
@@ -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
|
/**
|
|
@@ -22,6 +22,8 @@ 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;
|
|
27
29
|
/**
|
|
@@ -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
|
+
};
|
|
@@ -35,6 +35,7 @@ export * from "./DeliveryStatus.mjs";
|
|
|
35
35
|
export * from "./EndDate.mjs";
|
|
36
36
|
export * from "./EnrichmentSchema.mjs";
|
|
37
37
|
export * from "./EnrichmentType.mjs";
|
|
38
|
+
export * from "./EntityAssociationType.mjs";
|
|
38
39
|
export * from "./EntityListResponse.mjs";
|
|
39
40
|
export * from "./EntityResponse.mjs";
|
|
40
41
|
export * from "./EntitySortBy.mjs";
|
|
@@ -35,6 +35,7 @@ export * from "./DeliveryStatus.mjs";
|
|
|
35
35
|
export * from "./EndDate.mjs";
|
|
36
36
|
export * from "./EnrichmentSchema.mjs";
|
|
37
37
|
export * from "./EnrichmentType.mjs";
|
|
38
|
+
export * from "./EntityAssociationType.mjs";
|
|
38
39
|
export * from "./EntityListResponse.mjs";
|
|
39
40
|
export * from "./EntityResponse.mjs";
|
|
40
41
|
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
|
-
|
|
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
|
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.0.
|
|
1
|
+
export declare const SDK_VERSION = "3.0.1";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "3.0.
|
|
1
|
+
export const SDK_VERSION = "3.0.1";
|