@trii/types 3.0.0-preview.1 → 3.0.0-preview.3
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/Common/Messages/EmailQueue.d.ts +53 -0
- package/dist/Common/Messages/EmailQueue.js +41 -0
- package/dist/Common/Messages/EmailUnsubscribe.d.ts +19 -0
- package/dist/Common/Messages/EmailUnsubscribe.js +61 -0
- package/dist/Common/Messages/Message.d.ts +213 -45
- package/dist/Common/Messages/Message.js +45 -1
- package/dist/Common/Messages/MessageIdentityIndex.d.ts +19 -0
- package/dist/Common/Messages/MessageModel.d.ts +72 -0
- package/dist/Common/Messages/MessageModel.js +56 -0
- package/dist/Common/Messages/SendOperation.d.ts +157 -0
- package/dist/Common/Messages/SendOperation.js +17 -0
- package/dist/Common/Messages/index.d.ts +5 -0
- package/dist/Common/Messages/index.js +5 -0
- package/dist/Common/Notifications/UserNotificationsConfig.d.ts +6 -0
- package/dist/Common/Notifications/UserNotificationsConfig.js +2 -0
- package/dist/Common/Variables.d.ts +22 -0
- package/dist/Common/Variables.js +7 -0
- package/dist/Common/index.d.ts +1 -0
- package/dist/Common/index.js +2 -1
- package/dist/Contacts/BusinessModel.d.ts +53 -0
- package/dist/Contacts/BusinessModel.js +10 -0
- package/dist/Contacts/ChannelIdentityModel.d.ts +116 -0
- package/dist/Contacts/ChannelIdentityModel.js +54 -0
- package/dist/Contacts/IdentityErrors.d.ts +42 -0
- package/dist/Contacts/IdentityErrors.js +10 -0
- package/dist/Contacts/IdentityEvents.d.ts +60 -0
- package/dist/Contacts/IdentityPolicyChange.d.ts +51 -0
- package/dist/Contacts/IdentityPolicyChange.js +12 -0
- package/dist/Contacts/Note.d.ts +24 -0
- package/dist/Contacts/Note.js +2 -0
- package/dist/Contacts/contacts.d.ts +96 -31
- package/dist/Contacts/contacts.js +2 -0
- package/dist/Contacts/index.d.ts +5 -0
- package/dist/Contacts/index.js +5 -0
- package/dist/Conversations/Conversation.d.ts +41 -4
- package/dist/Conversations/Conversation.js +5 -1
- package/dist/Conversations/ConversationAssociationEvents.d.ts +22 -0
- package/dist/Conversations/ConversationAssociationEvents.js +8 -0
- package/dist/Conversations/index.d.ts +1 -0
- package/dist/Conversations/index.js +1 -0
- package/dist/Marketing/Subscriber.d.ts +34 -2
- package/dist/Media/MediaApi.d.ts +51 -0
- package/dist/Media/MediaAsset.d.ts +162 -0
- package/dist/Media/MediaAsset.js +66 -0
- package/dist/Media/index.d.ts +2 -0
- package/dist/Media/index.js +18 -0
- package/dist/Spaces/WorkspaceSecurityPolicy.d.ts +10 -0
- package/dist/Spaces/index.d.ts +1 -0
- package/dist/Spaces/index.js +1 -0
- package/dist/Spaces/spaces.d.ts +14 -0
- package/dist/Tickets/Task.d.ts +11 -0
- package/dist/Tickets/Ticket.d.ts +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +4 -2
- package/dist/AI/MapPolygon.d.ts +0 -22
- package/dist/Conversations/ConversationAutoCloseSettings.d.ts +0 -17
- package/dist/Conversations/ConversationAutoCloseSettings.js +0 -5
- package/dist/Conversations/DashBoard/dashboardForms.d.ts +0 -44
- package/dist/Conversations/DashBoard/dashboardForms.js +0 -24
- package/dist/Conversations/Flows/Nodes/NodeAIChatBot.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeAIChatBot.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeApi.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeApi.js +0 -183
- package/dist/Conversations/Flows/Nodes/NodeBotIA.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeBotIA.js +0 -6
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeChatBotIA.js +0 -6
- package/dist/Conversations/Flows/Nodes/NodeConditional.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConditional.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactSearch.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactSearch.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactUpdate.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeContactUpdate.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationAssignTo.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationFinalize.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeConversationUpdate.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillForm.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillForm.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeFillTicket.d.ts +0 -1
- package/dist/Conversations/Flows/Nodes/NodeFillTicket.js +0 -9
- package/dist/Conversations/Flows/Nodes/NodeGoogleCalendar.d.ts +0 -20
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.d.ts +0 -12
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps copy.js +0 -6
- package/dist/Conversations/Flows/Nodes/NodeGoogleMaps.d.ts +0 -15
- package/dist/Conversations/Flows/Nodes/NodeMsgReply.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgReply.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgSend.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgSend.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgText.d.ts +0 -1
- package/dist/Conversations/Flows/Nodes/NodeMsgText.js +0 -27
- package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeMsgWaitResponse.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeRedirect.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeRedirect.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSendEmail.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSendEmail.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSqlQuery.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeSqlQuery.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeStart.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeStart.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeScheduleControl.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeTimer.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeTimer.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.d.ts +0 -0
- package/dist/Conversations/Flows/Nodes/NodeTimeWaitUntil.js +0 -0
- package/dist/Conversations/Flows/Nodes/NodeToolCalculator.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolCalculator.js +0 -37
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolContacts.js +0 -59
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolFunction.js +0 -45
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleCalendar.js +0 -87
- package/dist/Conversations/Flows/Nodes/NodeToolGoogleMaps.d.ts +0 -1
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolKnowledge.js +0 -52
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolMapsCheckPolygon.js +0 -59
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolMcpClient.js +0 -45
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.d.ts +0 -2
- package/dist/Conversations/Flows/Nodes/NodeToolShoppingCart.js +0 -81
- package/dist/Conversations/Flows/Nodes/index.d.ts +0 -24
- package/dist/Conversations/Flows/Nodes/index.js +0 -40
- package/dist/Conversations/InboxCounters.d.ts +0 -18
- package/dist/Conversations/InboxCounters.js +0 -2
- package/dist/Presence/ChannelRoutingState.d.ts +0 -17
- package/dist/Presence/ChannelRoutingState.js +0 -9
- package/dist/Tickets/AccessLevel.d.ts +0 -5
- package/dist/Tickets/AccessLevel.js +0 -9
- /package/dist/{AI/MapPolygon.js → Common/Messages/MessageIdentityIndex.js} +0 -0
- /package/dist/{Conversations/Flows/Nodes/NodeGoogleCalendar.js → Contacts/IdentityEvents.js} +0 -0
- /package/dist/{Conversations/Flows/Nodes/NodeGoogleMaps.js → Media/MediaApi.js} +0 -0
- /package/dist/{Conversations/Flows/Nodes/NodeToolGoogleMaps.js → Spaces/WorkspaceSecurityPolicy.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { MediaKind, MediaVariantKind, MediaVisibility } from './MediaAsset';
|
|
2
|
+
/** POST /api/v2/media/{spaceId}/uploads (MD4). */
|
|
3
|
+
export interface CreateMediaUploadRequest {
|
|
4
|
+
kind: MediaKind;
|
|
5
|
+
filename: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
/** Bytes declarados; al completar deben coincidir. */
|
|
8
|
+
size: number;
|
|
9
|
+
/** public solo para usos permitidos (MD9/Q02): webchat, signature, calls, forms y avatares. */
|
|
10
|
+
visibility: MediaVisibility;
|
|
11
|
+
/** messages, chat, contacts, users, marketing, forms, signature, webchat, calls. */
|
|
12
|
+
module: string;
|
|
13
|
+
/** Carpeta dentro del módulo; `avatars` en users/contacts/chat habilita public (Q02). */
|
|
14
|
+
folder?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateMediaUploadResponse {
|
|
17
|
+
mediaAssetId: string;
|
|
18
|
+
/** SAS de escritura de ese blob para el PUT directo a Azure; no se guarda. */
|
|
19
|
+
uploadUrl: string;
|
|
20
|
+
uploadExpiresAt: Date;
|
|
21
|
+
requiredHeaders: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
/** POST /api/v2/media/{spaceId}/access (MD2): URLs firmadas por archivo, en lote. No acepta URLs (§15.31 S4). */
|
|
24
|
+
export interface MediaAccessRequest {
|
|
25
|
+
mediaAssetIds: string[];
|
|
26
|
+
/** Imágenes remotas de emails por id (R02b); nunca por URL. */
|
|
27
|
+
remoteImages?: RemoteImageAccessRef[];
|
|
28
|
+
variant?: MediaVariantKind | null;
|
|
29
|
+
/** Forzar Content-Disposition: attachment. */
|
|
30
|
+
download: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type MediaAccessError = 'not_found' | 'forbidden' | 'not_ready' | 'rejected' | 'deleted' | 'variant_not_found';
|
|
33
|
+
/** Referencia a una imagen remota (R02b/R01): por el asset email_body que contiene el mapa, nunca por URL. */
|
|
34
|
+
export interface RemoteImageAccessRef {
|
|
35
|
+
/** Id del MediaAsset email_body (MessageEmail.body.id o SendOperationEmail.body.id). */
|
|
36
|
+
bodyAssetId: string;
|
|
37
|
+
remoteImageId: string;
|
|
38
|
+
}
|
|
39
|
+
export interface MediaAccessGrant {
|
|
40
|
+
/** Solo imágenes remotas (R02b/R01). */
|
|
41
|
+
bodyAssetId?: string;
|
|
42
|
+
remoteImageId?: string;
|
|
43
|
+
mediaAssetId?: string;
|
|
44
|
+
url?: string;
|
|
45
|
+
expiresAt?: Date;
|
|
46
|
+
error?: MediaAccessError;
|
|
47
|
+
}
|
|
48
|
+
export interface MediaAccessResponse {
|
|
49
|
+
/** Un elemento por pedido, en el mismo orden. */
|
|
50
|
+
items: MediaAccessGrant[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export declare const MEDIA_COLLECTIONS: {
|
|
2
|
+
readonly Database: "Media";
|
|
3
|
+
readonly MediaAssets: "MediaAssets";
|
|
4
|
+
/** Un documento por uso de un archivo (MD17b). */
|
|
5
|
+
readonly MediaReferences: "MediaReferences";
|
|
6
|
+
};
|
|
7
|
+
/** Imagen remota de un email (R02b/R01): id opaco = valor de data-trii-remote; url original http/https. Solo interna. */
|
|
8
|
+
export interface EmailRemoteImage {
|
|
9
|
+
id: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
12
|
+
/** Dirección del archivo respecto del espacio (MD17c). */
|
|
13
|
+
export type MediaDirection = 'inbound' | 'outbound';
|
|
14
|
+
/** Dónde se usa un archivo (MD17b). */
|
|
15
|
+
export type MediaReferenceTargetType = 'message' | 'template' | 'email' | 'post' | 'send_operation';
|
|
16
|
+
/**
|
|
17
|
+
* Uso de un MediaAsset (colección MediaReferences, MD17b): una fila por uso, sin tope. Las carpetas del explorador son
|
|
18
|
+
* virtuales (MD17a), derivadas de atributos del asset.
|
|
19
|
+
*/
|
|
20
|
+
export interface MediaReference {
|
|
21
|
+
id: string;
|
|
22
|
+
spaceId: string;
|
|
23
|
+
mediaAssetId: string;
|
|
24
|
+
targetType: MediaReferenceTargetType;
|
|
25
|
+
targetId: string;
|
|
26
|
+
conversationId?: string | null;
|
|
27
|
+
/** Identidad externa del uso (MD17-1). */
|
|
28
|
+
channelIdentityId?: string | null;
|
|
29
|
+
channelId?: string | null;
|
|
30
|
+
/** userId o system:<servicio>. */
|
|
31
|
+
createdBy: string;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
}
|
|
34
|
+
export type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'email_body' | 'email_raw';
|
|
35
|
+
/** pending_upload → scanning → ready | rejected; cualquiera → deleted. Solo ready se lee o envía (MD5). */
|
|
36
|
+
export type MediaAssetStatus = 'pending_upload' | 'scanning' | 'ready' | 'rejected' | 'deleted';
|
|
37
|
+
export type MediaRejectReason = 'too_large' | 'type_not_allowed' | 'type_mismatch' | 'size_mismatch' | 'malicious' | 'upload_expired';
|
|
38
|
+
/** MD9: private = acceso firmado corto; public = URL estable sin SAS. */
|
|
39
|
+
export type MediaVisibility = 'private' | 'public';
|
|
40
|
+
export type MediaSource = 'upload' | 'channel_inbound' | 'migration' | 'system';
|
|
41
|
+
export type MediaVariantKind = 'thumbnail' | 'poster' | 'transcoded';
|
|
42
|
+
/** Variante derivada (MD11). */
|
|
43
|
+
export interface MediaVariant {
|
|
44
|
+
kind: MediaVariantKind;
|
|
45
|
+
blobName: string;
|
|
46
|
+
mimeType: string;
|
|
47
|
+
size: number;
|
|
48
|
+
width?: number | null;
|
|
49
|
+
height?: number | null;
|
|
50
|
+
}
|
|
51
|
+
/** Documento interno de MediaAssets (MD1). Contenedor, blobName y legacyUrl no se exponen. */
|
|
52
|
+
export interface MediaAsset {
|
|
53
|
+
id: string;
|
|
54
|
+
spaceId: string;
|
|
55
|
+
kind: MediaKind;
|
|
56
|
+
visibility: MediaVisibility;
|
|
57
|
+
status: MediaAssetStatus;
|
|
58
|
+
rejectReason?: MediaRejectReason | null;
|
|
59
|
+
container: string;
|
|
60
|
+
/** Generado por el servidor; nunca el nombre del usuario sin sanitizar. */
|
|
61
|
+
blobName: string;
|
|
62
|
+
/** Tipo real detectado por magic bytes. */
|
|
63
|
+
mimeType: string;
|
|
64
|
+
declaredMimeType?: string | null;
|
|
65
|
+
filename: string;
|
|
66
|
+
size: number;
|
|
67
|
+
/** SHA-256 hexadecimal. */
|
|
68
|
+
sha256?: string | null;
|
|
69
|
+
width?: number | null;
|
|
70
|
+
height?: number | null;
|
|
71
|
+
durationMs?: number | null;
|
|
72
|
+
/** BlurHash (MD15); se copia al mensaje. */
|
|
73
|
+
blurhash?: string | null;
|
|
74
|
+
variants: MediaVariant[];
|
|
75
|
+
source: MediaSource;
|
|
76
|
+
/** Solo migration (MD7): trazabilidad; no se usa para resolver ni dar acceso (§15.31 S4). */
|
|
77
|
+
legacyUrl?: string | null;
|
|
78
|
+
/** Contexto de origen (MD17c); alimenta las carpetas virtuales. */
|
|
79
|
+
channelId?: string | null;
|
|
80
|
+
conversationId?: string | null;
|
|
81
|
+
/** Identidad externa de origen (MD17-1), no contactId. */
|
|
82
|
+
channelIdentityId?: string | null;
|
|
83
|
+
direction?: MediaDirection | null;
|
|
84
|
+
/** Búsqueda por prefijo (MD17c); internos. */
|
|
85
|
+
filenameNormalized?: string | null;
|
|
86
|
+
extension?: string | null;
|
|
87
|
+
/** Uso (MD17c), derivado de MediaReferences. */
|
|
88
|
+
referenceCount?: number;
|
|
89
|
+
lastReferencedAt?: Date | null;
|
|
90
|
+
/**
|
|
91
|
+
* Solo kind email_body (R02b, Codex 112 R01): mapa id → URL de imágenes remotas. INTERNO: para backends que leen el
|
|
92
|
+
* documento (proxy de trii-media-api); nunca se devuelve en JSON ni en MediaAssetDetail.
|
|
93
|
+
*/
|
|
94
|
+
remoteImages?: EmailRemoteImage[] | null;
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
/** userId o system:<servicio>. */
|
|
97
|
+
createdBy: string;
|
|
98
|
+
updatedAt: Date;
|
|
99
|
+
uploadExpiresAt?: Date | null;
|
|
100
|
+
scannedAt?: Date | null;
|
|
101
|
+
readyAt?: Date | null;
|
|
102
|
+
deletedAt?: Date | null;
|
|
103
|
+
deletedBy?: string | null;
|
|
104
|
+
/** deletedAt + retención (MD10). */
|
|
105
|
+
purgeAfter?: Date | null;
|
|
106
|
+
/** Q01, interno: blob temporal de la sesión de subida (`uploads/{id}`); null tras completar. */
|
|
107
|
+
uploadBlobName?: string | null;
|
|
108
|
+
/** Q01, interno: ETag de la copia final enviada a escanear; un resultado con otro ETag se ignora. */
|
|
109
|
+
scannedEtag?: string | null;
|
|
110
|
+
/** Q02/Q03b, interno: copia en el contenedor público (solo public y ready); null tras retirarla y confirmar la purga. */
|
|
111
|
+
publicBlobName?: string | null;
|
|
112
|
+
}
|
|
113
|
+
/** Proyección pública (respuesta de completar la subida y GET del asset). */
|
|
114
|
+
export interface MediaAssetDetail {
|
|
115
|
+
mediaAssetId: string;
|
|
116
|
+
kind: MediaKind;
|
|
117
|
+
visibility: MediaVisibility;
|
|
118
|
+
status: MediaAssetStatus;
|
|
119
|
+
rejectReason?: MediaRejectReason | null;
|
|
120
|
+
mimeType: string;
|
|
121
|
+
filename: string;
|
|
122
|
+
size: number;
|
|
123
|
+
sha256?: string | null;
|
|
124
|
+
width?: number | null;
|
|
125
|
+
height?: number | null;
|
|
126
|
+
durationMs?: number | null;
|
|
127
|
+
/** BlurHash (MD15); se copia al mensaje. */
|
|
128
|
+
blurhash?: string | null;
|
|
129
|
+
variantKinds: MediaVariantKind[];
|
|
130
|
+
createdAt: Date;
|
|
131
|
+
/** Contexto y uso (MD17-2). */
|
|
132
|
+
channelId?: string | null;
|
|
133
|
+
conversationId?: string | null;
|
|
134
|
+
channelIdentityId?: string | null;
|
|
135
|
+
direction?: MediaDirection | null;
|
|
136
|
+
referenceCount?: number;
|
|
137
|
+
lastReferencedAt?: Date | null;
|
|
138
|
+
}
|
|
139
|
+
/** Minúsculas, sin acentos, recortado (MD17c): igual que MediaFilenames.Normalize en C#. */
|
|
140
|
+
export declare function normalizeMediaFilename(filename: string | null | undefined): string;
|
|
141
|
+
/** Extensión en minúsculas sin punto ("pdf"); "" si no tiene. */
|
|
142
|
+
export declare function mediaFileExtension(filename: string | null | undefined): string;
|
|
143
|
+
/** Límites por categoría (MD12); el envío valida además el límite del proveedor. */
|
|
144
|
+
export declare const MEDIA_LIMITS: {
|
|
145
|
+
readonly defaultMaxBytes: Readonly<Record<MediaKind, number>>;
|
|
146
|
+
/** document acepta cualquier tipo no bloqueado. */
|
|
147
|
+
readonly allowedMimeTypes: Readonly<Partial<Record<MediaKind, readonly string[]>>>;
|
|
148
|
+
readonly blockedExtensions: readonly string[];
|
|
149
|
+
/** Se muestran en línea (MD3); el resto con Content-Disposition: attachment. SVG/HTML nunca. */
|
|
150
|
+
readonly inlineSafeMimeTypes: readonly string[];
|
|
151
|
+
/** WhatsApp Cloud API. */
|
|
152
|
+
readonly whatsAppMaxBytes: Readonly<Partial<Record<MediaKind, number>>>;
|
|
153
|
+
};
|
|
154
|
+
export declare function isBlockedMediaFilename(filename: string): boolean;
|
|
155
|
+
export declare function isMediaMimeAllowed(kind: MediaKind, mimeType: string): boolean;
|
|
156
|
+
export declare function isInlineSafeMime(mimeType: string): boolean;
|
|
157
|
+
/** Vencimientos de las SAS en minutos (MD2, MD4, MD6). Nunca se guardan. */
|
|
158
|
+
export declare const MEDIA_SAS_LIFETIME_MINUTES: {
|
|
159
|
+
readonly read: 15;
|
|
160
|
+
readonly upload: 15;
|
|
161
|
+
readonly provider: 60;
|
|
162
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Archivos (plan §15.27). Un MediaAsset por archivo en la base Media de trii-media-api (MD1/MD8). Los mensajes guardan
|
|
4
|
+
* mediaAssetId y datos para mostrar, nunca una URL; la URL se pide firmada por archivo al leer (MD2) y se sirve desde un
|
|
5
|
+
* dominio separado de contenido de usuarios (MD3).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MEDIA_SAS_LIFETIME_MINUTES = exports.MEDIA_LIMITS = exports.MEDIA_COLLECTIONS = void 0;
|
|
9
|
+
exports.normalizeMediaFilename = normalizeMediaFilename;
|
|
10
|
+
exports.mediaFileExtension = mediaFileExtension;
|
|
11
|
+
exports.isBlockedMediaFilename = isBlockedMediaFilename;
|
|
12
|
+
exports.isMediaMimeAllowed = isMediaMimeAllowed;
|
|
13
|
+
exports.isInlineSafeMime = isInlineSafeMime;
|
|
14
|
+
exports.MEDIA_COLLECTIONS = {
|
|
15
|
+
Database: 'Media',
|
|
16
|
+
MediaAssets: 'MediaAssets',
|
|
17
|
+
/** Un documento por uso de un archivo (MD17b). */
|
|
18
|
+
MediaReferences: 'MediaReferences',
|
|
19
|
+
};
|
|
20
|
+
/** Minúsculas, sin acentos, recortado (MD17c): igual que MediaFilenames.Normalize en C#. */
|
|
21
|
+
function normalizeMediaFilename(filename) {
|
|
22
|
+
if (!filename || !filename.trim())
|
|
23
|
+
return '';
|
|
24
|
+
return filename.trim().normalize('NFD').replace(/\p{Mn}/gu, '').normalize('NFC').toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
/** Extensión en minúsculas sin punto ("pdf"); "" si no tiene. */
|
|
27
|
+
function mediaFileExtension(filename) {
|
|
28
|
+
const n = normalizeMediaFilename(filename);
|
|
29
|
+
const dot = n.lastIndexOf('.');
|
|
30
|
+
return dot > 0 && dot < n.length - 1 ? n.substring(dot + 1) : '';
|
|
31
|
+
}
|
|
32
|
+
const MB = 1024 * 1024;
|
|
33
|
+
/** Límites por categoría (MD12); el envío valida además el límite del proveedor. */
|
|
34
|
+
exports.MEDIA_LIMITS = {
|
|
35
|
+
defaultMaxBytes: { image: 16 * MB, sticker: 1 * MB, audio: 16 * MB, video: 64 * MB, document: 100 * MB, email_body: 50 * MB, email_raw: 200 * MB },
|
|
36
|
+
/** document acepta cualquier tipo no bloqueado. */
|
|
37
|
+
allowedMimeTypes: {
|
|
38
|
+
image: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
|
|
39
|
+
sticker: ['image/webp'],
|
|
40
|
+
audio: ['audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/amr', 'audio/webm', 'audio/wav'],
|
|
41
|
+
video: ['video/mp4', 'video/3gpp', 'video/webm', 'video/quicktime'],
|
|
42
|
+
email_body: ['application/json'],
|
|
43
|
+
email_raw: ['message/rfc822'],
|
|
44
|
+
},
|
|
45
|
+
blockedExtensions: ['.exe', '.bat', '.cmd', '.com', '.scr', '.pif', '.msi', '.msp', '.dll', '.cpl', '.msc', '.jar',
|
|
46
|
+
'.js', '.jse', '.vbs', '.vbe', '.wsf', '.wsh', '.hta', '.ps1', '.psm1', '.sh', '.lnk', '.reg'],
|
|
47
|
+
/** Se muestran en línea (MD3); el resto con Content-Disposition: attachment. SVG/HTML nunca. */
|
|
48
|
+
inlineSafeMimeTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif',
|
|
49
|
+
'audio/aac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/amr', 'audio/webm', 'audio/wav',
|
|
50
|
+
'video/mp4', 'video/3gpp', 'video/webm', 'video/quicktime', 'application/pdf'],
|
|
51
|
+
/** WhatsApp Cloud API. */
|
|
52
|
+
whatsAppMaxBytes: { image: 5 * MB, sticker: 500 * 1024, audio: 16 * MB, video: 16 * MB, document: 100 * MB },
|
|
53
|
+
};
|
|
54
|
+
function isBlockedMediaFilename(filename) {
|
|
55
|
+
const dot = filename.lastIndexOf('.');
|
|
56
|
+
return dot >= 0 && exports.MEDIA_LIMITS.blockedExtensions.includes(filename.slice(dot).toLowerCase());
|
|
57
|
+
}
|
|
58
|
+
function isMediaMimeAllowed(kind, mimeType) {
|
|
59
|
+
var _a;
|
|
60
|
+
return kind === 'document' || ((_a = exports.MEDIA_LIMITS.allowedMimeTypes[kind]) !== null && _a !== void 0 ? _a : []).includes(mimeType.toLowerCase());
|
|
61
|
+
}
|
|
62
|
+
function isInlineSafeMime(mimeType) {
|
|
63
|
+
return exports.MEDIA_LIMITS.inlineSafeMimeTypes.includes(mimeType.toLowerCase());
|
|
64
|
+
}
|
|
65
|
+
/** Vencimientos de las SAS en minutos (MD2, MD4, MD6). Nunca se guardan. */
|
|
66
|
+
exports.MEDIA_SAS_LIFETIME_MINUTES = { read: 15, upload: 15, provider: 60 };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./MediaAsset"), exports);
|
|
18
|
+
__exportStar(require("./MediaApi"), exports);
|
package/dist/Spaces/index.d.ts
CHANGED
package/dist/Spaces/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./spaces"), exports);
|
|
18
18
|
__exportStar(require("./Dashboard"), exports);
|
|
19
|
+
__exportStar(require("./WorkspaceSecurityPolicy"), exports);
|
package/dist/Spaces/spaces.d.ts
CHANGED
|
@@ -81,9 +81,23 @@ export interface ISpace {
|
|
|
81
81
|
contactNameFormat: nameFormat;
|
|
82
82
|
showItemsInDevelopment: boolean;
|
|
83
83
|
timeZone: string;
|
|
84
|
+
/** Modelo de identidades (K5). Ausente o 1 = legacy (ContactAddresses); 2 = ChannelIdentities. Solo lo escribe trii-admin. */
|
|
85
|
+
channelIdentityModelVersion?: number | null;
|
|
86
|
+
channelIdentityModelActivatedAt?: Date | null;
|
|
87
|
+
/** Ventana de mantenimiento en curso; ausente = sin mantenimiento. Distinta de la versión del modelo. */
|
|
88
|
+
maintenance?: ISpaceMaintenance | null;
|
|
89
|
+
/** País por defecto para normalizar teléfonos a E.164 (ISO 3166 alfa-2, p. ej. "AR"). */
|
|
90
|
+
phoneDefaultCountry?: string | null;
|
|
84
91
|
createdAt: Date;
|
|
85
92
|
deletedAt: Date;
|
|
86
93
|
}
|
|
94
|
+
export type SpaceMaintenanceReason = 'channel_identity_migration' | 'identity_policy_change';
|
|
95
|
+
/** Ventana de mantenimiento de un espacio (K5). Durante la ventana solo escriben los workers de trii-admin. */
|
|
96
|
+
export interface ISpaceMaintenance {
|
|
97
|
+
reason: SpaceMaintenanceReason;
|
|
98
|
+
startedAt: Date;
|
|
99
|
+
startedBy: string;
|
|
100
|
+
}
|
|
87
101
|
export declare enum nameFormat {
|
|
88
102
|
FIRST_LAST = 0,
|
|
89
103
|
LAST_FIRST = 1,
|
package/dist/Tickets/Task.d.ts
CHANGED
|
@@ -87,6 +87,16 @@ export interface ITicketTaskSummary {
|
|
|
87
87
|
overdue: number;
|
|
88
88
|
requiredIncomplete: number;
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Tasks of a ticket assigned to the REQUESTING user (per-request projection of ticket searches and GET /tickets/{id}).
|
|
92
|
+
* `pending` counts every task not COMPLETED nor CANCELLED; cancelled tasks are not counted.
|
|
93
|
+
* `overdue` is the part of `pending` whose `dueAt` already passed. Optional: older API versions do not send it.
|
|
94
|
+
*/
|
|
95
|
+
export interface ITicketAssignedTaskSummary {
|
|
96
|
+
pending: number;
|
|
97
|
+
completed: number;
|
|
98
|
+
overdue?: number;
|
|
99
|
+
}
|
|
90
100
|
export interface ICreateTicketTaskDto {
|
|
91
101
|
expectedTicketVersion: number;
|
|
92
102
|
parentTaskId?: string;
|
|
@@ -109,6 +119,7 @@ export interface IUpdateTicketTaskDto {
|
|
|
109
119
|
collaboratorGroupIds?: string[];
|
|
110
120
|
required?: boolean;
|
|
111
121
|
dueAt?: Date;
|
|
122
|
+
completionNote?: string;
|
|
112
123
|
}
|
|
113
124
|
export interface ICompleteTicketChecklistItemDto {
|
|
114
125
|
expectedTaskVersion: number;
|
package/dist/Tickets/Ticket.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ITicketFormSubmissionReference, TicketActivityType } from "./Workflow";
|
|
|
4
4
|
import { ITicketSlaState } from "./Sla";
|
|
5
5
|
import { ITicketSecurityState } from "./Security";
|
|
6
6
|
import { ITicketApprovalSummary } from "./Approval";
|
|
7
|
-
import { ITicketTaskSummary } from "./Task";
|
|
7
|
+
import { ITicketAssignedTaskSummary, ITicketTaskSummary } from "./Task";
|
|
8
8
|
import { ITicketConversationReference, TicketMessageActorType } from "./Conversation";
|
|
9
9
|
import { ITicketRoutingState } from "./Routing";
|
|
10
10
|
import { ITicketAISummary } from "./AI";
|
|
@@ -70,6 +70,11 @@ export interface ITicket {
|
|
|
70
70
|
security?: ITicketSecurityState;
|
|
71
71
|
approvalSummary?: ITicketApprovalSummary;
|
|
72
72
|
taskSummary?: ITicketTaskSummary;
|
|
73
|
+
/**
|
|
74
|
+
* Tasks assigned to the requesting user. Sent by searches and GET /tickets/{id} (zeros when the
|
|
75
|
+
* user has none); absent on mutation responses, where it means "unknown", not "none".
|
|
76
|
+
*/
|
|
77
|
+
assignedTaskSummary?: ITicketAssignedTaskSummary;
|
|
73
78
|
resolution?: ITicketResolution;
|
|
74
79
|
formSubmissions?: ITicketFormSubmissionReference[];
|
|
75
80
|
reopenedAt?: Date;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Marketing = exports.Automations = exports.Forms = exports.APIResponses = exports.Shop = exports.AI = exports.APIKeys = exports.Events = exports.EventsQueue = exports.ApiResponses = exports.Presence = exports.Users = exports.Collections = exports.Sales = exports.Tickets = exports.Releases = exports.Spaces = exports.Reports = exports.Security = exports.Calls = exports.Conversations = exports.Calendar = exports.Contacts = exports.Common = exports.AuditLogs = exports.Accounts = void 0;
|
|
36
|
+
exports.Media = exports.Marketing = exports.Automations = exports.Forms = exports.APIResponses = exports.Shop = exports.AI = exports.APIKeys = exports.Events = exports.EventsQueue = exports.ApiResponses = exports.Presence = exports.Users = exports.Collections = exports.Sales = exports.Tickets = exports.Releases = exports.Spaces = exports.Reports = exports.Security = exports.Calls = exports.Conversations = exports.Calendar = exports.Contacts = exports.Common = exports.AuditLogs = exports.Accounts = void 0;
|
|
37
37
|
exports.Accounts = __importStar(require("./Accounts/index"));
|
|
38
38
|
exports.AuditLogs = __importStar(require("./AuditLogs/index"));
|
|
39
39
|
exports.Common = __importStar(require("./Common/index"));
|
|
@@ -60,3 +60,4 @@ exports.APIResponses = __importStar(require("./ApiResponses/index"));
|
|
|
60
60
|
exports.Forms = __importStar(require("./Forms/index"));
|
|
61
61
|
exports.Automations = __importStar(require("./Automations/index"));
|
|
62
62
|
exports.Marketing = __importStar(require("./Marketing"));
|
|
63
|
+
exports.Media = __importStar(require("./Media/index"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trii/types",
|
|
3
|
-
"version": "3.0.0-preview.
|
|
3
|
+
"version": "3.0.0-preview.3",
|
|
4
4
|
"description": "Types definitions for Trii projects - ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,5 +8,7 @@
|
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
10
|
"author": "Trii LLC",
|
|
11
|
-
"license": "ISC"
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"scripts": { "build": "tsc -p .", "prepublishOnly": "npm run build" },
|
|
13
|
+
"devDependencies": { "typescript": "^5.7.2" }
|
|
12
14
|
}
|
package/dist/AI/MapPolygon.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface Map {
|
|
2
|
-
id?: string | null;
|
|
3
|
-
spaceId: string | "";
|
|
4
|
-
name: string | "";
|
|
5
|
-
description: string | "";
|
|
6
|
-
layers: MapLayer[];
|
|
7
|
-
createdAt: Date;
|
|
8
|
-
createdBy: string;
|
|
9
|
-
updatedAt?: Date | null;
|
|
10
|
-
updatedBy?: string | null;
|
|
11
|
-
deletedAt?: Date | null;
|
|
12
|
-
deletedBy?: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface MapLayer {
|
|
15
|
-
id?: string | null;
|
|
16
|
-
spaceId: string | "";
|
|
17
|
-
name: string | "";
|
|
18
|
-
fileName: string | "";
|
|
19
|
-
fileUrl: string | "";
|
|
20
|
-
data?: object | null;
|
|
21
|
-
polygons?: object | null;
|
|
22
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Largest whole-hour delay that fits in a signed 32-bit minute count. */
|
|
2
|
-
export declare const CONVERSATION_AUTO_CLOSE_MAX_DURATION_HOURS: number;
|
|
3
|
-
/** Current automatic closing settings for the space. */
|
|
4
|
-
export interface ConversationAutoCloseSettingsResponse {
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
/** Delay in elapsed hours for newly scheduled closures. */
|
|
7
|
-
durationHours: number;
|
|
8
|
-
/** ISO 8601 UTC start of the current activation, or null when disabled. */
|
|
9
|
-
activatedAt: string | null;
|
|
10
|
-
version: number;
|
|
11
|
-
}
|
|
12
|
-
/** Changes the policy using the settings revision last read by the caller. */
|
|
13
|
-
export interface SaveConversationAutoCloseSettingsRequest {
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
durationHours: number;
|
|
16
|
-
version: number;
|
|
17
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONVERSATION_AUTO_CLOSE_MAX_DURATION_HOURS = void 0;
|
|
4
|
-
/** Largest whole-hour delay that fits in a signed 32-bit minute count. */
|
|
5
|
-
exports.CONVERSATION_AUTO_CLOSE_MAX_DURATION_HOURS = Math.floor(2147483647 / 60);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { FormItemType } from "../../Common/Channels/Form";
|
|
2
|
-
export declare class DashBoardFormsSummaryInfo {
|
|
3
|
-
formId: string;
|
|
4
|
-
timeStart: Date;
|
|
5
|
-
timeEnd: Date;
|
|
6
|
-
completedForms: number;
|
|
7
|
-
records: DashBoardFormsQuestionSummary[];
|
|
8
|
-
}
|
|
9
|
-
export declare class DashBoardFormsQuestionSummary {
|
|
10
|
-
questionId: string;
|
|
11
|
-
question: string;
|
|
12
|
-
type: FormItemType;
|
|
13
|
-
count: number;
|
|
14
|
-
responses: DashBoardFormsResponseSummary[];
|
|
15
|
-
}
|
|
16
|
-
export declare class DashBoardFormsResponseSummary {
|
|
17
|
-
count: number;
|
|
18
|
-
responseTitle: string;
|
|
19
|
-
}
|
|
20
|
-
export declare class DashBoardFormsSubmittedFormsInfo {
|
|
21
|
-
formId: string;
|
|
22
|
-
timeStart: Date;
|
|
23
|
-
timeEnd: Date;
|
|
24
|
-
completedForms: number;
|
|
25
|
-
records: DashBoardFormsSubmittedFormRecord[];
|
|
26
|
-
}
|
|
27
|
-
export declare class DashBoardFormsSubmittedFormRecord {
|
|
28
|
-
id: string;
|
|
29
|
-
tags: FormTag[];
|
|
30
|
-
responses: DashBoardFormsSubmittedFormResponse[];
|
|
31
|
-
expireAt: Date;
|
|
32
|
-
createdAt: Date;
|
|
33
|
-
completedAt: Date;
|
|
34
|
-
}
|
|
35
|
-
export declare class DashBoardFormsSubmittedFormResponse {
|
|
36
|
-
questionId: string;
|
|
37
|
-
question: string;
|
|
38
|
-
type: FormItemType;
|
|
39
|
-
response: any;
|
|
40
|
-
}
|
|
41
|
-
export declare class FormTag {
|
|
42
|
-
name: string;
|
|
43
|
-
value: string;
|
|
44
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormTag = exports.DashBoardFormsSubmittedFormResponse = exports.DashBoardFormsSubmittedFormRecord = exports.DashBoardFormsSubmittedFormsInfo = exports.DashBoardFormsResponseSummary = exports.DashBoardFormsQuestionSummary = exports.DashBoardFormsSummaryInfo = void 0;
|
|
4
|
-
class DashBoardFormsSummaryInfo {
|
|
5
|
-
}
|
|
6
|
-
exports.DashBoardFormsSummaryInfo = DashBoardFormsSummaryInfo;
|
|
7
|
-
class DashBoardFormsQuestionSummary {
|
|
8
|
-
}
|
|
9
|
-
exports.DashBoardFormsQuestionSummary = DashBoardFormsQuestionSummary;
|
|
10
|
-
class DashBoardFormsResponseSummary {
|
|
11
|
-
}
|
|
12
|
-
exports.DashBoardFormsResponseSummary = DashBoardFormsResponseSummary;
|
|
13
|
-
class DashBoardFormsSubmittedFormsInfo {
|
|
14
|
-
}
|
|
15
|
-
exports.DashBoardFormsSubmittedFormsInfo = DashBoardFormsSubmittedFormsInfo;
|
|
16
|
-
class DashBoardFormsSubmittedFormRecord {
|
|
17
|
-
}
|
|
18
|
-
exports.DashBoardFormsSubmittedFormRecord = DashBoardFormsSubmittedFormRecord;
|
|
19
|
-
class DashBoardFormsSubmittedFormResponse {
|
|
20
|
-
}
|
|
21
|
-
exports.DashBoardFormsSubmittedFormResponse = DashBoardFormsSubmittedFormResponse;
|
|
22
|
-
class FormTag {
|
|
23
|
-
}
|
|
24
|
-
exports.FormTag = FormTag;
|
|
File without changes
|
|
File without changes
|