newscatcher-catchall-sdk 0.3.1 → 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 -286
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +32 -8
- package/dist/cjs/api/resources/jobs/client/Client.js +93 -20
- 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/GetUserJobsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +12 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +17 -6
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
- 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 -33
- package/dist/cjs/api/resources/monitors/client/Client.js +35 -37
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +26 -5
- 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/ListMonitorsRequest.js +3 -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 +8 -0
- package/dist/cjs/api/types/EndDate.js +3 -0
- package/dist/cjs/api/types/EnrichmentSchema.d.ts +13 -0
- package/dist/cjs/api/types/EnrichmentSchema.js +3 -0
- package/dist/cjs/api/types/EnrichmentType.d.ts +19 -0
- package/dist/cjs/api/types/EnrichmentType.js +22 -0
- package/dist/cjs/api/types/Error_.d.ts +1 -1
- package/dist/cjs/api/types/InitializeResponseDto.d.ts +19 -0
- package/dist/cjs/api/types/InitializeResponseDto.js +3 -0
- package/dist/cjs/api/types/JobStep.d.ts +2 -2
- package/dist/cjs/api/types/Limit.d.ts +6 -0
- package/dist/cjs/api/types/Limit.js +3 -0
- package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
- package/dist/cjs/api/types/ListUserJobsResponseDto.d.ts +11 -8
- 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 +28 -23
- 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 +8 -0
- package/dist/cjs/api/types/StartDate.js +3 -0
- 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/SubmitResponseDto.js +3 -0
- package/dist/cjs/api/types/UserJob.d.ts +10 -0
- package/dist/cjs/api/types/UserJob.js +3 -0
- 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 +13 -0
- package/dist/cjs/api/types/ValidatorSchema.js +3 -0
- 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 +12 -3
- package/dist/cjs/api/types/index.js +12 -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 +32 -8
- package/dist/esm/api/resources/jobs/client/Client.mjs +93 -20
- 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/GetUserJobsRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +12 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +17 -6
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
- 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 -33
- package/dist/esm/api/resources/monitors/client/Client.mjs +35 -37
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +26 -5
- 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/ListMonitorsRequest.mjs +2 -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 +8 -0
- package/dist/esm/api/types/EndDate.mjs +2 -0
- package/dist/esm/api/types/EnrichmentSchema.d.mts +13 -0
- package/dist/esm/api/types/EnrichmentSchema.mjs +2 -0
- package/dist/esm/api/types/EnrichmentType.d.mts +19 -0
- package/dist/esm/api/types/EnrichmentType.mjs +19 -0
- package/dist/esm/api/types/Error_.d.mts +1 -1
- package/dist/esm/api/types/InitializeResponseDto.d.mts +19 -0
- package/dist/esm/api/types/InitializeResponseDto.mjs +2 -0
- package/dist/esm/api/types/JobStep.d.mts +2 -2
- package/dist/esm/api/types/Limit.d.mts +6 -0
- package/dist/esm/api/types/Limit.mjs +2 -0
- package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
- package/dist/esm/api/types/ListUserJobsResponseDto.d.mts +11 -8
- 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 +28 -23
- 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 +8 -0
- package/dist/esm/api/types/StartDate.mjs +2 -0
- 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/SubmitResponseDto.mjs +2 -0
- package/dist/esm/api/types/UserJob.d.mts +10 -0
- package/dist/esm/api/types/UserJob.mjs +2 -0
- 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 +13 -0
- package/dist/esm/api/types/ValidatorSchema.mjs +2 -0
- 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 +12 -3
- package/dist/esm/api/types/index.mjs +12 -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 +115 -40
- 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 → jobs/client/requests/GetUserJobsRequest.js} +0 -0
- /package/dist/cjs/api/{types/Schema.js → resources/jobs/client/requests/InitializeRequestDto.js} +0 -0
- /package/dist/cjs/api/{types/SubmitResponseBody.js → resources/monitors/client/requests/EnableMonitorRequestDto.js} +0 -0
- /package/dist/esm/api/resources/{monitors/client/requests/EnableMonitorRequest.mjs → jobs/client/requests/GetUserJobsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/Schema.mjs → resources/jobs/client/requests/InitializeRequestDto.mjs} +0 -0
- /package/dist/esm/api/{types/SubmitResponseBody.mjs → resources/monitors/client/requests/EnableMonitorRequestDto.mjs} +0 -0
|
@@ -4,18 +4,18 @@ export interface MonitorListItemDto {
|
|
|
4
4
|
monitor_id: string;
|
|
5
5
|
/** Job identifier used as a reference for this monitor. */
|
|
6
6
|
reference_job_id: string;
|
|
7
|
-
/**
|
|
7
|
+
/** Plain text query from the reference job. */
|
|
8
8
|
reference_job_query: string;
|
|
9
9
|
/** Whether the monitor is currently active. */
|
|
10
10
|
enabled: boolean;
|
|
11
11
|
/** Cron expression for monitor schedule. */
|
|
12
|
-
schedule?: string;
|
|
13
|
-
/**
|
|
14
|
-
schedule_human_readable?: string;
|
|
12
|
+
schedule?: string | undefined;
|
|
13
|
+
/** The monitor schedule in a plain text format. */
|
|
14
|
+
schedule_human_readable?: string | undefined;
|
|
15
15
|
/** Timezone for schedule execution. */
|
|
16
|
-
timezone?: string;
|
|
16
|
+
timezone?: string | undefined;
|
|
17
17
|
/** The date when the monitor was created. */
|
|
18
|
-
created_at?: string;
|
|
18
|
+
created_at?: string | undefined;
|
|
19
19
|
/** Webhook configuration for this monitor (if set). */
|
|
20
|
-
webhook?: CatchAllApi.WebhookDto;
|
|
20
|
+
webhook?: CatchAllApi.WebhookDto | undefined;
|
|
21
21
|
}
|
|
@@ -3,21 +3,11 @@ import type * as CatchAllApi from "../index.js";
|
|
|
3
3
|
* Record with monitor-specific metadata. Used in monitor results and webhook payloads.
|
|
4
4
|
* Includes timestamps tracking when records were added and updated, and citations include job tracking.
|
|
5
5
|
*/
|
|
6
|
-
export interface MonitorRecord {
|
|
7
|
-
/**
|
|
8
|
-
record_id: string;
|
|
9
|
-
/** Short title summarizing the record. */
|
|
10
|
-
record_title: string;
|
|
11
|
-
/**
|
|
12
|
-
* Structured data extracted from articles. Schema is dynamically generated per job. Field names are chosen semantically to match the content.
|
|
13
|
-
*
|
|
14
|
-
* See [Understanding dynamic schemas](https://www.newscatcherapi.com/docs/v3/catch-all/overview/dynamic-schemas) for integration guidance.
|
|
15
|
-
*/
|
|
16
|
-
enrichment: Record<string, unknown>;
|
|
17
|
-
/** Source articles with monitor-specific metadata (job_id, added_on timestamps). */
|
|
6
|
+
export interface MonitorRecord extends CatchAllApi.BaseRecord {
|
|
7
|
+
/** Source documents with monitor-specific metadata (job_id, added_on timestamps). */
|
|
18
8
|
citations: CatchAllApi.MonitorCitation[];
|
|
19
9
|
/** The date when this record was first added to monitor results in ISO 8601 format with UTC timezone. */
|
|
20
|
-
added_on?: string;
|
|
10
|
+
added_on?: string | undefined;
|
|
21
11
|
/** The date when this record was last updated in monitor results in ISO 8601 format with UTC timezone. */
|
|
22
|
-
updated_on?: string;
|
|
12
|
+
updated_on?: string | undefined;
|
|
23
13
|
}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* - `submitted`: Job queued, waiting to start processing.
|
|
5
5
|
* - `analyzing`: Extracting keywords, generating search queries, and creating validators/extractors.
|
|
6
|
-
* - `fetching`: Retrieving
|
|
7
|
-
* - `clustering`: Grouping similar
|
|
6
|
+
* - `fetching`: Retrieving web pages.
|
|
7
|
+
* - `clustering`: Grouping similar web pages into clusters.
|
|
8
8
|
* - `enriching`: Validating clusters and extracting structured data.
|
|
9
9
|
* - `completed`: Job finished successfully, results ready.
|
|
10
10
|
* - `failed`: Job processing failed.
|
|
11
11
|
*
|
|
12
12
|
* Poll `/catchAll/status/{job_id}` every 30-60 seconds until status is `completed` (typically 10-15 minutes).
|
|
13
13
|
*/
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const PublicJobStatus: {
|
|
15
15
|
readonly Submitted: "submitted";
|
|
16
16
|
readonly Analyzing: "analyzing";
|
|
17
17
|
readonly Fetching: "fetching";
|
|
@@ -20,4 +20,4 @@ export declare const JobStatus: {
|
|
|
20
20
|
readonly Completed: "completed";
|
|
21
21
|
readonly Failed: "failed";
|
|
22
22
|
};
|
|
23
|
-
export type
|
|
23
|
+
export type PublicJobStatus = (typeof PublicJobStatus)[keyof typeof PublicJobStatus];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.PublicJobStatus = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* Current job processing status. Jobs progress through these stages:
|
|
7
7
|
*
|
|
8
8
|
* - `submitted`: Job queued, waiting to start processing.
|
|
9
9
|
* - `analyzing`: Extracting keywords, generating search queries, and creating validators/extractors.
|
|
10
|
-
* - `fetching`: Retrieving
|
|
11
|
-
* - `clustering`: Grouping similar
|
|
10
|
+
* - `fetching`: Retrieving web pages.
|
|
11
|
+
* - `clustering`: Grouping similar web pages into clusters.
|
|
12
12
|
* - `enriching`: Validating clusters and extracting structured data.
|
|
13
13
|
* - `completed`: Job finished successfully, results ready.
|
|
14
14
|
* - `failed`: Job processing failed.
|
|
15
15
|
*
|
|
16
16
|
* Poll `/catchAll/status/{job_id}` every 30-60 seconds until status is `completed` (typically 10-15 minutes).
|
|
17
17
|
*/
|
|
18
|
-
exports.
|
|
18
|
+
exports.PublicJobStatus = {
|
|
19
19
|
Submitted: "submitted",
|
|
20
20
|
Analyzing: "analyzing",
|
|
21
21
|
Fetching: "fetching",
|
|
@@ -2,44 +2,49 @@ import type * as CatchAllApi from "../index.js";
|
|
|
2
2
|
export interface PullJobResponseDto {
|
|
3
3
|
/** Job identifier. */
|
|
4
4
|
job_id: string;
|
|
5
|
-
/** Original
|
|
6
|
-
query?: string;
|
|
5
|
+
/** Original plain text query. */
|
|
6
|
+
query?: string | undefined;
|
|
7
7
|
/** Context provided with the query. */
|
|
8
|
-
context?: string;
|
|
8
|
+
context?: string | undefined;
|
|
9
9
|
/** List of validation criteria applied to filter results. */
|
|
10
|
-
validators?: string[];
|
|
10
|
+
validators?: string[] | undefined;
|
|
11
11
|
/**
|
|
12
|
-
* List of extracted field names generated by the enrichment process.
|
|
13
|
-
*
|
|
12
|
+
* List of extracted field names generated by the enrichment process. These field names appear in the `enrichment` object of each record.
|
|
13
|
+
*
|
|
14
|
+
* **Note:** The `enrichment_confidence` field always appears in this list. The system adds it to every record regardless of the enrichments generated or defined.
|
|
14
15
|
*/
|
|
15
|
-
enrichments?: string[];
|
|
16
|
+
enrichments?: string[] | undefined;
|
|
16
17
|
/** Job status. */
|
|
17
|
-
status
|
|
18
|
+
status?: string | undefined;
|
|
19
|
+
/** Error message if the job failed. Null for successful jobs. */
|
|
20
|
+
error?: (string | null) | undefined;
|
|
21
|
+
/** Record limit for this job. Reflects the value specified at submit time, or the plan default if no limit was provided. */
|
|
22
|
+
limit?: number | undefined;
|
|
18
23
|
/** Total time taken to process the job. */
|
|
19
|
-
duration?: string;
|
|
20
|
-
/**
|
|
21
|
-
candidate_records?: number;
|
|
24
|
+
duration?: string | undefined;
|
|
25
|
+
/** Total number of distinct event clusters identified. Compare with `progress_validated` to estimate how many candidates remain unprocessed for job continuation. */
|
|
26
|
+
candidate_records?: number | undefined;
|
|
22
27
|
/** Number of validated records extracted. */
|
|
23
|
-
valid_records?: number;
|
|
28
|
+
valid_records?: number | undefined;
|
|
24
29
|
/**
|
|
25
|
-
* Number of candidate
|
|
30
|
+
* Number of candidate clusters that have been validated during processing.
|
|
26
31
|
*
|
|
27
|
-
* The system process
|
|
32
|
+
* The system process data in batches. This field tracks how many `candidate_records` have been checked against validation criteria so far.
|
|
28
33
|
*/
|
|
29
|
-
progress_validated?: number;
|
|
30
|
-
date_range?: PullJobResponseDto.DateRange;
|
|
34
|
+
progress_validated?: (number | null) | undefined;
|
|
35
|
+
date_range?: PullJobResponseDto.DateRange | undefined;
|
|
31
36
|
/** The current page number. */
|
|
32
|
-
page?: number;
|
|
33
|
-
/** The total number of pages available. */
|
|
34
|
-
total_pages?: number;
|
|
37
|
+
page?: number | undefined;
|
|
35
38
|
/** The number of records per page. */
|
|
36
|
-
page_size?: number;
|
|
39
|
+
page_size?: number | undefined;
|
|
40
|
+
/** The total number of pages available. */
|
|
41
|
+
total_pages?: number | undefined;
|
|
37
42
|
/** Array of extracted records with structured data and citations. */
|
|
38
|
-
all_records?: CatchAllApi.Record_[];
|
|
43
|
+
all_records?: CatchAllApi.Record_[] | undefined;
|
|
39
44
|
}
|
|
40
45
|
export declare namespace PullJobResponseDto {
|
|
41
46
|
interface DateRange {
|
|
42
|
-
start_date?: string;
|
|
43
|
-
end_date?: string;
|
|
47
|
+
start_date?: string | undefined;
|
|
48
|
+
end_date?: string | undefined;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
@@ -3,24 +3,24 @@ export interface PullMonitorResponseDto {
|
|
|
3
3
|
/** Unique identifier for the monitor. */
|
|
4
4
|
monitor_id: string;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The cron expression for a monitor schedule parsed from the text schedule you provide.
|
|
7
|
+
*
|
|
7
8
|
* Standard cron format (minute hour day month day-of-week).
|
|
8
9
|
*/
|
|
9
|
-
cron_expression?: string;
|
|
10
|
+
cron_expression?: string | undefined;
|
|
10
11
|
/** Timezone used for schedule execution. */
|
|
11
|
-
timezone?: string;
|
|
12
|
+
timezone?: string | undefined;
|
|
12
13
|
reference_job: CatchAllApi.ReferenceJob;
|
|
13
14
|
/** Execution time range for this monitor. */
|
|
14
|
-
run_info?: PullMonitorResponseDto.RunInfo;
|
|
15
|
+
run_info?: PullMonitorResponseDto.RunInfo | undefined;
|
|
15
16
|
/** Total number of records collected across all monitor jobs. */
|
|
16
|
-
records?: number;
|
|
17
|
+
records?: number | undefined;
|
|
17
18
|
/** Current monitor status or error message if monitor creation failed. */
|
|
18
19
|
status: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
all_records?: CatchAllApi.MonitorRecord[];
|
|
20
|
+
/** Aggregated records from all jobs executed by this monitor. Each record includes structured data extracted from web sources with citations. */
|
|
21
|
+
all_records?: CatchAllApi.MonitorRecord[] | undefined;
|
|
22
|
+
/** Record limit applied to this monitor's jobs. */
|
|
23
|
+
limit?: (number | null) | undefined;
|
|
24
24
|
}
|
|
25
25
|
export declare namespace PullMonitorResponseDto {
|
|
26
26
|
/**
|
|
@@ -28,8 +28,8 @@ export declare namespace PullMonitorResponseDto {
|
|
|
28
28
|
*/
|
|
29
29
|
interface RunInfo {
|
|
30
30
|
/** Timestamp of the first job execution. */
|
|
31
|
-
first_run?: string;
|
|
31
|
+
first_run?: string | undefined;
|
|
32
32
|
/** Timestamp of the most recent job execution. */
|
|
33
|
-
last_run?: string;
|
|
33
|
+
last_run?: string | undefined;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start date for web search (ISO 8601 format with UTC timezone).
|
|
3
|
+
*
|
|
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.
|
|
7
|
+
*/
|
|
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
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface UserJob {
|
|
2
|
+
/** Job identifier. */
|
|
3
|
+
job_id: string;
|
|
4
|
+
/** Plain text query for this job. */
|
|
5
|
+
query: string;
|
|
6
|
+
/** Job creation timestamp in ISO 8601 format. */
|
|
7
|
+
created_at: string;
|
|
8
|
+
/** Current processing status of the job. */
|
|
9
|
+
status: string;
|
|
10
|
+
}
|
|
@@ -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[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for a single validator that filters clusters of web pages.
|
|
3
|
+
*
|
|
4
|
+
* Validators are applied during the enriching stage to determine which clusters are relevant.
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidatorSchema {
|
|
7
|
+
/** Validator field name (snake_case recommended). */
|
|
8
|
+
name: string;
|
|
9
|
+
/** What this validator checks for in the web page. */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Validator type (currently only boolean supported). */
|
|
12
|
+
type?: "boolean" | undefined;
|
|
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,26 +1,35 @@
|
|
|
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
|
+
export * from "./EndDate.js";
|
|
8
|
+
export * from "./EnrichmentSchema.js";
|
|
9
|
+
export * from "./EnrichmentType.js";
|
|
5
10
|
export * from "./Error_.js";
|
|
6
|
-
export * from "./
|
|
11
|
+
export * from "./InitializeResponseDto.js";
|
|
7
12
|
export * from "./JobStep.js";
|
|
13
|
+
export * from "./Limit.js";
|
|
8
14
|
export * from "./ListMonitorsResponseDto.js";
|
|
9
15
|
export * from "./ListUserJobsResponseDto.js";
|
|
10
16
|
export * from "./MonitorCitation.js";
|
|
11
17
|
export * from "./MonitorJobItem.js";
|
|
12
18
|
export * from "./MonitorListItemDto.js";
|
|
13
19
|
export * from "./MonitorRecord.js";
|
|
20
|
+
export * from "./PublicJobStatus.js";
|
|
14
21
|
export * from "./PullJobResponseDto.js";
|
|
15
22
|
export * from "./PullMonitorResponseDto.js";
|
|
16
23
|
export * from "./Query.js";
|
|
17
24
|
export * from "./Record_.js";
|
|
18
25
|
export * from "./ReferenceJob.js";
|
|
19
|
-
export * from "./
|
|
26
|
+
export * from "./StartDate.js";
|
|
20
27
|
export * from "./StatusResponseDto.js";
|
|
21
|
-
export * from "./
|
|
28
|
+
export * from "./SubmitResponseDto.js";
|
|
22
29
|
export * from "./UpdateMonitorResponseDto.js";
|
|
30
|
+
export * from "./UserJob.js";
|
|
23
31
|
export * from "./ValidationErrorDetail.js";
|
|
24
32
|
export * from "./ValidationErrorResponse.js";
|
|
33
|
+
export * from "./ValidatorSchema.js";
|
|
25
34
|
export * from "./WebhookDto.js";
|
|
26
35
|
export * from "./WebhookPayload.js";
|
|
@@ -14,29 +14,38 @@ 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
|
+
__exportStar(require("./EndDate.js"), exports);
|
|
24
|
+
__exportStar(require("./EnrichmentSchema.js"), exports);
|
|
25
|
+
__exportStar(require("./EnrichmentType.js"), exports);
|
|
21
26
|
__exportStar(require("./Error_.js"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
27
|
+
__exportStar(require("./InitializeResponseDto.js"), exports);
|
|
23
28
|
__exportStar(require("./JobStep.js"), exports);
|
|
29
|
+
__exportStar(require("./Limit.js"), exports);
|
|
24
30
|
__exportStar(require("./ListMonitorsResponseDto.js"), exports);
|
|
25
31
|
__exportStar(require("./ListUserJobsResponseDto.js"), exports);
|
|
26
32
|
__exportStar(require("./MonitorCitation.js"), exports);
|
|
27
33
|
__exportStar(require("./MonitorJobItem.js"), exports);
|
|
28
34
|
__exportStar(require("./MonitorListItemDto.js"), exports);
|
|
29
35
|
__exportStar(require("./MonitorRecord.js"), exports);
|
|
36
|
+
__exportStar(require("./PublicJobStatus.js"), exports);
|
|
30
37
|
__exportStar(require("./PullJobResponseDto.js"), exports);
|
|
31
38
|
__exportStar(require("./PullMonitorResponseDto.js"), exports);
|
|
32
39
|
__exportStar(require("./Query.js"), exports);
|
|
33
40
|
__exportStar(require("./Record_.js"), exports);
|
|
34
41
|
__exportStar(require("./ReferenceJob.js"), exports);
|
|
35
|
-
__exportStar(require("./
|
|
42
|
+
__exportStar(require("./StartDate.js"), exports);
|
|
36
43
|
__exportStar(require("./StatusResponseDto.js"), exports);
|
|
37
|
-
__exportStar(require("./
|
|
44
|
+
__exportStar(require("./SubmitResponseDto.js"), exports);
|
|
38
45
|
__exportStar(require("./UpdateMonitorResponseDto.js"), exports);
|
|
46
|
+
__exportStar(require("./UserJob.js"), exports);
|
|
39
47
|
__exportStar(require("./ValidationErrorDetail.js"), exports);
|
|
40
48
|
__exportStar(require("./ValidationErrorResponse.js"), exports);
|
|
49
|
+
__exportStar(require("./ValidatorSchema.js"), exports);
|
|
41
50
|
__exportStar(require("./WebhookDto.js"), exports);
|
|
42
51
|
__exportStar(require("./WebhookPayload.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
|
+
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": "
|
|
10
|
-
"User-Agent": "newscatcher-catchall-sdk/
|
|
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);
|