@shelf/agent-assist-sdk
Version:
SDK for Shelf Agent Assist Express
130 lines (129 loc) • 3.96 kB
TypeScript
export type Telemetery = {
systemName: 'kustomer' | 'genesys_cloud' | 'five9' | 'shelf' | 'cxone' | 'sap_c4c' | 'zendesk' | string;
systemLocation?: 'standalone_widget' | 'conversation_widget' | 'configurator-preview' | 'search_widget';
};
export type InitializeConfig = {
configurationId?: string;
suggestions?: {
enabled?: boolean;
send?: {
enabled: boolean;
};
};
gem?: {
send?: {
enabled: boolean;
};
};
favorites?: {
enabled: boolean;
};
announcements?: {
enabled: boolean;
};
contentLinking?: {
enabled: boolean;
};
telemetry?: Telemetery;
shelfDomain: string;
subdomain?: string;
onMissingToken?(): Promise<{
token: string;
}>;
};
export type AgentAssistTab = 'suggestions' | 'search' | 'gem' | 'favorites' | 'announcements' | 'links' | 'settings';
export type SDKEvent = 'open-tab' | 'get-suggestions' | 'clear-suggestions' | 'get-context-suggestions' | 'initialize' | 'update-session' | 'start-session' | 'request' | 'track-event' | 'apply-search' | 'open-gem' | string;
export type AgentEvent = 'initialize' | 'missing-token' | 'send-to-chat' | 'session-start' | 'gem-favorited' | 'gem-unfavorited' | 'copy-snippet' | 'content-linked' | 'content-unlinked';
export type UpdateSessionPayload = {
interactionId?: string;
agentId?: string;
participantId?: string;
participantContext?: Record<string, any>;
systemLocation?: string;
systemName?: string;
};
export type StartSessionPayload = UpdateSessionPayload;
export type Message = {
id?: string;
createdAt?: string;
text: string;
senderType: 'client' | 'agent';
};
export type RequestParams = {
url: string;
method: 'PATCH' | 'PUT' | 'DELETE' | 'GET' | 'POST';
body?: Record<string, any>;
headers?: Record<string, any>;
};
export type EventsPayloadMap = {
initialize: undefined;
'session-start': undefined;
'missing-token': undefined;
'gem-favorited': {
gemId: string;
};
'gem-unfavorited': {
gemId: string;
};
'send-to-chat': {
text: string;
html: string;
};
'copy-snippet': {
text: string;
html: string;
};
'content-linked': {
gemId: string;
objectId: string;
decisionTreeStepId?: string;
};
'content-unlinked': {
gemId: string;
objectId: string;
};
};
export type Event = {
name: string;
payload?: Record<string, any>;
};
export type SortBy = 'TITLE' | 'CREATED_DATE' | 'UPDATED_DATE' | 'VIEWS' | 'RATING' | 'RELEVANCE' | 'LAST_REVIEWED_DATE' | 'SCHEDULED_REVIEW_DATE' | 'REVIEW_FREQUENCY';
type QueryField = 'title' | `fields.${string}`;
export type SearchFilters = {
query?: string;
searchLanguage?: string[] | 'any' | string;
mimeType?: string[];
tags?: string[];
tagsOp?: 'and' | 'or';
tagsToExclude?: string[];
queryFields?: QueryField[];
collectionIds?: string[];
collectionIdsToExclude?: string[];
connectorIds?: string[];
idsToInclude?: string[];
idsToExclude?: string[];
createdAfter?: string;
createdBefore?: string;
updatedAfter?: string;
updatedBefore?: string;
updatedAfterStrict?: string;
updatedBeforeStrict?: string;
parentId?: string;
includeDeepResults?: boolean;
entityTypes?: NonNullable<undefined | 'Content' | 'Folder' | 'Mixed'>[];
fieldsFilters?: Record<string, string[] | number[] | string>;
externalURLs?: string[];
sortBy?: SortBy;
sortOrder?: 'ASC' | 'DESC';
size?: number;
from?: number;
nextToken?: string;
};
export type GetField = 'account' | 'user' | 'agentAssistSettings';
export type ToastMessageType = 'success' | 'info' | 'warning' | 'error';
export type ToastMessageProps = {
message: string;
messageType: ToastMessageType;
duration?: number;
};
export {};