@trii/types 2.10.797 → 2.10.799

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.
@@ -320,6 +320,16 @@ export interface MessageButton {
320
320
  payload: string;
321
321
  type: MessageButtonType;
322
322
  }
323
+ export interface MessageButtonBehavior {
324
+ /** single: una única selección aceptada; multiple: permite más de una. */
325
+ selectionMode: "single" | "multiple";
326
+ /** hide_others conserva visibles las opciones seleccionadas; single las deshabilita. */
327
+ afterSelection: "keep" | "disable_selected" | "disable_all" | "hide_others";
328
+ }
329
+ export interface MessageButtonState {
330
+ /** Payloads seleccionados, únicos dentro del mensaje. Vacío: sin selección. */
331
+ selectedValues: string[];
332
+ }
323
333
  export declare enum MessageButtonType {
324
334
  TEXT = 0,
325
335
  URL = 1
@@ -511,6 +521,21 @@ export interface IMessage {
511
521
  ticket?: MessageTicket;
512
522
  email?: MessageEmail;
513
523
  buttons?: MessageButton[];
524
+ /**
525
+ * Comportamiento de los botones de respuesta en clientes controlados por Trii.
526
+ * Ausente: permite múltiples selecciones y mantiene los botones visibles.
527
+ * single impide nuevas selecciones después de la primera, cualquiera sea afterSelection.
528
+ * El servidor debe validar la política; no controla la interfaz de canales externos.
529
+ */
530
+ buttonBehavior?: MessageButtonBehavior;
531
+ /**
532
+ * Estado de selección de los botones de este mensaje entrante,
533
+ * según la aplicación que administra esta copia.
534
+ * Calculado por el servidor a partir de las respuestas aceptadas.
535
+ * Permite restaurar la interfaz sin cargar dichas respuestas.
536
+ * Ausente: estado no informado; no implica que no haya selección.
537
+ */
538
+ buttonState?: MessageButtonState;
514
539
  poll?: MessagePoll;
515
540
  note?: MessageNote;
516
541
  /**
@@ -519,7 +544,23 @@ export interface IMessage {
519
544
  */
520
545
  event?: MessageEvent;
521
546
  reactions?: MessageReaction[];
547
+ /**
548
+ * Recursos relacionados con este mensaje: mensajes respondidos,
549
+ * anuncios, publicaciones u otros objetos externos.
550
+ * Cada referencia indica la relación, el destino y, opcionalmente,
551
+ * una copia de su contenido para mostrarlo sin consultar el original.
552
+ * Reemplaza progresivamente a messageReference y tiene precedencia
553
+ * cuando ambos campos están presentes.
554
+ */
555
+ references?: MessageRelatedResource[];
522
556
  messageReference?: MessageReference;
557
+ /**
558
+ * Selección realizada por el usuario, como un botón o una opción de lista.
559
+ * Conserva el valor devuelto por el proveedor y el texto visible.
560
+ * actionId identifica la opción original cuando pudo resolverse.
561
+ * El mensaje de origen se vincula mediante references.
562
+ */
563
+ interaction?: MessageInteraction;
523
564
  comment?: CommentData;
524
565
  isLoaded: boolean;
525
566
  isHighlighted: boolean;
@@ -530,3 +571,30 @@ export interface IMessage {
530
571
  updatedAt?: Date;
531
572
  updatedBy?: UserInfo;
532
573
  }
574
+ export interface MessageInteraction {
575
+ type: "button_reply" | "list_reply";
576
+ value: string;
577
+ text: string;
578
+ actionId?: string;
579
+ }
580
+ export type MessageRelation = "reply_to" | "referral";
581
+ export interface MessageRelatedResource {
582
+ relation: MessageRelation;
583
+ target: {
584
+ type: "message" | "ad" | "post" | "story" | "reel" | "product";
585
+ provider: string;
586
+ channelId: string;
587
+ externalId?: string;
588
+ messageId?: string;
589
+ url?: string;
590
+ };
591
+ snapshot?: {
592
+ title?: string;
593
+ text?: string;
594
+ mediaUrl?: string;
595
+ mediaType?: string;
596
+ };
597
+ attribution?: {
598
+ clickId?: string;
599
+ };
600
+ }
@@ -1,5 +1,5 @@
1
1
  import { ITicket } from "./Ticket";
2
- import { TicketOrigin, TicketPriority, TicketPropertyValue, TicketStage } from "./Common";
2
+ import { TicketCreationMethod, TicketPriority, TicketPropertyValue, TicketStage } from "./Common";
3
3
  export interface ITicketCursorRequest {
4
4
  cursor?: string;
5
5
  limit?: number;
@@ -27,7 +27,7 @@ export interface ITicketFilter {
27
27
  stages?: TicketStage[];
28
28
  statusIds?: string[];
29
29
  priorities?: TicketPriority[];
30
- origins?: TicketOrigin[];
30
+ origins?: TicketCreationMethod[];
31
31
  contactIds?: string[];
32
32
  assigneeIds?: string[];
33
33
  assignedGroupIds?: string[];
@@ -12,17 +12,22 @@ export declare enum TicketPriority {
12
12
  HIGH = "HIGH",
13
13
  URGENT = "URGENT"
14
14
  }
15
- export declare enum TicketOrigin {
16
- MANUAL = "MANUAL",
17
- API = "API",
18
- IMPORT = "IMPORT",
19
- AUTOMATION = "AUTOMATION",
20
- CONVERSATION = "CONVERSATION",
21
- WEB_FORM = "WEB_FORM",
22
- SOCIAL_MEDIA = "SOCIAL_MEDIA",
23
- EMAIL = "EMAIL",
24
- PHONE = "PHONE",
25
- OTHER = "OTHER"
15
+ /**
16
+ * How a ticket was created (stored in ITicket.origin). The server sets it from
17
+ * the surface that creates the ticket; callers never choose it. The channel the
18
+ * request arrived through is a separate concern (channelType/channelId).
19
+ * - manual: an agent creates it from the CRM, including from a conversation.
20
+ * - self_service: the customer creates it from a portal or public form.
21
+ * - integration: an external system or message generates it.
22
+ * - automation: a rule, scheduled job or internal process creates it.
23
+ * - import: it comes in through a bulk load or migration.
24
+ */
25
+ export declare enum TicketCreationMethod {
26
+ Manual = "manual",
27
+ SelfService = "self_service",
28
+ Integration = "integration",
29
+ Automation = "automation",
30
+ Import = "import"
26
31
  }
27
32
  export declare enum TicketAccessLevel {
28
33
  ALL = "ALL",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TicketAccessLevel = exports.TicketOrigin = exports.TicketPriority = exports.TicketStage = void 0;
3
+ exports.TicketAccessLevel = exports.TicketCreationMethod = exports.TicketPriority = exports.TicketStage = void 0;
4
4
  var TicketStage;
5
5
  (function (TicketStage) {
6
6
  TicketStage["NEW"] = "NEW";
@@ -16,19 +16,24 @@ var TicketPriority;
16
16
  TicketPriority["HIGH"] = "HIGH";
17
17
  TicketPriority["URGENT"] = "URGENT";
18
18
  })(TicketPriority || (exports.TicketPriority = TicketPriority = {}));
19
- var TicketOrigin;
20
- (function (TicketOrigin) {
21
- TicketOrigin["MANUAL"] = "MANUAL";
22
- TicketOrigin["API"] = "API";
23
- TicketOrigin["IMPORT"] = "IMPORT";
24
- TicketOrigin["AUTOMATION"] = "AUTOMATION";
25
- TicketOrigin["CONVERSATION"] = "CONVERSATION";
26
- TicketOrigin["WEB_FORM"] = "WEB_FORM";
27
- TicketOrigin["SOCIAL_MEDIA"] = "SOCIAL_MEDIA";
28
- TicketOrigin["EMAIL"] = "EMAIL";
29
- TicketOrigin["PHONE"] = "PHONE";
30
- TicketOrigin["OTHER"] = "OTHER";
31
- })(TicketOrigin || (exports.TicketOrigin = TicketOrigin = {}));
19
+ /**
20
+ * How a ticket was created (stored in ITicket.origin). The server sets it from
21
+ * the surface that creates the ticket; callers never choose it. The channel the
22
+ * request arrived through is a separate concern (channelType/channelId).
23
+ * - manual: an agent creates it from the CRM, including from a conversation.
24
+ * - self_service: the customer creates it from a portal or public form.
25
+ * - integration: an external system or message generates it.
26
+ * - automation: a rule, scheduled job or internal process creates it.
27
+ * - import: it comes in through a bulk load or migration.
28
+ */
29
+ var TicketCreationMethod;
30
+ (function (TicketCreationMethod) {
31
+ TicketCreationMethod["Manual"] = "manual";
32
+ TicketCreationMethod["SelfService"] = "self_service";
33
+ TicketCreationMethod["Integration"] = "integration";
34
+ TicketCreationMethod["Automation"] = "automation";
35
+ TicketCreationMethod["Import"] = "import";
36
+ })(TicketCreationMethod || (exports.TicketCreationMethod = TicketCreationMethod = {}));
32
37
  var TicketAccessLevel;
33
38
  (function (TicketAccessLevel) {
34
39
  TicketAccessLevel["ALL"] = "ALL";
@@ -600,7 +600,7 @@ export interface ICreateCustomerTicketAttachmentDto {
600
600
  * channelId, primaryConversationId, assigneeId, assigneeName, assignedGroupId,
601
601
  * statusId, origin, tagIds or externalReferences. Routing, channel provenance
602
602
  * and the internal taxonomy are decisions of the agent side; the server fills
603
- * them in (origin WEB_FORM, the space's initial status, the routing defaults of
603
+ * them in (origin self_service, the space's initial status, the routing defaults of
604
604
  * the category and the request type).
605
605
  */
606
606
  export interface ICreateCustomerTicketDto {
@@ -1,5 +1,5 @@
1
1
  import { ChannelType } from "../Common/Channels/ChannelType";
2
- import { ITicketAttachment, ITicketContactProjection, ITicketExternalReference, ITicketProperty, ITicketTagInfo, TicketOrigin, TicketPriority, TicketStage } from "./Common";
2
+ import { ITicketAttachment, ITicketContactProjection, ITicketExternalReference, ITicketProperty, ITicketTagInfo, TicketCreationMethod, TicketPriority, TicketStage } from "./Common";
3
3
  import { ITicketFormSubmissionReference } from "./Workflow";
4
4
  import { ITicketSlaState } from "./Sla";
5
5
  import { ITicketSecurityState } from "./Security";
@@ -29,7 +29,7 @@ export interface ITicket {
29
29
  statusId: string;
30
30
  stage: TicketStage;
31
31
  priority: TicketPriority;
32
- origin: TicketOrigin;
32
+ origin: TicketCreationMethod;
33
33
  assigneeId?: string;
34
34
  assignedGroupId?: string;
35
35
  routing?: ITicketRoutingState;
@@ -78,7 +78,6 @@ export interface ICreateTicketDto {
78
78
  businessId?: string;
79
79
  statusId?: string;
80
80
  priority: TicketPriority;
81
- origin: TicketOrigin;
82
81
  assigneeId?: string;
83
82
  assignedGroupId?: string;
84
83
  dueAt?: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.797",
3
+ "version": "2.10.799",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",