newscatcher-catchall-sdk 3.0.1 → 4.0.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 +2 -0
- package/dist/cjs/BaseClient.d.ts +12 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/errors/BadRequestError.js +1 -1
- package/dist/cjs/api/errors/ForbiddenError.js +1 -1
- package/dist/cjs/api/errors/NotFoundError.js +1 -1
- package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
- package/dist/cjs/api/errors/UnprocessableEntityError.js +1 -1
- package/dist/cjs/api/resources/datasets/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/datasets/client/Client.js +11 -8
- package/dist/cjs/api/resources/entities/client/Client.d.ts +8 -6
- package/dist/cjs/api/resources/entities/client/Client.js +12 -9
- package/dist/cjs/api/resources/entities/client/requests/UpdateEntityRequest.d.ts +3 -1
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/jobs/client/Client.js +60 -4
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.ts +10 -0
- package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +4 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/monitors/client/Client.js +59 -3
- package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.ts +10 -0
- package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.js +3 -0
- package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/projects/client/Client.js +4 -3
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +25 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +78 -4
- package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.ts +2 -2
- package/dist/cjs/api/resources/webhooks/client/requests/TriggerWebhookRequest.d.ts +23 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TriggerWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.ts +2 -2
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/CompanyAttributes.d.ts +0 -2
- package/dist/cjs/api/types/ConnectedDataset.d.ts +11 -0
- package/dist/cjs/api/types/ConnectedDataset.js +3 -0
- package/dist/cjs/api/types/ConnectedEntity.d.ts +2 -0
- package/dist/cjs/api/types/CreateEntityRequest.d.ts +6 -2
- package/dist/cjs/api/types/DatasetResponse.d.ts +15 -0
- package/dist/cjs/api/types/EntityResponse.d.ts +2 -0
- package/dist/cjs/api/types/EntitySummary.d.ts +2 -0
- package/dist/cjs/api/types/FormatterConfigDto.d.ts +15 -0
- package/dist/cjs/api/types/FormatterConfigDto.js +3 -0
- package/dist/cjs/api/types/InitializeResponseDto.d.ts +6 -1
- package/dist/cjs/api/types/PullJobResponseDto.d.ts +4 -0
- package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +4 -0
- package/dist/cjs/api/types/WebhookResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/core/file/file.js +3 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +3 -0
- package/dist/cjs/core/requestBody.d.ts +12 -0
- package/dist/cjs/core/requestBody.js +26 -0
- package/dist/cjs/core/url/qs.js +2 -2
- package/dist/cjs/errors/CatchAllApiError.d.ts +1 -0
- package/dist/cjs/errors/CatchAllApiError.js +5 -1
- package/dist/cjs/errors/CatchAllApiTimeoutError.d.ts +2 -2
- package/dist/cjs/errors/CatchAllApiTimeoutError.js +40 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +12 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/errors/BadRequestError.mjs +1 -1
- package/dist/esm/api/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/api/errors/NotFoundError.mjs +1 -1
- package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +1 -1
- package/dist/esm/api/resources/datasets/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/datasets/client/Client.mjs +11 -8
- package/dist/esm/api/resources/entities/client/Client.d.mts +8 -6
- package/dist/esm/api/resources/entities/client/Client.mjs +12 -9
- package/dist/esm/api/resources/entities/client/requests/UpdateEntityRequest.d.mts +3 -1
- package/dist/esm/api/resources/jobs/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/jobs/client/Client.mjs +60 -4
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.mts +10 -0
- package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +4 -0
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/monitors/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/monitors/client/Client.mjs +59 -3
- package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.mts +10 -0
- package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.mjs +2 -0
- package/dist/esm/api/resources/monitors/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/projects/client/Client.mjs +4 -3
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +25 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +78 -4
- package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.mts +2 -2
- package/dist/esm/api/resources/webhooks/client/requests/TriggerWebhookRequest.d.mts +23 -0
- package/dist/esm/api/resources/webhooks/client/requests/TriggerWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.mts +2 -2
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/CompanyAttributes.d.mts +0 -2
- package/dist/esm/api/types/ConnectedDataset.d.mts +11 -0
- package/dist/esm/api/types/ConnectedDataset.mjs +2 -0
- package/dist/esm/api/types/ConnectedEntity.d.mts +2 -0
- package/dist/esm/api/types/CreateEntityRequest.d.mts +6 -2
- package/dist/esm/api/types/DatasetResponse.d.mts +15 -0
- package/dist/esm/api/types/EntityResponse.d.mts +2 -0
- package/dist/esm/api/types/EntitySummary.d.mts +2 -0
- package/dist/esm/api/types/FormatterConfigDto.d.mts +15 -0
- package/dist/esm/api/types/FormatterConfigDto.mjs +2 -0
- package/dist/esm/api/types/InitializeResponseDto.d.mts +6 -1
- package/dist/esm/api/types/PullJobResponseDto.d.mts +4 -0
- package/dist/esm/api/types/PullMonitorResponseDto.d.mts +4 -0
- package/dist/esm/api/types/WebhookResponseDto.d.mts +2 -2
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/core/file/file.mjs +3 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +3 -0
- package/dist/esm/core/requestBody.d.mts +12 -0
- package/dist/esm/core/requestBody.mjs +23 -0
- package/dist/esm/core/url/qs.mjs +2 -2
- package/dist/esm/errors/CatchAllApiError.d.mts +1 -0
- package/dist/esm/errors/CatchAllApiError.mjs +5 -1
- package/dist/esm/errors/CatchAllApiTimeoutError.d.mts +2 -2
- package/dist/esm/errors/CatchAllApiTimeoutError.mjs +7 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +216 -9
package/README.md
CHANGED
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export type BaseClientOptions = {
|
|
|
16
16
|
fetch?: typeof fetch;
|
|
17
17
|
/** Configure logging for the client. */
|
|
18
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
+
/** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
20
|
+
stream?: {
|
|
21
|
+
reconnectionEnabled?: boolean;
|
|
22
|
+
maxReconnectionAttempts?: number;
|
|
23
|
+
};
|
|
19
24
|
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
20
25
|
auth?: AuthOption;
|
|
21
26
|
} & HeaderAuthProvider.AuthOptions;
|
|
@@ -28,8 +33,15 @@ export interface BaseRequestOptions {
|
|
|
28
33
|
abortSignal?: AbortSignal;
|
|
29
34
|
/** Additional query string parameters to include in the request. */
|
|
30
35
|
queryParams?: Record<string, unknown>;
|
|
36
|
+
/** A dictionary containing additional parameters to spread into the request's body. */
|
|
37
|
+
additionalBodyParameters?: Record<string, unknown>;
|
|
31
38
|
/** Additional headers to include in the request. */
|
|
32
39
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
40
|
+
/** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
41
|
+
stream?: {
|
|
42
|
+
reconnectionEnabled?: boolean;
|
|
43
|
+
maxReconnectionAttempts?: number;
|
|
44
|
+
};
|
|
33
45
|
}
|
|
34
46
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
35
47
|
logging: core.logging.Logger;
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/
|
|
46
|
+
"X-Fern-SDK-Version": "4.0.1",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/4.0.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -48,7 +48,7 @@ class BadRequestError extends errors.CatchAllApiError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "BadRequestError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.BadRequestError = BadRequestError;
|
|
@@ -48,7 +48,7 @@ class ForbiddenError extends errors.CatchAllApiError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "ForbiddenError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.ForbiddenError = ForbiddenError;
|
|
@@ -48,7 +48,7 @@ class NotFoundError extends errors.CatchAllApiError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "NotFoundError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.NotFoundError = NotFoundError;
|
|
@@ -48,7 +48,7 @@ class UnauthorizedError extends errors.CatchAllApiError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "UnauthorizedError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -48,7 +48,7 @@ class UnprocessableEntityError extends errors.CatchAllApiError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "UnprocessableEntityError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
@@ -34,7 +34,9 @@ export declare class DatasetsClient {
|
|
|
34
34
|
listDatasets(request?: CatchAllApi.ListDatasetsRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetListResponse>;
|
|
35
35
|
private __listDatasets;
|
|
36
36
|
/**
|
|
37
|
-
* Creates a new dataset from a list of existing entity IDs.
|
|
37
|
+
* Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
|
|
38
|
+
*
|
|
39
|
+
* Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
|
|
38
40
|
*
|
|
39
41
|
* If any of the provided entity IDs do not exist or do not belong to
|
|
40
42
|
* your organization, the request fails with `400`. All entity IDs must
|
|
@@ -60,12 +62,12 @@ export declare class DatasetsClient {
|
|
|
60
62
|
createDataset(request: CatchAllApi.CreateDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetResponse>;
|
|
61
63
|
private __createDataset;
|
|
62
64
|
/**
|
|
63
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity.
|
|
65
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
|
|
64
66
|
*
|
|
65
67
|
* **CSV format:**
|
|
66
68
|
* ```csv
|
|
67
69
|
* name,description,domain,alternative_names,key_persons
|
|
68
|
-
* NewsCatcher,"
|
|
70
|
+
* NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
|
|
69
71
|
* OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
|
|
70
72
|
* ```
|
|
71
73
|
*
|
|
@@ -58,6 +58,7 @@ exports.DatasetsClient = void 0;
|
|
|
58
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
61
62
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
63
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -140,7 +141,9 @@ class DatasetsClient {
|
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
|
-
* Creates a new dataset from a list of existing entity IDs.
|
|
144
|
+
* Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
|
|
145
|
+
*
|
|
146
|
+
* Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
|
|
144
147
|
*
|
|
145
148
|
* If any of the provided entity IDs do not exist or do not belong to
|
|
146
149
|
* your organization, the request fails with `400`. All entity IDs must
|
|
@@ -178,7 +181,7 @@ class DatasetsClient {
|
|
|
178
181
|
contentType: "application/json",
|
|
179
182
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
180
183
|
requestType: "json",
|
|
181
|
-
body: request,
|
|
184
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
182
185
|
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,
|
|
183
186
|
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,
|
|
184
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,12 +211,12 @@ class DatasetsClient {
|
|
|
208
211
|
});
|
|
209
212
|
}
|
|
210
213
|
/**
|
|
211
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity.
|
|
214
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
|
|
212
215
|
*
|
|
213
216
|
* **CSV format:**
|
|
214
217
|
* ```csv
|
|
215
218
|
* name,description,domain,alternative_names,key_persons
|
|
216
|
-
* NewsCatcher,"
|
|
219
|
+
* NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
|
|
217
220
|
* OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
|
|
218
221
|
* ```
|
|
219
222
|
*
|
|
@@ -426,7 +429,7 @@ class DatasetsClient {
|
|
|
426
429
|
contentType: "application/json",
|
|
427
430
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
428
431
|
requestType: "json",
|
|
429
|
-
body: _body,
|
|
432
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
430
433
|
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,
|
|
431
434
|
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,
|
|
432
435
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -489,7 +492,7 @@ class DatasetsClient {
|
|
|
489
492
|
contentType: "application/json",
|
|
490
493
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
491
494
|
requestType: "json",
|
|
492
|
-
body: _body,
|
|
495
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
493
496
|
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,
|
|
494
497
|
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,
|
|
495
498
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -552,7 +555,7 @@ class DatasetsClient {
|
|
|
552
555
|
contentType: "application/json",
|
|
553
556
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
554
557
|
requestType: "json",
|
|
555
|
-
body: _body,
|
|
558
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
556
559
|
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,
|
|
557
560
|
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,
|
|
558
561
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -619,7 +622,7 @@ class DatasetsClient {
|
|
|
619
622
|
contentType: "application/json",
|
|
620
623
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
621
624
|
requestType: "json",
|
|
622
|
-
body: _body,
|
|
625
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
623
626
|
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,
|
|
624
627
|
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,
|
|
625
628
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -35,10 +35,10 @@ export declare class EntitiesClient {
|
|
|
35
35
|
/**
|
|
36
36
|
* Creates a new company entity and begins background enrichment.
|
|
37
37
|
*
|
|
38
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
|
|
39
|
+
*
|
|
38
40
|
* The entity status starts as `pending` and transitions to `ready` once
|
|
39
|
-
* enrichment completes.
|
|
40
|
-
* possible — `domain` is the highest-signal field because it is
|
|
41
|
-
* unambiguous.
|
|
41
|
+
* enrichment completes.
|
|
42
42
|
*
|
|
43
43
|
* @param {CatchAllApi.CreateEntityRequest} request
|
|
44
44
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -50,12 +50,12 @@ export declare class EntitiesClient {
|
|
|
50
50
|
* await client.entities.createEntity({
|
|
51
51
|
* name: "NewsCatcher",
|
|
52
52
|
* entity_type: "company",
|
|
53
|
-
* description: "
|
|
53
|
+
* description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
|
|
54
54
|
* additional_attributes: {
|
|
55
55
|
* company_attributes: {
|
|
56
56
|
* domain: "newscatcherapi.com",
|
|
57
57
|
* key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
|
|
58
|
-
* alternative_names: ["
|
|
58
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
|
|
59
59
|
* }
|
|
60
60
|
* }
|
|
61
61
|
* })
|
|
@@ -65,6 +65,8 @@ export declare class EntitiesClient {
|
|
|
65
65
|
/**
|
|
66
66
|
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
67
67
|
*
|
|
68
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
|
|
69
|
+
*
|
|
68
70
|
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
69
71
|
*
|
|
70
72
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
@@ -150,7 +152,7 @@ export declare class EntitiesClient {
|
|
|
150
152
|
* description: "Updated description",
|
|
151
153
|
* additional_attributes: {
|
|
152
154
|
* company_attributes: {
|
|
153
|
-
* alternative_names: ["
|
|
155
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
154
156
|
* }
|
|
155
157
|
* }
|
|
156
158
|
* })
|
|
@@ -58,6 +58,7 @@ exports.EntitiesClient = void 0;
|
|
|
58
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
61
62
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
63
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -140,10 +141,10 @@ class EntitiesClient {
|
|
|
140
141
|
/**
|
|
141
142
|
* Creates a new company entity and begins background enrichment.
|
|
142
143
|
*
|
|
144
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
|
|
145
|
+
*
|
|
143
146
|
* The entity status starts as `pending` and transitions to `ready` once
|
|
144
|
-
* enrichment completes.
|
|
145
|
-
* possible — `domain` is the highest-signal field because it is
|
|
146
|
-
* unambiguous.
|
|
147
|
+
* enrichment completes.
|
|
147
148
|
*
|
|
148
149
|
* @param {CatchAllApi.CreateEntityRequest} request
|
|
149
150
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -155,12 +156,12 @@ class EntitiesClient {
|
|
|
155
156
|
* await client.entities.createEntity({
|
|
156
157
|
* name: "NewsCatcher",
|
|
157
158
|
* entity_type: "company",
|
|
158
|
-
* description: "
|
|
159
|
+
* description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
|
|
159
160
|
* additional_attributes: {
|
|
160
161
|
* company_attributes: {
|
|
161
162
|
* domain: "newscatcherapi.com",
|
|
162
163
|
* key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
|
|
163
|
-
* alternative_names: ["
|
|
164
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
|
|
164
165
|
* }
|
|
165
166
|
* }
|
|
166
167
|
* })
|
|
@@ -180,7 +181,7 @@ class EntitiesClient {
|
|
|
180
181
|
contentType: "application/json",
|
|
181
182
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
182
183
|
requestType: "json",
|
|
183
|
-
body: request,
|
|
184
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
184
185
|
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,
|
|
185
186
|
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,
|
|
186
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -210,6 +211,8 @@ class EntitiesClient {
|
|
|
210
211
|
/**
|
|
211
212
|
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
212
213
|
*
|
|
214
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
|
|
215
|
+
*
|
|
213
216
|
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
214
217
|
*
|
|
215
218
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
@@ -259,7 +262,7 @@ class EntitiesClient {
|
|
|
259
262
|
contentType: "application/json",
|
|
260
263
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
261
264
|
requestType: "json",
|
|
262
|
-
body: request,
|
|
265
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
263
266
|
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,
|
|
264
267
|
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,
|
|
265
268
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -414,7 +417,7 @@ class EntitiesClient {
|
|
|
414
417
|
* description: "Updated description",
|
|
415
418
|
* additional_attributes: {
|
|
416
419
|
* company_attributes: {
|
|
417
|
-
* alternative_names: ["
|
|
420
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
418
421
|
* }
|
|
419
422
|
* }
|
|
420
423
|
* })
|
|
@@ -435,7 +438,7 @@ class EntitiesClient {
|
|
|
435
438
|
contentType: "application/json",
|
|
436
439
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
437
440
|
requestType: "json",
|
|
438
|
-
body: _body,
|
|
441
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
439
442
|
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,
|
|
440
443
|
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,
|
|
441
444
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,7 +6,7 @@ import type * as CatchAllApi from "../../../../index.js";
|
|
|
6
6
|
* description: "Updated description",
|
|
7
7
|
* additional_attributes: {
|
|
8
8
|
* company_attributes: {
|
|
9
|
-
* alternative_names: ["
|
|
9
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
10
10
|
* }
|
|
11
11
|
* }
|
|
12
12
|
* }
|
|
@@ -18,5 +18,7 @@ export interface UpdateEntityRequest {
|
|
|
18
18
|
name?: string;
|
|
19
19
|
/** Updated description. */
|
|
20
20
|
description?: string;
|
|
21
|
+
/** Updated external identifier for this entity. */
|
|
22
|
+
external_entity_id?: string;
|
|
21
23
|
additional_attributes?: CatchAllApi.AdditionalAttributes;
|
|
22
24
|
}
|
|
@@ -117,6 +117,22 @@ export declare class JobsClient {
|
|
|
117
117
|
*/
|
|
118
118
|
getJobResults(request: CatchAllApi.GetJobResultsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullJobResponseDto>;
|
|
119
119
|
private __getJobResults;
|
|
120
|
+
/**
|
|
121
|
+
* Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
|
|
122
|
+
*
|
|
123
|
+
* @param {CatchAllApi.GetJobResultsCsvRequest} request
|
|
124
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
125
|
+
*
|
|
126
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
127
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.jobs.getJobResultsCsv({
|
|
131
|
+
* job_id: "job_id"
|
|
132
|
+
* })
|
|
133
|
+
*/
|
|
134
|
+
getJobResultsCsv(request: CatchAllApi.GetJobResultsCsvRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<string>;
|
|
135
|
+
private __getJobResultsCsv;
|
|
120
136
|
/**
|
|
121
137
|
* Continue an existing job to process more records beyond the initial limit.
|
|
122
138
|
*
|
|
@@ -47,6 +47,7 @@ exports.JobsClient = void 0;
|
|
|
47
47
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
50
51
|
const environments = __importStar(require("../../../../environments.js"));
|
|
51
52
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -151,7 +152,7 @@ class JobsClient {
|
|
|
151
152
|
contentType: "application/json",
|
|
152
153
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
153
154
|
requestType: "json",
|
|
154
|
-
body: request,
|
|
155
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
155
156
|
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,
|
|
156
157
|
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,
|
|
157
158
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,7 +209,7 @@ class JobsClient {
|
|
|
208
209
|
contentType: "application/json",
|
|
209
210
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
210
211
|
requestType: "json",
|
|
211
|
-
body: request,
|
|
212
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
212
213
|
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,
|
|
213
214
|
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,
|
|
214
215
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -270,7 +271,7 @@ class JobsClient {
|
|
|
270
271
|
contentType: "application/json",
|
|
271
272
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
272
273
|
requestType: "json",
|
|
273
|
-
body: request,
|
|
274
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
274
275
|
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,
|
|
275
276
|
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,
|
|
276
277
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -415,6 +416,61 @@ class JobsClient {
|
|
|
415
416
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}");
|
|
416
417
|
});
|
|
417
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
|
|
421
|
+
*
|
|
422
|
+
* @param {CatchAllApi.GetJobResultsCsvRequest} request
|
|
423
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
424
|
+
*
|
|
425
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
426
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* await client.jobs.getJobResultsCsv({
|
|
430
|
+
* job_id: "job_id"
|
|
431
|
+
* })
|
|
432
|
+
*/
|
|
433
|
+
getJobResultsCsv(request, requestOptions) {
|
|
434
|
+
return core.HttpResponsePromise.fromPromise(this.__getJobResultsCsv(request, requestOptions));
|
|
435
|
+
}
|
|
436
|
+
__getJobResultsCsv(request, requestOptions) {
|
|
437
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
438
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
439
|
+
const { job_id: jobId } = request;
|
|
440
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
441
|
+
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);
|
|
442
|
+
const _response = yield core.fetcher({
|
|
443
|
+
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/pull/${core.url.encodePathParam(jobId)}/csv`),
|
|
444
|
+
method: "GET",
|
|
445
|
+
headers: _headers,
|
|
446
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
447
|
+
responseType: "text",
|
|
448
|
+
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,
|
|
449
|
+
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,
|
|
450
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
451
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
452
|
+
logging: this._options.logging,
|
|
453
|
+
});
|
|
454
|
+
if (_response.ok) {
|
|
455
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
456
|
+
}
|
|
457
|
+
if (_response.error.reason === "status-code") {
|
|
458
|
+
switch (_response.error.statusCode) {
|
|
459
|
+
case 403:
|
|
460
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
461
|
+
case 404:
|
|
462
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
463
|
+
default:
|
|
464
|
+
throw new errors.CatchAllApiError({
|
|
465
|
+
statusCode: _response.error.statusCode,
|
|
466
|
+
body: _response.error.body,
|
|
467
|
+
rawResponse: _response.rawResponse,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}/csv");
|
|
472
|
+
});
|
|
473
|
+
}
|
|
418
474
|
/**
|
|
419
475
|
* Continue an existing job to process more records beyond the initial limit.
|
|
420
476
|
*
|
|
@@ -446,7 +502,7 @@ class JobsClient {
|
|
|
446
502
|
contentType: "application/json",
|
|
447
503
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
448
504
|
requestType: "json",
|
|
449
|
-
body: request,
|
|
505
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
450
506
|
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,
|
|
451
507
|
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,
|
|
452
508
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* job_id: "job_id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface GetJobResultsCsvRequest {
|
|
8
|
+
/** Unique job identifier returned from [`POST /catchAll/submit`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/jobs/create-job). */
|
|
9
|
+
job_id: string;
|
|
10
|
+
}
|
|
@@ -20,6 +20,10 @@ export interface SubmitRequestDto {
|
|
|
20
20
|
* Custom validators for filtering web page clusters.
|
|
21
21
|
*
|
|
22
22
|
* If not provided, validators are generated automatically based on the query.
|
|
23
|
+
* The system may also inject validators during the `analyzing` stage — for
|
|
24
|
+
* example, converting a relative time qualifier into an explicit event-date
|
|
25
|
+
* gate. The returned `validators[]` in the job status shows the complete
|
|
26
|
+
* applied set, including any system-added ones.
|
|
23
27
|
*/
|
|
24
28
|
validators?: CatchAllApi.ValidatorSchema[];
|
|
25
29
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { ContinueRequestDto } from "./ContinueRequestDto.js";
|
|
2
2
|
export type { DeleteJobRequest } from "./DeleteJobRequest.js";
|
|
3
|
+
export type { GetJobResultsCsvRequest } from "./GetJobResultsCsvRequest.js";
|
|
3
4
|
export type { GetJobResultsRequest } from "./GetJobResultsRequest.js";
|
|
4
5
|
export type { GetJobStatusRequest } from "./GetJobStatusRequest.js";
|
|
5
6
|
export type { GetUserJobsRequest } from "./GetUserJobsRequest.js";
|
|
@@ -65,6 +65,22 @@ export declare class MonitorsClient {
|
|
|
65
65
|
*/
|
|
66
66
|
pullMonitorResults(request: CatchAllApi.PullMonitorResultsRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullMonitorResponseDto>;
|
|
67
67
|
private __pullMonitorResults;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the most recent run's records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
|
|
70
|
+
*
|
|
71
|
+
* @param {CatchAllApi.PullMonitorResultsCsvRequest} request
|
|
72
|
+
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
75
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.monitors.pullMonitorResultsCsv({
|
|
79
|
+
* monitor_id: "monitor_id"
|
|
80
|
+
* })
|
|
81
|
+
*/
|
|
82
|
+
pullMonitorResultsCsv(request: CatchAllApi.PullMonitorResultsCsvRequest, requestOptions?: MonitorsClient.RequestOptions): core.HttpResponsePromise<string>;
|
|
83
|
+
private __pullMonitorResultsCsv;
|
|
68
84
|
/**
|
|
69
85
|
* Return all jobs executed by a monitor.
|
|
70
86
|
*
|