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
package/README.md
CHANGED
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export type BaseClientOptions = {
|
|
|
16
16
|
fetch?: typeof fetch;
|
|
17
17
|
/** Configure logging for the client. */
|
|
18
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
+
/** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
20
|
+
stream?: {
|
|
21
|
+
reconnectionEnabled?: boolean;
|
|
22
|
+
maxReconnectionAttempts?: number;
|
|
23
|
+
};
|
|
19
24
|
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
20
25
|
auth?: AuthOption;
|
|
21
26
|
} & HeaderAuthProvider.AuthOptions;
|
|
@@ -28,8 +33,15 @@ export interface BaseRequestOptions {
|
|
|
28
33
|
abortSignal?: AbortSignal;
|
|
29
34
|
/** Additional query string parameters to include in the request. */
|
|
30
35
|
queryParams?: Record<string, unknown>;
|
|
36
|
+
/** A dictionary containing additional parameters to spread into the request's body. */
|
|
37
|
+
additionalBodyParameters?: Record<string, unknown>;
|
|
31
38
|
/** Additional headers to include in the request. */
|
|
32
39
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
40
|
+
/** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
|
|
41
|
+
stream?: {
|
|
42
|
+
reconnectionEnabled?: boolean;
|
|
43
|
+
maxReconnectionAttempts?: number;
|
|
44
|
+
};
|
|
33
45
|
}
|
|
34
46
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
35
47
|
logging: core.logging.Logger;
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "4.0.
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/4.0.
|
|
46
|
+
"X-Fern-SDK-Version": "4.0.1",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/4.0.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -34,7 +34,9 @@ export declare class DatasetsClient {
|
|
|
34
34
|
listDatasets(request?: CatchAllApi.ListDatasetsRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetListResponse>;
|
|
35
35
|
private __listDatasets;
|
|
36
36
|
/**
|
|
37
|
-
* Creates a new dataset from a list of existing entity IDs.
|
|
37
|
+
* Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
|
|
38
|
+
*
|
|
39
|
+
* Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
|
|
38
40
|
*
|
|
39
41
|
* If any of the provided entity IDs do not exist or do not belong to
|
|
40
42
|
* your organization, the request fails with `400`. All entity IDs must
|
|
@@ -60,12 +62,12 @@ export declare class DatasetsClient {
|
|
|
60
62
|
createDataset(request: CatchAllApi.CreateDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetResponse>;
|
|
61
63
|
private __createDataset;
|
|
62
64
|
/**
|
|
63
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity.
|
|
65
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
|
|
64
66
|
*
|
|
65
67
|
* **CSV format:**
|
|
66
68
|
* ```csv
|
|
67
69
|
* name,description,domain,alternative_names,key_persons
|
|
68
|
-
* NewsCatcher,"
|
|
70
|
+
* NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
|
|
69
71
|
* OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
|
|
70
72
|
* ```
|
|
71
73
|
*
|
|
@@ -58,6 +58,7 @@ exports.DatasetsClient = void 0;
|
|
|
58
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
61
62
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
63
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -140,7 +141,9 @@ class DatasetsClient {
|
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
|
-
* Creates a new dataset from a list of existing entity IDs.
|
|
144
|
+
* Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
|
|
145
|
+
*
|
|
146
|
+
* Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
|
|
144
147
|
*
|
|
145
148
|
* If any of the provided entity IDs do not exist or do not belong to
|
|
146
149
|
* your organization, the request fails with `400`. All entity IDs must
|
|
@@ -178,7 +181,7 @@ class DatasetsClient {
|
|
|
178
181
|
contentType: "application/json",
|
|
179
182
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
180
183
|
requestType: "json",
|
|
181
|
-
body: request,
|
|
184
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
182
185
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
183
186
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
184
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,12 +211,12 @@ class DatasetsClient {
|
|
|
208
211
|
});
|
|
209
212
|
}
|
|
210
213
|
/**
|
|
211
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity.
|
|
214
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
|
|
212
215
|
*
|
|
213
216
|
* **CSV format:**
|
|
214
217
|
* ```csv
|
|
215
218
|
* name,description,domain,alternative_names,key_persons
|
|
216
|
-
* NewsCatcher,"
|
|
219
|
+
* NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
|
|
217
220
|
* OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
|
|
218
221
|
* ```
|
|
219
222
|
*
|
|
@@ -426,7 +429,7 @@ class DatasetsClient {
|
|
|
426
429
|
contentType: "application/json",
|
|
427
430
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
428
431
|
requestType: "json",
|
|
429
|
-
body: _body,
|
|
432
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
430
433
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
431
434
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
432
435
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -489,7 +492,7 @@ class DatasetsClient {
|
|
|
489
492
|
contentType: "application/json",
|
|
490
493
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
491
494
|
requestType: "json",
|
|
492
|
-
body: _body,
|
|
495
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
493
496
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
494
497
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
495
498
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -552,7 +555,7 @@ class DatasetsClient {
|
|
|
552
555
|
contentType: "application/json",
|
|
553
556
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
554
557
|
requestType: "json",
|
|
555
|
-
body: _body,
|
|
558
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
556
559
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
557
560
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
558
561
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -619,7 +622,7 @@ class DatasetsClient {
|
|
|
619
622
|
contentType: "application/json",
|
|
620
623
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
621
624
|
requestType: "json",
|
|
622
|
-
body: _body,
|
|
625
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
623
626
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
624
627
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
625
628
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -35,10 +35,10 @@ export declare class EntitiesClient {
|
|
|
35
35
|
/**
|
|
36
36
|
* Creates a new company entity and begins background enrichment.
|
|
37
37
|
*
|
|
38
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
|
|
39
|
+
*
|
|
38
40
|
* The entity status starts as `pending` and transitions to `ready` once
|
|
39
|
-
* enrichment completes.
|
|
40
|
-
* possible — `domain` is the highest-signal field because it is
|
|
41
|
-
* unambiguous.
|
|
41
|
+
* enrichment completes.
|
|
42
42
|
*
|
|
43
43
|
* @param {CatchAllApi.CreateEntityRequest} request
|
|
44
44
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -50,12 +50,12 @@ export declare class EntitiesClient {
|
|
|
50
50
|
* await client.entities.createEntity({
|
|
51
51
|
* name: "NewsCatcher",
|
|
52
52
|
* entity_type: "company",
|
|
53
|
-
* description: "
|
|
53
|
+
* description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
|
|
54
54
|
* additional_attributes: {
|
|
55
55
|
* company_attributes: {
|
|
56
56
|
* domain: "newscatcherapi.com",
|
|
57
57
|
* key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
|
|
58
|
-
* alternative_names: ["
|
|
58
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
|
|
59
59
|
* }
|
|
60
60
|
* }
|
|
61
61
|
* })
|
|
@@ -65,6 +65,8 @@ export declare class EntitiesClient {
|
|
|
65
65
|
/**
|
|
66
66
|
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
67
67
|
*
|
|
68
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
|
|
69
|
+
*
|
|
68
70
|
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
69
71
|
*
|
|
70
72
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
@@ -150,7 +152,7 @@ export declare class EntitiesClient {
|
|
|
150
152
|
* description: "Updated description",
|
|
151
153
|
* additional_attributes: {
|
|
152
154
|
* company_attributes: {
|
|
153
|
-
* alternative_names: ["
|
|
155
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
154
156
|
* }
|
|
155
157
|
* }
|
|
156
158
|
* })
|
|
@@ -58,6 +58,7 @@ exports.EntitiesClient = void 0;
|
|
|
58
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
59
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
60
|
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
61
62
|
const environments = __importStar(require("../../../../environments.js"));
|
|
62
63
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
64
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -140,10 +141,10 @@ class EntitiesClient {
|
|
|
140
141
|
/**
|
|
141
142
|
* Creates a new company entity and begins background enrichment.
|
|
142
143
|
*
|
|
144
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
|
|
145
|
+
*
|
|
143
146
|
* The entity status starts as `pending` and transitions to `ready` once
|
|
144
|
-
* enrichment completes.
|
|
145
|
-
* possible — `domain` is the highest-signal field because it is
|
|
146
|
-
* unambiguous.
|
|
147
|
+
* enrichment completes.
|
|
147
148
|
*
|
|
148
149
|
* @param {CatchAllApi.CreateEntityRequest} request
|
|
149
150
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -155,12 +156,12 @@ class EntitiesClient {
|
|
|
155
156
|
* await client.entities.createEntity({
|
|
156
157
|
* name: "NewsCatcher",
|
|
157
158
|
* entity_type: "company",
|
|
158
|
-
* description: "
|
|
159
|
+
* description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
|
|
159
160
|
* additional_attributes: {
|
|
160
161
|
* company_attributes: {
|
|
161
162
|
* domain: "newscatcherapi.com",
|
|
162
163
|
* key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
|
|
163
|
-
* alternative_names: ["
|
|
164
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
|
|
164
165
|
* }
|
|
165
166
|
* }
|
|
166
167
|
* })
|
|
@@ -180,7 +181,7 @@ class EntitiesClient {
|
|
|
180
181
|
contentType: "application/json",
|
|
181
182
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
182
183
|
requestType: "json",
|
|
183
|
-
body: request,
|
|
184
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
184
185
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
185
186
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
186
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -210,6 +211,8 @@ class EntitiesClient {
|
|
|
210
211
|
/**
|
|
211
212
|
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
212
213
|
*
|
|
214
|
+
* Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
|
|
215
|
+
*
|
|
213
216
|
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
214
217
|
*
|
|
215
218
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
@@ -259,7 +262,7 @@ class EntitiesClient {
|
|
|
259
262
|
contentType: "application/json",
|
|
260
263
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
261
264
|
requestType: "json",
|
|
262
|
-
body: request,
|
|
265
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
263
266
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
264
267
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
265
268
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -414,7 +417,7 @@ class EntitiesClient {
|
|
|
414
417
|
* description: "Updated description",
|
|
415
418
|
* additional_attributes: {
|
|
416
419
|
* company_attributes: {
|
|
417
|
-
* alternative_names: ["
|
|
420
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
418
421
|
* }
|
|
419
422
|
* }
|
|
420
423
|
* })
|
|
@@ -435,7 +438,7 @@ class EntitiesClient {
|
|
|
435
438
|
contentType: "application/json",
|
|
436
439
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
437
440
|
requestType: "json",
|
|
438
|
-
body: _body,
|
|
441
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
439
442
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
440
443
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
441
444
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,7 +6,7 @@ import type * as CatchAllApi from "../../../../index.js";
|
|
|
6
6
|
* description: "Updated description",
|
|
7
7
|
* additional_attributes: {
|
|
8
8
|
* company_attributes: {
|
|
9
|
-
* alternative_names: ["
|
|
9
|
+
* alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
|
|
10
10
|
* }
|
|
11
11
|
* }
|
|
12
12
|
* }
|
|
@@ -47,6 +47,7 @@ exports.JobsClient = void 0;
|
|
|
47
47
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
50
51
|
const environments = __importStar(require("../../../../environments.js"));
|
|
51
52
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
@@ -151,7 +152,7 @@ class JobsClient {
|
|
|
151
152
|
contentType: "application/json",
|
|
152
153
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
153
154
|
requestType: "json",
|
|
154
|
-
body: request,
|
|
155
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
155
156
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
156
157
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
157
158
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,7 +209,7 @@ class JobsClient {
|
|
|
208
209
|
contentType: "application/json",
|
|
209
210
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
210
211
|
requestType: "json",
|
|
211
|
-
body: request,
|
|
212
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
212
213
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
213
214
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
214
215
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -270,7 +271,7 @@ class JobsClient {
|
|
|
270
271
|
contentType: "application/json",
|
|
271
272
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
272
273
|
requestType: "json",
|
|
273
|
-
body: request,
|
|
274
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
274
275
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
275
276
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
276
277
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -501,7 +502,7 @@ class JobsClient {
|
|
|
501
502
|
contentType: "application/json",
|
|
502
503
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
503
504
|
requestType: "json",
|
|
504
|
-
body: request,
|
|
505
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
505
506
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
506
507
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
507
508
|
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
|
/**
|
|
@@ -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,
|
|
@@ -451,7 +452,7 @@ class MonitorsClient {
|
|
|
451
452
|
contentType: "application/json",
|
|
452
453
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
453
454
|
requestType: "json",
|
|
454
|
-
body: _body,
|
|
455
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
455
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,
|
|
456
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,
|
|
457
458
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -630,7 +631,7 @@ class MonitorsClient {
|
|
|
630
631
|
contentType: "application/json",
|
|
631
632
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
632
633
|
requestType: "json",
|
|
633
|
-
body: _body,
|
|
634
|
+
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
634
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,
|
|
635
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,
|
|
636
637
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -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
|
}
|