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.
Files changed (169) hide show
  1. package/README.md +284 -286
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/resources/jobs/client/Client.d.ts +32 -8
  4. package/dist/cjs/api/resources/jobs/client/Client.js +93 -20
  5. package/dist/cjs/api/resources/jobs/client/requests/ContinueRequestDto.d.ts +3 -3
  6. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.d.ts +2 -2
  7. package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +2 -2
  8. package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +12 -0
  10. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +17 -6
  11. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/jobs/exports.d.ts +2 -0
  13. package/dist/cjs/api/resources/jobs/exports.js +21 -0
  14. package/dist/cjs/api/resources/meta/exports.d.ts +2 -0
  15. package/dist/cjs/api/resources/meta/exports.js +21 -0
  16. package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +1 -1
  17. package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +1 -1
  18. package/dist/cjs/api/resources/monitors/client/Client.d.ts +23 -33
  19. package/dist/cjs/api/resources/monitors/client/Client.js +35 -37
  20. package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +26 -5
  21. package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.ts +17 -0
  22. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +10 -0
  23. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.js +3 -0
  24. package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +2 -0
  25. package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +2 -1
  26. package/dist/cjs/api/resources/monitors/exports.d.ts +2 -0
  27. package/dist/cjs/api/resources/monitors/exports.js +21 -0
  28. package/dist/cjs/api/types/BaseRecord.d.ts +38 -0
  29. package/dist/cjs/api/types/BaseRecord.js +16 -0
  30. package/dist/cjs/api/types/Citation.d.ts +3 -3
  31. package/dist/cjs/api/types/CompanyEnrichmentOutput.d.ts +29 -0
  32. package/dist/cjs/api/types/CompanyEnrichmentOutput.js +16 -0
  33. package/dist/cjs/api/types/ContinueResponseDto.d.ts +2 -2
  34. package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +1 -1
  35. package/dist/cjs/api/types/EndDate.d.ts +8 -0
  36. package/dist/cjs/api/types/EndDate.js +3 -0
  37. package/dist/cjs/api/types/EnrichmentSchema.d.ts +13 -0
  38. package/dist/cjs/api/types/EnrichmentSchema.js +3 -0
  39. package/dist/cjs/api/types/EnrichmentType.d.ts +19 -0
  40. package/dist/cjs/api/types/EnrichmentType.js +22 -0
  41. package/dist/cjs/api/types/Error_.d.ts +1 -1
  42. package/dist/cjs/api/types/InitializeResponseDto.d.ts +19 -0
  43. package/dist/cjs/api/types/InitializeResponseDto.js +3 -0
  44. package/dist/cjs/api/types/JobStep.d.ts +2 -2
  45. package/dist/cjs/api/types/Limit.d.ts +6 -0
  46. package/dist/cjs/api/types/Limit.js +3 -0
  47. package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
  48. package/dist/cjs/api/types/ListUserJobsResponseDto.d.ts +11 -8
  49. package/dist/cjs/api/types/MonitorCitation.d.ts +3 -8
  50. package/dist/cjs/api/types/MonitorListItemDto.d.ts +7 -7
  51. package/dist/cjs/api/types/MonitorRecord.d.ts +4 -14
  52. package/dist/{esm/api/types/JobStatus.d.mts → cjs/api/types/PublicJobStatus.d.ts} +4 -4
  53. package/dist/cjs/api/types/{JobStatus.js → PublicJobStatus.js} +4 -4
  54. package/dist/cjs/api/types/PullJobResponseDto.d.ts +28 -23
  55. package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +12 -12
  56. package/dist/cjs/api/types/Query.d.ts +1 -1
  57. package/dist/cjs/api/types/Record_.d.ts +2 -12
  58. package/dist/cjs/api/types/ReferenceJob.d.ts +3 -3
  59. package/dist/cjs/api/types/StartDate.d.ts +8 -0
  60. package/dist/cjs/api/types/StartDate.js +3 -0
  61. package/dist/cjs/api/types/StatusResponseDto.d.ts +2 -2
  62. package/dist/cjs/api/types/{SubmitResponseBody.d.ts → SubmitResponseDto.d.ts} +1 -1
  63. package/dist/cjs/api/types/SubmitResponseDto.js +3 -0
  64. package/dist/cjs/api/types/UserJob.d.ts +10 -0
  65. package/dist/cjs/api/types/UserJob.js +3 -0
  66. package/dist/cjs/api/types/ValidationErrorDetail.d.ts +3 -3
  67. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +1 -1
  68. package/dist/cjs/api/types/ValidatorSchema.d.ts +13 -0
  69. package/dist/cjs/api/types/ValidatorSchema.js +3 -0
  70. package/dist/cjs/api/types/WebhookDto.d.ts +4 -4
  71. package/dist/cjs/api/types/WebhookPayload.d.ts +9 -9
  72. package/dist/cjs/api/types/index.d.ts +12 -3
  73. package/dist/cjs/api/types/index.js +12 -3
  74. package/dist/cjs/core/fetcher/Fetcher.js +8 -2
  75. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  76. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  77. package/dist/cjs/core/runtime/runtime.js +8 -7
  78. package/dist/cjs/version.d.ts +1 -1
  79. package/dist/cjs/version.js +1 -1
  80. package/dist/esm/BaseClient.mjs +2 -2
  81. package/dist/esm/api/resources/jobs/client/Client.d.mts +32 -8
  82. package/dist/esm/api/resources/jobs/client/Client.mjs +93 -20
  83. package/dist/esm/api/resources/jobs/client/requests/ContinueRequestDto.d.mts +3 -3
  84. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.d.mts +2 -2
  85. package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +2 -2
  86. package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +10 -0
  87. package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +12 -0
  88. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +17 -6
  89. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
  90. package/dist/esm/api/resources/jobs/exports.d.mts +2 -0
  91. package/dist/esm/api/resources/jobs/exports.mjs +3 -0
  92. package/dist/esm/api/resources/meta/exports.d.mts +2 -0
  93. package/dist/esm/api/resources/meta/exports.mjs +3 -0
  94. package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +1 -1
  95. package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +1 -1
  96. package/dist/esm/api/resources/monitors/client/Client.d.mts +23 -33
  97. package/dist/esm/api/resources/monitors/client/Client.mjs +35 -37
  98. package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +26 -5
  99. package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.mts +17 -0
  100. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +10 -0
  101. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.mjs +2 -0
  102. package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +2 -0
  103. package/dist/esm/api/resources/monitors/client/requests/index.d.mts +2 -1
  104. package/dist/esm/api/resources/monitors/exports.d.mts +2 -0
  105. package/dist/esm/api/resources/monitors/exports.mjs +3 -0
  106. package/dist/esm/api/types/BaseRecord.d.mts +38 -0
  107. package/dist/esm/api/types/BaseRecord.mjs +13 -0
  108. package/dist/esm/api/types/Citation.d.mts +3 -3
  109. package/dist/esm/api/types/CompanyEnrichmentOutput.d.mts +29 -0
  110. package/dist/esm/api/types/CompanyEnrichmentOutput.mjs +13 -0
  111. package/dist/esm/api/types/ContinueResponseDto.d.mts +2 -2
  112. package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +1 -1
  113. package/dist/esm/api/types/EndDate.d.mts +8 -0
  114. package/dist/esm/api/types/EndDate.mjs +2 -0
  115. package/dist/esm/api/types/EnrichmentSchema.d.mts +13 -0
  116. package/dist/esm/api/types/EnrichmentSchema.mjs +2 -0
  117. package/dist/esm/api/types/EnrichmentType.d.mts +19 -0
  118. package/dist/esm/api/types/EnrichmentType.mjs +19 -0
  119. package/dist/esm/api/types/Error_.d.mts +1 -1
  120. package/dist/esm/api/types/InitializeResponseDto.d.mts +19 -0
  121. package/dist/esm/api/types/InitializeResponseDto.mjs +2 -0
  122. package/dist/esm/api/types/JobStep.d.mts +2 -2
  123. package/dist/esm/api/types/Limit.d.mts +6 -0
  124. package/dist/esm/api/types/Limit.mjs +2 -0
  125. package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
  126. package/dist/esm/api/types/ListUserJobsResponseDto.d.mts +11 -8
  127. package/dist/esm/api/types/MonitorCitation.d.mts +3 -8
  128. package/dist/esm/api/types/MonitorListItemDto.d.mts +7 -7
  129. package/dist/esm/api/types/MonitorRecord.d.mts +4 -14
  130. package/dist/{cjs/api/types/JobStatus.d.ts → esm/api/types/PublicJobStatus.d.mts} +4 -4
  131. package/dist/esm/api/types/{JobStatus.mjs → PublicJobStatus.mjs} +3 -3
  132. package/dist/esm/api/types/PullJobResponseDto.d.mts +28 -23
  133. package/dist/esm/api/types/PullMonitorResponseDto.d.mts +12 -12
  134. package/dist/esm/api/types/Query.d.mts +1 -1
  135. package/dist/esm/api/types/Record_.d.mts +2 -12
  136. package/dist/esm/api/types/ReferenceJob.d.mts +3 -3
  137. package/dist/esm/api/types/StartDate.d.mts +8 -0
  138. package/dist/esm/api/types/StartDate.mjs +2 -0
  139. package/dist/esm/api/types/StatusResponseDto.d.mts +2 -2
  140. package/dist/esm/api/types/{SubmitResponseBody.d.mts → SubmitResponseDto.d.mts} +1 -1
  141. package/dist/esm/api/types/SubmitResponseDto.mjs +2 -0
  142. package/dist/esm/api/types/UserJob.d.mts +10 -0
  143. package/dist/esm/api/types/UserJob.mjs +2 -0
  144. package/dist/esm/api/types/ValidationErrorDetail.d.mts +3 -3
  145. package/dist/esm/api/types/ValidationErrorResponse.d.mts +1 -1
  146. package/dist/esm/api/types/ValidatorSchema.d.mts +13 -0
  147. package/dist/esm/api/types/ValidatorSchema.mjs +2 -0
  148. package/dist/esm/api/types/WebhookDto.d.mts +4 -4
  149. package/dist/esm/api/types/WebhookPayload.d.mts +9 -9
  150. package/dist/esm/api/types/index.d.mts +12 -3
  151. package/dist/esm/api/types/index.mjs +12 -3
  152. package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
  153. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  154. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  155. package/dist/esm/core/runtime/runtime.mjs +8 -7
  156. package/dist/esm/version.d.mts +1 -1
  157. package/dist/esm/version.mjs +1 -1
  158. package/package.json +37 -4
  159. package/reference.md +115 -40
  160. package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +0 -10
  161. package/dist/cjs/api/types/Schema.d.ts +0 -6
  162. package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +0 -10
  163. package/dist/esm/api/types/Schema.d.mts +0 -6
  164. /package/dist/cjs/api/resources/{monitors/client/requests/EnableMonitorRequest.js → jobs/client/requests/GetUserJobsRequest.js} +0 -0
  165. /package/dist/cjs/api/{types/Schema.js → resources/jobs/client/requests/InitializeRequestDto.js} +0 -0
  166. /package/dist/cjs/api/{types/SubmitResponseBody.js → resources/monitors/client/requests/EnableMonitorRequestDto.js} +0 -0
  167. /package/dist/esm/api/resources/{monitors/client/requests/EnableMonitorRequest.mjs → jobs/client/requests/GetUserJobsRequest.mjs} +0 -0
  168. /package/dist/esm/api/{types/Schema.mjs → resources/jobs/client/requests/InitializeRequestDto.mjs} +0 -0
  169. /package/dist/esm/api/{types/SubmitResponseBody.mjs → resources/monitors/client/requests/EnableMonitorRequestDto.mjs} +0 -0
@@ -3,21 +3,11 @@ import type * as CatchAllApi from "../index.mjs";
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
- /** Unique identifier for the record. */
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 articles from web sources.
7
- * - `clustering`: Grouping similar articles into distinct events.
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 JobStatus: {
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 JobStatus = (typeof JobStatus)[keyof typeof JobStatus];
23
+ export type PublicJobStatus = (typeof PublicJobStatus)[keyof typeof PublicJobStatus];
@@ -4,15 +4,15 @@
4
4
  *
5
5
  * - `submitted`: Job queued, waiting to start processing.
6
6
  * - `analyzing`: Extracting keywords, generating search queries, and creating validators/extractors.
7
- * - `fetching`: Retrieving articles from web sources.
8
- * - `clustering`: Grouping similar articles into distinct events.
7
+ * - `fetching`: Retrieving web pages.
8
+ * - `clustering`: Grouping similar web pages into clusters.
9
9
  * - `enriching`: Validating clusters and extracting structured data.
10
10
  * - `completed`: Job finished successfully, results ready.
11
11
  * - `failed`: Job processing failed.
12
12
  *
13
13
  * Poll `/catchAll/status/{job_id}` every 30-60 seconds until status is `completed` (typically 10-15 minutes).
14
14
  */
15
- export const JobStatus = {
15
+ export const PublicJobStatus = {
16
16
  Submitted: "submitted",
17
17
  Analyzing: "analyzing",
18
18
  Fetching: "fetching",
@@ -2,44 +2,49 @@ import type * as CatchAllApi from "../index.mjs";
2
2
  export interface PullJobResponseDto {
3
3
  /** Job identifier. */
4
4
  job_id: string;
5
- /** Original natural language query. */
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
- * These field names appear in the `enrichment` object of each record.
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: string;
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
- /** Number of candidate records before validation. */
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 records that have been validated during processing.
30
+ * Number of candidate clusters that have been validated during processing.
26
31
  *
27
- * The system process records in batches. This field tracks how many candidates have been checked against validation criteria so far.
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
- * Parsed cron expression from the natural language schedule.
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
- * Aggregated records from all jobs executed by this monitor.
21
- * Each record includes structured data extracted from web sources with citations.
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,5 +1,5 @@
1
1
  /**
2
- * Natural language question describing what to find.
2
+ * Plain text question describing what to find.
3
3
  *
4
4
  * The system analyzes your input to generate search queries, validators, and extractors. More specific queries produce more focused results.
5
5
  */
@@ -1,15 +1,5 @@
1
1
  import type * as CatchAllApi from "../index.mjs";
2
- export interface Record_ {
3
- /** Unique identifier for the record. */
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
- /** Natural language query from the reference job. */
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;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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.JobStatus;
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: CatchAllApi.JobStep[];
8
+ steps?: CatchAllApi.JobStep[] | undefined;
9
9
  }
@@ -1,4 +1,4 @@
1
- export interface SubmitResponseBody {
1
+ export interface SubmitResponseDto {
2
2
  /** Unique identifier for the created job. Use this to check status and retrieve results. */
3
3
  job_id: string;
4
4
  }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,4 +1,4 @@
1
1
  import type * as CatchAllApi from "../index.mjs";
2
2
  export interface ValidationErrorResponse {
3
- detail?: CatchAllApi.ValidationErrorDetail[];
3
+ detail?: CatchAllApi.ValidationErrorDetail[] | undefined;
4
4
  }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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.mjs";
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.mjs";
1
2
  export * from "./Citation.mjs";
3
+ export * from "./CompanyEnrichmentOutput.mjs";
2
4
  export * from "./Context.mjs";
3
5
  export * from "./ContinueResponseDto.mjs";
4
6
  export * from "./CreateMonitorResponseDto.mjs";
7
+ export * from "./EndDate.mjs";
8
+ export * from "./EnrichmentSchema.mjs";
9
+ export * from "./EnrichmentType.mjs";
5
10
  export * from "./Error_.mjs";
6
- export * from "./JobStatus.mjs";
11
+ export * from "./InitializeResponseDto.mjs";
7
12
  export * from "./JobStep.mjs";
13
+ export * from "./Limit.mjs";
8
14
  export * from "./ListMonitorsResponseDto.mjs";
9
15
  export * from "./ListUserJobsResponseDto.mjs";
10
16
  export * from "./MonitorCitation.mjs";
11
17
  export * from "./MonitorJobItem.mjs";
12
18
  export * from "./MonitorListItemDto.mjs";
13
19
  export * from "./MonitorRecord.mjs";
20
+ export * from "./PublicJobStatus.mjs";
14
21
  export * from "./PullJobResponseDto.mjs";
15
22
  export * from "./PullMonitorResponseDto.mjs";
16
23
  export * from "./Query.mjs";
17
24
  export * from "./Record_.mjs";
18
25
  export * from "./ReferenceJob.mjs";
19
- export * from "./Schema.mjs";
26
+ export * from "./StartDate.mjs";
20
27
  export * from "./StatusResponseDto.mjs";
21
- export * from "./SubmitResponseBody.mjs";
28
+ export * from "./SubmitResponseDto.mjs";
22
29
  export * from "./UpdateMonitorResponseDto.mjs";
30
+ export * from "./UserJob.mjs";
23
31
  export * from "./ValidationErrorDetail.mjs";
24
32
  export * from "./ValidationErrorResponse.mjs";
33
+ export * from "./ValidatorSchema.mjs";
25
34
  export * from "./WebhookDto.mjs";
26
35
  export * from "./WebhookPayload.mjs";
@@ -1,26 +1,35 @@
1
+ export * from "./BaseRecord.mjs";
1
2
  export * from "./Citation.mjs";
3
+ export * from "./CompanyEnrichmentOutput.mjs";
2
4
  export * from "./Context.mjs";
3
5
  export * from "./ContinueResponseDto.mjs";
4
6
  export * from "./CreateMonitorResponseDto.mjs";
7
+ export * from "./EndDate.mjs";
8
+ export * from "./EnrichmentSchema.mjs";
9
+ export * from "./EnrichmentType.mjs";
5
10
  export * from "./Error_.mjs";
6
- export * from "./JobStatus.mjs";
11
+ export * from "./InitializeResponseDto.mjs";
7
12
  export * from "./JobStep.mjs";
13
+ export * from "./Limit.mjs";
8
14
  export * from "./ListMonitorsResponseDto.mjs";
9
15
  export * from "./ListUserJobsResponseDto.mjs";
10
16
  export * from "./MonitorCitation.mjs";
11
17
  export * from "./MonitorJobItem.mjs";
12
18
  export * from "./MonitorListItemDto.mjs";
13
19
  export * from "./MonitorRecord.mjs";
20
+ export * from "./PublicJobStatus.mjs";
14
21
  export * from "./PullJobResponseDto.mjs";
15
22
  export * from "./PullMonitorResponseDto.mjs";
16
23
  export * from "./Query.mjs";
17
24
  export * from "./Record_.mjs";
18
25
  export * from "./ReferenceJob.mjs";
19
- export * from "./Schema.mjs";
26
+ export * from "./StartDate.mjs";
20
27
  export * from "./StatusResponseDto.mjs";
21
- export * from "./SubmitResponseBody.mjs";
28
+ export * from "./SubmitResponseDto.mjs";
22
29
  export * from "./UpdateMonitorResponseDto.mjs";
30
+ export * from "./UserJob.mjs";
23
31
  export * from "./ValidationErrorDetail.mjs";
24
32
  export * from "./ValidationErrorResponse.mjs";
33
+ export * from "./ValidatorSchema.mjs";
25
34
  export * from "./WebhookDto.mjs";
26
35
  export * from "./WebhookPayload.mjs";
@@ -152,7 +152,13 @@ function getHeaders(args) {
152
152
  return __awaiter(this, void 0, void 0, function* () {
153
153
  var _a;
154
154
  const newHeaders = new Headers();
155
- newHeaders.set("Accept", args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*");
155
+ newHeaders.set("Accept", args.responseType === "json"
156
+ ? "application/json"
157
+ : args.responseType === "text"
158
+ ? "text/plain"
159
+ : args.responseType === "sse"
160
+ ? "text/event-stream"
161
+ : "*/*");
156
162
  if (args.body !== undefined && args.contentType != null) {
157
163
  newHeaders.set("Content-Type", args.contentType);
158
164
  }
@@ -196,7 +202,7 @@ export function fetcherImpl(args) {
196
202
  }
197
203
  try {
198
204
  const response = yield requestWithRetries(() => __awaiter(this, void 0, void 0, function* () {
199
- return makeRequest(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
205
+ return makeRequest(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex, args.responseType === "streaming" || args.responseType === "sse");
200
206
  }), args.maxRetries);
201
207
  if (response.status >= 200 && response.status < 400) {
202
208
  if (logger.isDebug()) {
@@ -1 +1,6 @@
1
- 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") => Promise<Response>;
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>;
@@ -8,7 +8,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { anySignal, getTimeoutSignal } from "./signals.mjs";
11
- export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => __awaiter(void 0, void 0, void 0, function* () {
11
+ /**
12
+ * Cached result of checking whether the current runtime supports
13
+ * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
14
+ * throw a TypeError when this option is used.
15
+ */
16
+ let _cacheNoStoreSupported;
17
+ export function isCacheNoStoreSupported() {
18
+ if (_cacheNoStoreSupported != null) {
19
+ return _cacheNoStoreSupported;
20
+ }
21
+ try {
22
+ new Request("http://localhost", { cache: "no-store" });
23
+ _cacheNoStoreSupported = true;
24
+ }
25
+ catch (_a) {
26
+ _cacheNoStoreSupported = false;
27
+ }
28
+ return _cacheNoStoreSupported;
29
+ }
30
+ /**
31
+ * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
32
+ */
33
+ export function resetCacheNoStoreSupported() {
34
+ _cacheNoStoreSupported = undefined;
35
+ }
36
+ export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __awaiter(void 0, void 0, void 0, function* () {
12
37
  const signals = [];
13
38
  let timeoutAbortId;
14
39
  if (timeoutMs != null) {
@@ -20,15 +45,9 @@ export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutM
20
45
  signals.push(abortSignal);
21
46
  }
22
47
  const newSignals = anySignal(signals);
23
- const response = yield fetchFn(url, {
24
- method: method,
25
- headers,
26
- body: requestBody,
27
- signal: newSignals,
28
- credentials: withCredentials ? "include" : undefined,
48
+ const response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
29
49
  // @ts-ignore
30
- duplex,
31
- });
50
+ duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
32
51
  if (timeoutAbortId != null) {
33
52
  clearTimeout(timeoutAbortId);
34
53
  }
@@ -81,17 +81,18 @@ function evaluateRuntime() {
81
81
  }
82
82
  /**
83
83
  * A constant that indicates whether the environment the code is running is Node.JS.
84
+ *
85
+ * We assign `process` to a local variable first to avoid being flagged by
86
+ * bundlers that perform static analysis on `process.versions` (e.g. Next.js
87
+ * Edge Runtime warns about Node.js APIs even when they are guarded).
84
88
  */
85
- const isNode = typeof process !== "undefined" &&
86
- "version" in process &&
87
- !!process.version &&
88
- "versions" in process &&
89
- !!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
89
+ const _process = typeof process !== "undefined" ? process : undefined;
90
+ const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
90
91
  if (isNode) {
91
92
  return {
92
93
  type: "node",
93
- version: process.versions.node,
94
- parsedVersion: Number(process.versions.node.split(".")[0]),
94
+ version: _process.versions.node,
95
+ parsedVersion: Number(_process.versions.node.split(".")[0]),
95
96
  };
96
97
  }
97
98
  return {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.3.1";
1
+ export declare const SDK_VERSION = "1.1.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.3.1";
1
+ export const SDK_VERSION = "1.1.2";