@trii/types 2.10.680 → 2.10.682
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.
|
@@ -4,10 +4,13 @@ import { GroupInfo } from "./Groups/Group";
|
|
|
4
4
|
import { Channels } from "../Common/index";
|
|
5
5
|
import { IContactAddress, IContactInfo } from "../Contacts/contacts";
|
|
6
6
|
import { IEnding } from "./Ending";
|
|
7
|
+
import { ChatType } from "../Chats/Chat";
|
|
7
8
|
export interface IConversation {
|
|
8
9
|
id: string;
|
|
9
10
|
spaceId: string;
|
|
10
11
|
version: number;
|
|
12
|
+
/** @deprecated Use assignment.owner. */
|
|
13
|
+
type: ChatType;
|
|
11
14
|
/**only for Front-End */
|
|
12
15
|
chatName: string;
|
|
13
16
|
chatImage: string;
|
|
@@ -21,6 +24,8 @@ export interface IConversation {
|
|
|
21
24
|
status: ConversationStatus;
|
|
22
25
|
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
23
26
|
assignment: ConversationAssignmentSnapshot;
|
|
27
|
+
/** @deprecated Use owner and assignment.*/
|
|
28
|
+
assignedTo?: ConversationAssigned;
|
|
24
29
|
sla: {
|
|
25
30
|
status: 'none' | 'running' | 'warning' | 'breached' | 'met';
|
|
26
31
|
deadlineAt?: Date;
|
|
@@ -36,7 +41,13 @@ export interface IConversation {
|
|
|
36
41
|
lastAgentActivityAt?: Date;
|
|
37
42
|
labels: ILabel[];
|
|
38
43
|
pinned: boolean;
|
|
44
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
45
|
+
transferBy?: string;
|
|
46
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
47
|
+
transferTo?: ConversationAssigned;
|
|
39
48
|
expired: boolean;
|
|
49
|
+
/** @deprecated Expiration does not own a separate assignment snapshot.*/
|
|
50
|
+
expiredAssignedTo: ConversationAssigned;
|
|
40
51
|
participants: UserInfo[];
|
|
41
52
|
archived: boolean;
|
|
42
53
|
spam: boolean;
|
|
@@ -25,11 +25,57 @@ export interface ConversationSlaTarget {
|
|
|
25
25
|
durationSeconds: number;
|
|
26
26
|
warningThresholds: ConversationSlaWarningThreshold[];
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Threshold received by the SLA policy write API.
|
|
30
|
+
*
|
|
31
|
+
* Existing thresholds keep their id. New thresholds may omit it so the
|
|
32
|
+
* backend can assign the canonical identifier returned in
|
|
33
|
+
* ConversationSlaPolicy.
|
|
34
|
+
*/
|
|
35
|
+
export interface ConversationSlaWarningThresholdInput {
|
|
36
|
+
id?: ID;
|
|
37
|
+
percentage: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Target received by the SLA policy write API.
|
|
41
|
+
* durationSeconds is stored as seconds regardless of the unit used by the UI.
|
|
42
|
+
*/
|
|
43
|
+
export interface ConversationSlaTargetInput {
|
|
44
|
+
metric: ConversationSlaMetric;
|
|
45
|
+
durationSeconds: number;
|
|
46
|
+
warningThresholds: ConversationSlaWarningThresholdInput[];
|
|
47
|
+
}
|
|
28
48
|
export type ConversationSlaResumeBehavior = 'continue' | 'restart' | 'recalculate';
|
|
29
49
|
export type ConversationSlaReopenBehavior = 'preserve' | 'restart' | 'recalculate' | 'do_not_start';
|
|
30
50
|
export interface ConversationSlaClockBehavior {
|
|
51
|
+
/**
|
|
52
|
+
* Conversation statuses that pause every running SLA cycle.
|
|
53
|
+
*
|
|
54
|
+
* Entering one of these statuses pauses the clock. Leaving all of them
|
|
55
|
+
* resumes it according to onResume. An empty array means that conversation
|
|
56
|
+
* status changes never pause the SLA clock.
|
|
57
|
+
*/
|
|
31
58
|
pauseOnStatuses: ConversationStatus[];
|
|
59
|
+
/**
|
|
60
|
+
* Behavior applied when the conversation leaves the last status included
|
|
61
|
+
* in pauseOnStatuses.
|
|
62
|
+
*
|
|
63
|
+
* continue: keeps the current cycle and its consumed/remaining time.
|
|
64
|
+
* restart: resets the current cycle from the resume timestamp.
|
|
65
|
+
* recalculate: keeps the applied policy snapshot and recalculates the
|
|
66
|
+
* schedule-derived warnings/deadline. It does not select another policy
|
|
67
|
+
* version.
|
|
68
|
+
*/
|
|
32
69
|
onResume: ConversationSlaResumeBehavior;
|
|
70
|
+
/**
|
|
71
|
+
* Behavior applied when a resolved/finalized conversation is reopened.
|
|
72
|
+
* Reopening is independent from resuming a status-paused clock.
|
|
73
|
+
*
|
|
74
|
+
* preserve: preserves the previous cycle state.
|
|
75
|
+
* restart: starts a new cycle from the reopen timestamp.
|
|
76
|
+
* recalculate: recalculates the cycle using the applied policy snapshot.
|
|
77
|
+
* do_not_start: does not start an SLA cycle because of the reopen action.
|
|
78
|
+
*/
|
|
33
79
|
onReopen: ConversationSlaReopenBehavior;
|
|
34
80
|
}
|
|
35
81
|
/**
|
|
@@ -51,6 +97,46 @@ export interface ConversationSlaPolicy {
|
|
|
51
97
|
updatedAt: Date;
|
|
52
98
|
updatedByUserId?: ID;
|
|
53
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Editable definition sent by clients.
|
|
102
|
+
*
|
|
103
|
+
* It intentionally excludes policy id/version and audit fields controlled by
|
|
104
|
+
* the backend. targets is full-replacement: omitted metrics are disabled in
|
|
105
|
+
* the newly published policy version.
|
|
106
|
+
*/
|
|
107
|
+
export interface ConversationSlaPolicyDefinitionInput {
|
|
108
|
+
name: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
timeCalculation: ConversationSlaTimeCalculation;
|
|
112
|
+
targets: ConversationSlaTargetInput[];
|
|
113
|
+
clockBehavior: ConversationSlaClockBehavior;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates the first immutable version of an SLA policy.
|
|
117
|
+
*
|
|
118
|
+
* commandId provides idempotency for retries. The authenticated backend
|
|
119
|
+
* context supplies createdByUserId and the audit timestamps.
|
|
120
|
+
*/
|
|
121
|
+
export interface CreateConversationSlaPolicyRequest {
|
|
122
|
+
commandId: ID;
|
|
123
|
+
spaceId: ID;
|
|
124
|
+
definition: ConversationSlaPolicyDefinitionInput;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Publishes a new immutable version of an existing SLA policy.
|
|
128
|
+
*
|
|
129
|
+
* expectedVersion implements optimistic concurrency. The backend rejects the
|
|
130
|
+
* request when another version was published after the client loaded it.
|
|
131
|
+
* version, updatedAt and updatedByUserId are always assigned by the backend.
|
|
132
|
+
*/
|
|
133
|
+
export interface PublishConversationSlaPolicyVersionRequest {
|
|
134
|
+
commandId: ID;
|
|
135
|
+
spaceId: ID;
|
|
136
|
+
policyId: ID;
|
|
137
|
+
expectedVersion: number;
|
|
138
|
+
definition: ConversationSlaPolicyDefinitionInput;
|
|
139
|
+
}
|
|
54
140
|
export type ConversationSlaClockAction = 'start' | 'evaluate' | 'pause' | 'resume' | 'complete' | 'recalculate' | 'cancel';
|
|
55
141
|
export type ConversationSlaClockReason = 'conversation_created' | 'conversation_enqueued' | 'customer_message' | 'agent_response' | 'assignment_changed' | 'status_changed' | 'queue_transfer' | 'conversation_reopened' | 'deadline_due' | 'policy_override';
|
|
56
142
|
/**
|