@trii/types 2.10.685 → 2.10.687

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 (44) hide show
  1. package/dist/Common/Channels/Channel.d.ts +21 -3
  2. package/dist/Conversations/Queue.d.ts +41 -0
  3. package/dist/src/Automations/Capabilities/Capability.d.ts +48 -0
  4. package/dist/src/Automations/Capabilities/Capability.js +9 -0
  5. package/dist/src/Automations/Capabilities/index.d.ts +1 -0
  6. package/dist/src/Automations/Capabilities/index.js +17 -0
  7. package/dist/src/Automations/Common.d.ts +47 -0
  8. package/dist/src/Automations/Common.js +18 -0
  9. package/dist/src/Automations/Events/Event.d.ts +41 -0
  10. package/dist/src/Automations/Events/Event.js +2 -0
  11. package/dist/src/Automations/Events/index.d.ts +1 -0
  12. package/dist/src/Automations/Events/index.js +17 -0
  13. package/dist/src/Automations/Executions/Execution.d.ts +114 -0
  14. package/dist/src/Automations/Executions/Execution.js +23 -0
  15. package/dist/src/Automations/Executions/index.d.ts +1 -0
  16. package/dist/src/Automations/Executions/index.js +17 -0
  17. package/dist/src/Automations/Flows/Canvas.d.ts +86 -0
  18. package/dist/src/Automations/Flows/Canvas.js +34 -0
  19. package/dist/src/Automations/Flows/Flow.d.ts +102 -0
  20. package/dist/src/Automations/Flows/Flow.js +34 -0
  21. package/dist/src/Automations/Flows/Requests.d.ts +71 -0
  22. package/dist/src/Automations/Flows/Requests.js +2 -0
  23. package/dist/src/Automations/Flows/Validation.d.ts +28 -0
  24. package/dist/src/Automations/Flows/Validation.js +9 -0
  25. package/dist/src/Automations/Flows/index.d.ts +4 -0
  26. package/dist/src/Automations/Flows/index.js +20 -0
  27. package/dist/src/Automations/Nodes/Node.d.ts +75 -0
  28. package/dist/src/Automations/Nodes/Node.js +18 -0
  29. package/dist/src/Automations/Nodes/index.d.ts +1 -0
  30. package/dist/src/Automations/Nodes/index.js +17 -0
  31. package/dist/src/Automations/index.d.ts +6 -0
  32. package/dist/src/Automations/index.js +22 -0
  33. package/dist/src/Common/Channels/Channel.d.ts +17 -1
  34. package/dist/src/Conversations/Conversation.d.ts +11 -0
  35. package/dist/src/Conversations/Queue.d.ts +41 -0
  36. package/dist/src/Conversations/Sla.d.ts +227 -0
  37. package/dist/src/Conversations/Sla.js +6 -0
  38. package/dist/src/Conversations/index.d.ts +1 -0
  39. package/dist/src/Conversations/index.js +1 -0
  40. package/dist/src/Tickets/Dashboard.d.ts +17 -0
  41. package/dist/src/Tickets/Dashboard.js +13 -1
  42. package/dist/src/index.d.ts +1 -0
  43. package/dist/src/index.js +2 -1
  44. package/package.json +1 -1
@@ -0,0 +1,227 @@
1
+ import type { ISchedule } from '../Common/Schedules/Schedules';
2
+ import type { ConversationEventType, ConversationStatus, ID } from './Conversation';
3
+ import type { OutboxEvent } from './Outbox';
4
+ export declare const CONVERSATION_SLA_POLICIES_COLLECTION = "conversation_sla_policies";
5
+ export declare const CONVERSATION_SLA_CYCLES_COLLECTION = "conversation_sla_cycles";
6
+ export declare const CONVERSATION_SLA_EVENTS_COLLECTION = "conversation_sla_events";
7
+ export type ConversationSlaMetric = 'first_response' | 'next_response' | 'assignment' | 'acceptance' | 'resolution';
8
+ /**
9
+ * continuous counts natural elapsed time, including nights and holidays.
10
+ * schedule counts only ranges allowed by the referenced customer ISchedule.
11
+ */
12
+ export type ConversationSlaTimeCalculation = {
13
+ mode: 'continuous';
14
+ scheduleId?: never;
15
+ } | {
16
+ mode: 'schedule';
17
+ scheduleId: Exclude<ISchedule['id'], null>;
18
+ };
19
+ export interface ConversationSlaWarningThreshold {
20
+ id: ID;
21
+ percentage: number;
22
+ }
23
+ export interface ConversationSlaTarget {
24
+ metric: ConversationSlaMetric;
25
+ durationSeconds: number;
26
+ warningThresholds: ConversationSlaWarningThreshold[];
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
+ }
48
+ export type ConversationSlaResumeBehavior = 'continue' | 'restart' | 'recalculate';
49
+ export type ConversationSlaReopenBehavior = 'preserve' | 'restart' | 'recalculate' | 'do_not_start';
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
+ */
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
+ */
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
+ */
79
+ onReopen: ConversationSlaReopenBehavior;
80
+ }
81
+ /**
82
+ * Immutable, versioned policy referenced by ConversationQueue.sla.
83
+ * Editing a published policy creates a new version.
84
+ */
85
+ export interface ConversationSlaPolicy {
86
+ id: ID;
87
+ spaceId: ID;
88
+ name: string;
89
+ description?: string;
90
+ enabled: boolean;
91
+ version: number;
92
+ timeCalculation: ConversationSlaTimeCalculation;
93
+ targets: ConversationSlaTarget[];
94
+ clockBehavior: ConversationSlaClockBehavior;
95
+ createdAt: Date;
96
+ createdByUserId?: ID;
97
+ updatedAt: Date;
98
+ updatedByUserId?: ID;
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
+ }
140
+ export type ConversationSlaClockAction = 'start' | 'evaluate' | 'pause' | 'resume' | 'complete' | 'recalculate' | 'cancel';
141
+ export type ConversationSlaClockReason = 'conversation_created' | 'conversation_enqueued' | 'customer_message' | 'agent_response' | 'assignment_changed' | 'status_changed' | 'queue_transfer' | 'conversation_reopened' | 'deadline_due' | 'policy_override';
142
+ /**
143
+ * Idempotent input for the conversation-sla-worker.
144
+ * policyId/policyVersion identify the immutable policy snapshot to apply.
145
+ */
146
+ export interface SlaClockCommand {
147
+ commandId: ID;
148
+ sourceEventId: ID;
149
+ spaceId: ID;
150
+ conversationId: ID;
151
+ expectedConversationVersion: number;
152
+ action: ConversationSlaClockAction;
153
+ reason: ConversationSlaClockReason;
154
+ metric?: ConversationSlaMetric;
155
+ policyId: ID;
156
+ policyVersion: number;
157
+ queueId?: ID;
158
+ occurredAt: Date;
159
+ requestedAt: Date;
160
+ }
161
+ export type ConversationSlaCycleStatus = 'running' | 'paused' | 'met' | 'breached' | 'cancelled';
162
+ export interface ConversationSlaPausePeriod {
163
+ startedAt: Date;
164
+ endedAt?: Date;
165
+ reason: ConversationSlaClockReason;
166
+ sourceEventId: ID;
167
+ }
168
+ /**
169
+ * Durable metric cycle. The target and time calculation are copied from the
170
+ * selected policy version so later policy edits cannot alter active history.
171
+ */
172
+ export interface ConversationSlaCycle {
173
+ id: ID;
174
+ spaceId: ID;
175
+ conversationId: ID;
176
+ metric: ConversationSlaMetric;
177
+ sequence: number;
178
+ status: ConversationSlaCycleStatus;
179
+ policyId: ID;
180
+ policyVersion: number;
181
+ timeCalculation: ConversationSlaTimeCalculation;
182
+ target: ConversationSlaTarget;
183
+ startedAt: Date;
184
+ deadlineAt?: Date;
185
+ nextWarningAt?: Date;
186
+ pausedAt?: Date;
187
+ completedAt?: Date;
188
+ breachedAt?: Date;
189
+ cancelledAt?: Date;
190
+ elapsedSeconds: number;
191
+ pausedSeconds: number;
192
+ pausePeriods: ConversationSlaPausePeriod[];
193
+ startedByEventId: ID;
194
+ completedByEventId?: ID;
195
+ version: number;
196
+ updatedAt: Date;
197
+ }
198
+ export type ConversationSlaEventType = Extract<ConversationEventType, 'sla_started' | 'sla_paused' | 'sla_resumed' | 'sla_warning' | 'sla_breached' | 'sla_met' | 'sla_overridden'>;
199
+ /**
200
+ * Immutable SLA event. Corrections are represented by a later event.
201
+ */
202
+ export interface ConversationSlaEvent {
203
+ eventId: ID;
204
+ sourceEventId: ID;
205
+ type: ConversationSlaEventType;
206
+ schemaVersion: 1;
207
+ spaceId: ID;
208
+ conversationId: ID;
209
+ conversationVersion: number;
210
+ cycleId: ID;
211
+ metric: ConversationSlaMetric;
212
+ policyId: ID;
213
+ policyVersion: number;
214
+ status: ConversationSlaCycleStatus;
215
+ deadlineAt?: Date;
216
+ warningThresholdId?: ID;
217
+ reason: ConversationSlaClockReason;
218
+ correlationId: ID;
219
+ causationId: ID;
220
+ occurredAt: Date;
221
+ recordedAt: Date;
222
+ }
223
+ export type ConversationSlaOutboxEvent = OutboxEvent<ConversationSlaEvent> & {
224
+ aggregateType: 'conversation';
225
+ eventType: `conversation.${ConversationSlaEventType}`;
226
+ schemaVersion: 1;
227
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONVERSATION_SLA_EVENTS_COLLECTION = exports.CONVERSATION_SLA_CYCLES_COLLECTION = exports.CONVERSATION_SLA_POLICIES_COLLECTION = void 0;
4
+ exports.CONVERSATION_SLA_POLICIES_COLLECTION = 'conversation_sla_policies';
5
+ exports.CONVERSATION_SLA_CYCLES_COLLECTION = 'conversation_sla_cycles';
6
+ exports.CONVERSATION_SLA_EVENTS_COLLECTION = 'conversation_sla_events';
@@ -17,4 +17,5 @@ export * from './DashBoard/dashboardMessages';
17
17
  export * from './Survey';
18
18
  export * from './Queue';
19
19
  export * from './Routing';
20
+ export * from './Sla';
20
21
  export * from './Transfer';
@@ -56,4 +56,5 @@ __exportStar(require("./DashBoard/dashboardMessages"), exports);
56
56
  __exportStar(require("./Survey"), exports);
57
57
  __exportStar(require("./Queue"), exports);
58
58
  __exportStar(require("./Routing"), exports);
59
+ __exportStar(require("./Sla"), exports);
59
60
  __exportStar(require("./Transfer"), exports);
@@ -193,6 +193,17 @@ export declare enum TicketMetricCode {
193
193
  SECURITY_DENIAL_COUNT = "SECURITY_DENIAL_COUNT",
194
194
  PII_ACCESS_COUNT = "PII_ACCESS_COUNT"
195
195
  }
196
+ export declare enum DashboardIcon {
197
+ DASHBOARD = "DASHBOARD",
198
+ HOME = "HOME",
199
+ SUPPORT = "SUPPORT",
200
+ ANALYTICS = "ANALYTICS",
201
+ REPORTS = "REPORTS",
202
+ USERS = "USERS",
203
+ SETTINGS = "SETTINGS",
204
+ FAVORITES = "FAVORITES",
205
+ QUICK_ACTIONS = "QUICK_ACTIONS"
206
+ }
196
207
  export interface ITicketAnalyticsFilter extends ITicketFilter {
197
208
  range: ITicketDateRange;
198
209
  channelTypes?: ChannelType[];
@@ -318,6 +329,8 @@ export interface ITicketDashboard {
318
329
  refreshMode: TicketWidgetRefreshMode;
319
330
  refreshIntervalSeconds?: number;
320
331
  isDefault?: boolean;
332
+ order: number;
333
+ icon?: DashboardIcon;
321
334
  createdAt: Date;
322
335
  createdBy: string;
323
336
  updatedAt?: Date;
@@ -334,7 +347,9 @@ export interface ICreateTicketDashboardDto {
334
347
  widgets?: ITicketWidgetConfiguration[];
335
348
  refreshMode?: TicketWidgetRefreshMode;
336
349
  refreshIntervalSeconds?: number;
350
+ order?: number;
337
351
  isDefault?: boolean;
352
+ icon?: DashboardIcon;
338
353
  }
339
354
  export interface IUpdateTicketDashboardDto {
340
355
  name?: string;
@@ -347,7 +362,9 @@ export interface IUpdateTicketDashboardDto {
347
362
  widgets?: ITicketWidgetConfiguration[];
348
363
  refreshMode?: TicketWidgetRefreshMode;
349
364
  refreshIntervalSeconds?: number;
365
+ order?: number;
350
366
  isDefault?: boolean;
367
+ icon?: DashboardIcon;
351
368
  }
352
369
  export interface ITicketDashboardTemplate {
353
370
  id: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TicketMetricCode = exports.TicketDrilldownTarget = exports.TicketWidgetRefreshMode = exports.TicketMetricFormat = exports.TicketComparisonMode = exports.TicketTimeGranularity = exports.TicketAnalyticsDimension = exports.TicketMetricAggregation = exports.TicketWidgetType = exports.TicketDashboardVisibility = exports.TicketAnalyticsAudience = void 0;
3
+ exports.DashboardIcon = exports.TicketMetricCode = exports.TicketDrilldownTarget = exports.TicketWidgetRefreshMode = exports.TicketMetricFormat = exports.TicketComparisonMode = exports.TicketTimeGranularity = exports.TicketAnalyticsDimension = exports.TicketMetricAggregation = exports.TicketWidgetType = exports.TicketDashboardVisibility = exports.TicketAnalyticsAudience = void 0;
4
4
  var TicketAnalyticsAudience;
5
5
  (function (TicketAnalyticsAudience) {
6
6
  TicketAnalyticsAudience["AGENT"] = "AGENT";
@@ -204,3 +204,15 @@ var TicketMetricCode;
204
204
  TicketMetricCode["SECURITY_DENIAL_COUNT"] = "SECURITY_DENIAL_COUNT";
205
205
  TicketMetricCode["PII_ACCESS_COUNT"] = "PII_ACCESS_COUNT";
206
206
  })(TicketMetricCode || (exports.TicketMetricCode = TicketMetricCode = {}));
207
+ var DashboardIcon;
208
+ (function (DashboardIcon) {
209
+ DashboardIcon["DASHBOARD"] = "DASHBOARD";
210
+ DashboardIcon["HOME"] = "HOME";
211
+ DashboardIcon["SUPPORT"] = "SUPPORT";
212
+ DashboardIcon["ANALYTICS"] = "ANALYTICS";
213
+ DashboardIcon["REPORTS"] = "REPORTS";
214
+ DashboardIcon["USERS"] = "USERS";
215
+ DashboardIcon["SETTINGS"] = "SETTINGS";
216
+ DashboardIcon["FAVORITES"] = "FAVORITES";
217
+ DashboardIcon["QUICK_ACTIONS"] = "QUICK_ACTIONS";
218
+ })(DashboardIcon || (exports.DashboardIcon = DashboardIcon = {}));
@@ -20,3 +20,4 @@ export * as AI from './AI/index';
20
20
  export * as Shop from './Shop/index';
21
21
  export * as APIResponses from './ApiResponses/index';
22
22
  export * as Forms from './Forms/index';
23
+ export * as Automations from './Automations/index';
package/dist/src/index.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Forms = exports.APIResponses = exports.Shop = exports.AI = exports.APIKeys = 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;
36
+ exports.Automations = exports.Forms = exports.APIResponses = exports.Shop = exports.AI = exports.APIKeys = 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;
37
37
  exports.Accounts = __importStar(require("./Accounts/index"));
38
38
  exports.AuditLogs = __importStar(require("./AuditLogs/index"));
39
39
  exports.Common = __importStar(require("./Common/index"));
@@ -56,3 +56,4 @@ exports.AI = __importStar(require("./AI/index"));
56
56
  exports.Shop = __importStar(require("./Shop/index"));
57
57
  exports.APIResponses = __importStar(require("./ApiResponses/index"));
58
58
  exports.Forms = __importStar(require("./Forms/index"));
59
+ exports.Automations = __importStar(require("./Automations/index"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.685",
3
+ "version": "2.10.687",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",