UNPKG

@lableb/javascript-sdk

Version:

Lableb cloud search client for javascript

57 lines (46 loc) 2.04 kB
import { BaseRequestParams, BuildRequestResult } from "../../types"; import { FeedbackDocument } from "../feedback/feedback.document.type"; export interface BatchSearchFeedbackRequestParams extends Omit<BaseRequestParams, "sessionId" | "userId" | "userIp" | "userCountry" | "sessionIdGenerator"> { /** your search API Key copied from [Lableb Dashboard](https://dashboard.lableb.com) */ APIKey?: string, /** the used search handler for the search function */ searchHandler?: string, /** * feedback object * * ## Content of the feedback object: `documentFeedback` * * | field | type | description | * | --------- | ------ | ----------- | * | query* | string | query used in the search function | * | itemId | string | document"s id clicked on or chosen by the user | * | itemOrder | string | document"s order clicked on or chosen by the user | * | url | string | document"s url clicked on or chosen by the user | * | sessionId | string | uniques session id of the end user | */ documentsFeedbacks: FeedbackDocument[], } export interface SingleSearchFeedbackRequestParams extends Omit<BatchSearchFeedbackRequestParams, "documentsFeedbacks"> { /** * feedback object * * ## Content of the feedback object: `documentFeedback` * * | field | type | description | * | --------- | ------ | ----------- | * | query* | string | query used in the search function | * | itemId | string | document"s id clicked on or chosen by the user | * | itemOrder | string | document"s order clicked on or chosen by the user | * | url | string | document"s url clicked on or chosen by the user | * | sessionId | string | uniques session id of the end user | */ documentFeedback: FeedbackDocument, } export interface BatchSearchFeedbackRequestResult extends BuildRequestResult { params: { apikey?: string, }, body: FeedbackDocument[], }