@livechat/customer-sdk 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +11 -19
  2. package/dist/customer-sdk.cjs.js +48 -68
  3. package/dist/customer-sdk.cjs.native.js +48 -68
  4. package/dist/customer-sdk.esm.js +45 -67
  5. package/dist/customer-sdk.js +59 -82
  6. package/dist/customer-sdk.min.js +1 -1
  7. package/package.json +7 -7
  8. package/types/actions.d.ts +0 -331
  9. package/types/chatHistory.d.ts +0 -19
  10. package/types/clientDataParsers.d.ts +0 -55
  11. package/types/completionValues.d.ts +0 -4
  12. package/types/constants/clientErrorCodes.d.ts +0 -11
  13. package/types/constants/connectionStatuses.d.ts +0 -6
  14. package/types/constants/eventTypes.d.ts +0 -8
  15. package/types/constants/organizationIds.d.ts +0 -2
  16. package/types/constants/reduxActions.d.ts +0 -23
  17. package/types/constants/serverDisconnectionReasons.d.ts +0 -15
  18. package/types/constants/serverErrorCodes.d.ts +0 -23
  19. package/types/constants/serverPushActions.d.ts +0 -26
  20. package/types/constants/serverRequestActions.d.ts +0 -30
  21. package/types/constants/sortOrders.d.ts +0 -3
  22. package/types/constants/userTypes.d.ts +0 -3
  23. package/types/createError.d.ts +0 -9
  24. package/types/createStore.d.ts +0 -12
  25. package/types/debug.d.ts +0 -3
  26. package/types/graylog/index.d.ts +0 -14
  27. package/types/graylog/makeGrayLogRequest.d.ts +0 -2
  28. package/types/graylog/makeGrayLogRequest.native.d.ts +0 -6
  29. package/types/index.d.ts +0 -245
  30. package/types/reducer.d.ts +0 -546
  31. package/types/sendRequestAction.d.ts +0 -4
  32. package/types/sendTicketForm.d.ts +0 -15
  33. package/types/serverDataParser.d.ts +0 -34
  34. package/types/serverEventParser.d.ts +0 -12
  35. package/types/serverFrameParser.d.ts +0 -385
  36. package/types/sideEffects/checkGoals.d.ts +0 -5
  37. package/types/sideEffects/index.d.ts +0 -13
  38. package/types/sideStorage.d.ts +0 -5
  39. package/types/socketClient.d.ts +0 -11
  40. package/types/socketListener.d.ts +0 -12
  41. package/types/thunks.d.ts +0 -4
  42. package/types/types/actions.d.ts +0 -157
  43. package/types/types/clientEntities.d.ts +0 -376
  44. package/types/types/frames.d.ts +0 -635
  45. package/types/types/serverEntities.d.ts +0 -409
  46. package/types/types/state.d.ts +0 -56
  47. package/types/uploadFile.d.ts +0 -19
  48. package/types/validateFile/index.d.ts +0 -3
@@ -1,6 +0,0 @@
1
- import fetch from 'unfetch';
2
- import { C } from 'ts-toolbelt';
3
- type UnfetchResponse = C.PromiseOf<ReturnType<typeof fetch>>;
4
- export declare const makeGraylogRequest: (url: string, body: string) => Promise<UnfetchResponse | void>;
5
- export {};
6
- //# sourceMappingURL=makeGrayLogRequest.native.d.ts.map
package/types/index.d.ts DELETED
@@ -1,245 +0,0 @@
1
- import sendTicketForm from './sendTicketForm';
2
- import { UploadFileOptions } from './uploadFile';
3
- import * as actions from './actions';
4
- import { RequestBodyResumeChatData, RequestBodyStartChatData } from './clientDataParsers';
5
- import { Config, Env, Page, SortOrder } from './types';
6
- import * as clientEntities from './types/clientEntities';
7
- export { default as debug } from './debug';
8
- export * from './serverEventParser';
9
- export { parseForm } from './serverFrameParser';
10
- export declare const init: (config: Config, env: Env | undefined, licenseId: number) => Readonly<{
11
- acceptGreeting({ greetingId, uniqueId }: {
12
- greetingId: number;
13
- uniqueId: string;
14
- }): Promise<Readonly<{
15
- readonly success: true;
16
- }>>;
17
- auth: import("@livechat/customer-auth/src/types").CustomerAuth;
18
- cancelGreeting({ uniqueId }: {
19
- uniqueId: string;
20
- }): Promise<Readonly<{
21
- readonly success: true;
22
- }>>;
23
- cancelRate(params: {
24
- chatId: string;
25
- properties: Array<'score' | 'comment'>;
26
- }): Promise<Readonly<{
27
- readonly success: true;
28
- }>>;
29
- connect: () => void;
30
- deactivateChat({ id }: {
31
- id: string;
32
- }): Promise<Readonly<{
33
- readonly success: true;
34
- }>>;
35
- deleteChatProperties({ id, properties }: {
36
- id: string;
37
- properties: Record<string, string[]>;
38
- }): Promise<Readonly<{
39
- readonly success: true;
40
- }>>;
41
- deleteEventProperties({ chatId, threadId, eventId, properties, }: {
42
- chatId: string;
43
- threadId: string;
44
- eventId: string;
45
- properties: Record<string, string[]>;
46
- }): Promise<Readonly<{
47
- readonly success: true;
48
- }>>;
49
- deleteThreadProperties({ chatId, threadId, properties, }: {
50
- chatId: string;
51
- threadId: string;
52
- properties: Record<string, string[]>;
53
- }): Promise<Readonly<{
54
- readonly success: true;
55
- }>>;
56
- destroy(): void;
57
- disconnect(): void;
58
- getChat({ chatId, threadId }: {
59
- chatId: string;
60
- threadId?: string | undefined;
61
- }): Promise<{
62
- thread: clientEntities.Thread | null;
63
- id: string;
64
- access: clientEntities.Access;
65
- users: clientEntities.ChatUser[];
66
- properties: import("./types/serverEntities").Properties;
67
- eventsSeenUpToMap: clientEntities.EventsSeenUpToMap;
68
- }>;
69
- getChatHistory({ chatId }: {
70
- chatId: string;
71
- }): import("./chatHistory").HistoryIterator;
72
- getCustomer(): Promise<{
73
- type: "customer";
74
- id: string;
75
- name?: string | undefined;
76
- email?: string | undefined;
77
- avatar?: string | undefined;
78
- sessionFields: clientEntities.CustomerSessionFields;
79
- statistics: {
80
- chatsCount: number;
81
- threadsCount: number;
82
- visitsCount: number;
83
- pageViewsCount: number;
84
- greetingsShownCount: number;
85
- greetingsAcceptedCount: number;
86
- };
87
- }>;
88
- getForm({ groupId, type }: {
89
- groupId: number;
90
- type: clientEntities.FormType;
91
- }): Promise<{
92
- enabled: false;
93
- } | {
94
- form: {
95
- id: string;
96
- fields: clientEntities.FormField[];
97
- };
98
- enabled: true;
99
- }>;
100
- getPredictedAgent(params?: {
101
- groupId?: number;
102
- }): Promise<clientEntities.PredictedAgent>;
103
- getUrlInfo({ url }: {
104
- url: string;
105
- }): Promise<clientEntities.UrlInfo>;
106
- listChats(params?: {
107
- pageId: string;
108
- } | {
109
- pageId?: undefined;
110
- limit?: number;
111
- }): Promise<{
112
- chatsSummary: clientEntities.ChatSummary[];
113
- totalChats: number;
114
- users: clientEntities.ChatUser[];
115
- previousPageId: string | null;
116
- nextPageId: string | null;
117
- }>;
118
- listGroupStatuses({ groupIds }?: {
119
- groupIds?: number[] | undefined;
120
- }): Promise<Record<number, import("./types/serverEntities").GroupStatus>>;
121
- listThreads(params: {
122
- chatId: string;
123
- sortOrder?: SortOrder;
124
- limit?: number;
125
- pageId?: undefined;
126
- minEventsCount?: number;
127
- } | {
128
- chatId: string;
129
- pageId: string;
130
- }): Promise<{
131
- threads: clientEntities.Thread[];
132
- previousPageId: string | null;
133
- nextPageId: string | null;
134
- }>;
135
- markEventsAsSeen({ chatId, seenUpTo }: {
136
- chatId: string;
137
- seenUpTo: string;
138
- }): Promise<Readonly<{
139
- readonly success: true;
140
- }>>;
141
- on: {
142
- <Key extends import("mitt").EventType>(type: Key, handler: import("mitt").Handler<{
143
- [x: string]: unknown;
144
- [x: symbol]: unknown;
145
- }[Key]>): void;
146
- (type: "*", handler: import("mitt").WildcardHandler<{
147
- [x: string]: unknown;
148
- [x: symbol]: unknown;
149
- }>): void;
150
- };
151
- once: {
152
- <Key extends import("mitt").EventType>(type: Key, handler: import("mitt").Handler<{
153
- [x: string]: unknown;
154
- [x: symbol]: unknown;
155
- }[Key]>): void;
156
- (type: "*", handler: import("mitt").WildcardHandler<{
157
- [x: string]: unknown;
158
- [x: symbol]: unknown;
159
- }>): void;
160
- };
161
- off: {
162
- <Key_1 extends import("mitt").EventType>(type: Key_1, handler?: import("mitt").Handler<{
163
- [x: string]: unknown;
164
- [x: symbol]: unknown;
165
- }[Key_1]> | undefined): void;
166
- (type: "*", handler: import("mitt").WildcardHandler<{
167
- [x: string]: unknown;
168
- [x: symbol]: unknown;
169
- }>): void;
170
- } & {
171
- (type: "*", handler: import("mitt").WildcardHandler<{
172
- [x: string]: unknown;
173
- [x: symbol]: unknown;
174
- }>): void;
175
- (): void;
176
- };
177
- rateChat(params: {
178
- chatId: string;
179
- rating: {
180
- comment?: string;
181
- score?: 0 | 1;
182
- };
183
- }): Promise<Readonly<{
184
- readonly success: true;
185
- }>>;
186
- resumeChat(data: RequestBodyResumeChatData): Promise<clientEntities.IncomingChat>;
187
- sendEvent(params: Parameters<typeof actions.sendEvent>[0]): Promise<clientEntities.Event>;
188
- sendTicketForm(options: Parameters<typeof sendTicketForm>['2']): Promise<{
189
- id: string;
190
- }>;
191
- sendRichMessagePostback({ chatId, threadId, eventId, postback, }: {
192
- chatId: string;
193
- threadId: string;
194
- eventId: string;
195
- postback: {
196
- id: string;
197
- toggled: boolean;
198
- };
199
- }): Promise<Readonly<{
200
- readonly success: true;
201
- }>>;
202
- setCustomerSessionFields({ sessionFields }: {
203
- sessionFields: clientEntities.CustomerSessionFields;
204
- }): Promise<Readonly<{
205
- readonly success: true;
206
- }>>;
207
- setSneakPeek: ({ chatId, sneakPeekText }: {
208
- chatId: string;
209
- sneakPeekText: string;
210
- }) => void;
211
- startChat(data?: RequestBodyStartChatData): Promise<clientEntities.IncomingChat>;
212
- updateChatProperties({ id, properties }: {
213
- id: string;
214
- properties: clientEntities.Properties;
215
- }): Promise<Readonly<{
216
- readonly success: true;
217
- }>>;
218
- updateCustomer(update: clientEntities.CustomerUpdate): Promise<Readonly<{
219
- readonly success: true;
220
- }>>;
221
- updateCustomerPage(page: Page): void;
222
- updateEventProperties({ chatId, threadId, eventId, properties, }: {
223
- chatId: string;
224
- threadId: string;
225
- eventId: string;
226
- properties: clientEntities.Properties;
227
- }): Promise<Readonly<{
228
- readonly success: true;
229
- }>>;
230
- updateThreadProperties({ chatId, threadId, properties, }: {
231
- chatId: string;
232
- threadId: string;
233
- properties: clientEntities.Properties;
234
- }): Promise<Readonly<{
235
- readonly success: true;
236
- }>>;
237
- uploadFile(options: UploadFileOptions): {
238
- promise: Promise<{
239
- url: string;
240
- }>;
241
- cancel(): void;
242
- };
243
- }>;
244
- export type CustomerSDK = ReturnType<typeof init>;
245
- //# sourceMappingURL=index.d.ts.map