import { GetJobSearchResponse } from '../responses/jobs-search.reponse.get' ; import { JobSearchFilters } from '../types/job-search-filters' ; import { LinkedInRequest } from '../core/linkedin-request' ; import { GetBlendedSearchResponse } from '../responses/blended-search.reponse.get' ; import { BlendedSearchFilters } from '../types/blended-search-filters' ; export class SearchRequest { private request : LinkedInRequest ; constructor ( { request } ) { this . request = request ; } searchBlended ( { skip = 0 , limit = 10 , filters = { } , keywords , } ) { const queryParams = { filters , count : limit , ... ( keywords ? { keywords : encodeURIComponent ( keywords ) } : { } ) , origin : 'TYPEAHEAD_ESCAPE_HATCH' , q : 'all' , queryContext : { spellCorrectionEnabled : true , relatedSearchesEnabled : true , } , start : skip , } ; return this . request . get < GetBlendedSearchResponse > ( 'search/blended' , { params : queryParams , } ) ; } searchJobs ( { skip = 0 , limit = 10 , filters = { } , keywords , } ) { const queryParams = { filters , count : limit , ... ( keywords ? { keywords : encodeURIComponent ( keywords ) } : { } ) , origin : 'JOB_SEARCH_RESULTS_PAGE' , decorationId : 'com.linkedin.voyager.deco.jserp.WebJobSearchHitLite-14' , q : 'jserpFilters' , queryContext : { primaryHitType : 'JOBS' , spellCorrectionEnabled : true , } , start : skip , } ; return this . request . get < GetJobSearchResponse > ( 'search/hits' , { params : queryParams , } ) ; } }