@trii/types 2.10.776 → 2.10.778

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.
@@ -26,6 +26,8 @@ interface IChannelInfo {
26
26
  * Indicates if the WhatsApp business is on the WhatsApp Business App
27
27
  */
28
28
  cloudApiIsOnBizApp?: boolean | null;
29
+ /** WhatsApp Web instance configured for coexistence. */
30
+ apiqrId?: string | null;
29
31
  /**
30
32
  * ID of the channel in the external system.
31
33
  */
@@ -1,12 +1,14 @@
1
1
  import type { TransferConversationReason, TransferConversationTarget } from './Transfer';
2
2
  /** Single current handoff, not history. Keep assignment unchanged until acceptance.
3
3
  * Accept atomically with matching transferId, sourceAssignmentId and Conversation.version.
4
- * First valid acceptance wins. Reject/cancel/expire clears this state without moving source.
4
+ * First valid acceptance wins. Cancel/terminal expiry clears the state without moving source.
5
+ * An automatic offer rejection may requeue this attempt; explicit user rejection ends it.
5
6
  * Resolve authorized target audience at query time, checking expiration even before cleanup.
6
7
  */
7
8
  export interface ConversationPendingTransfer {
8
9
  transferId: string;
9
10
  sourceAssignmentId: string;
11
+ /** Effective destination; queue routing may change the selected agent or fallback queue. */
10
12
  target: TransferConversationTarget;
11
13
  /** Null for automated requests; full actor is recorded in events. */
12
14
  requestedByUserId?: string | null;
@@ -0,0 +1,77 @@
1
+ import type { IConversation } from './Conversation';
2
+ import type { ConversationAssignmentEvent } from './Assignment';
3
+ export type ConversationTransferRoutingStatus = 'waiting' | 'offered' | 'shared';
4
+ /** Server-side state, never the effective assignment. Missing state identifies a legacy transfer.
5
+ * Match transferId before using it. An offered state requires offerId and offerExpiresAt;
6
+ * clear offer fields when waiting/shared, and clear the state on terminal outcomes.
7
+ */
8
+ export interface ConversationTransferRoutingState {
9
+ transferId: string;
10
+ status: ConversationTransferRoutingStatus;
11
+ /** Queue-selected offers can retry; an explicit user destination cannot. */
12
+ automatic: boolean;
13
+ queuedAt: Date;
14
+ excludedUsers: string[];
15
+ offerId?: string | null;
16
+ offerExpiresAt?: Date | null;
17
+ /** Supervisor fallback; membership is still checked at acceptance. */
18
+ supervisorOffer?: boolean;
19
+ }
20
+ /** Persistence-only fields, deliberately separate from the public IConversation DTO.
21
+ * Notice is serialized JSON for compatibility with existing documents.
22
+ * Event and notice are saved atomically with the transition and cleared after delivery.
23
+ */
24
+ export interface ConversationTransferPersistence {
25
+ transferRouting?: ConversationTransferRoutingState | null;
26
+ transferRoutingNotice?: string | null;
27
+ transferRoutingEvent?: ConversationAssignmentEvent | null;
28
+ }
29
+ /** HTTP take-options wire response: dates are ISO-8601 UTC strings, not hydrated Date objects.
30
+ * Missing optional flags mean false. The API rechecks authorization when executing an action.
31
+ * conversationId used for client request correlation is not part of this response.
32
+ */
33
+ export interface ConversationTakeOptions {
34
+ canTake: boolean;
35
+ canReassign: boolean;
36
+ canAcceptTransfer?: boolean;
37
+ canCancelTransfer?: boolean;
38
+ transferId?: string | null;
39
+ queueName?: string | null;
40
+ ownerName?: string | null;
41
+ sourceQueueName?: string | null;
42
+ targetUserName?: string | null;
43
+ requestedAt?: string | null;
44
+ /** Total attempt deadline; not the individual offer deadline. */
45
+ expiresAt?: string | null;
46
+ transferStatus?: ConversationTransferRoutingStatus | null;
47
+ offerExpiresAt?: string | null;
48
+ version?: number | null;
49
+ }
50
+ export type ConversationAssignmentChangeStatus = 'pending' | 'accepted' | 'declined' | 'cancelled' | 'already_applied' | 'version_conflict' | 'rejected';
51
+ /** Pending-transfer HTTP command result, separate from legacy TransferConversationResult.
52
+ * The conversation, when present, is hydrated by the consumer's normal conversation mapper.
53
+ */
54
+ export interface ConversationAssignmentChangeResult {
55
+ status: ConversationAssignmentChangeStatus;
56
+ commandId: string;
57
+ /** Extensible domain rejection code. */
58
+ code?: string | null;
59
+ transferId?: string | null;
60
+ conversation?: IConversation | null;
61
+ conversationVersion?: number | null;
62
+ }
63
+ export type ConversationTransferNotificationResult = 'accepted' | 'closed' | 'transfer_expired' | 'target_queue_unavailable';
64
+ /** Data in conversation_changed, not a complete conversation.
65
+ * Hints do not grant access: validate incoming offers through take-options.
66
+ * Deduplicate by transferOfferId (legacy fallback: newTransferId); terminal notices
67
+ * use resolvedTransferId + transferResult and are shown to transferRequesterId.
68
+ */
69
+ export interface ConversationChangedNotification {
70
+ conversationId: string;
71
+ version: number;
72
+ newTransferId?: string | null;
73
+ transferOfferId?: string | null;
74
+ transferResult?: ConversationTransferNotificationResult | null;
75
+ transferRequesterId?: string | null;
76
+ resolvedTransferId?: string | null;
77
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,3 +23,4 @@ export * from './Routing';
23
23
  export * from './Sla';
24
24
  export * from './Transfer';
25
25
  export * from './Classifications';
26
+ export * from './ConversationTransferRouting';
@@ -62,3 +62,4 @@ __exportStar(require("./Routing"), exports);
62
62
  __exportStar(require("./Sla"), exports);
63
63
  __exportStar(require("./Transfer"), exports);
64
64
  __exportStar(require("./Classifications"), exports);
65
+ __exportStar(require("./ConversationTransferRouting"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.776",
3
+ "version": "2.10.778",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",