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.
Files changed (63) hide show
  1. package/README.md +12 -2
  2. package/dist/cjs/BaseClient.d.ts +3 -0
  3. package/dist/cjs/BaseClient.js +17 -2
  4. package/dist/cjs/api/resources/datasets/client/Client.d.ts +30 -31
  5. package/dist/cjs/api/resources/datasets/client/Client.js +64 -75
  6. package/dist/cjs/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.ts +28 -0
  7. package/dist/cjs/api/resources/datasets/client/requests/ListDatasetsRequest.d.ts +0 -1
  8. package/dist/cjs/api/resources/datasets/client/requests/index.d.ts +1 -1
  9. package/dist/cjs/api/resources/entities/client/Client.d.ts +3 -7
  10. package/dist/cjs/api/resources/entities/client/Client.js +8 -13
  11. package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -4
  12. package/dist/cjs/api/resources/jobs/client/Client.js +7 -11
  13. package/dist/cjs/api/resources/jobs/client/requests/GetUserJobsRequest.d.ts +0 -1
  14. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +7 -1
  15. package/dist/cjs/api/resources/meta/client/Client.js +3 -3
  16. package/dist/cjs/api/resources/monitors/client/Client.d.ts +2 -1
  17. package/dist/cjs/api/resources/monitors/client/Client.js +16 -17
  18. package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +7 -4
  19. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +0 -1
  20. package/dist/cjs/api/types/ConnectedEntity.d.ts +12 -9
  21. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  22. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  23. package/dist/cjs/core/auth/index.d.ts +1 -1
  24. package/dist/cjs/core/auth/index.js +3 -1
  25. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -0
  26. package/dist/cjs/core/fetcher/Fetcher.js +2 -7
  27. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  28. package/dist/cjs/version.d.ts +1 -1
  29. package/dist/cjs/version.js +1 -1
  30. package/dist/esm/BaseClient.d.mts +3 -0
  31. package/dist/esm/BaseClient.mjs +17 -2
  32. package/dist/esm/api/resources/datasets/client/Client.d.mts +30 -31
  33. package/dist/esm/api/resources/datasets/client/Client.mjs +64 -75
  34. package/dist/esm/api/resources/datasets/client/requests/ListDatasetEntitiesRequest.d.mts +28 -0
  35. package/dist/esm/api/resources/datasets/client/requests/ListDatasetsRequest.d.mts +0 -1
  36. package/dist/esm/api/resources/datasets/client/requests/index.d.mts +1 -1
  37. package/dist/esm/api/resources/entities/client/Client.d.mts +3 -7
  38. package/dist/esm/api/resources/entities/client/Client.mjs +8 -13
  39. package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -4
  40. package/dist/esm/api/resources/jobs/client/Client.mjs +7 -11
  41. package/dist/esm/api/resources/jobs/client/requests/GetUserJobsRequest.d.mts +0 -1
  42. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +7 -1
  43. package/dist/esm/api/resources/meta/client/Client.mjs +3 -3
  44. package/dist/esm/api/resources/monitors/client/Client.d.mts +2 -1
  45. package/dist/esm/api/resources/monitors/client/Client.mjs +16 -17
  46. package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +7 -4
  47. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +0 -1
  48. package/dist/esm/api/types/ConnectedEntity.d.mts +12 -9
  49. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  50. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  51. package/dist/esm/core/auth/index.d.mts +1 -1
  52. package/dist/esm/core/auth/index.mjs +1 -0
  53. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -0
  54. package/dist/esm/core/fetcher/Fetcher.mjs +2 -7
  55. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  56. package/dist/esm/version.d.mts +1 -1
  57. package/dist/esm/version.mjs +1 -1
  58. package/package.json +2 -2
  59. package/reference.md +35 -42
  60. package/dist/cjs/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.ts +0 -21
  61. package/dist/esm/api/resources/datasets/client/requests/ListEntitiesInDatasetRequest.d.mts +0 -21
  62. /package/dist/cjs/api/resources/datasets/client/requests/{ListEntitiesInDatasetRequest.js → ListDatasetEntitiesRequest.js} +0 -0
  63. /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
- A request is deemed retryable when any of the following HTTP status codes is returned:
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/500) (Internal Server Errors)
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
 
@@ -364,3 +372,5 @@ On the other hand, contributions to the README are always very welcome!
364
372
 
365
373
 
366
374
 
375
+
376
+
@@ -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. */
@@ -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": "1.5.0",
47
- "User-Agent": "newscatcher-catchall-sdk/1.5.0",
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 the full status change history for a dataset, ordered
207
- * chronologically from oldest to newest.
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.
@@ -110,7 +108,6 @@ class DatasetsClient {
110
108
  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"),
111
109
  method: "GET",
112
110
  headers: _headers,
113
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
114
111
  queryString: core.url
115
112
  .queryBuilder()
116
113
  .addMany(_queryParams)
@@ -177,7 +174,7 @@ class DatasetsClient {
177
174
  method: "POST",
178
175
  headers: _headers,
179
176
  contentType: "application/json",
180
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
177
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
181
178
  requestType: "json",
182
179
  body: request,
183
180
  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,
@@ -209,9 +206,7 @@ class DatasetsClient {
209
206
  });
210
207
  }
211
208
  /**
212
- * Creates a new dataset by uploading a CSV file. Each row in the CSV
213
- * becomes an entity. The `name` column is required; all other columns
214
- * 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.
215
210
  *
216
211
  * **CSV format:**
217
212
  * ```csv
@@ -256,7 +251,7 @@ class DatasetsClient {
256
251
  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/upload"),
257
252
  method: "POST",
258
253
  headers: _headers,
259
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
254
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
260
255
  requestType: "file",
261
256
  duplex: _maybeEncodedRequest.duplex,
262
257
  body: _maybeEncodedRequest.body,
@@ -313,7 +308,7 @@ class DatasetsClient {
313
308
  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)}`),
314
309
  method: "GET",
315
310
  headers: _headers,
316
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
311
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
317
312
  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,
318
313
  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,
319
314
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -369,7 +364,7 @@ class DatasetsClient {
369
364
  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)}`),
370
365
  method: "DELETE",
371
366
  headers: _headers,
372
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
367
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
373
368
  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,
374
369
  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,
375
370
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -427,7 +422,7 @@ class DatasetsClient {
427
422
  method: "PATCH",
428
423
  headers: _headers,
429
424
  contentType: "application/json",
430
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
425
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
431
426
  requestType: "json",
432
427
  body: _body,
433
428
  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,
@@ -459,47 +454,40 @@ class DatasetsClient {
459
454
  });
460
455
  }
461
456
  /**
462
- * Returns a paginated list of entities in a dataset. Supports filtering by status and entity type.
457
+ * Adds one or more existing entities to a dataset. Returns the number of entities added.
463
458
  *
464
- * @param {CatchAllApi.ListEntitiesInDatasetRequest} request
459
+ * @param {CatchAllApi.AddEntitiesToDatasetRequest} request
465
460
  * @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
466
461
  *
467
462
  * @throws {@link CatchAllApi.ForbiddenError}
468
463
  * @throws {@link CatchAllApi.NotFoundError}
464
+ * @throws {@link CatchAllApi.UnprocessableEntityError}
469
465
  *
470
466
  * @example
471
- * await client.datasets.listEntitiesInDataset({
472
- * 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
+ * }
473
472
  * })
474
473
  */
475
- listEntitiesInDataset(request, requestOptions) {
476
- return core.HttpResponsePromise.fromPromise(this.__listEntitiesInDataset(request, requestOptions));
474
+ addEntitiesToDataset(request, requestOptions) {
475
+ return core.HttpResponsePromise.fromPromise(this.__addEntitiesToDataset(request, requestOptions));
477
476
  }
478
- __listEntitiesInDataset(request, requestOptions) {
477
+ __addEntitiesToDataset(request, requestOptions) {
479
478
  return __awaiter(this, void 0, void 0, function* () {
480
479
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
481
- const { dataset_id: datasetId, page, page_size: pageSize, search, status, entity_type: entityType, sort_by: sortBy, sort_order: sortOrder, } = request;
482
- const _queryParams = {
483
- page,
484
- page_size: pageSize,
485
- search,
486
- status: status != null ? status : undefined,
487
- entity_type: entityType != null ? entityType : undefined,
488
- sort_by: sortBy != null ? sortBy : undefined,
489
- sort_order: sortOrder != null ? sortOrder : undefined,
490
- };
480
+ const { dataset_id: datasetId, body: _body } = request;
491
481
  const _authRequest = yield this._options.authProvider.getAuthRequest();
492
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);
493
483
  const _response = yield core.fetcher({
494
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`),
495
- method: "GET",
485
+ method: "POST",
496
486
  headers: _headers,
497
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
498
- queryString: core.url
499
- .queryBuilder()
500
- .addMany(_queryParams)
501
- .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
502
- .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,
503
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,
504
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,
505
493
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -507,10 +495,7 @@ class DatasetsClient {
507
495
  logging: this._options.logging,
508
496
  });
509
497
  if (_response.ok) {
510
- return {
511
- data: _response.body,
512
- rawResponse: _response.rawResponse,
513
- };
498
+ return { data: _response.body, rawResponse: _response.rawResponse };
514
499
  }
515
500
  if (_response.error.reason === "status-code") {
516
501
  switch (_response.error.statusCode) {
@@ -518,6 +503,8 @@ class DatasetsClient {
518
503
  throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
519
504
  case 404:
520
505
  throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
506
+ case 422:
507
+ throw new CatchAllApi.UnprocessableEntityError(_response.error.body, _response.rawResponse);
521
508
  default:
522
509
  throw new errors.CatchAllApiError({
523
510
  statusCode: _response.error.statusCode,
@@ -526,13 +513,13 @@ class DatasetsClient {
526
513
  });
527
514
  }
528
515
  }
529
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/catchAll/datasets/{dataset_id}/entities");
516
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/datasets/{dataset_id}/entities");
530
517
  });
531
518
  }
532
519
  /**
533
- * Adds one or more existing entities to a dataset. Returns the number of entities added.
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.
534
521
  *
535
- * @param {CatchAllApi.AddEntitiesToDatasetRequest} request
522
+ * @param {CatchAllApi.RemoveEntitiesFromDatasetRequest} request
536
523
  * @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
537
524
  *
538
525
  * @throws {@link CatchAllApi.ForbiddenError}
@@ -540,17 +527,17 @@ class DatasetsClient {
540
527
  * @throws {@link CatchAllApi.UnprocessableEntityError}
541
528
  *
542
529
  * @example
543
- * await client.datasets.addEntitiesToDataset({
530
+ * await client.datasets.removeEntitiesFromDataset({
544
531
  * dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
545
532
  * body: {
546
533
  * entity_ids: ["854198fa-f702-49db-a381-0427fa87f173"]
547
534
  * }
548
535
  * })
549
536
  */
550
- addEntitiesToDataset(request, requestOptions) {
551
- return core.HttpResponsePromise.fromPromise(this.__addEntitiesToDataset(request, requestOptions));
537
+ removeEntitiesFromDataset(request, requestOptions) {
538
+ return core.HttpResponsePromise.fromPromise(this.__removeEntitiesFromDataset(request, requestOptions));
552
539
  }
553
- __addEntitiesToDataset(request, requestOptions) {
540
+ __removeEntitiesFromDataset(request, requestOptions) {
554
541
  return __awaiter(this, void 0, void 0, function* () {
555
542
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
556
543
  const { dataset_id: datasetId, body: _body } = request;
@@ -558,10 +545,10 @@ class DatasetsClient {
558
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);
559
546
  const _response = yield core.fetcher({
560
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`),
561
- method: "POST",
548
+ method: "DELETE",
562
549
  headers: _headers,
563
550
  contentType: "application/json",
564
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
551
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
565
552
  requestType: "json",
566
553
  body: _body,
567
554
  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,
@@ -589,15 +576,13 @@ class DatasetsClient {
589
576
  });
590
577
  }
591
578
  }
592
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/datasets/{dataset_id}/entities");
579
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/catchAll/datasets/{dataset_id}/entities");
593
580
  });
594
581
  }
595
582
  /**
596
- * Removes one or more entities from a dataset. The entities themselves
597
- * are not deleted — they are only removed from this dataset. Returns
598
- * the number of entities removed.
583
+ * Returns a paginated list of entities in a dataset. Supports filtering by status, entity type, and name search.
599
584
  *
600
- * @param {CatchAllApi.RemoveEntitiesFromDatasetRequest} request
585
+ * @param {CatchAllApi.ListDatasetEntitiesRequest} request
601
586
  * @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
602
587
  *
603
588
  * @throws {@link CatchAllApi.ForbiddenError}
@@ -605,28 +590,32 @@ class DatasetsClient {
605
590
  * @throws {@link CatchAllApi.UnprocessableEntityError}
606
591
  *
607
592
  * @example
608
- * await client.datasets.removeEntitiesFromDataset({
593
+ * await client.datasets.listEntitiesInDataset({
609
594
  * dataset_id: "ccabb755-afc2-4047-b84c-78d1f23d49b2",
610
- * body: {
611
- * entity_ids: ["854198fa-f702-49db-a381-0427fa87f173"]
612
- * }
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"
613
602
  * })
614
603
  */
615
- removeEntitiesFromDataset(request, requestOptions) {
616
- return core.HttpResponsePromise.fromPromise(this.__removeEntitiesFromDataset(request, requestOptions));
604
+ listEntitiesInDataset(request, requestOptions) {
605
+ return core.HttpResponsePromise.fromPromise(this.__listEntitiesInDataset(request, requestOptions));
617
606
  }
618
- __removeEntitiesFromDataset(request, requestOptions) {
607
+ __listEntitiesInDataset(request, requestOptions) {
619
608
  return __awaiter(this, void 0, void 0, function* () {
620
609
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
621
- const { dataset_id: datasetId, body: _body } = request;
610
+ const { dataset_id: datasetId } = request, _body = __rest(request, ["dataset_id"]);
622
611
  const _authRequest = yield this._options.authProvider.getAuthRequest();
623
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);
624
613
  const _response = yield core.fetcher({
625
- 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`),
626
- method: "DELETE",
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",
627
616
  headers: _headers,
628
617
  contentType: "application/json",
629
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
618
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
630
619
  requestType: "json",
631
620
  body: _body,
632
621
  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,
@@ -636,7 +625,10 @@ class DatasetsClient {
636
625
  logging: this._options.logging,
637
626
  });
638
627
  if (_response.ok) {
639
- return { data: _response.body, rawResponse: _response.rawResponse };
628
+ return {
629
+ data: _response.body,
630
+ rawResponse: _response.rawResponse,
631
+ };
640
632
  }
641
633
  if (_response.error.reason === "status-code") {
642
634
  switch (_response.error.statusCode) {
@@ -654,12 +646,11 @@ class DatasetsClient {
654
646
  });
655
647
  }
656
648
  }
657
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/catchAll/datasets/{dataset_id}/entities");
649
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/catchAll/datasets/{dataset_id}/entities/list");
658
650
  });
659
651
  }
660
652
  /**
661
- * Returns the full status change history for a dataset, ordered
662
- * chronologically from oldest to newest.
653
+ * Returns the full status change history for a dataset, ordered chronologically from oldest to newest.
663
654
  *
664
655
  * @param {CatchAllApi.GetDatasetStatusHistoryRequest} request
665
656
  * @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -685,7 +676,7 @@ class DatasetsClient {
685
676
  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)}/status`),
686
677
  method: "GET",
687
678
  headers: _headers,
688
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
679
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
689
680
  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,
690
681
  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,
691
682
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -716,11 +707,9 @@ class DatasetsClient {
716
707
  });
717
708
  }
718
709
  /**
719
- * Appends new companies to an existing dataset by uploading a CSV file.
720
- * 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.
721
711
  *
722
- * The response omits `dataset_name` compared to the create-from-CSV
723
- * endpoint since the dataset already exists.
712
+ * The response omits `dataset_name` compared to the create-from-CSV endpoint since the dataset already exists.
724
713
  *
725
714
  * @param {CatchAllApi.UploadCsvToDatasetRequest} request
726
715
  * @param {DatasetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -751,7 +740,7 @@ class DatasetsClient {
751
740
  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(request.dataset_id)}/upload`),
752
741
  method: "POST",
753
742
  headers: _headers,
754
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
743
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
755
744
  requestType: "file",
756
745
  duplex: _maybeEncodedRequest.duplex,
757
746
  body: _maybeEncodedRequest.body,
@@ -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.