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
|
@@ -14,21 +14,42 @@ export declare class JobsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<JobsClient.Options>;
|
|
15
15
|
constructor(options?: JobsClient.Options);
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Get suggested validators, enrichments, and date ranges for a query.
|
|
18
|
+
*
|
|
19
|
+
* @param {CatchAllApi.InitializeRequestDto} request
|
|
20
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
+
*
|
|
22
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
23
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* await client.jobs.initialize({
|
|
27
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
28
|
+
* context: "Focus on funding amount and company name"
|
|
29
|
+
* })
|
|
30
|
+
*/
|
|
31
|
+
initialize(request: CatchAllApi.InitializeRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.InitializeResponseDto>;
|
|
32
|
+
private __initialize;
|
|
33
|
+
/**
|
|
34
|
+
* Submit a query to create a new processing job.
|
|
18
35
|
*
|
|
19
36
|
* @param {CatchAllApi.SubmitRequestDto} request
|
|
20
37
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
38
|
*
|
|
39
|
+
* @throws {@link CatchAllApi.BadRequestError}
|
|
22
40
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
23
41
|
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
24
42
|
*
|
|
25
43
|
* @example
|
|
26
44
|
* await client.jobs.createJob({
|
|
27
|
-
* query: "
|
|
28
|
-
* context: "Focus on
|
|
45
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
46
|
+
* context: "Focus on funding amount and company name",
|
|
47
|
+
* limit: 10,
|
|
48
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
49
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
29
50
|
* })
|
|
30
51
|
*/
|
|
31
|
-
createJob(request: CatchAllApi.SubmitRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.
|
|
52
|
+
createJob(request: CatchAllApi.SubmitRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.SubmitResponseDto>;
|
|
32
53
|
private __createJob;
|
|
33
54
|
/**
|
|
34
55
|
* Continue an existing job to process more records beyond the initial limit.
|
|
@@ -42,7 +63,7 @@ export declare class JobsClient {
|
|
|
42
63
|
*
|
|
43
64
|
* @example
|
|
44
65
|
* await client.jobs.continueJob({
|
|
45
|
-
* job_id: "
|
|
66
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
46
67
|
* new_limit: 100
|
|
47
68
|
* })
|
|
48
69
|
*/
|
|
@@ -59,7 +80,7 @@ export declare class JobsClient {
|
|
|
59
80
|
*
|
|
60
81
|
* @example
|
|
61
82
|
* await client.jobs.getJobStatus({
|
|
62
|
-
* job_id: "
|
|
83
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
63
84
|
* })
|
|
64
85
|
*/
|
|
65
86
|
getJobStatus(request: CatchAllApi.GetJobStatusRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.StatusResponseDto>;
|
|
@@ -67,12 +88,15 @@ export declare class JobsClient {
|
|
|
67
88
|
/**
|
|
68
89
|
* Returns all jobs created by the authenticated user.
|
|
69
90
|
*
|
|
91
|
+
* @param {CatchAllApi.GetUserJobsRequest} request
|
|
70
92
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
93
|
*
|
|
94
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
95
|
+
*
|
|
72
96
|
* @example
|
|
73
97
|
* await client.jobs.getUserJobs()
|
|
74
98
|
*/
|
|
75
|
-
getUserJobs(requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListUserJobsResponseDto
|
|
99
|
+
getUserJobs(request?: CatchAllApi.GetUserJobsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListUserJobsResponseDto>;
|
|
76
100
|
private __getUserJobs;
|
|
77
101
|
/**
|
|
78
102
|
* Retrieve the final results for a completed job.
|
|
@@ -85,7 +109,7 @@ export declare class JobsClient {
|
|
|
85
109
|
*
|
|
86
110
|
* @example
|
|
87
111
|
* await client.jobs.getJobResults({
|
|
88
|
-
* job_id: "
|
|
112
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
89
113
|
* })
|
|
90
114
|
*/
|
|
91
115
|
getJobResults(request: CatchAllApi.GetJobResultsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullJobResponseDto>;
|
|
@@ -23,18 +23,79 @@ export class JobsClient {
|
|
|
23
23
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Get suggested validators, enrichments, and date ranges for a query.
|
|
27
|
+
*
|
|
28
|
+
* @param {CatchAllApi.InitializeRequestDto} request
|
|
29
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
32
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.jobs.initialize({
|
|
36
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
37
|
+
* context: "Focus on funding amount and company name"
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
initialize(request, requestOptions) {
|
|
41
|
+
return core.HttpResponsePromise.fromPromise(this.__initialize(request, requestOptions));
|
|
42
|
+
}
|
|
43
|
+
__initialize(request, requestOptions) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
47
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
|
+
const _response = yield core.fetcher({
|
|
49
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/initialize"),
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: _headers,
|
|
52
|
+
contentType: "application/json",
|
|
53
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
+
requestType: "json",
|
|
55
|
+
body: request,
|
|
56
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
57
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
60
|
+
logging: this._options.logging,
|
|
61
|
+
});
|
|
62
|
+
if (_response.ok) {
|
|
63
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
64
|
+
}
|
|
65
|
+
if (_response.error.reason === "status-code") {
|
|
66
|
+
switch (_response.error.statusCode) {
|
|
67
|
+
case 403:
|
|
68
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
69
|
+
case 422:
|
|
70
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
71
|
+
default:
|
|
72
|
+
throw new errors.CatchAllApiError({
|
|
73
|
+
statusCode: _response.error.statusCode,
|
|
74
|
+
body: _response.error.body,
|
|
75
|
+
rawResponse: _response.rawResponse,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/initialize");
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Submit a query to create a new processing job.
|
|
27
84
|
*
|
|
28
85
|
* @param {CatchAllApi.SubmitRequestDto} request
|
|
29
86
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
87
|
*
|
|
88
|
+
* @throws {@link CatchAllApi.BadRequestError}
|
|
31
89
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
32
90
|
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
33
91
|
*
|
|
34
92
|
* @example
|
|
35
93
|
* await client.jobs.createJob({
|
|
36
|
-
* query: "
|
|
37
|
-
* context: "Focus on
|
|
94
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
95
|
+
* context: "Focus on funding amount and company name",
|
|
96
|
+
* limit: 10,
|
|
97
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
98
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
38
99
|
* })
|
|
39
100
|
*/
|
|
40
101
|
createJob(request, requestOptions) {
|
|
@@ -64,6 +125,8 @@ export class JobsClient {
|
|
|
64
125
|
}
|
|
65
126
|
if (_response.error.reason === "status-code") {
|
|
66
127
|
switch (_response.error.statusCode) {
|
|
128
|
+
case 400:
|
|
129
|
+
throw new CatchAllApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
67
130
|
case 403:
|
|
68
131
|
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
69
132
|
case 422:
|
|
@@ -91,7 +154,7 @@ export class JobsClient {
|
|
|
91
154
|
*
|
|
92
155
|
* @example
|
|
93
156
|
* await client.jobs.continueJob({
|
|
94
|
-
* job_id: "
|
|
157
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
95
158
|
* new_limit: 100
|
|
96
159
|
* })
|
|
97
160
|
*/
|
|
@@ -150,7 +213,7 @@ export class JobsClient {
|
|
|
150
213
|
*
|
|
151
214
|
* @example
|
|
152
215
|
* await client.jobs.getJobStatus({
|
|
153
|
-
* job_id: "
|
|
216
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
154
217
|
* })
|
|
155
218
|
*/
|
|
156
219
|
getJobStatus(request, requestOptions) {
|
|
@@ -196,24 +259,32 @@ export class JobsClient {
|
|
|
196
259
|
/**
|
|
197
260
|
* Returns all jobs created by the authenticated user.
|
|
198
261
|
*
|
|
262
|
+
* @param {CatchAllApi.GetUserJobsRequest} request
|
|
199
263
|
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
200
264
|
*
|
|
265
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
266
|
+
*
|
|
201
267
|
* @example
|
|
202
268
|
* await client.jobs.getUserJobs()
|
|
203
269
|
*/
|
|
204
|
-
getUserJobs(requestOptions) {
|
|
205
|
-
return core.HttpResponsePromise.fromPromise(this.__getUserJobs(requestOptions));
|
|
270
|
+
getUserJobs(request = {}, requestOptions) {
|
|
271
|
+
return core.HttpResponsePromise.fromPromise(this.__getUserJobs(request, requestOptions));
|
|
206
272
|
}
|
|
207
|
-
__getUserJobs(
|
|
208
|
-
return __awaiter(this,
|
|
273
|
+
__getUserJobs() {
|
|
274
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
209
275
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
276
|
+
const { page, page_size: pageSize } = request;
|
|
277
|
+
const _queryParams = {
|
|
278
|
+
page,
|
|
279
|
+
page_size: pageSize,
|
|
280
|
+
};
|
|
210
281
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
211
282
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
212
283
|
const _response = yield core.fetcher({
|
|
213
284
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/jobs/user"),
|
|
214
285
|
method: "GET",
|
|
215
286
|
headers: _headers,
|
|
216
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
287
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
217
288
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
218
289
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
219
290
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -221,17 +292,19 @@ export class JobsClient {
|
|
|
221
292
|
logging: this._options.logging,
|
|
222
293
|
});
|
|
223
294
|
if (_response.ok) {
|
|
224
|
-
return {
|
|
225
|
-
data: _response.body,
|
|
226
|
-
rawResponse: _response.rawResponse,
|
|
227
|
-
};
|
|
295
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
228
296
|
}
|
|
229
297
|
if (_response.error.reason === "status-code") {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
298
|
+
switch (_response.error.statusCode) {
|
|
299
|
+
case 403:
|
|
300
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
301
|
+
default:
|
|
302
|
+
throw new errors.CatchAllApiError({
|
|
303
|
+
statusCode: _response.error.statusCode,
|
|
304
|
+
body: _response.error.body,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
235
308
|
}
|
|
236
309
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/jobs/user");
|
|
237
310
|
});
|
|
@@ -247,7 +320,7 @@ export class JobsClient {
|
|
|
247
320
|
*
|
|
248
321
|
* @example
|
|
249
322
|
* await client.jobs.getJobResults({
|
|
250
|
-
* job_id: "
|
|
323
|
+
* job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
|
|
251
324
|
* })
|
|
252
325
|
*/
|
|
253
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
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* query: "Series B funding rounds for SaaS startups",
|
|
6
|
+
* context: "Focus on funding amount and company name"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface InitializeRequestDto {
|
|
10
|
+
query: CatchAllApi.Query;
|
|
11
|
+
context?: CatchAllApi.Context;
|
|
12
|
+
}
|
|
@@ -2,18 +2,29 @@ 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
|
+
* limit: 10,
|
|
8
|
+
* start_date: "2026-02-18T00:00:00Z",
|
|
9
|
+
* end_date: "2026-02-23T00:00:00Z"
|
|
7
10
|
* }
|
|
8
11
|
*/
|
|
9
12
|
export interface SubmitRequestDto {
|
|
10
13
|
query: CatchAllApi.Query;
|
|
11
|
-
schema?: CatchAllApi.Schema;
|
|
12
14
|
context?: CatchAllApi.Context;
|
|
15
|
+
limit?: CatchAllApi.Limit;
|
|
16
|
+
start_date?: CatchAllApi.StartDate;
|
|
17
|
+
end_date?: CatchAllApi.EndDate;
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
19
|
+
* Custom validators for filtering web page clusters.
|
|
15
20
|
*
|
|
16
|
-
*
|
|
21
|
+
* If not provided, validators are generated automatically based on the query.
|
|
17
22
|
*/
|
|
18
|
-
|
|
23
|
+
validators?: CatchAllApi.ValidatorSchema[];
|
|
24
|
+
/**
|
|
25
|
+
* Custom enrichment fields for data extraction.
|
|
26
|
+
*
|
|
27
|
+
* If not provided, enrichments are generated automatically based on the query.
|
|
28
|
+
*/
|
|
29
|
+
enrichments?: CatchAllApi.EnrichmentSchema[];
|
|
19
30
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { ContinueRequestDto } from "./ContinueRequestDto.mjs";
|
|
2
2
|
export type { GetJobResultsRequest } from "./GetJobResultsRequest.mjs";
|
|
3
3
|
export type { GetJobStatusRequest } from "./GetJobStatusRequest.mjs";
|
|
4
|
+
export type { GetUserJobsRequest } from "./GetUserJobsRequest.mjs";
|
|
5
|
+
export type { InitializeRequestDto } from "./InitializeRequestDto.mjs";
|
|
4
6
|
export type { SubmitRequestDto } from "./SubmitRequestDto.mjs";
|
|
@@ -14,16 +14,7 @@ export declare class MonitorsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<MonitorsClient.Options>;
|
|
15
15
|
constructor(options?: MonitorsClient.Options);
|
|
16
16
|
/**
|
|
17
|
-
* Create a monitor
|
|
18
|
-
*
|
|
19
|
-
* **Schedule requirements:**
|
|
20
|
-
* - Minimum 24-hour interval between executions
|
|
21
|
-
* - Natural language format (e.g., "every day at 12 PM UTC", "every 48 hours")
|
|
22
|
-
*
|
|
23
|
-
* **Validation:**
|
|
24
|
-
* - Schedules below minimum frequency return error with descriptive message.
|
|
25
|
-
* - Invalid job IDs return 400 Bad Request.
|
|
26
|
-
* - Duplicate monitors (same job already monitored) return error.
|
|
17
|
+
* Create a scheduled monitor based on a reference job.
|
|
27
18
|
*
|
|
28
19
|
* @param {CatchAllApi.CreateMonitorRequestDto} request
|
|
29
20
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -32,22 +23,23 @@ export declare class MonitorsClient {
|
|
|
32
23
|
*
|
|
33
24
|
* @example
|
|
34
25
|
* await client.monitors.createMonitor({
|
|
35
|
-
* reference_job_id: "
|
|
36
|
-
* schedule: "every day at 12 PM UTC"
|
|
26
|
+
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
27
|
+
* schedule: "every day at 12 PM UTC",
|
|
28
|
+
* webhook: {
|
|
29
|
+
* url: "https://your-endpoint.com/webhook",
|
|
30
|
+
* method: "POST",
|
|
31
|
+
* headers: {
|
|
32
|
+
* "Authorization": "Bearer your_token_here"
|
|
33
|
+
* }
|
|
34
|
+
* },
|
|
35
|
+
* limit: 10,
|
|
36
|
+
* backfill: true
|
|
37
37
|
* })
|
|
38
38
|
*/
|
|
39
39
|
createMonitor(request: CatchAllApi.CreateMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.CreateMonitorResponseDto>;
|
|
40
40
|
private __createMonitor;
|
|
41
41
|
/**
|
|
42
|
-
* Update webhook configuration for an existing monitor
|
|
43
|
-
*
|
|
44
|
-
* **Supported updates:**
|
|
45
|
-
* - Webhook URL
|
|
46
|
-
* - HTTP method (POST/PUT)
|
|
47
|
-
* - Headers and authentication
|
|
48
|
-
* - Query parameters
|
|
49
|
-
*
|
|
50
|
-
* **Note:** Schedule and reference job cannot be modified. To change these, create a new monitor.
|
|
42
|
+
* Update the webhook configuration for an existing monitor.
|
|
51
43
|
*
|
|
52
44
|
* @param {CatchAllApi.UpdateMonitorRequestDto} request
|
|
53
45
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -71,8 +63,7 @@ export declare class MonitorsClient {
|
|
|
71
63
|
updateMonitor(request: CatchAllApi.UpdateMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.UpdateMonitorResponseDto>;
|
|
72
64
|
private __updateMonitor;
|
|
73
65
|
/**
|
|
74
|
-
*
|
|
75
|
-
* Each job includes job_id, start_date, and end_date.
|
|
66
|
+
* Return all jobs executed by a monitor.
|
|
76
67
|
*
|
|
77
68
|
* @param {CatchAllApi.ListMonitorJobsRequest} request
|
|
78
69
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -88,8 +79,7 @@ export declare class MonitorsClient {
|
|
|
88
79
|
listMonitorJobs(request: CatchAllApi.ListMonitorJobsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorJobsResponse>;
|
|
89
80
|
private __listMonitorJobs;
|
|
90
81
|
/**
|
|
91
|
-
* Retrieve aggregated results from all jobs executed by
|
|
92
|
-
* Includes monitor configuration, execution history, and all records collected.
|
|
82
|
+
* Retrieve aggregated results from all jobs executed by a monitor.
|
|
93
83
|
*
|
|
94
84
|
* @param {CatchAllApi.PullMonitorResultsRequest} request
|
|
95
85
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -105,8 +95,7 @@ export declare class MonitorsClient {
|
|
|
105
95
|
pullMonitorResults(request: CatchAllApi.PullMonitorResultsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullMonitorResponseDto>;
|
|
106
96
|
private __pullMonitorResults;
|
|
107
97
|
/**
|
|
108
|
-
*
|
|
109
|
-
* Validates that the provided API key is associated with the monitor.
|
|
98
|
+
* Stop scheduled job execution for a monitor.
|
|
110
99
|
*
|
|
111
100
|
* @param {CatchAllApi.DisableMonitorRequest} request
|
|
112
101
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -123,10 +112,9 @@ export declare class MonitorsClient {
|
|
|
123
112
|
disableMonitor(request: CatchAllApi.DisableMonitorRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DisableMonitorResponse>;
|
|
124
113
|
private __disableMonitor;
|
|
125
114
|
/**
|
|
126
|
-
*
|
|
127
|
-
* Validates that the provided API key is associated with the monitor.
|
|
115
|
+
* Resume scheduled job execution for a monitor.
|
|
128
116
|
*
|
|
129
|
-
* @param {CatchAllApi.
|
|
117
|
+
* @param {CatchAllApi.EnableMonitorRequestDto} request
|
|
130
118
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
131
119
|
*
|
|
132
120
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -135,14 +123,16 @@ export declare class MonitorsClient {
|
|
|
135
123
|
*
|
|
136
124
|
* @example
|
|
137
125
|
* await client.monitors.enableMonitor({
|
|
138
|
-
* monitor_id: "monitor_id"
|
|
126
|
+
* monitor_id: "monitor_id",
|
|
127
|
+
* backfill: true
|
|
139
128
|
* })
|
|
140
129
|
*/
|
|
141
|
-
enableMonitor(request: CatchAllApi.
|
|
130
|
+
enableMonitor(request: CatchAllApi.EnableMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.EnableMonitorResponse>;
|
|
142
131
|
private __enableMonitor;
|
|
143
132
|
/**
|
|
144
133
|
* Returns all monitors created by the authenticated user.
|
|
145
134
|
*
|
|
135
|
+
* @param {CatchAllApi.ListMonitorsRequest} request
|
|
146
136
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
147
137
|
*
|
|
148
138
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -151,6 +141,6 @@ export declare class MonitorsClient {
|
|
|
151
141
|
* @example
|
|
152
142
|
* await client.monitors.listMonitors()
|
|
153
143
|
*/
|
|
154
|
-
listMonitors(requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorsResponseDto>;
|
|
144
|
+
listMonitors(request?: CatchAllApi.ListMonitorsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorsResponseDto>;
|
|
155
145
|
private __listMonitors;
|
|
156
146
|
}
|