@trii/types 2.10.761 → 2.10.763

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
+ }
@@ -61,3 +61,19 @@ export interface IAssignTicketDto {
61
61
  assignedGroupId?: string;
62
62
  }
63
63
  export type TicketPage = ITicketCursorResponse<ITicket>;
64
+ /** One ticket waiting in a work queue, as listed by GET /routing/queues/{id}/work. */
65
+ export interface ITicketQueueWorkItem {
66
+ ticket: ITicket;
67
+ enqueuedAt: Date;
68
+ /** 1-based position in the queue's configured order across pages. */
69
+ position: number;
70
+ }
71
+ /** Body of GET /routing/queues/{id}/work. Only members of the queue's groups may read it. */
72
+ export type ITicketQueueWorkPage = ITicketCursorResponse<ITicketQueueWorkItem>;
73
+ /**
74
+ * Body of POST /tickets/{id}/routing/pull: an agent who belongs to one of the
75
+ * queue's groups takes a QUEUED ticket. Pulling is an implicit accept.
76
+ */
77
+ export interface IPullTicketDto {
78
+ expectedVersion: number;
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.761",
3
+ "version": "2.10.763",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",