@trii/types 2.10.737 → 2.10.740

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.
Files changed (111) hide show
  1. package/dist/Automations/Events/Event.d.ts +3 -3
  2. package/dist/Common/Messages/Message.d.ts +30 -0
  3. package/dist/Common/index.js +17 -7
  4. package/dist/Contacts/CommunicationEndpoint.d.ts +8 -8
  5. package/dist/Conversations/Classifications/ConversationClassificationEvents.d.ts +2 -2
  6. package/dist/Conversations/Conversation.d.ts +8 -8
  7. package/dist/Conversations/DashBoard/dashboardForms.d.ts +44 -0
  8. package/dist/Conversations/DashBoard/dashboardForms.js +24 -0
  9. package/dist/Conversations/InboxCounters.d.ts +18 -0
  10. package/dist/Conversations/InboxMongo.d.ts +12 -12
  11. package/dist/Conversations/Routing.d.ts +10 -10
  12. package/dist/Conversations/SocialWalls.d.ts +1 -0
  13. package/dist/Conversations/index.js +17 -7
  14. package/dist/Events/DomainEventTypes.d.ts +23 -23
  15. package/dist/Tickets/Api.d.ts +1 -0
  16. package/dist/Tickets/Notes.d.ts +18 -1
  17. package/dist/Tickets/Notes.js +8 -5
  18. package/dist/Tickets/SelfService.d.ts +75 -3
  19. package/dist/Tickets/SelfService.js +7 -1
  20. package/dist/Tickets/Workflow.d.ts +18 -0
  21. package/dist/index.js +17 -7
  22. package/dist/src/Common/Channels/Channel.d.ts +1 -28
  23. package/dist/src/Contacts/contacts.d.ts +2 -2
  24. package/dist/src/Conversations/Conversation.d.ts +48 -331
  25. package/dist/src/Conversations/Conversation.js +34 -14
  26. package/dist/src/Conversations/DashBoard/dashboard.d.ts +2 -2
  27. package/dist/src/Conversations/DashBoard/dashboardForms.d.ts +44 -0
  28. package/dist/src/Conversations/DashBoard/dashboardForms.js +24 -0
  29. package/dist/src/Conversations/Flows/Workflows/Workflow.d.ts +123 -280
  30. package/dist/src/Conversations/Flows/Workflows/Workflow.js +35 -85
  31. package/dist/src/Conversations/Groups/Group.d.ts +8 -2
  32. package/dist/src/Conversations/Groups/Group.js +6 -0
  33. package/dist/src/Conversations/Label.d.ts +1 -1
  34. package/dist/src/Conversations/WebHook.d.ts +1 -1
  35. package/dist/src/Conversations/index.d.ts +1 -9
  36. package/dist/src/Conversations/index.js +1 -9
  37. package/dist/src/Tickets/Category.d.ts +0 -18
  38. package/dist/src/Tickets/Dashboard.d.ts +0 -78
  39. package/dist/src/Tickets/Dashboard.js +1 -13
  40. package/dist/src/Tickets/Fields.d.ts +0 -1
  41. package/dist/src/Tickets/Layouts.d.ts +1 -3
  42. package/dist/src/Tickets/Workflow.d.ts +0 -20
  43. package/dist/src/Users/UserTrii.d.ts +0 -10
  44. package/dist/src/Users/UserTrii.js +1 -8
  45. package/dist/src/index.d.ts +0 -3
  46. package/dist/src/index.js +1 -4
  47. package/package.json +2 -5
  48. package/dist/src/Automations/Capabilities/Capability.d.ts +0 -81
  49. package/dist/src/Automations/Capabilities/Capability.js +0 -23
  50. package/dist/src/Automations/Capabilities/index.d.ts +0 -1
  51. package/dist/src/Automations/Capabilities/index.js +0 -17
  52. package/dist/src/Automations/Common.d.ts +0 -94
  53. package/dist/src/Automations/Common.js +0 -40
  54. package/dist/src/Automations/Events/Event.d.ts +0 -69
  55. package/dist/src/Automations/Events/Event.js +0 -14
  56. package/dist/src/Automations/Events/index.d.ts +0 -1
  57. package/dist/src/Automations/Events/index.js +0 -17
  58. package/dist/src/Automations/Executions/Execution.d.ts +0 -254
  59. package/dist/src/Automations/Executions/Execution.js +0 -62
  60. package/dist/src/Automations/Executions/Testing.d.ts +0 -166
  61. package/dist/src/Automations/Executions/Testing.js +0 -54
  62. package/dist/src/Automations/Executions/index.d.ts +0 -2
  63. package/dist/src/Automations/Executions/index.js +0 -18
  64. package/dist/src/Automations/Flows/Canvas.d.ts +0 -103
  65. package/dist/src/Automations/Flows/Canvas.js +0 -38
  66. package/dist/src/Automations/Flows/Flow.d.ts +0 -147
  67. package/dist/src/Automations/Flows/Flow.js +0 -58
  68. package/dist/src/Automations/Flows/Requests.d.ts +0 -71
  69. package/dist/src/Automations/Flows/Validation.d.ts +0 -28
  70. package/dist/src/Automations/Flows/Validation.js +0 -9
  71. package/dist/src/Automations/Flows/index.d.ts +0 -4
  72. package/dist/src/Automations/Flows/index.js +0 -20
  73. package/dist/src/Automations/Nodes/Node.d.ts +0 -113
  74. package/dist/src/Automations/Nodes/Node.js +0 -27
  75. package/dist/src/Automations/Nodes/index.d.ts +0 -1
  76. package/dist/src/Automations/Nodes/index.js +0 -17
  77. package/dist/src/Automations/index.d.ts +0 -6
  78. package/dist/src/Automations/index.js +0 -22
  79. package/dist/src/Chats/Chat.d.ts +0 -61
  80. package/dist/src/Chats/Chat.js +0 -28
  81. package/dist/src/Conversations/Assignment.d.ts +0 -81
  82. package/dist/src/Conversations/Assignment.js +0 -4
  83. package/dist/src/Conversations/InboxMongo.d.ts +0 -154
  84. package/dist/src/Conversations/InboxMongo.js +0 -128
  85. package/dist/src/Conversations/InboxProjection.d.ts +0 -162
  86. package/dist/src/Conversations/InboxProjection.js +0 -2
  87. package/dist/src/Conversations/Outbox.d.ts +0 -24
  88. package/dist/src/Conversations/Outbox.js +0 -4
  89. package/dist/src/Conversations/Queue.d.ts +0 -107
  90. package/dist/src/Conversations/Queue.js +0 -4
  91. package/dist/src/Conversations/Routing.d.ts +0 -164
  92. package/dist/src/Conversations/Routing.js +0 -2
  93. package/dist/src/Conversations/Sla.d.ts +0 -227
  94. package/dist/src/Conversations/Sla.js +0 -6
  95. package/dist/src/Conversations/Transfer.d.ts +0 -73
  96. package/dist/src/Conversations/Transfer.js +0 -2
  97. package/dist/src/Forms/API.d.ts +0 -53
  98. package/dist/src/Forms/API.js +0 -2
  99. package/dist/src/Forms/SubmittedForm.d.ts +0 -56
  100. package/dist/src/Forms/SubmittedForm.js +0 -9
  101. package/dist/src/Forms/index.d.ts +0 -2
  102. package/dist/src/Forms/index.js +0 -18
  103. package/dist/src/Presence/AgentPause.d.ts +0 -24
  104. package/dist/src/Presence/AgentPause.js +0 -19
  105. package/dist/src/Presence/QueueParticipation.d.ts +0 -17
  106. package/dist/src/Presence/QueueParticipation.js +0 -2
  107. package/dist/src/Presence/QueueRoutingState.d.ts +0 -27
  108. package/dist/src/Presence/QueueRoutingState.js +0 -9
  109. package/dist/src/Presence/index.d.ts +0 -3
  110. package/dist/src/Presence/index.js +0 -19
  111. /package/dist/{src/Automations/Flows/Requests.js → Conversations/InboxCounters.js} +0 -0
@@ -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/dist/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  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.Spaces = exports.Reports = exports.Security = exports.Calls = exports.Conversations = exports.Calendar = exports.Contacts = exports.Common = exports.AuditLogs = exports.Accounts = void 0;
27
37
  exports.Accounts = __importStar(require("./Accounts/index"));
@@ -37,16 +37,6 @@ interface IChannelInfo {
37
37
  */
38
38
  status?: string;
39
39
  }
40
- /**
41
- * Fallback routing used only when no published Flow entry point matches the
42
- * channel, or when the selected Flow cannot produce a valid disposition.
43
- *
44
- * Flow-to-channel bindings remain authoritative in FlowEntryPoint.
45
- */
46
- interface ChannelConversationRoutingConfig {
47
- /** Stable id of a ConversationQueue in the same space as the channel. */
48
- defaultQueueId: string;
49
- }
50
40
  interface IChannel {
51
41
  id?: string | null;
52
42
  spaceId?: string | null;
@@ -54,30 +44,13 @@ interface IChannel {
54
44
  description?: string | null;
55
45
  type?: ChannelType | null;
56
46
  permissions?: Permission[] | null;
57
- /**
58
- * @deprecated Legacy channel assignment configuration. Use
59
- * ChannelConversationRoutingConfig; Flow bindings live in FlowEntryPoint.
60
- */
61
47
  assignTo?: ConversationAssigned;
62
- /**
63
- * @deprecated Legacy channel assignment configuration. Use
64
- * ChannelConversationRoutingConfig; QueueRoutingPolicy controls agent
65
- * distribution only after a Queue has been selected.
66
- */
67
48
  assignMethod: AssignMethod;
68
- /**
69
- * @deprecated Ownership is produced by the routing decision.
70
- */
71
49
  assignToOwner?: boolean;
72
50
  /**
73
51
  * habilita la creacion de conversaciones para este canal, si esta en false, los mensajes entrantes no generaran conversaciones
74
52
  */
75
53
  conversationsEnabled: boolean | false;
76
- /**
77
- * Default Queue for newly-created conversations that are not handled by a
78
- * Flow. Store only the Queue id;
79
- */
80
- conversationRouting?: ChannelConversationRoutingConfig | null;
81
54
  /**
82
55
  * Gets or sets a value indicating whether webhook notifications are enabled.
83
56
  * Redirects incoming messages to the specified webhook URL when set to true.
@@ -123,4 +96,4 @@ declare enum channelStatus {
123
96
  SUSPENDED = 7,
124
97
  CONFIGURATION_PENDING = 9
125
98
  }
126
- export { IChannel, IChannelInfo, ChannelConversationRoutingConfig, channelStatus, MessagingAvailability };
99
+ export { IChannel, IChannelInfo, channelStatus, MessagingAvailability };
@@ -14,7 +14,7 @@ export interface IBusiness {
14
14
  counters?: ICounters;
15
15
  name: string;
16
16
  imageUrl: string;
17
- ownerUserId?: string;
17
+ owner?: string;
18
18
  membersId: string[];
19
19
  members: IContactInfo[];
20
20
  phones: IContactAddress[];
@@ -54,7 +54,7 @@ export interface IContact {
54
54
  lastName: string;
55
55
  imageUrl: string;
56
56
  birthDate?: Date | null;
57
- ownerUserId?: string;
57
+ owner?: string;
58
58
  businessId?: string;
59
59
  businessName?: string;
60
60
  phones: IContactAddress[];