coveo-search-ui-extensions
Version:
Small generic components to extend the functionality of Coveo's Search UI framework.
77 lines (76 loc) • 1.93 kB
TypeScript
import { AccessToken } from 'coveo-search-ui';
/**
* Initialization options for **UserProfilingEndpoint**.
*/
export interface IUserProfilingEndpointOptions {
/**
* URI of the User Profiling Endpoint.
*
* Default: `https://platform.cloud.coveo.com`
*/
uri?: string;
/**
* Search Token to query the endpoint.
*/
accessToken: AccessToken;
/**
* Organization identifier of the organization.
*/
organization: string;
}
/**
* User Actions posible type.
*/
export declare enum UserActionType {
Search = "SEARCH",
Click = "CLICK",
PageView = "VIEW",
Custom = "CUSTOM",
TicketCreated = "TICKET_CREATED"
}
/**
* Pased Action History item format.
*/
export interface IActionHistory {
/**
* Type of the action.
*/
name: UserActionType;
/**
* When the action was done.
*/
time: number;
/**
* Value associated to an actions.
*/
value: {
[key: string]: string;
};
}
/**
* Class that handle interaction with the endpoint.
*/
export declare class UserProfilingEndpoint {
options: IUserProfilingEndpointOptions;
/**
* Default platform uri.
*/
static readonly DEFAULT_URI = "https://platform.cloud.coveo.com";
private caller;
/**
* Create a `UserProfilingEndpoint` instance.
* Create [`EndpointCaller`]{@link EndpointCaller} instance and uses it to communicate with the endpoint internally.
*
* @param options The options to initialize the component.
*/
constructor(options: IUserProfilingEndpointOptions);
private buildEndpointCaller;
/**
* Get the list of actions a user has performed.
*
* @param userId Id from which action history will be retrieve. (either visitId or user email).
*/
getActions(userId: string): Promise<IActionHistory[]>;
private parseResponse;
private isResponseEmpty;
}