newscatcher-catchall-sdk 1.0.0 → 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 (179) hide show
  1. package/README.md +41 -25
  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 +14 -17
  6. package/dist/cjs/api/resources/jobs/client/Client.js +13 -19
  7. package/dist/cjs/api/resources/jobs/client/requests/ContinueRequestDto.d.ts +3 -3
  8. package/dist/cjs/api/resources/jobs/client/requests/GetJobResultsRequest.d.ts +2 -2
  9. package/dist/cjs/api/resources/jobs/client/requests/GetJobStatusRequest.d.ts +2 -2
  10. package/dist/cjs/api/resources/jobs/client/requests/InitializeRequestDto.d.ts +2 -1
  11. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.d.ts +26 -6
  12. package/dist/cjs/api/resources/jobs/client/requests/SubmitRequestDto.js +14 -0
  13. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -1
  14. package/dist/cjs/api/resources/jobs/client/requests/index.js +3 -0
  15. package/dist/cjs/api/resources/jobs/exports.d.ts +2 -0
  16. package/dist/cjs/api/resources/jobs/exports.js +21 -0
  17. package/dist/cjs/api/resources/meta/client/Client.d.ts +15 -3
  18. package/dist/cjs/api/resources/meta/client/Client.js +49 -1
  19. package/dist/cjs/api/resources/meta/exports.d.ts +2 -0
  20. package/dist/cjs/api/resources/meta/exports.js +21 -0
  21. package/dist/cjs/api/resources/meta/types/GetVersionResponse.d.ts +1 -1
  22. package/dist/cjs/api/resources/meta/types/HealthCheckResponse.d.ts +1 -1
  23. package/dist/cjs/api/resources/monitors/client/Client.d.ts +23 -37
  24. package/dist/cjs/api/resources/monitors/client/Client.js +35 -41
  25. package/dist/cjs/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.ts +23 -6
  26. package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.ts +17 -0
  27. package/dist/cjs/api/resources/monitors/client/requests/ListMonitorsRequest.d.ts +10 -0
  28. package/dist/cjs/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.ts +2 -0
  29. package/dist/cjs/api/resources/monitors/client/requests/index.d.ts +2 -1
  30. package/dist/cjs/api/resources/monitors/exports.d.ts +2 -0
  31. package/dist/cjs/api/resources/monitors/exports.js +21 -0
  32. package/dist/cjs/api/types/BaseRecord.d.ts +38 -0
  33. package/dist/cjs/api/types/BaseRecord.js +16 -0
  34. package/dist/cjs/api/types/Citation.d.ts +3 -3
  35. package/dist/cjs/api/types/CompanyEnrichmentOutput.d.ts +29 -0
  36. package/dist/cjs/api/types/CompanyEnrichmentOutput.js +16 -0
  37. package/dist/cjs/api/types/ContinueResponseDto.d.ts +2 -2
  38. package/dist/cjs/api/types/CreateMonitorResponseDto.d.ts +1 -1
  39. package/dist/cjs/api/types/EndDate.d.ts +4 -2
  40. package/dist/cjs/api/types/EnrichmentType.d.ts +1 -3
  41. package/dist/cjs/api/types/EnrichmentType.js +1 -3
  42. package/dist/cjs/api/types/Error_.d.ts +1 -1
  43. package/dist/cjs/api/types/GetPlanLimitsResponseDto.d.ts +5 -0
  44. package/dist/cjs/api/types/InitializeResponseDto.d.ts +8 -9
  45. package/dist/cjs/api/types/JobStep.d.ts +2 -2
  46. package/dist/cjs/api/types/Limit.d.ts +1 -1
  47. package/dist/cjs/api/types/ListMonitorsResponseDto.d.ts +7 -1
  48. package/dist/cjs/api/types/MonitorCitation.d.ts +3 -8
  49. package/dist/cjs/api/types/MonitorListItemDto.d.ts +10 -8
  50. package/dist/cjs/api/types/MonitorRecord.d.ts +4 -14
  51. package/dist/cjs/api/types/PlanFeature.d.ts +12 -0
  52. package/dist/cjs/api/types/PlanFeature.js +3 -0
  53. package/dist/{esm/api/types/JobStatus.d.mts → cjs/api/types/PublicJobStatus.d.ts} +4 -4
  54. package/dist/cjs/api/types/{JobStatus.js → PublicJobStatus.js} +4 -4
  55. package/dist/cjs/api/types/PullJobResponseDto.d.ts +34 -25
  56. package/dist/cjs/api/types/PullJobResponseDto.js +9 -0
  57. package/dist/cjs/api/types/PullMonitorResponseDto.d.ts +12 -12
  58. package/dist/cjs/api/types/Query.d.ts +1 -1
  59. package/dist/cjs/api/types/Record_.d.ts +2 -12
  60. package/dist/cjs/api/types/ReferenceJob.d.ts +3 -3
  61. package/dist/cjs/api/types/StartDate.d.ts +4 -2
  62. package/dist/cjs/api/types/StatusResponseDto.d.ts +2 -2
  63. package/dist/cjs/api/types/{SubmitResponseBody.d.ts → SubmitResponseDto.d.ts} +1 -1
  64. package/dist/cjs/api/types/SubmitResponseDto.js +3 -0
  65. package/dist/cjs/api/types/UserJob.d.ts +13 -1
  66. package/dist/cjs/api/types/UserJob.js +9 -0
  67. package/dist/cjs/api/types/ValidationErrorDetail.d.ts +3 -3
  68. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +1 -1
  69. package/dist/cjs/api/types/ValidatorSchema.d.ts +3 -3
  70. package/dist/cjs/api/types/WebhookDto.d.ts +4 -4
  71. package/dist/cjs/api/types/WebhookPayload.d.ts +9 -9
  72. package/dist/cjs/api/types/index.d.ts +6 -3
  73. package/dist/cjs/api/types/index.js +6 -3
  74. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  75. package/dist/cjs/core/fetcher/Fetcher.js +8 -2
  76. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  77. package/dist/cjs/core/fetcher/index.js +3 -1
  78. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  79. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  80. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  81. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  82. package/dist/cjs/core/runtime/runtime.js +8 -7
  83. package/dist/cjs/version.d.ts +1 -1
  84. package/dist/cjs/version.js +1 -1
  85. package/dist/esm/BaseClient.mjs +2 -2
  86. package/dist/esm/Client.d.mts +12 -0
  87. package/dist/esm/Client.mjs +34 -0
  88. package/dist/esm/api/resources/jobs/client/Client.d.mts +14 -17
  89. package/dist/esm/api/resources/jobs/client/Client.mjs +13 -19
  90. package/dist/esm/api/resources/jobs/client/requests/ContinueRequestDto.d.mts +3 -3
  91. package/dist/esm/api/resources/jobs/client/requests/GetJobResultsRequest.d.mts +2 -2
  92. package/dist/esm/api/resources/jobs/client/requests/GetJobStatusRequest.d.mts +2 -2
  93. package/dist/esm/api/resources/jobs/client/requests/InitializeRequestDto.d.mts +2 -1
  94. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.d.mts +26 -6
  95. package/dist/esm/api/resources/jobs/client/requests/SubmitRequestDto.mjs +13 -1
  96. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -1
  97. package/dist/esm/api/resources/jobs/client/requests/index.mjs +1 -1
  98. package/dist/esm/api/resources/jobs/exports.d.mts +2 -0
  99. package/dist/esm/api/resources/jobs/exports.mjs +3 -0
  100. package/dist/esm/api/resources/meta/client/Client.d.mts +15 -3
  101. package/dist/esm/api/resources/meta/client/Client.mjs +50 -2
  102. package/dist/esm/api/resources/meta/exports.d.mts +2 -0
  103. package/dist/esm/api/resources/meta/exports.mjs +3 -0
  104. package/dist/esm/api/resources/meta/types/GetVersionResponse.d.mts +1 -1
  105. package/dist/esm/api/resources/meta/types/HealthCheckResponse.d.mts +1 -1
  106. package/dist/esm/api/resources/monitors/client/Client.d.mts +23 -37
  107. package/dist/esm/api/resources/monitors/client/Client.mjs +35 -41
  108. package/dist/esm/api/resources/monitors/client/requests/CreateMonitorRequestDto.d.mts +23 -6
  109. package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequestDto.d.mts +17 -0
  110. package/dist/esm/api/resources/monitors/client/requests/ListMonitorsRequest.d.mts +10 -0
  111. package/dist/esm/api/resources/monitors/client/requests/UpdateMonitorRequestDto.d.mts +2 -0
  112. package/dist/esm/api/resources/monitors/client/requests/index.d.mts +2 -1
  113. package/dist/esm/api/resources/monitors/exports.d.mts +2 -0
  114. package/dist/esm/api/resources/monitors/exports.mjs +3 -0
  115. package/dist/esm/api/types/BaseRecord.d.mts +38 -0
  116. package/dist/esm/api/types/BaseRecord.mjs +13 -0
  117. package/dist/esm/api/types/Citation.d.mts +3 -3
  118. package/dist/esm/api/types/CompanyEnrichmentOutput.d.mts +29 -0
  119. package/dist/esm/api/types/CompanyEnrichmentOutput.mjs +13 -0
  120. package/dist/esm/api/types/ContinueResponseDto.d.mts +2 -2
  121. package/dist/esm/api/types/CreateMonitorResponseDto.d.mts +1 -1
  122. package/dist/esm/api/types/EndDate.d.mts +4 -2
  123. package/dist/esm/api/types/EnrichmentType.d.mts +1 -3
  124. package/dist/esm/api/types/EnrichmentType.mjs +1 -3
  125. package/dist/esm/api/types/Error_.d.mts +1 -1
  126. package/dist/esm/api/types/GetPlanLimitsResponseDto.d.mts +5 -0
  127. package/dist/esm/api/types/InitializeResponseDto.d.mts +8 -9
  128. package/dist/esm/api/types/JobStep.d.mts +2 -2
  129. package/dist/esm/api/types/Limit.d.mts +1 -1
  130. package/dist/esm/api/types/ListMonitorsResponseDto.d.mts +7 -1
  131. package/dist/esm/api/types/MonitorCitation.d.mts +3 -8
  132. package/dist/esm/api/types/MonitorListItemDto.d.mts +10 -8
  133. package/dist/esm/api/types/MonitorRecord.d.mts +4 -14
  134. package/dist/esm/api/types/PlanFeature.d.mts +12 -0
  135. package/dist/esm/api/types/PlanFeature.mjs +2 -0
  136. package/dist/{cjs/api/types/JobStatus.d.ts → esm/api/types/PublicJobStatus.d.mts} +4 -4
  137. package/dist/esm/api/types/{JobStatus.mjs → PublicJobStatus.mjs} +3 -3
  138. package/dist/esm/api/types/PullJobResponseDto.d.mts +34 -25
  139. package/dist/esm/api/types/PullJobResponseDto.mjs +8 -1
  140. package/dist/esm/api/types/PullMonitorResponseDto.d.mts +12 -12
  141. package/dist/esm/api/types/Query.d.mts +1 -1
  142. package/dist/esm/api/types/Record_.d.mts +2 -12
  143. package/dist/esm/api/types/ReferenceJob.d.mts +3 -3
  144. package/dist/esm/api/types/StartDate.d.mts +4 -2
  145. package/dist/esm/api/types/StatusResponseDto.d.mts +2 -2
  146. package/dist/esm/api/types/{SubmitResponseBody.d.mts → SubmitResponseDto.d.mts} +1 -1
  147. package/dist/esm/api/types/SubmitResponseDto.mjs +2 -0
  148. package/dist/esm/api/types/UserJob.d.mts +13 -1
  149. package/dist/esm/api/types/UserJob.mjs +8 -1
  150. package/dist/esm/api/types/ValidationErrorDetail.d.mts +3 -3
  151. package/dist/esm/api/types/ValidationErrorResponse.d.mts +1 -1
  152. package/dist/esm/api/types/ValidatorSchema.d.mts +3 -3
  153. package/dist/esm/api/types/WebhookDto.d.mts +4 -4
  154. package/dist/esm/api/types/WebhookPayload.d.mts +9 -9
  155. package/dist/esm/api/types/index.d.mts +6 -3
  156. package/dist/esm/api/types/index.mjs +6 -3
  157. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  158. package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
  159. package/dist/esm/core/fetcher/index.d.mts +2 -0
  160. package/dist/esm/core/fetcher/index.mjs +1 -0
  161. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  162. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  163. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  164. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  165. package/dist/esm/core/runtime/runtime.mjs +8 -7
  166. package/dist/esm/version.d.mts +1 -1
  167. package/dist/esm/version.mjs +1 -1
  168. package/package.json +37 -4
  169. package/reference.md +99 -53
  170. package/dist/cjs/api/resources/monitors/client/requests/EnableMonitorRequest.d.ts +0 -10
  171. package/dist/cjs/api/types/Schema.d.ts +0 -6
  172. package/dist/esm/api/resources/monitors/client/requests/EnableMonitorRequest.d.mts +0 -10
  173. package/dist/esm/api/types/Schema.d.mts +0 -6
  174. /package/dist/cjs/api/resources/monitors/client/requests/{EnableMonitorRequest.js → EnableMonitorRequestDto.js} +0 -0
  175. /package/dist/cjs/api/{types/Schema.js → resources/monitors/client/requests/ListMonitorsRequest.js} +0 -0
  176. /package/dist/cjs/api/types/{SubmitResponseBody.js → GetPlanLimitsResponseDto.js} +0 -0
  177. /package/dist/esm/api/resources/monitors/client/requests/{EnableMonitorRequest.mjs → EnableMonitorRequestDto.mjs} +0 -0
  178. /package/dist/esm/api/{types/Schema.mjs → resources/monitors/client/requests/ListMonitorsRequest.mjs} +0 -0
  179. /package/dist/esm/api/types/{SubmitResponseBody.mjs → GetPlanLimitsResponseDto.mjs} +0 -0
@@ -0,0 +1,132 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { createLogger } from "../logging/logger.mjs";
11
+ import { join } from "../url/join.mjs";
12
+ import { EndpointSupplier } from "./EndpointSupplier.mjs";
13
+ import { getFetchFn } from "./getFetchFn.mjs";
14
+ import { makeRequest } from "./makeRequest.mjs";
15
+ import { requestWithRetries } from "./requestWithRetries.mjs";
16
+ import { Supplier } from "./Supplier.mjs";
17
+ /**
18
+ * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.)
19
+ * while mimicking the standard `fetch` API.
20
+ *
21
+ * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL.
22
+ * @param init - Standard RequestInit options (method, headers, body, signal, etc.)
23
+ * @param clientOptions - SDK client options (auth, default headers, logging, etc.)
24
+ * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal).
25
+ * @returns A standard Response object.
26
+ */
27
+ export function makePassthroughRequest(input, init, clientOptions, requestOptions) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ var _a, _b, _c, _d, _e, _f, _g;
30
+ const logger = createLogger(clientOptions.logging);
31
+ // Extract URL and default init properties from Request object if provided
32
+ let url;
33
+ let effectiveInit = init;
34
+ if (input instanceof Request) {
35
+ url = input.url;
36
+ // If no explicit init provided, extract properties from the Request object
37
+ if (init == null) {
38
+ effectiveInit = {
39
+ method: input.method,
40
+ headers: Object.fromEntries(input.headers.entries()),
41
+ body: input.body,
42
+ signal: input.signal,
43
+ credentials: input.credentials,
44
+ cache: input.cache,
45
+ redirect: input.redirect,
46
+ referrer: input.referrer,
47
+ integrity: input.integrity,
48
+ mode: input.mode,
49
+ };
50
+ }
51
+ }
52
+ else {
53
+ url = input instanceof URL ? input.toString() : input;
54
+ }
55
+ // Resolve the base URL
56
+ const baseUrl = (_a = (clientOptions.baseUrl != null ? yield Supplier.get(clientOptions.baseUrl) : undefined)) !== null && _a !== void 0 ? _a : (clientOptions.environment != null ? yield Supplier.get(clientOptions.environment) : undefined);
57
+ // Determine the full URL
58
+ let fullUrl;
59
+ if (url.startsWith("http://") || url.startsWith("https://")) {
60
+ fullUrl = url;
61
+ }
62
+ else if (baseUrl != null) {
63
+ fullUrl = join(baseUrl, url);
64
+ }
65
+ else {
66
+ fullUrl = url;
67
+ }
68
+ // Merge headers: SDK default headers -> auth headers -> user-provided headers
69
+ const mergedHeaders = {};
70
+ // Apply SDK default headers (resolve suppliers)
71
+ if (clientOptions.headers != null) {
72
+ for (const [key, value] of Object.entries(clientOptions.headers)) {
73
+ const resolved = yield EndpointSupplier.get(value, { endpointMetadata: {} });
74
+ if (resolved != null) {
75
+ mergedHeaders[key.toLowerCase()] = `${resolved}`;
76
+ }
77
+ }
78
+ }
79
+ // Apply auth headers
80
+ if (clientOptions.getAuthHeaders != null) {
81
+ const authHeaders = yield clientOptions.getAuthHeaders();
82
+ for (const [key, value] of Object.entries(authHeaders)) {
83
+ mergedHeaders[key.toLowerCase()] = value;
84
+ }
85
+ }
86
+ // Apply user-provided headers from init
87
+ if ((effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.headers) != null) {
88
+ const initHeaders = effectiveInit.headers instanceof Headers
89
+ ? Object.fromEntries(effectiveInit.headers.entries())
90
+ : Array.isArray(effectiveInit.headers)
91
+ ? Object.fromEntries(effectiveInit.headers)
92
+ : effectiveInit.headers;
93
+ for (const [key, value] of Object.entries(initHeaders)) {
94
+ if (value != null) {
95
+ mergedHeaders[key.toLowerCase()] = value;
96
+ }
97
+ }
98
+ }
99
+ // Apply per-request option headers (highest priority)
100
+ if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers) != null) {
101
+ for (const [key, value] of Object.entries(requestOptions.headers)) {
102
+ mergedHeaders[key.toLowerCase()] = value;
103
+ }
104
+ }
105
+ const method = (_b = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.method) !== null && _b !== void 0 ? _b : "GET";
106
+ const body = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.body;
107
+ const timeoutInSeconds = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : clientOptions.timeoutInSeconds;
108
+ const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined;
109
+ const maxRetries = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _d !== void 0 ? _d : clientOptions.maxRetries;
110
+ 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;
111
+ const fetchFn = (_g = clientOptions.fetch) !== null && _g !== void 0 ? _g : (yield getFetchFn());
112
+ if (logger.isDebug()) {
113
+ logger.debug("Making passthrough HTTP request", {
114
+ method,
115
+ url: fullUrl,
116
+ hasBody: body != null,
117
+ });
118
+ }
119
+ const response = yield requestWithRetries(() => __awaiter(this, void 0, void 0, function* () {
120
+ return 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
121
+ false);
122
+ }), maxRetries);
123
+ if (logger.isDebug()) {
124
+ logger.debug("Passthrough HTTP request completed", {
125
+ method,
126
+ url: fullUrl,
127
+ statusCode: response.status,
128
+ });
129
+ }
130
+ return response;
131
+ });
132
+ }
@@ -1 +1,6 @@
1
- export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half") => Promise<Response>;
1
+ export declare function isCacheNoStoreSupported(): boolean;
2
+ /**
3
+ * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
4
+ */
5
+ export declare function resetCacheNoStoreSupported(): void;
6
+ export declare const makeRequest: (fetchFn: (url: string, init: RequestInit) => Promise<Response>, url: string, method: string, headers: Headers | Record<string, string>, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", disableCache?: boolean) => Promise<Response>;
@@ -8,7 +8,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { anySignal, getTimeoutSignal } from "./signals.mjs";
11
- export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => __awaiter(void 0, void 0, void 0, function* () {
11
+ /**
12
+ * Cached result of checking whether the current runtime supports
13
+ * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
14
+ * throw a TypeError when this option is used.
15
+ */
16
+ let _cacheNoStoreSupported;
17
+ export function isCacheNoStoreSupported() {
18
+ if (_cacheNoStoreSupported != null) {
19
+ return _cacheNoStoreSupported;
20
+ }
21
+ try {
22
+ new Request("http://localhost", { cache: "no-store" });
23
+ _cacheNoStoreSupported = true;
24
+ }
25
+ catch (_a) {
26
+ _cacheNoStoreSupported = false;
27
+ }
28
+ return _cacheNoStoreSupported;
29
+ }
30
+ /**
31
+ * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only.
32
+ */
33
+ export function resetCacheNoStoreSupported() {
34
+ _cacheNoStoreSupported = undefined;
35
+ }
36
+ export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __awaiter(void 0, void 0, void 0, function* () {
12
37
  const signals = [];
13
38
  let timeoutAbortId;
14
39
  if (timeoutMs != null) {
@@ -20,15 +45,9 @@ export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutM
20
45
  signals.push(abortSignal);
21
46
  }
22
47
  const newSignals = anySignal(signals);
23
- const response = yield fetchFn(url, {
24
- method: method,
25
- headers,
26
- body: requestBody,
27
- signal: newSignals,
28
- credentials: withCredentials ? "include" : undefined,
48
+ const response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
29
49
  // @ts-ignore
30
- duplex,
31
- });
50
+ duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
32
51
  if (timeoutAbortId != null) {
33
52
  clearTimeout(timeoutAbortId);
34
53
  }
@@ -81,17 +81,18 @@ function evaluateRuntime() {
81
81
  }
82
82
  /**
83
83
  * A constant that indicates whether the environment the code is running is Node.JS.
84
+ *
85
+ * We assign `process` to a local variable first to avoid being flagged by
86
+ * bundlers that perform static analysis on `process.versions` (e.g. Next.js
87
+ * Edge Runtime warns about Node.js APIs even when they are guarded).
84
88
  */
85
- const isNode = typeof process !== "undefined" &&
86
- "version" in process &&
87
- !!process.version &&
88
- "versions" in process &&
89
- !!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
89
+ const _process = typeof process !== "undefined" ? process : undefined;
90
+ const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
90
91
  if (isNode) {
91
92
  return {
92
93
  type: "node",
93
- version: process.versions.node,
94
- parsedVersion: Number(process.versions.node.split(".")[0]),
94
+ version: _process.versions.node,
95
+ parsedVersion: Number(_process.versions.node.split(".")[0]),
95
96
  };
96
97
  }
97
98
  return {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.3.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0";
1
+ export const SDK_VERSION = "1.3.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newscatcher-catchall-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.3.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,6 @@
13
13
  "types": "./dist/cjs/index.d.ts",
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./dist/cjs/index.d.ts",
17
16
  "import": {
18
17
  "types": "./dist/esm/index.d.mts",
19
18
  "default": "./dist/esm/index.mjs"
@@ -24,6 +23,39 @@
24
23
  },
25
24
  "default": "./dist/cjs/index.js"
26
25
  },
26
+ "./jobs": {
27
+ "import": {
28
+ "types": "./dist/esm/api/resources/jobs/exports.d.mts",
29
+ "default": "./dist/esm/api/resources/jobs/exports.mjs"
30
+ },
31
+ "require": {
32
+ "types": "./dist/cjs/api/resources/jobs/exports.d.ts",
33
+ "default": "./dist/cjs/api/resources/jobs/exports.js"
34
+ },
35
+ "default": "./dist/cjs/api/resources/jobs/exports.js"
36
+ },
37
+ "./monitors": {
38
+ "import": {
39
+ "types": "./dist/esm/api/resources/monitors/exports.d.mts",
40
+ "default": "./dist/esm/api/resources/monitors/exports.mjs"
41
+ },
42
+ "require": {
43
+ "types": "./dist/cjs/api/resources/monitors/exports.d.ts",
44
+ "default": "./dist/cjs/api/resources/monitors/exports.js"
45
+ },
46
+ "default": "./dist/cjs/api/resources/monitors/exports.js"
47
+ },
48
+ "./meta": {
49
+ "import": {
50
+ "types": "./dist/esm/api/resources/meta/exports.d.mts",
51
+ "default": "./dist/esm/api/resources/meta/exports.mjs"
52
+ },
53
+ "require": {
54
+ "types": "./dist/cjs/api/resources/meta/exports.d.ts",
55
+ "default": "./dist/cjs/api/resources/meta/exports.js"
56
+ },
57
+ "default": "./dist/cjs/api/resources/meta/exports.js"
58
+ },
27
59
  "./package.json": "./package.json"
28
60
  },
29
61
  "files": [
@@ -54,13 +86,14 @@
54
86
  "msw": "2.11.2",
55
87
  "@types/node": "^18.19.70",
56
88
  "typescript": "~5.7.2",
57
- "@biomejs/biome": "2.3.11"
89
+ "@biomejs/biome": "2.4.3"
58
90
  },
59
91
  "browser": {
60
92
  "fs": false,
61
93
  "os": false,
62
94
  "path": false,
63
- "stream": false
95
+ "stream": false,
96
+ "crypto": false
64
97
  },
65
98
  "packageManager": "pnpm@10.20.0",
66
99
  "engines": {
package/reference.md CHANGED
@@ -12,9 +12,7 @@
12
12
  <dl>
13
13
  <dd>
14
14
 
15
- Get suggested validators, enrichments, and date ranges for a query before submitting a job.
16
-
17
- Returns LLM-generated suggestions based on query analysis and validates against plan limits.
15
+ Get suggested validators, enrichments, and date ranges for a query.
18
16
  </dd>
19
17
  </dl>
20
18
  </dd>
@@ -30,7 +28,8 @@ Returns LLM-generated suggestions based on query analysis and validates against
30
28
 
31
29
  ```typescript
32
30
  await client.jobs.initialize({
33
- query: "AI company acquisitions in fintech last week"
31
+ query: "Series B funding rounds for SaaS startups",
32
+ context: "Focus on funding amount and company name"
34
33
  });
35
34
 
36
35
  ```
@@ -67,7 +66,7 @@ await client.jobs.initialize({
67
66
  </dl>
68
67
  </details>
69
68
 
70
- <details><summary><code>client.jobs.<a href="/src/api/resources/jobs/client/Client.ts">createJob</a>({ ...params }) -> CatchAllApi.SubmitResponseBody</code></summary>
69
+ <details><summary><code>client.jobs.<a href="/src/api/resources/jobs/client/Client.ts">createJob</a>({ ...params }) -> CatchAllApi.SubmitResponseDto</code></summary>
71
70
  <dl>
72
71
  <dd>
73
72
 
@@ -79,10 +78,7 @@ await client.jobs.initialize({
79
78
  <dl>
80
79
  <dd>
81
80
 
82
- Submit a natural language query to create a new processing job.
83
-
84
- Optionally specify context, date ranges, limit, custom validators, and enrichments.
85
- If dates exceed plan limits, returns 400 error.
81
+ Submit a query to create a new processing job.
86
82
  </dd>
87
83
  </dl>
88
84
  </dd>
@@ -98,11 +94,12 @@ If dates exceed plan limits, returns 400 error.
98
94
 
99
95
  ```typescript
100
96
  await client.jobs.createJob({
101
- query: "AI company acquisitions",
102
- context: "Focus on deal size and acquiring company details",
97
+ query: "Series B funding rounds for SaaS startups",
98
+ context: "Focus on funding amount and company name",
103
99
  limit: 10,
104
- start_date: "2026-01-30T00:00:00Z",
105
- end_date: "2026-02-05T00:00:00Z"
100
+ start_date: "2026-02-18T00:00:00Z",
101
+ end_date: "2026-02-23T00:00:00Z",
102
+ mode: "base"
106
103
  });
107
104
 
108
105
  ```
@@ -167,7 +164,7 @@ Continue an existing job to process more records beyond the initial limit.
167
164
 
168
165
  ```typescript
169
166
  await client.jobs.continueJob({
170
- job_id: "af7a26d6-cf0b-458c-a6ed-4b6318c74da3",
167
+ job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
171
168
  new_limit: 100
172
169
  });
173
170
 
@@ -233,7 +230,7 @@ Retrieve the current processing status of a job.
233
230
 
234
231
  ```typescript
235
232
  await client.jobs.getJobStatus({
236
- job_id: "af7a26d6-cf0b-458c-a6ed-4b6318c74da3"
233
+ job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
237
234
  });
238
235
 
239
236
  ```
@@ -270,7 +267,7 @@ await client.jobs.getJobStatus({
270
267
  </dl>
271
268
  </details>
272
269
 
273
- <details><summary><code>client.jobs.<a href="/src/api/resources/jobs/client/Client.ts">getUserJobs</a>({ ...params }) -> CatchAllApi.ListUserJobsResponseDto[]</code></summary>
270
+ <details><summary><code>client.jobs.<a href="/src/api/resources/jobs/client/Client.ts">getUserJobs</a>({ ...params }) -> CatchAllApi.ListUserJobsResponseDto</code></summary>
274
271
  <dl>
275
272
  <dd>
276
273
 
@@ -361,7 +358,7 @@ Retrieve the final results for a completed job.
361
358
 
362
359
  ```typescript
363
360
  await client.jobs.getJobResults({
364
- job_id: "af7a26d6-cf0b-458c-a6ed-4b6318c74da3"
361
+ job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c"
365
362
  });
366
363
 
367
364
  ```
@@ -411,20 +408,7 @@ await client.jobs.getJobResults({
411
408
  <dl>
412
409
  <dd>
413
410
 
414
- Create a monitor that runs jobs based on a reference job with a specified schedule.
415
-
416
- **Reference job requirements:**
417
- - Job's `end_date` must be within the last 7 days
418
-
419
- **Schedule requirements:**
420
- - Minimum 24-hour interval between executions
421
- - Natural language format (e.g., "every day at 12 PM UTC", "every 48 hours")
422
-
423
- **Validation:**
424
- - Reference jobs older than 7 days return 400 Bad Request.
425
- - Schedules below minimum frequency return error with descriptive message.
426
- - Invalid job IDs return 400 Bad Request.
427
- - Duplicate monitors (same job already monitored) return error.
411
+ Create a scheduled monitor based on a reference job.
428
412
  </dd>
429
413
  </dl>
430
414
  </dd>
@@ -440,8 +424,17 @@ Create a monitor that runs jobs based on a reference job with a specified schedu
440
424
 
441
425
  ```typescript
442
426
  await client.monitors.createMonitor({
443
- reference_job_id: "reference_job_id",
444
- schedule: "every day at 12 PM UTC"
427
+ reference_job_id: "5f0c9087-85cb-4917-b3c7-e5a5eff73a0c",
428
+ schedule: "every day at 12 PM UTC",
429
+ webhook: {
430
+ url: "https://your-endpoint.com/webhook",
431
+ method: "POST",
432
+ headers: {
433
+ "Authorization": "Bearer your_token_here"
434
+ }
435
+ },
436
+ limit: 10,
437
+ backfill: true
445
438
  });
446
439
 
447
440
  ```
@@ -490,15 +483,7 @@ await client.monitors.createMonitor({
490
483
  <dl>
491
484
  <dd>
492
485
 
493
- Update webhook configuration for an existing monitor without recreating it.
494
-
495
- **Supported updates:**
496
- - Webhook URL
497
- - HTTP method (POST/PUT)
498
- - Headers and authentication
499
- - Query parameters
500
-
501
- **Note:** Schedule and reference job cannot be modified. To change these, create a new monitor.
486
+ Update the webhook configuration for an existing monitor.
502
487
  </dd>
503
488
  </dl>
504
489
  </dd>
@@ -570,8 +555,7 @@ await client.monitors.updateMonitor({
570
555
  <dl>
571
556
  <dd>
572
557
 
573
- Returns all jobs associated with a monitor, sorted by start_date.
574
- Each job includes job_id, start_date, and end_date.
558
+ Return all jobs executed by a monitor.
575
559
  </dd>
576
560
  </dl>
577
561
  </dd>
@@ -636,8 +620,7 @@ await client.monitors.listMonitorJobs({
636
620
  <dl>
637
621
  <dd>
638
622
 
639
- Retrieve aggregated results from all jobs executed by this monitor.
640
- Includes monitor configuration, execution history, and all records collected.
623
+ Retrieve aggregated results from all jobs executed by a monitor.
641
624
  </dd>
642
625
  </dl>
643
626
  </dd>
@@ -702,8 +685,7 @@ await client.monitors.pullMonitorResults({
702
685
  <dl>
703
686
  <dd>
704
687
 
705
- Disables a monitor to stop executing scheduled jobs.
706
- Validates that the provided API key is associated with the monitor.
688
+ Stop scheduled job execution for a monitor.
707
689
  </dd>
708
690
  </dl>
709
691
  </dd>
@@ -768,8 +750,7 @@ await client.monitors.disableMonitor({
768
750
  <dl>
769
751
  <dd>
770
752
 
771
- Enables a monitor to resume executing scheduled jobs.
772
- Validates that the provided API key is associated with the monitor.
753
+ Resume scheduled job execution for a monitor.
773
754
  </dd>
774
755
  </dl>
775
756
  </dd>
@@ -785,7 +766,8 @@ Validates that the provided API key is associated with the monitor.
785
766
 
786
767
  ```typescript
787
768
  await client.monitors.enableMonitor({
788
- monitor_id: "monitor_id"
769
+ monitor_id: "monitor_id",
770
+ backfill: true
789
771
  });
790
772
 
791
773
  ```
@@ -802,7 +784,7 @@ await client.monitors.enableMonitor({
802
784
  <dl>
803
785
  <dd>
804
786
 
805
- **request:** `CatchAllApi.EnableMonitorRequest`
787
+ **request:** `CatchAllApi.EnableMonitorRequestDto`
806
788
 
807
789
  </dd>
808
790
  </dl>
@@ -822,7 +804,7 @@ await client.monitors.enableMonitor({
822
804
  </dl>
823
805
  </details>
824
806
 
825
- <details><summary><code>client.monitors.<a href="/src/api/resources/monitors/client/Client.ts">listMonitors</a>() -> CatchAllApi.ListMonitorsResponseDto</code></summary>
807
+ <details><summary><code>client.monitors.<a href="/src/api/resources/monitors/client/Client.ts">listMonitors</a>({ ...params }) -> CatchAllApi.ListMonitorsResponseDto</code></summary>
826
808
  <dl>
827
809
  <dd>
828
810
 
@@ -865,6 +847,14 @@ await client.monitors.listMonitors();
865
847
  <dl>
866
848
  <dd>
867
849
 
850
+ **request:** `CatchAllApi.ListMonitorsRequest`
851
+
852
+ </dd>
853
+ </dl>
854
+
855
+ <dl>
856
+ <dd>
857
+
868
858
  **requestOptions:** `MonitorsClient.RequestOptions`
869
859
 
870
860
  </dd>
@@ -987,3 +977,59 @@ await client.meta.getVersion();
987
977
  </dd>
988
978
  </dl>
989
979
  </details>
980
+
981
+ <details><summary><code>client.meta.<a href="/src/api/resources/meta/client/Client.ts">getPlanLimits</a>() -> CatchAllApi.GetPlanLimitsResponseDto</code></summary>
982
+ <dl>
983
+ <dd>
984
+
985
+ #### 📝 Description
986
+
987
+ <dl>
988
+ <dd>
989
+
990
+ <dl>
991
+ <dd>
992
+
993
+ Returns plan features and current usage for the authenticated organization.
994
+ </dd>
995
+ </dl>
996
+ </dd>
997
+ </dl>
998
+
999
+ #### 🔌 Usage
1000
+
1001
+ <dl>
1002
+ <dd>
1003
+
1004
+ <dl>
1005
+ <dd>
1006
+
1007
+ ```typescript
1008
+ await client.meta.getPlanLimits();
1009
+
1010
+ ```
1011
+ </dd>
1012
+ </dl>
1013
+ </dd>
1014
+ </dl>
1015
+
1016
+ #### ⚙️ Parameters
1017
+
1018
+ <dl>
1019
+ <dd>
1020
+
1021
+ <dl>
1022
+ <dd>
1023
+
1024
+ **requestOptions:** `MetaClient.RequestOptions`
1025
+
1026
+ </dd>
1027
+ </dl>
1028
+ </dd>
1029
+ </dl>
1030
+
1031
+
1032
+ </dd>
1033
+ </dl>
1034
+ </details>
1035
+
@@ -1,10 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * monitor_id: "monitor_id"
5
- * }
6
- */
7
- export interface EnableMonitorRequest {
8
- /** Monitor identifier. */
9
- monitor_id: string;
10
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Template string to guide record summary formatting. Use placeholder syntax with brackets to indicate desired fields: [COMPANY], [REVENUE], [TARGET], [AMOUNT], etc.
3
- *
4
- * When provided, the system generates a `schema_based_summary` field for each record following this template.
5
- */
6
- export type Schema = string;
@@ -1,10 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * monitor_id: "monitor_id"
5
- * }
6
- */
7
- export interface EnableMonitorRequest {
8
- /** Monitor identifier. */
9
- monitor_id: string;
10
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Template string to guide record summary formatting. Use placeholder syntax with brackets to indicate desired fields: [COMPANY], [REVENUE], [TARGET], [AMOUNT], etc.
3
- *
4
- * When provided, the system generates a `schema_based_summary` field for each record following this template.
5
- */
6
- export type Schema = string;