UNPKG

@sociate/sociate-api-sdk

Version:

Javascript client for Sociate AI APIs

35 lines (34 loc) 1.61 kB
import { HttpClient } from '../lib/core/http'; import { SearchAdvancedRequest, SearchBasicRequest, SearchCategoryProductRequest, SearchCategoryProductResponse, SearchProductResponse, SearchRequest } from '../types/search'; export declare class SearchAPI { private httpClient; constructor(httpClient: HttpClient); /** * Performs a basic search using the provided parameters. * @param params - The parameters for the basic search. * @returns A promise that resolves to the search results. */ basic(params: SearchBasicRequest): Promise<SearchProductResponse>; /** * Performs an advanced search using the provided parameters. * @param params - The parameters for the advanced search. * @returns A promise that resolves to the search results. */ advanced(params: SearchAdvancedRequest): Promise<SearchProductResponse>; /** * Searches for products by image. * * @param {SearchCategoryProductRequest} params - The parameters for the search. * @param {File} params.image - The image file to search with. * @param {string} params.style - The style to filter the search results. * @returns The search results. */ searchByImage(params: SearchCategoryProductRequest): Promise<SearchCategoryProductResponse>; /** * Executes a search request with the provided parameters. * * @param {SearchRequest} params - The search parameters to be used in the request. * @returns A promise that resolves to the search product response. */ get(params: SearchRequest): Promise<SearchProductResponse>; }