exa-js 1.8.25 → 1.8.26
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 +37 -47
- package/dist/index.d.ts +37 -47
- package/dist/index.js +9 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
49
|
+
protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise<T>;
|
|
50
50
|
/**
|
|
51
51
|
* Helper to build pagination parameters
|
|
52
52
|
* @param pagination The pagination parameters
|
|
@@ -2023,6 +2023,37 @@ 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
|
+
|
|
2026
2057
|
/**
|
|
2027
2058
|
* Client for managing Webset Webhooks
|
|
2028
2059
|
*/
|
|
@@ -2115,47 +2146,6 @@ declare class WebsetWebhooksClient extends WebsetsBaseClient {
|
|
|
2115
2146
|
getAllAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise<WebhookAttempt[]>;
|
|
2116
2147
|
}
|
|
2117
2148
|
|
|
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
|
-
|
|
2159
2149
|
/**
|
|
2160
2150
|
* Main client for Websets API
|
|
2161
2151
|
*/
|
|
@@ -2207,9 +2197,7 @@ declare class WebsetsClient extends WebsetsBaseClient {
|
|
|
2207
2197
|
* @param params The Webset creation parameters
|
|
2208
2198
|
* @returns The created Webset
|
|
2209
2199
|
*/
|
|
2210
|
-
create(params: CreateWebsetParameters
|
|
2211
|
-
headers?: WebsetHeadersLike;
|
|
2212
|
-
}): Promise<Webset>;
|
|
2200
|
+
create(params: CreateWebsetParameters): Promise<Webset>;
|
|
2213
2201
|
/**
|
|
2214
2202
|
* Preview a webset
|
|
2215
2203
|
* @param params The preview parameters
|
|
@@ -2778,6 +2766,7 @@ declare const isBeta = false;
|
|
|
2778
2766
|
* @property {string[]} [includeText] - List of strings that must be present in webpage text of results. Currently only supports 1 string of up to 5 words.
|
|
2779
2767
|
* @property {string[]} [excludeText] - List of strings that must not be present in webpage text of results. Currently only supports 1 string of up to 5 words.
|
|
2780
2768
|
* @property {string[]} [flags] - Experimental flags
|
|
2769
|
+
* @property {string} [userLocation] - The two-letter ISO country code of the user, e.g. US.
|
|
2781
2770
|
*/
|
|
2782
2771
|
type BaseSearchOptions = {
|
|
2783
2772
|
numResults?: number;
|
|
@@ -2791,6 +2780,7 @@ type BaseSearchOptions = {
|
|
|
2791
2780
|
includeText?: string[];
|
|
2792
2781
|
excludeText?: string[];
|
|
2793
2782
|
flags?: string[];
|
|
2783
|
+
userLocation?: string;
|
|
2794
2784
|
};
|
|
2795
2785
|
/**
|
|
2796
2786
|
* Search options for performing a search query.
|
|
@@ -3145,7 +3135,7 @@ declare class Exa {
|
|
|
3145
3135
|
* @returns {Promise<any>} The response from the API.
|
|
3146
3136
|
* @throws {ExaError} When any API request fails with structured error information
|
|
3147
3137
|
*/
|
|
3148
|
-
request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any
|
|
3138
|
+
request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>): Promise<T>;
|
|
3149
3139
|
rawRequest(endpoint: string, method?: string, body?: Record<string, unknown>, queryParams?: Record<string, string | number | boolean | string[] | undefined>): Promise<Response>;
|
|
3150
3140
|
/**
|
|
3151
3141
|
* Performs a search with an Exa prompt-engineered query.
|
|
@@ -3250,4 +3240,4 @@ declare class Exa {
|
|
|
3250
3240
|
private parseSSEStream;
|
|
3251
3241
|
}
|
|
3252
3242
|
|
|
3253
|
-
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
|
|
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 };
|
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
|
|
49
|
+
protected request<T = unknown>(endpoint: string, method?: string, data?: RequestBody$1, params?: QueryParams$1): Promise<T>;
|
|
50
50
|
/**
|
|
51
51
|
* Helper to build pagination parameters
|
|
52
52
|
* @param pagination The pagination parameters
|
|
@@ -2023,6 +2023,37 @@ 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
|
+
|
|
2026
2057
|
/**
|
|
2027
2058
|
* Client for managing Webset Webhooks
|
|
2028
2059
|
*/
|
|
@@ -2115,47 +2146,6 @@ declare class WebsetWebhooksClient extends WebsetsBaseClient {
|
|
|
2115
2146
|
getAllAttempts(id: string, options?: ListWebhookAttemptsOptions): Promise<WebhookAttempt[]>;
|
|
2116
2147
|
}
|
|
2117
2148
|
|
|
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
|
-
|
|
2159
2149
|
/**
|
|
2160
2150
|
* Main client for Websets API
|
|
2161
2151
|
*/
|
|
@@ -2207,9 +2197,7 @@ declare class WebsetsClient extends WebsetsBaseClient {
|
|
|
2207
2197
|
* @param params The Webset creation parameters
|
|
2208
2198
|
* @returns The created Webset
|
|
2209
2199
|
*/
|
|
2210
|
-
create(params: CreateWebsetParameters
|
|
2211
|
-
headers?: WebsetHeadersLike;
|
|
2212
|
-
}): Promise<Webset>;
|
|
2200
|
+
create(params: CreateWebsetParameters): Promise<Webset>;
|
|
2213
2201
|
/**
|
|
2214
2202
|
* Preview a webset
|
|
2215
2203
|
* @param params The preview parameters
|
|
@@ -2778,6 +2766,7 @@ declare const isBeta = false;
|
|
|
2778
2766
|
* @property {string[]} [includeText] - List of strings that must be present in webpage text of results. Currently only supports 1 string of up to 5 words.
|
|
2779
2767
|
* @property {string[]} [excludeText] - List of strings that must not be present in webpage text of results. Currently only supports 1 string of up to 5 words.
|
|
2780
2768
|
* @property {string[]} [flags] - Experimental flags
|
|
2769
|
+
* @property {string} [userLocation] - The two-letter ISO country code of the user, e.g. US.
|
|
2781
2770
|
*/
|
|
2782
2771
|
type BaseSearchOptions = {
|
|
2783
2772
|
numResults?: number;
|
|
@@ -2791,6 +2780,7 @@ type BaseSearchOptions = {
|
|
|
2791
2780
|
includeText?: string[];
|
|
2792
2781
|
excludeText?: string[];
|
|
2793
2782
|
flags?: string[];
|
|
2783
|
+
userLocation?: string;
|
|
2794
2784
|
};
|
|
2795
2785
|
/**
|
|
2796
2786
|
* Search options for performing a search query.
|
|
@@ -3145,7 +3135,7 @@ declare class Exa {
|
|
|
3145
3135
|
* @returns {Promise<any>} The response from the API.
|
|
3146
3136
|
* @throws {ExaError} When any API request fails with structured error information
|
|
3147
3137
|
*/
|
|
3148
|
-
request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any
|
|
3138
|
+
request<T = unknown>(endpoint: string, method: string, body?: any, params?: Record<string, any>): Promise<T>;
|
|
3149
3139
|
rawRequest(endpoint: string, method?: string, body?: Record<string, unknown>, queryParams?: Record<string, string | number | boolean | string[] | undefined>): Promise<Response>;
|
|
3150
3140
|
/**
|
|
3151
3141
|
* Performs a search with an Exa prompt-engineered query.
|
|
@@ -3250,4 +3240,4 @@ declare class Exa {
|
|
|
3250
3240
|
private parseSSEStream;
|
|
3251
3241
|
}
|
|
3252
3242
|
|
|
3253
|
-
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
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -122,14 +122,8 @@ 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(
|
|
127
|
-
`/websets${endpoint}`,
|
|
128
|
-
method,
|
|
129
|
-
data,
|
|
130
|
-
params,
|
|
131
|
-
headers
|
|
132
|
-
);
|
|
125
|
+
async request(endpoint, method = "POST", data, params) {
|
|
126
|
+
return this.client.request(`/websets${endpoint}`, method, data, params);
|
|
133
127
|
}
|
|
134
128
|
/**
|
|
135
129
|
* Helper to build pagination parameters
|
|
@@ -738,13 +732,11 @@ var WebsetSearchesClient = class extends WebsetsBaseClient {
|
|
|
738
732
|
* @param params The search parameters
|
|
739
733
|
* @returns The created Webset Search
|
|
740
734
|
*/
|
|
741
|
-
async create(websetId, params
|
|
735
|
+
async create(websetId, params) {
|
|
742
736
|
return this.request(
|
|
743
737
|
`/v0/websets/${websetId}/searches`,
|
|
744
738
|
"POST",
|
|
745
|
-
params
|
|
746
|
-
void 0,
|
|
747
|
-
options?.headers
|
|
739
|
+
params
|
|
748
740
|
);
|
|
749
741
|
}
|
|
750
742
|
/**
|
|
@@ -931,14 +923,8 @@ var WebsetsClient = class extends WebsetsBaseClient {
|
|
|
931
923
|
* @param params The Webset creation parameters
|
|
932
924
|
* @returns The created Webset
|
|
933
925
|
*/
|
|
934
|
-
async create(params
|
|
935
|
-
return this.request(
|
|
936
|
-
"/v0/websets",
|
|
937
|
-
"POST",
|
|
938
|
-
params,
|
|
939
|
-
void 0,
|
|
940
|
-
options?.headers
|
|
941
|
-
);
|
|
926
|
+
async create(params) {
|
|
927
|
+
return this.request("/v0/websets", "POST", params);
|
|
942
928
|
}
|
|
943
929
|
/**
|
|
944
930
|
* Preview a webset
|
|
@@ -946,11 +932,7 @@ var WebsetsClient = class extends WebsetsBaseClient {
|
|
|
946
932
|
* @returns The preview response showing how the query will be decomposed
|
|
947
933
|
*/
|
|
948
934
|
async preview(params) {
|
|
949
|
-
return this.request(
|
|
950
|
-
"/v0/websets/preview",
|
|
951
|
-
"POST",
|
|
952
|
-
params
|
|
953
|
-
);
|
|
935
|
+
return this.request("/v0/websets/preview", "POST", params);
|
|
954
936
|
}
|
|
955
937
|
/**
|
|
956
938
|
* Get a Webset by ID
|
|
@@ -1351,7 +1333,7 @@ var Exa2 = class {
|
|
|
1351
1333
|
* @returns {Promise<any>} The response from the API.
|
|
1352
1334
|
* @throws {ExaError} When any API request fails with structured error information
|
|
1353
1335
|
*/
|
|
1354
|
-
async request(endpoint, method, body, params
|
|
1336
|
+
async request(endpoint, method, body, params) {
|
|
1355
1337
|
let url = this.baseURL + endpoint;
|
|
1356
1338
|
if (params && Object.keys(params).length > 0) {
|
|
1357
1339
|
const searchParams = new URLSearchParams();
|
|
@@ -1366,20 +1348,9 @@ var Exa2 = class {
|
|
|
1366
1348
|
}
|
|
1367
1349
|
url += `?${searchParams.toString()}`;
|
|
1368
1350
|
}
|
|
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
|
-
}
|
|
1380
1351
|
const response = await fetchImpl(url, {
|
|
1381
1352
|
method,
|
|
1382
|
-
headers:
|
|
1353
|
+
headers: this.headers,
|
|
1383
1354
|
body: body ? JSON.stringify(body) : void 0
|
|
1384
1355
|
});
|
|
1385
1356
|
if (!response.ok) {
|