@trii/types 2.10.820 → 2.10.822
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.
- package/dist/Accounts/device.d.ts +4 -0
- package/dist/Common/EventsQueue/EventQueue.d.ts +23 -0
- package/dist/Common/Notifications/UserNotificationsConfig.d.ts +47 -12
- package/dist/Common/Notifications/UserNotificationsConfig.js +24 -1
- package/dist/Conversations/InboxQueries.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface IDevice {
|
|
2
2
|
id: string;
|
|
3
3
|
uid: string;
|
|
4
|
+
/** Generated once per client installation and reused when the push token changes. */
|
|
5
|
+
installationId?: string | null;
|
|
4
6
|
token: string;
|
|
5
7
|
type: DeviceType;
|
|
6
8
|
info: string;
|
|
@@ -9,6 +11,8 @@ export interface IDevice {
|
|
|
9
11
|
createdAt?: string | null;
|
|
10
12
|
updatedAt?: string | null;
|
|
11
13
|
}
|
|
14
|
+
/** Payload for device registration. Older clients may send only the token. */
|
|
15
|
+
export type DeviceRegistration = Pick<IDevice, 'token' | 'installationId'>;
|
|
12
16
|
export declare enum DeviceType {
|
|
13
17
|
MOBILE_ANDROID = 11,
|
|
14
18
|
MOBILE_IOS = 12,
|
|
@@ -4,6 +4,8 @@ export type EventQueue = {
|
|
|
4
4
|
/** Identificador estable generado una sola vez por el productor y conservado al
|
|
5
5
|
* persistir, publicar y reintentar el mismo hecho; permite deduplicar.
|
|
6
6
|
* Obligatorio para nuevos eventos durables; ausente/null en mensajes legacy.
|
|
7
|
+
* En avisos multicanal, copiar la identidad original a websocket y push antes de
|
|
8
|
+
* enviarlos. Dos transferencias de la misma conversación son hechos distintos.
|
|
7
9
|
* No generar automáticamente al deserializar o en cada intento de envío.
|
|
8
10
|
*/
|
|
9
11
|
eventId?: string | null;
|
|
@@ -29,3 +31,24 @@ export type EventQueue = {
|
|
|
29
31
|
websocketGroup: string;
|
|
30
32
|
sessionId: string;
|
|
31
33
|
};
|
|
34
|
+
/** Identidad de un aviso nuevo. Ambos canales conservan los valores del sobre original.
|
|
35
|
+
* La deduplicación de la presentación se limita al usuario e instalación actuales.
|
|
36
|
+
*/
|
|
37
|
+
export interface NotificationEventIdentity {
|
|
38
|
+
eventId: string;
|
|
39
|
+
spaceId: string;
|
|
40
|
+
}
|
|
41
|
+
/** Para avisos identificados, añadir la identidad al final de los argumentos originales
|
|
42
|
+
* de Socket.IO (args o [data]). Los avisos legacy mantienen su aridad original.
|
|
43
|
+
*/
|
|
44
|
+
export type SocketNotificationArgs<TArgs extends unknown[]> = [...TArgs, NotificationEventIdentity];
|
|
45
|
+
/** Datos de FCM para un aviso identificado. eventId y spaceId viajan al nivel de eventKey.
|
|
46
|
+
* El campo data contiene el payload de dominio serializado.
|
|
47
|
+
*/
|
|
48
|
+
export interface NotificationPushData extends NotificationEventIdentity {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
eventKey: string;
|
|
51
|
+
title: string;
|
|
52
|
+
body: string;
|
|
53
|
+
data: string;
|
|
54
|
+
}
|
|
@@ -1,33 +1,68 @@
|
|
|
1
|
+
import type { NotificationSound, NotificationVolumeLevel } from '../../Users/UserTrii';
|
|
1
2
|
export interface IUserNotificationsConfig {
|
|
2
3
|
id: string;
|
|
3
4
|
spaceId: string;
|
|
4
5
|
userId: string;
|
|
6
|
+
audio?: UserConfig_Audio | null;
|
|
7
|
+
pushDelivery?: UserConfig_PushDelivery | null;
|
|
5
8
|
conversations: UserConfig_Conversations;
|
|
6
9
|
chat: UserConfig_Chat;
|
|
7
10
|
calendar: UserConfig_Calendar;
|
|
8
11
|
tickets: UserConfig_Tickets;
|
|
9
12
|
}
|
|
10
13
|
export declare class UserConfig_Conversations {
|
|
11
|
-
newConversation:
|
|
12
|
-
transferIn:
|
|
13
|
-
newMessage:
|
|
14
|
-
responseTimeOut:
|
|
15
|
-
reminders:
|
|
14
|
+
newConversation: NotificationEventPreferences;
|
|
15
|
+
transferIn: NotificationEventPreferences;
|
|
16
|
+
newMessage: NotificationEventPreferences;
|
|
17
|
+
responseTimeOut: NotificationEventPreferences;
|
|
18
|
+
reminders: NotificationEventPreferences;
|
|
16
19
|
}
|
|
17
20
|
export declare class UserConfig_Chat {
|
|
18
|
-
|
|
21
|
+
newMessage?: NotificationEventPreferences | null;
|
|
22
|
+
reminders: NotificationEventPreferences;
|
|
19
23
|
}
|
|
20
24
|
export declare class UserConfig_Calendar {
|
|
21
|
-
eventReminder:
|
|
25
|
+
eventReminder: NotificationEventPreferences;
|
|
22
26
|
}
|
|
23
27
|
export declare class UserConfig_Tickets {
|
|
24
|
-
newTicketAssigned:
|
|
25
|
-
transferIn:
|
|
26
|
-
newContactMessage:
|
|
27
|
-
firstResponseTimeOut:
|
|
28
|
-
resolutionTimeOut:
|
|
28
|
+
newTicketAssigned: NotificationEventPreferences;
|
|
29
|
+
transferIn: NotificationEventPreferences;
|
|
30
|
+
newContactMessage: NotificationEventPreferences;
|
|
31
|
+
firstResponseTimeOut: NotificationEventPreferences;
|
|
32
|
+
resolutionTimeOut: NotificationEventPreferences;
|
|
29
33
|
}
|
|
34
|
+
export declare class NotificationEventPreferences {
|
|
35
|
+
email?: boolean | null;
|
|
36
|
+
push?: boolean | null;
|
|
37
|
+
/** For events supporting sound, missing or null inherits the default. 'none' silences the event. */
|
|
38
|
+
sound?: NotificationSound | null;
|
|
39
|
+
}
|
|
40
|
+
/** @deprecated Use NotificationEventPreferences for event preferences. */
|
|
30
41
|
export declare class UserConfig_SendTo {
|
|
31
42
|
email: boolean;
|
|
32
43
|
push: boolean;
|
|
33
44
|
}
|
|
45
|
+
export interface UserConfig_Audio {
|
|
46
|
+
volume?: NotificationVolumeLevel | null;
|
|
47
|
+
defaultSound?: NotificationSound | null;
|
|
48
|
+
}
|
|
49
|
+
export interface UserConfig_PushDelivery {
|
|
50
|
+
/** Applies to every enabled push event for this user in this space. Missing or empty excludes no installations. */
|
|
51
|
+
excludedInstallationIds?: string[] | null;
|
|
52
|
+
}
|
|
53
|
+
/** Options supported by each event, independent of saved preferences. */
|
|
54
|
+
export declare const notificationEventOptions: {
|
|
55
|
+
readonly 'conversations.newConversation': readonly ["email", "push"];
|
|
56
|
+
readonly 'conversations.transferIn': readonly ["email", "push", "sound"];
|
|
57
|
+
readonly 'conversations.newMessage': readonly ["email", "push", "sound"];
|
|
58
|
+
readonly 'conversations.responseTimeOut': readonly ["email", "push", "sound"];
|
|
59
|
+
readonly 'conversations.reminders': readonly ["email", "push"];
|
|
60
|
+
readonly 'chat.newMessage': readonly ["sound"];
|
|
61
|
+
readonly 'chat.reminders': readonly ["email", "push"];
|
|
62
|
+
readonly 'calendar.eventReminder': readonly ["email", "push"];
|
|
63
|
+
readonly 'tickets.newTicketAssigned': readonly ["email", "push"];
|
|
64
|
+
readonly 'tickets.transferIn': readonly ["email", "push"];
|
|
65
|
+
readonly 'tickets.newContactMessage': readonly ["email", "push"];
|
|
66
|
+
readonly 'tickets.firstResponseTimeOut': readonly ["email", "push"];
|
|
67
|
+
readonly 'tickets.resolutionTimeOut': readonly ["email", "push"];
|
|
68
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserConfig_SendTo = exports.UserConfig_Tickets = exports.UserConfig_Calendar = exports.UserConfig_Chat = exports.UserConfig_Conversations = void 0;
|
|
3
|
+
exports.notificationEventOptions = exports.UserConfig_SendTo = exports.NotificationEventPreferences = exports.UserConfig_Tickets = exports.UserConfig_Calendar = exports.UserConfig_Chat = exports.UserConfig_Conversations = void 0;
|
|
4
4
|
class UserConfig_Conversations {
|
|
5
5
|
}
|
|
6
6
|
exports.UserConfig_Conversations = UserConfig_Conversations;
|
|
@@ -13,6 +13,29 @@ exports.UserConfig_Calendar = UserConfig_Calendar;
|
|
|
13
13
|
class UserConfig_Tickets {
|
|
14
14
|
}
|
|
15
15
|
exports.UserConfig_Tickets = UserConfig_Tickets;
|
|
16
|
+
class NotificationEventPreferences {
|
|
17
|
+
}
|
|
18
|
+
exports.NotificationEventPreferences = NotificationEventPreferences;
|
|
19
|
+
/** @deprecated Use NotificationEventPreferences for event preferences. */
|
|
16
20
|
class UserConfig_SendTo {
|
|
17
21
|
}
|
|
18
22
|
exports.UserConfig_SendTo = UserConfig_SendTo;
|
|
23
|
+
const delivery = ['email', 'push'];
|
|
24
|
+
const all = ['email', 'push', 'sound'];
|
|
25
|
+
const sound = ['sound'];
|
|
26
|
+
/** Options supported by each event, independent of saved preferences. */
|
|
27
|
+
exports.notificationEventOptions = {
|
|
28
|
+
'conversations.newConversation': delivery,
|
|
29
|
+
'conversations.transferIn': all,
|
|
30
|
+
'conversations.newMessage': all,
|
|
31
|
+
'conversations.responseTimeOut': all,
|
|
32
|
+
'conversations.reminders': delivery,
|
|
33
|
+
'chat.newMessage': sound,
|
|
34
|
+
'chat.reminders': delivery,
|
|
35
|
+
'calendar.eventReminder': delivery,
|
|
36
|
+
'tickets.newTicketAssigned': delivery,
|
|
37
|
+
'tickets.transferIn': delivery,
|
|
38
|
+
'tickets.newContactMessage': delivery,
|
|
39
|
+
'tickets.firstResponseTimeOut': delivery,
|
|
40
|
+
'tickets.resolutionTimeOut': delivery,
|
|
41
|
+
};
|
|
@@ -101,6 +101,8 @@ export interface PersonalInboxItem {
|
|
|
101
101
|
requestedAt: string;
|
|
102
102
|
expiresAt?: string | null;
|
|
103
103
|
}) | null;
|
|
104
|
+
/** Whether the current user can receive the pending handoff to a queue. */
|
|
105
|
+
isIncomingQueueTransfer?: boolean;
|
|
104
106
|
interactionKind: InteractionKind;
|
|
105
107
|
participants: {
|
|
106
108
|
id: ID;
|