@trii/types 2.10.738 → 2.10.742

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,3 +1,4 @@
1
+ import { IEventType } from "../../Calendar/Event";
1
2
  import { IContactAddress } from "../../Contacts/contacts";
2
3
  import { UserInfo } from "../../Users/UserTrii";
3
4
  import { IChannelInfo } from "../Channels/Channel";
@@ -314,6 +315,41 @@ export interface MessagePollOption {
314
315
  name: string;
315
316
  localId: string;
316
317
  }
318
+ /**
319
+ * Evento de calendario compartido como mensaje (B22). Es un **snapshot** del evento al momento de
320
+ * compartirlo, no una referencia viva: la tarjeta se pinta sin pegarle al calendar API y sigue
321
+ * siendo legible si después el evento se edita o se borra. `eventId` es lo único que se resuelve
322
+ * contra el calendario (deep link y, a futuro, refrescar el snapshot).
323
+ *
324
+ * Compatibilidad: el emisor sigue mandando además el resumen en `text.body`, así que un cliente
325
+ * que no conozca este campo muestra el mensaje de texto de siempre.
326
+ *
327
+ * Espejo C#: Trii.Common.Messages.MessageEvent.
328
+ */
329
+ export interface MessageEvent {
330
+ /** `IEvent.id` en el calendario. */
331
+ eventId: string;
332
+ title: string;
333
+ /**ISO8601 timestamp */
334
+ startAt: Date;
335
+ /**ISO8601 timestamp */
336
+ endAt: Date;
337
+ allDay: boolean;
338
+ location?: string;
339
+ details?: string;
340
+ /** Color del evento (`IEvent.color`), para que la tarjeta use el mismo del calendario. */
341
+ color?: string;
342
+ /** Tipo de evento (`IEvent.eventType`): nombre, color e ícono. Snapshot, como el resto. */
343
+ eventType?: IEventType;
344
+ /**
345
+ * Sólo en eventos recurrentes: la ocurrencia que se compartió
346
+ * (`IEvent.originalOccurrenceDate`). `eventId` identifica la serie, así que sin esto el deep
347
+ * link abre la serie y no el día compartido.
348
+ */
349
+ originalOccurrenceDate?: Date;
350
+ /** Deep link al evento (`/a/calendar/Calendar?eventId=`). El front lo recalcula si falta. */
351
+ link?: string;
352
+ }
317
353
  /** Un voto de un usuario a una opción de la encuesta (B13). Espejo C#: Trii.Common.Messages.MessagePollVote. */
318
354
  export interface MessagePollVote {
319
355
  /** `MessagePollOption.localId` de la opción votada. */
@@ -437,6 +473,11 @@ export interface IMessage {
437
473
  buttons?: MessageButton[];
438
474
  poll?: MessagePoll;
439
475
  note?: MessageNote;
476
+ /**
477
+ * Evento de calendario compartido en el chat (B22). Snapshot; el resumen legible sigue
478
+ * viajando en `text.body` para los clientes que no conocen el campo.
479
+ */
480
+ event?: MessageEvent;
440
481
  reactions?: MessageReaction[];
441
482
  messageReference?: MessageReference;
442
483
  comment?: CommentData;
@@ -19,6 +19,8 @@ export interface Post {
19
19
  participants: UserInfo[];
20
20
  archived: boolean;
21
21
  assignment: ConversationAssignmentSnapshot;
22
+ /** Concurrencia optimista + idempotencia de comandos, igual que Conversation.version. */
23
+ version: number;
22
24
  createdAt: Date;
23
25
  updatedAt: Date;
24
26
  }
@@ -32,6 +32,7 @@ export interface ITicketFilter {
32
32
  assigneeIds?: string[];
33
33
  assignedGroupIds?: string[];
34
34
  categoryIds?: string[];
35
+ requestTypeIds?: string[];
35
36
  tagIds?: string[];
36
37
  createdFrom?: Date;
37
38
  createdTo?: Date;
@@ -1,13 +1,30 @@
1
1
  import type { ITicketAuditedEntity } from "./Common";
2
+ import type { TicketMessageActorType } from "./Conversation";
3
+ /**
4
+ * The four actor fields exist because ITicketAuditedEntity.createdBy is a
5
+ * single uuid-shaped string, which a contact cannot occupy. They follow the
6
+ * same pairing rule as ITicketActivity: AGENT is identified by createdBy /
7
+ * updatedBy, CONTACT, BOT and EXTERNAL_COLLABORATOR by the *ExternalId field,
8
+ * and SYSTEM by neither.
9
+ */
2
10
  export interface ITicketNote extends ITicketAuditedEntity {
3
11
  ticketId: string;
4
12
  text: string;
5
13
  version: number;
14
+ isPublic: boolean;
15
+ createdByType?: TicketMessageActorType;
16
+ createdByExternalId?: string;
17
+ updatedByType?: TicketMessageActorType;
18
+ updatedByExternalId?: string;
6
19
  }
7
20
  export interface CreateTicketNoteDto {
8
21
  text: string;
22
+ /** Defaults to false. */
23
+ isPublic?: boolean;
9
24
  }
25
+ /** At least one of `text` / `isPublic` must be present. */
10
26
  export interface UpdateTicketNoteDto {
11
27
  expectedVersion: number;
12
- text: string;
28
+ text?: string;
29
+ isPublic?: boolean;
13
30
  }
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  // ---------------------------------------------------------------------------
3
- // Ticket internal notes.
3
+ // Ticket notes.
4
4
  //
5
- // Free-text internal annotations attached to a ticket, distinct from public
6
- // replies and from the conversation timeline. Optimistic concurrency via
7
- // version + expectedVersion on update, same pattern as the rest of the
8
- // module.
5
+ // Free-text annotations attached to a ticket. A note is either internal or
6
+ // public, and `isPublic` governs which: internal notes stay on the agent side,
7
+ // public notes are the customer-visible reply channel while Conversations is
8
+ // not wired to the public portal surface.
9
+ //
10
+ // Optimistic concurrency via version + expectedVersion on update, same pattern
11
+ // as the rest of the module.
9
12
  // ---------------------------------------------------------------------------
10
13
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  import { ChannelType } from "../Common/Channels/ChannelType";
2
2
  import { ITicketAuditedEntity, ITicketProperty, TicketPriority } from "./Common";
3
3
  import { ITicketMessageReference } from "./Conversation";
4
+ import type { ITicketCursorResponse } from "./Api";
4
5
  export declare enum TicketPortalAuthenticationMode {
5
6
  PUBLIC = "PUBLIC",
6
7
  OPTIONAL = "OPTIONAL",
@@ -63,6 +64,7 @@ export interface ITicketPortal extends ITicketAuditedEntity {
63
64
  allowComments: boolean;
64
65
  allowReopen: boolean;
65
66
  allowCancellation: boolean;
67
+ allowAttachments: boolean;
66
68
  termsDocumentId?: string;
67
69
  privacyDocumentId?: string;
68
70
  enabled: boolean;
@@ -83,6 +85,7 @@ export interface ICreateTicketPortalDto {
83
85
  allowComments?: boolean;
84
86
  allowReopen?: boolean;
85
87
  allowCancellation?: boolean;
88
+ allowAttachments?: boolean;
86
89
  termsDocumentId?: string;
87
90
  privacyDocumentId?: string;
88
91
  enabled?: boolean;
@@ -103,6 +106,7 @@ export interface IUpdateTicketPortalDto {
103
106
  allowComments?: boolean;
104
107
  allowReopen?: boolean;
105
108
  allowCancellation?: boolean;
109
+ allowAttachments?: boolean;
106
110
  termsDocumentId?: string | null;
107
111
  privacyDocumentId?: string | null;
108
112
  enabled?: boolean;
@@ -118,6 +122,11 @@ export interface ITicketRequestType extends ITicketAuditedEntity {
118
122
  defaultPriority?: TicketPriority;
119
123
  defaultAssignedGroupId?: string;
120
124
  slaPolicyId?: string;
125
+ /**
126
+ * @deprecated Never used. Public status resolution is space-level, not per
127
+ * request type - see the public portal surface. Always undefined; will be
128
+ * removed in a later release.
129
+ */
121
130
  publicStatusSchemeId?: string;
122
131
  fieldDefinitionIds?: string[];
123
132
  layoutIds?: string[];
@@ -135,7 +144,6 @@ export interface ICreateTicketRequestTypeDto {
135
144
  defaultPriority?: TicketPriority;
136
145
  defaultAssignedGroupId?: string;
137
146
  slaPolicyId?: string;
138
- publicStatusSchemeId?: string;
139
147
  fieldDefinitionIds?: string[];
140
148
  layoutIds?: string[];
141
149
  audiencePolicyId?: string;
@@ -152,7 +160,6 @@ export interface IUpdateTicketRequestTypeDto {
152
160
  defaultPriority?: TicketPriority | null;
153
161
  defaultAssignedGroupId?: string | null;
154
162
  slaPolicyId?: string | null;
155
- publicStatusSchemeId?: string | null;
156
163
  fieldDefinitionIds?: string[] | null;
157
164
  layoutIds?: string[] | null;
158
165
  audiencePolicyId?: string | null;
@@ -306,23 +313,87 @@ export interface ITicketPublicStatusScheme extends ITicketAuditedEntity {
306
313
  defaultPublicStatusId?: string;
307
314
  enabled: boolean;
308
315
  }
316
+ export interface ICreateTicketPublicStatusDto {
317
+ name: string;
318
+ description?: string;
319
+ color?: string;
320
+ icon?: string;
321
+ order: number;
322
+ }
323
+ export interface IUpdateTicketPublicStatusDto extends Partial<ICreateTicketPublicStatusDto> {
324
+ }
325
+ export interface ICreateTicketPublicStatusSchemeDto {
326
+ name: string;
327
+ description?: string;
328
+ defaultPublicStatusId?: string;
329
+ enabled?: boolean;
330
+ }
331
+ export interface IUpdateTicketPublicStatusSchemeDto extends Partial<ICreateTicketPublicStatusSchemeDto> {
332
+ }
333
+ /**
334
+ * `schemeId` is absent on purpose: mappings are a sub-resource of a scheme
335
+ * (`/public-status-schemes/:schemeId/mappings`), so the parent id comes from the
336
+ * path.
337
+ */
338
+ export interface ICreateTicketPublicStatusMappingDto {
339
+ publicStatusId: string;
340
+ internalStatusIds: string[];
341
+ }
342
+ export interface IUpdateTicketPublicStatusMappingDto extends Partial<ICreateTicketPublicStatusMappingDto> {
343
+ }
344
+ /** Customer-facing projection of ITicketPublicStatus: no audit or tenant fields. */
345
+ export interface ICustomerPublicStatusView {
346
+ id: string;
347
+ name: string;
348
+ description?: string;
349
+ color?: string;
350
+ icon?: string;
351
+ order: number;
352
+ }
309
353
  /** Safe customer projection; internal activity, notes, routing and SLA details are intentionally excluded. */
310
354
  export interface ICustomerTicketView {
311
355
  id: string;
312
356
  number: number;
313
357
  title: string;
314
358
  description?: string;
359
+ contactId: string;
315
360
  requestTypeId?: string;
316
361
  categoryId: string;
317
- publicStatus: ITicketPublicStatus;
362
+ publicStatus: ICustomerPublicStatusView;
318
363
  priority?: TicketPriority;
319
364
  publicProperties?: ITicketProperty[];
365
+ version: number;
320
366
  createdAt: Date;
321
367
  updatedAt?: Date;
322
368
  resolvedAt?: Date;
323
369
  messages?: ITicketMessageReference[];
324
370
  availableActions: TicketCustomerAction[];
325
371
  }
372
+ export interface ICustomerTicketFilter {
373
+ /** Mandatory. The surface never serves tickets across contacts. */
374
+ contactId: string;
375
+ search?: string;
376
+ publicStatusIds?: string[];
377
+ requestTypeIds?: string[];
378
+ categoryIds?: string[];
379
+ createdFrom?: Date;
380
+ createdTo?: Date;
381
+ }
382
+ export declare enum CustomerTicketSortField {
383
+ CREATED_AT = "CREATED_AT",
384
+ UPDATED_AT = "UPDATED_AT",
385
+ NUMBER = "NUMBER"
386
+ }
387
+ export interface ICustomerTicketQuery {
388
+ filter: ICustomerTicketFilter;
389
+ sort?: {
390
+ field: CustomerTicketSortField;
391
+ direction: 'ASC' | 'DESC';
392
+ }[];
393
+ cursor?: string;
394
+ limit?: number;
395
+ }
396
+ export type CustomerTicketPage = ITicketCursorResponse<ICustomerTicketView>;
326
397
  /** Reference only. Article content and lifecycle remain authoritative in Docs/Knowledge. */
327
398
  export interface ITicketKnowledgeReference extends ITicketAuditedEntity {
328
399
  referenceType: TicketKnowledgeReferenceType;
@@ -438,6 +509,7 @@ export interface ISubmitTicketRequestDto {
438
509
  idempotencyKey: string;
439
510
  }
440
511
  export interface ICustomerTicketActionDto {
512
+ expectedVersion: number;
441
513
  action: TicketCustomerAction;
442
514
  comment?: string;
443
515
  attachmentIds?: string[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TicketKnowledgeReferenceType = exports.TicketDeflectionOutcome = exports.TicketNotificationEvent = exports.TicketAudienceRuleEffect = exports.TicketCustomerAction = exports.TicketRequestDraftStatus = exports.TicketPortalAuthenticationMode = void 0;
3
+ exports.CustomerTicketSortField = exports.TicketKnowledgeReferenceType = exports.TicketDeflectionOutcome = exports.TicketNotificationEvent = exports.TicketAudienceRuleEffect = exports.TicketCustomerAction = exports.TicketRequestDraftStatus = exports.TicketPortalAuthenticationMode = void 0;
4
4
  var TicketPortalAuthenticationMode;
5
5
  (function (TicketPortalAuthenticationMode) {
6
6
  TicketPortalAuthenticationMode["PUBLIC"] = "PUBLIC";
@@ -54,3 +54,9 @@ var TicketKnowledgeReferenceType;
54
54
  TicketKnowledgeReferenceType["COLLECTION"] = "COLLECTION";
55
55
  TicketKnowledgeReferenceType["FOLDER"] = "FOLDER";
56
56
  })(TicketKnowledgeReferenceType || (exports.TicketKnowledgeReferenceType = TicketKnowledgeReferenceType = {}));
57
+ var CustomerTicketSortField;
58
+ (function (CustomerTicketSortField) {
59
+ CustomerTicketSortField["CREATED_AT"] = "CREATED_AT";
60
+ CustomerTicketSortField["UPDATED_AT"] = "UPDATED_AT";
61
+ CustomerTicketSortField["NUMBER"] = "NUMBER";
62
+ })(CustomerTicketSortField || (exports.CustomerTicketSortField = CustomerTicketSortField = {}));
@@ -1,6 +1,7 @@
1
1
  import { TicketApprovalStatus } from './Approval';
2
2
  import { TicketTaskStatus } from './Task';
3
3
  import { ITicketAuditedEntity, TicketPropertyValue, TicketStage } from "./Common";
4
+ import type { TicketMessageActorType } from "./Conversation";
4
5
  export interface ITicketStatus extends ITicketAuditedEntity {
5
6
  name: string;
6
7
  description?: string;
@@ -98,6 +99,21 @@ export interface ITicketFieldChange {
98
99
  previousValue?: TicketPropertyValue;
99
100
  newValue?: TicketPropertyValue;
100
101
  }
102
+ /**
103
+ * Actor identity is split in two columns and exactly one of them is populated:
104
+ *
105
+ * | actorType | Identity field | Notes |
106
+ * |-------------------------|---------------------|----------------------------------------|
107
+ * | AGENT | actorId (uuid) | an internal user |
108
+ * | CONTACT | actorExternalId | a Mongo ObjectId |
109
+ * | EXTERNAL_COLLABORATOR | actorExternalId | not produced yet |
110
+ * | BOT | actorExternalId | not produced yet |
111
+ * | SYSTEM | neither | schedulers, migrations, processor jobs |
112
+ *
113
+ * Both identity fields are absent for SYSTEM. Rows written before `actorType`
114
+ * existed have none, and must be read as AGENT when `actorId` is present and as
115
+ * SYSTEM when it is not.
116
+ */
101
117
  export interface ITicketActivity {
102
118
  id: string;
103
119
  spaceId: string;
@@ -105,6 +121,8 @@ export interface ITicketActivity {
105
121
  type: TicketActivityType;
106
122
  ticketEventType?: string;
107
123
  actorId?: string;
124
+ actorType?: TicketMessageActorType;
125
+ actorExternalId?: string;
108
126
  occurredAt: Date;
109
127
  comment?: string;
110
128
  attachmentIds?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.738",
3
+ "version": "2.10.742",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",