@trii/types 2.10.805 → 2.10.806
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.
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ISchedule } from "../Schedules/Schedules";
|
|
2
2
|
/** Operaciones que una API key de OpenMessaging puede ejecutar sobre su canal. */
|
|
3
3
|
export declare enum OpenMessagingPermission {
|
|
4
|
-
CAPABILITIES_READ = "capabilities:read",
|
|
5
4
|
THREADS_READ = "threads:read",
|
|
6
5
|
THREADS_WRITE = "threads:write",
|
|
7
6
|
MESSAGES_WRITE = "messages:write",
|
|
8
7
|
RECEIPTS_WRITE = "receipts:write",
|
|
9
8
|
ACTIVITIES_WRITE = "activities:write",
|
|
10
|
-
MEDIA_READ = "media:read"
|
|
11
|
-
MEDIA_WRITE = "media:write"
|
|
9
|
+
MEDIA_READ = "media:read"
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
12
|
* API key app → Trii. Solo se guarda el hash (SHA-256 hex) de la clave; la clave en claro
|
|
@@ -26,21 +24,13 @@ export interface OpenMessagingApiKey {
|
|
|
26
24
|
revokedAt?: Date | null;
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* La URL y el secreto de firma de los webhooks hacia la app son los generales del canal
|
|
28
|
+
* (Channel.webhookEnabled / webhookUrl / webhookSecret).
|
|
31
29
|
*/
|
|
32
|
-
export interface OpenMessagingSigningKey {
|
|
33
|
-
keyId: string;
|
|
34
|
-
secret: string;
|
|
35
|
-
createdAt: Date;
|
|
36
|
-
expiresAt?: Date | null;
|
|
37
|
-
}
|
|
38
30
|
export declare class OpenMessagingConfig {
|
|
39
|
-
/** URL HTTPS del backend externo que recibe los webhooks. */
|
|
40
|
-
webhookUrl?: string | null;
|
|
41
31
|
apiKeys: OpenMessagingApiKey[];
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
/** Opcional. Si está configurada, el canal la envía en el encabezado X-Api-Key de cada webhook a la app. */
|
|
33
|
+
webhookApiKey?: string | null;
|
|
44
34
|
reassign?: boolean;
|
|
45
35
|
reassignTime?: number;
|
|
46
36
|
reassignGroupId?: string;
|
|
@@ -4,19 +4,20 @@ exports.OpenMessagingConfig = exports.OpenMessagingPermission = void 0;
|
|
|
4
4
|
/** Operaciones que una API key de OpenMessaging puede ejecutar sobre su canal. */
|
|
5
5
|
var OpenMessagingPermission;
|
|
6
6
|
(function (OpenMessagingPermission) {
|
|
7
|
-
OpenMessagingPermission["CAPABILITIES_READ"] = "capabilities:read";
|
|
8
7
|
OpenMessagingPermission["THREADS_READ"] = "threads:read";
|
|
9
8
|
OpenMessagingPermission["THREADS_WRITE"] = "threads:write";
|
|
10
9
|
OpenMessagingPermission["MESSAGES_WRITE"] = "messages:write";
|
|
11
10
|
OpenMessagingPermission["RECEIPTS_WRITE"] = "receipts:write";
|
|
12
11
|
OpenMessagingPermission["ACTIVITIES_WRITE"] = "activities:write";
|
|
13
12
|
OpenMessagingPermission["MEDIA_READ"] = "media:read";
|
|
14
|
-
OpenMessagingPermission["MEDIA_WRITE"] = "media:write";
|
|
15
13
|
})(OpenMessagingPermission || (exports.OpenMessagingPermission = OpenMessagingPermission = {}));
|
|
14
|
+
/**
|
|
15
|
+
* La URL y el secreto de firma de los webhooks hacia la app son los generales del canal
|
|
16
|
+
* (Channel.webhookEnabled / webhookUrl / webhookSecret).
|
|
17
|
+
*/
|
|
16
18
|
class OpenMessagingConfig {
|
|
17
19
|
constructor() {
|
|
18
20
|
this.apiKeys = [];
|
|
19
|
-
this.signingKeys = [];
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
exports.OpenMessagingConfig = OpenMessagingConfig;
|
|
@@ -39,8 +39,10 @@ export interface IConversation {
|
|
|
39
39
|
direction: ConversationDirection;
|
|
40
40
|
remoteAddress: string;
|
|
41
41
|
remoteAddressId: string;
|
|
42
|
-
/** OpenMessaging: hilo externo
|
|
42
|
+
/** OpenMessaging: hilo externo de la conversación; cada hilo tiene una única conversación (1 a 1), que se reabre con un mensaje del hilo. */
|
|
43
43
|
externalThreadId?: string | null;
|
|
44
|
+
/** OpenMessaging: datos del hilo que mantiene channel-openmessaging. Null en los demás canales. */
|
|
45
|
+
openMessaging?: IConversationOpenMessaging | null;
|
|
44
46
|
channelInfo: Channels.IChannelInfo;
|
|
45
47
|
status: ConversationStatus;
|
|
46
48
|
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
@@ -113,6 +115,13 @@ export interface IConversation {
|
|
|
113
115
|
lastCommentId?: string | null;
|
|
114
116
|
}
|
|
115
117
|
export type InteractionKind = 'private' | 'wall_post' | 'comment' | 'mention';
|
|
118
|
+
/** Hilo de OpenMessaging. Lo escribe channel-openmessaging al crear la conversación. */
|
|
119
|
+
export interface IConversationOpenMessaging {
|
|
120
|
+
/** Usuario de la app dueño del hilo; no cambia. Es el contacto de la conversación. */
|
|
121
|
+
externalUserId: string;
|
|
122
|
+
/** Último pedido a message-processor de completar la conversación; se repite mientras siga sin contacto. */
|
|
123
|
+
completionRequestedAt?: Date | null;
|
|
124
|
+
}
|
|
116
125
|
export interface IWhatsAppGroupInfo {
|
|
117
126
|
whatsappGroupId: string;
|
|
118
127
|
groupInviteCode: string;
|