newscatcher-catchall-sdk 4.0.0 → 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 +1 -0
- package/dist/cjs/BaseClient.d.ts +12 -0
- package/dist/cjs/BaseClient.js +2 -2
- 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 +1 -1
- package/dist/cjs/api/resources/jobs/client/Client.js +5 -4
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +4 -0
- package/dist/cjs/api/resources/monitors/client/Client.js +4 -3
- 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/CreateEntityRequest.d.ts +4 -2
- package/dist/cjs/api/types/DatasetResponse.d.ts +15 -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/WebhookResponseDto.d.ts +2 -2
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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 +4 -0
- package/dist/cjs/errors/CatchAllApiTimeoutError.d.ts +2 -2
- package/dist/cjs/errors/CatchAllApiTimeoutError.js +39 -5
- 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/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 +1 -1
- package/dist/esm/api/resources/jobs/client/Client.mjs +5 -4
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +4 -0
- package/dist/esm/api/resources/monitors/client/Client.mjs +4 -3
- 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/CreateEntityRequest.d.mts +4 -2
- package/dist/esm/api/types/DatasetResponse.d.mts +15 -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/WebhookResponseDto.d.mts +2 -2
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -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 +4 -0
- package/dist/esm/errors/CatchAllApiTimeoutError.d.mts +2 -2
- package/dist/esm/errors/CatchAllApiTimeoutError.mjs +6 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +86 -9
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
23
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
25
26
|
import * as environments from "../../../../environments.mjs";
|
|
26
27
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
28
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -104,10 +105,10 @@ export class EntitiesClient {
|
|
|
104
105
|
/**
|
|
105
106
|
* Creates a new company entity and begins background enrichment.
|
|
106
107
|
*
|
|
108
|
+
* 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.
|
|
109
|
+
*
|
|
107
110
|
* The entity status starts as `pending` and transitions to `ready` once
|
|
108
|
-
* enrichment completes.
|
|
109
|
-
* possible — `domain` is the highest-signal field because it is
|
|
110
|
-
* unambiguous.
|
|
111
|
+
* enrichment completes.
|
|
111
112
|
*
|
|
112
113
|
* @param {CatchAllApi.CreateEntityRequest} request
|
|
113
114
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -119,12 +120,12 @@ export class EntitiesClient {
|
|
|
119
120
|
* await client.entities.createEntity({
|
|
120
121
|
* name: "NewsCatcher",
|
|
121
122
|
* entity_type: "company",
|
|
122
|
-
* description: "
|
|
123
|
+
* 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).",
|
|
123
124
|
* additional_attributes: {
|
|
124
125
|
* company_attributes: {
|
|
125
126
|
* domain: "newscatcherapi.com",
|
|
126
127
|
* key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
|
|
127
|
-
* alternative_names: ["
|
|
128
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
|
|
128
129
|
* }
|
|
129
130
|
* }
|
|
130
131
|
* })
|
|
@@ -144,7 +145,7 @@ export class EntitiesClient {
|
|
|
144
145
|
contentType: "application/json",
|
|
145
146
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
146
147
|
requestType: "json",
|
|
147
|
-
body: request,
|
|
148
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
148
149
|
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,
|
|
149
150
|
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,
|
|
150
151
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -174,6 +175,8 @@ export class EntitiesClient {
|
|
|
174
175
|
/**
|
|
175
176
|
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
176
177
|
*
|
|
178
|
+
* 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.
|
|
179
|
+
*
|
|
177
180
|
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
178
181
|
*
|
|
179
182
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
@@ -223,7 +226,7 @@ export class EntitiesClient {
|
|
|
223
226
|
contentType: "application/json",
|
|
224
227
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
225
228
|
requestType: "json",
|
|
226
|
-
body: request,
|
|
229
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
227
230
|
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,
|
|
228
231
|
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,
|
|
229
232
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -378,7 +381,7 @@ export class EntitiesClient {
|
|
|
378
381
|
* description: "Updated description",
|
|
379
382
|
* additional_attributes: {
|
|
380
383
|
* company_attributes: {
|
|
381
|
-
* alternative_names: ["
|
|
384
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
382
385
|
* }
|
|
383
386
|
* }
|
|
384
387
|
* })
|
|
@@ -399,7 +402,7 @@ export class EntitiesClient {
|
|
|
399
402
|
contentType: "application/json",
|
|
400
403
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
401
404
|
requestType: "json",
|
|
402
|
-
body: _body,
|
|
405
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
403
406
|
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,
|
|
404
407
|
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,
|
|
405
408
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,7 +6,7 @@ import type * as CatchAllApi from "../../../../index.mjs";
|
|
|
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
|
* }
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
14
15
|
import * as environments from "../../../../environments.mjs";
|
|
15
16
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -115,7 +116,7 @@ export class JobsClient {
|
|
|
115
116
|
contentType: "application/json",
|
|
116
117
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
117
118
|
requestType: "json",
|
|
118
|
-
body: request,
|
|
119
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
119
120
|
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,
|
|
120
121
|
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,
|
|
121
122
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -172,7 +173,7 @@ export class JobsClient {
|
|
|
172
173
|
contentType: "application/json",
|
|
173
174
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
174
175
|
requestType: "json",
|
|
175
|
-
body: request,
|
|
176
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
176
177
|
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,
|
|
177
178
|
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,
|
|
178
179
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -234,7 +235,7 @@ export class JobsClient {
|
|
|
234
235
|
contentType: "application/json",
|
|
235
236
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
236
237
|
requestType: "json",
|
|
237
|
-
body: request,
|
|
238
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
238
239
|
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,
|
|
239
240
|
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,
|
|
240
241
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -465,7 +466,7 @@ export class JobsClient {
|
|
|
465
466
|
contentType: "application/json",
|
|
466
467
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
467
468
|
requestType: "json",
|
|
468
|
-
body: request,
|
|
469
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
469
470
|
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,
|
|
470
471
|
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,
|
|
471
472
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -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
|
/**
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
23
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
25
26
|
import * as environments from "../../../../environments.mjs";
|
|
26
27
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
28
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -131,7 +132,7 @@ export class MonitorsClient {
|
|
|
131
132
|
contentType: "application/json",
|
|
132
133
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
133
134
|
requestType: "json",
|
|
134
|
-
body: request,
|
|
135
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
135
136
|
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,
|
|
136
137
|
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,
|
|
137
138
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -415,7 +416,7 @@ export class MonitorsClient {
|
|
|
415
416
|
contentType: "application/json",
|
|
416
417
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
417
418
|
requestType: "json",
|
|
418
|
-
body: _body,
|
|
419
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
419
420
|
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,
|
|
420
421
|
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,
|
|
421
422
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -594,7 +595,7 @@ export class MonitorsClient {
|
|
|
594
595
|
contentType: "application/json",
|
|
595
596
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
596
597
|
requestType: "json",
|
|
597
|
-
body: _body,
|
|
598
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
598
599
|
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,
|
|
599
600
|
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,
|
|
600
601
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
23
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
25
26
|
import * as environments from "../../../../environments.mjs";
|
|
26
27
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
28
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -131,7 +132,7 @@ export class ProjectsClient {
|
|
|
131
132
|
contentType: "application/json",
|
|
132
133
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
133
134
|
requestType: "json",
|
|
134
|
-
body: request,
|
|
135
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
135
136
|
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,
|
|
136
137
|
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,
|
|
137
138
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -305,7 +306,7 @@ export class ProjectsClient {
|
|
|
305
306
|
contentType: "application/json",
|
|
306
307
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
307
308
|
requestType: "json",
|
|
308
|
-
body: _body,
|
|
309
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
309
310
|
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,
|
|
310
311
|
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,
|
|
311
312
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -497,7 +498,7 @@ export class ProjectsClient {
|
|
|
497
498
|
contentType: "application/json",
|
|
498
499
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
499
500
|
requestType: "json",
|
|
500
|
-
body: _body,
|
|
501
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
501
502
|
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,
|
|
502
503
|
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,
|
|
503
504
|
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
|
*
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
23
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
25
26
|
import * as environments from "../../../../environments.mjs";
|
|
26
27
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
28
|
import * as errors from "../../../../errors/index.mjs";
|
|
@@ -132,7 +133,7 @@ export class WebhooksClient {
|
|
|
132
133
|
contentType: "application/json",
|
|
133
134
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
134
135
|
requestType: "json",
|
|
135
|
-
body: request,
|
|
136
|
+
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
136
137
|
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,
|
|
137
138
|
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,
|
|
138
139
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -305,7 +306,7 @@ export class WebhooksClient {
|
|
|
305
306
|
contentType: "application/json",
|
|
306
307
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
307
308
|
requestType: "json",
|
|
308
|
-
body: _body,
|
|
309
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
309
310
|
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,
|
|
310
311
|
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,
|
|
311
312
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -371,7 +372,7 @@ export class WebhooksClient {
|
|
|
371
372
|
contentType: "application/json",
|
|
372
373
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
373
374
|
requestType: "json",
|
|
374
|
-
body: _body,
|
|
375
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
375
376
|
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,
|
|
376
377
|
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,
|
|
377
378
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -507,7 +508,7 @@ export class WebhooksClient {
|
|
|
507
508
|
contentType: "application/json",
|
|
508
509
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
509
510
|
requestType: "json",
|
|
510
|
-
body: _body,
|
|
511
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
511
512
|
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,
|
|
512
513
|
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,
|
|
513
514
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -666,6 +667,79 @@ export class WebhooksClient {
|
|
|
666
667
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/resources/{resource_type}/{resource_id}/webhooks");
|
|
667
668
|
});
|
|
668
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Manually dispatches a webhook delivery for a resource on demand, without
|
|
672
|
+
* waiting for the next job or monitor cycle.
|
|
673
|
+
*
|
|
674
|
+
* Use this to re-deliver results after a failed delivery, replay a specific
|
|
675
|
+
* job's results, or validate a webhook against live data. The webhook must
|
|
676
|
+
* already be assigned to the resource.
|
|
677
|
+
*
|
|
678
|
+
* @param {CatchAllApi.TriggerWebhookRequest} request
|
|
679
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
680
|
+
*
|
|
681
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
682
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
683
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* await client.webhooks.triggerWebhook({
|
|
687
|
+
* resource_type: "job",
|
|
688
|
+
* resource_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4",
|
|
689
|
+
* webhook_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
690
|
+
* job_id: "3fec5b07-8786-46d7-9486-d43ff67eccd4"
|
|
691
|
+
* })
|
|
692
|
+
*/
|
|
693
|
+
triggerWebhook(request, requestOptions) {
|
|
694
|
+
return core.HttpResponsePromise.fromPromise(this.__triggerWebhook(request, requestOptions));
|
|
695
|
+
}
|
|
696
|
+
__triggerWebhook(request, requestOptions) {
|
|
697
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
698
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
699
|
+
const { resource_type: resourceType, resource_id: resourceId, webhook_id: webhookId, job_id: jobId } = request;
|
|
700
|
+
const _queryParams = {
|
|
701
|
+
webhook_id: webhookId,
|
|
702
|
+
job_id: jobId,
|
|
703
|
+
};
|
|
704
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
705
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
706
|
+
const _response = yield core.fetcher({
|
|
707
|
+
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)}`),
|
|
708
|
+
method: "POST",
|
|
709
|
+
headers: _headers,
|
|
710
|
+
queryString: core.url
|
|
711
|
+
.queryBuilder()
|
|
712
|
+
.addMany(_queryParams)
|
|
713
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
714
|
+
.build(),
|
|
715
|
+
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,
|
|
716
|
+
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,
|
|
717
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
718
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
719
|
+
logging: this._options.logging,
|
|
720
|
+
});
|
|
721
|
+
if (_response.ok) {
|
|
722
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
723
|
+
}
|
|
724
|
+
if (_response.error.reason === "status-code") {
|
|
725
|
+
switch (_response.error.statusCode) {
|
|
726
|
+
case 403:
|
|
727
|
+
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
728
|
+
case 404:
|
|
729
|
+
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
730
|
+
case 422:
|
|
731
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
732
|
+
default:
|
|
733
|
+
throw new errors.CatchAllApiError({
|
|
734
|
+
statusCode: _response.error.statusCode,
|
|
735
|
+
body: _response.error.body,
|
|
736
|
+
rawResponse: _response.rawResponse,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/webhook/trigger/{resource_type}/{resource_id}");
|
|
741
|
+
});
|
|
742
|
+
}
|
|
669
743
|
/**
|
|
670
744
|
* Returns a paginated delivery log for a given resource, ordered by timestamp descending.
|
|
671
745
|
*
|
|
@@ -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.mjs";
|
|
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.mjs";
|
|
9
9
|
export type { RemoveWebhookResourceRequest } from "./RemoveWebhookResourceRequest.mjs";
|
|
10
10
|
export type { TestWebhookRequestDto } from "./TestWebhookRequestDto.mjs";
|
|
11
|
+
export type { TriggerWebhookRequest } from "./TriggerWebhookRequest.mjs";
|
|
11
12
|
export type { UpdateWebhookRequestDto } from "./UpdateWebhookRequestDto.mjs";
|
|
@@ -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. */
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type * as CatchAllApi from "../index.mjs";
|
|
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;
|
|
12
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. */
|
|
13
15
|
external_entity_id?: string | undefined;
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -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. */
|
|
@@ -45,6 +45,7 @@ export * from "./EntitySummary.mjs";
|
|
|
45
45
|
export * from "./EntityType.mjs";
|
|
46
46
|
export * from "./EntityValidationErrorBody.mjs";
|
|
47
47
|
export * from "./Error_.mjs";
|
|
48
|
+
export * from "./FormatterConfigDto.mjs";
|
|
48
49
|
export * from "./GetPlanLimitsResponseDto.mjs";
|
|
49
50
|
export * from "./GetWebhookResponseDto.mjs";
|
|
50
51
|
export * from "./HttpMethod.mjs";
|
|
@@ -45,6 +45,7 @@ export * from "./EntitySummary.mjs";
|
|
|
45
45
|
export * from "./EntityType.mjs";
|
|
46
46
|
export * from "./EntityValidationErrorBody.mjs";
|
|
47
47
|
export * from "./Error_.mjs";
|
|
48
|
+
export * from "./FormatterConfigDto.mjs";
|
|
48
49
|
export * from "./GetPlanLimitsResponseDto.mjs";
|
|
49
50
|
export * from "./GetWebhookResponseDto.mjs";
|
|
50
51
|
export * from "./HttpMethod.mjs";
|
|
@@ -41,6 +41,9 @@ export function toMultipartDataPart(file) {
|
|
|
41
41
|
function getFileWithMetadata(file_1) {
|
|
42
42
|
return __awaiter(this, arguments, void 0, function* (file, { noSniffFileSize } = {}) {
|
|
43
43
|
var _a, _b, _c, _d, _e;
|
|
44
|
+
if (file == null) {
|
|
45
|
+
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"}.`);
|
|
46
|
+
}
|
|
44
47
|
if (isFileLike(file)) {
|
|
45
48
|
return getFileWithMetadata({
|
|
46
49
|
data: file,
|
|
@@ -36,6 +36,9 @@ export class FormDataWrapper {
|
|
|
36
36
|
}
|
|
37
37
|
appendFile(key, value) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (value == null) {
|
|
40
|
+
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.`);
|
|
41
|
+
}
|
|
39
42
|
const { data, filename, contentType } = yield toMultipartDataPart(value);
|
|
40
43
|
const blob = yield convertToBlob(data, contentType);
|
|
41
44
|
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;
|