bibot 1.0.42 → 1.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { predefinedQuestionsType, Q_DATA_TYPE, recordPredefinedQProps, RemoteChatBubbleConfigProps } from '../types/coreInterfaces';
3
- declare function recordPredefinedQ(pluginAxiosInstance: AxiosInstance, data: recordPredefinedQProps): Promise<string>;
4
- declare function askBiBot(pluginAxiosInstance: AxiosInstance, data: Q_DATA_TYPE): Promise<string>;
2
+ import { BIBOT_INFERENCE_TYPE, PredefinedQuestionsType, Q_DATA_TYPE, recordPredefinedQProps, RemoteChatBubbleConfigProps } from '../types/coreInterfaces';
3
+ declare function recordPredefinedQ(pluginAxiosInstance: AxiosInstance, data: recordPredefinedQProps): Promise<BIBOT_INFERENCE_TYPE>;
4
+ declare function askBiBot(pluginAxiosInstance: AxiosInstance, data: Q_DATA_TYPE): Promise<BIBOT_INFERENCE_TYPE>;
5
5
  declare function getRemoteClientChatBubbleConfig(pluginAxiosInstance: AxiosInstance, params: {
6
6
  client_id: string;
7
7
  }): Promise<RemoteChatBubbleConfigProps>;
8
8
  declare function getRemoteClientChatPredefinedQuestions(pluginAxiosInstance: AxiosInstance, params: {
9
9
  client_id: string;
10
- }): Promise<predefinedQuestionsType[]>;
10
+ }): Promise<PredefinedQuestionsType[]>;
11
11
  export { askBiBot, getRemoteClientChatBubbleConfig, getRemoteClientChatPredefinedQuestions, recordPredefinedQ };
@@ -10,32 +10,34 @@ interface Q_DATA_TYPE {
10
10
  session_id: string;
11
11
  chat_id: string;
12
12
  tries?: number;
13
+ chat_history?: MESSAGES;
13
14
  }
14
- interface RemoteChatBubbleConfigProps {
15
- bgColor: string;
16
- chatColor: string;
17
- title: string;
18
- userImage: string;
15
+ interface BIBOT_INFERENCE_TYPE {
16
+ message: string;
17
+ aiFollowUp?: PredefinedQuestionsType[];
19
18
  }
20
19
  interface BiBotProps {
21
20
  clientId: string;
22
21
  client_session_id?: string;
23
22
  redirect_notice?: boolean;
24
23
  test?: boolean;
24
+ jwt?: string;
25
25
  }
26
26
  interface AppStates {
27
- hideImportantMessages?: boolean;
28
- collapsed?: boolean;
29
- chatIsOpen: boolean;
27
+ aiFollowUpQs: PredefinedQuestionsType[] | [];
28
+ pQuestions: PredefinedQuestionsType[] | [];
30
29
  sessionId: string;
30
+ chatBubbleConfig: ChatBubbleConfigProps;
31
31
  }
32
32
  interface AppContextProps {
33
33
  state: AppStates;
34
34
  dispatch: React.Dispatch<any>;
35
35
  }
36
36
  interface AppAction {
37
+ aiFollowUp: PredefinedQuestionsType[] | [];
38
+ pQuestions: PredefinedQuestionsType[] | [];
37
39
  type: appStateEnums;
38
- chatIsOpen: boolean;
40
+ chatBubbleConfig: ChatBubbleConfigProps;
39
41
  }
40
42
  declare type NotificationType = 'info' | 'warning' | 'success' | 'error';
41
43
  interface NOTIFICATION_DT {
@@ -67,27 +69,34 @@ interface docInfoType {
67
69
  size: number;
68
70
  type: string;
69
71
  }
72
+ interface RemoteChatBubbleConfigProps {
73
+ bgColor?: string;
74
+ color?: string;
75
+ title?: string;
76
+ logo_url?: string;
77
+ knownUser?: string;
78
+ }
70
79
  interface ChatBubbleConfigProps {
71
80
  bgColor?: string;
72
81
  color?: string;
73
82
  title?: string;
74
83
  logo_url?: string;
84
+ knownUser?: string;
75
85
  }
76
86
  interface recordPredefinedQProps {
77
87
  question: string;
78
88
  client_id: string;
79
89
  q_n_a_id: string;
80
90
  }
81
- interface predefinedQuestionsType {
91
+ interface PredefinedQuestionsType {
82
92
  question: string;
83
93
  answer: string;
84
94
  q_n_a_id: string;
85
95
  }
86
96
  interface PredefinedQuestionsProps {
87
- onSelect: (question: predefinedQuestionsType) => void;
88
- questions: predefinedQuestionsType[];
89
- clientId: string;
90
- test?: boolean;
97
+ onSelect: (question: PredefinedQuestionsType) => void;
98
+ questions: PredefinedQuestionsType[];
99
+ chatBubbleConfig?: ChatBubbleConfigProps;
91
100
  }
92
101
  interface AvatarProps {
93
102
  source: string | undefined;
@@ -99,4 +108,9 @@ interface AvatarProps {
99
108
  interface iconColor {
100
109
  color: string | undefined;
101
110
  }
102
- export type { AppStates, AppAction, AppContextProps, NOTIFICATION_DT, NotificationType, Plan, SUBSCRIPTION, AppconfigType, docInfoType, BiBotProps, PredefinedQuestionsProps, Q_DATA_TYPE, RemoteChatBubbleConfigProps, recordPredefinedQProps, AvatarProps, predefinedQuestionsType, iconColor, AppProps, ChatBubbleConfigProps };
111
+ interface MESSAGES extends Array<{
112
+ sender: 'user' | 'bot';
113
+ text: string;
114
+ }> {
115
+ }
116
+ export type { AppStates, AppAction, AppContextProps, NOTIFICATION_DT, NotificationType, Plan, SUBSCRIPTION, AppconfigType, docInfoType, BiBotProps, PredefinedQuestionsProps, Q_DATA_TYPE, RemoteChatBubbleConfigProps, recordPredefinedQProps, AvatarProps, PredefinedQuestionsType, iconColor, AppProps, ChatBubbleConfigProps, MESSAGES, BIBOT_INFERENCE_TYPE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bibot",
3
- "version": "1.0.42",
3
+ "version": "1.0.50",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "chrisdjin",
6
6
  "license": "ISC",