newscatcher-catchall-sdk 1.0.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +284 -289
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +13 -17
- package/dist/cjs/api/resources/jobs/client/Client.js +12 -19
- package/dist/cjs/api/resources/jobs/client/requests/ContinueRequestDto.d.ts +3 -3
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +2 -1
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +5 -6
- package/dist/cjs/api/resources/jobs/exports.d.ts +2 -0
- package/dist/cjs/api/resources/jobs/exports.js +21 -0
- package/dist/cjs/api/resources/meta/exports.d.ts +2 -0
- package/dist/cjs/api/resources/meta/exports.js +21 -0
- package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +1 -1
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +23 -37
- package/dist/cjs/api/resources/monitors/client/Client.js +35 -41
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +23 -6
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.ts +17 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/monitors/exports.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/exports.js +21 -0
- package/dist/cjs/api/types/BaseRecord.d.ts +38 -0
- package/dist/cjs/api/types/BaseRecord.js +16 -0
- package/dist/cjs/api/types/Citation.d.ts +3 -3
- package/dist/cjs/api/types/CompanyEnrichmentOutput.d.ts +29 -0
- package/dist/cjs/api/types/CompanyEnrichmentOutput.js +16 -0
- package/dist/cjs/api/types/ContinueResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/EndDate.d.ts +4 -2
- package/dist/cjs/api/types/EnrichmentType.d.ts +1 -3
- package/dist/cjs/api/types/EnrichmentType.js +1 -3
- package/dist/cjs/api/types/Error_.d.ts +1 -1
- package/dist/cjs/api/types/InitializeResponseDto.d.ts +8 -9
- package/dist/cjs/api/types/JobStep.d.ts +2 -2
- package/dist/cjs/api/types/Limit.d.ts +1 -1
- package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
- package/dist/cjs/api/types/MonitorCitation.d.ts +3 -8
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +7 -7
- package/dist/cjs/api/types/MonitorRecord.d.ts +4 -14
- package/dist/{esm/api/types/JobStatus.d.mts → cjs/api/types/PublicJobStatus.d.ts} +4 -4
- package/dist/cjs/api/types/{JobStatus.js → PublicJobStatus.js} +4 -4
- package/dist/cjs/api/types/PullJobResponseDto.d.ts +27 -22
- package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +12 -12
- package/dist/cjs/api/types/Query.d.ts +1 -1
- package/dist/cjs/api/types/Record_.d.ts +2 -12
- package/dist/cjs/api/types/ReferenceJob.d.ts +3 -3
- package/dist/cjs/api/types/StartDate.d.ts +4 -2
- package/dist/cjs/api/types/StatusResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/{SubmitResponseBody.d.ts → SubmitResponseDto.d.ts} +1 -1
- package/dist/cjs/api/types/UserJob.d.ts +1 -1
- package/dist/cjs/api/types/ValidationErrorDetail.d.ts +3 -3
- package/dist/cjs/api/types/ValidationErrorResponse.d.ts +1 -1
- package/dist/cjs/api/types/ValidatorSchema.d.ts +3 -3
- package/dist/cjs/api/types/WebhookDto.d.ts +4 -4
- package/dist/cjs/api/types/WebhookPayload.d.ts +9 -9
- package/dist/cjs/api/types/index.d.ts +4 -3
- package/dist/cjs/api/types/index.js +4 -3
- package/dist/cjs/core/fetcher/Fetcher.js +8 -2
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/runtime/runtime.js +8 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/jobs/client/Client.d.mts +13 -17
- package/dist/esm/api/resources/jobs/client/Client.mjs +12 -19
- package/dist/esm/api/resources/jobs/client/requests/ContinueRequestDto.d.mts +3 -3
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +2 -1
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +5 -6
- package/dist/esm/api/resources/jobs/exports.d.mts +2 -0
- package/dist/esm/api/resources/jobs/exports.mjs +3 -0
- package/dist/esm/api/resources/meta/exports.d.mts +2 -0
- package/dist/esm/api/resources/meta/exports.mjs +3 -0
- package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +1 -1
- package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +1 -1
- package/dist/esm/api/resources/monitors/client/Client.d.mts +23 -37
- package/dist/esm/api/resources/monitors/client/Client.mjs +35 -41
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +23 -6
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.mts +17 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +2 -0
- package/dist/esm/api/resources/monitors/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/monitors/exports.d.mts +2 -0
- package/dist/esm/api/resources/monitors/exports.mjs +3 -0
- package/dist/esm/api/types/BaseRecord.d.mts +38 -0
- package/dist/esm/api/types/BaseRecord.mjs +13 -0
- package/dist/esm/api/types/Citation.d.mts +3 -3
- package/dist/esm/api/types/CompanyEnrichmentOutput.d.mts +29 -0
- package/dist/esm/api/types/CompanyEnrichmentOutput.mjs +13 -0
- package/dist/esm/api/types/ContinueResponseDto.d.mts +2 -2
- package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +1 -1
- package/dist/esm/api/types/EndDate.d.mts +4 -2
- package/dist/esm/api/types/EnrichmentType.d.mts +1 -3
- package/dist/esm/api/types/EnrichmentType.mjs +1 -3
- package/dist/esm/api/types/Error_.d.mts +1 -1
- package/dist/esm/api/types/InitializeResponseDto.d.mts +8 -9
- package/dist/esm/api/types/JobStep.d.mts +2 -2
- package/dist/esm/api/types/Limit.d.mts +1 -1
- package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
- package/dist/esm/api/types/MonitorCitation.d.mts +3 -8
- package/dist/esm/api/types/MonitorListItemDto.d.mts +7 -7
- package/dist/esm/api/types/MonitorRecord.d.mts +4 -14
- package/dist/{cjs/api/types/JobStatus.d.ts → esm/api/types/PublicJobStatus.d.mts} +4 -4
- package/dist/esm/api/types/{JobStatus.mjs → PublicJobStatus.mjs} +3 -3
- package/dist/esm/api/types/PullJobResponseDto.d.mts +27 -22
- package/dist/esm/api/types/PullMonitorResponseDto.d.mts +12 -12
- package/dist/esm/api/types/Query.d.mts +1 -1
- package/dist/esm/api/types/Record_.d.mts +2 -12
- package/dist/esm/api/types/ReferenceJob.d.mts +3 -3
- package/dist/esm/api/types/StartDate.d.mts +4 -2
- package/dist/esm/api/types/StatusResponseDto.d.mts +2 -2
- package/dist/esm/api/types/{SubmitResponseBody.d.mts → SubmitResponseDto.d.mts} +1 -1
- package/dist/esm/api/types/UserJob.d.mts +1 -1
- package/dist/esm/api/types/ValidationErrorDetail.d.mts +3 -3
- package/dist/esm/api/types/ValidationErrorResponse.d.mts +1 -1
- package/dist/esm/api/types/ValidatorSchema.d.mts +3 -3
- package/dist/esm/api/types/WebhookDto.d.mts +4 -4
- package/dist/esm/api/types/WebhookPayload.d.mts +9 -9
- package/dist/esm/api/types/index.d.mts +4 -3
- package/dist/esm/api/types/index.mjs +4 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/runtime/runtime.mjs +8 -7
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +37 -4
- package/reference.md +43 -53
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +0 -10
- package/dist/cjs/api/types/Schema.d.ts +0 -6
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +0 -10
- package/dist/esm/api/types/Schema.d.mts +0 -6
- /package/dist/cjs/api/resources/monitors/client/requests/{EnableMonitorRequest.js → EnableMonitorRequestDto.js} +0 -0
- /package/dist/cjs/api/{types/Schema.js → resources/monitors/client/requests/ListMonitorsRequest.js} +0 -0
- /package/dist/cjs/api/types/{SubmitResponseBody.js → SubmitResponseDto.js} +0 -0
- /package/dist/esm/api/resources/monitors/client/requests/{EnableMonitorRequest.mjs → EnableMonitorRequestDto.mjs} +0 -0
- /package/dist/esm/api/{types/Schema.mjs → resources/monitors/client/requests/ListMonitorsRequest.mjs} +0 -0
- /package/dist/esm/api/types/{SubmitResponseBody.mjs → SubmitResponseDto.mjs} +0 -0
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type * as CatchAllApi from "../index.js";
|
|
2
|
-
export interface Record_ {
|
|
3
|
-
/**
|
|
4
|
-
record_id: string;
|
|
5
|
-
/** Short title summarizing the record. */
|
|
6
|
-
record_title: string;
|
|
7
|
-
/**
|
|
8
|
-
* Structured data extracted from articles. Schema is dynamically generated per job. Field names are chosen semantically to match the content.
|
|
9
|
-
*
|
|
10
|
-
* See [Understanding dynamic schemas](https://www.newscatcherapi.com/docs/v3/catch-all/overview/dynamic-schemas) for integration guidance.
|
|
11
|
-
*/
|
|
12
|
-
enrichment: Record<string, unknown>;
|
|
13
|
-
/** Source articles that were used to extract this record. */
|
|
2
|
+
export interface Record_ extends CatchAllApi.BaseRecord {
|
|
3
|
+
/** Source documents that were used to extract this record. */
|
|
14
4
|
citations: CatchAllApi.Citation[];
|
|
15
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface ReferenceJob {
|
|
2
|
-
/**
|
|
3
|
-
query?: string;
|
|
2
|
+
/** Plain text query from the reference job. */
|
|
3
|
+
query?: string | undefined;
|
|
4
4
|
/** Context provided with the reference job query. */
|
|
5
|
-
context?: string;
|
|
5
|
+
context?: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Start
|
|
2
|
+
* Start date for web search (ISO 8601 format with UTC timezone).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Defines the start of the search window by web page discovery date, not event date. Web pages discovered within this range may describe events from any time period.
|
|
5
|
+
*
|
|
6
|
+
* Must be within plan's allowed search depth. Default is 5 days before current date if not specified.
|
|
5
7
|
*/
|
|
6
8
|
export type StartDate = string;
|
|
@@ -3,7 +3,7 @@ export interface StatusResponseDto {
|
|
|
3
3
|
/** Job identifier. */
|
|
4
4
|
job_id: string;
|
|
5
5
|
/** Current job processing status. */
|
|
6
|
-
status?: CatchAllApi.
|
|
6
|
+
status?: CatchAllApi.PublicJobStatus | undefined;
|
|
7
7
|
/** Detailed progress tracking for each processing stage. Steps progress sequentially from order 1 (submitted) through 5 (enriching), ending at order 6 (completed) or 7 (failed). */
|
|
8
|
-
steps
|
|
8
|
+
steps?: CatchAllApi.JobStep[] | undefined;
|
|
9
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface ValidationErrorDetail {
|
|
2
2
|
/** Location of the validation error */
|
|
3
|
-
loc?: ValidationErrorDetail.Loc.Item[];
|
|
3
|
+
loc?: ValidationErrorDetail.Loc.Item[] | undefined;
|
|
4
4
|
/** Error message */
|
|
5
|
-
msg?: string;
|
|
5
|
+
msg?: string | undefined;
|
|
6
6
|
/** Error type */
|
|
7
|
-
type?: string;
|
|
7
|
+
type?: string | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare namespace ValidationErrorDetail {
|
|
10
10
|
type Loc = Loc.Item[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Schema for a single validator that filters
|
|
2
|
+
* Schema for a single validator that filters clusters of web pages.
|
|
3
3
|
*
|
|
4
4
|
* Validators are applied during the enriching stage to determine which clusters are relevant.
|
|
5
5
|
*/
|
|
6
6
|
export interface ValidatorSchema {
|
|
7
7
|
/** Validator field name (snake_case recommended). */
|
|
8
8
|
name: string;
|
|
9
|
-
/** What this validator checks for in the
|
|
9
|
+
/** What this validator checks for in the web page. */
|
|
10
10
|
description: string;
|
|
11
11
|
/** Validator type (currently only boolean supported). */
|
|
12
|
-
type?: "boolean";
|
|
12
|
+
type?: "boolean" | undefined;
|
|
13
13
|
}
|
|
@@ -2,13 +2,13 @@ export interface WebhookDto {
|
|
|
2
2
|
/** Webhook endpoint URL. */
|
|
3
3
|
url: string;
|
|
4
4
|
/** HTTP method to use. */
|
|
5
|
-
method?: WebhookDto.Method;
|
|
5
|
+
method?: WebhookDto.Method | undefined;
|
|
6
6
|
/** HTTP headers to include in request. */
|
|
7
|
-
headers?: Record<string, string
|
|
7
|
+
headers?: Record<string, string> | undefined;
|
|
8
8
|
/** Query string parameters. */
|
|
9
|
-
params?: Record<string, unknown
|
|
9
|
+
params?: Record<string, unknown> | undefined;
|
|
10
10
|
/** Basic auth credentials [username, password]. */
|
|
11
|
-
auth?: string[];
|
|
11
|
+
auth?: string[] | undefined;
|
|
12
12
|
}
|
|
13
13
|
export declare namespace WebhookDto {
|
|
14
14
|
/** HTTP method to use. */
|
|
@@ -6,21 +6,21 @@ import type * as CatchAllApi from "../index.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface WebhookPayload {
|
|
8
8
|
/** Monitor identifier. */
|
|
9
|
-
monitor_id?: string;
|
|
9
|
+
monitor_id?: string | undefined;
|
|
10
10
|
/** Reference job used as template for this monitor. */
|
|
11
|
-
reference_job_id?: string;
|
|
11
|
+
reference_job_id?: string | undefined;
|
|
12
12
|
/** Job ID of the most recent execution. */
|
|
13
|
-
latest_job_id?: string;
|
|
13
|
+
latest_job_id?: string | undefined;
|
|
14
14
|
/** Number of new records from latest job (after deduplication). */
|
|
15
|
-
records_count?: number;
|
|
15
|
+
records_count?: number | undefined;
|
|
16
16
|
/** Total number of jobs executed by this monitor. */
|
|
17
|
-
jobs_processed?: number;
|
|
17
|
+
jobs_processed?: number | undefined;
|
|
18
18
|
/** The date when the webhook was triggered in ISO 8601 format with UTC timezone. */
|
|
19
|
-
updated_at?: string;
|
|
19
|
+
updated_at?: string | undefined;
|
|
20
20
|
/** Cron expression defining the monitor schedule. */
|
|
21
|
-
cron_expression?: string;
|
|
21
|
+
cron_expression?: string | undefined;
|
|
22
22
|
/** Timezone for schedule execution. */
|
|
23
|
-
timezone?: string;
|
|
23
|
+
timezone?: string | undefined;
|
|
24
24
|
/** Array of new records from the latest job execution (includes monitor-specific fields like added_on, updated_on). */
|
|
25
|
-
records?: CatchAllApi.MonitorRecord[];
|
|
25
|
+
records?: CatchAllApi.MonitorRecord[] | undefined;
|
|
26
26
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export * from "./BaseRecord.js";
|
|
1
2
|
export * from "./Citation.js";
|
|
3
|
+
export * from "./CompanyEnrichmentOutput.js";
|
|
2
4
|
export * from "./Context.js";
|
|
3
5
|
export * from "./ContinueResponseDto.js";
|
|
4
6
|
export * from "./CreateMonitorResponseDto.js";
|
|
@@ -7,7 +9,6 @@ export * from "./EnrichmentSchema.js";
|
|
|
7
9
|
export * from "./EnrichmentType.js";
|
|
8
10
|
export * from "./Error_.js";
|
|
9
11
|
export * from "./InitializeResponseDto.js";
|
|
10
|
-
export * from "./JobStatus.js";
|
|
11
12
|
export * from "./JobStep.js";
|
|
12
13
|
export * from "./Limit.js";
|
|
13
14
|
export * from "./ListMonitorsResponseDto.js";
|
|
@@ -16,15 +17,15 @@ export * from "./MonitorCitation.js";
|
|
|
16
17
|
export * from "./MonitorJobItem.js";
|
|
17
18
|
export * from "./MonitorListItemDto.js";
|
|
18
19
|
export * from "./MonitorRecord.js";
|
|
20
|
+
export * from "./PublicJobStatus.js";
|
|
19
21
|
export * from "./PullJobResponseDto.js";
|
|
20
22
|
export * from "./PullMonitorResponseDto.js";
|
|
21
23
|
export * from "./Query.js";
|
|
22
24
|
export * from "./Record_.js";
|
|
23
25
|
export * from "./ReferenceJob.js";
|
|
24
|
-
export * from "./Schema.js";
|
|
25
26
|
export * from "./StartDate.js";
|
|
26
27
|
export * from "./StatusResponseDto.js";
|
|
27
|
-
export * from "./
|
|
28
|
+
export * from "./SubmitResponseDto.js";
|
|
28
29
|
export * from "./UpdateMonitorResponseDto.js";
|
|
29
30
|
export * from "./UserJob.js";
|
|
30
31
|
export * from "./ValidationErrorDetail.js";
|
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BaseRecord.js"), exports);
|
|
17
18
|
__exportStar(require("./Citation.js"), exports);
|
|
19
|
+
__exportStar(require("./CompanyEnrichmentOutput.js"), exports);
|
|
18
20
|
__exportStar(require("./Context.js"), exports);
|
|
19
21
|
__exportStar(require("./ContinueResponseDto.js"), exports);
|
|
20
22
|
__exportStar(require("./CreateMonitorResponseDto.js"), exports);
|
|
@@ -23,7 +25,6 @@ __exportStar(require("./EnrichmentSchema.js"), exports);
|
|
|
23
25
|
__exportStar(require("./EnrichmentType.js"), exports);
|
|
24
26
|
__exportStar(require("./Error_.js"), exports);
|
|
25
27
|
__exportStar(require("./InitializeResponseDto.js"), exports);
|
|
26
|
-
__exportStar(require("./JobStatus.js"), exports);
|
|
27
28
|
__exportStar(require("./JobStep.js"), exports);
|
|
28
29
|
__exportStar(require("./Limit.js"), exports);
|
|
29
30
|
__exportStar(require("./ListMonitorsResponseDto.js"), exports);
|
|
@@ -32,15 +33,15 @@ __exportStar(require("./MonitorCitation.js"), exports);
|
|
|
32
33
|
__exportStar(require("./MonitorJobItem.js"), exports);
|
|
33
34
|
__exportStar(require("./MonitorListItemDto.js"), exports);
|
|
34
35
|
__exportStar(require("./MonitorRecord.js"), exports);
|
|
36
|
+
__exportStar(require("./PublicJobStatus.js"), exports);
|
|
35
37
|
__exportStar(require("./PullJobResponseDto.js"), exports);
|
|
36
38
|
__exportStar(require("./PullMonitorResponseDto.js"), exports);
|
|
37
39
|
__exportStar(require("./Query.js"), exports);
|
|
38
40
|
__exportStar(require("./Record_.js"), exports);
|
|
39
41
|
__exportStar(require("./ReferenceJob.js"), exports);
|
|
40
|
-
__exportStar(require("./Schema.js"), exports);
|
|
41
42
|
__exportStar(require("./StartDate.js"), exports);
|
|
42
43
|
__exportStar(require("./StatusResponseDto.js"), exports);
|
|
43
|
-
__exportStar(require("./
|
|
44
|
+
__exportStar(require("./SubmitResponseDto.js"), exports);
|
|
44
45
|
__exportStar(require("./UpdateMonitorResponseDto.js"), exports);
|
|
45
46
|
__exportStar(require("./UserJob.js"), exports);
|
|
46
47
|
__exportStar(require("./ValidationErrorDetail.js"), exports);
|
|
@@ -156,7 +156,13 @@ function getHeaders(args) {
|
|
|
156
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
157
|
var _a;
|
|
158
158
|
const newHeaders = new Headers_js_1.Headers();
|
|
159
|
-
newHeaders.set("Accept", args.responseType === "json"
|
|
159
|
+
newHeaders.set("Accept", args.responseType === "json"
|
|
160
|
+
? "application/json"
|
|
161
|
+
: args.responseType === "text"
|
|
162
|
+
? "text/plain"
|
|
163
|
+
: args.responseType === "sse"
|
|
164
|
+
? "text/event-stream"
|
|
165
|
+
: "*/*");
|
|
160
166
|
if (args.body !== undefined && args.contentType != null) {
|
|
161
167
|
newHeaders.set("Content-Type", args.contentType);
|
|
162
168
|
}
|
|
@@ -200,7 +206,7 @@ function fetcherImpl(args) {
|
|
|
200
206
|
}
|
|
201
207
|
try {
|
|
202
208
|
const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
|
|
209
|
+
return (0, makeRequest_js_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex, args.responseType === "streaming" || args.responseType === "sse");
|
|
204
210
|
}), args.maxRetries);
|
|
205
211
|
if (response.status >= 200 && response.status < 400) {
|
|
206
212
|
if (logger.isDebug()) {
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function isCacheNoStoreSupported(): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resetCacheNoStoreSupported(): void;
|
|
6
|
+
export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", disableCache?: boolean) => Promise<Response>;
|
|
@@ -10,8 +10,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.makeRequest = void 0;
|
|
13
|
+
exports.isCacheNoStoreSupported = isCacheNoStoreSupported;
|
|
14
|
+
exports.resetCacheNoStoreSupported = resetCacheNoStoreSupported;
|
|
13
15
|
const signals_js_1 = require("./signals.js");
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Cached result of checking whether the current runtime supports
|
|
18
|
+
* the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
|
|
19
|
+
* throw a TypeError when this option is used.
|
|
20
|
+
*/
|
|
21
|
+
let _cacheNoStoreSupported;
|
|
22
|
+
function isCacheNoStoreSupported() {
|
|
23
|
+
if (_cacheNoStoreSupported != null) {
|
|
24
|
+
return _cacheNoStoreSupported;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
new Request("http://localhost", { cache: "no-store" });
|
|
28
|
+
_cacheNoStoreSupported = true;
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
_cacheNoStoreSupported = false;
|
|
32
|
+
}
|
|
33
|
+
return _cacheNoStoreSupported;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
|
|
37
|
+
*/
|
|
38
|
+
function resetCacheNoStoreSupported() {
|
|
39
|
+
_cacheNoStoreSupported = undefined;
|
|
40
|
+
}
|
|
41
|
+
const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
42
|
const signals = [];
|
|
16
43
|
let timeoutAbortId;
|
|
17
44
|
if (timeoutMs != null) {
|
|
@@ -23,15 +50,9 @@ const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abor
|
|
|
23
50
|
signals.push(abortSignal);
|
|
24
51
|
}
|
|
25
52
|
const newSignals = (0, signals_js_1.anySignal)(signals);
|
|
26
|
-
const response = yield fetchFn(url, {
|
|
27
|
-
method: method,
|
|
28
|
-
headers,
|
|
29
|
-
body: requestBody,
|
|
30
|
-
signal: newSignals,
|
|
31
|
-
credentials: withCredentials ? "include" : undefined,
|
|
53
|
+
const response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
|
|
32
54
|
// @ts-ignore
|
|
33
|
-
duplex,
|
|
34
|
-
});
|
|
55
|
+
duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
|
|
35
56
|
if (timeoutAbortId != null) {
|
|
36
57
|
clearTimeout(timeoutAbortId);
|
|
37
58
|
}
|
|
@@ -84,17 +84,18 @@ function evaluateRuntime() {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
87
|
+
*
|
|
88
|
+
* We assign `process` to a local variable first to avoid being flagged by
|
|
89
|
+
* bundlers that perform static analysis on `process.versions` (e.g. Next.js
|
|
90
|
+
* Edge Runtime warns about Node.js APIs even when they are guarded).
|
|
87
91
|
*/
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
!!process.version &&
|
|
91
|
-
"versions" in process &&
|
|
92
|
-
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
92
|
+
const _process = typeof process !== "undefined" ? process : undefined;
|
|
93
|
+
const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
|
|
93
94
|
if (isNode) {
|
|
94
95
|
return {
|
|
95
96
|
type: "node",
|
|
96
|
-
version:
|
|
97
|
-
parsedVersion: Number(
|
|
97
|
+
version: _process.versions.node,
|
|
98
|
+
parsedVersion: Number(_process.versions.node.split(".")[0]),
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
return {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1.2";
|
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": "1.
|
|
10
|
-
"User-Agent": "newscatcher-catchall-sdk/1.
|
|
9
|
+
"X-Fern-SDK-Version": "1.1.2",
|
|
10
|
+
"User-Agent": "newscatcher-catchall-sdk/1.1.2",
|
|
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);
|
|
@@ -14,9 +14,7 @@ export declare class JobsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<JobsClient.Options>;
|
|
15
15
|
constructor(options?: JobsClient.Options);
|
|
16
16
|
/**
|
|
17
|
-
* Get suggested validators, enrichments, and date ranges for a query
|
|
18
|
-
*
|
|
19
|
-
* Returns LLM-generated suggestions based on query analysis and validates against plan limits.
|
|
17
|
+
* Get suggested validators, enrichments, and date ranges for a query.
|
|
20
18
|
*
|
|
21
19
|
* @param {CatchAllApi.InitializeRequestDto} request
|
|
22
20
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -26,16 +24,14 @@ export declare class JobsClient {
|
|
|
26
24
|
*
|
|
27
25
|
* @example
|
|
28
26
|
* await client.jobs.initialize({
|
|
29
|
-
* query: "
|
|
27
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
28
|
+
* context: "Focus on funding amount and company name"
|
|
30
29
|
* })
|
|
31
30
|
*/
|
|
32
31
|
initialize(request: CatchAllApi.InitializeRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.InitializeResponseDto>;
|
|
33
32
|
private __initialize;
|
|
34
33
|
/**
|
|
35
|
-
* Submit a
|
|
36
|
-
*
|
|
37
|
-
* Optionally specify context, date ranges, limit, custom validators, and enrichments.
|
|
38
|
-
* If dates exceed plan limits, returns 400 error.
|
|
34
|
+
* Submit a query to create a new processing job.
|
|
39
35
|
*
|
|
40
36
|
* @param {CatchAllApi.SubmitRequestDto} request
|
|
41
37
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -46,14 +42,14 @@ export declare class JobsClient {
|
|
|
46
42
|
*
|
|
47
43
|
* @example
|
|
48
44
|
* await client.jobs.createJob({
|
|
49
|
-
* query: "
|
|
50
|
-
* context: "Focus on
|
|
45
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
46
|
+
* context: "Focus on funding amount and company name",
|
|
51
47
|
* limit: 10,
|
|
52
|
-
* start_date: "2026-
|
|
53
|
-
* end_date: "2026-02-
|
|
48
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
49
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
54
50
|
* })
|
|
55
51
|
*/
|
|
56
|
-
createJob(request: CatchAllApi.SubmitRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.
|
|
52
|
+
createJob(request: CatchAllApi.SubmitRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.SubmitResponseDto>;
|
|
57
53
|
private __createJob;
|
|
58
54
|
/**
|
|
59
55
|
* Continue an existing job to process more records beyond the initial limit.
|
|
@@ -67,7 +63,7 @@ export declare class JobsClient {
|
|
|
67
63
|
*
|
|
68
64
|
* @example
|
|
69
65
|
* await client.jobs.continueJob({
|
|
70
|
-
* job_id: "
|
|
66
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
71
67
|
* new_limit: 100
|
|
72
68
|
* })
|
|
73
69
|
*/
|
|
@@ -84,7 +80,7 @@ export declare class JobsClient {
|
|
|
84
80
|
*
|
|
85
81
|
* @example
|
|
86
82
|
* await client.jobs.getJobStatus({
|
|
87
|
-
* job_id: "
|
|
83
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
88
84
|
* })
|
|
89
85
|
*/
|
|
90
86
|
getJobStatus(request: CatchAllApi.GetJobStatusRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.StatusResponseDto>;
|
|
@@ -100,7 +96,7 @@ export declare class JobsClient {
|
|
|
100
96
|
* @example
|
|
101
97
|
* await client.jobs.getUserJobs()
|
|
102
98
|
*/
|
|
103
|
-
getUserJobs(request?: CatchAllApi.GetUserJobsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListUserJobsResponseDto
|
|
99
|
+
getUserJobs(request?: CatchAllApi.GetUserJobsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListUserJobsResponseDto>;
|
|
104
100
|
private __getUserJobs;
|
|
105
101
|
/**
|
|
106
102
|
* Retrieve the final results for a completed job.
|
|
@@ -113,7 +109,7 @@ export declare class JobsClient {
|
|
|
113
109
|
*
|
|
114
110
|
* @example
|
|
115
111
|
* await client.jobs.getJobResults({
|
|
116
|
-
* job_id: "
|
|
112
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
117
113
|
* })
|
|
118
114
|
*/
|
|
119
115
|
getJobResults(request: CatchAllApi.GetJobResultsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullJobResponseDto>;
|
|
@@ -23,9 +23,7 @@ export class JobsClient {
|
|
|
23
23
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Get suggested validators, enrichments, and date ranges for a query
|
|
27
|
-
*
|
|
28
|
-
* Returns LLM-generated suggestions based on query analysis and validates against plan limits.
|
|
26
|
+
* Get suggested validators, enrichments, and date ranges for a query.
|
|
29
27
|
*
|
|
30
28
|
* @param {CatchAllApi.InitializeRequestDto} request
|
|
31
29
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -35,7 +33,8 @@ export class JobsClient {
|
|
|
35
33
|
*
|
|
36
34
|
* @example
|
|
37
35
|
* await client.jobs.initialize({
|
|
38
|
-
* query: "
|
|
36
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
37
|
+
* context: "Focus on funding amount and company name"
|
|
39
38
|
* })
|
|
40
39
|
*/
|
|
41
40
|
initialize(request, requestOptions) {
|
|
@@ -81,10 +80,7 @@ export class JobsClient {
|
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
82
|
/**
|
|
84
|
-
* Submit a
|
|
85
|
-
*
|
|
86
|
-
* Optionally specify context, date ranges, limit, custom validators, and enrichments.
|
|
87
|
-
* If dates exceed plan limits, returns 400 error.
|
|
83
|
+
* Submit a query to create a new processing job.
|
|
88
84
|
*
|
|
89
85
|
* @param {CatchAllApi.SubmitRequestDto} request
|
|
90
86
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -95,11 +91,11 @@ export class JobsClient {
|
|
|
95
91
|
*
|
|
96
92
|
* @example
|
|
97
93
|
* await client.jobs.createJob({
|
|
98
|
-
* query: "
|
|
99
|
-
* context: "Focus on
|
|
94
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
95
|
+
* context: "Focus on funding amount and company name",
|
|
100
96
|
* limit: 10,
|
|
101
|
-
* start_date: "2026-
|
|
102
|
-
* end_date: "2026-02-
|
|
97
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
98
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
103
99
|
* })
|
|
104
100
|
*/
|
|
105
101
|
createJob(request, requestOptions) {
|
|
@@ -158,7 +154,7 @@ export class JobsClient {
|
|
|
158
154
|
*
|
|
159
155
|
* @example
|
|
160
156
|
* await client.jobs.continueJob({
|
|
161
|
-
* job_id: "
|
|
157
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
162
158
|
* new_limit: 100
|
|
163
159
|
* })
|
|
164
160
|
*/
|
|
@@ -217,7 +213,7 @@ export class JobsClient {
|
|
|
217
213
|
*
|
|
218
214
|
* @example
|
|
219
215
|
* await client.jobs.getJobStatus({
|
|
220
|
-
* job_id: "
|
|
216
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
221
217
|
* })
|
|
222
218
|
*/
|
|
223
219
|
getJobStatus(request, requestOptions) {
|
|
@@ -296,10 +292,7 @@ export class JobsClient {
|
|
|
296
292
|
logging: this._options.logging,
|
|
297
293
|
});
|
|
298
294
|
if (_response.ok) {
|
|
299
|
-
return {
|
|
300
|
-
data: _response.body,
|
|
301
|
-
rawResponse: _response.rawResponse,
|
|
302
|
-
};
|
|
295
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
303
296
|
}
|
|
304
297
|
if (_response.error.reason === "status-code") {
|
|
305
298
|
switch (_response.error.statusCode) {
|
|
@@ -327,7 +320,7 @@ export class JobsClient {
|
|
|
327
320
|
*
|
|
328
321
|
* @example
|
|
329
322
|
* await client.jobs.getJobResults({
|
|
330
|
-
* job_id: "
|
|
323
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
331
324
|
* })
|
|
332
325
|
*/
|
|
333
326
|
getJobResults(request, requestOptions) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* job_id: "
|
|
4
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
5
5
|
* new_limit: 100
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface ContinueRequestDto {
|
|
9
9
|
/** Job identifier of the completed job to continue. */
|
|
10
10
|
job_id: string;
|
|
11
|
-
/** New record limit for continued processing. Must be greater than the previous limit. */
|
|
12
|
-
new_limit
|
|
11
|
+
/** New record limit for continued processing. Must be greater than the previous limit. If not provided, defaults to the plan maximum. */
|
|
12
|
+
new_limit?: number;
|
|
13
13
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* job_id: "
|
|
4
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface GetJobResultsRequest {
|
|
8
|
-
/** Unique job identifier returned from
|
|
8
|
+
/** Unique job identifier returned from [`POST /catchAll/submit`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/create-job). */
|
|
9
9
|
job_id: string;
|
|
10
10
|
/** Page number to retrieve. */
|
|
11
11
|
page?: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* job_id: "
|
|
4
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface GetJobStatusRequest {
|
|
8
|
-
/** Unique job identifier returned from
|
|
8
|
+
/** Unique job identifier returned from [`POST /catchAll/submit`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/create-job). */
|
|
9
9
|
job_id: string;
|
|
10
10
|
}
|
|
@@ -2,7 +2,8 @@ import type * as CatchAllApi from "../../../../index.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
|
-
* query: "
|
|
5
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
6
|
+
* context: "Focus on funding amount and company name"
|
|
6
7
|
* }
|
|
7
8
|
*/
|
|
8
9
|
export interface InitializeRequestDto {
|
|
@@ -2,22 +2,21 @@ import type * as CatchAllApi from "../../../../index.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
|
-
* query: "
|
|
6
|
-
* context: "Focus on
|
|
5
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
6
|
+
* context: "Focus on funding amount and company name",
|
|
7
7
|
* limit: 10,
|
|
8
|
-
* start_date: "2026-
|
|
9
|
-
* end_date: "2026-02-
|
|
8
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
9
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface SubmitRequestDto {
|
|
13
13
|
query: CatchAllApi.Query;
|
|
14
|
-
schema?: CatchAllApi.Schema;
|
|
15
14
|
context?: CatchAllApi.Context;
|
|
16
15
|
limit?: CatchAllApi.Limit;
|
|
17
16
|
start_date?: CatchAllApi.StartDate;
|
|
18
17
|
end_date?: CatchAllApi.EndDate;
|
|
19
18
|
/**
|
|
20
|
-
* Custom validators for filtering
|
|
19
|
+
* Custom validators for filtering web page clusters.
|
|
21
20
|
*
|
|
22
21
|
* If not provided, validators are generated automatically based on the query.
|
|
23
22
|
*/
|