newscatcher-catchall-sdk 1.1.2 → 1.3.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 (61) hide show
  1. package/README.md +305 -284
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +12 -0
  4. package/dist/cjs/Client.js +67 -0
  5. package/dist/cjs/api/resources/jobs/client/Client.d.ts +2 -1
  6. package/dist/cjs/api/resources/jobs/client/Client.js +2 -1
  7. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +22 -1
  8. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +14 -0
  9. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -1
  10. package/dist/cjs/api/resources/jobs/client/requests/index.js +3 -0
  11. package/dist/cjs/api/resources/meta/client/Client.d.ts +15 -3
  12. package/dist/cjs/api/resources/meta/client/Client.js +49 -1
  13. package/dist/cjs/api/types/GetPlanLimitsResponseDto.d.ts +5 -0
  14. package/dist/cjs/api/types/GetPlanLimitsResponseDto.js +3 -0
  15. package/dist/cjs/api/types/MonitorListItemDto.d.ts +4 -2
  16. package/dist/cjs/api/types/PlanFeature.d.ts +12 -0
  17. package/dist/cjs/api/types/PlanFeature.js +3 -0
  18. package/dist/cjs/api/types/PullJobResponseDto.d.ts +12 -8
  19. package/dist/cjs/api/types/PullJobResponseDto.js +9 -0
  20. package/dist/cjs/api/types/UserJob.d.ts +12 -0
  21. package/dist/cjs/api/types/UserJob.js +9 -0
  22. package/dist/cjs/api/types/index.d.ts +2 -0
  23. package/dist/cjs/api/types/index.js +2 -0
  24. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  25. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  26. package/dist/cjs/core/fetcher/index.js +3 -1
  27. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  28. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/BaseClient.mjs +2 -2
  32. package/dist/esm/Client.d.mts +12 -0
  33. package/dist/esm/Client.mjs +34 -0
  34. package/dist/esm/api/resources/jobs/client/Client.d.mts +2 -1
  35. package/dist/esm/api/resources/jobs/client/Client.mjs +2 -1
  36. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +22 -1
  37. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +13 -1
  38. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -1
  39. package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -1
  40. package/dist/esm/api/resources/meta/client/Client.d.mts +15 -3
  41. package/dist/esm/api/resources/meta/client/Client.mjs +50 -2
  42. package/dist/esm/api/types/GetPlanLimitsResponseDto.d.mts +5 -0
  43. package/dist/esm/api/types/GetPlanLimitsResponseDto.mjs +2 -0
  44. package/dist/esm/api/types/MonitorListItemDto.d.mts +4 -2
  45. package/dist/esm/api/types/PlanFeature.d.mts +12 -0
  46. package/dist/esm/api/types/PlanFeature.mjs +2 -0
  47. package/dist/esm/api/types/PullJobResponseDto.d.mts +12 -8
  48. package/dist/esm/api/types/PullJobResponseDto.mjs +8 -1
  49. package/dist/esm/api/types/UserJob.d.mts +12 -0
  50. package/dist/esm/api/types/UserJob.mjs +8 -1
  51. package/dist/esm/api/types/index.d.mts +2 -0
  52. package/dist/esm/api/types/index.mjs +2 -0
  53. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  54. package/dist/esm/core/fetcher/index.d.mts +2 -0
  55. package/dist/esm/core/fetcher/index.mjs +1 -0
  56. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  57. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  58. package/dist/esm/version.d.mts +1 -1
  59. package/dist/esm/version.mjs +1 -1
  60. package/package.json +1 -1
  61. package/reference.md +57 -1
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.makePassthroughRequest = makePassthroughRequest;
13
+ const logger_js_1 = require("../logging/logger.js");
14
+ const join_js_1 = require("../url/join.js");
15
+ const EndpointSupplier_js_1 = require("./EndpointSupplier.js");
16
+ const getFetchFn_js_1 = require("./getFetchFn.js");
17
+ const makeRequest_js_1 = require("./makeRequest.js");
18
+ const requestWithRetries_js_1 = require("./requestWithRetries.js");
19
+ const Supplier_js_1 = require("./Supplier.js");
20
+ /**
21
+ * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.)
22
+ * while mimicking the standard `fetch` API.
23
+ *
24
+ * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL.
25
+ * @param init - Standard RequestInit options (method, headers, body, signal, etc.)
26
+ * @param clientOptions - SDK client options (auth, default headers, logging, etc.)
27
+ * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal).
28
+ * @returns A standard Response object.
29
+ */
30
+ function makePassthroughRequest(input, init, clientOptions, requestOptions) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ var _a, _b, _c, _d, _e, _f, _g;
33
+ const logger = (0, logger_js_1.createLogger)(clientOptions.logging);
34
+ // Extract URL and default init properties from Request object if provided
35
+ let url;
36
+ let effectiveInit = init;
37
+ if (input instanceof Request) {
38
+ url = input.url;
39
+ // If no explicit init provided, extract properties from the Request object
40
+ if (init == null) {
41
+ effectiveInit = {
42
+ method: input.method,
43
+ headers: Object.fromEntries(input.headers.entries()),
44
+ body: input.body,
45
+ signal: input.signal,
46
+ credentials: input.credentials,
47
+ cache: input.cache,
48
+ redirect: input.redirect,
49
+ referrer: input.referrer,
50
+ integrity: input.integrity,
51
+ mode: input.mode,
52
+ };
53
+ }
54
+ }
55
+ else {
56
+ url = input instanceof URL ? input.toString() : input;
57
+ }
58
+ // Resolve the base URL
59
+ const baseUrl = (_a = (clientOptions.baseUrl != null ? yield Supplier_js_1.Supplier.get(clientOptions.baseUrl) : undefined)) !== null && _a !== void 0 ? _a : (clientOptions.environment != null ? yield Supplier_js_1.Supplier.get(clientOptions.environment) : undefined);
60
+ // Determine the full URL
61
+ let fullUrl;
62
+ if (url.startsWith("http://") || url.startsWith("https://")) {
63
+ fullUrl = url;
64
+ }
65
+ else if (baseUrl != null) {
66
+ fullUrl = (0, join_js_1.join)(baseUrl, url);
67
+ }
68
+ else {
69
+ fullUrl = url;
70
+ }
71
+ // Merge headers: SDK default headers -> auth headers -> user-provided headers
72
+ const mergedHeaders = {};
73
+ // Apply SDK default headers (resolve suppliers)
74
+ if (clientOptions.headers != null) {
75
+ for (const [key, value] of Object.entries(clientOptions.headers)) {
76
+ const resolved = yield EndpointSupplier_js_1.EndpointSupplier.get(value, { endpointMetadata: {} });
77
+ if (resolved != null) {
78
+ mergedHeaders[key.toLowerCase()] = `${resolved}`;
79
+ }
80
+ }
81
+ }
82
+ // Apply auth headers
83
+ if (clientOptions.getAuthHeaders != null) {
84
+ const authHeaders = yield clientOptions.getAuthHeaders();
85
+ for (const [key, value] of Object.entries(authHeaders)) {
86
+ mergedHeaders[key.toLowerCase()] = value;
87
+ }
88
+ }
89
+ // Apply user-provided headers from init
90
+ if ((effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.headers) != null) {
91
+ const initHeaders = effectiveInit.headers instanceof Headers
92
+ ? Object.fromEntries(effectiveInit.headers.entries())
93
+ : Array.isArray(effectiveInit.headers)
94
+ ? Object.fromEntries(effectiveInit.headers)
95
+ : effectiveInit.headers;
96
+ for (const [key, value] of Object.entries(initHeaders)) {
97
+ if (value != null) {
98
+ mergedHeaders[key.toLowerCase()] = value;
99
+ }
100
+ }
101
+ }
102
+ // Apply per-request option headers (highest priority)
103
+ if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers) != null) {
104
+ for (const [key, value] of Object.entries(requestOptions.headers)) {
105
+ mergedHeaders[key.toLowerCase()] = value;
106
+ }
107
+ }
108
+ const method = (_b = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.method) !== null && _b !== void 0 ? _b : "GET";
109
+ const body = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.body;
110
+ const timeoutInSeconds = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : clientOptions.timeoutInSeconds;
111
+ const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined;
112
+ const maxRetries = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _d !== void 0 ? _d : clientOptions.maxRetries;
113
+ const abortSignal = (_f = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal) !== null && _e !== void 0 ? _e : effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.signal) !== null && _f !== void 0 ? _f : undefined;
114
+ const fetchFn = (_g = clientOptions.fetch) !== null && _g !== void 0 ? _g : (yield (0, getFetchFn_js_1.getFetchFn)());
115
+ if (logger.isDebug()) {
116
+ logger.debug("Making passthrough HTTP request", {
117
+ method,
118
+ url: fullUrl,
119
+ hasBody: body != null,
120
+ });
121
+ }
122
+ const response = yield (0, requestWithRetries_js_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
123
+ return (0, makeRequest_js_1.makeRequest)(fetchFn, fullUrl, method, mergedHeaders, body !== null && body !== void 0 ? body : undefined, timeoutMs, abortSignal, (effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.credentials) === "include", undefined, // duplex
124
+ false);
125
+ }), maxRetries);
126
+ if (logger.isDebug()) {
127
+ logger.debug("Passthrough HTTP request completed", {
128
+ method,
129
+ url: fullUrl,
130
+ statusCode: response.status,
131
+ });
132
+ }
133
+ return response;
134
+ });
135
+ }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.1.2";
1
+ export declare const SDK_VERSION = "1.3.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 = "1.1.2";
4
+ exports.SDK_VERSION = "1.3.1";
@@ -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": "1.1.2",
10
- "User-Agent": "newscatcher-catchall-sdk/1.1.2",
9
+ "X-Fern-SDK-Version": "1.3.1",
10
+ "User-Agent": "newscatcher-catchall-sdk/1.3.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);
@@ -3,6 +3,7 @@ import { MetaClient } from "./api/resources/meta/client/Client.mjs";
3
3
  import { MonitorsClient } from "./api/resources/monitors/client/Client.mjs";
4
4
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
5
5
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
6
+ import * as core from "./core/index.mjs";
6
7
  export declare namespace CatchAllApiClient {
7
8
  type Options = BaseClientOptions;
8
9
  interface RequestOptions extends BaseRequestOptions {
@@ -17,4 +18,15 @@ export declare class CatchAllApiClient {
17
18
  get jobs(): JobsClient;
18
19
  get monitors(): MonitorsClient;
19
20
  get meta(): MetaClient;
21
+ /**
22
+ * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
23
+ * This is useful for making requests to endpoints not yet supported in the SDK.
24
+ * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
25
+ *
26
+ * @param {Request | string | URL} input - The URL, path, or Request object.
27
+ * @param {RequestInit} init - Standard fetch RequestInit options.
28
+ * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
29
+ * @returns {Promise<Response>} A standard Response object.
30
+ */
31
+ fetch(input: Request | string | URL, init?: RequestInit, requestOptions?: core.PassthroughRequest.RequestOptions): Promise<Response>;
20
32
  }
@@ -1,8 +1,18 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  import { JobsClient } from "./api/resources/jobs/client/Client.mjs";
3
12
  import { MetaClient } from "./api/resources/meta/client/Client.mjs";
4
13
  import { MonitorsClient } from "./api/resources/monitors/client/Client.mjs";
5
14
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
15
+ import * as core from "./core/index.mjs";
6
16
  export class CatchAllApiClient {
7
17
  constructor(options = {}) {
8
18
  this._options = normalizeClientOptionsWithAuth(options);
@@ -19,4 +29,28 @@ export class CatchAllApiClient {
19
29
  var _a;
20
30
  return ((_a = this._meta) !== null && _a !== void 0 ? _a : (this._meta = new MetaClient(this._options)));
21
31
  }
32
+ /**
33
+ * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
34
+ * This is useful for making requests to endpoints not yet supported in the SDK.
35
+ * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL.
36
+ *
37
+ * @param {Request | string | URL} input - The URL, path, or Request object.
38
+ * @param {RequestInit} init - Standard fetch RequestInit options.
39
+ * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal).
40
+ * @returns {Promise<Response>} A standard Response object.
41
+ */
42
+ fetch(input, init, requestOptions) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ var _a;
45
+ return core.makePassthroughRequest(input, init, {
46
+ baseUrl: (_a = this._options.baseUrl) !== null && _a !== void 0 ? _a : this._options.environment,
47
+ headers: this._options.headers,
48
+ timeoutInSeconds: this._options.timeoutInSeconds,
49
+ maxRetries: this._options.maxRetries,
50
+ fetch: this._options.fetch,
51
+ logging: this._options.logging,
52
+ getAuthHeaders: () => __awaiter(this, void 0, void 0, function* () { return (yield this._options.authProvider.getAuthRequest()).headers; }),
53
+ }, requestOptions);
54
+ });
55
+ }
22
56
  }
@@ -46,7 +46,8 @@ export declare class JobsClient {
46
46
  * context: "Focus on funding amount and company name",
47
47
  * limit: 10,
48
48
  * start_date: "2026-02-18T00:00:00Z",
49
- * end_date: "2026-02-23T00:00:00Z"
49
+ * end_date: "2026-02-23T00:00:00Z",
50
+ * mode: "base"
50
51
  * })
51
52
  */
52
53
  createJob(request: CatchAllApi.SubmitRequestDto, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.SubmitResponseDto>;
@@ -95,7 +95,8 @@ export class JobsClient {
95
95
  * context: "Focus on funding amount and company name",
96
96
  * limit: 10,
97
97
  * start_date: "2026-02-18T00:00:00Z",
98
- * end_date: "2026-02-23T00:00:00Z"
98
+ * end_date: "2026-02-23T00:00:00Z",
99
+ * mode: "base"
99
100
  * })
100
101
  */
101
102
  createJob(request, requestOptions) {
@@ -6,7 +6,8 @@ import type * as CatchAllApi from "../../../../index.mjs";
6
6
  * context: "Focus on funding amount and company name",
7
7
  * limit: 10,
8
8
  * start_date: "2026-02-18T00:00:00Z",
9
- * end_date: "2026-02-23T00:00:00Z"
9
+ * end_date: "2026-02-23T00:00:00Z",
10
+ * mode: "base"
10
11
  * }
11
12
  */
12
13
  export interface SubmitRequestDto {
@@ -27,4 +28,24 @@ export interface SubmitRequestDto {
27
28
  * If not provided, enrichments are generated automatically based on the query.
28
29
  */
29
30
  enrichments?: CatchAllApi.EnrichmentSchema[];
31
+ /**
32
+ * Job processing mode.
33
+ *
34
+ * - `base`: Full pipeline with validation and enrichment.
35
+ * - `lite`: Lightweight extraction with faster processing. Returns titles and citations only.
36
+ */
37
+ mode?: SubmitRequestDto.Mode;
38
+ }
39
+ export declare namespace SubmitRequestDto {
40
+ /**
41
+ * Job processing mode.
42
+ *
43
+ * - `base`: Full pipeline with validation and enrichment.
44
+ * - `lite`: Lightweight extraction with faster processing. Returns titles and citations only.
45
+ */
46
+ const Mode: {
47
+ readonly Lite: "lite";
48
+ readonly Base: "base";
49
+ };
50
+ type Mode = (typeof Mode)[keyof typeof Mode];
30
51
  }
@@ -1,2 +1,14 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var SubmitRequestDto;
3
+ (function (SubmitRequestDto) {
4
+ /**
5
+ * Job processing mode.
6
+ *
7
+ * - `base`: Full pipeline with validation and enrichment.
8
+ * - `lite`: Lightweight extraction with faster processing. Returns titles and citations only.
9
+ */
10
+ SubmitRequestDto.Mode = {
11
+ Lite: "lite",
12
+ Base: "base",
13
+ };
14
+ })(SubmitRequestDto || (SubmitRequestDto = {}));
@@ -3,4 +3,4 @@ export type { GetJobResultsRequest } from "./GetJobResultsRequest.mjs";
3
3
  export type { GetJobStatusRequest } from "./GetJobStatusRequest.mjs";
4
4
  export type { GetUserJobsRequest } from "./GetUserJobsRequest.mjs";
5
5
  export type { InitializeRequestDto } from "./InitializeRequestDto.mjs";
6
- export type { SubmitRequestDto } from "./SubmitRequestDto.mjs";
6
+ export { SubmitRequestDto } from "./SubmitRequestDto.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export { SubmitRequestDto } from "./SubmitRequestDto.mjs";
@@ -1,7 +1,7 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../core/index.mjs";
4
- import type * as CatchAllApi from "../../../index.mjs";
4
+ import * as CatchAllApi from "../../../index.mjs";
5
5
  export declare namespace MetaClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
@@ -11,7 +11,7 @@ export declare namespace MetaClient {
11
11
  * Operations to check API health and version.
12
12
  */
13
13
  export declare class MetaClient {
14
- protected readonly _options: NormalizedClientOptions<MetaClient.Options>;
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<MetaClient.Options>;
15
15
  constructor(options?: MetaClient.Options);
16
16
  /**
17
17
  * Check API availability.
@@ -33,4 +33,16 @@ export declare class MetaClient {
33
33
  */
34
34
  getVersion(requestOptions?: MetaClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.GetVersionResponse>;
35
35
  private __getVersion;
36
+ /**
37
+ * Returns plan features and current usage for the authenticated organization.
38
+ *
39
+ * @param {MetaClient.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link CatchAllApi.ForbiddenError}
42
+ *
43
+ * @example
44
+ * await client.meta.getPlanLimits()
45
+ */
46
+ getPlanLimits(requestOptions?: MetaClient.RequestOptions): core.HttpResponsePromise<CatchAllApi.GetPlanLimitsResponseDto>;
47
+ private __getPlanLimits;
36
48
  }
@@ -8,18 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
12
  import { mergeHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
14
  import * as environments from "../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../errors/index.mjs";
17
+ import * as CatchAllApi from "../../../index.mjs";
17
18
  /**
18
19
  * Operations to check API health and version.
19
20
  */
20
21
  export class MetaClient {
21
22
  constructor(options = {}) {
22
- this._options = normalizeClientOptions(options);
23
+ this._options = normalizeClientOptionsWithAuth(options);
23
24
  }
24
25
  /**
25
26
  * Check API availability.
@@ -99,4 +100,51 @@ export class MetaClient {
99
100
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/version");
100
101
  });
101
102
  }
103
+ /**
104
+ * Returns plan features and current usage for the authenticated organization.
105
+ *
106
+ * @param {MetaClient.RequestOptions} requestOptions - Request-specific configuration.
107
+ *
108
+ * @throws {@link CatchAllApi.ForbiddenError}
109
+ *
110
+ * @example
111
+ * await client.meta.getPlanLimits()
112
+ */
113
+ getPlanLimits(requestOptions) {
114
+ return core.HttpResponsePromise.fromPromise(this.__getPlanLimits(requestOptions));
115
+ }
116
+ __getPlanLimits(requestOptions) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
119
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
120
+ 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);
121
+ const _response = yield core.fetcher({
122
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CatchAllApiEnvironment.Default, "catchAll/user/limits"),
123
+ method: "POST",
124
+ headers: _headers,
125
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
126
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
127
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
128
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
129
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
130
+ logging: this._options.logging,
131
+ });
132
+ if (_response.ok) {
133
+ return { data: _response.body, rawResponse: _response.rawResponse };
134
+ }
135
+ if (_response.error.reason === "status-code") {
136
+ switch (_response.error.statusCode) {
137
+ case 403:
138
+ throw new CatchAllApi.ForbiddenError(_response.error.body, _response.rawResponse);
139
+ default:
140
+ throw new errors.CatchAllApiError({
141
+ statusCode: _response.error.statusCode,
142
+ body: _response.error.body,
143
+ rawResponse: _response.rawResponse,
144
+ });
145
+ }
146
+ }
147
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/catchAll/user/limits");
148
+ });
149
+ }
102
150
  }
@@ -0,0 +1,5 @@
1
+ import type * as CatchAllApi from "../index.mjs";
2
+ export interface GetPlanLimitsResponseDto {
3
+ /** Plan features with current usage. */
4
+ features: CatchAllApi.PlanFeature[];
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -16,6 +16,8 @@ export interface MonitorListItemDto {
16
16
  timezone?: string | undefined;
17
17
  /** The date when the monitor was created. */
18
18
  created_at?: string | undefined;
19
- /** Webhook configuration for this monitor (if set). */
20
- webhook?: CatchAllApi.WebhookDto | undefined;
19
+ /** Webhook configuration for this monitor, or null if not set. */
20
+ webhook?: (CatchAllApi.WebhookDto | null) | undefined;
21
+ /** Masked API key associated with this monitor. */
22
+ user_key?: string | undefined;
21
23
  }
@@ -0,0 +1,12 @@
1
+ export interface PlanFeature {
2
+ /** Human-readable feature name. */
3
+ name: string;
4
+ /** Machine-readable feature identifier. */
5
+ code: string;
6
+ /** Data type of the feature value. */
7
+ value_type?: string | undefined;
8
+ /** Feature limit. Type depends on `value_type`. */
9
+ value?: unknown | undefined;
10
+ /** Current usage count for this feature. */
11
+ current_usage?: number | undefined;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -6,14 +6,10 @@ export interface PullJobResponseDto {
6
6
  query?: string | undefined;
7
7
  /** Context provided with the query. */
8
8
  context?: string | undefined;
9
- /** List of validation criteria applied to filter results. */
10
- validators?: string[] | undefined;
11
- /**
12
- * List of extracted field names generated by the enrichment process. These field names appear in the `enrichment` object of each record.
13
- *
14
- * **Note:** The `enrichment_confidence` field always appears in this list. The system adds it to every record regardless of the enrichments generated or defined.
15
- */
16
- enrichments?: string[] | undefined;
9
+ /** Validators applied to filter results. */
10
+ validators?: Record<string, unknown>[] | undefined;
11
+ /** Enrichment fields used for data extraction. */
12
+ enrichments?: Record<string, unknown>[] | undefined;
17
13
  /** Job status. */
18
14
  status?: string | undefined;
19
15
  /** Error message if the job failed. Null for successful jobs. */
@@ -39,6 +35,8 @@ export interface PullJobResponseDto {
39
35
  page_size?: number | undefined;
40
36
  /** The total number of pages available. */
41
37
  total_pages?: number | undefined;
38
+ /** Processing mode used for this job. */
39
+ mode?: PullJobResponseDto.Mode | undefined;
42
40
  /** Array of extracted records with structured data and citations. */
43
41
  all_records?: CatchAllApi.Record_[] | undefined;
44
42
  }
@@ -47,4 +45,10 @@ export declare namespace PullJobResponseDto {
47
45
  start_date?: string | undefined;
48
46
  end_date?: string | undefined;
49
47
  }
48
+ /** Processing mode used for this job. */
49
+ const Mode: {
50
+ readonly Lite: "lite";
51
+ readonly Base: "base";
52
+ };
53
+ type Mode = (typeof Mode)[keyof typeof Mode];
50
54
  }
@@ -1,2 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var PullJobResponseDto;
3
+ (function (PullJobResponseDto) {
4
+ /** Processing mode used for this job. */
5
+ PullJobResponseDto.Mode = {
6
+ Lite: "lite",
7
+ Base: "base",
8
+ };
9
+ })(PullJobResponseDto || (PullJobResponseDto = {}));
@@ -7,4 +7,16 @@ export interface UserJob {
7
7
  created_at: string;
8
8
  /** Current processing status of the job. */
9
9
  status: string;
10
+ /** Processing mode used for this job. */
11
+ mode?: UserJob.Mode | undefined;
12
+ /** Masked API key that created this job. */
13
+ user_key?: string | undefined;
14
+ }
15
+ export declare namespace UserJob {
16
+ /** Processing mode used for this job. */
17
+ const Mode: {
18
+ readonly Lite: "lite";
19
+ readonly Base: "base";
20
+ };
21
+ type Mode = (typeof Mode)[keyof typeof Mode];
10
22
  }
@@ -1,2 +1,9 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var UserJob;
3
+ (function (UserJob) {
4
+ /** Processing mode used for this job. */
5
+ UserJob.Mode = {
6
+ Lite: "lite",
7
+ Base: "base",
8
+ };
9
+ })(UserJob || (UserJob = {}));
@@ -8,6 +8,7 @@ export * from "./EndDate.mjs";
8
8
  export * from "./EnrichmentSchema.mjs";
9
9
  export * from "./EnrichmentType.mjs";
10
10
  export * from "./Error_.mjs";
11
+ export * from "./GetPlanLimitsResponseDto.mjs";
11
12
  export * from "./InitializeResponseDto.mjs";
12
13
  export * from "./JobStep.mjs";
13
14
  export * from "./Limit.mjs";
@@ -17,6 +18,7 @@ export * from "./MonitorCitation.mjs";
17
18
  export * from "./MonitorJobItem.mjs";
18
19
  export * from "./MonitorListItemDto.mjs";
19
20
  export * from "./MonitorRecord.mjs";
21
+ export * from "./PlanFeature.mjs";
20
22
  export * from "./PublicJobStatus.mjs";
21
23
  export * from "./PullJobResponseDto.mjs";
22
24
  export * from "./PullMonitorResponseDto.mjs";
@@ -8,6 +8,7 @@ export * from "./EndDate.mjs";
8
8
  export * from "./EnrichmentSchema.mjs";
9
9
  export * from "./EnrichmentType.mjs";
10
10
  export * from "./Error_.mjs";
11
+ export * from "./GetPlanLimitsResponseDto.mjs";
11
12
  export * from "./InitializeResponseDto.mjs";
12
13
  export * from "./JobStep.mjs";
13
14
  export * from "./Limit.mjs";
@@ -17,6 +18,7 @@ export * from "./MonitorCitation.mjs";
17
18
  export * from "./MonitorJobItem.mjs";
18
19
  export * from "./MonitorListItemDto.mjs";
19
20
  export * from "./MonitorRecord.mjs";
21
+ export * from "./PlanFeature.mjs";
20
22
  export * from "./PublicJobStatus.mjs";
21
23
  export * from "./PullJobResponseDto.mjs";
22
24
  export * from "./PullMonitorResponseDto.mjs";
@@ -14,6 +14,6 @@ export type BinaryResponse = {
14
14
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
15
15
  * Some versions of the Fetch API may not support this method.
16
16
  */
17
- bytes?(): ReturnType<Response["bytes"]>;
17
+ bytes?(): Promise<Uint8Array>;
18
18
  };
19
19
  export declare function getBinaryResponse(response: Response): BinaryResponse;
@@ -6,6 +6,8 @@ export type { Fetcher, FetchFunction } from "./Fetcher.mjs";
6
6
  export { fetcher } from "./Fetcher.mjs";
7
7
  export { getHeader } from "./getHeader.mjs";
8
8
  export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
9
+ export type { PassthroughRequest } from "./makePassthroughRequest.mjs";
10
+ export { makePassthroughRequest } from "./makePassthroughRequest.mjs";
9
11
  export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
10
12
  export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
11
13
  export { Supplier } from "./Supplier.mjs";
@@ -2,5 +2,6 @@ export { EndpointSupplier } from "./EndpointSupplier.mjs";
2
2
  export { fetcher } from "./Fetcher.mjs";
3
3
  export { getHeader } from "./getHeader.mjs";
4
4
  export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
5
+ export { makePassthroughRequest } from "./makePassthroughRequest.mjs";
5
6
  export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
6
7
  export { Supplier } from "./Supplier.mjs";