@lilaquadrat/chat 0.1.13 → 0.1.15

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/dist/app/assets/de-DD_Cd2_H.js +1 -0
  2. package/dist/app/assets/loadFonts-BWquVJC2.js +1 -0
  3. package/dist/app/assets/main-CpABZ8xk.js +2 -0
  4. package/dist/app/assets/preload-helper-B46Frp_x.js +1 -0
  5. package/dist/app/assets/support-DP0S3Vwv.js +2 -0
  6. package/dist/app/assets/support-agent-BWO3I__B.js +1 -0
  7. package/dist/app/assets/web-component-VTtUtC7T.js +1 -0
  8. package/dist/app/index.html +2 -1
  9. package/dist/app/support/index.html +43 -0
  10. package/dist/types/src/composables/useChatBootstrap.d.ts +27 -0
  11. package/dist/types/src/config/auth.d.ts +1 -1
  12. package/dist/types/src/config/bootstrap.agent.d.ts +85 -0
  13. package/dist/types/src/config/bootstrap.d.ts +5 -69
  14. package/dist/types/src/config/chatConfig.d.ts +82 -0
  15. package/dist/types/src/config/components.shared.d.ts +18 -0
  16. package/dist/types/src/config/users.d.ts +1 -1
  17. package/dist/types/src/helpers/handleMessages.d.ts +2 -1
  18. package/dist/types/src/helpers/participants.d.ts +25 -0
  19. package/dist/types/src/helpers/supportStatus.d.ts +15 -0
  20. package/dist/types/src/interfaces/Conversation.d.ts +44 -0
  21. package/dist/types/src/interfaces/ConversationSla.d.ts +9 -0
  22. package/dist/types/src/interfaces/IncomingFrame.d.ts +71 -0
  23. package/dist/types/src/interfaces/Message.d.ts +16 -0
  24. package/dist/types/src/interfaces/ParticipantDocument.d.ts +13 -0
  25. package/dist/types/src/libs/StudioSDK.d.ts +44 -19
  26. package/dist/types/src/libs/chatSession.d.ts +2 -1
  27. package/dist/types/src/locales/de.d.ts +24 -0
  28. package/dist/types/src/locales/en.d.ts +24 -0
  29. package/dist/types/src/mixins/groupMessages.d.ts +14 -1
  30. package/dist/types/src/plugins/i18n.d.ts +24 -0
  31. package/dist/types/src/standalone/auth.d.ts +9 -23
  32. package/dist/types/src/standalone/settings.d.ts +28 -8
  33. package/dist/types/src/standalone-support/main.d.ts +1 -0
  34. package/dist/types/src/stores/calls.store.d.ts +3 -3
  35. package/dist/types/src/stores/conversations.store.d.ts +2047 -77
  36. package/dist/types/src/stores/main.store.d.ts +32 -3
  37. package/dist/types/src/stores/supportConversations.store.d.ts +65 -0
  38. package/dist/types/src/support-agent.d.ts +18 -0
  39. package/dist/types/tsconfig.build.tsbuildinfo +1 -1
  40. package/dist/wc/lilaquadrat-studio-chat.js +7 -7
  41. package/dist/wc/lilaquadrat-studio-chat.umd.cjs +1 -1
  42. package/dist/wc-support/lilaquadrat-studio-support.js +9 -0
  43. package/dist/wc-support/lilaquadrat-studio-support.umd.cjs +1 -0
  44. package/package.json +7 -4
  45. package/dist/app/assets/de-s6DWJrk7.js +0 -1
  46. package/dist/app/assets/en-C_4GFXY1.js +0 -1
  47. package/dist/app/assets/index-BdLih8WZ.js +0 -1
  48. package/dist/app/assets/web-component-C93sD53H.js +0 -1
@@ -1,174 +1,2144 @@
1
1
  import { type Participant } from '@/helpers/participants';
2
- interface ConversationEntry {
3
- [key: string]: any;
4
- }
2
+ import { type SupportStatus } from '@/helpers/supportStatus';
3
+ import type { Conversation, ConversationPayload } from '@/interfaces/Conversation';
4
+ import type { Message } from '@/interfaces/Message';
5
+ import type { ParticipantState } from '@/interfaces/ParticipantDocument';
6
+ export type ConversationEntry = Conversation;
5
7
  export declare const useConversationsStore: import("pinia").StoreDefinition<"conversations", Pick<{
6
8
  getAllConversations: () => Promise<void>;
9
+ mergeConversations: (incoming: ConversationPayload[]) => void;
7
10
  refreshConversations: () => Promise<void>;
8
11
  handleReconnect: () => Promise<void>;
9
- conversations: import("vue").Ref<ConversationEntry[], ConversationEntry[]>;
12
+ conversations: import("vue").Ref<{
13
+ _id?: string;
14
+ id?: string;
15
+ name?: string;
16
+ participants: (string | {
17
+ id: string;
18
+ prename?: string;
19
+ lastname?: string;
20
+ email?: string;
21
+ name?: string;
22
+ lastSeen?: string;
23
+ online?: boolean;
24
+ role?: "agent" | null;
25
+ })[];
26
+ blocked?: string[];
27
+ messagesCount?: number;
28
+ messagesCountSystem?: number;
29
+ createdAt?: string;
30
+ lastActivity?: string;
31
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
32
+ supportStatus?: SupportStatus;
33
+ supportStatusUpdatedAt?: string;
34
+ supportStatusVersion?: number;
35
+ sla?: {
36
+ conversation: string;
37
+ status: SupportStatus;
38
+ statusVersion: number;
39
+ startedAt: string;
40
+ endAt: string;
41
+ stoppedAt?: string;
42
+ };
43
+ participant?: {
44
+ _id?: string;
45
+ conversation: string;
46
+ user: string;
47
+ state: ParticipantState;
48
+ rights: string[];
49
+ lastReadId?: number;
50
+ latestMessageId?: number;
51
+ muted?: boolean;
52
+ role?: "agent";
53
+ joinedAt?: string;
54
+ };
55
+ participantDocs?: {
56
+ _id?: string;
57
+ conversation: string;
58
+ user: string;
59
+ state: ParticipantState;
60
+ rights: string[];
61
+ lastReadId?: number;
62
+ latestMessageId?: number;
63
+ muted?: boolean;
64
+ role?: "agent";
65
+ joinedAt?: string;
66
+ }[];
67
+ lastMessage?: {
68
+ _id?: string;
69
+ id: number;
70
+ conversation: string;
71
+ user?: string;
72
+ message?: string;
73
+ origin: "user" | "system";
74
+ history: {
75
+ created: string;
76
+ updated?: string;
77
+ };
78
+ action?: string;
79
+ actionData?: Record<string, unknown>;
80
+ isUser?: boolean;
81
+ };
82
+ oldestMessageId?: number | null;
83
+ messages?: {
84
+ _id?: string;
85
+ id: number;
86
+ conversation: string;
87
+ user?: string;
88
+ message?: string;
89
+ origin: "user" | "system";
90
+ history: {
91
+ created: string;
92
+ updated?: string;
93
+ };
94
+ action?: string;
95
+ actionData?: Record<string, unknown>;
96
+ isUser?: boolean;
97
+ }[];
98
+ messagesLoaded?: boolean;
99
+ unreadCount?: number;
100
+ unread?: boolean;
101
+ isMember?: boolean;
102
+ isNew?: boolean;
103
+ isTemp?: boolean;
104
+ creator?: string;
105
+ }[], Conversation[] | {
106
+ _id?: string;
107
+ id?: string;
108
+ name?: string;
109
+ participants: (string | {
110
+ id: string;
111
+ prename?: string;
112
+ lastname?: string;
113
+ email?: string;
114
+ name?: string;
115
+ lastSeen?: string;
116
+ online?: boolean;
117
+ role?: "agent" | null;
118
+ })[];
119
+ blocked?: string[];
120
+ messagesCount?: number;
121
+ messagesCountSystem?: number;
122
+ createdAt?: string;
123
+ lastActivity?: string;
124
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
125
+ supportStatus?: SupportStatus;
126
+ supportStatusUpdatedAt?: string;
127
+ supportStatusVersion?: number;
128
+ sla?: {
129
+ conversation: string;
130
+ status: SupportStatus;
131
+ statusVersion: number;
132
+ startedAt: string;
133
+ endAt: string;
134
+ stoppedAt?: string;
135
+ };
136
+ participant?: {
137
+ _id?: string;
138
+ conversation: string;
139
+ user: string;
140
+ state: ParticipantState;
141
+ rights: string[];
142
+ lastReadId?: number;
143
+ latestMessageId?: number;
144
+ muted?: boolean;
145
+ role?: "agent";
146
+ joinedAt?: string;
147
+ };
148
+ participantDocs?: {
149
+ _id?: string;
150
+ conversation: string;
151
+ user: string;
152
+ state: ParticipantState;
153
+ rights: string[];
154
+ lastReadId?: number;
155
+ latestMessageId?: number;
156
+ muted?: boolean;
157
+ role?: "agent";
158
+ joinedAt?: string;
159
+ }[];
160
+ lastMessage?: {
161
+ _id?: string;
162
+ id: number;
163
+ conversation: string;
164
+ user?: string;
165
+ message?: string;
166
+ origin: "user" | "system";
167
+ history: {
168
+ created: string;
169
+ updated?: string;
170
+ };
171
+ action?: string;
172
+ actionData?: Record<string, unknown>;
173
+ isUser?: boolean;
174
+ };
175
+ oldestMessageId?: number | null;
176
+ messages?: {
177
+ _id?: string;
178
+ id: number;
179
+ conversation: string;
180
+ user?: string;
181
+ message?: string;
182
+ origin: "user" | "system";
183
+ history: {
184
+ created: string;
185
+ updated?: string;
186
+ };
187
+ action?: string;
188
+ actionData?: Record<string, unknown>;
189
+ isUser?: boolean;
190
+ }[];
191
+ messagesLoaded?: boolean;
192
+ unreadCount?: number;
193
+ unread?: boolean;
194
+ isMember?: boolean;
195
+ isNew?: boolean;
196
+ isTemp?: boolean;
197
+ creator?: string;
198
+ }[]>;
10
199
  conversationsLoaded: import("vue").Ref<boolean, boolean>;
11
- unreadConversations: import("vue").ComputedRef<ConversationEntry[]>;
12
- totalUnreadCount: import("vue").ComputedRef<any>;
200
+ unreadConversations: import("vue").ComputedRef<{
201
+ _id?: string;
202
+ id?: string;
203
+ name?: string;
204
+ participants: (string | {
205
+ id: string;
206
+ prename?: string;
207
+ lastname?: string;
208
+ email?: string;
209
+ name?: string;
210
+ lastSeen?: string;
211
+ online?: boolean;
212
+ role?: "agent" | null;
213
+ })[];
214
+ blocked?: string[];
215
+ messagesCount?: number;
216
+ messagesCountSystem?: number;
217
+ createdAt?: string;
218
+ lastActivity?: string;
219
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
220
+ supportStatus?: SupportStatus;
221
+ supportStatusUpdatedAt?: string;
222
+ supportStatusVersion?: number;
223
+ sla?: {
224
+ conversation: string;
225
+ status: SupportStatus;
226
+ statusVersion: number;
227
+ startedAt: string;
228
+ endAt: string;
229
+ stoppedAt?: string;
230
+ };
231
+ participant?: {
232
+ _id?: string;
233
+ conversation: string;
234
+ user: string;
235
+ state: ParticipantState;
236
+ rights: string[];
237
+ lastReadId?: number;
238
+ latestMessageId?: number;
239
+ muted?: boolean;
240
+ role?: "agent";
241
+ joinedAt?: string;
242
+ };
243
+ participantDocs?: {
244
+ _id?: string;
245
+ conversation: string;
246
+ user: string;
247
+ state: ParticipantState;
248
+ rights: string[];
249
+ lastReadId?: number;
250
+ latestMessageId?: number;
251
+ muted?: boolean;
252
+ role?: "agent";
253
+ joinedAt?: string;
254
+ }[];
255
+ lastMessage?: {
256
+ _id?: string;
257
+ id: number;
258
+ conversation: string;
259
+ user?: string;
260
+ message?: string;
261
+ origin: "user" | "system";
262
+ history: {
263
+ created: string;
264
+ updated?: string;
265
+ };
266
+ action?: string;
267
+ actionData?: Record<string, unknown>;
268
+ isUser?: boolean;
269
+ };
270
+ oldestMessageId?: number | null;
271
+ messages?: {
272
+ _id?: string;
273
+ id: number;
274
+ conversation: string;
275
+ user?: string;
276
+ message?: string;
277
+ origin: "user" | "system";
278
+ history: {
279
+ created: string;
280
+ updated?: string;
281
+ };
282
+ action?: string;
283
+ actionData?: Record<string, unknown>;
284
+ isUser?: boolean;
285
+ }[];
286
+ messagesLoaded?: boolean;
287
+ unreadCount?: number;
288
+ unread?: boolean;
289
+ isMember?: boolean;
290
+ isNew?: boolean;
291
+ isTemp?: boolean;
292
+ creator?: string;
293
+ }[]>;
294
+ totalUnreadCount: import("vue").ComputedRef<number>;
13
295
  totalUnreadConversations: import("vue").ComputedRef<number>;
14
296
  typing: import("vue").Ref<Record<string, string[]>, Record<string, string[]>>;
15
297
  setTyping: (conversation: string, user: string, isTyping: boolean) => void;
16
- loadParticipants: (conversation: string) => Promise<any>;
17
- setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
298
+ loadParticipants: (conversation: string) => Promise<import("@/interfaces/ParticipantDocument").ParticipantDocument[]>;
299
+ setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
18
300
  isMuted: (conversation: string) => boolean;
19
301
  setMuted: (conversation: string, muted: boolean) => Promise<void>;
20
302
  conversationMuted: (conversation: string, muted: boolean) => void;
21
- blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
303
+ updateSupportStatus: (conversation: string, status: SupportStatus | undefined, version: number | undefined, updatedAt: string | undefined, options?: {
304
+ force?: boolean;
305
+ sla?: Conversation["sla"];
306
+ }) => boolean;
307
+ blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
22
308
  updateParticipantRights: (conversation: string, user: string, rights: string[]) => void;
23
- create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
309
+ create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
24
310
  createNew: (participants: string[], creator?: string, operationMode?: "chat" | "support") => string;
25
311
  createConversation: () => string;
26
- startSupport: () => Promise<any>;
312
+ startSupport: () => Promise<string>;
27
313
  activateConversation: (conversationId: string) => Promise<void>;
28
- activeConversation: import("vue").Ref<any, any>;
29
- convertTempToConversation: (conversation: Record<string, any>) => void;
30
- getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<any>;
31
- addMessagesToConversation: (messages: Record<string, any>[], conversation: string) => void;
32
- getMessagesForConversation: (conversation: string) => any;
33
- updateLastMessage: (conversationId: string, message: Record<string, any>) => void;
314
+ activeConversation: import("vue").Ref<{
315
+ _id?: string;
316
+ id?: string;
317
+ name?: string;
318
+ participants: (string | {
319
+ id: string;
320
+ prename?: string;
321
+ lastname?: string;
322
+ email?: string;
323
+ name?: string;
324
+ lastSeen?: string;
325
+ online?: boolean;
326
+ role?: "agent" | null;
327
+ })[];
328
+ blocked?: string[];
329
+ messagesCount?: number;
330
+ messagesCountSystem?: number;
331
+ createdAt?: string;
332
+ lastActivity?: string;
333
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
334
+ supportStatus?: SupportStatus;
335
+ supportStatusUpdatedAt?: string;
336
+ supportStatusVersion?: number;
337
+ sla?: {
338
+ conversation: string;
339
+ status: SupportStatus;
340
+ statusVersion: number;
341
+ startedAt: string;
342
+ endAt: string;
343
+ stoppedAt?: string;
344
+ };
345
+ participant?: {
346
+ _id?: string;
347
+ conversation: string;
348
+ user: string;
349
+ state: ParticipantState;
350
+ rights: string[];
351
+ lastReadId?: number;
352
+ latestMessageId?: number;
353
+ muted?: boolean;
354
+ role?: "agent";
355
+ joinedAt?: string;
356
+ };
357
+ participantDocs?: {
358
+ _id?: string;
359
+ conversation: string;
360
+ user: string;
361
+ state: ParticipantState;
362
+ rights: string[];
363
+ lastReadId?: number;
364
+ latestMessageId?: number;
365
+ muted?: boolean;
366
+ role?: "agent";
367
+ joinedAt?: string;
368
+ }[];
369
+ lastMessage?: {
370
+ _id?: string;
371
+ id: number;
372
+ conversation: string;
373
+ user?: string;
374
+ message?: string;
375
+ origin: "user" | "system";
376
+ history: {
377
+ created: string;
378
+ updated?: string;
379
+ };
380
+ action?: string;
381
+ actionData?: Record<string, unknown>;
382
+ isUser?: boolean;
383
+ };
384
+ oldestMessageId?: number | null;
385
+ messages?: {
386
+ _id?: string;
387
+ id: number;
388
+ conversation: string;
389
+ user?: string;
390
+ message?: string;
391
+ origin: "user" | "system";
392
+ history: {
393
+ created: string;
394
+ updated?: string;
395
+ };
396
+ action?: string;
397
+ actionData?: Record<string, unknown>;
398
+ isUser?: boolean;
399
+ }[];
400
+ messagesLoaded?: boolean;
401
+ unreadCount?: number;
402
+ unread?: boolean;
403
+ isMember?: boolean;
404
+ isNew?: boolean;
405
+ isTemp?: boolean;
406
+ creator?: string;
407
+ }, Conversation | {
408
+ _id?: string;
409
+ id?: string;
410
+ name?: string;
411
+ participants: (string | {
412
+ id: string;
413
+ prename?: string;
414
+ lastname?: string;
415
+ email?: string;
416
+ name?: string;
417
+ lastSeen?: string;
418
+ online?: boolean;
419
+ role?: "agent" | null;
420
+ })[];
421
+ blocked?: string[];
422
+ messagesCount?: number;
423
+ messagesCountSystem?: number;
424
+ createdAt?: string;
425
+ lastActivity?: string;
426
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
427
+ supportStatus?: SupportStatus;
428
+ supportStatusUpdatedAt?: string;
429
+ supportStatusVersion?: number;
430
+ sla?: {
431
+ conversation: string;
432
+ status: SupportStatus;
433
+ statusVersion: number;
434
+ startedAt: string;
435
+ endAt: string;
436
+ stoppedAt?: string;
437
+ };
438
+ participant?: {
439
+ _id?: string;
440
+ conversation: string;
441
+ user: string;
442
+ state: ParticipantState;
443
+ rights: string[];
444
+ lastReadId?: number;
445
+ latestMessageId?: number;
446
+ muted?: boolean;
447
+ role?: "agent";
448
+ joinedAt?: string;
449
+ };
450
+ participantDocs?: {
451
+ _id?: string;
452
+ conversation: string;
453
+ user: string;
454
+ state: ParticipantState;
455
+ rights: string[];
456
+ lastReadId?: number;
457
+ latestMessageId?: number;
458
+ muted?: boolean;
459
+ role?: "agent";
460
+ joinedAt?: string;
461
+ }[];
462
+ lastMessage?: {
463
+ _id?: string;
464
+ id: number;
465
+ conversation: string;
466
+ user?: string;
467
+ message?: string;
468
+ origin: "user" | "system";
469
+ history: {
470
+ created: string;
471
+ updated?: string;
472
+ };
473
+ action?: string;
474
+ actionData?: Record<string, unknown>;
475
+ isUser?: boolean;
476
+ };
477
+ oldestMessageId?: number | null;
478
+ messages?: {
479
+ _id?: string;
480
+ id: number;
481
+ conversation: string;
482
+ user?: string;
483
+ message?: string;
484
+ origin: "user" | "system";
485
+ history: {
486
+ created: string;
487
+ updated?: string;
488
+ };
489
+ action?: string;
490
+ actionData?: Record<string, unknown>;
491
+ isUser?: boolean;
492
+ }[];
493
+ messagesLoaded?: boolean;
494
+ unreadCount?: number;
495
+ unread?: boolean;
496
+ isMember?: boolean;
497
+ isNew?: boolean;
498
+ isTemp?: boolean;
499
+ creator?: string;
500
+ }>;
501
+ convertTempToConversation: (conversation: ConversationPayload) => void;
502
+ getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<Message[]>;
503
+ addMessagesToConversation: (messages: Message[], conversation: string) => void;
504
+ getMessagesForConversation: (conversation: string) => Message[];
505
+ updateLastMessage: (conversationId: string, message: Message) => void;
34
506
  updateUnread: (conversation: string) => void;
35
507
  updateAllUnread: () => void;
36
508
  increaseMessageCount: (conversation: string) => void;
37
509
  increaseMessageCountSystem: (conversation: string) => void;
38
510
  setLastReadId: (conversation: string, lastReadId: number) => void;
39
- getConversation: (conversation: string) => ConversationEntry;
511
+ getConversation: (conversation: string | undefined) => ConversationEntry | undefined;
40
512
  addParticipant: (conversation: string, participant: string) => void;
41
513
  removeParticipant: (conversation: string, participant: string) => void;
42
- setParticipants: (conversation: string, participants: string[]) => void;
514
+ setParticipants: (conversation: string, participants: Participant[]) => void;
43
515
  toggleParticipant: (conversation: string, participant: string) => void;
44
- getConversationViaParticipantsAndName: (participants: Participant[], name: string, options?: {
516
+ getConversationViaParticipantsAndName: (participants: Participant[], name?: string, options?: {
45
517
  excludeTemp?: boolean;
46
518
  exclude?: string[];
47
- }) => ConversationEntry;
519
+ }) => {
520
+ _id?: string;
521
+ id?: string;
522
+ name?: string;
523
+ participants: (string | {
524
+ id: string;
525
+ prename?: string;
526
+ lastname?: string;
527
+ email?: string;
528
+ name?: string;
529
+ lastSeen?: string;
530
+ online?: boolean;
531
+ role?: "agent" | null;
532
+ })[];
533
+ blocked?: string[];
534
+ messagesCount?: number;
535
+ messagesCountSystem?: number;
536
+ createdAt?: string;
537
+ lastActivity?: string;
538
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
539
+ supportStatus?: SupportStatus;
540
+ supportStatusUpdatedAt?: string;
541
+ supportStatusVersion?: number;
542
+ sla?: {
543
+ conversation: string;
544
+ status: SupportStatus;
545
+ statusVersion: number;
546
+ startedAt: string;
547
+ endAt: string;
548
+ stoppedAt?: string;
549
+ };
550
+ participant?: {
551
+ _id?: string;
552
+ conversation: string;
553
+ user: string;
554
+ state: ParticipantState;
555
+ rights: string[];
556
+ lastReadId?: number;
557
+ latestMessageId?: number;
558
+ muted?: boolean;
559
+ role?: "agent";
560
+ joinedAt?: string;
561
+ };
562
+ participantDocs?: {
563
+ _id?: string;
564
+ conversation: string;
565
+ user: string;
566
+ state: ParticipantState;
567
+ rights: string[];
568
+ lastReadId?: number;
569
+ latestMessageId?: number;
570
+ muted?: boolean;
571
+ role?: "agent";
572
+ joinedAt?: string;
573
+ }[];
574
+ lastMessage?: {
575
+ _id?: string;
576
+ id: number;
577
+ conversation: string;
578
+ user?: string;
579
+ message?: string;
580
+ origin: "user" | "system";
581
+ history: {
582
+ created: string;
583
+ updated?: string;
584
+ };
585
+ action?: string;
586
+ actionData?: Record<string, unknown>;
587
+ isUser?: boolean;
588
+ };
589
+ oldestMessageId?: number | null;
590
+ messages?: {
591
+ _id?: string;
592
+ id: number;
593
+ conversation: string;
594
+ user?: string;
595
+ message?: string;
596
+ origin: "user" | "system";
597
+ history: {
598
+ created: string;
599
+ updated?: string;
600
+ };
601
+ action?: string;
602
+ actionData?: Record<string, unknown>;
603
+ isUser?: boolean;
604
+ }[];
605
+ messagesLoaded?: boolean;
606
+ unreadCount?: number;
607
+ unread?: boolean;
608
+ isMember?: boolean;
609
+ isNew?: boolean;
610
+ isTemp?: boolean;
611
+ creator?: string;
612
+ };
48
613
  cleanConversations: () => void;
49
614
  abandonConversation: (conversation: string) => void;
50
615
  inactivateConversation: () => void;
51
- rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<any>>;
616
+ rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<unknown>>;
52
617
  conversationRenamed: (conversation: string, newName: string) => void;
53
- executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
54
- updateConversationParticipant: (conversation: string, state: string) => void;
55
- leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
618
+ executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
619
+ updateConversationParticipant: (conversation: string, state: ParticipantState) => void;
620
+ leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
56
621
  deleteConversation: (conversation: string) => Promise<void>;
57
- lastActiveConversation: import("vue").Ref<any, any>;
58
- getLatestConversation: () => ConversationEntry;
622
+ lastActiveConversation: import("vue").Ref<string, string>;
623
+ getLatestConversation: () => {
624
+ _id?: string;
625
+ id?: string;
626
+ name?: string;
627
+ participants: (string | {
628
+ id: string;
629
+ prename?: string;
630
+ lastname?: string;
631
+ email?: string;
632
+ name?: string;
633
+ lastSeen?: string;
634
+ online?: boolean;
635
+ role?: "agent" | null;
636
+ })[];
637
+ blocked?: string[];
638
+ messagesCount?: number;
639
+ messagesCountSystem?: number;
640
+ createdAt?: string;
641
+ lastActivity?: string;
642
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
643
+ supportStatus?: SupportStatus;
644
+ supportStatusUpdatedAt?: string;
645
+ supportStatusVersion?: number;
646
+ sla?: {
647
+ conversation: string;
648
+ status: SupportStatus;
649
+ statusVersion: number;
650
+ startedAt: string;
651
+ endAt: string;
652
+ stoppedAt?: string;
653
+ };
654
+ participant?: {
655
+ _id?: string;
656
+ conversation: string;
657
+ user: string;
658
+ state: ParticipantState;
659
+ rights: string[];
660
+ lastReadId?: number;
661
+ latestMessageId?: number;
662
+ muted?: boolean;
663
+ role?: "agent";
664
+ joinedAt?: string;
665
+ };
666
+ participantDocs?: {
667
+ _id?: string;
668
+ conversation: string;
669
+ user: string;
670
+ state: ParticipantState;
671
+ rights: string[];
672
+ lastReadId?: number;
673
+ latestMessageId?: number;
674
+ muted?: boolean;
675
+ role?: "agent";
676
+ joinedAt?: string;
677
+ }[];
678
+ lastMessage?: {
679
+ _id?: string;
680
+ id: number;
681
+ conversation: string;
682
+ user?: string;
683
+ message?: string;
684
+ origin: "user" | "system";
685
+ history: {
686
+ created: string;
687
+ updated?: string;
688
+ };
689
+ action?: string;
690
+ actionData?: Record<string, unknown>;
691
+ isUser?: boolean;
692
+ };
693
+ oldestMessageId?: number | null;
694
+ messages?: {
695
+ _id?: string;
696
+ id: number;
697
+ conversation: string;
698
+ user?: string;
699
+ message?: string;
700
+ origin: "user" | "system";
701
+ history: {
702
+ created: string;
703
+ updated?: string;
704
+ };
705
+ action?: string;
706
+ actionData?: Record<string, unknown>;
707
+ isUser?: boolean;
708
+ }[];
709
+ messagesLoaded?: boolean;
710
+ unreadCount?: number;
711
+ unread?: boolean;
712
+ isMember?: boolean;
713
+ isNew?: boolean;
714
+ isTemp?: boolean;
715
+ creator?: string;
716
+ };
59
717
  activateLastOrLatestConversation: () => void;
60
718
  readLastActiveConversation: () => void;
61
- }, "conversations" | "typing" | "conversationsLoaded" | "activeConversation" | "lastActiveConversation">, Pick<{
719
+ }, "conversations" | "conversationsLoaded" | "typing" | "activeConversation" | "lastActiveConversation">, Pick<{
62
720
  getAllConversations: () => Promise<void>;
721
+ mergeConversations: (incoming: ConversationPayload[]) => void;
63
722
  refreshConversations: () => Promise<void>;
64
723
  handleReconnect: () => Promise<void>;
65
- conversations: import("vue").Ref<ConversationEntry[], ConversationEntry[]>;
724
+ conversations: import("vue").Ref<{
725
+ _id?: string;
726
+ id?: string;
727
+ name?: string;
728
+ participants: (string | {
729
+ id: string;
730
+ prename?: string;
731
+ lastname?: string;
732
+ email?: string;
733
+ name?: string;
734
+ lastSeen?: string;
735
+ online?: boolean;
736
+ role?: "agent" | null;
737
+ })[];
738
+ blocked?: string[];
739
+ messagesCount?: number;
740
+ messagesCountSystem?: number;
741
+ createdAt?: string;
742
+ lastActivity?: string;
743
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
744
+ supportStatus?: SupportStatus;
745
+ supportStatusUpdatedAt?: string;
746
+ supportStatusVersion?: number;
747
+ sla?: {
748
+ conversation: string;
749
+ status: SupportStatus;
750
+ statusVersion: number;
751
+ startedAt: string;
752
+ endAt: string;
753
+ stoppedAt?: string;
754
+ };
755
+ participant?: {
756
+ _id?: string;
757
+ conversation: string;
758
+ user: string;
759
+ state: ParticipantState;
760
+ rights: string[];
761
+ lastReadId?: number;
762
+ latestMessageId?: number;
763
+ muted?: boolean;
764
+ role?: "agent";
765
+ joinedAt?: string;
766
+ };
767
+ participantDocs?: {
768
+ _id?: string;
769
+ conversation: string;
770
+ user: string;
771
+ state: ParticipantState;
772
+ rights: string[];
773
+ lastReadId?: number;
774
+ latestMessageId?: number;
775
+ muted?: boolean;
776
+ role?: "agent";
777
+ joinedAt?: string;
778
+ }[];
779
+ lastMessage?: {
780
+ _id?: string;
781
+ id: number;
782
+ conversation: string;
783
+ user?: string;
784
+ message?: string;
785
+ origin: "user" | "system";
786
+ history: {
787
+ created: string;
788
+ updated?: string;
789
+ };
790
+ action?: string;
791
+ actionData?: Record<string, unknown>;
792
+ isUser?: boolean;
793
+ };
794
+ oldestMessageId?: number | null;
795
+ messages?: {
796
+ _id?: string;
797
+ id: number;
798
+ conversation: string;
799
+ user?: string;
800
+ message?: string;
801
+ origin: "user" | "system";
802
+ history: {
803
+ created: string;
804
+ updated?: string;
805
+ };
806
+ action?: string;
807
+ actionData?: Record<string, unknown>;
808
+ isUser?: boolean;
809
+ }[];
810
+ messagesLoaded?: boolean;
811
+ unreadCount?: number;
812
+ unread?: boolean;
813
+ isMember?: boolean;
814
+ isNew?: boolean;
815
+ isTemp?: boolean;
816
+ creator?: string;
817
+ }[], Conversation[] | {
818
+ _id?: string;
819
+ id?: string;
820
+ name?: string;
821
+ participants: (string | {
822
+ id: string;
823
+ prename?: string;
824
+ lastname?: string;
825
+ email?: string;
826
+ name?: string;
827
+ lastSeen?: string;
828
+ online?: boolean;
829
+ role?: "agent" | null;
830
+ })[];
831
+ blocked?: string[];
832
+ messagesCount?: number;
833
+ messagesCountSystem?: number;
834
+ createdAt?: string;
835
+ lastActivity?: string;
836
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
837
+ supportStatus?: SupportStatus;
838
+ supportStatusUpdatedAt?: string;
839
+ supportStatusVersion?: number;
840
+ sla?: {
841
+ conversation: string;
842
+ status: SupportStatus;
843
+ statusVersion: number;
844
+ startedAt: string;
845
+ endAt: string;
846
+ stoppedAt?: string;
847
+ };
848
+ participant?: {
849
+ _id?: string;
850
+ conversation: string;
851
+ user: string;
852
+ state: ParticipantState;
853
+ rights: string[];
854
+ lastReadId?: number;
855
+ latestMessageId?: number;
856
+ muted?: boolean;
857
+ role?: "agent";
858
+ joinedAt?: string;
859
+ };
860
+ participantDocs?: {
861
+ _id?: string;
862
+ conversation: string;
863
+ user: string;
864
+ state: ParticipantState;
865
+ rights: string[];
866
+ lastReadId?: number;
867
+ latestMessageId?: number;
868
+ muted?: boolean;
869
+ role?: "agent";
870
+ joinedAt?: string;
871
+ }[];
872
+ lastMessage?: {
873
+ _id?: string;
874
+ id: number;
875
+ conversation: string;
876
+ user?: string;
877
+ message?: string;
878
+ origin: "user" | "system";
879
+ history: {
880
+ created: string;
881
+ updated?: string;
882
+ };
883
+ action?: string;
884
+ actionData?: Record<string, unknown>;
885
+ isUser?: boolean;
886
+ };
887
+ oldestMessageId?: number | null;
888
+ messages?: {
889
+ _id?: string;
890
+ id: number;
891
+ conversation: string;
892
+ user?: string;
893
+ message?: string;
894
+ origin: "user" | "system";
895
+ history: {
896
+ created: string;
897
+ updated?: string;
898
+ };
899
+ action?: string;
900
+ actionData?: Record<string, unknown>;
901
+ isUser?: boolean;
902
+ }[];
903
+ messagesLoaded?: boolean;
904
+ unreadCount?: number;
905
+ unread?: boolean;
906
+ isMember?: boolean;
907
+ isNew?: boolean;
908
+ isTemp?: boolean;
909
+ creator?: string;
910
+ }[]>;
66
911
  conversationsLoaded: import("vue").Ref<boolean, boolean>;
67
- unreadConversations: import("vue").ComputedRef<ConversationEntry[]>;
68
- totalUnreadCount: import("vue").ComputedRef<any>;
912
+ unreadConversations: import("vue").ComputedRef<{
913
+ _id?: string;
914
+ id?: string;
915
+ name?: string;
916
+ participants: (string | {
917
+ id: string;
918
+ prename?: string;
919
+ lastname?: string;
920
+ email?: string;
921
+ name?: string;
922
+ lastSeen?: string;
923
+ online?: boolean;
924
+ role?: "agent" | null;
925
+ })[];
926
+ blocked?: string[];
927
+ messagesCount?: number;
928
+ messagesCountSystem?: number;
929
+ createdAt?: string;
930
+ lastActivity?: string;
931
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
932
+ supportStatus?: SupportStatus;
933
+ supportStatusUpdatedAt?: string;
934
+ supportStatusVersion?: number;
935
+ sla?: {
936
+ conversation: string;
937
+ status: SupportStatus;
938
+ statusVersion: number;
939
+ startedAt: string;
940
+ endAt: string;
941
+ stoppedAt?: string;
942
+ };
943
+ participant?: {
944
+ _id?: string;
945
+ conversation: string;
946
+ user: string;
947
+ state: ParticipantState;
948
+ rights: string[];
949
+ lastReadId?: number;
950
+ latestMessageId?: number;
951
+ muted?: boolean;
952
+ role?: "agent";
953
+ joinedAt?: string;
954
+ };
955
+ participantDocs?: {
956
+ _id?: string;
957
+ conversation: string;
958
+ user: string;
959
+ state: ParticipantState;
960
+ rights: string[];
961
+ lastReadId?: number;
962
+ latestMessageId?: number;
963
+ muted?: boolean;
964
+ role?: "agent";
965
+ joinedAt?: string;
966
+ }[];
967
+ lastMessage?: {
968
+ _id?: string;
969
+ id: number;
970
+ conversation: string;
971
+ user?: string;
972
+ message?: string;
973
+ origin: "user" | "system";
974
+ history: {
975
+ created: string;
976
+ updated?: string;
977
+ };
978
+ action?: string;
979
+ actionData?: Record<string, unknown>;
980
+ isUser?: boolean;
981
+ };
982
+ oldestMessageId?: number | null;
983
+ messages?: {
984
+ _id?: string;
985
+ id: number;
986
+ conversation: string;
987
+ user?: string;
988
+ message?: string;
989
+ origin: "user" | "system";
990
+ history: {
991
+ created: string;
992
+ updated?: string;
993
+ };
994
+ action?: string;
995
+ actionData?: Record<string, unknown>;
996
+ isUser?: boolean;
997
+ }[];
998
+ messagesLoaded?: boolean;
999
+ unreadCount?: number;
1000
+ unread?: boolean;
1001
+ isMember?: boolean;
1002
+ isNew?: boolean;
1003
+ isTemp?: boolean;
1004
+ creator?: string;
1005
+ }[]>;
1006
+ totalUnreadCount: import("vue").ComputedRef<number>;
69
1007
  totalUnreadConversations: import("vue").ComputedRef<number>;
70
1008
  typing: import("vue").Ref<Record<string, string[]>, Record<string, string[]>>;
71
1009
  setTyping: (conversation: string, user: string, isTyping: boolean) => void;
72
- loadParticipants: (conversation: string) => Promise<any>;
73
- setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1010
+ loadParticipants: (conversation: string) => Promise<import("@/interfaces/ParticipantDocument").ParticipantDocument[]>;
1011
+ setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
74
1012
  isMuted: (conversation: string) => boolean;
75
1013
  setMuted: (conversation: string, muted: boolean) => Promise<void>;
76
1014
  conversationMuted: (conversation: string, muted: boolean) => void;
77
- blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1015
+ updateSupportStatus: (conversation: string, status: SupportStatus | undefined, version: number | undefined, updatedAt: string | undefined, options?: {
1016
+ force?: boolean;
1017
+ sla?: Conversation["sla"];
1018
+ }) => boolean;
1019
+ blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
78
1020
  updateParticipantRights: (conversation: string, user: string, rights: string[]) => void;
79
- create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1021
+ create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
80
1022
  createNew: (participants: string[], creator?: string, operationMode?: "chat" | "support") => string;
81
1023
  createConversation: () => string;
82
- startSupport: () => Promise<any>;
1024
+ startSupport: () => Promise<string>;
83
1025
  activateConversation: (conversationId: string) => Promise<void>;
84
- activeConversation: import("vue").Ref<any, any>;
85
- convertTempToConversation: (conversation: Record<string, any>) => void;
86
- getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<any>;
87
- addMessagesToConversation: (messages: Record<string, any>[], conversation: string) => void;
88
- getMessagesForConversation: (conversation: string) => any;
89
- updateLastMessage: (conversationId: string, message: Record<string, any>) => void;
1026
+ activeConversation: import("vue").Ref<{
1027
+ _id?: string;
1028
+ id?: string;
1029
+ name?: string;
1030
+ participants: (string | {
1031
+ id: string;
1032
+ prename?: string;
1033
+ lastname?: string;
1034
+ email?: string;
1035
+ name?: string;
1036
+ lastSeen?: string;
1037
+ online?: boolean;
1038
+ role?: "agent" | null;
1039
+ })[];
1040
+ blocked?: string[];
1041
+ messagesCount?: number;
1042
+ messagesCountSystem?: number;
1043
+ createdAt?: string;
1044
+ lastActivity?: string;
1045
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1046
+ supportStatus?: SupportStatus;
1047
+ supportStatusUpdatedAt?: string;
1048
+ supportStatusVersion?: number;
1049
+ sla?: {
1050
+ conversation: string;
1051
+ status: SupportStatus;
1052
+ statusVersion: number;
1053
+ startedAt: string;
1054
+ endAt: string;
1055
+ stoppedAt?: string;
1056
+ };
1057
+ participant?: {
1058
+ _id?: string;
1059
+ conversation: string;
1060
+ user: string;
1061
+ state: ParticipantState;
1062
+ rights: string[];
1063
+ lastReadId?: number;
1064
+ latestMessageId?: number;
1065
+ muted?: boolean;
1066
+ role?: "agent";
1067
+ joinedAt?: string;
1068
+ };
1069
+ participantDocs?: {
1070
+ _id?: string;
1071
+ conversation: string;
1072
+ user: string;
1073
+ state: ParticipantState;
1074
+ rights: string[];
1075
+ lastReadId?: number;
1076
+ latestMessageId?: number;
1077
+ muted?: boolean;
1078
+ role?: "agent";
1079
+ joinedAt?: string;
1080
+ }[];
1081
+ lastMessage?: {
1082
+ _id?: string;
1083
+ id: number;
1084
+ conversation: string;
1085
+ user?: string;
1086
+ message?: string;
1087
+ origin: "user" | "system";
1088
+ history: {
1089
+ created: string;
1090
+ updated?: string;
1091
+ };
1092
+ action?: string;
1093
+ actionData?: Record<string, unknown>;
1094
+ isUser?: boolean;
1095
+ };
1096
+ oldestMessageId?: number | null;
1097
+ messages?: {
1098
+ _id?: string;
1099
+ id: number;
1100
+ conversation: string;
1101
+ user?: string;
1102
+ message?: string;
1103
+ origin: "user" | "system";
1104
+ history: {
1105
+ created: string;
1106
+ updated?: string;
1107
+ };
1108
+ action?: string;
1109
+ actionData?: Record<string, unknown>;
1110
+ isUser?: boolean;
1111
+ }[];
1112
+ messagesLoaded?: boolean;
1113
+ unreadCount?: number;
1114
+ unread?: boolean;
1115
+ isMember?: boolean;
1116
+ isNew?: boolean;
1117
+ isTemp?: boolean;
1118
+ creator?: string;
1119
+ }, Conversation | {
1120
+ _id?: string;
1121
+ id?: string;
1122
+ name?: string;
1123
+ participants: (string | {
1124
+ id: string;
1125
+ prename?: string;
1126
+ lastname?: string;
1127
+ email?: string;
1128
+ name?: string;
1129
+ lastSeen?: string;
1130
+ online?: boolean;
1131
+ role?: "agent" | null;
1132
+ })[];
1133
+ blocked?: string[];
1134
+ messagesCount?: number;
1135
+ messagesCountSystem?: number;
1136
+ createdAt?: string;
1137
+ lastActivity?: string;
1138
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1139
+ supportStatus?: SupportStatus;
1140
+ supportStatusUpdatedAt?: string;
1141
+ supportStatusVersion?: number;
1142
+ sla?: {
1143
+ conversation: string;
1144
+ status: SupportStatus;
1145
+ statusVersion: number;
1146
+ startedAt: string;
1147
+ endAt: string;
1148
+ stoppedAt?: string;
1149
+ };
1150
+ participant?: {
1151
+ _id?: string;
1152
+ conversation: string;
1153
+ user: string;
1154
+ state: ParticipantState;
1155
+ rights: string[];
1156
+ lastReadId?: number;
1157
+ latestMessageId?: number;
1158
+ muted?: boolean;
1159
+ role?: "agent";
1160
+ joinedAt?: string;
1161
+ };
1162
+ participantDocs?: {
1163
+ _id?: string;
1164
+ conversation: string;
1165
+ user: string;
1166
+ state: ParticipantState;
1167
+ rights: string[];
1168
+ lastReadId?: number;
1169
+ latestMessageId?: number;
1170
+ muted?: boolean;
1171
+ role?: "agent";
1172
+ joinedAt?: string;
1173
+ }[];
1174
+ lastMessage?: {
1175
+ _id?: string;
1176
+ id: number;
1177
+ conversation: string;
1178
+ user?: string;
1179
+ message?: string;
1180
+ origin: "user" | "system";
1181
+ history: {
1182
+ created: string;
1183
+ updated?: string;
1184
+ };
1185
+ action?: string;
1186
+ actionData?: Record<string, unknown>;
1187
+ isUser?: boolean;
1188
+ };
1189
+ oldestMessageId?: number | null;
1190
+ messages?: {
1191
+ _id?: string;
1192
+ id: number;
1193
+ conversation: string;
1194
+ user?: string;
1195
+ message?: string;
1196
+ origin: "user" | "system";
1197
+ history: {
1198
+ created: string;
1199
+ updated?: string;
1200
+ };
1201
+ action?: string;
1202
+ actionData?: Record<string, unknown>;
1203
+ isUser?: boolean;
1204
+ }[];
1205
+ messagesLoaded?: boolean;
1206
+ unreadCount?: number;
1207
+ unread?: boolean;
1208
+ isMember?: boolean;
1209
+ isNew?: boolean;
1210
+ isTemp?: boolean;
1211
+ creator?: string;
1212
+ }>;
1213
+ convertTempToConversation: (conversation: ConversationPayload) => void;
1214
+ getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<Message[]>;
1215
+ addMessagesToConversation: (messages: Message[], conversation: string) => void;
1216
+ getMessagesForConversation: (conversation: string) => Message[];
1217
+ updateLastMessage: (conversationId: string, message: Message) => void;
90
1218
  updateUnread: (conversation: string) => void;
91
1219
  updateAllUnread: () => void;
92
1220
  increaseMessageCount: (conversation: string) => void;
93
1221
  increaseMessageCountSystem: (conversation: string) => void;
94
1222
  setLastReadId: (conversation: string, lastReadId: number) => void;
95
- getConversation: (conversation: string) => ConversationEntry;
1223
+ getConversation: (conversation: string | undefined) => ConversationEntry | undefined;
96
1224
  addParticipant: (conversation: string, participant: string) => void;
97
1225
  removeParticipant: (conversation: string, participant: string) => void;
98
- setParticipants: (conversation: string, participants: string[]) => void;
1226
+ setParticipants: (conversation: string, participants: Participant[]) => void;
99
1227
  toggleParticipant: (conversation: string, participant: string) => void;
100
- getConversationViaParticipantsAndName: (participants: Participant[], name: string, options?: {
1228
+ getConversationViaParticipantsAndName: (participants: Participant[], name?: string, options?: {
101
1229
  excludeTemp?: boolean;
102
1230
  exclude?: string[];
103
- }) => ConversationEntry;
1231
+ }) => {
1232
+ _id?: string;
1233
+ id?: string;
1234
+ name?: string;
1235
+ participants: (string | {
1236
+ id: string;
1237
+ prename?: string;
1238
+ lastname?: string;
1239
+ email?: string;
1240
+ name?: string;
1241
+ lastSeen?: string;
1242
+ online?: boolean;
1243
+ role?: "agent" | null;
1244
+ })[];
1245
+ blocked?: string[];
1246
+ messagesCount?: number;
1247
+ messagesCountSystem?: number;
1248
+ createdAt?: string;
1249
+ lastActivity?: string;
1250
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1251
+ supportStatus?: SupportStatus;
1252
+ supportStatusUpdatedAt?: string;
1253
+ supportStatusVersion?: number;
1254
+ sla?: {
1255
+ conversation: string;
1256
+ status: SupportStatus;
1257
+ statusVersion: number;
1258
+ startedAt: string;
1259
+ endAt: string;
1260
+ stoppedAt?: string;
1261
+ };
1262
+ participant?: {
1263
+ _id?: string;
1264
+ conversation: string;
1265
+ user: string;
1266
+ state: ParticipantState;
1267
+ rights: string[];
1268
+ lastReadId?: number;
1269
+ latestMessageId?: number;
1270
+ muted?: boolean;
1271
+ role?: "agent";
1272
+ joinedAt?: string;
1273
+ };
1274
+ participantDocs?: {
1275
+ _id?: string;
1276
+ conversation: string;
1277
+ user: string;
1278
+ state: ParticipantState;
1279
+ rights: string[];
1280
+ lastReadId?: number;
1281
+ latestMessageId?: number;
1282
+ muted?: boolean;
1283
+ role?: "agent";
1284
+ joinedAt?: string;
1285
+ }[];
1286
+ lastMessage?: {
1287
+ _id?: string;
1288
+ id: number;
1289
+ conversation: string;
1290
+ user?: string;
1291
+ message?: string;
1292
+ origin: "user" | "system";
1293
+ history: {
1294
+ created: string;
1295
+ updated?: string;
1296
+ };
1297
+ action?: string;
1298
+ actionData?: Record<string, unknown>;
1299
+ isUser?: boolean;
1300
+ };
1301
+ oldestMessageId?: number | null;
1302
+ messages?: {
1303
+ _id?: string;
1304
+ id: number;
1305
+ conversation: string;
1306
+ user?: string;
1307
+ message?: string;
1308
+ origin: "user" | "system";
1309
+ history: {
1310
+ created: string;
1311
+ updated?: string;
1312
+ };
1313
+ action?: string;
1314
+ actionData?: Record<string, unknown>;
1315
+ isUser?: boolean;
1316
+ }[];
1317
+ messagesLoaded?: boolean;
1318
+ unreadCount?: number;
1319
+ unread?: boolean;
1320
+ isMember?: boolean;
1321
+ isNew?: boolean;
1322
+ isTemp?: boolean;
1323
+ creator?: string;
1324
+ };
104
1325
  cleanConversations: () => void;
105
1326
  abandonConversation: (conversation: string) => void;
106
1327
  inactivateConversation: () => void;
107
- rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<any>>;
1328
+ rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<unknown>>;
108
1329
  conversationRenamed: (conversation: string, newName: string) => void;
109
- executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
110
- updateConversationParticipant: (conversation: string, state: string) => void;
111
- leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1330
+ executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
1331
+ updateConversationParticipant: (conversation: string, state: ParticipantState) => void;
1332
+ leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
112
1333
  deleteConversation: (conversation: string) => Promise<void>;
113
- lastActiveConversation: import("vue").Ref<any, any>;
114
- getLatestConversation: () => ConversationEntry;
1334
+ lastActiveConversation: import("vue").Ref<string, string>;
1335
+ getLatestConversation: () => {
1336
+ _id?: string;
1337
+ id?: string;
1338
+ name?: string;
1339
+ participants: (string | {
1340
+ id: string;
1341
+ prename?: string;
1342
+ lastname?: string;
1343
+ email?: string;
1344
+ name?: string;
1345
+ lastSeen?: string;
1346
+ online?: boolean;
1347
+ role?: "agent" | null;
1348
+ })[];
1349
+ blocked?: string[];
1350
+ messagesCount?: number;
1351
+ messagesCountSystem?: number;
1352
+ createdAt?: string;
1353
+ lastActivity?: string;
1354
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1355
+ supportStatus?: SupportStatus;
1356
+ supportStatusUpdatedAt?: string;
1357
+ supportStatusVersion?: number;
1358
+ sla?: {
1359
+ conversation: string;
1360
+ status: SupportStatus;
1361
+ statusVersion: number;
1362
+ startedAt: string;
1363
+ endAt: string;
1364
+ stoppedAt?: string;
1365
+ };
1366
+ participant?: {
1367
+ _id?: string;
1368
+ conversation: string;
1369
+ user: string;
1370
+ state: ParticipantState;
1371
+ rights: string[];
1372
+ lastReadId?: number;
1373
+ latestMessageId?: number;
1374
+ muted?: boolean;
1375
+ role?: "agent";
1376
+ joinedAt?: string;
1377
+ };
1378
+ participantDocs?: {
1379
+ _id?: string;
1380
+ conversation: string;
1381
+ user: string;
1382
+ state: ParticipantState;
1383
+ rights: string[];
1384
+ lastReadId?: number;
1385
+ latestMessageId?: number;
1386
+ muted?: boolean;
1387
+ role?: "agent";
1388
+ joinedAt?: string;
1389
+ }[];
1390
+ lastMessage?: {
1391
+ _id?: string;
1392
+ id: number;
1393
+ conversation: string;
1394
+ user?: string;
1395
+ message?: string;
1396
+ origin: "user" | "system";
1397
+ history: {
1398
+ created: string;
1399
+ updated?: string;
1400
+ };
1401
+ action?: string;
1402
+ actionData?: Record<string, unknown>;
1403
+ isUser?: boolean;
1404
+ };
1405
+ oldestMessageId?: number | null;
1406
+ messages?: {
1407
+ _id?: string;
1408
+ id: number;
1409
+ conversation: string;
1410
+ user?: string;
1411
+ message?: string;
1412
+ origin: "user" | "system";
1413
+ history: {
1414
+ created: string;
1415
+ updated?: string;
1416
+ };
1417
+ action?: string;
1418
+ actionData?: Record<string, unknown>;
1419
+ isUser?: boolean;
1420
+ }[];
1421
+ messagesLoaded?: boolean;
1422
+ unreadCount?: number;
1423
+ unread?: boolean;
1424
+ isMember?: boolean;
1425
+ isNew?: boolean;
1426
+ isTemp?: boolean;
1427
+ creator?: string;
1428
+ };
115
1429
  activateLastOrLatestConversation: () => void;
116
1430
  readLastActiveConversation: () => void;
117
1431
  }, "unreadConversations" | "totalUnreadCount" | "totalUnreadConversations">, Pick<{
118
1432
  getAllConversations: () => Promise<void>;
1433
+ mergeConversations: (incoming: ConversationPayload[]) => void;
119
1434
  refreshConversations: () => Promise<void>;
120
1435
  handleReconnect: () => Promise<void>;
121
- conversations: import("vue").Ref<ConversationEntry[], ConversationEntry[]>;
1436
+ conversations: import("vue").Ref<{
1437
+ _id?: string;
1438
+ id?: string;
1439
+ name?: string;
1440
+ participants: (string | {
1441
+ id: string;
1442
+ prename?: string;
1443
+ lastname?: string;
1444
+ email?: string;
1445
+ name?: string;
1446
+ lastSeen?: string;
1447
+ online?: boolean;
1448
+ role?: "agent" | null;
1449
+ })[];
1450
+ blocked?: string[];
1451
+ messagesCount?: number;
1452
+ messagesCountSystem?: number;
1453
+ createdAt?: string;
1454
+ lastActivity?: string;
1455
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1456
+ supportStatus?: SupportStatus;
1457
+ supportStatusUpdatedAt?: string;
1458
+ supportStatusVersion?: number;
1459
+ sla?: {
1460
+ conversation: string;
1461
+ status: SupportStatus;
1462
+ statusVersion: number;
1463
+ startedAt: string;
1464
+ endAt: string;
1465
+ stoppedAt?: string;
1466
+ };
1467
+ participant?: {
1468
+ _id?: string;
1469
+ conversation: string;
1470
+ user: string;
1471
+ state: ParticipantState;
1472
+ rights: string[];
1473
+ lastReadId?: number;
1474
+ latestMessageId?: number;
1475
+ muted?: boolean;
1476
+ role?: "agent";
1477
+ joinedAt?: string;
1478
+ };
1479
+ participantDocs?: {
1480
+ _id?: string;
1481
+ conversation: string;
1482
+ user: string;
1483
+ state: ParticipantState;
1484
+ rights: string[];
1485
+ lastReadId?: number;
1486
+ latestMessageId?: number;
1487
+ muted?: boolean;
1488
+ role?: "agent";
1489
+ joinedAt?: string;
1490
+ }[];
1491
+ lastMessage?: {
1492
+ _id?: string;
1493
+ id: number;
1494
+ conversation: string;
1495
+ user?: string;
1496
+ message?: string;
1497
+ origin: "user" | "system";
1498
+ history: {
1499
+ created: string;
1500
+ updated?: string;
1501
+ };
1502
+ action?: string;
1503
+ actionData?: Record<string, unknown>;
1504
+ isUser?: boolean;
1505
+ };
1506
+ oldestMessageId?: number | null;
1507
+ messages?: {
1508
+ _id?: string;
1509
+ id: number;
1510
+ conversation: string;
1511
+ user?: string;
1512
+ message?: string;
1513
+ origin: "user" | "system";
1514
+ history: {
1515
+ created: string;
1516
+ updated?: string;
1517
+ };
1518
+ action?: string;
1519
+ actionData?: Record<string, unknown>;
1520
+ isUser?: boolean;
1521
+ }[];
1522
+ messagesLoaded?: boolean;
1523
+ unreadCount?: number;
1524
+ unread?: boolean;
1525
+ isMember?: boolean;
1526
+ isNew?: boolean;
1527
+ isTemp?: boolean;
1528
+ creator?: string;
1529
+ }[], Conversation[] | {
1530
+ _id?: string;
1531
+ id?: string;
1532
+ name?: string;
1533
+ participants: (string | {
1534
+ id: string;
1535
+ prename?: string;
1536
+ lastname?: string;
1537
+ email?: string;
1538
+ name?: string;
1539
+ lastSeen?: string;
1540
+ online?: boolean;
1541
+ role?: "agent" | null;
1542
+ })[];
1543
+ blocked?: string[];
1544
+ messagesCount?: number;
1545
+ messagesCountSystem?: number;
1546
+ createdAt?: string;
1547
+ lastActivity?: string;
1548
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1549
+ supportStatus?: SupportStatus;
1550
+ supportStatusUpdatedAt?: string;
1551
+ supportStatusVersion?: number;
1552
+ sla?: {
1553
+ conversation: string;
1554
+ status: SupportStatus;
1555
+ statusVersion: number;
1556
+ startedAt: string;
1557
+ endAt: string;
1558
+ stoppedAt?: string;
1559
+ };
1560
+ participant?: {
1561
+ _id?: string;
1562
+ conversation: string;
1563
+ user: string;
1564
+ state: ParticipantState;
1565
+ rights: string[];
1566
+ lastReadId?: number;
1567
+ latestMessageId?: number;
1568
+ muted?: boolean;
1569
+ role?: "agent";
1570
+ joinedAt?: string;
1571
+ };
1572
+ participantDocs?: {
1573
+ _id?: string;
1574
+ conversation: string;
1575
+ user: string;
1576
+ state: ParticipantState;
1577
+ rights: string[];
1578
+ lastReadId?: number;
1579
+ latestMessageId?: number;
1580
+ muted?: boolean;
1581
+ role?: "agent";
1582
+ joinedAt?: string;
1583
+ }[];
1584
+ lastMessage?: {
1585
+ _id?: string;
1586
+ id: number;
1587
+ conversation: string;
1588
+ user?: string;
1589
+ message?: string;
1590
+ origin: "user" | "system";
1591
+ history: {
1592
+ created: string;
1593
+ updated?: string;
1594
+ };
1595
+ action?: string;
1596
+ actionData?: Record<string, unknown>;
1597
+ isUser?: boolean;
1598
+ };
1599
+ oldestMessageId?: number | null;
1600
+ messages?: {
1601
+ _id?: string;
1602
+ id: number;
1603
+ conversation: string;
1604
+ user?: string;
1605
+ message?: string;
1606
+ origin: "user" | "system";
1607
+ history: {
1608
+ created: string;
1609
+ updated?: string;
1610
+ };
1611
+ action?: string;
1612
+ actionData?: Record<string, unknown>;
1613
+ isUser?: boolean;
1614
+ }[];
1615
+ messagesLoaded?: boolean;
1616
+ unreadCount?: number;
1617
+ unread?: boolean;
1618
+ isMember?: boolean;
1619
+ isNew?: boolean;
1620
+ isTemp?: boolean;
1621
+ creator?: string;
1622
+ }[]>;
122
1623
  conversationsLoaded: import("vue").Ref<boolean, boolean>;
123
- unreadConversations: import("vue").ComputedRef<ConversationEntry[]>;
124
- totalUnreadCount: import("vue").ComputedRef<any>;
1624
+ unreadConversations: import("vue").ComputedRef<{
1625
+ _id?: string;
1626
+ id?: string;
1627
+ name?: string;
1628
+ participants: (string | {
1629
+ id: string;
1630
+ prename?: string;
1631
+ lastname?: string;
1632
+ email?: string;
1633
+ name?: string;
1634
+ lastSeen?: string;
1635
+ online?: boolean;
1636
+ role?: "agent" | null;
1637
+ })[];
1638
+ blocked?: string[];
1639
+ messagesCount?: number;
1640
+ messagesCountSystem?: number;
1641
+ createdAt?: string;
1642
+ lastActivity?: string;
1643
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1644
+ supportStatus?: SupportStatus;
1645
+ supportStatusUpdatedAt?: string;
1646
+ supportStatusVersion?: number;
1647
+ sla?: {
1648
+ conversation: string;
1649
+ status: SupportStatus;
1650
+ statusVersion: number;
1651
+ startedAt: string;
1652
+ endAt: string;
1653
+ stoppedAt?: string;
1654
+ };
1655
+ participant?: {
1656
+ _id?: string;
1657
+ conversation: string;
1658
+ user: string;
1659
+ state: ParticipantState;
1660
+ rights: string[];
1661
+ lastReadId?: number;
1662
+ latestMessageId?: number;
1663
+ muted?: boolean;
1664
+ role?: "agent";
1665
+ joinedAt?: string;
1666
+ };
1667
+ participantDocs?: {
1668
+ _id?: string;
1669
+ conversation: string;
1670
+ user: string;
1671
+ state: ParticipantState;
1672
+ rights: string[];
1673
+ lastReadId?: number;
1674
+ latestMessageId?: number;
1675
+ muted?: boolean;
1676
+ role?: "agent";
1677
+ joinedAt?: string;
1678
+ }[];
1679
+ lastMessage?: {
1680
+ _id?: string;
1681
+ id: number;
1682
+ conversation: string;
1683
+ user?: string;
1684
+ message?: string;
1685
+ origin: "user" | "system";
1686
+ history: {
1687
+ created: string;
1688
+ updated?: string;
1689
+ };
1690
+ action?: string;
1691
+ actionData?: Record<string, unknown>;
1692
+ isUser?: boolean;
1693
+ };
1694
+ oldestMessageId?: number | null;
1695
+ messages?: {
1696
+ _id?: string;
1697
+ id: number;
1698
+ conversation: string;
1699
+ user?: string;
1700
+ message?: string;
1701
+ origin: "user" | "system";
1702
+ history: {
1703
+ created: string;
1704
+ updated?: string;
1705
+ };
1706
+ action?: string;
1707
+ actionData?: Record<string, unknown>;
1708
+ isUser?: boolean;
1709
+ }[];
1710
+ messagesLoaded?: boolean;
1711
+ unreadCount?: number;
1712
+ unread?: boolean;
1713
+ isMember?: boolean;
1714
+ isNew?: boolean;
1715
+ isTemp?: boolean;
1716
+ creator?: string;
1717
+ }[]>;
1718
+ totalUnreadCount: import("vue").ComputedRef<number>;
125
1719
  totalUnreadConversations: import("vue").ComputedRef<number>;
126
1720
  typing: import("vue").Ref<Record<string, string[]>, Record<string, string[]>>;
127
1721
  setTyping: (conversation: string, user: string, isTyping: boolean) => void;
128
- loadParticipants: (conversation: string) => Promise<any>;
129
- setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1722
+ loadParticipants: (conversation: string) => Promise<import("@/interfaces/ParticipantDocument").ParticipantDocument[]>;
1723
+ setRights: (conversation: string, user: string, rights: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
130
1724
  isMuted: (conversation: string) => boolean;
131
1725
  setMuted: (conversation: string, muted: boolean) => Promise<void>;
132
1726
  conversationMuted: (conversation: string, muted: boolean) => void;
133
- blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1727
+ updateSupportStatus: (conversation: string, status: SupportStatus | undefined, version: number | undefined, updatedAt: string | undefined, options?: {
1728
+ force?: boolean;
1729
+ sla?: Conversation["sla"];
1730
+ }) => boolean;
1731
+ blockUser: (conversation: string, user: string, block: boolean) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
134
1732
  updateParticipantRights: (conversation: string, user: string, rights: string[]) => void;
135
- create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
1733
+ create: (participants: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
136
1734
  createNew: (participants: string[], creator?: string, operationMode?: "chat" | "support") => string;
137
1735
  createConversation: () => string;
138
- startSupport: () => Promise<any>;
1736
+ startSupport: () => Promise<string>;
139
1737
  activateConversation: (conversationId: string) => Promise<void>;
140
- activeConversation: import("vue").Ref<any, any>;
141
- convertTempToConversation: (conversation: Record<string, any>) => void;
142
- getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<any>;
143
- addMessagesToConversation: (messages: Record<string, any>[], conversation: string) => void;
144
- getMessagesForConversation: (conversation: string) => any;
145
- updateLastMessage: (conversationId: string, message: Record<string, any>) => void;
1738
+ activeConversation: import("vue").Ref<{
1739
+ _id?: string;
1740
+ id?: string;
1741
+ name?: string;
1742
+ participants: (string | {
1743
+ id: string;
1744
+ prename?: string;
1745
+ lastname?: string;
1746
+ email?: string;
1747
+ name?: string;
1748
+ lastSeen?: string;
1749
+ online?: boolean;
1750
+ role?: "agent" | null;
1751
+ })[];
1752
+ blocked?: string[];
1753
+ messagesCount?: number;
1754
+ messagesCountSystem?: number;
1755
+ createdAt?: string;
1756
+ lastActivity?: string;
1757
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1758
+ supportStatus?: SupportStatus;
1759
+ supportStatusUpdatedAt?: string;
1760
+ supportStatusVersion?: number;
1761
+ sla?: {
1762
+ conversation: string;
1763
+ status: SupportStatus;
1764
+ statusVersion: number;
1765
+ startedAt: string;
1766
+ endAt: string;
1767
+ stoppedAt?: string;
1768
+ };
1769
+ participant?: {
1770
+ _id?: string;
1771
+ conversation: string;
1772
+ user: string;
1773
+ state: ParticipantState;
1774
+ rights: string[];
1775
+ lastReadId?: number;
1776
+ latestMessageId?: number;
1777
+ muted?: boolean;
1778
+ role?: "agent";
1779
+ joinedAt?: string;
1780
+ };
1781
+ participantDocs?: {
1782
+ _id?: string;
1783
+ conversation: string;
1784
+ user: string;
1785
+ state: ParticipantState;
1786
+ rights: string[];
1787
+ lastReadId?: number;
1788
+ latestMessageId?: number;
1789
+ muted?: boolean;
1790
+ role?: "agent";
1791
+ joinedAt?: string;
1792
+ }[];
1793
+ lastMessage?: {
1794
+ _id?: string;
1795
+ id: number;
1796
+ conversation: string;
1797
+ user?: string;
1798
+ message?: string;
1799
+ origin: "user" | "system";
1800
+ history: {
1801
+ created: string;
1802
+ updated?: string;
1803
+ };
1804
+ action?: string;
1805
+ actionData?: Record<string, unknown>;
1806
+ isUser?: boolean;
1807
+ };
1808
+ oldestMessageId?: number | null;
1809
+ messages?: {
1810
+ _id?: string;
1811
+ id: number;
1812
+ conversation: string;
1813
+ user?: string;
1814
+ message?: string;
1815
+ origin: "user" | "system";
1816
+ history: {
1817
+ created: string;
1818
+ updated?: string;
1819
+ };
1820
+ action?: string;
1821
+ actionData?: Record<string, unknown>;
1822
+ isUser?: boolean;
1823
+ }[];
1824
+ messagesLoaded?: boolean;
1825
+ unreadCount?: number;
1826
+ unread?: boolean;
1827
+ isMember?: boolean;
1828
+ isNew?: boolean;
1829
+ isTemp?: boolean;
1830
+ creator?: string;
1831
+ }, Conversation | {
1832
+ _id?: string;
1833
+ id?: string;
1834
+ name?: string;
1835
+ participants: (string | {
1836
+ id: string;
1837
+ prename?: string;
1838
+ lastname?: string;
1839
+ email?: string;
1840
+ name?: string;
1841
+ lastSeen?: string;
1842
+ online?: boolean;
1843
+ role?: "agent" | null;
1844
+ })[];
1845
+ blocked?: string[];
1846
+ messagesCount?: number;
1847
+ messagesCountSystem?: number;
1848
+ createdAt?: string;
1849
+ lastActivity?: string;
1850
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1851
+ supportStatus?: SupportStatus;
1852
+ supportStatusUpdatedAt?: string;
1853
+ supportStatusVersion?: number;
1854
+ sla?: {
1855
+ conversation: string;
1856
+ status: SupportStatus;
1857
+ statusVersion: number;
1858
+ startedAt: string;
1859
+ endAt: string;
1860
+ stoppedAt?: string;
1861
+ };
1862
+ participant?: {
1863
+ _id?: string;
1864
+ conversation: string;
1865
+ user: string;
1866
+ state: ParticipantState;
1867
+ rights: string[];
1868
+ lastReadId?: number;
1869
+ latestMessageId?: number;
1870
+ muted?: boolean;
1871
+ role?: "agent";
1872
+ joinedAt?: string;
1873
+ };
1874
+ participantDocs?: {
1875
+ _id?: string;
1876
+ conversation: string;
1877
+ user: string;
1878
+ state: ParticipantState;
1879
+ rights: string[];
1880
+ lastReadId?: number;
1881
+ latestMessageId?: number;
1882
+ muted?: boolean;
1883
+ role?: "agent";
1884
+ joinedAt?: string;
1885
+ }[];
1886
+ lastMessage?: {
1887
+ _id?: string;
1888
+ id: number;
1889
+ conversation: string;
1890
+ user?: string;
1891
+ message?: string;
1892
+ origin: "user" | "system";
1893
+ history: {
1894
+ created: string;
1895
+ updated?: string;
1896
+ };
1897
+ action?: string;
1898
+ actionData?: Record<string, unknown>;
1899
+ isUser?: boolean;
1900
+ };
1901
+ oldestMessageId?: number | null;
1902
+ messages?: {
1903
+ _id?: string;
1904
+ id: number;
1905
+ conversation: string;
1906
+ user?: string;
1907
+ message?: string;
1908
+ origin: "user" | "system";
1909
+ history: {
1910
+ created: string;
1911
+ updated?: string;
1912
+ };
1913
+ action?: string;
1914
+ actionData?: Record<string, unknown>;
1915
+ isUser?: boolean;
1916
+ }[];
1917
+ messagesLoaded?: boolean;
1918
+ unreadCount?: number;
1919
+ unread?: boolean;
1920
+ isMember?: boolean;
1921
+ isNew?: boolean;
1922
+ isTemp?: boolean;
1923
+ creator?: string;
1924
+ }>;
1925
+ convertTempToConversation: (conversation: ConversationPayload) => void;
1926
+ getMessagesFromApi: (conversation: string, beforeId?: number) => Promise<Message[]>;
1927
+ addMessagesToConversation: (messages: Message[], conversation: string) => void;
1928
+ getMessagesForConversation: (conversation: string) => Message[];
1929
+ updateLastMessage: (conversationId: string, message: Message) => void;
146
1930
  updateUnread: (conversation: string) => void;
147
1931
  updateAllUnread: () => void;
148
1932
  increaseMessageCount: (conversation: string) => void;
149
1933
  increaseMessageCountSystem: (conversation: string) => void;
150
1934
  setLastReadId: (conversation: string, lastReadId: number) => void;
151
- getConversation: (conversation: string) => ConversationEntry;
1935
+ getConversation: (conversation: string | undefined) => ConversationEntry | undefined;
152
1936
  addParticipant: (conversation: string, participant: string) => void;
153
1937
  removeParticipant: (conversation: string, participant: string) => void;
154
- setParticipants: (conversation: string, participants: string[]) => void;
1938
+ setParticipants: (conversation: string, participants: Participant[]) => void;
155
1939
  toggleParticipant: (conversation: string, participant: string) => void;
156
- getConversationViaParticipantsAndName: (participants: Participant[], name: string, options?: {
1940
+ getConversationViaParticipantsAndName: (participants: Participant[], name?: string, options?: {
157
1941
  excludeTemp?: boolean;
158
1942
  exclude?: string[];
159
- }) => ConversationEntry;
1943
+ }) => {
1944
+ _id?: string;
1945
+ id?: string;
1946
+ name?: string;
1947
+ participants: (string | {
1948
+ id: string;
1949
+ prename?: string;
1950
+ lastname?: string;
1951
+ email?: string;
1952
+ name?: string;
1953
+ lastSeen?: string;
1954
+ online?: boolean;
1955
+ role?: "agent" | null;
1956
+ })[];
1957
+ blocked?: string[];
1958
+ messagesCount?: number;
1959
+ messagesCountSystem?: number;
1960
+ createdAt?: string;
1961
+ lastActivity?: string;
1962
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
1963
+ supportStatus?: SupportStatus;
1964
+ supportStatusUpdatedAt?: string;
1965
+ supportStatusVersion?: number;
1966
+ sla?: {
1967
+ conversation: string;
1968
+ status: SupportStatus;
1969
+ statusVersion: number;
1970
+ startedAt: string;
1971
+ endAt: string;
1972
+ stoppedAt?: string;
1973
+ };
1974
+ participant?: {
1975
+ _id?: string;
1976
+ conversation: string;
1977
+ user: string;
1978
+ state: ParticipantState;
1979
+ rights: string[];
1980
+ lastReadId?: number;
1981
+ latestMessageId?: number;
1982
+ muted?: boolean;
1983
+ role?: "agent";
1984
+ joinedAt?: string;
1985
+ };
1986
+ participantDocs?: {
1987
+ _id?: string;
1988
+ conversation: string;
1989
+ user: string;
1990
+ state: ParticipantState;
1991
+ rights: string[];
1992
+ lastReadId?: number;
1993
+ latestMessageId?: number;
1994
+ muted?: boolean;
1995
+ role?: "agent";
1996
+ joinedAt?: string;
1997
+ }[];
1998
+ lastMessage?: {
1999
+ _id?: string;
2000
+ id: number;
2001
+ conversation: string;
2002
+ user?: string;
2003
+ message?: string;
2004
+ origin: "user" | "system";
2005
+ history: {
2006
+ created: string;
2007
+ updated?: string;
2008
+ };
2009
+ action?: string;
2010
+ actionData?: Record<string, unknown>;
2011
+ isUser?: boolean;
2012
+ };
2013
+ oldestMessageId?: number | null;
2014
+ messages?: {
2015
+ _id?: string;
2016
+ id: number;
2017
+ conversation: string;
2018
+ user?: string;
2019
+ message?: string;
2020
+ origin: "user" | "system";
2021
+ history: {
2022
+ created: string;
2023
+ updated?: string;
2024
+ };
2025
+ action?: string;
2026
+ actionData?: Record<string, unknown>;
2027
+ isUser?: boolean;
2028
+ }[];
2029
+ messagesLoaded?: boolean;
2030
+ unreadCount?: number;
2031
+ unread?: boolean;
2032
+ isMember?: boolean;
2033
+ isNew?: boolean;
2034
+ isTemp?: boolean;
2035
+ creator?: string;
2036
+ };
160
2037
  cleanConversations: () => void;
161
2038
  abandonConversation: (conversation: string) => void;
162
2039
  inactivateConversation: () => void;
163
- rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<any>>;
2040
+ rename: (conversation: string, newName: string) => Promise<void | import("@/libs/StudioSDK").SDKResponse<unknown>>;
164
2041
  conversationRenamed: (conversation: string, newName: string) => void;
165
- executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
166
- updateConversationParticipant: (conversation: string, state: string) => void;
167
- leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
2042
+ executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
2043
+ updateConversationParticipant: (conversation: string, state: ParticipantState) => void;
2044
+ leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<unknown>>;
168
2045
  deleteConversation: (conversation: string) => Promise<void>;
169
- lastActiveConversation: import("vue").Ref<any, any>;
170
- getLatestConversation: () => ConversationEntry;
2046
+ lastActiveConversation: import("vue").Ref<string, string>;
2047
+ getLatestConversation: () => {
2048
+ _id?: string;
2049
+ id?: string;
2050
+ name?: string;
2051
+ participants: (string | {
2052
+ id: string;
2053
+ prename?: string;
2054
+ lastname?: string;
2055
+ email?: string;
2056
+ name?: string;
2057
+ lastSeen?: string;
2058
+ online?: boolean;
2059
+ role?: "agent" | null;
2060
+ })[];
2061
+ blocked?: string[];
2062
+ messagesCount?: number;
2063
+ messagesCountSystem?: number;
2064
+ createdAt?: string;
2065
+ lastActivity?: string;
2066
+ operationMode: import("@/interfaces/Conversation").ConversationOperationMode;
2067
+ supportStatus?: SupportStatus;
2068
+ supportStatusUpdatedAt?: string;
2069
+ supportStatusVersion?: number;
2070
+ sla?: {
2071
+ conversation: string;
2072
+ status: SupportStatus;
2073
+ statusVersion: number;
2074
+ startedAt: string;
2075
+ endAt: string;
2076
+ stoppedAt?: string;
2077
+ };
2078
+ participant?: {
2079
+ _id?: string;
2080
+ conversation: string;
2081
+ user: string;
2082
+ state: ParticipantState;
2083
+ rights: string[];
2084
+ lastReadId?: number;
2085
+ latestMessageId?: number;
2086
+ muted?: boolean;
2087
+ role?: "agent";
2088
+ joinedAt?: string;
2089
+ };
2090
+ participantDocs?: {
2091
+ _id?: string;
2092
+ conversation: string;
2093
+ user: string;
2094
+ state: ParticipantState;
2095
+ rights: string[];
2096
+ lastReadId?: number;
2097
+ latestMessageId?: number;
2098
+ muted?: boolean;
2099
+ role?: "agent";
2100
+ joinedAt?: string;
2101
+ }[];
2102
+ lastMessage?: {
2103
+ _id?: string;
2104
+ id: number;
2105
+ conversation: string;
2106
+ user?: string;
2107
+ message?: string;
2108
+ origin: "user" | "system";
2109
+ history: {
2110
+ created: string;
2111
+ updated?: string;
2112
+ };
2113
+ action?: string;
2114
+ actionData?: Record<string, unknown>;
2115
+ isUser?: boolean;
2116
+ };
2117
+ oldestMessageId?: number | null;
2118
+ messages?: {
2119
+ _id?: string;
2120
+ id: number;
2121
+ conversation: string;
2122
+ user?: string;
2123
+ message?: string;
2124
+ origin: "user" | "system";
2125
+ history: {
2126
+ created: string;
2127
+ updated?: string;
2128
+ };
2129
+ action?: string;
2130
+ actionData?: Record<string, unknown>;
2131
+ isUser?: boolean;
2132
+ }[];
2133
+ messagesLoaded?: boolean;
2134
+ unreadCount?: number;
2135
+ unread?: boolean;
2136
+ isMember?: boolean;
2137
+ isNew?: boolean;
2138
+ isTemp?: boolean;
2139
+ creator?: string;
2140
+ };
171
2141
  activateLastOrLatestConversation: () => void;
172
2142
  readLastActiveConversation: () => void;
173
- }, "leave" | "rename" | "getAllConversations" | "refreshConversations" | "handleReconnect" | "setTyping" | "loadParticipants" | "setRights" | "isMuted" | "setMuted" | "conversationMuted" | "blockUser" | "updateParticipantRights" | "create" | "createNew" | "createConversation" | "startSupport" | "activateConversation" | "convertTempToConversation" | "getMessagesFromApi" | "addMessagesToConversation" | "getMessagesForConversation" | "updateLastMessage" | "updateUnread" | "updateAllUnread" | "increaseMessageCount" | "increaseMessageCountSystem" | "setLastReadId" | "getConversation" | "addParticipant" | "removeParticipant" | "setParticipants" | "toggleParticipant" | "getConversationViaParticipantsAndName" | "cleanConversations" | "abandonConversation" | "inactivateConversation" | "conversationRenamed" | "executeParticipantsEdit" | "updateConversationParticipant" | "deleteConversation" | "getLatestConversation" | "activateLastOrLatestConversation" | "readLastActiveConversation">>;
2143
+ }, "leave" | "rename" | "getAllConversations" | "mergeConversations" | "refreshConversations" | "handleReconnect" | "setTyping" | "loadParticipants" | "setRights" | "isMuted" | "setMuted" | "conversationMuted" | "updateSupportStatus" | "blockUser" | "updateParticipantRights" | "create" | "createNew" | "createConversation" | "startSupport" | "activateConversation" | "convertTempToConversation" | "getMessagesFromApi" | "addMessagesToConversation" | "getMessagesForConversation" | "updateLastMessage" | "updateUnread" | "updateAllUnread" | "increaseMessageCount" | "increaseMessageCountSystem" | "setLastReadId" | "getConversation" | "addParticipant" | "removeParticipant" | "setParticipants" | "toggleParticipant" | "getConversationViaParticipantsAndName" | "cleanConversations" | "abandonConversation" | "inactivateConversation" | "conversationRenamed" | "executeParticipantsEdit" | "updateConversationParticipant" | "deleteConversation" | "getLatestConversation" | "activateLastOrLatestConversation" | "readLastActiveConversation">>;
174
2144
  export default useConversationsStore;