newscatcher-catchall-sdk 3.0.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/BaseClient.d.ts +12 -0
  3. package/dist/cjs/BaseClient.js +2 -2
  4. package/dist/cjs/api/errors/BadRequestError.js +1 -1
  5. package/dist/cjs/api/errors/ForbiddenError.js +1 -1
  6. package/dist/cjs/api/errors/NotFoundError.js +1 -1
  7. package/dist/cjs/api/errors/UnauthorizedError.js +1 -1
  8. package/dist/cjs/api/errors/UnprocessableEntityError.js +1 -1
  9. package/dist/cjs/api/resources/datasets/client/Client.d.ts +5 -3
  10. package/dist/cjs/api/resources/datasets/client/Client.js +11 -8
  11. package/dist/cjs/api/resources/entities/client/Client.d.ts +8 -6
  12. package/dist/cjs/api/resources/entities/client/Client.js +12 -9
  13. package/dist/cjs/api/resources/entities/client/requests/UpdateEntityRequest.d.ts +3 -1
  14. package/dist/cjs/api/resources/jobs/client/Client.d.ts +16 -0
  15. package/dist/cjs/api/resources/jobs/client/Client.js +60 -4
  16. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.ts +10 -0
  17. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsCsvRequest.js +3 -0
  18. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +4 -0
  19. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/monitors/client/Client.d.ts +16 -0
  21. package/dist/cjs/api/resources/monitors/client/Client.js +59 -3
  22. package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.ts +10 -0
  23. package/dist/cjs/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.js +3 -0
  24. package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/projects/client/Client.js +4 -3
  26. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +25 -0
  27. package/dist/cjs/api/resources/webhooks/client/Client.js +78 -4
  28. package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.ts +2 -2
  29. package/dist/cjs/api/resources/webhooks/client/requests/TriggerWebhookRequest.d.ts +23 -0
  30. package/dist/cjs/api/resources/webhooks/client/requests/TriggerWebhookRequest.js +3 -0
  31. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.ts +2 -2
  32. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
  33. package/dist/cjs/api/types/CompanyAttributes.d.ts +0 -2
  34. package/dist/cjs/api/types/ConnectedDataset.d.ts +11 -0
  35. package/dist/cjs/api/types/ConnectedDataset.js +3 -0
  36. package/dist/cjs/api/types/ConnectedEntity.d.ts +2 -0
  37. package/dist/cjs/api/types/CreateEntityRequest.d.ts +6 -2
  38. package/dist/cjs/api/types/DatasetResponse.d.ts +15 -0
  39. package/dist/cjs/api/types/EntityResponse.d.ts +2 -0
  40. package/dist/cjs/api/types/EntitySummary.d.ts +2 -0
  41. package/dist/cjs/api/types/FormatterConfigDto.d.ts +15 -0
  42. package/dist/cjs/api/types/FormatterConfigDto.js +3 -0
  43. package/dist/cjs/api/types/InitializeResponseDto.d.ts +6 -1
  44. package/dist/cjs/api/types/PullJobResponseDto.d.ts +4 -0
  45. package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +4 -0
  46. package/dist/cjs/api/types/WebhookResponseDto.d.ts +2 -2
  47. package/dist/cjs/api/types/index.d.ts +2 -0
  48. package/dist/cjs/api/types/index.js +2 -0
  49. package/dist/cjs/core/file/file.js +3 -0
  50. package/dist/cjs/core/form-data-utils/FormDataWrapper.js +3 -0
  51. package/dist/cjs/core/requestBody.d.ts +12 -0
  52. package/dist/cjs/core/requestBody.js +26 -0
  53. package/dist/cjs/core/url/qs.js +2 -2
  54. package/dist/cjs/errors/CatchAllApiError.d.ts +1 -0
  55. package/dist/cjs/errors/CatchAllApiError.js +5 -1
  56. package/dist/cjs/errors/CatchAllApiTimeoutError.d.ts +2 -2
  57. package/dist/cjs/errors/CatchAllApiTimeoutError.js +40 -6
  58. package/dist/cjs/version.d.ts +1 -1
  59. package/dist/cjs/version.js +1 -1
  60. package/dist/esm/BaseClient.d.mts +12 -0
  61. package/dist/esm/BaseClient.mjs +2 -2
  62. package/dist/esm/api/errors/BadRequestError.mjs +1 -1
  63. package/dist/esm/api/errors/ForbiddenError.mjs +1 -1
  64. package/dist/esm/api/errors/NotFoundError.mjs +1 -1
  65. package/dist/esm/api/errors/UnauthorizedError.mjs +1 -1
  66. package/dist/esm/api/errors/UnprocessableEntityError.mjs +1 -1
  67. package/dist/esm/api/resources/datasets/client/Client.d.mts +5 -3
  68. package/dist/esm/api/resources/datasets/client/Client.mjs +11 -8
  69. package/dist/esm/api/resources/entities/client/Client.d.mts +8 -6
  70. package/dist/esm/api/resources/entities/client/Client.mjs +12 -9
  71. package/dist/esm/api/resources/entities/client/requests/UpdateEntityRequest.d.mts +3 -1
  72. package/dist/esm/api/resources/jobs/client/Client.d.mts +16 -0
  73. package/dist/esm/api/resources/jobs/client/Client.mjs +60 -4
  74. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.d.mts +10 -0
  75. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsCsvRequest.mjs +2 -0
  76. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +4 -0
  77. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
  78. package/dist/esm/api/resources/monitors/client/Client.d.mts +16 -0
  79. package/dist/esm/api/resources/monitors/client/Client.mjs +59 -3
  80. package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.d.mts +10 -0
  81. package/dist/esm/api/resources/monitors/client/requests/PullMonitorResultsCsvRequest.mjs +2 -0
  82. package/dist/esm/api/resources/monitors/client/requests/index.d.mts +1 -0
  83. package/dist/esm/api/resources/projects/client/Client.mjs +4 -3
  84. package/dist/esm/api/resources/webhooks/client/Client.d.mts +25 -0
  85. package/dist/esm/api/resources/webhooks/client/Client.mjs +78 -4
  86. package/dist/esm/api/resources/webhooks/client/requests/CreateWebhookRequestDto.d.mts +2 -2
  87. package/dist/esm/api/resources/webhooks/client/requests/TriggerWebhookRequest.d.mts +23 -0
  88. package/dist/esm/api/resources/webhooks/client/requests/TriggerWebhookRequest.mjs +2 -0
  89. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequestDto.d.mts +2 -2
  90. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
  91. package/dist/esm/api/types/CompanyAttributes.d.mts +0 -2
  92. package/dist/esm/api/types/ConnectedDataset.d.mts +11 -0
  93. package/dist/esm/api/types/ConnectedDataset.mjs +2 -0
  94. package/dist/esm/api/types/ConnectedEntity.d.mts +2 -0
  95. package/dist/esm/api/types/CreateEntityRequest.d.mts +6 -2
  96. package/dist/esm/api/types/DatasetResponse.d.mts +15 -0
  97. package/dist/esm/api/types/EntityResponse.d.mts +2 -0
  98. package/dist/esm/api/types/EntitySummary.d.mts +2 -0
  99. package/dist/esm/api/types/FormatterConfigDto.d.mts +15 -0
  100. package/dist/esm/api/types/FormatterConfigDto.mjs +2 -0
  101. package/dist/esm/api/types/InitializeResponseDto.d.mts +6 -1
  102. package/dist/esm/api/types/PullJobResponseDto.d.mts +4 -0
  103. package/dist/esm/api/types/PullMonitorResponseDto.d.mts +4 -0
  104. package/dist/esm/api/types/WebhookResponseDto.d.mts +2 -2
  105. package/dist/esm/api/types/index.d.mts +2 -0
  106. package/dist/esm/api/types/index.mjs +2 -0
  107. package/dist/esm/core/file/file.mjs +3 -0
  108. package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +3 -0
  109. package/dist/esm/core/requestBody.d.mts +12 -0
  110. package/dist/esm/core/requestBody.mjs +23 -0
  111. package/dist/esm/core/url/qs.mjs +2 -2
  112. package/dist/esm/errors/CatchAllApiError.d.mts +1 -0
  113. package/dist/esm/errors/CatchAllApiError.mjs +5 -1
  114. package/dist/esm/errors/CatchAllApiTimeoutError.d.mts +2 -2
  115. package/dist/esm/errors/CatchAllApiTimeoutError.mjs +7 -6
  116. package/dist/esm/version.d.mts +1 -1
  117. package/dist/esm/version.mjs +1 -1
  118. package/package.json +1 -1
  119. package/reference.md +216 -9
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeAdditionalBodyParameters = mergeAdditionalBodyParameters;
4
+ /**
5
+ * Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
6
+ * on top of the request body. Caller-supplied properties win over the endpoint body. When no
7
+ * additional body parameters are provided, the original body is returned unchanged so serialization
8
+ * is unaffected.
9
+ *
10
+ * The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
11
+ * the additional parameters become the body; when the body is an array or a primitive JSON value it
12
+ * is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
13
+ * SDK, which only merges additional body parameters into mapping bodies.
14
+ */
15
+ function mergeAdditionalBodyParameters(body, additionalBodyParameters) {
16
+ if (additionalBodyParameters == null) {
17
+ return body;
18
+ }
19
+ if (body == null) {
20
+ return Object.assign({}, additionalBodyParameters);
21
+ }
22
+ if (typeof body === "object" && !Array.isArray(body)) {
23
+ return Object.assign(Object.assign({}, body), additionalBodyParameters);
24
+ }
25
+ return body;
26
+ }
@@ -19,7 +19,7 @@ function stringifyObject(obj, prefix = "", options) {
19
19
  const parts = [];
20
20
  for (const [key, value] of Object.entries(obj)) {
21
21
  const fullKey = prefix ? `${prefix}[${key}]` : key;
22
- if (value === undefined) {
22
+ if (value == null) {
23
23
  continue;
24
24
  }
25
25
  if (Array.isArray(value)) {
@@ -39,7 +39,7 @@ function stringifyObject(obj, prefix = "", options) {
39
39
  else {
40
40
  for (let i = 0; i < value.length; i++) {
41
41
  const item = value[i];
42
- if (item === undefined) {
42
+ if (item == null) {
43
43
  continue;
44
44
  }
45
45
  if (typeof item === "object" && !Array.isArray(item) && item !== null) {
@@ -11,4 +11,5 @@ export declare class CatchAllApiError extends Error {
11
11
  rawResponse?: core.RawResponse;
12
12
  cause?: unknown;
13
13
  });
14
+ get requestId(): string | undefined;
14
15
  }
@@ -10,7 +10,7 @@ class CatchAllApiError extends Error {
10
10
  if (Error.captureStackTrace) {
11
11
  Error.captureStackTrace(this, this.constructor);
12
12
  }
13
- this.name = this.constructor.name;
13
+ this.name = "CatchAllApiError";
14
14
  this.statusCode = statusCode;
15
15
  this.body = body;
16
16
  this.rawResponse = rawResponse;
@@ -18,6 +18,10 @@ class CatchAllApiError extends Error {
18
18
  this.cause = cause;
19
19
  }
20
20
  }
21
+ get requestId() {
22
+ var _a, _b, _c;
23
+ return (_c = (_b = (_a = this.rawResponse) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.get("x-request-id")) !== null && _c !== void 0 ? _c : undefined;
24
+ }
21
25
  }
22
26
  exports.CatchAllApiError = CatchAllApiError;
23
27
  function buildMessage({ message, statusCode, body, }) {
@@ -1,5 +1,5 @@
1
- export declare class CatchAllApiTimeoutError extends Error {
2
- readonly cause?: unknown;
1
+ import * as errors from "./index.js";
2
+ export declare class CatchAllApiTimeoutError extends errors.CatchAllApiError {
3
3
  constructor(message: string, opts?: {
4
4
  cause?: unknown;
5
5
  });
@@ -1,18 +1,52 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
3
36
  Object.defineProperty(exports, "__esModule", { value: true });
4
37
  exports.CatchAllApiTimeoutError = void 0;
5
- class CatchAllApiTimeoutError extends Error {
38
+ const errors = __importStar(require("./index.js"));
39
+ class CatchAllApiTimeoutError extends errors.CatchAllApiError {
6
40
  constructor(message, opts) {
7
- super(message);
41
+ super({
42
+ message: message,
43
+ cause: opts === null || opts === void 0 ? void 0 : opts.cause,
44
+ });
8
45
  Object.setPrototypeOf(this, new.target.prototype);
9
46
  if (Error.captureStackTrace) {
10
47
  Error.captureStackTrace(this, this.constructor);
11
48
  }
12
- this.name = this.constructor.name;
13
- if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
14
- this.cause = opts.cause;
15
- }
49
+ this.name = "CatchAllApiTimeoutError";
16
50
  }
17
51
  }
18
52
  exports.CatchAllApiTimeoutError = CatchAllApiTimeoutError;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.0.1";
1
+ export declare const SDK_VERSION = "4.0.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "3.0.1";
4
+ exports.SDK_VERSION = "4.0.1";
@@ -16,6 +16,11 @@ export type BaseClientOptions = {
16
16
  fetch?: typeof fetch;
17
17
  /** Configure logging for the client. */
18
18
  logging?: core.logging.LogConfig | core.logging.Logger;
19
+ /** Default options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
20
+ stream?: {
21
+ reconnectionEnabled?: boolean;
22
+ maxReconnectionAttempts?: number;
23
+ };
19
24
  /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
20
25
  auth?: AuthOption;
21
26
  } & HeaderAuthProvider.AuthOptions;
@@ -28,8 +33,15 @@ export interface BaseRequestOptions {
28
33
  abortSignal?: AbortSignal;
29
34
  /** Additional query string parameters to include in the request. */
30
35
  queryParams?: Record<string, unknown>;
36
+ /** A dictionary containing additional parameters to spread into the request's body. */
37
+ additionalBodyParameters?: Record<string, unknown>;
31
38
  /** Additional headers to include in the request. */
32
39
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
40
+ /** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */
41
+ stream?: {
42
+ reconnectionEnabled?: boolean;
43
+ maxReconnectionAttempts?: number;
44
+ };
33
45
  }
34
46
  export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
35
47
  logging: core.logging.Logger;
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "newscatcher-catchall-sdk",
9
- "X-Fern-SDK-Version": "3.0.1",
10
- "User-Agent": "newscatcher-catchall-sdk/3.0.1",
9
+ "X-Fern-SDK-Version": "4.0.1",
10
+ "User-Agent": "newscatcher-catchall-sdk/4.0.1",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -12,6 +12,6 @@ export class BadRequestError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "BadRequestError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class ForbiddenError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "ForbiddenError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class NotFoundError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "NotFoundError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class UnauthorizedError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "UnauthorizedError";
16
16
  }
17
17
  }
@@ -12,6 +12,6 @@ export class UnprocessableEntityError extends errors.CatchAllApiError {
12
12
  if (Error.captureStackTrace) {
13
13
  Error.captureStackTrace(this, this.constructor);
14
14
  }
15
- this.name = this.constructor.name;
15
+ this.name = "UnprocessableEntityError";
16
16
  }
17
17
  }
@@ -34,7 +34,9 @@ export declare class DatasetsClient {
34
34
  listDatasets(request?: CatchAllApi.ListDatasetsRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetListResponse>;
35
35
  private __listDatasets;
36
36
  /**
37
- * Creates a new dataset from a list of existing entity IDs.
37
+ * Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
38
+ *
39
+ * Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
38
40
  *
39
41
  * If any of the provided entity IDs do not exist or do not belong to
40
42
  * your organization, the request fails with `400`. All entity IDs must
@@ -60,12 +62,12 @@ export declare class DatasetsClient {
60
62
  createDataset(request: CatchAllApi.CreateDatasetRequest, requestOptions?: DatasetsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.DatasetResponse>;
61
63
  private __createDataset;
62
64
  /**
63
- * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. The `name` and `domain`columns are required; all other columns are optional.
65
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
64
66
  *
65
67
  * **CSV format:**
66
68
  * ```csv
67
69
  * name,description,domain,alternative_names,key_persons
68
- * NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
70
+ * NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
69
71
  * OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
70
72
  * ```
71
73
  *
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
23
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
25
26
  import * as environments from "../../../../environments.mjs";
26
27
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
27
28
  import * as errors from "../../../../errors/index.mjs";
@@ -104,7 +105,9 @@ export class DatasetsClient {
104
105
  });
105
106
  }
106
107
  /**
107
- * Creates a new dataset from a list of existing entity IDs.
108
+ * Creates a new dataset from a list of existing entity IDs. The optional `description` field here describes the dataset itself — it is separate from the entity-level `description` used for matching.
109
+ *
110
+ * Entities must be created before adding them to a dataset. Each entity requires a `name` plus at least one of: a `description` or a `domain`. Use [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) or [Create entities batch](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entities-batch) to create entities first.
108
111
  *
109
112
  * If any of the provided entity IDs do not exist or do not belong to
110
113
  * your organization, the request fails with `400`. All entity IDs must
@@ -142,7 +145,7 @@ export class DatasetsClient {
142
145
  contentType: "application/json",
143
146
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
144
147
  requestType: "json",
145
- body: request,
148
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
146
149
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
147
150
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
148
151
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -172,12 +175,12 @@ export class DatasetsClient {
172
175
  });
173
176
  }
174
177
  /**
175
- * 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.
178
+ * Creates a new dataset by uploading a CSV file. Each row in the CSV becomes an entity. Each row requires a `name` plus at least one of: a `description` or a `domain`; all other columns are optional. Note: `description` in the CSV is the entity's matching description — it is separate from the dataset-level `description` field in the form data.
176
179
  *
177
180
  * **CSV format:**
178
181
  * ```csv
179
182
  * name,description,domain,alternative_names,key_persons
180
- * NewsCatcher,"AI-powered news data provider",newscatcherapi.com,"NC;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
183
+ * NewsCatcher,"NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",newscatcherapi.com,"NewsCatcher CatchAll;NewsCatcher API","Artem Bugara;Maksym Sugonyaka"
181
184
  * OpenAI,"Artificial intelligence research company",openai.com,"Open AI","Sam Altman"
182
185
  * ```
183
186
  *
@@ -390,7 +393,7 @@ export class DatasetsClient {
390
393
  contentType: "application/json",
391
394
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
392
395
  requestType: "json",
393
- body: _body,
396
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
394
397
  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,
395
398
  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,
396
399
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -453,7 +456,7 @@ export class DatasetsClient {
453
456
  contentType: "application/json",
454
457
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
455
458
  requestType: "json",
456
- body: _body,
459
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
457
460
  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,
458
461
  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,
459
462
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -516,7 +519,7 @@ export class DatasetsClient {
516
519
  contentType: "application/json",
517
520
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
518
521
  requestType: "json",
519
- body: _body,
522
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
520
523
  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,
521
524
  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,
522
525
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -583,7 +586,7 @@ export class DatasetsClient {
583
586
  contentType: "application/json",
584
587
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
585
588
  requestType: "json",
586
- body: _body,
589
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
587
590
  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,
588
591
  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,
589
592
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -35,10 +35,10 @@ export declare class EntitiesClient {
35
35
  /**
36
36
  * Creates a new company entity and begins background enrichment.
37
37
  *
38
+ * Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
39
+ *
38
40
  * The entity status starts as `pending` and transitions to `ready` once
39
- * enrichment completes. Provide as much identifying information as
40
- * possible — `domain` is the highest-signal field because it is
41
- * unambiguous.
41
+ * enrichment completes.
42
42
  *
43
43
  * @param {CatchAllApi.CreateEntityRequest} request
44
44
  * @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -50,12 +50,12 @@ export declare class EntitiesClient {
50
50
  * await client.entities.createEntity({
51
51
  * name: "NewsCatcher",
52
52
  * entity_type: "company",
53
- * description: "AI-powered news data provider",
53
+ * description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
54
54
  * additional_attributes: {
55
55
  * company_attributes: {
56
56
  * domain: "newscatcherapi.com",
57
57
  * key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
58
- * alternative_names: ["NC", "NewsCatcher API"]
58
+ * alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
59
59
  * }
60
60
  * }
61
61
  * })
@@ -65,6 +65,8 @@ export declare class EntitiesClient {
65
65
  /**
66
66
  * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
67
67
  *
68
+ * Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
69
+ *
68
70
  * Returns an array of `{id, status}` objects in the same order as the input array.
69
71
  *
70
72
  * @param {CatchAllApi.CreateEntitiesBatchRequest} request
@@ -150,7 +152,7 @@ export declare class EntitiesClient {
150
152
  * description: "Updated description",
151
153
  * additional_attributes: {
152
154
  * company_attributes: {
153
- * alternative_names: ["NC", "NewsCatcher API", "NCA"]
155
+ * alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
154
156
  * }
155
157
  * }
156
158
  * })
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
23
  import { mergeHeaders } from "../../../../core/headers.mjs";
24
24
  import * as core from "../../../../core/index.mjs";
25
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
25
26
  import * as environments from "../../../../environments.mjs";
26
27
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
27
28
  import * as errors from "../../../../errors/index.mjs";
@@ -104,10 +105,10 @@ export class EntitiesClient {
104
105
  /**
105
106
  * Creates a new company entity and begins background enrichment.
106
107
  *
108
+ * Each entity requires a `name` plus at least one of: a `description` or a `domain`. Providing both is recommended — `domain` is the highest-signal identifier because it is unambiguous; a well-written `description` is the best alternative when no domain is available.
109
+ *
107
110
  * The entity status starts as `pending` and transitions to `ready` once
108
- * enrichment completes. Provide as much identifying information as
109
- * possible — `domain` is the highest-signal field because it is
110
- * unambiguous.
111
+ * enrichment completes.
111
112
  *
112
113
  * @param {CatchAllApi.CreateEntityRequest} request
113
114
  * @param {EntitiesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -119,12 +120,12 @@ export class EntitiesClient {
119
120
  * await client.entities.createEntity({
120
121
  * name: "NewsCatcher",
121
122
  * entity_type: "company",
122
- * description: "AI-powered news data provider",
123
+ * description: "NewsCatcher is a data-as-a-service company providing news intelligence APIs including the CatchAll Web Search API (2B+ web pages indexed) and News API (140,000+ sources, 100+ countries).",
123
124
  * additional_attributes: {
124
125
  * company_attributes: {
125
126
  * domain: "newscatcherapi.com",
126
127
  * key_persons: ["Artem Bugara", "Maksym Sugonyaka"],
127
- * alternative_names: ["NC", "NewsCatcher API"]
128
+ * alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API"]
128
129
  * }
129
130
  * }
130
131
  * })
@@ -144,7 +145,7 @@ export class EntitiesClient {
144
145
  contentType: "application/json",
145
146
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
146
147
  requestType: "json",
147
- body: request,
148
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
148
149
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
149
150
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
150
151
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -174,6 +175,8 @@ export class EntitiesClient {
174
175
  /**
175
176
  * Creates multiple entities in a single request. Each entity is processed independently — a failure in one does not affect others.
176
177
  *
178
+ * Each entity requires a `name` plus at least one of: a `description` or a `domain`. See [Create entity](https://www.newscatcherapi.com/docs/web-search-api/api-reference/entities/create-entity) for the full field reference.
179
+ *
177
180
  * Returns an array of `{id, status}` objects in the same order as the input array.
178
181
  *
179
182
  * @param {CatchAllApi.CreateEntitiesBatchRequest} request
@@ -223,7 +226,7 @@ export class EntitiesClient {
223
226
  contentType: "application/json",
224
227
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
225
228
  requestType: "json",
226
- body: request,
229
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
227
230
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
228
231
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
229
232
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -378,7 +381,7 @@ export class EntitiesClient {
378
381
  * description: "Updated description",
379
382
  * additional_attributes: {
380
383
  * company_attributes: {
381
- * alternative_names: ["NC", "NewsCatcher API", "NCA"]
384
+ * alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
382
385
  * }
383
386
  * }
384
387
  * })
@@ -399,7 +402,7 @@ export class EntitiesClient {
399
402
  contentType: "application/json",
400
403
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
401
404
  requestType: "json",
402
- body: _body,
405
+ body: mergeAdditionalBodyParameters(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
403
406
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
404
407
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
405
408
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -6,7 +6,7 @@ import type * as CatchAllApi from "../../../../index.mjs";
6
6
  * description: "Updated description",
7
7
  * additional_attributes: {
8
8
  * company_attributes: {
9
- * alternative_names: ["NC", "NewsCatcher API", "NCA"]
9
+ * alternative_names: ["NewsCatcher CatchAll", "NewsCatcher API", "NCA"]
10
10
  * }
11
11
  * }
12
12
  * }
@@ -18,5 +18,7 @@ export interface UpdateEntityRequest {
18
18
  name?: string;
19
19
  /** Updated description. */
20
20
  description?: string;
21
+ /** Updated external identifier for this entity. */
22
+ external_entity_id?: string;
21
23
  additional_attributes?: CatchAllApi.AdditionalAttributes;
22
24
  }
@@ -117,6 +117,22 @@ export declare class JobsClient {
117
117
  */
118
118
  getJobResults(request: CatchAllApi.GetJobResultsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.PullJobResponseDto>;
119
119
  private __getJobResults;
120
+ /**
121
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
122
+ *
123
+ * @param {CatchAllApi.GetJobResultsCsvRequest} request
124
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
125
+ *
126
+ * @throws {@link CatchAllApi.ForbiddenError}
127
+ * @throws {@link CatchAllApi.NotFoundError}
128
+ *
129
+ * @example
130
+ * await client.jobs.getJobResultsCsv({
131
+ * job_id: "job_id"
132
+ * })
133
+ */
134
+ getJobResultsCsv(request: CatchAllApi.GetJobResultsCsvRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<string>;
135
+ private __getJobResultsCsv;
120
136
  /**
121
137
  * Continue an existing job to process more records beyond the initial limit.
122
138
  *
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
12
  import { mergeHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
14
15
  import * as environments from "../../../../environments.mjs";
15
16
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
17
  import * as errors from "../../../../errors/index.mjs";
@@ -115,7 +116,7 @@ export class JobsClient {
115
116
  contentType: "application/json",
116
117
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
117
118
  requestType: "json",
118
- body: request,
119
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
119
120
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
120
121
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
121
122
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -172,7 +173,7 @@ export class JobsClient {
172
173
  contentType: "application/json",
173
174
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
174
175
  requestType: "json",
175
- body: request,
176
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
176
177
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
177
178
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
178
179
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -234,7 +235,7 @@ export class JobsClient {
234
235
  contentType: "application/json",
235
236
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
236
237
  requestType: "json",
237
- body: request,
238
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
238
239
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
239
240
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
240
241
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -379,6 +380,61 @@ export class JobsClient {
379
380
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}");
380
381
  });
381
382
  }
383
+ /**
384
+ * Returns a completed job's result records as a CSV download. One row per record, with enrichment fields as columns, citations as a JSON column, and connected entities split into `event_associated_entities` and `mention_entities` JSON columns.
385
+ *
386
+ * @param {CatchAllApi.GetJobResultsCsvRequest} request
387
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
388
+ *
389
+ * @throws {@link CatchAllApi.ForbiddenError}
390
+ * @throws {@link CatchAllApi.NotFoundError}
391
+ *
392
+ * @example
393
+ * await client.jobs.getJobResultsCsv({
394
+ * job_id: "job_id"
395
+ * })
396
+ */
397
+ getJobResultsCsv(request, requestOptions) {
398
+ return core.HttpResponsePromise.fromPromise(this.__getJobResultsCsv(request, requestOptions));
399
+ }
400
+ __getJobResultsCsv(request, requestOptions) {
401
+ return __awaiter(this, void 0, void 0, function* () {
402
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
403
+ const { job_id: jobId } = request;
404
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
405
+ 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);
406
+ const _response = yield core.fetcher({
407
+ 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)}/csv`),
408
+ method: "GET",
409
+ headers: _headers,
410
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
411
+ responseType: "text",
412
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
413
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
414
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
415
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
416
+ logging: this._options.logging,
417
+ });
418
+ if (_response.ok) {
419
+ return { data: _response.body, rawResponse: _response.rawResponse };
420
+ }
421
+ if (_response.error.reason === "status-code") {
422
+ switch (_response.error.statusCode) {
423
+ case 403:
424
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
425
+ case 404:
426
+ throw new CatchAllApi.NotFoundError(_response.error.body, _response.rawResponse);
427
+ default:
428
+ throw new errors.CatchAllApiError({
429
+ statusCode: _response.error.statusCode,
430
+ body: _response.error.body,
431
+ rawResponse: _response.rawResponse,
432
+ });
433
+ }
434
+ }
435
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/catchAll/pull/{job_id}/csv");
436
+ });
437
+ }
382
438
  /**
383
439
  * Continue an existing job to process more records beyond the initial limit.
384
440
  *
@@ -410,7 +466,7 @@ export class JobsClient {
410
466
  contentType: "application/json",
411
467
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
412
468
  requestType: "json",
413
- body: request,
469
+ body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
414
470
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
415
471
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
416
472
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,