newscatcher-catchall-sdk 1.5.1 → 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 +11 -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 +55 -64
- 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 +3 -7
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -4
- package/dist/cjs/api/resources/jobs/client/Client.js +2 -4
- 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/monitors/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/monitors/client/Client.js +2 -1
- 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/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 +55 -64
- 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 +3 -7
- package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -4
- package/dist/esm/api/resources/jobs/client/Client.mjs +2 -4
- 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/monitors/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/monitors/client/Client.mjs +2 -1
- 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/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
package/README.md
CHANGED
|
@@ -202,11 +202,19 @@ The SDK is instrumented with automatic retries with exponential backoff. A reque
|
|
|
202
202
|
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
203
203
|
retry limit (default: 2).
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
Which status codes are retried depends on the `retryStatusCodes` generator configuration:
|
|
206
206
|
|
|
207
|
+
**`legacy`** (current default): retries on
|
|
207
208
|
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
208
209
|
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
209
|
-
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
|
|
210
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
|
|
211
|
+
|
|
212
|
+
**`recommended`**: retries on
|
|
213
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
214
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
215
|
+
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
|
|
216
|
+
- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
|
|
217
|
+
- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
|
|
210
218
|
|
|
211
219
|
Use the `maxRetries` request option to configure this behavior.
|
|
212
220
|
|
|
@@ -365,3 +373,4 @@ On the other hand, contributions to the README are always very welcome!
|
|
|
365
373
|
|
|
366
374
|
|
|
367
375
|
|
|
376
|
+
|
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js";
|
|
2
2
|
import * as core from "./core/index.js";
|
|
3
3
|
import type * as environments from "./environments.js";
|
|
4
|
+
export type AuthOption = false | core.AuthProvider["getAuthRequest"] | core.AuthProvider | HeaderAuthProvider.AuthOptions;
|
|
4
5
|
export type BaseClientOptions = {
|
|
5
6
|
environment?: core.Supplier<environments.CatchAllApiEnvironment | string>;
|
|
6
7
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -15,6 +16,8 @@ export type BaseClientOptions = {
|
|
|
15
16
|
fetch?: typeof fetch;
|
|
16
17
|
/** Configure logging for the client. */
|
|
17
18
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
19
|
+
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
|
|
20
|
+
auth?: AuthOption;
|
|
18
21
|
} & HeaderAuthProvider.AuthOptions;
|
|
19
22
|
export interface BaseRequestOptions {
|
|
20
23
|
/** The maximum time to wait for a response in seconds. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "newscatcher-catchall-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "newscatcher-catchall-sdk/
|
|
46
|
+
"X-Fern-SDK-Version": "2.0.0",
|
|
47
|
+
"User-Agent": "newscatcher-catchall-sdk/2.0.0",
|
|
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);
|
|
@@ -53,6 +53,21 @@ function normalizeClientOptions(options) {
|
|
|
53
53
|
function normalizeClientOptionsWithAuth(options) {
|
|
54
54
|
var _a;
|
|
55
55
|
const normalized = normalizeClientOptions(options);
|
|
56
|
+
if (options.auth === false) {
|
|
57
|
+
normalized.authProvider = new core.NoOpAuthProvider();
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
if (options.auth != null) {
|
|
61
|
+
if (typeof options.auth === "function") {
|
|
62
|
+
normalized.authProvider = { getAuthRequest: options.auth };
|
|
63
|
+
return normalized;
|
|
64
|
+
}
|
|
65
|
+
if (core.isAuthProvider(options.auth)) {
|
|
66
|
+
normalized.authProvider = options.auth;
|
|
67
|
+
return normalized;
|
|
68
|
+
}
|
|
69
|
+
Object.assign(normalized, options.auth);
|
|
70
|
+
}
|
|
56
71
|
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
57
72
|
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new HeaderAuthProvider_js_1.HeaderAuthProvider(normalizedWithNoOpAuthProvider));
|
|
58
73
|
return normalized;
|
|
@@ -18,9 +18,7 @@ export declare class DatasetsClient {
|
|
|
18
18
|
protected readonly _options: NormalizedClientOptionsWithAuth<DatasetsClient.Options>;
|
|
19
19
|
constructor(options?: DatasetsClient.Options);
|
|
20
20
|
/**
|
|
21
|
-
* Returns a paginated list of datasets belonging to the authenticated
|
|
22
|
-
* organization. Supports filtering by status and sorting by name,
|
|
23
|
-
* status, or creation date.
|
|
21
|
+
* Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
|
|
24
22
|
*
|
|
25
23
|
* @param {CatchAllApi.ListDatasetsRequest} request
|
|
26
24
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -61,9 +59,7 @@ export declare class DatasetsClient {
|
|
|
61
59
|
createDataset(request: CatchAllApi.CreateDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetResponse>;
|
|
62
60
|
private __createDataset;
|
|
63
61
|
/**
|
|
64
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV
|
|
65
|
-
* becomes an entity. The `name` column is required; all other columns
|
|
66
|
-
* are optional.
|
|
62
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The `name` and `domain`columns are required; all other columns are optional.
|
|
67
63
|
*
|
|
68
64
|
* **CSV format:**
|
|
69
65
|
* ```csv
|
|
@@ -144,22 +140,6 @@ export declare class DatasetsClient {
|
|
|
144
140
|
*/
|
|
145
141
|
updateDataset(request: CatchAllApi.UpdateDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetResponse>;
|
|
146
142
|
private __updateDataset;
|
|
147
|
-
/**
|
|
148
|
-
* Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
|
|
149
|
-
*
|
|
150
|
-
* @param {CatchAllApi.ListEntitiesInDatasetRequest} request
|
|
151
|
-
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
152
|
-
*
|
|
153
|
-
* @throws {@link CatchAllApi.ForbiddenError}
|
|
154
|
-
* @throws {@link CatchAllApi.NotFoundError}
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* await client.datasets.listEntitiesInDataset({
|
|
158
|
-
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2"
|
|
159
|
-
* })
|
|
160
|
-
*/
|
|
161
|
-
listEntitiesInDataset(request: CatchAllApi.ListEntitiesInDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetEntityListResponse>;
|
|
162
|
-
private __listEntitiesInDataset;
|
|
163
143
|
/**
|
|
164
144
|
* Adds one or more existing entities to a dataset. Returns the number of entities added.
|
|
165
145
|
*
|
|
@@ -181,9 +161,7 @@ export declare class DatasetsClient {
|
|
|
181
161
|
addEntitiesToDataset(request: CatchAllApi.AddEntitiesToDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ManageEntitiesResponse>;
|
|
182
162
|
private __addEntitiesToDataset;
|
|
183
163
|
/**
|
|
184
|
-
* Removes one or more entities from a dataset. The entities themselves
|
|
185
|
-
* are not deleted — they are only removed from this dataset. Returns
|
|
186
|
-
* the number of entities removed.
|
|
164
|
+
* Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
|
|
187
165
|
*
|
|
188
166
|
* @param {CatchAllApi.RemoveEntitiesFromDatasetRequest} request
|
|
189
167
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -203,8 +181,31 @@ export declare class DatasetsClient {
|
|
|
203
181
|
removeEntitiesFromDataset(request: CatchAllApi.RemoveEntitiesFromDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ManageEntitiesResponse>;
|
|
204
182
|
private __removeEntitiesFromDataset;
|
|
205
183
|
/**
|
|
206
|
-
* Returns
|
|
207
|
-
*
|
|
184
|
+
* Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
|
|
185
|
+
*
|
|
186
|
+
* @param {CatchAllApi.ListDatasetEntitiesRequest} request
|
|
187
|
+
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
188
|
+
*
|
|
189
|
+
* @throws {@link CatchAllApi.ForbiddenError}
|
|
190
|
+
* @throws {@link CatchAllApi.NotFoundError}
|
|
191
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* await client.datasets.listEntitiesInDataset({
|
|
195
|
+
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
|
|
196
|
+
* page: 1,
|
|
197
|
+
* page_size: 100,
|
|
198
|
+
* search: "OpenAI",
|
|
199
|
+
* status: "ready",
|
|
200
|
+
* entity_type: "company",
|
|
201
|
+
* sort_by: "created_at",
|
|
202
|
+
* sort_order: "desc"
|
|
203
|
+
* })
|
|
204
|
+
*/
|
|
205
|
+
listEntitiesInDataset(request: CatchAllApi.ListDatasetEntitiesRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetEntityListResponse>;
|
|
206
|
+
private __listEntitiesInDataset;
|
|
207
|
+
/**
|
|
208
|
+
* Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
|
|
208
209
|
*
|
|
209
210
|
* @param {CatchAllApi.GetDatasetStatusHistoryRequest} request
|
|
210
211
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -220,11 +221,9 @@ export declare class DatasetsClient {
|
|
|
220
221
|
getDatasetStatusHistory(request: CatchAllApi.GetDatasetStatusHistoryRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetStatusHistoryResponse>;
|
|
221
222
|
private __getDatasetStatusHistory;
|
|
222
223
|
/**
|
|
223
|
-
* Appends new companies to an existing dataset by uploading a CSV file.
|
|
224
|
-
* Uses the same CSV format as the dataset creation endpoint.
|
|
224
|
+
* Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
|
|
225
225
|
*
|
|
226
|
-
* The response omits `dataset_name` compared to the create-from-CSV
|
|
227
|
-
* endpoint since the dataset already exists.
|
|
226
|
+
* The response omits `dataset_name` compared to the create-from-CSV endpoint since the dataset already exists.
|
|
228
227
|
*
|
|
229
228
|
* @param {CatchAllApi.UploadCsvToDatasetRequest} request
|
|
230
229
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -74,9 +74,7 @@ class DatasetsClient {
|
|
|
74
74
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Returns a paginated list of datasets belonging to the authenticated
|
|
78
|
-
* organization. Supports filtering by status and sorting by name,
|
|
79
|
-
* status, or creation date.
|
|
77
|
+
* Returns a paginated list of datasets belonging to the authenticated organization. Supports filtering by status and sorting by name, status, or creation date.
|
|
80
78
|
*
|
|
81
79
|
* @param {CatchAllApi.ListDatasetsRequest} request
|
|
82
80
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -208,9 +206,7 @@ class DatasetsClient {
|
|
|
208
206
|
});
|
|
209
207
|
}
|
|
210
208
|
/**
|
|
211
|
-
* Creates a new dataset by uploading a CSV file. Each row in the CSV
|
|
212
|
-
* becomes an entity. The `name` column is required; all other columns
|
|
213
|
-
* are optional.
|
|
209
|
+
* Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The `name` and `domain`columns are required; all other columns are optional.
|
|
214
210
|
*
|
|
215
211
|
* **CSV format:**
|
|
216
212
|
* ```csv
|
|
@@ -458,46 +454,40 @@ class DatasetsClient {
|
|
|
458
454
|
});
|
|
459
455
|
}
|
|
460
456
|
/**
|
|
461
|
-
*
|
|
457
|
+
* Adds one or more existing entities to a dataset. Returns the number of entities added.
|
|
462
458
|
*
|
|
463
|
-
* @param {CatchAllApi.
|
|
459
|
+
* @param {CatchAllApi.AddEntitiesToDatasetRequest} request
|
|
464
460
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
465
461
|
*
|
|
466
462
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
467
463
|
* @throws {@link CatchAllApi.NotFoundError}
|
|
464
|
+
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
468
465
|
*
|
|
469
466
|
* @example
|
|
470
|
-
* await client.datasets.
|
|
471
|
-
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2"
|
|
467
|
+
* await client.datasets.addEntitiesToDataset({
|
|
468
|
+
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
|
|
469
|
+
* body: {
|
|
470
|
+
* entity_ids: ["854198fa-f702-49db-a381-0427fa87f173"]
|
|
471
|
+
* }
|
|
472
472
|
* })
|
|
473
473
|
*/
|
|
474
|
-
|
|
475
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
474
|
+
addEntitiesToDataset(request, requestOptions) {
|
|
475
|
+
return core.HttpResponsePromise.fromPromise(this.__addEntitiesToDataset(request, requestOptions));
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
__addEntitiesToDataset(request, requestOptions) {
|
|
478
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
479
479
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
480
|
-
const { dataset_id: datasetId,
|
|
481
|
-
const _queryParams = {
|
|
482
|
-
page,
|
|
483
|
-
page_size: pageSize,
|
|
484
|
-
search,
|
|
485
|
-
status: status != null ? status : undefined,
|
|
486
|
-
entity_type: entityType != null ? entityType : undefined,
|
|
487
|
-
sort_by: sortBy != null ? sortBy : undefined,
|
|
488
|
-
sort_order: sortOrder != null ? sortOrder : undefined,
|
|
489
|
-
};
|
|
480
|
+
const { dataset_id: datasetId, body: _body } = request;
|
|
490
481
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
491
482
|
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);
|
|
492
483
|
const _response = yield core.fetcher({
|
|
493
484
|
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/datasets/${core.url.encodePathParam(datasetId)}/entities`),
|
|
494
|
-
method: "
|
|
485
|
+
method: "POST",
|
|
495
486
|
headers: _headers,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
.build(),
|
|
487
|
+
contentType: "application/json",
|
|
488
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
489
|
+
requestType: "json",
|
|
490
|
+
body: _body,
|
|
501
491
|
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
492
|
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
493
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -505,10 +495,7 @@ class DatasetsClient {
|
|
|
505
495
|
logging: this._options.logging,
|
|
506
496
|
});
|
|
507
497
|
if (_response.ok) {
|
|
508
|
-
return {
|
|
509
|
-
data: _response.body,
|
|
510
|
-
rawResponse: _response.rawResponse,
|
|
511
|
-
};
|
|
498
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
512
499
|
}
|
|
513
500
|
if (_response.error.reason === "status-code") {
|
|
514
501
|
switch (_response.error.statusCode) {
|
|
@@ -516,6 +503,8 @@ class DatasetsClient {
|
|
|
516
503
|
throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
517
504
|
case 404:
|
|
518
505
|
throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
506
|
+
case 422:
|
|
507
|
+
throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
519
508
|
default:
|
|
520
509
|
throw new errors.CatchAllApiError({
|
|
521
510
|
statusCode: _response.error.statusCode,
|
|
@@ -524,13 +513,13 @@ class DatasetsClient {
|
|
|
524
513
|
});
|
|
525
514
|
}
|
|
526
515
|
}
|
|
527
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
516
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/datasets/{dataset_id}/entities");
|
|
528
517
|
});
|
|
529
518
|
}
|
|
530
519
|
/**
|
|
531
|
-
*
|
|
520
|
+
* Removes one or more entities from a dataset. The entities themselves are not deleted — they are only removed from this dataset. Returns the number of entities removed.
|
|
532
521
|
*
|
|
533
|
-
* @param {CatchAllApi.
|
|
522
|
+
* @param {CatchAllApi.RemoveEntitiesFromDatasetRequest} request
|
|
534
523
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
535
524
|
*
|
|
536
525
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -538,17 +527,17 @@ class DatasetsClient {
|
|
|
538
527
|
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
539
528
|
*
|
|
540
529
|
* @example
|
|
541
|
-
* await client.datasets.
|
|
530
|
+
* await client.datasets.removeEntitiesFromDataset({
|
|
542
531
|
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
|
|
543
532
|
* body: {
|
|
544
533
|
* entity_ids: ["854198fa-f702-49db-a381-0427fa87f173"]
|
|
545
534
|
* }
|
|
546
535
|
* })
|
|
547
536
|
*/
|
|
548
|
-
|
|
549
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
537
|
+
removeEntitiesFromDataset(request, requestOptions) {
|
|
538
|
+
return core.HttpResponsePromise.fromPromise(this.__removeEntitiesFromDataset(request, requestOptions));
|
|
550
539
|
}
|
|
551
|
-
|
|
540
|
+
__removeEntitiesFromDataset(request, requestOptions) {
|
|
552
541
|
return __awaiter(this, void 0, void 0, function* () {
|
|
553
542
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
554
543
|
const { dataset_id: datasetId, body: _body } = request;
|
|
@@ -556,7 +545,7 @@ class DatasetsClient {
|
|
|
556
545
|
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);
|
|
557
546
|
const _response = yield core.fetcher({
|
|
558
547
|
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/datasets/${core.url.encodePathParam(datasetId)}/entities`),
|
|
559
|
-
method: "
|
|
548
|
+
method: "DELETE",
|
|
560
549
|
headers: _headers,
|
|
561
550
|
contentType: "application/json",
|
|
562
551
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
@@ -587,15 +576,13 @@ class DatasetsClient {
|
|
|
587
576
|
});
|
|
588
577
|
}
|
|
589
578
|
}
|
|
590
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
579
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/catchAll/datasets/{dataset_id}/entities");
|
|
591
580
|
});
|
|
592
581
|
}
|
|
593
582
|
/**
|
|
594
|
-
*
|
|
595
|
-
* are not deleted — they are only removed from this dataset. Returns
|
|
596
|
-
* the number of entities removed.
|
|
583
|
+
* Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
|
|
597
584
|
*
|
|
598
|
-
* @param {CatchAllApi.
|
|
585
|
+
* @param {CatchAllApi.ListDatasetEntitiesRequest} request
|
|
599
586
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
600
587
|
*
|
|
601
588
|
* @throws {@link CatchAllApi.ForbiddenError}
|
|
@@ -603,25 +590,29 @@ class DatasetsClient {
|
|
|
603
590
|
* @throws {@link CatchAllApi.UnprocessableEntityError}
|
|
604
591
|
*
|
|
605
592
|
* @example
|
|
606
|
-
* await client.datasets.
|
|
593
|
+
* await client.datasets.listEntitiesInDataset({
|
|
607
594
|
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
595
|
+
* page: 1,
|
|
596
|
+
* page_size: 100,
|
|
597
|
+
* search: "OpenAI",
|
|
598
|
+
* status: "ready",
|
|
599
|
+
* entity_type: "company",
|
|
600
|
+
* sort_by: "created_at",
|
|
601
|
+
* sort_order: "desc"
|
|
611
602
|
* })
|
|
612
603
|
*/
|
|
613
|
-
|
|
614
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
604
|
+
listEntitiesInDataset(request, requestOptions) {
|
|
605
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntitiesInDataset(request, requestOptions));
|
|
615
606
|
}
|
|
616
|
-
|
|
607
|
+
__listEntitiesInDataset(request, requestOptions) {
|
|
617
608
|
return __awaiter(this, void 0, void 0, function* () {
|
|
618
609
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
619
|
-
const { dataset_id: datasetId,
|
|
610
|
+
const { dataset_id: datasetId } = request, _body = __rest(request, ["dataset_id"]);
|
|
620
611
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
621
612
|
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);
|
|
622
613
|
const _response = yield core.fetcher({
|
|
623
|
-
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/datasets/${core.url.encodePathParam(datasetId)}/entities`),
|
|
624
|
-
method: "
|
|
614
|
+
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/datasets/${core.url.encodePathParam(datasetId)}/entities/list`),
|
|
615
|
+
method: "POST",
|
|
625
616
|
headers: _headers,
|
|
626
617
|
contentType: "application/json",
|
|
627
618
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
@@ -634,7 +625,10 @@ class DatasetsClient {
|
|
|
634
625
|
logging: this._options.logging,
|
|
635
626
|
});
|
|
636
627
|
if (_response.ok) {
|
|
637
|
-
return {
|
|
628
|
+
return {
|
|
629
|
+
data: _response.body,
|
|
630
|
+
rawResponse: _response.rawResponse,
|
|
631
|
+
};
|
|
638
632
|
}
|
|
639
633
|
if (_response.error.reason === "status-code") {
|
|
640
634
|
switch (_response.error.statusCode) {
|
|
@@ -652,12 +646,11 @@ class DatasetsClient {
|
|
|
652
646
|
});
|
|
653
647
|
}
|
|
654
648
|
}
|
|
655
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
649
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/datasets/{dataset_id}/entities/list");
|
|
656
650
|
});
|
|
657
651
|
}
|
|
658
652
|
/**
|
|
659
|
-
* Returns the full status change history for a dataset, ordered
|
|
660
|
-
* chronologically from oldest to newest.
|
|
653
|
+
* Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
|
|
661
654
|
*
|
|
662
655
|
* @param {CatchAllApi.GetDatasetStatusHistoryRequest} request
|
|
663
656
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -714,11 +707,9 @@ class DatasetsClient {
|
|
|
714
707
|
});
|
|
715
708
|
}
|
|
716
709
|
/**
|
|
717
|
-
* Appends new companies to an existing dataset by uploading a CSV file.
|
|
718
|
-
* Uses the same CSV format as the dataset creation endpoint.
|
|
710
|
+
* Appends new companies to an existing dataset by uploading a CSV file. Uses the same CSV format as the dataset creation endpoint.
|
|
719
711
|
*
|
|
720
|
-
* The response omits `dataset_name` compared to the create-from-CSV
|
|
721
|
-
* endpoint since the dataset already exists.
|
|
712
|
+
* The response omits `dataset_name` compared to the create-from-CSV endpoint since the dataset already exists.
|
|
722
713
|
*
|
|
723
714
|
* @param {CatchAllApi.UploadCsvToDatasetRequest} request
|
|
724
715
|
* @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type * as CatchAllApi from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
|
|
6
|
+
* page: 1,
|
|
7
|
+
* page_size: 100,
|
|
8
|
+
* search: "OpenAI",
|
|
9
|
+
* status: "ready",
|
|
10
|
+
* entity_type: "company",
|
|
11
|
+
* sort_by: "created_at",
|
|
12
|
+
* sort_order: "desc"
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface ListDatasetEntitiesRequest {
|
|
16
|
+
/** Unique dataset identifier. */
|
|
17
|
+
dataset_id: string;
|
|
18
|
+
/** The page number to retrieve. */
|
|
19
|
+
page?: number;
|
|
20
|
+
/** The number of entities per page. */
|
|
21
|
+
page_size?: number;
|
|
22
|
+
/** Filters entities by name using a case-insensitive substring match. */
|
|
23
|
+
search?: string;
|
|
24
|
+
status?: CatchAllApi.EntityStatus;
|
|
25
|
+
entity_type?: CatchAllApi.EntityType;
|
|
26
|
+
sort_by?: CatchAllApi.EntitySortBy;
|
|
27
|
+
sort_order?: CatchAllApi.SortOrder;
|
|
28
|
+
}
|
|
@@ -16,6 +16,5 @@ export interface ListDatasetsRequest {
|
|
|
16
16
|
latest_status?: CatchAllApi.DatasetStatus;
|
|
17
17
|
sort_by?: CatchAllApi.DatasetSortBy;
|
|
18
18
|
sort_order?: CatchAllApi.SortOrder;
|
|
19
|
-
/** Filter results by ownership. Defaults to `all`. */
|
|
20
19
|
ownership?: CatchAllApi.OwnershipFilter;
|
|
21
20
|
}
|
|
@@ -4,8 +4,8 @@ export type { CreateDatasetRequest } from "./CreateDatasetRequest.js";
|
|
|
4
4
|
export type { DeleteDatasetRequest } from "./DeleteDatasetRequest.js";
|
|
5
5
|
export type { GetDatasetRequest } from "./GetDatasetRequest.js";
|
|
6
6
|
export type { GetDatasetStatusHistoryRequest } from "./GetDatasetStatusHistoryRequest.js";
|
|
7
|
+
export type { ListDatasetEntitiesRequest } from "./ListDatasetEntitiesRequest.js";
|
|
7
8
|
export type { ListDatasetsRequest } from "./ListDatasetsRequest.js";
|
|
8
|
-
export type { ListEntitiesInDatasetRequest } from "./ListEntitiesInDatasetRequest.js";
|
|
9
9
|
export type { RemoveEntitiesFromDatasetRequest } from "./RemoveEntitiesFromDatasetRequest.js";
|
|
10
10
|
export type { UpdateDatasetRequest } from "./UpdateDatasetRequest.js";
|
|
11
11
|
export type { UploadCsvToDatasetRequest } from "./UploadCsvToDatasetRequest.js";
|
|
@@ -18,9 +18,7 @@ export declare class EntitiesClient {
|
|
|
18
18
|
protected readonly _options: NormalizedClientOptionsWithAuth<EntitiesClient.Options>;
|
|
19
19
|
constructor(options?: EntitiesClient.Options);
|
|
20
20
|
/**
|
|
21
|
-
* Returns a paginated list of entities belonging to the authenticated
|
|
22
|
-
* organization. Supports filtering by status and entity type, and
|
|
23
|
-
* sorting by name, status, or creation date.
|
|
21
|
+
* Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
|
|
24
22
|
*
|
|
25
23
|
* @param {CatchAllApi.ListEntitiesRequest} request
|
|
26
24
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -65,11 +63,9 @@ export declare class EntitiesClient {
|
|
|
65
63
|
createEntity(request: CatchAllApi.CreateEntityRequest, requestOptions?: EntitiesClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.CreateEntityResponse>;
|
|
66
64
|
private __createEntity;
|
|
67
65
|
/**
|
|
68
|
-
* Creates multiple entities in a single request. Each entity is
|
|
69
|
-
* processed independently — a failure in one does not affect others.
|
|
66
|
+
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
70
67
|
*
|
|
71
|
-
* Returns an array of `{id, status}` objects in the same order as
|
|
72
|
-
* the input array.
|
|
68
|
+
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
73
69
|
*
|
|
74
70
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
75
71
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -74,9 +74,7 @@ class EntitiesClient {
|
|
|
74
74
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Returns a paginated list of entities belonging to the authenticated
|
|
78
|
-
* organization. Supports filtering by status and entity type, and
|
|
79
|
-
* sorting by name, status, or creation date.
|
|
77
|
+
* Returns a paginated list of entities belonging to the authenticated organization. Supports filtering by status and entity type, and sorting by name, status, or creation date.
|
|
80
78
|
*
|
|
81
79
|
* @param {CatchAllApi.ListEntitiesRequest} request
|
|
82
80
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -210,11 +208,9 @@ class EntitiesClient {
|
|
|
210
208
|
});
|
|
211
209
|
}
|
|
212
210
|
/**
|
|
213
|
-
* Creates multiple entities in a single request. Each entity is
|
|
214
|
-
* processed independently — a failure in one does not affect others.
|
|
211
|
+
* Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
|
|
215
212
|
*
|
|
216
|
-
* Returns an array of `{id, status}` objects in the same order as
|
|
217
|
-
* the input array.
|
|
213
|
+
* Returns an array of `{id, status}` objects in the same order as the input array.
|
|
218
214
|
*
|
|
219
215
|
* @param {CatchAllApi.CreateEntitiesBatchRequest} request
|
|
220
216
|
* @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -116,11 +116,9 @@ export declare class JobsClient {
|
|
|
116
116
|
continueJob(request: CatchAllApi.ContinueRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.ContinueResponseDto>;
|
|
117
117
|
private __continueJob;
|
|
118
118
|
/**
|
|
119
|
-
* Soft-deletes a job. The job is flagged as deleted and no longer
|
|
120
|
-
* appears in list results. The underlying data is retained.
|
|
119
|
+
* Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
|
|
121
120
|
*
|
|
122
|
-
* Only the job owner can delete a job. Returns `404` if the job is not
|
|
123
|
-
* found or does not belong to the authenticated user.
|
|
121
|
+
* Only the job owner can delete a job. Returns `404` if the job is not found or does not belong to the authenticated user.
|
|
124
122
|
*
|
|
125
123
|
* Deleting an already-deleted job returns `200`.
|
|
126
124
|
*
|
|
@@ -415,11 +415,9 @@ class JobsClient {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
|
-
* Soft-deletes a job. The job is flagged as deleted and no longer
|
|
419
|
-
* appears in list results. The underlying data is retained.
|
|
418
|
+
* Soft-deletes a job. The job is flagged as deleted and no longer appears in list results. The underlying data is retained.
|
|
420
419
|
*
|
|
421
|
-
* Only the job owner can delete a job. Returns `404` if the job is not
|
|
422
|
-
* found or does not belong to the authenticated user.
|
|
420
|
+
* Only the job owner can delete a job. Returns `404` if the job is not found or does not belong to the authenticated user.
|
|
423
421
|
*
|
|
424
422
|
* Deleting an already-deleted job returns `200`.
|
|
425
423
|
*
|
|
@@ -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
|
/**
|
|
@@ -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",
|
|
@@ -142,7 +142,8 @@ class MonitorsClient {
|
|
|
142
142
|
* @example
|
|
143
143
|
* await client.monitors.createMonitor({
|
|
144
144
|
* reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
|
|
145
|
-
* schedule: "every day at 12 PM
|
|
145
|
+
* schedule: "every day at 12 PM",
|
|
146
|
+
* timezone: "UTC",
|
|
146
147
|
* webhook: {
|
|
147
148
|
* url: "https://your-endpoint.com/webhook",
|
|
148
149
|
* method: "POST",
|