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
|
@@ -70,16 +70,7 @@ class MonitorsClient {
|
|
|
70
70
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Create a monitor
|
|
74
|
-
*
|
|
75
|
-
* **Schedule requirements:**
|
|
76
|
-
* - Minimum 24-hour interval between executions
|
|
77
|
-
* - Natural language format (e.g., "every day at 12 PM UTC", "every 48 hours")
|
|
78
|
-
*
|
|
79
|
-
* **Validation:**
|
|
80
|
-
* - Schedules below minimum frequency return error with descriptive message.
|
|
81
|
-
* - Invalid job IDs return 400 Bad Request.
|
|
82
|
-
* - Duplicate monitors (same job already monitored) return error.
|
|
73
|
+
* Create a scheduled monitor based on a reference job.
|
|
83
74
|
*
|
|
84
75
|
* @param {CatchAllApi.CreateMonitorRequestDto} request
|
|
85
76
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -88,8 +79,17 @@ class MonitorsClient {
|
|
|
88
79
|
*
|
|
89
80
|
* @example
|
|
90
81
|
* await client.monitors.createMonitor({
|
|
91
|
-
* reference_job_id: "
|
|
92
|
-
* schedule: "every day at 12 PM UTC"
|
|
82
|
+
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
83
|
+
* schedule: "every day at 12 PM UTC",
|
|
84
|
+
* webhook: {
|
|
85
|
+
* url: "https://your-endpoint.com/webhook",
|
|
86
|
+
* method: "POST",
|
|
87
|
+
* headers: {
|
|
88
|
+
* "Authorization": "Bearer your_token_here"
|
|
89
|
+
* }
|
|
90
|
+
* },
|
|
91
|
+
* limit: 10,
|
|
92
|
+
* backfill: true
|
|
93
93
|
* })
|
|
94
94
|
*/
|
|
95
95
|
createMonitor(request, requestOptions) {
|
|
@@ -133,15 +133,7 @@ class MonitorsClient {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
* Update webhook configuration for an existing monitor
|
|
137
|
-
*
|
|
138
|
-
* **Supported updates:**
|
|
139
|
-
* - Webhook URL
|
|
140
|
-
* - HTTP method (POST/PUT)
|
|
141
|
-
* - Headers and authentication
|
|
142
|
-
* - Query parameters
|
|
143
|
-
*
|
|
144
|
-
* **Note:** Schedule and reference job cannot be modified. To change these, create a new monitor.
|
|
136
|
+
* Update the webhook configuration for an existing monitor.
|
|
145
137
|
*
|
|
146
138
|
* @param {CatchAllApi.UpdateMonitorRequestDto} request
|
|
147
139
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -208,8 +200,7 @@ class MonitorsClient {
|
|
|
208
200
|
});
|
|
209
201
|
}
|
|
210
202
|
/**
|
|
211
|
-
*
|
|
212
|
-
* Each job includes job_id, start_date, and end_date.
|
|
203
|
+
* Return all jobs executed by a monitor.
|
|
213
204
|
*
|
|
214
205
|
* @param {CatchAllApi.ListMonitorJobsRequest} request
|
|
215
206
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -266,8 +257,7 @@ class MonitorsClient {
|
|
|
266
257
|
});
|
|
267
258
|
}
|
|
268
259
|
/**
|
|
269
|
-
* Retrieve aggregated results from all jobs executed by
|
|
270
|
-
* Includes monitor configuration, execution history, and all records collected.
|
|
260
|
+
* Retrieve aggregated results from all jobs executed by a monitor.
|
|
271
261
|
*
|
|
272
262
|
* @param {CatchAllApi.PullMonitorResultsRequest} request
|
|
273
263
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -321,8 +311,7 @@ class MonitorsClient {
|
|
|
321
311
|
});
|
|
322
312
|
}
|
|
323
313
|
/**
|
|
324
|
-
*
|
|
325
|
-
* Validates that the provided API key is associated with the monitor.
|
|
314
|
+
* Stop scheduled job execution for a monitor.
|
|
326
315
|
*
|
|
327
316
|
* @param {CatchAllApi.DisableMonitorRequest} request
|
|
328
317
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -379,10 +368,9 @@ class MonitorsClient {
|
|
|
379
368
|
});
|
|
380
369
|
}
|
|
381
370
|
/**
|
|
382
|
-
*
|
|
383
|
-
* Validates that the provided API key is associated with the monitor.
|
|
371
|
+
* Resume scheduled job execution for a monitor.
|
|
384
372
|
*
|
|
385
|
-
* @param {CatchAllApi.
|
|
373
|
+
* @param {CatchAllApi.EnableMonitorRequestDto} request
|
|
386
374
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
387
375
|
*
|
|
388
376
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -391,7 +379,8 @@ class MonitorsClient {
|
|
|
391
379
|
*
|
|
392
380
|
* @example
|
|
393
381
|
* await client.monitors.enableMonitor({
|
|
394
|
-
* monitor_id: "monitor_id"
|
|
382
|
+
* monitor_id: "monitor_id",
|
|
383
|
+
* backfill: true
|
|
395
384
|
* })
|
|
396
385
|
*/
|
|
397
386
|
enableMonitor(request, requestOptions) {
|
|
@@ -400,14 +389,17 @@ class MonitorsClient {
|
|
|
400
389
|
__enableMonitor(request, requestOptions) {
|
|
401
390
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
391
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
403
|
-
const { monitor_id: monitorId } = request;
|
|
392
|
+
const { monitor_id: monitorId } = request, _body = __rest(request, ["monitor_id"]);
|
|
404
393
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
405
394
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
406
395
|
const _response = yield core.fetcher({
|
|
407
396
|
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/monitors/${core.url.encodePathParam(monitorId)}/enable`),
|
|
408
397
|
method: "POST",
|
|
409
398
|
headers: _headers,
|
|
399
|
+
contentType: "application/json",
|
|
410
400
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
401
|
+
requestType: "json",
|
|
402
|
+
body: _body,
|
|
411
403
|
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,
|
|
412
404
|
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,
|
|
413
405
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -439,6 +431,7 @@ class MonitorsClient {
|
|
|
439
431
|
/**
|
|
440
432
|
* Returns all monitors created by the authenticated user.
|
|
441
433
|
*
|
|
434
|
+
* @param {CatchAllApi.ListMonitorsRequest} request
|
|
442
435
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
443
436
|
*
|
|
444
437
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -447,19 +440,24 @@ class MonitorsClient {
|
|
|
447
440
|
* @example
|
|
448
441
|
* await client.monitors.listMonitors()
|
|
449
442
|
*/
|
|
450
|
-
listMonitors(requestOptions) {
|
|
451
|
-
return core.HttpResponsePromise.fromPromise(this.__listMonitors(requestOptions));
|
|
443
|
+
listMonitors(request = {}, requestOptions) {
|
|
444
|
+
return core.HttpResponsePromise.fromPromise(this.__listMonitors(request, requestOptions));
|
|
452
445
|
}
|
|
453
|
-
__listMonitors(
|
|
454
|
-
return __awaiter(this,
|
|
446
|
+
__listMonitors() {
|
|
447
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
455
448
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
449
|
+
const { page, page_size: pageSize } = request;
|
|
450
|
+
const _queryParams = {
|
|
451
|
+
page,
|
|
452
|
+
page_size: pageSize,
|
|
453
|
+
};
|
|
456
454
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
457
455
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
458
456
|
const _response = yield core.fetcher({
|
|
459
457
|
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/monitors"),
|
|
460
458
|
method: "GET",
|
|
461
459
|
headers: _headers,
|
|
462
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
460
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
463
461
|
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,
|
|
464
462
|
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,
|
|
465
463
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2,19 +2,40 @@ import type * as CatchAllApi from "../../../../index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
|
-
* reference_job_id: "
|
|
6
|
-
* schedule: "every day at 12 PM UTC"
|
|
5
|
+
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
6
|
+
* schedule: "every day at 12 PM UTC",
|
|
7
|
+
* webhook: {
|
|
8
|
+
* url: "https://your-endpoint.com/webhook",
|
|
9
|
+
* method: "POST",
|
|
10
|
+
* headers: {
|
|
11
|
+
* "Authorization": "Bearer your_token_here"
|
|
12
|
+
* }
|
|
13
|
+
* },
|
|
14
|
+
* limit: 10,
|
|
15
|
+
* backfill: true
|
|
7
16
|
* }
|
|
8
17
|
*/
|
|
9
18
|
export interface CreateMonitorRequestDto {
|
|
10
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Job ID to use as template for scheduled runs. Defines the query, validators, and enrichments used for each scheduled run.
|
|
21
|
+
*
|
|
22
|
+
* If [`backfill`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/monitors/create-monitor#body-backfill) is true, the job's `end_date` must be within the last 7 days.
|
|
23
|
+
*/
|
|
11
24
|
reference_job_id: string;
|
|
12
25
|
/**
|
|
13
|
-
*
|
|
26
|
+
* Monitor schedule in plain text format (e.g. 'every day at 12 PM UTC', 'every 48 hours').
|
|
14
27
|
*
|
|
15
|
-
*
|
|
28
|
+
* Minimum frequency depends on your plan.
|
|
16
29
|
*/
|
|
17
30
|
schedule: string;
|
|
18
31
|
/** Optional webhook to receive notifications when jobs complete. */
|
|
19
32
|
webhook?: CatchAllApi.WebhookDto;
|
|
33
|
+
/** Maximum number of records per monitor run. If not provided, defaults to the plan limit. */
|
|
34
|
+
limit?: number;
|
|
35
|
+
/**
|
|
36
|
+
* If true, fills the data gap between the reference job's `end_date` and the first scheduled run. The reference job's `end_date` must be within the last 7 days.
|
|
37
|
+
*
|
|
38
|
+
* If false, no gap filling occurs and the first run uses the current cron window only — the reference job's age does not matter.
|
|
39
|
+
*/
|
|
40
|
+
backfill?: boolean;
|
|
20
41
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* monitor_id: "monitor_id",
|
|
5
|
+
* backfill: true
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface EnableMonitorRequestDto {
|
|
9
|
+
/** Monitor identifier. */
|
|
10
|
+
monitor_id: string;
|
|
11
|
+
/**
|
|
12
|
+
* If true, fills the data gap between the last job's `end_date` and the first scheduled run after enabling. The last job's `end_date` must be within the last 7 days.
|
|
13
|
+
*
|
|
14
|
+
* If false, no gap filling occurs and the first run uses the current cron window only — the last job's age does not matter.
|
|
15
|
+
*/
|
|
16
|
+
backfill?: boolean;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { CreateMonitorRequestDto } from "./CreateMonitorRequestDto.js";
|
|
2
2
|
export type { DisableMonitorRequest } from "./DisableMonitorRequest.js";
|
|
3
|
-
export type {
|
|
3
|
+
export type { EnableMonitorRequestDto } from "./EnableMonitorRequestDto.js";
|
|
4
4
|
export type { ListMonitorJobsRequest } from "./ListMonitorJobsRequest.js";
|
|
5
|
+
export type { ListMonitorsRequest } from "./ListMonitorsRequest.js";
|
|
5
6
|
export type { PullMonitorResultsRequest } from "./PullMonitorResultsRequest.js";
|
|
6
7
|
export type { UpdateMonitorRequestDto } from "./UpdateMonitorRequestDto.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MonitorsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "MonitorsClient", { enumerable: true, get: function () { return Client_js_1.MonitorsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface BaseRecord {
|
|
2
|
+
/** Unique identifier for the record. */
|
|
3
|
+
record_id: string;
|
|
4
|
+
/** Short title summarizing the record. */
|
|
5
|
+
record_title: string;
|
|
6
|
+
/**
|
|
7
|
+
* Structured data extracted from web pages. Schema is dynamically generated per job. Field names are chosen semantically to match the content.
|
|
8
|
+
*
|
|
9
|
+
* **Note:** The system always includes the `enrichment_confidence` field within the `enrichment` object, regardless of whether enrichments are generated or specified by you.
|
|
10
|
+
*
|
|
11
|
+
* For integration guidance, see [Dynamic schemas](https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/dynamic-schemas)
|
|
12
|
+
*/
|
|
13
|
+
enrichment: BaseRecord.Enrichment;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace BaseRecord {
|
|
16
|
+
/**
|
|
17
|
+
* Structured data extracted from web pages. Schema is dynamically generated per job. Field names are chosen semantically to match the content.
|
|
18
|
+
*
|
|
19
|
+
* **Note:** The system always includes the `enrichment_confidence` field within the `enrichment` object, regardless of whether enrichments are generated or specified by you.
|
|
20
|
+
*
|
|
21
|
+
* For integration guidance, see [Dynamic schemas](https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/dynamic-schemas)
|
|
22
|
+
*/
|
|
23
|
+
interface Enrichment {
|
|
24
|
+
/** Overall confidence score for the enrichment extraction. */
|
|
25
|
+
enrichment_confidence?: (Enrichment.EnrichmentConfidence | null) | undefined;
|
|
26
|
+
/** Accepts any additional properties */
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
namespace Enrichment {
|
|
30
|
+
/** Overall confidence score for the enrichment extraction. */
|
|
31
|
+
const EnrichmentConfidence: {
|
|
32
|
+
readonly Low: "low";
|
|
33
|
+
readonly Medium: "medium";
|
|
34
|
+
readonly High: "high";
|
|
35
|
+
};
|
|
36
|
+
type EnrichmentConfidence = (typeof EnrichmentConfidence)[keyof typeof EnrichmentConfidence];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BaseRecord = void 0;
|
|
5
|
+
var BaseRecord;
|
|
6
|
+
(function (BaseRecord) {
|
|
7
|
+
let Enrichment;
|
|
8
|
+
(function (Enrichment) {
|
|
9
|
+
/** Overall confidence score for the enrichment extraction. */
|
|
10
|
+
Enrichment.EnrichmentConfidence = {
|
|
11
|
+
Low: "low",
|
|
12
|
+
Medium: "medium",
|
|
13
|
+
High: "high",
|
|
14
|
+
};
|
|
15
|
+
})(Enrichment = BaseRecord.Enrichment || (BaseRecord.Enrichment = {}));
|
|
16
|
+
})(BaseRecord || (exports.BaseRecord = BaseRecord = {}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface Citation {
|
|
2
|
-
/**
|
|
2
|
+
/** The title of the source document. */
|
|
3
3
|
title: string;
|
|
4
|
-
/** URL to the source
|
|
4
|
+
/** URL to the source document. */
|
|
5
5
|
link: string;
|
|
6
|
-
/**
|
|
6
|
+
/** The publication date of the source document in ISO 8601 format (UTC timezone). */
|
|
7
7
|
published_date: string;
|
|
8
8
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appears as the value of company-typed fields in the `enrichment` object of each record. The `metadata` sub-object is populated by the system based on the identified company.
|
|
3
|
+
*/
|
|
4
|
+
export interface CompanyEnrichmentOutput {
|
|
5
|
+
/** The text span in the source document where the company was identified. */
|
|
6
|
+
source_text: string;
|
|
7
|
+
/** Confidence score for the company identification. */
|
|
8
|
+
confidence: number;
|
|
9
|
+
metadata: CompanyEnrichmentOutput.Metadata;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace CompanyEnrichmentOutput {
|
|
12
|
+
interface Metadata {
|
|
13
|
+
/** Normalized company name. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Company website domain if resolved, otherwise null. */
|
|
16
|
+
domain_url?: (string | null) | undefined;
|
|
17
|
+
/** Confidence level for the domain URL resolution. */
|
|
18
|
+
domain_url_confidence?: (Metadata.DomainUrlConfidence | null) | undefined;
|
|
19
|
+
}
|
|
20
|
+
namespace Metadata {
|
|
21
|
+
/** Confidence level for the domain URL resolution. */
|
|
22
|
+
const DomainUrlConfidence: {
|
|
23
|
+
readonly Low: "low";
|
|
24
|
+
readonly Medium: "medium";
|
|
25
|
+
readonly High: "high";
|
|
26
|
+
};
|
|
27
|
+
type DomainUrlConfidence = (typeof DomainUrlConfidence)[keyof typeof DomainUrlConfidence];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CompanyEnrichmentOutput = void 0;
|
|
5
|
+
var CompanyEnrichmentOutput;
|
|
6
|
+
(function (CompanyEnrichmentOutput) {
|
|
7
|
+
let Metadata;
|
|
8
|
+
(function (Metadata) {
|
|
9
|
+
/** Confidence level for the domain URL resolution. */
|
|
10
|
+
Metadata.DomainUrlConfidence = {
|
|
11
|
+
Low: "low",
|
|
12
|
+
Medium: "medium",
|
|
13
|
+
High: "high",
|
|
14
|
+
};
|
|
15
|
+
})(Metadata = CompanyEnrichmentOutput.Metadata || (CompanyEnrichmentOutput.Metadata = {}));
|
|
16
|
+
})(CompanyEnrichmentOutput || (exports.CompanyEnrichmentOutput = CompanyEnrichmentOutput = {}));
|
|
@@ -2,9 +2,9 @@ export interface ContinueResponseDto {
|
|
|
2
2
|
/** Job identifier for the continued job. */
|
|
3
3
|
job_id: string;
|
|
4
4
|
/** Previous record limit before continuation. */
|
|
5
|
-
previous_limit?: number;
|
|
5
|
+
previous_limit?: number | undefined;
|
|
6
6
|
/** New record limit after continuation. */
|
|
7
7
|
new_limit: number;
|
|
8
8
|
/** Confirmation that the continuation request was accepted. */
|
|
9
|
-
status
|
|
9
|
+
status: string;
|
|
10
10
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End date for web search (ISO 8601 format with UTC timezone).
|
|
3
|
+
*
|
|
4
|
+
* Defines the end 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 and after start_date. Default is current date if not specified.
|
|
7
|
+
*/
|
|
8
|
+
export type EndDate = string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for a single enrichment field that extracts structured data.
|
|
4
|
+
*
|
|
5
|
+
* Enrichments are applied during the enriching stage to extract information from validated clusters.
|
|
6
|
+
*/
|
|
7
|
+
export interface EnrichmentSchema {
|
|
8
|
+
/** Enrichment field name (snake_case recommended). */
|
|
9
|
+
name: string;
|
|
10
|
+
/** What information this field extracts. */
|
|
11
|
+
description: string;
|
|
12
|
+
type: CatchAllApi.EnrichmentType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical enrichment types supported by the system.
|
|
3
|
+
*
|
|
4
|
+
* - `text`: Free-form text strings (names, descriptions, summaries)
|
|
5
|
+
* - `number`: Numeric values (amounts, counts, percentages)
|
|
6
|
+
* - `date`: ISO format dates (YYYY-MM-DD)
|
|
7
|
+
* - `option`: Enum-like fixed values (status, category)
|
|
8
|
+
* - `url`: Web URLs
|
|
9
|
+
* - `company`: Structured company data. Returns `source_text`, `confidence`, and `metadata`. See [Company enrichment](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/company-enrichment-dto) data model.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EnrichmentType: {
|
|
12
|
+
readonly Text: "text";
|
|
13
|
+
readonly Number: "number";
|
|
14
|
+
readonly Date: "date";
|
|
15
|
+
readonly Option: "option";
|
|
16
|
+
readonly Url: "url";
|
|
17
|
+
readonly Company: "company";
|
|
18
|
+
};
|
|
19
|
+
export type EnrichmentType = (typeof EnrichmentType)[keyof typeof EnrichmentType];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EnrichmentType = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Canonical enrichment types supported by the system.
|
|
7
|
+
*
|
|
8
|
+
* - `text`: Free-form text strings (names, descriptions, summaries)
|
|
9
|
+
* - `number`: Numeric values (amounts, counts, percentages)
|
|
10
|
+
* - `date`: ISO format dates (YYYY-MM-DD)
|
|
11
|
+
* - `option`: Enum-like fixed values (status, category)
|
|
12
|
+
* - `url`: Web URLs
|
|
13
|
+
* - `company`: Structured company data. Returns `source_text`, `confidence`, and `metadata`. See [Company enrichment](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/company-enrichment-dto) data model.
|
|
14
|
+
*/
|
|
15
|
+
exports.EnrichmentType = {
|
|
16
|
+
Text: "text",
|
|
17
|
+
Number: "number",
|
|
18
|
+
Date: "date",
|
|
19
|
+
Option: "option",
|
|
20
|
+
Url: "url",
|
|
21
|
+
Company: "company",
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../index.js";
|
|
2
|
+
export interface InitializeResponseDto {
|
|
3
|
+
/** Echo of the query from the request. */
|
|
4
|
+
query: string;
|
|
5
|
+
/** Echo of the context from the request. Null if not provided. */
|
|
6
|
+
context?: (string | null) | undefined;
|
|
7
|
+
/** Suggested validators for filtering relevant web pages. */
|
|
8
|
+
validators: CatchAllApi.ValidatorSchema[];
|
|
9
|
+
/** Suggested enrichment fields for data extraction. */
|
|
10
|
+
enrichments: CatchAllApi.EnrichmentSchema[];
|
|
11
|
+
start_date?: CatchAllApi.StartDate | undefined;
|
|
12
|
+
end_date?: CatchAllApi.EndDate | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Messages explaining date adjustments due to plan limits.
|
|
15
|
+
*
|
|
16
|
+
* Empty array if no modifications were needed. Contains human-readable messages when requested dates exceed plan's allowed lookback period.
|
|
17
|
+
*/
|
|
18
|
+
date_modification_message?: string[] | undefined;
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as CatchAllApi from "../index.js";
|
|
2
2
|
export interface JobStep {
|
|
3
|
-
status: CatchAllApi.
|
|
3
|
+
status: CatchAllApi.PublicJobStatus;
|
|
4
4
|
/** Sequential position of this step in the pipeline (1-7). */
|
|
5
5
|
order: number;
|
|
6
6
|
/** Whether this step has finished processing. */
|
|
7
|
-
completed
|
|
7
|
+
completed: boolean;
|
|
8
8
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maximum number of records to return. If not specified, defaults to your plan limit.
|
|
3
|
+
*
|
|
4
|
+
* Use [`POST /catchAll/continue`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/continue-job) to extend the limit after job completion without reprocessing.
|
|
5
|
+
*/
|
|
6
|
+
export type Limit = number;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type * as CatchAllApi from "../index.js";
|
|
2
2
|
export interface ListMonitorsResponseDto {
|
|
3
3
|
/** Total number of monitors for this user. */
|
|
4
|
-
|
|
4
|
+
total: number;
|
|
5
|
+
/** Current page number. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Number of monitors per page. */
|
|
8
|
+
page_size: number;
|
|
9
|
+
/** Total number of pages available. */
|
|
10
|
+
total_pages: number;
|
|
5
11
|
/** Array of monitor summaries. */
|
|
6
12
|
monitors: CatchAllApi.MonitorListItemDto[];
|
|
7
13
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../index.js";
|
|
1
2
|
export interface ListUserJobsResponseDto {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
3
|
+
/** Total number of jobs for this user. */
|
|
4
|
+
total: number;
|
|
5
|
+
/** Current page number. */
|
|
6
|
+
page: number;
|
|
7
|
+
/** Number of jobs per page. */
|
|
8
|
+
page_size: number;
|
|
9
|
+
/** Total number of pages available. */
|
|
10
|
+
total_pages: number;
|
|
11
|
+
/** Array of user jobs on this page. */
|
|
12
|
+
jobs: CatchAllApi.UserJob[];
|
|
10
13
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* Citation with monitor-specific metadata. Used in monitor results and webhook payloads.
|
|
3
4
|
* Extends base citation with tracking information for job_id and timestamps.
|
|
4
5
|
*/
|
|
5
|
-
export interface MonitorCitation {
|
|
6
|
-
/**
|
|
6
|
+
export interface MonitorCitation extends CatchAllApi.Citation {
|
|
7
|
+
/** Unique identifier of the document in the search index. */
|
|
7
8
|
id: string;
|
|
8
|
-
/** Article title */
|
|
9
|
-
title: string;
|
|
10
|
-
/** URL to the source article */
|
|
11
|
-
link: string;
|
|
12
|
-
/** Article publication date in ISO 8601 format with UTC timezone. */
|
|
13
|
-
published_date: string;
|
|
14
9
|
/** Job ID that found this citation. */
|
|
15
10
|
job_id: string;
|
|
16
11
|
/** The date when the citation was added to the record in ISO 8601 format with UTC timezone. */
|