@livechat/customer-sdk 3.1.1 → 3.1.2

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 (47) hide show
  1. package/README.md +6 -0
  2. package/dist/customer-sdk.cjs.js +186 -636
  3. package/dist/customer-sdk.cjs.native.js +186 -635
  4. package/dist/customer-sdk.esm.js +187 -637
  5. package/dist/customer-sdk.js +264 -863
  6. package/dist/customer-sdk.min.js +1 -1
  7. package/package.json +6 -5
  8. package/types/actions.d.ts +331 -0
  9. package/types/chatHistory.d.ts +19 -0
  10. package/types/clientDataParsers.d.ts +55 -0
  11. package/types/completionValues.d.ts +4 -0
  12. package/types/constants/clientErrorCodes.d.ts +11 -0
  13. package/types/constants/connectionStatuses.d.ts +6 -0
  14. package/types/constants/eventTypes.d.ts +8 -0
  15. package/types/constants/reduxActions.d.ts +23 -0
  16. package/types/constants/serverDisconnectionReasons.d.ts +15 -0
  17. package/types/constants/serverErrorCodes.d.ts +23 -0
  18. package/types/constants/serverPushActions.d.ts +26 -0
  19. package/types/constants/serverRequestActions.d.ts +30 -0
  20. package/types/constants/sortOrders.d.ts +3 -0
  21. package/types/constants/userTypes.d.ts +3 -0
  22. package/types/createError.d.ts +9 -0
  23. package/types/createStore.d.ts +12 -0
  24. package/types/debug.d.ts +3 -0
  25. package/types/graylog/index.d.ts +14 -0
  26. package/types/graylog/makeGrayLogRequest.d.ts +2 -0
  27. package/types/graylog/makeGrayLogRequest.native.d.ts +6 -0
  28. package/types/index.d.ts +239 -0
  29. package/types/reducer.d.ts +546 -0
  30. package/types/sendRequestAction.d.ts +4 -0
  31. package/types/sendTicketForm.d.ts +14 -0
  32. package/types/serverDataParser.d.ts +34 -0
  33. package/types/serverEventParser.d.ts +12 -0
  34. package/types/serverFrameParser.d.ts +385 -0
  35. package/types/sideEffects/checkGoals.d.ts +5 -0
  36. package/types/sideEffects/index.d.ts +12 -0
  37. package/types/sideStorage.d.ts +5 -0
  38. package/types/socketClient.d.ts +11 -0
  39. package/types/socketListener.d.ts +9 -0
  40. package/types/thunks.d.ts +4 -0
  41. package/types/types/actions.d.ts +157 -0
  42. package/types/types/clientEntities.d.ts +374 -0
  43. package/types/types/frames.d.ts +635 -0
  44. package/types/types/serverEntities.d.ts +408 -0
  45. package/types/types/state.d.ts +56 -0
  46. package/types/uploadFile.d.ts +19 -0
  47. package/types/validateFile/index.d.ts +3 -0
@@ -0,0 +1,546 @@
1
+ /// <reference types="ts-toolbelt" />
2
+ import { Action } from './types/actions';
3
+ import { InitialStateData, State } from './types/state';
4
+ export declare const getAllRequests: (state: State) => Record<string, {
5
+ id: string;
6
+ promise: Promise<any>;
7
+ resolve: (val: any) => void;
8
+ reject: (err: any) => void;
9
+ request: import("Object/Pick")._Pick<{
10
+ request_id: string;
11
+ version?: string | undefined;
12
+ action: "accept_greeting";
13
+ payload: {
14
+ greeting_id: number;
15
+ unique_id: string;
16
+ };
17
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
18
+ request_id: string;
19
+ version?: string | undefined;
20
+ action: "cancel_greeting";
21
+ payload: {
22
+ unique_id: string;
23
+ };
24
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
25
+ request_id: string;
26
+ version?: string | undefined;
27
+ action: "deactivate_chat";
28
+ payload: {
29
+ id: string;
30
+ };
31
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
32
+ request_id: string;
33
+ version?: string | undefined;
34
+ action: "delete_chat_properties";
35
+ payload: {
36
+ id: string;
37
+ properties: Record<string, string[]>;
38
+ };
39
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
40
+ request_id: string;
41
+ version?: string | undefined;
42
+ action: "delete_event_properties";
43
+ payload: {
44
+ chat_id: string;
45
+ thread_id: string;
46
+ event_id: string;
47
+ properties: Record<string, string[]>;
48
+ };
49
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
50
+ request_id: string;
51
+ version?: string | undefined;
52
+ action: "delete_thread_properties";
53
+ payload: {
54
+ chat_id: string;
55
+ thread_id: string;
56
+ properties: Record<string, string[]>;
57
+ };
58
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
59
+ request_id: string;
60
+ version?: string | undefined;
61
+ action: "get_chat";
62
+ payload: {
63
+ chat_id: string;
64
+ thread_id?: string | undefined;
65
+ };
66
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
67
+ request_id: string;
68
+ version?: string | undefined;
69
+ action: "get_customer";
70
+ payload: {
71
+ [x: string]: never;
72
+ };
73
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
74
+ request_id: string;
75
+ version?: string | undefined;
76
+ action: "get_form";
77
+ payload: {
78
+ type: import("./types/serverEntities").FormType;
79
+ group_id: number;
80
+ };
81
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
82
+ request_id: string;
83
+ version?: string | undefined;
84
+ action: "get_predicted_agent";
85
+ payload: {
86
+ group_id?: number | undefined;
87
+ };
88
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
89
+ request_id: string;
90
+ version?: string | undefined;
91
+ action: "get_url_info";
92
+ payload: {
93
+ url: string;
94
+ };
95
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
96
+ request_id: string;
97
+ version?: string | undefined;
98
+ action: "list_chats";
99
+ payload: {
100
+ limit?: number | undefined;
101
+ page_id?: string | undefined;
102
+ };
103
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
104
+ request_id: string;
105
+ version?: string | undefined;
106
+ action: "list_group_statuses";
107
+ payload: {
108
+ group_ids: number[];
109
+ } | {
110
+ all: true;
111
+ };
112
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
113
+ request_id: string;
114
+ version?: string | undefined;
115
+ action: "list_threads";
116
+ payload: {
117
+ chat_id: string;
118
+ sort_order?: "asc" | "desc" | undefined;
119
+ limit?: number | undefined;
120
+ page_id?: string | undefined;
121
+ min_events_count?: number | undefined;
122
+ };
123
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
124
+ request_id: string;
125
+ version?: string | undefined;
126
+ action: "login";
127
+ payload: {
128
+ token: string;
129
+ customer?: {
130
+ avatar?: string | undefined;
131
+ email?: string | undefined;
132
+ name?: string | undefined;
133
+ fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
134
+ } | undefined;
135
+ customer_page?: {
136
+ url?: string | undefined;
137
+ title?: string | undefined;
138
+ } | undefined;
139
+ customer_side_storage?: import("./types/serverEntities").SideStorage | undefined;
140
+ is_mobile?: boolean | undefined;
141
+ group_id?: number | undefined;
142
+ referrer?: string | undefined;
143
+ pushes?: Record<string, readonly import("./types").SubscribablePush[]> | undefined;
144
+ };
145
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
146
+ request_id: string;
147
+ version?: string | undefined;
148
+ action: "mark_events_as_seen";
149
+ payload: {
150
+ chat_id: string;
151
+ seen_up_to: string;
152
+ };
153
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
154
+ request_id: string;
155
+ version?: string | undefined;
156
+ action: "resume_chat";
157
+ payload: {
158
+ active?: boolean | undefined;
159
+ chat: {
160
+ id: string;
161
+ access?: import("./types/serverEntities").Access | undefined;
162
+ properties?: import("./types/serverEntities").Properties | undefined;
163
+ thread?: {
164
+ events?: import("./types/serverEntities").RequestBodyEvent[] | undefined;
165
+ properties?: import("./types/serverEntities").Properties | undefined;
166
+ } | undefined;
167
+ };
168
+ continuous?: boolean | undefined;
169
+ };
170
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
171
+ request_id: string;
172
+ version?: string | undefined;
173
+ action: "send_event";
174
+ payload: {
175
+ chat_id: string;
176
+ event: import("./types/serverEntities").RequestBodyEvent;
177
+ attach_to_last_thread?: boolean | undefined;
178
+ };
179
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
180
+ request_id: string;
181
+ version?: string | undefined;
182
+ action: "send_rich_message_postback";
183
+ payload: {
184
+ chat_id: string;
185
+ thread_id: string;
186
+ event_id: string;
187
+ postback: {
188
+ id: string;
189
+ toggled: boolean;
190
+ };
191
+ };
192
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
193
+ request_id: string;
194
+ version?: string | undefined;
195
+ action: "send_sneak_peek";
196
+ payload: {
197
+ chat_id: string;
198
+ sneak_peek_text: string;
199
+ };
200
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
201
+ request_id: string;
202
+ version?: string | undefined;
203
+ action: "set_customer_session_fields";
204
+ payload: {
205
+ session_fields: import("./types/serverEntities").CustomerSessionFields;
206
+ };
207
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
208
+ request_id: string;
209
+ version?: string | undefined;
210
+ action: "start_chat";
211
+ payload: {
212
+ active?: boolean | undefined;
213
+ chat?: {
214
+ access?: import("./types/serverEntities").Access | undefined;
215
+ properties?: import("./types/serverEntities").Properties | undefined;
216
+ thread?: {
217
+ events?: import("./types/serverEntities").RequestBodyEvent[] | undefined;
218
+ properties?: import("./types/serverEntities").Properties | undefined;
219
+ } | undefined;
220
+ } | undefined;
221
+ continuous?: boolean | undefined;
222
+ };
223
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
224
+ request_id: string;
225
+ version?: string | undefined;
226
+ action: "update_chat_properties";
227
+ payload: {
228
+ id: string;
229
+ properties: import("./types/serverEntities").Properties;
230
+ };
231
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
232
+ request_id: string;
233
+ version?: string | undefined;
234
+ action: "update_customer_page";
235
+ payload: {
236
+ url: string;
237
+ title?: string | undefined;
238
+ };
239
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
240
+ request_id: string;
241
+ version?: string | undefined;
242
+ action: "update_customer";
243
+ payload: {
244
+ avatar?: string | undefined;
245
+ name?: string | undefined;
246
+ email?: string | undefined;
247
+ fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
248
+ };
249
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
250
+ request_id: string;
251
+ version?: string | undefined;
252
+ action: "update_event_properties";
253
+ payload: {
254
+ chat_id: string;
255
+ thread_id: string;
256
+ event_id: string;
257
+ properties: import("./types/serverEntities").Properties;
258
+ };
259
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
260
+ request_id: string;
261
+ version?: string | undefined;
262
+ action: "update_thread_properties";
263
+ payload: {
264
+ chat_id: string;
265
+ thread_id: string;
266
+ properties: import("./types/serverEntities").Properties;
267
+ };
268
+ }, "action" | "payload">;
269
+ }>;
270
+ export declare const getConnectionStatus: (state: State) => "connected" | "destroyed" | "disconnected" | "paused" | "reconnecting";
271
+ export declare const getRequest: (state: State, id: string) => {
272
+ id: string;
273
+ promise: Promise<any>;
274
+ resolve: (val: any) => void;
275
+ reject: (err: any) => void;
276
+ request: import("Object/Pick")._Pick<{
277
+ request_id: string;
278
+ version?: string | undefined;
279
+ action: "accept_greeting";
280
+ payload: {
281
+ greeting_id: number;
282
+ unique_id: string;
283
+ };
284
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
285
+ request_id: string;
286
+ version?: string | undefined;
287
+ action: "cancel_greeting";
288
+ payload: {
289
+ unique_id: string;
290
+ };
291
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
292
+ request_id: string;
293
+ version?: string | undefined;
294
+ action: "deactivate_chat";
295
+ payload: {
296
+ id: string;
297
+ };
298
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
299
+ request_id: string;
300
+ version?: string | undefined;
301
+ action: "delete_chat_properties";
302
+ payload: {
303
+ id: string;
304
+ properties: Record<string, string[]>;
305
+ };
306
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
307
+ request_id: string;
308
+ version?: string | undefined;
309
+ action: "delete_event_properties";
310
+ payload: {
311
+ chat_id: string;
312
+ thread_id: string;
313
+ event_id: string;
314
+ properties: Record<string, string[]>;
315
+ };
316
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
317
+ request_id: string;
318
+ version?: string | undefined;
319
+ action: "delete_thread_properties";
320
+ payload: {
321
+ chat_id: string;
322
+ thread_id: string;
323
+ properties: Record<string, string[]>;
324
+ };
325
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
326
+ request_id: string;
327
+ version?: string | undefined;
328
+ action: "get_chat";
329
+ payload: {
330
+ chat_id: string;
331
+ thread_id?: string | undefined;
332
+ };
333
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
334
+ request_id: string;
335
+ version?: string | undefined;
336
+ action: "get_customer";
337
+ payload: {
338
+ [x: string]: never;
339
+ };
340
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
341
+ request_id: string;
342
+ version?: string | undefined;
343
+ action: "get_form";
344
+ payload: {
345
+ type: import("./types/serverEntities").FormType;
346
+ group_id: number;
347
+ };
348
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
349
+ request_id: string;
350
+ version?: string | undefined;
351
+ action: "get_predicted_agent";
352
+ payload: {
353
+ group_id?: number | undefined;
354
+ };
355
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
356
+ request_id: string;
357
+ version?: string | undefined;
358
+ action: "get_url_info";
359
+ payload: {
360
+ url: string;
361
+ };
362
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
363
+ request_id: string;
364
+ version?: string | undefined;
365
+ action: "list_chats";
366
+ payload: {
367
+ limit?: number | undefined;
368
+ page_id?: string | undefined;
369
+ };
370
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
371
+ request_id: string;
372
+ version?: string | undefined;
373
+ action: "list_group_statuses";
374
+ payload: {
375
+ group_ids: number[];
376
+ } | {
377
+ all: true;
378
+ };
379
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
380
+ request_id: string;
381
+ version?: string | undefined;
382
+ action: "list_threads";
383
+ payload: {
384
+ chat_id: string;
385
+ sort_order?: "asc" | "desc" | undefined;
386
+ limit?: number | undefined;
387
+ page_id?: string | undefined;
388
+ min_events_count?: number | undefined;
389
+ };
390
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
391
+ request_id: string;
392
+ version?: string | undefined;
393
+ action: "login";
394
+ payload: {
395
+ token: string;
396
+ customer?: {
397
+ avatar?: string | undefined;
398
+ email?: string | undefined;
399
+ name?: string | undefined;
400
+ fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
401
+ } | undefined;
402
+ customer_page?: {
403
+ url?: string | undefined;
404
+ title?: string | undefined;
405
+ } | undefined;
406
+ customer_side_storage?: import("./types/serverEntities").SideStorage | undefined;
407
+ is_mobile?: boolean | undefined;
408
+ group_id?: number | undefined;
409
+ referrer?: string | undefined;
410
+ pushes?: Record<string, readonly import("./types").SubscribablePush[]> | undefined;
411
+ };
412
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
413
+ request_id: string;
414
+ version?: string | undefined;
415
+ action: "mark_events_as_seen";
416
+ payload: {
417
+ chat_id: string;
418
+ seen_up_to: string;
419
+ };
420
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
421
+ request_id: string;
422
+ version?: string | undefined;
423
+ action: "resume_chat";
424
+ payload: {
425
+ active?: boolean | undefined;
426
+ chat: {
427
+ id: string;
428
+ access?: import("./types/serverEntities").Access | undefined;
429
+ properties?: import("./types/serverEntities").Properties | undefined;
430
+ thread?: {
431
+ events?: import("./types/serverEntities").RequestBodyEvent[] | undefined;
432
+ properties?: import("./types/serverEntities").Properties | undefined;
433
+ } | undefined;
434
+ };
435
+ continuous?: boolean | undefined;
436
+ };
437
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
438
+ request_id: string;
439
+ version?: string | undefined;
440
+ action: "send_event";
441
+ payload: {
442
+ chat_id: string;
443
+ event: import("./types/serverEntities").RequestBodyEvent;
444
+ attach_to_last_thread?: boolean | undefined;
445
+ };
446
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
447
+ request_id: string;
448
+ version?: string | undefined;
449
+ action: "send_rich_message_postback";
450
+ payload: {
451
+ chat_id: string;
452
+ thread_id: string;
453
+ event_id: string;
454
+ postback: {
455
+ id: string;
456
+ toggled: boolean;
457
+ };
458
+ };
459
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
460
+ request_id: string;
461
+ version?: string | undefined;
462
+ action: "send_sneak_peek";
463
+ payload: {
464
+ chat_id: string;
465
+ sneak_peek_text: string;
466
+ };
467
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
468
+ request_id: string;
469
+ version?: string | undefined;
470
+ action: "set_customer_session_fields";
471
+ payload: {
472
+ session_fields: import("./types/serverEntities").CustomerSessionFields;
473
+ };
474
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
475
+ request_id: string;
476
+ version?: string | undefined;
477
+ action: "start_chat";
478
+ payload: {
479
+ active?: boolean | undefined;
480
+ chat?: {
481
+ access?: import("./types/serverEntities").Access | undefined;
482
+ properties?: import("./types/serverEntities").Properties | undefined;
483
+ thread?: {
484
+ events?: import("./types/serverEntities").RequestBodyEvent[] | undefined;
485
+ properties?: import("./types/serverEntities").Properties | undefined;
486
+ } | undefined;
487
+ } | undefined;
488
+ continuous?: boolean | undefined;
489
+ };
490
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
491
+ request_id: string;
492
+ version?: string | undefined;
493
+ action: "update_chat_properties";
494
+ payload: {
495
+ id: string;
496
+ properties: import("./types/serverEntities").Properties;
497
+ };
498
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
499
+ request_id: string;
500
+ version?: string | undefined;
501
+ action: "update_customer_page";
502
+ payload: {
503
+ url: string;
504
+ title?: string | undefined;
505
+ };
506
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
507
+ request_id: string;
508
+ version?: string | undefined;
509
+ action: "update_customer";
510
+ payload: {
511
+ avatar?: string | undefined;
512
+ name?: string | undefined;
513
+ email?: string | undefined;
514
+ fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
515
+ };
516
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
517
+ request_id: string;
518
+ version?: string | undefined;
519
+ action: "update_event_properties";
520
+ payload: {
521
+ chat_id: string;
522
+ thread_id: string;
523
+ event_id: string;
524
+ properties: import("./types/serverEntities").Properties;
525
+ };
526
+ }, "action" | "payload"> | import("Object/Pick")._Pick<{
527
+ request_id: string;
528
+ version?: string | undefined;
529
+ action: "update_thread_properties";
530
+ payload: {
531
+ chat_id: string;
532
+ thread_id: string;
533
+ properties: import("./types/serverEntities").Properties;
534
+ };
535
+ }, "action" | "payload">;
536
+ };
537
+ export declare const getSelfId: (state: State) => string | null;
538
+ export declare const isChatActive: (state: State, chatId: string) => boolean;
539
+ export declare const isConnected: (state: State) => boolean;
540
+ export declare const isDestroyed: (state: State) => boolean;
541
+ export declare const getApiOrigin: (state: State) => string;
542
+ export declare const getServerUrl: (state: State) => string;
543
+ export declare const createInitialState: (initialStateData: InitialStateData) => State;
544
+ declare const _default: (state: State) => import("redux").Reducer<State, Action>;
545
+ export default _default;
546
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { Store } from './types';
2
+ declare const sendRequestAction: (store: Store, action: any) => Promise<unknown>;
3
+ export default sendRequestAction;
4
+ //# sourceMappingURL=sendRequestAction.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { CustomerAuth } from '@livechat/customer-auth';
2
+ import { Store } from './types';
3
+ import * as clientEntities from './types/clientEntities';
4
+ declare const sendTicketForm: (store: Store, auth: CustomerAuth, { filledForm, groupId, timeZone, }: {
5
+ filledForm: Extract<clientEntities.RequestBodyEvent, {
6
+ type: 'filled_form';
7
+ }>;
8
+ groupId?: number | undefined;
9
+ timeZone?: string | undefined;
10
+ }) => Promise<{
11
+ id: string;
12
+ }>;
13
+ export default sendTicketForm;
14
+ //# sourceMappingURL=sendTicketForm.d.ts.map
@@ -0,0 +1,34 @@
1
+ import * as ClientEntities from './types/clientEntities';
2
+ import * as ServerEntities from './types/serverEntities';
3
+ export declare const parseAccess: (access?: ServerEntities.Access) => ClientEntities.Access;
4
+ export declare const getEventsSeenUpToMap: (users: ServerEntities.ChatUser[]) => ClientEntities.EventsSeenUpToMap;
5
+ export declare const parseThread: (chatId: string, thread: ServerEntities.Thread) => ClientEntities.Thread;
6
+ export declare const parseChatCommon: (chat: Omit<ServerEntities.Chat, 'thread'>) => {
7
+ id: string;
8
+ access: ClientEntities.Access;
9
+ users: ClientEntities.ChatUser[];
10
+ properties: ServerEntities.Properties;
11
+ eventsSeenUpToMap: ClientEntities.EventsSeenUpToMap;
12
+ };
13
+ export declare const parseChatAgent: (agent: ServerEntities.ChatAgent) => ClientEntities.ChatAgent;
14
+ export declare const parseCustomerOptionalProps: (customerProps: ServerEntities.OptionalCustomerProps) => ClientEntities.CustomerOptionalProps;
15
+ export declare const parseChatCustomer: (customer: ServerEntities.ChatCustomer) => ClientEntities.ChatCustomer;
16
+ export declare const parseCustomer: (customer: ServerEntities.Customer) => ClientEntities.Customer;
17
+ type PredictedAgentPayload = {
18
+ agent: ServerEntities.PredictedAgent;
19
+ queue: boolean;
20
+ };
21
+ export declare const parsePredictedAgent: (payload: PredictedAgentPayload) => ClientEntities.PredictedAgent;
22
+ export declare const parseQueueUpdate: (queueUpdate: ServerEntities.QueueUpdate) => {
23
+ position: number;
24
+ waitTime: number;
25
+ };
26
+ export declare const parseQueue: (queue: ServerEntities.Queue) => {
27
+ queuedAt: string;
28
+ position: number;
29
+ waitTime: number;
30
+ };
31
+ export declare const parseChatUser: (user: ServerEntities.ChatUser) => ClientEntities.ChatUser;
32
+ export declare const parseGroupStatus: (status: ServerEntities.GroupStatus) => ClientEntities.AvailabilityStatus;
33
+ export {};
34
+ //# sourceMappingURL=serverDataParser.d.ts.map
@@ -0,0 +1,12 @@
1
+ import * as ClientEntities from './types/clientEntities';
2
+ import * as ServerEntities from './types/serverEntities';
3
+ export declare const parseFile: (thread: string, file: ServerEntities.File) => ClientEntities.File;
4
+ export declare const parseForm: (thread: string, form: ServerEntities.Form) => ClientEntities.Form;
5
+ export declare const parseFilledForm: (thread: string, filledForm: ServerEntities.FilledForm) => ClientEntities.FilledForm;
6
+ export declare const parseMessage: (thread: string, message: ServerEntities.Message) => ClientEntities.Message;
7
+ export declare const parseCustomEvent: (thread: string, event: ServerEntities.CustomEvent) => ClientEntities.CustomEvent;
8
+ export declare const parseRichMessage: (thread: string, richMessage: ServerEntities.RichMessage) => ClientEntities.RichMessage | null;
9
+ export declare const parseSystemMessage: (thread: string, systemMessage: ServerEntities.SystemMessage) => ClientEntities.SystemMessage;
10
+ export declare const parseEvent: (thread: string, event: ServerEntities.Event) => ClientEntities.Event | null;
11
+ export declare const parseGreeting: (greeting: ServerEntities.Greeting) => ClientEntities.Greeting;
12
+ //# sourceMappingURL=serverEventParser.d.ts.map