newscatcher-catchall-sdk 1.0.0 → 1.3.1
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 +41 -25
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +12 -0
- package/dist/cjs/Client.js +67 -0
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +14 -17
- package/dist/cjs/api/resources/jobs/client/Client.js +13 -19
- package/dist/cjs/api/resources/jobs/client/requests/ContinueRequestDto.d.ts +3 -3
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +2 -2
- package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +2 -1
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +26 -6
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +14 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/jobs/client/requests/index.js +3 -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/client/Client.d.ts +15 -3
- package/dist/cjs/api/resources/meta/client/Client.js +49 -1
- package/dist/cjs/api/resources/meta/exports.d.ts +2 -0
- package/dist/cjs/api/resources/meta/exports.js +21 -0
- package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +1 -1
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +23 -37
- package/dist/cjs/api/resources/monitors/client/Client.js +35 -41
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +23 -6
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.ts +17 -0
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/monitors/exports.d.ts +2 -0
- package/dist/cjs/api/resources/monitors/exports.js +21 -0
- package/dist/cjs/api/types/BaseRecord.d.ts +38 -0
- package/dist/cjs/api/types/BaseRecord.js +16 -0
- package/dist/cjs/api/types/Citation.d.ts +3 -3
- package/dist/cjs/api/types/CompanyEnrichmentOutput.d.ts +29 -0
- package/dist/cjs/api/types/CompanyEnrichmentOutput.js +16 -0
- package/dist/cjs/api/types/ContinueResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +1 -1
- package/dist/cjs/api/types/EndDate.d.ts +4 -2
- package/dist/cjs/api/types/EnrichmentType.d.ts +1 -3
- package/dist/cjs/api/types/EnrichmentType.js +1 -3
- package/dist/cjs/api/types/Error_.d.ts +1 -1
- package/dist/cjs/api/types/GetPlanLimitsResponseDto.d.ts +5 -0
- package/dist/cjs/api/types/InitializeResponseDto.d.ts +8 -9
- package/dist/cjs/api/types/JobStep.d.ts +2 -2
- package/dist/cjs/api/types/Limit.d.ts +1 -1
- package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
- package/dist/cjs/api/types/MonitorCitation.d.ts +3 -8
- package/dist/cjs/api/types/MonitorListItemDto.d.ts +10 -8
- package/dist/cjs/api/types/MonitorRecord.d.ts +4 -14
- package/dist/cjs/api/types/PlanFeature.d.ts +12 -0
- package/dist/cjs/api/types/PlanFeature.js +3 -0
- 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 +34 -25
- package/dist/cjs/api/types/PullJobResponseDto.js +9 -0
- package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +12 -12
- package/dist/cjs/api/types/Query.d.ts +1 -1
- package/dist/cjs/api/types/Record_.d.ts +2 -12
- package/dist/cjs/api/types/ReferenceJob.d.ts +3 -3
- package/dist/cjs/api/types/StartDate.d.ts +4 -2
- package/dist/cjs/api/types/StatusResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/{SubmitResponseBody.d.ts → SubmitResponseDto.d.ts} +1 -1
- package/dist/cjs/api/types/SubmitResponseDto.js +3 -0
- package/dist/cjs/api/types/UserJob.d.ts +13 -1
- package/dist/cjs/api/types/UserJob.js +9 -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 +3 -3
- package/dist/cjs/api/types/WebhookDto.d.ts +4 -4
- package/dist/cjs/api/types/WebhookPayload.d.ts +9 -9
- package/dist/cjs/api/types/index.d.ts +6 -3
- package/dist/cjs/api/types/index.js +6 -3
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.js +8 -2
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- 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/Client.d.mts +12 -0
- package/dist/esm/Client.mjs +34 -0
- package/dist/esm/api/resources/jobs/client/Client.d.mts +14 -17
- package/dist/esm/api/resources/jobs/client/Client.mjs +13 -19
- package/dist/esm/api/resources/jobs/client/requests/ContinueRequestDto.d.mts +3 -3
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +2 -2
- package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +2 -1
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +26 -6
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +13 -1
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -1
- 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/client/Client.d.mts +15 -3
- package/dist/esm/api/resources/meta/client/Client.mjs +50 -2
- package/dist/esm/api/resources/meta/exports.d.mts +2 -0
- package/dist/esm/api/resources/meta/exports.mjs +3 -0
- package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +1 -1
- package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +1 -1
- package/dist/esm/api/resources/monitors/client/Client.d.mts +23 -37
- package/dist/esm/api/resources/monitors/client/Client.mjs +35 -41
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +23 -6
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.mts +17 -0
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +2 -0
- package/dist/esm/api/resources/monitors/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/monitors/exports.d.mts +2 -0
- package/dist/esm/api/resources/monitors/exports.mjs +3 -0
- package/dist/esm/api/types/BaseRecord.d.mts +38 -0
- package/dist/esm/api/types/BaseRecord.mjs +13 -0
- package/dist/esm/api/types/Citation.d.mts +3 -3
- package/dist/esm/api/types/CompanyEnrichmentOutput.d.mts +29 -0
- package/dist/esm/api/types/CompanyEnrichmentOutput.mjs +13 -0
- package/dist/esm/api/types/ContinueResponseDto.d.mts +2 -2
- package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +1 -1
- package/dist/esm/api/types/EndDate.d.mts +4 -2
- package/dist/esm/api/types/EnrichmentType.d.mts +1 -3
- package/dist/esm/api/types/EnrichmentType.mjs +1 -3
- package/dist/esm/api/types/Error_.d.mts +1 -1
- package/dist/esm/api/types/GetPlanLimitsResponseDto.d.mts +5 -0
- package/dist/esm/api/types/InitializeResponseDto.d.mts +8 -9
- package/dist/esm/api/types/JobStep.d.mts +2 -2
- package/dist/esm/api/types/Limit.d.mts +1 -1
- package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
- package/dist/esm/api/types/MonitorCitation.d.mts +3 -8
- package/dist/esm/api/types/MonitorListItemDto.d.mts +10 -8
- package/dist/esm/api/types/MonitorRecord.d.mts +4 -14
- package/dist/esm/api/types/PlanFeature.d.mts +12 -0
- package/dist/esm/api/types/PlanFeature.mjs +2 -0
- 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 +34 -25
- package/dist/esm/api/types/PullJobResponseDto.mjs +8 -1
- package/dist/esm/api/types/PullMonitorResponseDto.d.mts +12 -12
- package/dist/esm/api/types/Query.d.mts +1 -1
- package/dist/esm/api/types/Record_.d.mts +2 -12
- package/dist/esm/api/types/ReferenceJob.d.mts +3 -3
- package/dist/esm/api/types/StartDate.d.mts +4 -2
- package/dist/esm/api/types/StatusResponseDto.d.mts +2 -2
- package/dist/esm/api/types/{SubmitResponseBody.d.mts → SubmitResponseDto.d.mts} +1 -1
- package/dist/esm/api/types/SubmitResponseDto.mjs +2 -0
- package/dist/esm/api/types/UserJob.d.mts +13 -1
- package/dist/esm/api/types/UserJob.mjs +8 -1
- package/dist/esm/api/types/ValidationErrorDetail.d.mts +3 -3
- package/dist/esm/api/types/ValidationErrorResponse.d.mts +1 -1
- package/dist/esm/api/types/ValidatorSchema.d.mts +3 -3
- package/dist/esm/api/types/WebhookDto.d.mts +4 -4
- package/dist/esm/api/types/WebhookPayload.d.mts +9 -9
- package/dist/esm/api/types/index.d.mts +6 -3
- package/dist/esm/api/types/index.mjs +6 -3
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- 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 +99 -53
- package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +0 -10
- package/dist/cjs/api/types/Schema.d.ts +0 -6
- package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +0 -10
- package/dist/esm/api/types/Schema.d.mts +0 -6
- /package/dist/cjs/api/resources/monitors/client/requests/{EnableMonitorRequest.js → EnableMonitorRequestDto.js} +0 -0
- /package/dist/cjs/api/{types/Schema.js → resources/monitors/client/requests/ListMonitorsRequest.js} +0 -0
- /package/dist/cjs/api/types/{SubmitResponseBody.js → GetPlanLimitsResponseDto.js} +0 -0
- /package/dist/esm/api/resources/monitors/client/requests/{EnableMonitorRequest.mjs → EnableMonitorRequestDto.mjs} +0 -0
- /package/dist/esm/api/{types/Schema.mjs → resources/monitors/client/requests/ListMonitorsRequest.mjs} +0 -0
- /package/dist/esm/api/types/{SubmitResponseBody.mjs → GetPlanLimitsResponseDto.mjs} +0 -0
|
@@ -50,12 +50,13 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
50
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
51
51
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const CatchAllApi = __importStar(require("../../../index.js"));
|
|
53
54
|
/**
|
|
54
55
|
* Operations to check API health and version.
|
|
55
56
|
*/
|
|
56
57
|
class MetaClient {
|
|
57
58
|
constructor(options = {}) {
|
|
58
|
-
this._options = (0, BaseClient_js_1.
|
|
59
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* Check API availability.
|
|
@@ -135,5 +136,52 @@ class MetaClient {
|
|
|
135
136
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/version");
|
|
136
137
|
});
|
|
137
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Returns plan features and current usage for the authenticated organization.
|
|
141
|
+
*
|
|
142
|
+
* @param {MetaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
143
|
+
*
|
|
144
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* await client.meta.getPlanLimits()
|
|
148
|
+
*/
|
|
149
|
+
getPlanLimits(requestOptions) {
|
|
150
|
+
return core.HttpResponsePromise.fromPromise(this.__getPlanLimits(requestOptions));
|
|
151
|
+
}
|
|
152
|
+
__getPlanLimits(requestOptions) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
155
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
156
|
+
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);
|
|
157
|
+
const _response = yield core.fetcher({
|
|
158
|
+
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/user/limits"),
|
|
159
|
+
method: "POST",
|
|
160
|
+
headers: _headers,
|
|
161
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
162
|
+
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,
|
|
163
|
+
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,
|
|
164
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
165
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
166
|
+
logging: this._options.logging,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
170
|
+
}
|
|
171
|
+
if (_response.error.reason === "status-code") {
|
|
172
|
+
switch (_response.error.statusCode) {
|
|
173
|
+
case 403:
|
|
174
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
175
|
+
default:
|
|
176
|
+
throw new errors.CatchAllApiError({
|
|
177
|
+
statusCode: _response.error.statusCode,
|
|
178
|
+
body: _response.error.body,
|
|
179
|
+
rawResponse: _response.rawResponse,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/user/limits");
|
|
184
|
+
});
|
|
185
|
+
}
|
|
138
186
|
}
|
|
139
187
|
exports.MetaClient = MetaClient;
|
|
@@ -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.MetaClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "MetaClient", { enumerable: true, get: function () { return Client_js_1.MetaClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -14,20 +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
|
-
* **Reference job requirements:**
|
|
20
|
-
* - Job's `end_date` must be within the last 7 days
|
|
21
|
-
*
|
|
22
|
-
* **Schedule requirements:**
|
|
23
|
-
* - Minimum 24-hour interval between executions
|
|
24
|
-
* - Natural language format (e.g., "every day at 12 PM UTC", "every 48 hours")
|
|
25
|
-
*
|
|
26
|
-
* **Validation:**
|
|
27
|
-
* - Reference jobs older than 7 days return 400 Bad Request.
|
|
28
|
-
* - Schedules below minimum frequency return error with descriptive message.
|
|
29
|
-
* - Invalid job IDs return 400 Bad Request.
|
|
30
|
-
* - Duplicate monitors (same job already monitored) return error.
|
|
17
|
+
* Create a scheduled monitor based on a reference job.
|
|
31
18
|
*
|
|
32
19
|
* @param {CatchAllApi.CreateMonitorRequestDto} request
|
|
33
20
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -36,22 +23,23 @@ export declare class MonitorsClient {
|
|
|
36
23
|
*
|
|
37
24
|
* @example
|
|
38
25
|
* await client.monitors.createMonitor({
|
|
39
|
-
* reference_job_id: "
|
|
40
|
-
* 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
|
|
41
37
|
* })
|
|
42
38
|
*/
|
|
43
39
|
createMonitor(request: CatchAllApi.CreateMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.CreateMonitorResponseDto>;
|
|
44
40
|
private __createMonitor;
|
|
45
41
|
/**
|
|
46
|
-
* Update webhook configuration for an existing monitor
|
|
47
|
-
*
|
|
48
|
-
* **Supported updates:**
|
|
49
|
-
* - Webhook URL
|
|
50
|
-
* - HTTP method (POST/PUT)
|
|
51
|
-
* - Headers and authentication
|
|
52
|
-
* - Query parameters
|
|
53
|
-
*
|
|
54
|
-
* **Note:** Schedule and reference job cannot be modified. To change these, create a new monitor.
|
|
42
|
+
* Update the webhook configuration for an existing monitor.
|
|
55
43
|
*
|
|
56
44
|
* @param {CatchAllApi.UpdateMonitorRequestDto} request
|
|
57
45
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -75,8 +63,7 @@ export declare class MonitorsClient {
|
|
|
75
63
|
updateMonitor(request: CatchAllApi.UpdateMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.UpdateMonitorResponseDto>;
|
|
76
64
|
private __updateMonitor;
|
|
77
65
|
/**
|
|
78
|
-
*
|
|
79
|
-
* Each job includes job_id, start_date, and end_date.
|
|
66
|
+
* Return all jobs executed by a monitor.
|
|
80
67
|
*
|
|
81
68
|
* @param {CatchAllApi.ListMonitorJobsRequest} request
|
|
82
69
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -92,8 +79,7 @@ export declare class MonitorsClient {
|
|
|
92
79
|
listMonitorJobs(request: CatchAllApi.ListMonitorJobsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorJobsResponse>;
|
|
93
80
|
private __listMonitorJobs;
|
|
94
81
|
/**
|
|
95
|
-
* Retrieve aggregated results from all jobs executed by
|
|
96
|
-
* Includes monitor configuration, execution history, and all records collected.
|
|
82
|
+
* Retrieve aggregated results from all jobs executed by a monitor.
|
|
97
83
|
*
|
|
98
84
|
* @param {CatchAllApi.PullMonitorResultsRequest} request
|
|
99
85
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -109,8 +95,7 @@ export declare class MonitorsClient {
|
|
|
109
95
|
pullMonitorResults(request: CatchAllApi.PullMonitorResultsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullMonitorResponseDto>;
|
|
110
96
|
private __pullMonitorResults;
|
|
111
97
|
/**
|
|
112
|
-
*
|
|
113
|
-
* Validates that the provided API key is associated with the monitor.
|
|
98
|
+
* Stop scheduled job execution for a monitor.
|
|
114
99
|
*
|
|
115
100
|
* @param {CatchAllApi.DisableMonitorRequest} request
|
|
116
101
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -127,10 +112,9 @@ export declare class MonitorsClient {
|
|
|
127
112
|
disableMonitor(request: CatchAllApi.DisableMonitorRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DisableMonitorResponse>;
|
|
128
113
|
private __disableMonitor;
|
|
129
114
|
/**
|
|
130
|
-
*
|
|
131
|
-
* Validates that the provided API key is associated with the monitor.
|
|
115
|
+
* Resume scheduled job execution for a monitor.
|
|
132
116
|
*
|
|
133
|
-
* @param {CatchAllApi.
|
|
117
|
+
* @param {CatchAllApi.EnableMonitorRequestDto} request
|
|
134
118
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
135
119
|
*
|
|
136
120
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -139,14 +123,16 @@ export declare class MonitorsClient {
|
|
|
139
123
|
*
|
|
140
124
|
* @example
|
|
141
125
|
* await client.monitors.enableMonitor({
|
|
142
|
-
* monitor_id: "monitor_id"
|
|
126
|
+
* monitor_id: "monitor_id",
|
|
127
|
+
* backfill: true
|
|
143
128
|
* })
|
|
144
129
|
*/
|
|
145
|
-
enableMonitor(request: CatchAllApi.
|
|
130
|
+
enableMonitor(request: CatchAllApi.EnableMonitorRequestDto, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.EnableMonitorResponse>;
|
|
146
131
|
private __enableMonitor;
|
|
147
132
|
/**
|
|
148
133
|
* Returns all monitors created by the authenticated user.
|
|
149
134
|
*
|
|
135
|
+
* @param {CatchAllApi.ListMonitorsRequest} request
|
|
150
136
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
137
|
*
|
|
152
138
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -155,6 +141,6 @@ export declare class MonitorsClient {
|
|
|
155
141
|
* @example
|
|
156
142
|
* await client.monitors.listMonitors()
|
|
157
143
|
*/
|
|
158
|
-
listMonitors(requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorsResponseDto>;
|
|
144
|
+
listMonitors(request?: CatchAllApi.ListMonitorsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListMonitorsResponseDto>;
|
|
159
145
|
private __listMonitors;
|
|
160
146
|
}
|
|
@@ -70,20 +70,7 @@ class MonitorsClient {
|
|
|
70
70
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Create a monitor
|
|
74
|
-
*
|
|
75
|
-
* **Reference job requirements:**
|
|
76
|
-
* - Job's `end_date` must be within the last 7 days
|
|
77
|
-
*
|
|
78
|
-
* **Schedule requirements:**
|
|
79
|
-
* - Minimum 24-hour interval between executions
|
|
80
|
-
* - Natural language format (e.g., "every day at 12 PM UTC", "every 48 hours")
|
|
81
|
-
*
|
|
82
|
-
* **Validation:**
|
|
83
|
-
* - Reference jobs older than 7 days return 400 Bad Request.
|
|
84
|
-
* - Schedules below minimum frequency return error with descriptive message.
|
|
85
|
-
* - Invalid job IDs return 400 Bad Request.
|
|
86
|
-
* - Duplicate monitors (same job already monitored) return error.
|
|
73
|
+
* Create a scheduled monitor based on a reference job.
|
|
87
74
|
*
|
|
88
75
|
* @param {CatchAllApi.CreateMonitorRequestDto} request
|
|
89
76
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -92,8 +79,17 @@ class MonitorsClient {
|
|
|
92
79
|
*
|
|
93
80
|
* @example
|
|
94
81
|
* await client.monitors.createMonitor({
|
|
95
|
-
* reference_job_id: "
|
|
96
|
-
* 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
|
|
97
93
|
* })
|
|
98
94
|
*/
|
|
99
95
|
createMonitor(request, requestOptions) {
|
|
@@ -137,15 +133,7 @@ class MonitorsClient {
|
|
|
137
133
|
});
|
|
138
134
|
}
|
|
139
135
|
/**
|
|
140
|
-
* Update webhook configuration for an existing monitor
|
|
141
|
-
*
|
|
142
|
-
* **Supported updates:**
|
|
143
|
-
* - Webhook URL
|
|
144
|
-
* - HTTP method (POST/PUT)
|
|
145
|
-
* - Headers and authentication
|
|
146
|
-
* - Query parameters
|
|
147
|
-
*
|
|
148
|
-
* **Note:** Schedule and reference job cannot be modified. To change these, create a new monitor.
|
|
136
|
+
* Update the webhook configuration for an existing monitor.
|
|
149
137
|
*
|
|
150
138
|
* @param {CatchAllApi.UpdateMonitorRequestDto} request
|
|
151
139
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -212,8 +200,7 @@ class MonitorsClient {
|
|
|
212
200
|
});
|
|
213
201
|
}
|
|
214
202
|
/**
|
|
215
|
-
*
|
|
216
|
-
* Each job includes job_id, start_date, and end_date.
|
|
203
|
+
* Return all jobs executed by a monitor.
|
|
217
204
|
*
|
|
218
205
|
* @param {CatchAllApi.ListMonitorJobsRequest} request
|
|
219
206
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -270,8 +257,7 @@ class MonitorsClient {
|
|
|
270
257
|
});
|
|
271
258
|
}
|
|
272
259
|
/**
|
|
273
|
-
* Retrieve aggregated results from all jobs executed by
|
|
274
|
-
* Includes monitor configuration, execution history, and all records collected.
|
|
260
|
+
* Retrieve aggregated results from all jobs executed by a monitor.
|
|
275
261
|
*
|
|
276
262
|
* @param {CatchAllApi.PullMonitorResultsRequest} request
|
|
277
263
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -325,8 +311,7 @@ class MonitorsClient {
|
|
|
325
311
|
});
|
|
326
312
|
}
|
|
327
313
|
/**
|
|
328
|
-
*
|
|
329
|
-
* Validates that the provided API key is associated with the monitor.
|
|
314
|
+
* Stop scheduled job execution for a monitor.
|
|
330
315
|
*
|
|
331
316
|
* @param {CatchAllApi.DisableMonitorRequest} request
|
|
332
317
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -383,10 +368,9 @@ class MonitorsClient {
|
|
|
383
368
|
});
|
|
384
369
|
}
|
|
385
370
|
/**
|
|
386
|
-
*
|
|
387
|
-
* Validates that the provided API key is associated with the monitor.
|
|
371
|
+
* Resume scheduled job execution for a monitor.
|
|
388
372
|
*
|
|
389
|
-
* @param {CatchAllApi.
|
|
373
|
+
* @param {CatchAllApi.EnableMonitorRequestDto} request
|
|
390
374
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
391
375
|
*
|
|
392
376
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -395,7 +379,8 @@ class MonitorsClient {
|
|
|
395
379
|
*
|
|
396
380
|
* @example
|
|
397
381
|
* await client.monitors.enableMonitor({
|
|
398
|
-
* monitor_id: "monitor_id"
|
|
382
|
+
* monitor_id: "monitor_id",
|
|
383
|
+
* backfill: true
|
|
399
384
|
* })
|
|
400
385
|
*/
|
|
401
386
|
enableMonitor(request, requestOptions) {
|
|
@@ -404,14 +389,17 @@ class MonitorsClient {
|
|
|
404
389
|
__enableMonitor(request, requestOptions) {
|
|
405
390
|
return __awaiter(this, void 0, void 0, function* () {
|
|
406
391
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
407
|
-
const { monitor_id: monitorId } = request;
|
|
392
|
+
const { monitor_id: monitorId } = request, _body = __rest(request, ["monitor_id"]);
|
|
408
393
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
409
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);
|
|
410
395
|
const _response = yield core.fetcher({
|
|
411
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`),
|
|
412
397
|
method: "POST",
|
|
413
398
|
headers: _headers,
|
|
399
|
+
contentType: "application/json",
|
|
414
400
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
401
|
+
requestType: "json",
|
|
402
|
+
body: _body,
|
|
415
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,
|
|
416
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,
|
|
417
405
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -443,6 +431,7 @@ class MonitorsClient {
|
|
|
443
431
|
/**
|
|
444
432
|
* Returns all monitors created by the authenticated user.
|
|
445
433
|
*
|
|
434
|
+
* @param {CatchAllApi.ListMonitorsRequest} request
|
|
446
435
|
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
447
436
|
*
|
|
448
437
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -451,19 +440,24 @@ class MonitorsClient {
|
|
|
451
440
|
* @example
|
|
452
441
|
* await client.monitors.listMonitors()
|
|
453
442
|
*/
|
|
454
|
-
listMonitors(requestOptions) {
|
|
455
|
-
return core.HttpResponsePromise.fromPromise(this.__listMonitors(requestOptions));
|
|
443
|
+
listMonitors(request = {}, requestOptions) {
|
|
444
|
+
return core.HttpResponsePromise.fromPromise(this.__listMonitors(request, requestOptions));
|
|
456
445
|
}
|
|
457
|
-
__listMonitors(
|
|
458
|
-
return __awaiter(this,
|
|
446
|
+
__listMonitors() {
|
|
447
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
459
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
|
+
};
|
|
460
454
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
461
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);
|
|
462
456
|
const _response = yield core.fetcher({
|
|
463
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"),
|
|
464
458
|
method: "GET",
|
|
465
459
|
headers: _headers,
|
|
466
|
-
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),
|
|
467
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,
|
|
468
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,
|
|
469
463
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2,23 +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
|
/**
|
|
11
|
-
* Job ID to use as template for scheduled runs.
|
|
20
|
+
* Job ID to use as template for scheduled runs. Defines the query, validators, and enrichments used for each scheduled run.
|
|
12
21
|
*
|
|
13
|
-
*
|
|
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.
|
|
14
23
|
*/
|
|
15
24
|
reference_job_id: string;
|
|
16
25
|
/**
|
|
17
|
-
*
|
|
26
|
+
* Monitor schedule in plain text format (e.g. 'every day at 12 PM UTC', 'every 48 hours').
|
|
18
27
|
*
|
|
19
|
-
*
|
|
28
|
+
* Minimum frequency depends on your plan.
|
|
20
29
|
*/
|
|
21
30
|
schedule: string;
|
|
22
31
|
/** Optional webhook to receive notifications when jobs complete. */
|
|
23
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;
|
|
24
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 = {}));
|