@trii/types 2.10.764 → 2.10.765

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.
@@ -11,6 +11,7 @@ import { IEnding } from "./Ending";
11
11
  import { ChatType } from "../Chats/Chat";
12
12
  import { TransferConversationCommand, TransferConversationResult } from "./Transfer";
13
13
  import { AcceptConversationAssignmentCommand, AcceptConversationAssignmentResult, DeclineConversationAssignmentCommand, DeclineConversationAssignmentResult, CancelConversationAssignmentCommand, CancelConversationAssignmentResult } from "./Assignment";
14
+ import { InboxPaginationSort, InboxSortDirection } from "./InboxQueries";
14
15
  export interface IConversation {
15
16
  id: string;
16
17
  spaceId: string;
@@ -387,9 +388,8 @@ export interface InboxFilterDto {
387
388
  to?: Date;
388
389
  };
389
390
  sort: {
390
- type: 'activity';
391
- } | {
392
- type: 'priority';
391
+ type: InboxPaginationSort;
392
+ direction?: InboxSortDirection;
393
393
  };
394
394
  }
395
395
  export interface InboxFacetOptionDto {
@@ -1,23 +1,33 @@
1
- import type { ID, InboxViewId, InboxFilterDto } from './Conversation';
2
- export type InboxPaginationSort = 'activity' | 'priority';
1
+ import type { ID, InboxViewId, InboxFilterDto, IConversation, ConversationStatus, InteractionKind } from './Conversation';
2
+ export type InboxPaginationSort = 'activity' | 'priority' | 'created';
3
+ export type InboxSortDirection = 'asc' | 'desc';
3
4
  /** Cursor over current authorized conversations, after filtering.
4
5
  * Bind to tenant/user/view/filter/sort; live updates may move rows between pages.
5
6
  */
6
7
  export interface InboxActivityCursor {
7
8
  sort: 'activity';
9
+ direction?: InboxSortDirection;
8
10
  pinned: boolean;
9
11
  lastActivityAt: Date;
10
12
  conversationId: ID;
11
13
  }
12
14
  export interface InboxPriorityCursor {
13
15
  sort: 'priority';
16
+ direction?: InboxSortDirection;
14
17
  pinned: boolean;
15
18
  /** Explicit rank urgent > high > normal > low, not lexical order. */
16
19
  priority: 'low' | 'normal' | 'high' | 'urgent';
17
20
  lastActivityAt: Date;
18
21
  conversationId: ID;
19
22
  }
20
- export type InboxPaginationCursor = InboxActivityCursor | InboxPriorityCursor;
23
+ export interface InboxCreatedCursor {
24
+ sort: 'created';
25
+ direction?: InboxSortDirection;
26
+ pinned: boolean;
27
+ createdAt: Date;
28
+ conversationId: ID;
29
+ }
30
+ export type InboxPaginationCursor = InboxActivityCursor | InboxPriorityCursor | InboxCreatedCursor;
21
31
  export interface InboxPageQuery {
22
32
  /** Trusted server context, not client authorization claims. */
23
33
  spaceId: ID;
@@ -28,3 +38,63 @@ export interface InboxPageQuery {
28
38
  /** Must match filter.sort. */
29
39
  cursor?: InboxPaginationCursor | null;
30
40
  }
41
+ /** Complete authorized personal lists for local-first inbox navigation. */
42
+ export interface PersonalInboxSnapshot {
43
+ schemaVersion: 1;
44
+ generatedAt: string;
45
+ snapshotId: string;
46
+ views: PersonalInboxMembership;
47
+ items: PersonalInboxItem[];
48
+ }
49
+ export interface PersonalInboxMembership {
50
+ pending: ID[];
51
+ following: ID[];
52
+ }
53
+ export interface PersonalInboxItem {
54
+ id: ID;
55
+ version: number;
56
+ chatName: string;
57
+ contactName: string | null;
58
+ contactId: ID | null;
59
+ contactIsBusiness: boolean | null;
60
+ chatImage: string | null;
61
+ channelType: string;
62
+ channelName: string | null;
63
+ status: ConversationStatus;
64
+ priority: IConversation['priority'];
65
+ lastMessagePreview: string;
66
+ lastMessageId: ID | null;
67
+ wallRootCommentId: ID | null;
68
+ lastActivityAt: string;
69
+ createdAt: string;
70
+ pinned: boolean;
71
+ requiresAction: boolean;
72
+ unreadCount: number;
73
+ isUnread: boolean;
74
+ readState: IConversation['readState'];
75
+ slaStatus: IConversation['sla']['status'];
76
+ slaDeadlineAt: string | null;
77
+ queueId: ID | null;
78
+ ownerUserId: ID | null;
79
+ ownerName: string | null;
80
+ ownerAvatarUrl: string | null;
81
+ interactionKind: InteractionKind;
82
+ participants: {
83
+ id: ID;
84
+ name: string;
85
+ imageUrl: string | null;
86
+ }[];
87
+ labels: {
88
+ id: ID;
89
+ name: string | null;
90
+ color: string | null;
91
+ }[];
92
+ }
93
+ export interface ResolvePersonalInboxItemsRequest {
94
+ conversationIds: ID[];
95
+ }
96
+ export interface ResolvedPersonalInboxItems {
97
+ views: PersonalInboxMembership;
98
+ items: PersonalInboxItem[];
99
+ removedIds: ID[];
100
+ }
@@ -50,13 +50,13 @@ export declare const RegionInfo: {
50
50
  Value: number;
51
51
  DisplayName: string;
52
52
  RegionalDisplayName: string;
53
- } | null;
53
+ };
54
54
  getInfo_from_Value: (Value: number) => {
55
55
  Name: string;
56
56
  Value: number;
57
57
  DisplayName: string;
58
58
  RegionalDisplayName: string;
59
- } | null;
59
+ };
60
60
  };
61
61
  export interface ISpace {
62
62
  id: string;
@@ -25,6 +25,8 @@ export declare enum TicketAutomationTrigger {
25
25
  TICKET_RESOLVED = "TICKET_RESOLVED",
26
26
  /** The ticket entered a work queue or moved to another one. */
27
27
  TICKET_ENQUEUED = "TICKET_ENQUEUED",
28
+ /** A step of an escalation policy ran on the ticket. */
29
+ TICKET_ESCALATED = "TICKET_ESCALATED",
28
30
  SCHEDULED = "SCHEDULED",
29
31
  MANUAL = "MANUAL"
30
32
  }
@@ -27,6 +27,8 @@ var TicketAutomationTrigger;
27
27
  TicketAutomationTrigger["TICKET_RESOLVED"] = "TICKET_RESOLVED";
28
28
  /** The ticket entered a work queue or moved to another one. */
29
29
  TicketAutomationTrigger["TICKET_ENQUEUED"] = "TICKET_ENQUEUED";
30
+ /** A step of an escalation policy ran on the ticket. */
31
+ TicketAutomationTrigger["TICKET_ESCALATED"] = "TICKET_ESCALATED";
30
32
  TicketAutomationTrigger["SCHEDULED"] = "SCHEDULED";
31
33
  TicketAutomationTrigger["MANUAL"] = "MANUAL";
32
34
  })(TicketAutomationTrigger || (exports.TicketAutomationTrigger = TicketAutomationTrigger = {}));
@@ -147,6 +147,12 @@ export interface ITicketQueue extends ITicketAuditedEntity {
147
147
  strategy: TicketRoutingStrategy;
148
148
  ordering: ITicketQueueOrder[];
149
149
  skillRequirements?: ITicketSkillRequirement[];
150
+ /**
151
+ * How long a ticket may wait in this queue before `escalationPolicyId` starts:
152
+ * escalation starts at the ticket's enqueue time + this value (0 = as soon as it
153
+ * waits). Without it the queue never escalates. Pulling or assigning the ticket
154
+ * stops the clock; re-enqueueing restarts it. Wall-clock minutes (no calendar).
155
+ */
150
156
  maximumWaitMinutes?: number;
151
157
  escalationPolicyId?: string;
152
158
  }
@@ -175,8 +181,11 @@ export interface ITicketEscalationStep {
175
181
  id: string;
176
182
  order: number;
177
183
  trigger: TicketEscalationTrigger;
184
+ /** Minutes after the escalation started (see ITicketQueue.maximumWaitMinutes) until the first run. Default 0. */
178
185
  thresholdMinutes?: number;
186
+ /** Runs again every N minutes after the first one. Without it the step runs once. */
179
187
  repeatEveryMinutes?: number;
188
+ /** Cap on runs per stay in the queue (a re-enqueue starts a new stay). */
180
189
  maximumExecutions?: number;
181
190
  actions: ITicketEscalationAction[];
182
191
  }
@@ -94,7 +94,9 @@ export declare enum TicketActivityType {
94
94
  CHECKLIST_COMPLETED = "CHECKLIST_COMPLETED",
95
95
  TICKET_EVENT = "TICKET_EVENT",
96
96
  /** The ticket entered a work queue or moved to another one (`changes` carries `queueId`). */
97
- ENQUEUED = "ENQUEUED"
97
+ ENQUEUED = "ENQUEUED",
98
+ /** A step of an escalation policy ran on the ticket (`changes` carries what its actions changed). */
99
+ ESCALATED = "ESCALATED"
98
100
  }
99
101
  export interface ITicketFieldChange {
100
102
  fieldNameKey: string;
@@ -43,4 +43,6 @@ var TicketActivityType;
43
43
  TicketActivityType["TICKET_EVENT"] = "TICKET_EVENT";
44
44
  /** The ticket entered a work queue or moved to another one (`changes` carries `queueId`). */
45
45
  TicketActivityType["ENQUEUED"] = "ENQUEUED";
46
+ /** A step of an escalation policy ran on the ticket (`changes` carries what its actions changed). */
47
+ TicketActivityType["ESCALATED"] = "ESCALATED";
46
48
  })(TicketActivityType || (exports.TicketActivityType = TicketActivityType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.764",
3
+ "version": "2.10.765",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",