newscatcher-catchall-sdk 1.5.0 → 2.0.0
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 +12 -2
- package/dist/cjs/BaseClient.d.ts +3 -0
- package/dist/cjs/BaseClient.js +17 -2
- package/dist/cjs/api/resources/datasets/client/Client.d.ts +30 -31
- package/dist/cjs/api/resources/datasets/client/Client.js +64 -75
- package/dist/cjs/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.ts +28 -0
- package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +0 -1
- package/dist/cjs/api/resources/datasets/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/entities/client/Client.d.ts +3 -7
- package/dist/cjs/api/resources/entities/client/Client.js +8 -13
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -4
- package/dist/cjs/api/resources/jobs/client/Client.js +7 -11
- package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +0 -1
- package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +7 -1
- package/dist/cjs/api/resources/meta/client/Client.js +3 -3
- package/dist/cjs/api/resources/monitors/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/monitors/client/Client.js +16 -17
- package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +7 -4
- package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +0 -1
- package/dist/cjs/api/types/ConnectedEntity.d.ts +12 -9
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
- package/dist/cjs/core/auth/AuthProvider.js +7 -0
- package/dist/cjs/core/auth/index.d.ts +1 -1
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -0
- package/dist/cjs/core/fetcher/Fetcher.js +2 -7
- package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/BaseClient.mjs +17 -2
- package/dist/esm/api/resources/datasets/client/Client.d.mts +30 -31
- package/dist/esm/api/resources/datasets/client/Client.mjs +64 -75
- package/dist/esm/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.mts +28 -0
- package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +0 -1
- package/dist/esm/api/resources/datasets/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/entities/client/Client.d.mts +3 -7
- package/dist/esm/api/resources/entities/client/Client.mjs +8 -13
- package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -4
- package/dist/esm/api/resources/jobs/client/Client.mjs +7 -11
- package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +0 -1
- package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +7 -1
- package/dist/esm/api/resources/meta/client/Client.mjs +3 -3
- package/dist/esm/api/resources/monitors/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/monitors/client/Client.mjs +16 -17
- package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +7 -4
- package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +0 -1
- package/dist/esm/api/types/ConnectedEntity.d.mts +12 -9
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -1
- package/dist/esm/core/auth/index.d.mts +1 -1
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +5 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -7
- package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +35 -42
- package/dist/cjs/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.ts +0 -21
- package/dist/esm/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.mts +0 -21
- /package/dist/cjs/api/resources/datasets/client/requests/{ListEntitiesInDatasetRequest.js → ListDatasetEntitiesRequest.js} +0 -0
- /package/dist/esm/api/resources/datasets/client/requests/{ListEntitiesInDatasetRequest.mjs → ListDatasetEntitiesRequest.mjs} +0 -0
|
@@ -52,7 +52,6 @@ export class JobsClient {
|
|
|
52
52
|
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/jobs/user"),
|
|
53
53
|
method: "GET",
|
|
54
54
|
headers: _headers,
|
|
55
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
56
55
|
queryString: core.url
|
|
57
56
|
.queryBuilder()
|
|
58
57
|
.addMany(_queryParams)
|
|
@@ -110,7 +109,7 @@ export class JobsClient {
|
|
|
110
109
|
method: "POST",
|
|
111
110
|
headers: _headers,
|
|
112
111
|
contentType: "application/json",
|
|
113
|
-
|
|
112
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
114
113
|
requestType: "json",
|
|
115
114
|
body: request,
|
|
116
115
|
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,7 +171,7 @@ export class JobsClient {
|
|
|
172
171
|
method: "POST",
|
|
173
172
|
headers: _headers,
|
|
174
173
|
contentType: "application/json",
|
|
175
|
-
|
|
174
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
176
175
|
requestType: "json",
|
|
177
176
|
body: request,
|
|
178
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,
|
|
@@ -230,7 +229,7 @@ export class JobsClient {
|
|
|
230
229
|
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/status/${core.url.encodePathParam(jobId)}`),
|
|
231
230
|
method: "GET",
|
|
232
231
|
headers: _headers,
|
|
233
|
-
|
|
232
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
234
233
|
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,
|
|
235
234
|
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,
|
|
236
235
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -288,7 +287,6 @@ export class JobsClient {
|
|
|
288
287
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/pull/${core.url.encodePathParam(jobId)}`),
|
|
289
288
|
method: "GET",
|
|
290
289
|
headers: _headers,
|
|
291
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
292
290
|
queryString: core.url
|
|
293
291
|
.queryBuilder()
|
|
294
292
|
.addMany(_queryParams)
|
|
@@ -349,7 +347,7 @@ export class JobsClient {
|
|
|
349
347
|
method: "POST",
|
|
350
348
|
headers: _headers,
|
|
351
349
|
contentType: "application/json",
|
|
352
|
-
|
|
350
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
353
351
|
requestType: "json",
|
|
354
352
|
body: request,
|
|
355
353
|
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,
|
|
@@ -381,11 +379,9 @@ export class JobsClient {
|
|
|
381
379
|
});
|
|
382
380
|
}
|
|
383
381
|
/**
|
|
384
|
-
* Soft-deletes a job. The job is flagged as deleted and no longer
|
|
385
|
-
* appears in list results. The underlying data is retained.
|
|
382
|
+
* Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
|
|
386
383
|
*
|
|
387
|
-
* Only the job owner can delete a job. Returns `404` if the job is not
|
|
388
|
-
* found or does not belong to the authenticated user.
|
|
384
|
+
* Only the job owner can delete a job. Returns `404` if the job is not found or does not belong to the authenticated user.
|
|
389
385
|
*
|
|
390
386
|
* Deleting an already-deleted job returns `200`.
|
|
391
387
|
*
|
|
@@ -413,7 +409,7 @@ export class JobsClient {
|
|
|
413
409
|
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/jobs/${core.url.encodePathParam(jobId)}`),
|
|
414
410
|
method: "DELETE",
|
|
415
411
|
headers: _headers,
|
|
416
|
-
|
|
412
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
417
413
|
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,
|
|
418
414
|
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,
|
|
419
415
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -36,11 +36,17 @@ export interface SubmitRequestDto {
|
|
|
36
36
|
*/
|
|
37
37
|
mode?: SubmitRequestDto.Mode;
|
|
38
38
|
/**
|
|
39
|
-
* Dataset IDs to connect to
|
|
39
|
+
* Dataset IDs to connect to the job. When provided, this enables Company Watchlist mode — the job returns only events relevant to companies in the connected datasets. To set the minimum relevance threshold, use `ed_score_min`.
|
|
40
40
|
*
|
|
41
41
|
* The dataset must have `latest_status: ready` before the job is submitted. Submitting with a non-existent or inaccessible dataset ID returns `400`.
|
|
42
42
|
*/
|
|
43
43
|
connected_dataset_ids?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* The minimum relevance score a connected entity must reach for its record to be included in results.
|
|
46
|
+
*
|
|
47
|
+
* Only valid when `connected_dataset_ids` is set; otherwise ignored. Records where no connected entity meets the threshold are excluded entirely.
|
|
48
|
+
*/
|
|
49
|
+
ed_score_min?: number;
|
|
44
50
|
}
|
|
45
51
|
export declare namespace SubmitRequestDto {
|
|
46
52
|
/**
|
|
@@ -41,7 +41,7 @@ export class MetaClient {
|
|
|
41
41
|
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, "health"),
|
|
42
42
|
method: "GET",
|
|
43
43
|
headers: _headers,
|
|
44
|
-
|
|
44
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
45
45
|
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,
|
|
46
46
|
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,
|
|
47
47
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -80,7 +80,7 @@ export class MetaClient {
|
|
|
80
80
|
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, "version"),
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: _headers,
|
|
83
|
-
|
|
83
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
84
84
|
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,
|
|
85
85
|
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,
|
|
86
86
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -122,7 +122,7 @@ export class MetaClient {
|
|
|
122
122
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/user/limits"),
|
|
123
123
|
method: "POST",
|
|
124
124
|
headers: _headers,
|
|
125
|
-
|
|
125
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
126
126
|
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,
|
|
127
127
|
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,
|
|
128
128
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -38,7 +38,8 @@ export declare class MonitorsClient {
|
|
|
38
38
|
* @example
|
|
39
39
|
* await client.monitors.createMonitor({
|
|
40
40
|
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
41
|
-
* schedule: "every day at 12 PM
|
|
41
|
+
* schedule: "every day at 12 PM",
|
|
42
|
+
* timezone: "UTC",
|
|
42
43
|
* webhook: {
|
|
43
44
|
* url: "https://your-endpoint.com/webhook",
|
|
44
45
|
* method: "POST",
|
|
@@ -64,7 +64,6 @@ export class MonitorsClient {
|
|
|
64
64
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/monitors"),
|
|
65
65
|
method: "GET",
|
|
66
66
|
headers: _headers,
|
|
67
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
68
67
|
queryString: core.url
|
|
69
68
|
.queryBuilder()
|
|
70
69
|
.addMany(_queryParams)
|
|
@@ -107,7 +106,8 @@ export class MonitorsClient {
|
|
|
107
106
|
* @example
|
|
108
107
|
* await client.monitors.createMonitor({
|
|
109
108
|
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
110
|
-
* schedule: "every day at 12 PM
|
|
109
|
+
* schedule: "every day at 12 PM",
|
|
110
|
+
* timezone: "UTC",
|
|
111
111
|
* webhook: {
|
|
112
112
|
* url: "https://your-endpoint.com/webhook",
|
|
113
113
|
* method: "POST",
|
|
@@ -132,7 +132,7 @@ export class MonitorsClient {
|
|
|
132
132
|
method: "POST",
|
|
133
133
|
headers: _headers,
|
|
134
134
|
contentType: "application/json",
|
|
135
|
-
|
|
135
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
136
136
|
requestType: "json",
|
|
137
137
|
body: request,
|
|
138
138
|
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,
|
|
@@ -186,7 +186,7 @@ export class MonitorsClient {
|
|
|
186
186
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/pull/${core.url.encodePathParam(monitorId)}`),
|
|
187
187
|
method: "GET",
|
|
188
188
|
headers: _headers,
|
|
189
|
-
|
|
189
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
190
190
|
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,
|
|
191
191
|
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,
|
|
192
192
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -232,27 +232,26 @@ export class MonitorsClient {
|
|
|
232
232
|
}
|
|
233
233
|
__listMonitorJobs(request, requestOptions) {
|
|
234
234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
235
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
236
236
|
const { monitor_id: monitorId, sort } = request;
|
|
237
237
|
const _queryParams = {
|
|
238
|
-
sort:
|
|
238
|
+
sort: sort != null ? sort : undefined,
|
|
239
239
|
};
|
|
240
240
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
241
|
-
const _headers = mergeHeaders(_authRequest.headers, (
|
|
241
|
+
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);
|
|
242
242
|
const _response = yield core.fetcher({
|
|
243
|
-
url: core.url.join((
|
|
243
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/jobs`),
|
|
244
244
|
method: "GET",
|
|
245
245
|
headers: _headers,
|
|
246
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
247
246
|
queryString: core.url
|
|
248
247
|
.queryBuilder()
|
|
249
248
|
.addMany(_queryParams)
|
|
250
249
|
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
251
250
|
.build(),
|
|
252
|
-
timeoutMs: ((
|
|
253
|
-
maxRetries: (
|
|
251
|
+
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,
|
|
252
|
+
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,
|
|
254
253
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
255
|
-
fetchFn: (
|
|
254
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
256
255
|
logging: this._options.logging,
|
|
257
256
|
});
|
|
258
257
|
if (_response.ok) {
|
|
@@ -302,7 +301,7 @@ export class MonitorsClient {
|
|
|
302
301
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/status`),
|
|
303
302
|
method: "GET",
|
|
304
303
|
headers: _headers,
|
|
305
|
-
|
|
304
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
306
305
|
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,
|
|
307
306
|
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,
|
|
308
307
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -362,7 +361,7 @@ export class MonitorsClient {
|
|
|
362
361
|
method: "POST",
|
|
363
362
|
headers: _headers,
|
|
364
363
|
contentType: "application/json",
|
|
365
|
-
|
|
364
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
366
365
|
requestType: "json",
|
|
367
366
|
body: _body,
|
|
368
367
|
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,
|
|
@@ -421,7 +420,7 @@ export class MonitorsClient {
|
|
|
421
420
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}/disable`),
|
|
422
421
|
method: "POST",
|
|
423
422
|
headers: _headers,
|
|
424
|
-
|
|
423
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
425
424
|
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,
|
|
426
425
|
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,
|
|
427
426
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -484,7 +483,7 @@ export class MonitorsClient {
|
|
|
484
483
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, `catchAll/monitors/${core.url.encodePathParam(monitorId)}`),
|
|
485
484
|
method: "DELETE",
|
|
486
485
|
headers: _headers,
|
|
487
|
-
|
|
486
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
488
487
|
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,
|
|
489
488
|
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,
|
|
490
489
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -547,7 +546,7 @@ export class MonitorsClient {
|
|
|
547
546
|
method: "PATCH",
|
|
548
547
|
headers: _headers,
|
|
549
548
|
contentType: "application/json",
|
|
550
|
-
|
|
549
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
551
550
|
requestType: "json",
|
|
552
551
|
body: _body,
|
|
553
552
|
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,
|
|
@@ -3,7 +3,8 @@ import type * as CatchAllApi from "../../../../index.mjs";
|
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
5
|
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
6
|
-
* schedule: "every day at 12 PM
|
|
6
|
+
* schedule: "every day at 12 PM",
|
|
7
|
+
* timezone: "UTC",
|
|
7
8
|
* webhook: {
|
|
8
9
|
* url: "https://your-endpoint.com/webhook",
|
|
9
10
|
* method: "POST",
|
|
@@ -22,12 +23,14 @@ export interface CreateMonitorRequestDto {
|
|
|
22
23
|
* If [`backfill`](https://www.newscatcherapi.com/docs/web-search-api/api-reference/monitors/create-monitor#body-backfill) is true, the job's `end_date` must be within the last 7 days.
|
|
23
24
|
*/
|
|
24
25
|
reference_job_id: string;
|
|
26
|
+
/** Monitor schedule in plain text format. Minimum frequency depends on your plan. */
|
|
27
|
+
schedule: string;
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* The IANA timezone identifier used as the fallback when the `schedule` string does not include an explicit timezone.
|
|
27
30
|
*
|
|
28
|
-
*
|
|
31
|
+
* If the schedule includes a timezone abbreviation (for example, `"every day at 9am EST"`), the parsed timezone takes priority and this value is ignored.
|
|
29
32
|
*/
|
|
30
|
-
|
|
33
|
+
timezone?: string;
|
|
31
34
|
/** Optional webhook to receive notifications when jobs complete. */
|
|
32
35
|
webhook?: CatchAllApi.WebhookDto;
|
|
33
36
|
/** Maximum number of records per monitor run. If not provided, defaults to the plan limit. */
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../index.mjs";
|
|
1
2
|
/**
|
|
2
|
-
* A company entity matched to a record in a Company Watchlist job, with
|
|
3
|
-
* a relevance score and explanation.
|
|
3
|
+
* A company entity matched to a record in a Company Watchlist job, with a relevance score and explanation.
|
|
4
4
|
*
|
|
5
|
-
* Only entities with `ed_score` ≥ 1 appear in results. Entities scored
|
|
6
|
-
* 0 are filtered out before the response is returned.
|
|
5
|
+
* Only entities with `ed_score` ≥ 1 appear in results. Entities scored 0 are filtered out before the response is returned. When `ed_score_min` is set at submission time, entities below that threshold are excluded.
|
|
7
6
|
*/
|
|
8
7
|
export interface ConnectedEntity {
|
|
9
8
|
/** Unique identifier of the matched entity. */
|
|
@@ -11,8 +10,7 @@ export interface ConnectedEntity {
|
|
|
11
10
|
/** Name of the matched entity. */
|
|
12
11
|
name: string;
|
|
13
12
|
/**
|
|
14
|
-
* Relevance score indicating how directly the entity is associated
|
|
15
|
-
* with this event.
|
|
13
|
+
* Relevance score indicating how directly the entity is associated with this event.
|
|
16
14
|
*
|
|
17
15
|
* | Score | Meaning |
|
|
18
16
|
* |-------|---------|
|
|
@@ -22,9 +20,14 @@ export interface ConnectedEntity {
|
|
|
22
20
|
* | 1–3 | Indirect mention (listed with others, stock noise) |
|
|
23
21
|
*/
|
|
24
22
|
ed_score: number;
|
|
23
|
+
/** Short explanation (up to 100 characters) of why this entity is associated with the event. */
|
|
24
|
+
relation: string;
|
|
25
|
+
/** The entity type. */
|
|
26
|
+
type: string;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
+
* The stored attributes for this entity. Present only when attributes exist in the database.
|
|
29
|
+
*
|
|
30
|
+
* The field name matches the value of `type` — for example, `"company"` type entities have a `company` field.
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
company?: CatchAllApi.CompanyAttributes | undefined;
|
|
30
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export { type AuthProvider, isAuthProvider } from "./AuthProvider.mjs";
|
|
2
2
|
export type { AuthRequest } from "./AuthRequest.mjs";
|
|
3
3
|
export { BasicAuth } from "./BasicAuth.mjs";
|
|
4
4
|
export { BearerToken } from "./BearerToken.mjs";
|
|
@@ -8,6 +8,11 @@ export declare namespace Fetcher {
|
|
|
8
8
|
method: string;
|
|
9
9
|
contentType?: string;
|
|
10
10
|
headers?: Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
|
|
13
|
+
* Retained for backwards compatibility with custom fetchers and callers that
|
|
14
|
+
* still construct request args with a query-parameter object.
|
|
15
|
+
*/
|
|
11
16
|
queryParameters?: Record<string, unknown>;
|
|
12
17
|
queryString?: string;
|
|
13
18
|
body?: unknown;
|
|
@@ -71,16 +71,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
|
|
|
71
71
|
]);
|
|
72
72
|
function redactQueryParameters(queryParameters) {
|
|
73
73
|
if (queryParameters == null) {
|
|
74
|
-
return
|
|
74
|
+
return undefined;
|
|
75
75
|
}
|
|
76
76
|
const redacted = {};
|
|
77
77
|
for (const [key, value] of Object.entries(queryParameters)) {
|
|
78
|
-
|
|
79
|
-
redacted[key] = "[REDACTED]";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
redacted[key] = value;
|
|
83
|
-
}
|
|
78
|
+
redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
|
|
84
79
|
}
|
|
85
80
|
return redacted;
|
|
86
81
|
}
|
|
@@ -11,6 +11,9 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
|
|
|
11
11
|
const MAX_RETRY_DELAY = 60000; // in milliseconds
|
|
12
12
|
const DEFAULT_MAX_RETRIES = 2;
|
|
13
13
|
const JITTER_FACTOR = 0.2; // 20% random jitter
|
|
14
|
+
function isRetryableStatusCode(statusCode) {
|
|
15
|
+
return [408, 429].includes(statusCode) || statusCode >= 500;
|
|
16
|
+
}
|
|
14
17
|
function addPositiveJitter(delay) {
|
|
15
18
|
const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
|
|
16
19
|
return delay * jitterMultiplier;
|
|
@@ -50,7 +53,7 @@ export function requestWithRetries(requestFn_1) {
|
|
|
50
53
|
return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
|
|
51
54
|
let response = yield requestFn();
|
|
52
55
|
for (let i = 0; i < maxRetries; ++i) {
|
|
53
|
-
if (
|
|
56
|
+
if (isRetryableStatusCode(response.status)) {
|
|
54
57
|
const delay = getRetryDelayFromHeaders(response, i);
|
|
55
58
|
yield new Promise((resolve) => setTimeout(resolve, delay));
|
|
56
59
|
response = yield requestFn();
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "2.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "2.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newscatcher-catchall-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"ts-loader": "^9.5.4",
|
|
107
107
|
"vitest": "^4.1.1",
|
|
108
108
|
"msw": "2.11.2",
|
|
109
|
-
"@types/node": "^
|
|
109
|
+
"@types/node": "^20.0.0",
|
|
110
110
|
"typescript": "~5.9.3",
|
|
111
111
|
"@biomejs/biome": "2.4.10"
|
|
112
112
|
},
|