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
|
@@ -58,6 +58,7 @@ exports.MonitorsClient = 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"));
|
|
@@ -167,7 +168,7 @@ class MonitorsClient {
|
|
|
167
168
|
contentType: "application/json",
|
|
168
169
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
169
170
|
requestType: "json",
|
|
170
|
-
body: request,
|
|
171
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
171
172
|
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,
|
|
172
173
|
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,
|
|
173
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -246,6 +247,61 @@ class MonitorsClient {
|
|
|
246
247
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}");
|
|
247
248
|
});
|
|
248
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* 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.
|
|
252
|
+
*
|
|
253
|
+
* @param {CatchAllApi.PullMonitorResultsCsvRequest} request
|
|
254
|
+
* @param {MonitorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
255
|
+
*
|
|
256
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
257
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* await client.monitors.pullMonitorResultsCsv({
|
|
261
|
+
* monitor_id: "monitor_id"
|
|
262
|
+
* })
|
|
263
|
+
*/
|
|
264
|
+
pullMonitorResultsCsv(request, requestOptions) {
|
|
265
|
+
return core.HttpResponsePromise.fromPromise(this.__pullMonitorResultsCsv(request, requestOptions));
|
|
266
|
+
}
|
|
267
|
+
__pullMonitorResultsCsv(request, requestOptions) {
|
|
268
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
269
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
270
|
+
const { monitor_id: monitorId } = request;
|
|
271
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
272
|
+
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);
|
|
273
|
+
const _response = yield core.fetcher({
|
|
274
|
+
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/pull/${core.url.encodePathParam(monitorId)}/csv`),
|
|
275
|
+
method: "GET",
|
|
276
|
+
headers: _headers,
|
|
277
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
278
|
+
responseType: "text",
|
|
279
|
+
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,
|
|
280
|
+
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,
|
|
281
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
282
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
283
|
+
logging: this._options.logging,
|
|
284
|
+
});
|
|
285
|
+
if (_response.ok) {
|
|
286
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
287
|
+
}
|
|
288
|
+
if (_response.error.reason === "status-code") {
|
|
289
|
+
switch (_response.error.statusCode) {
|
|
290
|
+
case 403:
|
|
291
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
292
|
+
case 404:
|
|
293
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
294
|
+
default:
|
|
295
|
+
throw new errors.CatchAllApiError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.body,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/monitors/pull/{monitor_id}/csv");
|
|
303
|
+
});
|
|
304
|
+
}
|
|
249
305
|
/**
|
|
250
306
|
* Return all jobs executed by a monitor.
|
|
251
307
|
*
|
|
@@ -396,7 +452,7 @@ class MonitorsClient {
|
|
|
396
452
|
contentType: "application/json",
|
|
397
453
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
398
454
|
requestType: "json",
|
|
399
|
-
body: _body,
|
|
455
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
400
456
|
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,
|
|
401
457
|
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,
|
|
402
458
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -575,7 +631,7 @@ class MonitorsClient {
|
|
|
575
631
|
contentType: "application/json",
|
|
576
632
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
577
633
|
requestType: "json",
|
|
578
|
-
body: _body,
|
|
634
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
579
635
|
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,
|
|
580
636
|
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,
|
|
581
637
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -5,5 +5,6 @@ export type { EnableMonitorRequestDto } from "./EnableMonitorRequestDto.js";
|
|
|
5
5
|
export type { GetMonitorStatusHistoryRequest } from "./GetMonitorStatusHistoryRequest.js";
|
|
6
6
|
export type { ListMonitorJobsRequest } from "./ListMonitorJobsRequest.js";
|
|
7
7
|
export type { ListMonitorsRequest } from "./ListMonitorsRequest.js";
|
|
8
|
+
export type { PullMonitorResultsCsvRequest } from "./PullMonitorResultsCsvRequest.js";
|
|
8
9
|
export type { PullMonitorResultsRequest } from "./PullMonitorResultsRequest.js";
|
|
9
10
|
export type { UpdateMonitorRequestDto } from "./UpdateMonitorRequestDto.js";
|
|
@@ -58,6 +58,7 @@ exports.ProjectsClient = 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"));
|
|
@@ -167,7 +168,7 @@ class ProjectsClient {
|
|
|
167
168
|
contentType: "application/json",
|
|
168
169
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
169
170
|
requestType: "json",
|
|
170
|
-
body: request,
|
|
171
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
171
172
|
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,
|
|
172
173
|
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,
|
|
173
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -341,7 +342,7 @@ class ProjectsClient {
|
|
|
341
342
|
contentType: "application/json",
|
|
342
343
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
343
344
|
requestType: "json",
|
|
344
|
-
body: _body,
|
|
345
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
345
346
|
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,
|
|
346
347
|
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,
|
|
347
348
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -533,7 +534,7 @@ class ProjectsClient {
|
|
|
533
534
|
contentType: "application/json",
|
|
534
535
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
535
536
|
requestType: "json",
|
|
536
|
-
body: _body,
|
|
537
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
537
538
|
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,
|
|
538
539
|
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,
|
|
539
540
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,6 +208,31 @@ export declare class WebhooksClient {
|
|
|
208
208
|
*/
|
|
209
209
|
listWebhooksForResource(request: CatchAllApi.ListWebhooksForResourceRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ListWebhooksResponseDto>;
|
|
210
210
|
private __listWebhooksForResource;
|
|
211
|
+
/**
|
|
212
|
+
* Manually dispatches a webhook delivery for a resource on demand, without
|
|
213
|
+
* waiting for the next job or monitor cycle.
|
|
214
|
+
*
|
|
215
|
+
* Use this to re-deliver results after a failed delivery, replay a specific
|
|
216
|
+
* job's results, or validate a webhook against live data. The webhook must
|
|
217
|
+
* already be assigned to the resource.
|
|
218
|
+
*
|
|
219
|
+
* @param {CatchAllApi.TriggerWebhookRequest} request
|
|
220
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
221
|
+
*
|
|
222
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
223
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
224
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* await client.webhooks.triggerWebhook({
|
|
228
|
+
* resource_type: "job",
|
|
229
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4",
|
|
230
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
231
|
+
* job_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
232
|
+
* })
|
|
233
|
+
*/
|
|
234
|
+
triggerWebhook(request: CatchAllApi.TriggerWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
235
|
+
private __triggerWebhook;
|
|
211
236
|
/**
|
|
212
237
|
* Returns a paginated delivery log for a given resource, ordered by timestamp descending.
|
|
213
238
|
*
|
|
@@ -58,6 +58,7 @@ exports.WebhooksClient = 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"));
|
|
@@ -168,7 +169,7 @@ class WebhooksClient {
|
|
|
168
169
|
contentType: "application/json",
|
|
169
170
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
170
171
|
requestType: "json",
|
|
171
|
-
body: request,
|
|
172
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
172
173
|
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,
|
|
173
174
|
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,
|
|
174
175
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -341,7 +342,7 @@ class WebhooksClient {
|
|
|
341
342
|
contentType: "application/json",
|
|
342
343
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
343
344
|
requestType: "json",
|
|
344
|
-
body: _body,
|
|
345
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
345
346
|
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,
|
|
346
347
|
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,
|
|
347
348
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -407,7 +408,7 @@ class WebhooksClient {
|
|
|
407
408
|
contentType: "application/json",
|
|
408
409
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
409
410
|
requestType: "json",
|
|
410
|
-
body: _body,
|
|
411
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
411
412
|
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
413
|
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
414
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -543,7 +544,7 @@ class WebhooksClient {
|
|
|
543
544
|
contentType: "application/json",
|
|
544
545
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
545
546
|
requestType: "json",
|
|
546
|
-
body: _body,
|
|
547
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
547
548
|
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,
|
|
548
549
|
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,
|
|
549
550
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -702,6 +703,79 @@ class WebhooksClient {
|
|
|
702
703
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/resources/{resource_type}/{resource_id}/webhooks");
|
|
703
704
|
});
|
|
704
705
|
}
|
|
706
|
+
/**
|
|
707
|
+
* Manually dispatches a webhook delivery for a resource on demand, without
|
|
708
|
+
* waiting for the next job or monitor cycle.
|
|
709
|
+
*
|
|
710
|
+
* Use this to re-deliver results after a failed delivery, replay a specific
|
|
711
|
+
* job's results, or validate a webhook against live data. The webhook must
|
|
712
|
+
* already be assigned to the resource.
|
|
713
|
+
*
|
|
714
|
+
* @param {CatchAllApi.TriggerWebhookRequest} request
|
|
715
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
716
|
+
*
|
|
717
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
718
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
719
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* await client.webhooks.triggerWebhook({
|
|
723
|
+
* resource_type: "job",
|
|
724
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4",
|
|
725
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
726
|
+
* job_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
727
|
+
* })
|
|
728
|
+
*/
|
|
729
|
+
triggerWebhook(request, requestOptions) {
|
|
730
|
+
return core.HttpResponsePromise.fromPromise(this.__triggerWebhook(request, requestOptions));
|
|
731
|
+
}
|
|
732
|
+
__triggerWebhook(request, requestOptions) {
|
|
733
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
734
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
735
|
+
const { resource_type: resourceType, resource_id: resourceId, webhook_id: webhookId, job_id: jobId } = request;
|
|
736
|
+
const _queryParams = {
|
|
737
|
+
webhook_id: webhookId,
|
|
738
|
+
job_id: jobId,
|
|
739
|
+
};
|
|
740
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
741
|
+
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);
|
|
742
|
+
const _response = yield core.fetcher({
|
|
743
|
+
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/webhook/trigger/${core.url.encodePathParam(resourceType)}/${core.url.encodePathParam(resourceId)}`),
|
|
744
|
+
method: "POST",
|
|
745
|
+
headers: _headers,
|
|
746
|
+
queryString: core.url
|
|
747
|
+
.queryBuilder()
|
|
748
|
+
.addMany(_queryParams)
|
|
749
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
750
|
+
.build(),
|
|
751
|
+
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,
|
|
752
|
+
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,
|
|
753
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
754
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
755
|
+
logging: this._options.logging,
|
|
756
|
+
});
|
|
757
|
+
if (_response.ok) {
|
|
758
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
759
|
+
}
|
|
760
|
+
if (_response.error.reason === "status-code") {
|
|
761
|
+
switch (_response.error.statusCode) {
|
|
762
|
+
case 403:
|
|
763
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
764
|
+
case 404:
|
|
765
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
766
|
+
case 422:
|
|
767
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
768
|
+
default:
|
|
769
|
+
throw new errors.CatchAllApiError({
|
|
770
|
+
statusCode: _response.error.statusCode,
|
|
771
|
+
body: _response.error.body,
|
|
772
|
+
rawResponse: _response.rawResponse,
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/webhook/trigger/{resource_type}/{resource_id}");
|
|
777
|
+
});
|
|
778
|
+
}
|
|
705
779
|
/**
|
|
706
780
|
* Returns a paginated delivery log for a given resource, ordered by timestamp descending.
|
|
707
781
|
*
|
|
@@ -37,6 +37,6 @@ export interface CreateWebhookRequestDto {
|
|
|
37
37
|
* - `basic`: Adds an `Authorization: Basic <credentials>` header.
|
|
38
38
|
*/
|
|
39
39
|
auth?: CatchAllApi.CreateWebhookRequestDtoAuth;
|
|
40
|
-
/** Custom payload
|
|
41
|
-
formatter_config?:
|
|
40
|
+
/** Custom payload formatter. Required when `type` is `custom`. */
|
|
41
|
+
formatter_config?: CatchAllApi.FormatterConfigDto | null;
|
|
42
42
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* resource_type: "job",
|
|
6
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4",
|
|
7
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
8
|
+
* job_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface TriggerWebhookRequest {
|
|
12
|
+
resource_type: CatchAllApi.MappableResourceType;
|
|
13
|
+
/** Unique resource identifier. */
|
|
14
|
+
resource_id: string;
|
|
15
|
+
/** Identifier of the webhook to trigger. Must be assigned to the resource. */
|
|
16
|
+
webhook_id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Specific job run to deliver. Optional for `job` resources; for
|
|
19
|
+
* `monitor` and `monitor_group` resources, selects a past run to replay.
|
|
20
|
+
* When omitted, the latest available results are delivered.
|
|
21
|
+
*/
|
|
22
|
+
job_id?: string;
|
|
23
|
+
}
|
|
@@ -23,8 +23,8 @@ export interface UpdateWebhookRequestDto {
|
|
|
23
23
|
params?: Record<string, string>;
|
|
24
24
|
/** Updated authentication configuration. Replaces existing auth entirely. */
|
|
25
25
|
auth?: CatchAllApi.UpdateWebhookRequestDtoAuth;
|
|
26
|
-
/** Updated formatter
|
|
27
|
-
formatter_config?:
|
|
26
|
+
/** Updated custom payload formatter. Set only when `type` is `custom`. */
|
|
27
|
+
formatter_config?: CatchAllApi.FormatterConfigDto | null;
|
|
28
28
|
/** Set to `false` to disable delivery without deleting the webhook. */
|
|
29
29
|
is_active?: boolean;
|
|
30
30
|
}
|
|
@@ -8,4 +8,5 @@ export type { ListWebhooksForResourceRequest } from "./ListWebhooksForResourceRe
|
|
|
8
8
|
export type { ListWebhooksRequest } from "./ListWebhooksRequest.js";
|
|
9
9
|
export type { RemoveWebhookResourceRequest } from "./RemoveWebhookResourceRequest.js";
|
|
10
10
|
export type { TestWebhookRequestDto } from "./TestWebhookRequestDto.js";
|
|
11
|
+
export type { TriggerWebhookRequest } from "./TriggerWebhookRequest.js";
|
|
11
12
|
export type { UpdateWebhookRequestDto } from "./UpdateWebhookRequestDto.js";
|
|
@@ -8,8 +8,6 @@ export interface CompanyAttributes {
|
|
|
8
8
|
* The most reliable identifier — strongly recommended when available.
|
|
9
9
|
*/
|
|
10
10
|
domain?: (string | null) | undefined;
|
|
11
|
-
/** Detailed description of the company used for matching. */
|
|
12
|
-
description?: (string | null) | undefined;
|
|
13
11
|
/** Names of key people associated with the company (founders, executives, etc.). Improves matching for articles that mention people rather than the company name. */
|
|
14
12
|
key_persons?: (string[] | null) | undefined;
|
|
15
13
|
/** Alternative names, abbreviations, or aliases. Helps resolve common variations of the company name. */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A dataset used to narrow the retrieval scope of a job or monitor, returned with its identifier and name.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConnectedDataset {
|
|
5
|
+
/** Dataset identifier. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Dataset name as stored. Check `is_deleted` to determine whether the dataset is still active. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** True when the dataset has been deleted. */
|
|
10
|
+
is_deleted?: boolean | undefined;
|
|
11
|
+
}
|
|
@@ -26,6 +26,8 @@ export interface ConnectedEntity {
|
|
|
26
26
|
association_type?: string | undefined;
|
|
27
27
|
/** The entity type. */
|
|
28
28
|
type: string;
|
|
29
|
+
/** External identifier for this entity. Null when not set. */
|
|
30
|
+
external_entity_id?: (string | null) | undefined;
|
|
29
31
|
/**
|
|
30
32
|
* The stored attributes for this entity. Present only when attributes exist in the database.
|
|
31
33
|
*
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type * as CatchAllApi from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Request body for creating a single entity.
|
|
3
|
+
* Request body for creating a single entity. The `name` field is required.
|
|
4
|
+
* You must also provide at least one of: a top-level `description` or a `domain`
|
|
5
|
+
* inside `additional_attributes.company_attributes`.
|
|
4
6
|
* The more fields you provide, the better the matching quality.
|
|
5
7
|
*/
|
|
6
8
|
export interface CreateEntityRequest {
|
|
7
9
|
/** The company or person name. Required and must be non-empty. */
|
|
8
10
|
name: string;
|
|
9
11
|
entity_type?: CatchAllApi.EntityType | undefined;
|
|
10
|
-
/** Free-text description of the entity used for disambiguation when similar names exist. */
|
|
12
|
+
/** Free-text description of the entity used for disambiguation when similar names exist. See [Writing effective descriptions](https://www.newscatcherapi.com/docs/web-search-api/concepts/company-search#writing-effective-descriptions) for guidance on improving matching quality. */
|
|
11
13
|
description?: string | undefined;
|
|
14
|
+
/** Optional external identifier for this entity. Free-form string, not enforced as unique. Use it to store your own CRM, data warehouse, or internal database ID so you can join CatchAll results back to your systems. */
|
|
15
|
+
external_entity_id?: string | undefined;
|
|
12
16
|
additional_attributes?: CatchAllApi.AdditionalAttributes | undefined;
|
|
13
17
|
}
|
|
@@ -10,6 +10,21 @@ export interface DatasetResponse {
|
|
|
10
10
|
description?: (string | null) | undefined;
|
|
11
11
|
/** Total number of entities in this dataset. */
|
|
12
12
|
entity_count?: number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Count of entities grouped by processing status. Keys are status values
|
|
15
|
+
* (`ready`, `pending`, `enriching`, `failed`); values are entity counts.
|
|
16
|
+
*/
|
|
17
|
+
entity_status_breakdown?: Record<string, number> | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Overall health score of the dataset, from 0 to 100. Reflects how many
|
|
20
|
+
* entities have sufficient identifying information for reliable matching.
|
|
21
|
+
*/
|
|
22
|
+
health_score?: number | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Health scores broken down by entity type. Keys are entity types
|
|
25
|
+
* (e.g. `company`); values are scores from 0 to 100.
|
|
26
|
+
*/
|
|
27
|
+
health_breakdown?: Record<string, number> | undefined;
|
|
13
28
|
latest_status?: CatchAllApi.DatasetStatus | undefined;
|
|
14
29
|
/** ID of the user who created this dataset. */
|
|
15
30
|
created_by_user_id?: string | undefined;
|
|
@@ -9,6 +9,8 @@ export interface EntityResponse {
|
|
|
9
9
|
name: string;
|
|
10
10
|
/** Free-text description. */
|
|
11
11
|
description?: (string | null) | undefined;
|
|
12
|
+
/** External identifier for this entity. Null when not set. */
|
|
13
|
+
external_entity_id?: (string | null) | undefined;
|
|
12
14
|
additional_attributes?: CatchAllApi.AdditionalAttributes | undefined;
|
|
13
15
|
status: CatchAllApi.EntityStatus;
|
|
14
16
|
/** ID of the user who created this entity. */
|
|
@@ -14,5 +14,7 @@ export interface EntitySummary {
|
|
|
14
14
|
status: CatchAllApi.EntityStatus;
|
|
15
15
|
/** Free-text description. */
|
|
16
16
|
description?: (string | null) | undefined;
|
|
17
|
+
/** External identifier for this entity. Null when not set. */
|
|
18
|
+
external_entity_id?: (string | null) | undefined;
|
|
17
19
|
attributes?: CatchAllApi.CompanyAttributes | undefined;
|
|
18
20
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom payload formatter for `custom` webhooks. A Liquid template is
|
|
3
|
+
* rendered at dispatch time to build a fully tailored request body — trim or
|
|
4
|
+
* rename fields, apply conditional logic, or emit non-JSON formats.
|
|
5
|
+
*/
|
|
6
|
+
export interface FormatterConfigDto {
|
|
7
|
+
/** Liquid template string rendered at dispatch time. Maximum 10 KB. */
|
|
8
|
+
template: string;
|
|
9
|
+
/**
|
|
10
|
+
* Content-Type of the rendered output. Supported values: `application/json`,
|
|
11
|
+
* `application/ld+json`, `text/html`, `text/plain`, `text/xml`,
|
|
12
|
+
* `application/xml`, `text/csv`.
|
|
13
|
+
*/
|
|
14
|
+
content_type?: string | undefined;
|
|
15
|
+
}
|
|
@@ -4,7 +4,12 @@ export interface InitializeResponseDto {
|
|
|
4
4
|
query: string;
|
|
5
5
|
/** Echo of the context from the request. Null if not provided. */
|
|
6
6
|
context?: (string | null) | undefined;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Suggested validators for filtering relevant web pages. When the job is
|
|
9
|
+
* submitted, the system may inject additional validators during the `analyzing`
|
|
10
|
+
* stage — check the returned `validators[]` in the job status to see the
|
|
11
|
+
* complete applied set.
|
|
12
|
+
*/
|
|
8
13
|
validators: CatchAllApi.ValidatorSchema[];
|
|
9
14
|
/** Suggested enrichment fields for data extraction. */
|
|
10
15
|
enrichments: CatchAllApi.EnrichmentSchema[];
|
|
@@ -37,6 +37,10 @@ export interface PullJobResponseDto {
|
|
|
37
37
|
total_pages?: number | undefined;
|
|
38
38
|
/** Processing mode used for this job. */
|
|
39
39
|
mode?: PullJobResponseDto.Mode | undefined;
|
|
40
|
+
/** Datasets used to narrow retrieval scope, each with `id` and `name`. */
|
|
41
|
+
connected_datasets?: CatchAllApi.ConnectedDataset[] | undefined;
|
|
42
|
+
/** True when the query was submitted as an all-news (watchlist-generic) query. */
|
|
43
|
+
is_all_news_query?: boolean | undefined;
|
|
40
44
|
/** Present when the job was shared with the authenticated user by another organization member. `null` when the user owns the job. */
|
|
41
45
|
sharing_info?: (CatchAllApi.SharingInfo | null) | undefined;
|
|
42
46
|
/** Array of extracted records with structured data and citations. */
|
|
@@ -21,6 +21,10 @@ export interface PullMonitorResponseDto {
|
|
|
21
21
|
all_records?: CatchAllApi.MonitorRecord[] | undefined;
|
|
22
22
|
/** Record limit applied to this monitor's jobs. */
|
|
23
23
|
limit?: (number | null) | undefined;
|
|
24
|
+
/** Datasets used to narrow retrieval scope, each with `id` and `name`. */
|
|
25
|
+
connected_datasets?: CatchAllApi.ConnectedDataset[] | undefined;
|
|
26
|
+
/** True when the reference job was submitted as an all-news (watchlist-generic) query. */
|
|
27
|
+
is_all_news_query?: boolean | undefined;
|
|
24
28
|
}
|
|
25
29
|
export declare namespace PullMonitorResponseDto {
|
|
26
30
|
/**
|
|
@@ -13,8 +13,8 @@ export interface WebhookResponseDto {
|
|
|
13
13
|
headers?: Record<string, string> | undefined;
|
|
14
14
|
/** Query parameters appended to the webhook URL. */
|
|
15
15
|
params?: Record<string, string> | undefined;
|
|
16
|
-
/** Custom payload
|
|
17
|
-
formatter_config?: (
|
|
16
|
+
/** Custom payload formatter. Set only when `type` is `custom`. */
|
|
17
|
+
formatter_config?: (CatchAllApi.FormatterConfigDto | null) | undefined;
|
|
18
18
|
/** True if the webhook is active; false otherwise. */
|
|
19
19
|
is_active: boolean;
|
|
20
20
|
/** Organization that owns this webhook. */
|
|
@@ -8,6 +8,7 @@ export * from "./BearerAuthDto.js";
|
|
|
8
8
|
export * from "./Citation.js";
|
|
9
9
|
export * from "./CompanyAttributes.js";
|
|
10
10
|
export * from "./CompanyEnrichmentOutput.js";
|
|
11
|
+
export * from "./ConnectedDataset.js";
|
|
11
12
|
export * from "./ConnectedEntity.js";
|
|
12
13
|
export * from "./Context.js";
|
|
13
14
|
export * from "./ContinueResponseDto.js";
|
|
@@ -44,6 +45,7 @@ export * from "./EntitySummary.js";
|
|
|
44
45
|
export * from "./EntityType.js";
|
|
45
46
|
export * from "./EntityValidationErrorBody.js";
|
|
46
47
|
export * from "./Error_.js";
|
|
48
|
+
export * from "./FormatterConfigDto.js";
|
|
47
49
|
export * from "./GetPlanLimitsResponseDto.js";
|
|
48
50
|
export * from "./GetWebhookResponseDto.js";
|
|
49
51
|
export * from "./HttpMethod.js";
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./BearerAuthDto.js"), exports);
|
|
|
24
24
|
__exportStar(require("./Citation.js"), exports);
|
|
25
25
|
__exportStar(require("./CompanyAttributes.js"), exports);
|
|
26
26
|
__exportStar(require("./CompanyEnrichmentOutput.js"), exports);
|
|
27
|
+
__exportStar(require("./ConnectedDataset.js"), exports);
|
|
27
28
|
__exportStar(require("./ConnectedEntity.js"), exports);
|
|
28
29
|
__exportStar(require("./Context.js"), exports);
|
|
29
30
|
__exportStar(require("./ContinueResponseDto.js"), exports);
|
|
@@ -60,6 +61,7 @@ __exportStar(require("./EntitySummary.js"), exports);
|
|
|
60
61
|
__exportStar(require("./EntityType.js"), exports);
|
|
61
62
|
__exportStar(require("./EntityValidationErrorBody.js"), exports);
|
|
62
63
|
__exportStar(require("./Error_.js"), exports);
|
|
64
|
+
__exportStar(require("./FormatterConfigDto.js"), exports);
|
|
63
65
|
__exportStar(require("./GetPlanLimitsResponseDto.js"), exports);
|
|
64
66
|
__exportStar(require("./GetWebhookResponseDto.js"), exports);
|
|
65
67
|
__exportStar(require("./HttpMethod.js"), exports);
|
|
@@ -78,6 +78,9 @@ function toMultipartDataPart(file) {
|
|
|
78
78
|
function getFileWithMetadata(file_1) {
|
|
79
79
|
return __awaiter(this, arguments, void 0, function* (file, { noSniffFileSize } = {}) {
|
|
80
80
|
var _a, _b, _c, _d, _e;
|
|
81
|
+
if (file == null) {
|
|
82
|
+
throw new Error(`Expected file to be a Blob, Buffer, ReadableStream, or an object with a "path" or "data" property, but received ${file === null ? "null" : "undefined"}.`);
|
|
83
|
+
}
|
|
81
84
|
if (isFileLike(file)) {
|
|
82
85
|
return getFileWithMetadata({
|
|
83
86
|
data: file,
|
|
@@ -73,6 +73,9 @@ class FormDataWrapper {
|
|
|
73
73
|
}
|
|
74
74
|
appendFile(key, value) {
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
throw new Error(`File upload for "${key}" received ${value === null ? "null" : "undefined"}. The generated code should not call appendFile with null/undefined — check that optional file fields are guarded before this call.`);
|
|
78
|
+
}
|
|
76
79
|
const { data, filename, contentType } = yield (0, index_js_1.toMultipartDataPart)(value);
|
|
77
80
|
const blob = yield convertToBlob(data, contentType);
|
|
78
81
|
if (filename) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
|
|
3
|
+
* on top of the request body. Caller-supplied properties win over the endpoint body. When no
|
|
4
|
+
* additional body parameters are provided, the original body is returned unchanged so serialization
|
|
5
|
+
* is unaffected.
|
|
6
|
+
*
|
|
7
|
+
* The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
|
|
8
|
+
* the additional parameters become the body; when the body is an array or a primitive JSON value it
|
|
9
|
+
* is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
|
|
10
|
+
* SDK, which only merges additional body parameters into mapping bodies.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeAdditionalBodyParameters(body: unknown, additionalBodyParameters: Record<string, unknown> | undefined): unknown;
|