exa-js 1.8.26 → 1.8.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -46,7 +46,7 @@ declare class WebsetsBaseClient {
46
46
  * @returns The response JSON
47
47
  * @throws ExaError with API error details if the request fails
48
48
  */
49
- protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise<T>;
49
+ protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1, headers?: Record<string, string>): Promise<T>;
50
50
  /**
51
51
  * Helper to build pagination parameters
52
52
  * @param pagination The pagination parameters
@@ -2023,37 +2023,6 @@ declare class WebsetMonitorsClient extends WebsetsBaseClient {
2023
2023
  delete(id: string): Promise<Monitor>;
2024
2024
  }
2025
2025
 
2026
- /**
2027
- * Client for managing Webset Searches
2028
- */
2029
-
2030
- /**
2031
- * Client for managing Webset Searches
2032
- */
2033
- declare class WebsetSearchesClient extends WebsetsBaseClient {
2034
- /**
2035
- * Create a new Search for the Webset
2036
- * @param websetId The ID of the Webset
2037
- * @param params The search parameters
2038
- * @returns The created Webset Search
2039
- */
2040
- create(websetId: string, params: CreateWebsetSearchParameters): Promise<WebsetSearch>;
2041
- /**
2042
- * Get a Search by ID
2043
- * @param websetId The ID of the Webset
2044
- * @param id The ID of the Search
2045
- * @returns The Webset Search
2046
- */
2047
- get(websetId: string, id: string): Promise<WebsetSearch>;
2048
- /**
2049
- * Cancel a running Search
2050
- * @param websetId The ID of the Webset
2051
- * @param id The ID of the Search
2052
- * @returns The canceled Webset Search
2053
- */
2054
- cancel(websetId: string, id: string): Promise<WebsetSearch>;
2055
- }
2056
-
2057
2026
  /**
2058
2027
  * Client for managing Webset Webhooks
2059
2028
  */
@@ -2146,6 +2115,47 @@ declare class WebsetWebhooksClient extends WebsetsBaseClient {
2146
2115
  getAllAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise<WebhookAttempt[]>;
2147
2116
  }
2148
2117
 
2118
+ /**
2119
+ * Websets API client
2120
+ */
2121
+
2122
+ type WebsetHeadersLike = {
2123
+ "x-exa-websets-priority"?: "low" | "medium" | "high";
2124
+ } & Record<string, string>;
2125
+
2126
+ /**
2127
+ * Client for managing Webset Searches
2128
+ */
2129
+
2130
+ /**
2131
+ * Client for managing Webset Searches
2132
+ */
2133
+ declare class WebsetSearchesClient extends WebsetsBaseClient {
2134
+ /**
2135
+ * Create a new Search for the Webset
2136
+ * @param websetId The ID of the Webset
2137
+ * @param params The search parameters
2138
+ * @returns The created Webset Search
2139
+ */
2140
+ create(websetId: string, params: CreateWebsetSearchParameters, options?: {
2141
+ headers?: WebsetHeadersLike;
2142
+ }): Promise<WebsetSearch>;
2143
+ /**
2144
+ * Get a Search by ID
2145
+ * @param websetId The ID of the Webset
2146
+ * @param id The ID of the Search
2147
+ * @returns The Webset Search
2148
+ */
2149
+ get(websetId: string, id: string): Promise<WebsetSearch>;
2150
+ /**
2151
+ * Cancel a running Search
2152
+ * @param websetId The ID of the Webset
2153
+ * @param id The ID of the Search
2154
+ * @returns The canceled Webset Search
2155
+ */
2156
+ cancel(websetId: string, id: string): Promise<WebsetSearch>;
2157
+ }
2158
+
2149
2159
  /**
2150
2160
  * Main client for Websets API
2151
2161
  */
@@ -2197,7 +2207,9 @@ declare class WebsetsClient extends WebsetsBaseClient {
2197
2207
  * @param params The Webset creation parameters
2198
2208
  * @returns The created Webset
2199
2209
  */
2200
- create(params: CreateWebsetParameters): Promise<Webset>;
2210
+ create(params: CreateWebsetParameters, options?: {
2211
+ headers?: WebsetHeadersLike;
2212
+ }): Promise<Webset>;
2201
2213
  /**
2202
2214
  * Preview a webset
2203
2215
  * @param params The preview parameters
@@ -3135,7 +3147,7 @@ declare class Exa {
3135
3147
  * @returns {Promise<any>} The response from the API.
3136
3148
  * @throws {ExaError} When any API request fails with structured error information
3137
3149
  */
3138
- request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>): Promise<T>;
3150
+ request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>, headers?: Record<string, string>): Promise<T>;
3139
3151
  rawRequest(endpoint: string, method?: string, body?: Record<string, unknown>, queryParams?: Record<string, string | number | boolean | string[] | undefined>): Promise<Response>;
3140
3152
  /**
3141
3153
  * Performs a search with an Exa prompt-engineered query.
@@ -3240,4 +3252,4 @@ declare class Exa {
3240
3252
  private parseSSEStream;
3241
3253
  }
3242
3254
 
3243
- export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, CreateWebsetParametersImportSource, CreateWebsetParametersSearchExcludeSource, type CreateWebsetSearchParameters, CreateWebsetSearchParametersExcludeSource, CreateWebsetSearchParametersScopeSource, type CsvDataInput, type CustomEntity, type Default, type EnrichmentResult, type Entity, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type SchemaListResearchTasksRequestDto as ListResearchTasksRequest, type SchemaListResearchTasksResponseDto as ListResearchTasksResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, PreviewWebsetResponseEnrichmentsFormat, type RegularSearchOptions, ResearchClient, type ResearchCreateTaskParamsTyped, type SchemaResearchCreateTaskRequestDto as ResearchCreateTaskRequest, type SchemaResearchCreateTaskResponseDto as ResearchCreateTaskResponse, type ResearchPaperEntity, type SchemaResearchTaskDto as ResearchTask, type ResearchTaskEvent, type ResearchTaskOperation, type ResearchTaskOutputTyped, ScopeSourceType, type SearchResponse, type SearchResult, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
3255
+ export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, CreateWebsetParametersImportSource, CreateWebsetParametersSearchExcludeSource, type CreateWebsetSearchParameters, CreateWebsetSearchParametersExcludeSource, CreateWebsetSearchParametersScopeSource, type CsvDataInput, type CustomEntity, type Default, type EnrichmentResult, type Entity, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type SchemaListResearchTasksRequestDto as ListResearchTasksRequest, type SchemaListResearchTasksResponseDto as ListResearchTasksResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, PreviewWebsetResponseEnrichmentsFormat, type RegularSearchOptions, ResearchClient, type ResearchCreateTaskParamsTyped, type SchemaResearchCreateTaskRequestDto as ResearchCreateTaskRequest, type SchemaResearchCreateTaskResponseDto as ResearchCreateTaskResponse, type ResearchPaperEntity, type SchemaResearchTaskDto as ResearchTask, type ResearchTaskEvent, type ResearchTaskOperation, type ResearchTaskOutputTyped, ScopeSourceType, type SearchResponse, type SearchResult, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, type WebsetHeadersLike, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
package/dist/index.d.ts CHANGED
@@ -46,7 +46,7 @@ declare class WebsetsBaseClient {
46
46
  * @returns The response JSON
47
47
  * @throws ExaError with API error details if the request fails
48
48
  */
49
- protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise<T>;
49
+ protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1, headers?: Record<string, string>): Promise<T>;
50
50
  /**
51
51
  * Helper to build pagination parameters
52
52
  * @param pagination The pagination parameters
@@ -2023,37 +2023,6 @@ declare class WebsetMonitorsClient extends WebsetsBaseClient {
2023
2023
  delete(id: string): Promise<Monitor>;
2024
2024
  }
2025
2025
 
2026
- /**
2027
- * Client for managing Webset Searches
2028
- */
2029
-
2030
- /**
2031
- * Client for managing Webset Searches
2032
- */
2033
- declare class WebsetSearchesClient extends WebsetsBaseClient {
2034
- /**
2035
- * Create a new Search for the Webset
2036
- * @param websetId The ID of the Webset
2037
- * @param params The search parameters
2038
- * @returns The created Webset Search
2039
- */
2040
- create(websetId: string, params: CreateWebsetSearchParameters): Promise<WebsetSearch>;
2041
- /**
2042
- * Get a Search by ID
2043
- * @param websetId The ID of the Webset
2044
- * @param id The ID of the Search
2045
- * @returns The Webset Search
2046
- */
2047
- get(websetId: string, id: string): Promise<WebsetSearch>;
2048
- /**
2049
- * Cancel a running Search
2050
- * @param websetId The ID of the Webset
2051
- * @param id The ID of the Search
2052
- * @returns The canceled Webset Search
2053
- */
2054
- cancel(websetId: string, id: string): Promise<WebsetSearch>;
2055
- }
2056
-
2057
2026
  /**
2058
2027
  * Client for managing Webset Webhooks
2059
2028
  */
@@ -2146,6 +2115,47 @@ declare class WebsetWebhooksClient extends WebsetsBaseClient {
2146
2115
  getAllAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise<WebhookAttempt[]>;
2147
2116
  }
2148
2117
 
2118
+ /**
2119
+ * Websets API client
2120
+ */
2121
+
2122
+ type WebsetHeadersLike = {
2123
+ "x-exa-websets-priority"?: "low" | "medium" | "high";
2124
+ } & Record<string, string>;
2125
+
2126
+ /**
2127
+ * Client for managing Webset Searches
2128
+ */
2129
+
2130
+ /**
2131
+ * Client for managing Webset Searches
2132
+ */
2133
+ declare class WebsetSearchesClient extends WebsetsBaseClient {
2134
+ /**
2135
+ * Create a new Search for the Webset
2136
+ * @param websetId The ID of the Webset
2137
+ * @param params The search parameters
2138
+ * @returns The created Webset Search
2139
+ */
2140
+ create(websetId: string, params: CreateWebsetSearchParameters, options?: {
2141
+ headers?: WebsetHeadersLike;
2142
+ }): Promise<WebsetSearch>;
2143
+ /**
2144
+ * Get a Search by ID
2145
+ * @param websetId The ID of the Webset
2146
+ * @param id The ID of the Search
2147
+ * @returns The Webset Search
2148
+ */
2149
+ get(websetId: string, id: string): Promise<WebsetSearch>;
2150
+ /**
2151
+ * Cancel a running Search
2152
+ * @param websetId The ID of the Webset
2153
+ * @param id The ID of the Search
2154
+ * @returns The canceled Webset Search
2155
+ */
2156
+ cancel(websetId: string, id: string): Promise<WebsetSearch>;
2157
+ }
2158
+
2149
2159
  /**
2150
2160
  * Main client for Websets API
2151
2161
  */
@@ -2197,7 +2207,9 @@ declare class WebsetsClient extends WebsetsBaseClient {
2197
2207
  * @param params The Webset creation parameters
2198
2208
  * @returns The created Webset
2199
2209
  */
2200
- create(params: CreateWebsetParameters): Promise<Webset>;
2210
+ create(params: CreateWebsetParameters, options?: {
2211
+ headers?: WebsetHeadersLike;
2212
+ }): Promise<Webset>;
2201
2213
  /**
2202
2214
  * Preview a webset
2203
2215
  * @param params The preview parameters
@@ -3135,7 +3147,7 @@ declare class Exa {
3135
3147
  * @returns {Promise<any>} The response from the API.
3136
3148
  * @throws {ExaError} When any API request fails with structured error information
3137
3149
  */
3138
- request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>): Promise<T>;
3150
+ request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>, headers?: Record<string, string>): Promise<T>;
3139
3151
  rawRequest(endpoint: string, method?: string, body?: Record<string, unknown>, queryParams?: Record<string, string | number | boolean | string[] | undefined>): Promise<Response>;
3140
3152
  /**
3141
3153
  * Performs a search with an Exa prompt-engineered query.
@@ -3240,4 +3252,4 @@ declare class Exa {
3240
3252
  private parseSSEStream;
3241
3253
  }
3242
3254
 
3243
- export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, CreateWebsetParametersImportSource, CreateWebsetParametersSearchExcludeSource, type CreateWebsetSearchParameters, CreateWebsetSearchParametersExcludeSource, CreateWebsetSearchParametersScopeSource, type CsvDataInput, type CustomEntity, type Default, type EnrichmentResult, type Entity, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type SchemaListResearchTasksRequestDto as ListResearchTasksRequest, type SchemaListResearchTasksResponseDto as ListResearchTasksResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, PreviewWebsetResponseEnrichmentsFormat, type RegularSearchOptions, ResearchClient, type ResearchCreateTaskParamsTyped, type SchemaResearchCreateTaskRequestDto as ResearchCreateTaskRequest, type SchemaResearchCreateTaskResponseDto as ResearchCreateTaskResponse, type ResearchPaperEntity, type SchemaResearchTaskDto as ResearchTask, type ResearchTaskEvent, type ResearchTaskOperation, type ResearchTaskOutputTyped, ScopeSourceType, type SearchResponse, type SearchResult, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
3255
+ export { type AnswerOptions, type AnswerOptionsTyped, type AnswerResponse, type AnswerResponseTyped, type AnswerStreamChunk, type AnswerStreamResponse, type ArticleEntity, type BaseSearchOptions, type CompanyEntity, type ContentsOptions, type ContentsResultComponent, type ContextOptions, type CostDollars, type CostDollarsContents, type CostDollarsSeearch, type CreateCriterionParameters, type CreateEnrichmentParameters, CreateEnrichmentParametersFormat, type CreateImportParameters, CreateImportParametersFormat, type CreateImportResponse, type CreateImportWithCsvParameters, type CreateMonitorParameters, type CreateWebhookParameters, type CreateWebsetParameters, CreateWebsetParametersImportSource, CreateWebsetParametersSearchExcludeSource, type CreateWebsetSearchParameters, CreateWebsetSearchParametersExcludeSource, CreateWebsetSearchParametersScopeSource, type CsvDataInput, type CustomEntity, type Default, type EnrichmentResult, type Entity, type Event, EventType, EventsClient, Exa, ExaError, type ExtrasOptions, type ExtrasResponse, type FindSimilarOptions, type GetWebsetResponse, type HighlightsContentsOptions, type HighlightsResponse, HttpStatusCode, type Import, ImportFailedReason, ImportFormat, ImportObject, ImportStatus, ImportsClient, type JSONSchema, type ListEventsResponse, type ListImportsResponse, type ListMonitorRunsResponse, type ListMonitorsOptions, type ListMonitorsResponse, type SchemaListResearchTasksRequestDto as ListResearchTasksRequest, type SchemaListResearchTasksResponseDto as ListResearchTasksResponse, type ListWebhookAttemptsResponse, type ListWebhooksResponse, type ListWebsetItemResponse, type ListWebsetItemsOptions, type ListWebsetsResponse, type LivecrawlOptions, type Monitor, type MonitorBehavior, type MonitorCadence, MonitorObject, type MonitorRun, MonitorRunObject, MonitorRunStatus, MonitorRunType, MonitorStatus, type PersonEntity, type PreviewWebsetParameters, type PreviewWebsetResponse, PreviewWebsetResponseEnrichmentsFormat, type RegularSearchOptions, ResearchClient, type ResearchCreateTaskParamsTyped, type SchemaResearchCreateTaskRequestDto as ResearchCreateTaskRequest, type SchemaResearchCreateTaskResponseDto as ResearchCreateTaskResponse, type ResearchPaperEntity, type SchemaResearchTaskDto as ResearchTask, type ResearchTaskEvent, type ResearchTaskOperation, type ResearchTaskOutputTyped, ScopeSourceType, type SearchResponse, type SearchResult, type Status, type SubpagesResponse, type SummaryContentsOptions, type SummaryContentsOptionsTyped, type SummaryResponse, type TextContentsOptions, type TextResponse, type UpdateImport, type UpdateMonitor, UpdateMonitorStatus, type UpdateWebhookParameters, type UpdateWebsetRequest, type WaitUntilCompletedOptions, type Webhook, type WebhookAttempt, WebhookStatus, type Webset, type WebsetEnrichment, WebsetEnrichmentFormat, WebsetEnrichmentStatus, WebsetEnrichmentsClient, type WebsetHeadersLike, type WebsetItem, type WebsetItemArticleProperties, type WebsetItemCompanyProperties, type WebsetItemCustomProperties, type WebsetItemEvaluation, WebsetItemEvaluationSatisfied, type WebsetItemPersonProperties, type WebsetItemResearchPaperProperties, WebsetItemSource, WebsetItemsClient, WebsetMonitorsClient, type WebsetSearch, WebsetSearchBehavior, WebsetSearchCanceledReason, WebsetSearchStatus, WebsetSearchesClient, WebsetStatus, WebsetWebhooksClient, WebsetsClient, Exa as default };
package/dist/index.js CHANGED
@@ -122,8 +122,14 @@ var WebsetsBaseClient = class {
122
122
  * @returns The response JSON
123
123
  * @throws ExaError with API error details if the request fails
124
124
  */
125
- async request(endpoint, method = "POST", data, params) {
126
- return this.client.request(`/websets${endpoint}`, method, data, params);
125
+ async request(endpoint, method = "POST", data, params, headers) {
126
+ return this.client.request(
127
+ `/websets${endpoint}`,
128
+ method,
129
+ data,
130
+ params,
131
+ headers
132
+ );
127
133
  }
128
134
  /**
129
135
  * Helper to build pagination parameters
@@ -732,11 +738,13 @@ var WebsetSearchesClient = class extends WebsetsBaseClient {
732
738
  * @param params The search parameters
733
739
  * @returns The created Webset Search
734
740
  */
735
- async create(websetId, params) {
741
+ async create(websetId, params, options) {
736
742
  return this.request(
737
743
  `/v0/websets/${websetId}/searches`,
738
744
  "POST",
739
- params
745
+ params,
746
+ void 0,
747
+ options?.headers
740
748
  );
741
749
  }
742
750
  /**
@@ -923,8 +931,14 @@ var WebsetsClient = class extends WebsetsBaseClient {
923
931
  * @param params The Webset creation parameters
924
932
  * @returns The created Webset
925
933
  */
926
- async create(params) {
927
- return this.request("/v0/websets", "POST", params);
934
+ async create(params, options) {
935
+ return this.request(
936
+ "/v0/websets",
937
+ "POST",
938
+ params,
939
+ void 0,
940
+ options?.headers
941
+ );
928
942
  }
929
943
  /**
930
944
  * Preview a webset
@@ -932,7 +946,11 @@ var WebsetsClient = class extends WebsetsBaseClient {
932
946
  * @returns The preview response showing how the query will be decomposed
933
947
  */
934
948
  async preview(params) {
935
- return this.request("/v0/websets/preview", "POST", params);
949
+ return this.request(
950
+ "/v0/websets/preview",
951
+ "POST",
952
+ params
953
+ );
936
954
  }
937
955
  /**
938
956
  * Get a Webset by ID
@@ -1333,7 +1351,7 @@ var Exa2 = class {
1333
1351
  * @returns {Promise<any>} The response from the API.
1334
1352
  * @throws {ExaError} When any API request fails with structured error information
1335
1353
  */
1336
- async request(endpoint, method, body, params) {
1354
+ async request(endpoint, method, body, params, headers) {
1337
1355
  let url = this.baseURL + endpoint;
1338
1356
  if (params && Object.keys(params).length > 0) {
1339
1357
  const searchParams = new URLSearchParams();
@@ -1348,9 +1366,20 @@ var Exa2 = class {
1348
1366
  }
1349
1367
  url += `?${searchParams.toString()}`;
1350
1368
  }
1369
+ let combinedHeaders = {};
1370
+ if (this.headers instanceof HeadersImpl) {
1371
+ this.headers.forEach((value, key) => {
1372
+ combinedHeaders[key] = value;
1373
+ });
1374
+ } else {
1375
+ combinedHeaders = { ...this.headers };
1376
+ }
1377
+ if (headers) {
1378
+ combinedHeaders = { ...combinedHeaders, ...headers };
1379
+ }
1351
1380
  const response = await fetchImpl(url, {
1352
1381
  method,
1353
- headers: this.headers,
1382
+ headers: combinedHeaders,
1354
1383
  body: body ? JSON.stringify(body) : void 0
1355
1384
  });
1356
1385
  if (!response.ok) {