@d19n/youfibre-odin-sdk 2.0.288 → 2.0.290
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.
- package/README.md +25 -22
- package/dist/actions-v2/AssignAutoResolutionStatusDto.d.ts +73 -0
- package/dist/actions-v2/AssignAutoResolutionStatusDto.js +56 -0
- package/dist/api-sdk-v2/AgentStatusApi.d.ts +48 -0
- package/dist/api-sdk-v2/AgentStatusApi.js +155 -0
- package/dist/api-sdk-v2/AgentStatusHistoryApi.d.ts +48 -0
- package/dist/api-sdk-v2/AgentStatusHistoryApi.js +155 -0
- package/dist/api-sdk-v2/UserApi.d.ts +4 -0
- package/dist/api-sdk-v2/UserApi.js +12 -0
- package/dist/db-sdk-v2/AgentStatusDb.d.ts +120 -0
- package/dist/db-sdk-v2/AgentStatusDb.js +204 -0
- package/dist/db-sdk-v2/AgentStatusHistoryDb.d.ts +120 -0
- package/dist/db-sdk-v2/AgentStatusHistoryDb.js +204 -0
- package/dist/db-sdk-v2/UserDb.d.ts +4 -0
- package/dist/db-sdk-v2/UserDb.js +12 -0
- package/dist/entities-v2/AgentStatus.d.ts +205 -0
- package/dist/entities-v2/AgentStatus.js +164 -0
- package/dist/entities-v2/AgentStatusHistory.d.ts +205 -0
- package/dist/entities-v2/AgentStatusHistory.js +164 -0
- package/dist/entities-v2/Case.d.ts +33 -0
- package/dist/entities-v2/Case.js +22 -2
- package/dist/entities-v2/User.d.ts +6 -0
- package/dist/entities-v2/WorkOrder.d.ts +294 -0
- package/dist/entities-v2/WorkOrder.js +6 -0
- package/dist/records-v2/CaseRecord.d.ts +27 -0
- package/dist/records-v2/CaseRecord.js +29 -0
- package/package.json +1 -1
package/dist/db-sdk-v2/UserDb.js
CHANGED
|
@@ -212,6 +212,18 @@ class UserDb extends db_provider_1.DbProvider {
|
|
|
212
212
|
}
|
|
213
213
|
return this._outbounddialsession;
|
|
214
214
|
}
|
|
215
|
+
get agentstatus() {
|
|
216
|
+
if (!this._agentstatus) {
|
|
217
|
+
this._agentstatus = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'IdentityModule:User', 'SupportModule:AgentStatus', 'AgentStatus__User');
|
|
218
|
+
}
|
|
219
|
+
return this._agentstatus;
|
|
220
|
+
}
|
|
221
|
+
get agentstatushistory() {
|
|
222
|
+
if (!this._agentstatushistory) {
|
|
223
|
+
this._agentstatushistory = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'IdentityModule:User', 'SupportModule:AgentStatusHistory', 'AgentStatusHistory__User');
|
|
224
|
+
}
|
|
225
|
+
return this._agentstatushistory;
|
|
226
|
+
}
|
|
215
227
|
// ============================================
|
|
216
228
|
// STANDARD METHODS
|
|
217
229
|
// ============================================
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentStatus Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* One row per Odin user: current channel-agnostic status, when it started, previous status, voice-sync flag, and change source. Odin-native, independent of Twilio. Phase 1 POC (CASES-1729).
|
|
5
|
+
*
|
|
6
|
+
* @module SupportModule
|
|
7
|
+
* @entity AgentStatus
|
|
8
|
+
* @schemaId 047ad49d-9d2d-4005-adf8-8ba24e45e1a3
|
|
9
|
+
*
|
|
10
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
11
|
+
* Generated from Odin schema definition
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord, OdinLink, LinkedOdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
|
+
import { UserProperties } from './User';
|
|
15
|
+
/**
|
|
16
|
+
* Available types for AgentStatus records
|
|
17
|
+
*/
|
|
18
|
+
export declare enum AgentStatusEntityTypes {
|
|
19
|
+
/** This is the default record type */
|
|
20
|
+
DEFAULT = "DEFAULT"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Valid values for AgentStatus.Status
|
|
24
|
+
*
|
|
25
|
+
* Current channel-agnostic availability status. Values mirror TwilioActivity.Name.
|
|
26
|
+
*
|
|
27
|
+
* @remarks Available options:
|
|
28
|
+
* - `After call work`
|
|
29
|
+
* - `Available`
|
|
30
|
+
* - `Away`
|
|
31
|
+
* - `Back office`
|
|
32
|
+
* - `Coaching`
|
|
33
|
+
* - `Offline`
|
|
34
|
+
* - `On a break`
|
|
35
|
+
* - `On a call`
|
|
36
|
+
* - `Special task`
|
|
37
|
+
* - `Training`
|
|
38
|
+
* - `Unavailable`
|
|
39
|
+
* - `Unplanned Break`
|
|
40
|
+
*/
|
|
41
|
+
export declare enum AgentStatusStatus {
|
|
42
|
+
AFTER_CALL_WORK = "After call work",
|
|
43
|
+
AVAILABLE = "Available",
|
|
44
|
+
AWAY = "Away",
|
|
45
|
+
BACK_OFFICE = "Back office",
|
|
46
|
+
COACHING = "Coaching",
|
|
47
|
+
OFFLINE = "Offline",
|
|
48
|
+
ON_A_BREAK = "On a break",
|
|
49
|
+
ON_A_CALL = "On a call",
|
|
50
|
+
SPECIAL_TASK = "Special task",
|
|
51
|
+
TRAINING = "Training",
|
|
52
|
+
UNAVAILABLE = "Unavailable",
|
|
53
|
+
UNPLANNED_BREAK = "Unplanned Break"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Valid values for AgentStatus.PreviousStatus
|
|
57
|
+
*
|
|
58
|
+
* The status immediately before the current one. Null on a user’s first-ever status write.
|
|
59
|
+
*
|
|
60
|
+
* @remarks Available options:
|
|
61
|
+
* - `After call work`
|
|
62
|
+
* - `Available`
|
|
63
|
+
* - `Away`
|
|
64
|
+
* - `Back office`
|
|
65
|
+
* - `Coaching`
|
|
66
|
+
* - `Offline`
|
|
67
|
+
* - `On a break`
|
|
68
|
+
* - `On a call`
|
|
69
|
+
* - `Special task`
|
|
70
|
+
* - `Training`
|
|
71
|
+
* - `Unavailable`
|
|
72
|
+
* - `Unplanned Break`
|
|
73
|
+
*/
|
|
74
|
+
export declare enum AgentStatusPreviousStatus {
|
|
75
|
+
AFTER_CALL_WORK = "After call work",
|
|
76
|
+
AVAILABLE = "Available",
|
|
77
|
+
AWAY = "Away",
|
|
78
|
+
BACK_OFFICE = "Back office",
|
|
79
|
+
COACHING = "Coaching",
|
|
80
|
+
OFFLINE = "Offline",
|
|
81
|
+
ON_A_BREAK = "On a break",
|
|
82
|
+
ON_A_CALL = "On a call",
|
|
83
|
+
SPECIAL_TASK = "Special task",
|
|
84
|
+
TRAINING = "Training",
|
|
85
|
+
UNAVAILABLE = "Unavailable",
|
|
86
|
+
UNPLANNED_BREAK = "Unplanned Break"
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Valid values for AgentStatus.Source
|
|
90
|
+
*
|
|
91
|
+
* What triggered the current Status: manual agent selection, a voice/Twilio event, or a system-generated change.
|
|
92
|
+
*
|
|
93
|
+
* @remarks Available options:
|
|
94
|
+
* - `Manual` - Manual agent selection
|
|
95
|
+
* - `System` - System-generated change
|
|
96
|
+
* - `Voice` - Voice or Twilio event
|
|
97
|
+
*/
|
|
98
|
+
export declare enum AgentStatusSource {
|
|
99
|
+
MANUAL_AGENT_SELECTION = "Manual",
|
|
100
|
+
SYSTEM_GENERATED_CHANGE = "System",
|
|
101
|
+
VOICE_OR_TWILIO_EVENT = "Voice"
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Property keys for AgentStatus
|
|
105
|
+
* Use these constants instead of string literals for type safety
|
|
106
|
+
*/
|
|
107
|
+
export declare enum AgentStatusPropertyKeys {
|
|
108
|
+
/** The Odin user this status belongs to. One AgentStatus row per user (UNIQUE) — the natural key upsertOnCreate upserts against. */
|
|
109
|
+
UserId = "UserId",
|
|
110
|
+
/** Current channel-agnostic availability status. Values mirror TwilioActivity.Name. */
|
|
111
|
+
Status = "Status",
|
|
112
|
+
/** The status immediately before the current one. Null on a user’s first-ever status write. */
|
|
113
|
+
PreviousStatus = "PreviousStatus",
|
|
114
|
+
/** Whether this user’s Odin status should sync to their Twilio Worker. Phase 1: stored only, never read by any sync (no Twilio calls happen yet) — the field exists now so Phase 2 does not need a schema change to turn sync on. */
|
|
115
|
+
VoiceEnabled = "VoiceEnabled",
|
|
116
|
+
/** When the current Status began. Reset on every status change. */
|
|
117
|
+
StatusStartedAt = "StatusStartedAt",
|
|
118
|
+
/** What triggered the current Status: manual agent selection, a voice/Twilio event, or a system-generated change. */
|
|
119
|
+
Source = "Source"
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Properties for AgentStatus records
|
|
123
|
+
*
|
|
124
|
+
* @see SupportModule:AgentStatus
|
|
125
|
+
*/
|
|
126
|
+
export interface AgentStatusProperties {
|
|
127
|
+
/** The Odin user this status belongs to. One AgentStatus row per user (UNIQUE) — the natural key upsertOnCreate upserts against.
|
|
128
|
+
*
|
|
129
|
+
* @type {LOOKUP}
|
|
130
|
+
* @default
|
|
131
|
+
*/
|
|
132
|
+
UserId: string;
|
|
133
|
+
/** Current channel-agnostic availability status. Values mirror TwilioActivity.Name.
|
|
134
|
+
*
|
|
135
|
+
* @type {ENUM}
|
|
136
|
+
* @default Available
|
|
137
|
+
* @enum {AgentStatusStatus}
|
|
138
|
+
*/
|
|
139
|
+
Status: AgentStatusStatus;
|
|
140
|
+
/** The status immediately before the current one. Null on a user’s first-ever status write.
|
|
141
|
+
*
|
|
142
|
+
* @type {ENUM}
|
|
143
|
+
* @default
|
|
144
|
+
* @enum {AgentStatusPreviousStatus}
|
|
145
|
+
*/
|
|
146
|
+
PreviousStatus: AgentStatusPreviousStatus;
|
|
147
|
+
/** Whether this user’s Odin status should sync to their Twilio Worker. Phase 1: stored only, never read by any sync (no Twilio calls happen yet) — the field exists now so Phase 2 does not need a schema change to turn sync on.
|
|
148
|
+
*
|
|
149
|
+
* @type {BOOLEAN}
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
152
|
+
VoiceEnabled: boolean;
|
|
153
|
+
/** When the current Status began. Reset on every status change.
|
|
154
|
+
*
|
|
155
|
+
* @type {DATE_TIME}
|
|
156
|
+
* @default
|
|
157
|
+
*/
|
|
158
|
+
StatusStartedAt: string;
|
|
159
|
+
/** What triggered the current Status: manual agent selection, a voice/Twilio event, or a system-generated change.
|
|
160
|
+
*
|
|
161
|
+
* @type {ENUM}
|
|
162
|
+
* @default Manual
|
|
163
|
+
* @enum {AgentStatusSource}
|
|
164
|
+
*/
|
|
165
|
+
Source: AgentStatusSource;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* AgentStatus entity from SupportModule
|
|
169
|
+
*
|
|
170
|
+
* One row per Odin user: current channel-agnostic status, when it started, previous status, voice-sync flag, and change source. Odin-native, independent of Twilio. Phase 1 POC (CASES-1729).
|
|
171
|
+
*
|
|
172
|
+
* @module SupportModule
|
|
173
|
+
* @entity AgentStatus
|
|
174
|
+
* @schemaId 047ad49d-9d2d-4005-adf8-8ba24e45e1a3
|
|
175
|
+
* @recordPrefix AGST
|
|
176
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
177
|
+
*/
|
|
178
|
+
export declare class AgentStatus extends OdinRecord<AgentStatusProperties> {
|
|
179
|
+
entity: 'SupportModule:AgentStatus';
|
|
180
|
+
type: AgentStatusEntityTypes;
|
|
181
|
+
schemaId: '047ad49d-9d2d-4005-adf8-8ba24e45e1a3';
|
|
182
|
+
properties: AgentStatusProperties;
|
|
183
|
+
/** Linked User records (AgentStatus__User) */
|
|
184
|
+
User: OdinLink<LinkedOdinRecord<UserProperties>>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* RabbitMQ routing keys for AgentStatus events
|
|
188
|
+
*/
|
|
189
|
+
export declare const ROUTING_KEY_AGENT_STATUS_CREATED = "SupportModule.AgentStatus.SubDbRecordCreated";
|
|
190
|
+
export declare const ROUTING_KEY_AGENT_STATUS_UPDATED = "SupportModule.AgentStatus.SubDbRecordUpdated";
|
|
191
|
+
export declare const ROUTING_KEY_AGENT_STATUS_DELETED = "SupportModule.AgentStatus.SubDbRecordDeleted";
|
|
192
|
+
/**
|
|
193
|
+
* Type-specific routing keys for AgentStatus events
|
|
194
|
+
* Subscribe to these for events on specific entity types only
|
|
195
|
+
*/
|
|
196
|
+
/** This is the default record type created */
|
|
197
|
+
export declare const ROUTING_KEY_AGENT_STATUS_DEFAULT_CREATED = "SupportModule.AgentStatus.DEFAULT.SubDbRecordCreated";
|
|
198
|
+
/** This is the default record type updated */
|
|
199
|
+
export declare const ROUTING_KEY_AGENT_STATUS_DEFAULT_UPDATED = "SupportModule.AgentStatus.DEFAULT.SubDbRecordUpdated";
|
|
200
|
+
/** This is the default record type deleted */
|
|
201
|
+
export declare const ROUTING_KEY_AGENT_STATUS_DEFAULT_DELETED = "SupportModule.AgentStatus.DEFAULT.SubDbRecordDeleted";
|
|
202
|
+
/** Event: AgentStatus__User link created */
|
|
203
|
+
export declare const ROUTING_KEY_LINK_AGENT_STATUS_USER_CREATED = "SupportModule.AgentStatus.User.SubDbRecordAssociationCreated";
|
|
204
|
+
/** Event: AgentStatus__User link deleted */
|
|
205
|
+
export declare const ROUTING_KEY_LINK_AGENT_STATUS_USER_DELETED = "SupportModule.AgentStatus.User.SubDbRecordAssociationDeleted";
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AgentStatus Entity Definition
|
|
4
|
+
*
|
|
5
|
+
* One row per Odin user: current channel-agnostic status, when it started, previous status, voice-sync flag, and change source. Odin-native, independent of Twilio. Phase 1 POC (CASES-1729).
|
|
6
|
+
*
|
|
7
|
+
* @module SupportModule
|
|
8
|
+
* @entity AgentStatus
|
|
9
|
+
* @schemaId 047ad49d-9d2d-4005-adf8-8ba24e45e1a3
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
* Generated from Odin schema definition
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ROUTING_KEY_LINK_AGENT_STATUS_USER_DELETED = exports.ROUTING_KEY_LINK_AGENT_STATUS_USER_CREATED = exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_DELETED = exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_UPDATED = exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_CREATED = exports.ROUTING_KEY_AGENT_STATUS_DELETED = exports.ROUTING_KEY_AGENT_STATUS_UPDATED = exports.ROUTING_KEY_AGENT_STATUS_CREATED = exports.AgentStatus = exports.AgentStatusPropertyKeys = exports.AgentStatusSource = exports.AgentStatusPreviousStatus = exports.AgentStatusStatus = exports.AgentStatusEntityTypes = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Available types for AgentStatus records
|
|
19
|
+
*/
|
|
20
|
+
var AgentStatusEntityTypes;
|
|
21
|
+
(function (AgentStatusEntityTypes) {
|
|
22
|
+
/** This is the default record type */
|
|
23
|
+
AgentStatusEntityTypes["DEFAULT"] = "DEFAULT";
|
|
24
|
+
})(AgentStatusEntityTypes = exports.AgentStatusEntityTypes || (exports.AgentStatusEntityTypes = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Valid values for AgentStatus.Status
|
|
27
|
+
*
|
|
28
|
+
* Current channel-agnostic availability status. Values mirror TwilioActivity.Name.
|
|
29
|
+
*
|
|
30
|
+
* @remarks Available options:
|
|
31
|
+
* - `After call work`
|
|
32
|
+
* - `Available`
|
|
33
|
+
* - `Away`
|
|
34
|
+
* - `Back office`
|
|
35
|
+
* - `Coaching`
|
|
36
|
+
* - `Offline`
|
|
37
|
+
* - `On a break`
|
|
38
|
+
* - `On a call`
|
|
39
|
+
* - `Special task`
|
|
40
|
+
* - `Training`
|
|
41
|
+
* - `Unavailable`
|
|
42
|
+
* - `Unplanned Break`
|
|
43
|
+
*/
|
|
44
|
+
var AgentStatusStatus;
|
|
45
|
+
(function (AgentStatusStatus) {
|
|
46
|
+
AgentStatusStatus["AFTER_CALL_WORK"] = "After call work";
|
|
47
|
+
AgentStatusStatus["AVAILABLE"] = "Available";
|
|
48
|
+
AgentStatusStatus["AWAY"] = "Away";
|
|
49
|
+
AgentStatusStatus["BACK_OFFICE"] = "Back office";
|
|
50
|
+
AgentStatusStatus["COACHING"] = "Coaching";
|
|
51
|
+
AgentStatusStatus["OFFLINE"] = "Offline";
|
|
52
|
+
AgentStatusStatus["ON_A_BREAK"] = "On a break";
|
|
53
|
+
AgentStatusStatus["ON_A_CALL"] = "On a call";
|
|
54
|
+
AgentStatusStatus["SPECIAL_TASK"] = "Special task";
|
|
55
|
+
AgentStatusStatus["TRAINING"] = "Training";
|
|
56
|
+
AgentStatusStatus["UNAVAILABLE"] = "Unavailable";
|
|
57
|
+
AgentStatusStatus["UNPLANNED_BREAK"] = "Unplanned Break";
|
|
58
|
+
})(AgentStatusStatus = exports.AgentStatusStatus || (exports.AgentStatusStatus = {}));
|
|
59
|
+
/**
|
|
60
|
+
* Valid values for AgentStatus.PreviousStatus
|
|
61
|
+
*
|
|
62
|
+
* The status immediately before the current one. Null on a user’s first-ever status write.
|
|
63
|
+
*
|
|
64
|
+
* @remarks Available options:
|
|
65
|
+
* - `After call work`
|
|
66
|
+
* - `Available`
|
|
67
|
+
* - `Away`
|
|
68
|
+
* - `Back office`
|
|
69
|
+
* - `Coaching`
|
|
70
|
+
* - `Offline`
|
|
71
|
+
* - `On a break`
|
|
72
|
+
* - `On a call`
|
|
73
|
+
* - `Special task`
|
|
74
|
+
* - `Training`
|
|
75
|
+
* - `Unavailable`
|
|
76
|
+
* - `Unplanned Break`
|
|
77
|
+
*/
|
|
78
|
+
var AgentStatusPreviousStatus;
|
|
79
|
+
(function (AgentStatusPreviousStatus) {
|
|
80
|
+
AgentStatusPreviousStatus["AFTER_CALL_WORK"] = "After call work";
|
|
81
|
+
AgentStatusPreviousStatus["AVAILABLE"] = "Available";
|
|
82
|
+
AgentStatusPreviousStatus["AWAY"] = "Away";
|
|
83
|
+
AgentStatusPreviousStatus["BACK_OFFICE"] = "Back office";
|
|
84
|
+
AgentStatusPreviousStatus["COACHING"] = "Coaching";
|
|
85
|
+
AgentStatusPreviousStatus["OFFLINE"] = "Offline";
|
|
86
|
+
AgentStatusPreviousStatus["ON_A_BREAK"] = "On a break";
|
|
87
|
+
AgentStatusPreviousStatus["ON_A_CALL"] = "On a call";
|
|
88
|
+
AgentStatusPreviousStatus["SPECIAL_TASK"] = "Special task";
|
|
89
|
+
AgentStatusPreviousStatus["TRAINING"] = "Training";
|
|
90
|
+
AgentStatusPreviousStatus["UNAVAILABLE"] = "Unavailable";
|
|
91
|
+
AgentStatusPreviousStatus["UNPLANNED_BREAK"] = "Unplanned Break";
|
|
92
|
+
})(AgentStatusPreviousStatus = exports.AgentStatusPreviousStatus || (exports.AgentStatusPreviousStatus = {}));
|
|
93
|
+
/**
|
|
94
|
+
* Valid values for AgentStatus.Source
|
|
95
|
+
*
|
|
96
|
+
* What triggered the current Status: manual agent selection, a voice/Twilio event, or a system-generated change.
|
|
97
|
+
*
|
|
98
|
+
* @remarks Available options:
|
|
99
|
+
* - `Manual` - Manual agent selection
|
|
100
|
+
* - `System` - System-generated change
|
|
101
|
+
* - `Voice` - Voice or Twilio event
|
|
102
|
+
*/
|
|
103
|
+
var AgentStatusSource;
|
|
104
|
+
(function (AgentStatusSource) {
|
|
105
|
+
AgentStatusSource["MANUAL_AGENT_SELECTION"] = "Manual";
|
|
106
|
+
AgentStatusSource["SYSTEM_GENERATED_CHANGE"] = "System";
|
|
107
|
+
AgentStatusSource["VOICE_OR_TWILIO_EVENT"] = "Voice";
|
|
108
|
+
})(AgentStatusSource = exports.AgentStatusSource || (exports.AgentStatusSource = {}));
|
|
109
|
+
/**
|
|
110
|
+
* Property keys for AgentStatus
|
|
111
|
+
* Use these constants instead of string literals for type safety
|
|
112
|
+
*/
|
|
113
|
+
var AgentStatusPropertyKeys;
|
|
114
|
+
(function (AgentStatusPropertyKeys) {
|
|
115
|
+
/** The Odin user this status belongs to. One AgentStatus row per user (UNIQUE) — the natural key upsertOnCreate upserts against. */
|
|
116
|
+
AgentStatusPropertyKeys["UserId"] = "UserId";
|
|
117
|
+
/** Current channel-agnostic availability status. Values mirror TwilioActivity.Name. */
|
|
118
|
+
AgentStatusPropertyKeys["Status"] = "Status";
|
|
119
|
+
/** The status immediately before the current one. Null on a user’s first-ever status write. */
|
|
120
|
+
AgentStatusPropertyKeys["PreviousStatus"] = "PreviousStatus";
|
|
121
|
+
/** Whether this user’s Odin status should sync to their Twilio Worker. Phase 1: stored only, never read by any sync (no Twilio calls happen yet) — the field exists now so Phase 2 does not need a schema change to turn sync on. */
|
|
122
|
+
AgentStatusPropertyKeys["VoiceEnabled"] = "VoiceEnabled";
|
|
123
|
+
/** When the current Status began. Reset on every status change. */
|
|
124
|
+
AgentStatusPropertyKeys["StatusStartedAt"] = "StatusStartedAt";
|
|
125
|
+
/** What triggered the current Status: manual agent selection, a voice/Twilio event, or a system-generated change. */
|
|
126
|
+
AgentStatusPropertyKeys["Source"] = "Source";
|
|
127
|
+
})(AgentStatusPropertyKeys = exports.AgentStatusPropertyKeys || (exports.AgentStatusPropertyKeys = {}));
|
|
128
|
+
/**
|
|
129
|
+
* AgentStatus entity from SupportModule
|
|
130
|
+
*
|
|
131
|
+
* One row per Odin user: current channel-agnostic status, when it started, previous status, voice-sync flag, and change source. Odin-native, independent of Twilio. Phase 1 POC (CASES-1729).
|
|
132
|
+
*
|
|
133
|
+
* @module SupportModule
|
|
134
|
+
* @entity AgentStatus
|
|
135
|
+
* @schemaId 047ad49d-9d2d-4005-adf8-8ba24e45e1a3
|
|
136
|
+
* @recordPrefix AGST
|
|
137
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
138
|
+
*/
|
|
139
|
+
class AgentStatus extends core_1.OdinRecord {
|
|
140
|
+
}
|
|
141
|
+
exports.AgentStatus = AgentStatus;
|
|
142
|
+
// ============================================
|
|
143
|
+
// RABBITMQ EVENT ROUTING KEYS
|
|
144
|
+
// ============================================
|
|
145
|
+
/**
|
|
146
|
+
* RabbitMQ routing keys for AgentStatus events
|
|
147
|
+
*/
|
|
148
|
+
exports.ROUTING_KEY_AGENT_STATUS_CREATED = 'SupportModule.AgentStatus.SubDbRecordCreated';
|
|
149
|
+
exports.ROUTING_KEY_AGENT_STATUS_UPDATED = 'SupportModule.AgentStatus.SubDbRecordUpdated';
|
|
150
|
+
exports.ROUTING_KEY_AGENT_STATUS_DELETED = 'SupportModule.AgentStatus.SubDbRecordDeleted';
|
|
151
|
+
/**
|
|
152
|
+
* Type-specific routing keys for AgentStatus events
|
|
153
|
+
* Subscribe to these for events on specific entity types only
|
|
154
|
+
*/
|
|
155
|
+
/** This is the default record type created */
|
|
156
|
+
exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_CREATED = 'SupportModule.AgentStatus.DEFAULT.SubDbRecordCreated';
|
|
157
|
+
/** This is the default record type updated */
|
|
158
|
+
exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_UPDATED = 'SupportModule.AgentStatus.DEFAULT.SubDbRecordUpdated';
|
|
159
|
+
/** This is the default record type deleted */
|
|
160
|
+
exports.ROUTING_KEY_AGENT_STATUS_DEFAULT_DELETED = 'SupportModule.AgentStatus.DEFAULT.SubDbRecordDeleted';
|
|
161
|
+
/** Event: AgentStatus__User link created */
|
|
162
|
+
exports.ROUTING_KEY_LINK_AGENT_STATUS_USER_CREATED = 'SupportModule.AgentStatus.User.SubDbRecordAssociationCreated';
|
|
163
|
+
/** Event: AgentStatus__User link deleted */
|
|
164
|
+
exports.ROUTING_KEY_LINK_AGENT_STATUS_USER_DELETED = 'SupportModule.AgentStatus.User.SubDbRecordAssociationDeleted';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentStatusHistory Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* Append-only log of agent status transitions: one row per change (from, to, when, source, time spent in the previous status). Never updated after create. Phase 1 POC (CASES-1729).
|
|
5
|
+
*
|
|
6
|
+
* @module SupportModule
|
|
7
|
+
* @entity AgentStatusHistory
|
|
8
|
+
* @schemaId bab18158-d61c-42bf-b05d-22f606c951a2
|
|
9
|
+
*
|
|
10
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
11
|
+
* Generated from Odin schema definition
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord, OdinLink, LinkedOdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
|
+
import { UserProperties } from './User';
|
|
15
|
+
/**
|
|
16
|
+
* Available types for AgentStatusHistory records
|
|
17
|
+
*/
|
|
18
|
+
export declare enum AgentStatusHistoryEntityTypes {
|
|
19
|
+
/** This is the default record type */
|
|
20
|
+
DEFAULT = "DEFAULT"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Valid values for AgentStatusHistory.ToStatus
|
|
24
|
+
*
|
|
25
|
+
* Status this transition moved the agent into.
|
|
26
|
+
*
|
|
27
|
+
* @remarks Available options:
|
|
28
|
+
* - `After call work`
|
|
29
|
+
* - `Available`
|
|
30
|
+
* - `Away`
|
|
31
|
+
* - `Back office`
|
|
32
|
+
* - `Coaching`
|
|
33
|
+
* - `Offline`
|
|
34
|
+
* - `On a break`
|
|
35
|
+
* - `On a call`
|
|
36
|
+
* - `Special task`
|
|
37
|
+
* - `Training`
|
|
38
|
+
* - `Unavailable`
|
|
39
|
+
* - `Unplanned Break`
|
|
40
|
+
*/
|
|
41
|
+
export declare enum AgentStatusHistoryToStatus {
|
|
42
|
+
AFTER_CALL_WORK = "After call work",
|
|
43
|
+
AVAILABLE = "Available",
|
|
44
|
+
AWAY = "Away",
|
|
45
|
+
BACK_OFFICE = "Back office",
|
|
46
|
+
COACHING = "Coaching",
|
|
47
|
+
OFFLINE = "Offline",
|
|
48
|
+
ON_A_BREAK = "On a break",
|
|
49
|
+
ON_A_CALL = "On a call",
|
|
50
|
+
SPECIAL_TASK = "Special task",
|
|
51
|
+
TRAINING = "Training",
|
|
52
|
+
UNAVAILABLE = "Unavailable",
|
|
53
|
+
UNPLANNED_BREAK = "Unplanned Break"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Valid values for AgentStatusHistory.Source
|
|
57
|
+
*
|
|
58
|
+
* What triggered this transition: manual agent selection, a voice/Twilio event, or a system-generated change.
|
|
59
|
+
*
|
|
60
|
+
* @remarks Available options:
|
|
61
|
+
* - `Manual` - Manual agent selection
|
|
62
|
+
* - `System` - System-generated change
|
|
63
|
+
* - `Voice` - Voice or Twilio event
|
|
64
|
+
*/
|
|
65
|
+
export declare enum AgentStatusHistorySource {
|
|
66
|
+
MANUAL_AGENT_SELECTION = "Manual",
|
|
67
|
+
SYSTEM_GENERATED_CHANGE = "System",
|
|
68
|
+
VOICE_OR_TWILIO_EVENT = "Voice"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Valid values for AgentStatusHistory.FromStatus
|
|
72
|
+
*
|
|
73
|
+
* Status before this transition. Empty on a user’s very first history row.
|
|
74
|
+
*
|
|
75
|
+
* @remarks Available options:
|
|
76
|
+
* - `After call work`
|
|
77
|
+
* - `Available`
|
|
78
|
+
* - `Away`
|
|
79
|
+
* - `Back office`
|
|
80
|
+
* - `Coaching`
|
|
81
|
+
* - `Offline`
|
|
82
|
+
* - `On a break`
|
|
83
|
+
* - `On a call`
|
|
84
|
+
* - `Special task`
|
|
85
|
+
* - `Training`
|
|
86
|
+
* - `Unavailable`
|
|
87
|
+
* - `Unplanned Break`
|
|
88
|
+
*/
|
|
89
|
+
export declare enum AgentStatusHistoryFromStatus {
|
|
90
|
+
AFTER_CALL_WORK = "After call work",
|
|
91
|
+
AVAILABLE = "Available",
|
|
92
|
+
AWAY = "Away",
|
|
93
|
+
BACK_OFFICE = "Back office",
|
|
94
|
+
COACHING = "Coaching",
|
|
95
|
+
OFFLINE = "Offline",
|
|
96
|
+
ON_A_BREAK = "On a break",
|
|
97
|
+
ON_A_CALL = "On a call",
|
|
98
|
+
SPECIAL_TASK = "Special task",
|
|
99
|
+
TRAINING = "Training",
|
|
100
|
+
UNAVAILABLE = "Unavailable",
|
|
101
|
+
UNPLANNED_BREAK = "Unplanned Break"
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Property keys for AgentStatusHistory
|
|
105
|
+
* Use these constants instead of string literals for type safety
|
|
106
|
+
*/
|
|
107
|
+
export declare enum AgentStatusHistoryPropertyKeys {
|
|
108
|
+
/** Status this transition moved the agent into. */
|
|
109
|
+
ToStatus = "ToStatus",
|
|
110
|
+
/** What triggered this transition: manual agent selection, a voice/Twilio event, or a system-generated change. */
|
|
111
|
+
Source = "Source",
|
|
112
|
+
/** Status before this transition. Empty on a user’s very first history row. */
|
|
113
|
+
FromStatus = "FromStatus",
|
|
114
|
+
/** The Odin user this transition belongs to. */
|
|
115
|
+
UserId = "UserId",
|
|
116
|
+
/** When this transition happened. */
|
|
117
|
+
ChangedAt = "ChangedAt",
|
|
118
|
+
/** How long the agent spent in FromStatus, in seconds. Empty on the first-ever transition (no prior status to measure). */
|
|
119
|
+
DurationInPreviousStatusSeconds = "DurationInPreviousStatusSeconds"
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Properties for AgentStatusHistory records
|
|
123
|
+
*
|
|
124
|
+
* @see SupportModule:AgentStatusHistory
|
|
125
|
+
*/
|
|
126
|
+
export interface AgentStatusHistoryProperties {
|
|
127
|
+
/** Status this transition moved the agent into.
|
|
128
|
+
*
|
|
129
|
+
* @type {ENUM}
|
|
130
|
+
* @default
|
|
131
|
+
* @enum {AgentStatusHistoryToStatus}
|
|
132
|
+
*/
|
|
133
|
+
ToStatus: AgentStatusHistoryToStatus;
|
|
134
|
+
/** What triggered this transition: manual agent selection, a voice/Twilio event, or a system-generated change.
|
|
135
|
+
*
|
|
136
|
+
* @type {ENUM}
|
|
137
|
+
* @default Manual
|
|
138
|
+
* @enum {AgentStatusHistorySource}
|
|
139
|
+
*/
|
|
140
|
+
Source: AgentStatusHistorySource;
|
|
141
|
+
/** Status before this transition. Empty on a user’s very first history row.
|
|
142
|
+
*
|
|
143
|
+
* @type {ENUM}
|
|
144
|
+
* @default
|
|
145
|
+
* @enum {AgentStatusHistoryFromStatus}
|
|
146
|
+
*/
|
|
147
|
+
FromStatus: AgentStatusHistoryFromStatus;
|
|
148
|
+
/** The Odin user this transition belongs to.
|
|
149
|
+
*
|
|
150
|
+
* @type {LOOKUP}
|
|
151
|
+
* @default
|
|
152
|
+
*/
|
|
153
|
+
UserId: string;
|
|
154
|
+
/** When this transition happened.
|
|
155
|
+
*
|
|
156
|
+
* @type {DATE_TIME}
|
|
157
|
+
* @default
|
|
158
|
+
*/
|
|
159
|
+
ChangedAt: string;
|
|
160
|
+
/** How long the agent spent in FromStatus, in seconds. Empty on the first-ever transition (no prior status to measure).
|
|
161
|
+
*
|
|
162
|
+
* @type {NUMBER}
|
|
163
|
+
* @default
|
|
164
|
+
*/
|
|
165
|
+
DurationInPreviousStatusSeconds: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* AgentStatusHistory entity from SupportModule
|
|
169
|
+
*
|
|
170
|
+
* Append-only log of agent status transitions: one row per change (from, to, when, source, time spent in the previous status). Never updated after create. Phase 1 POC (CASES-1729).
|
|
171
|
+
*
|
|
172
|
+
* @module SupportModule
|
|
173
|
+
* @entity AgentStatusHistory
|
|
174
|
+
* @schemaId bab18158-d61c-42bf-b05d-22f606c951a2
|
|
175
|
+
* @recordPrefix AGSH
|
|
176
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
177
|
+
*/
|
|
178
|
+
export declare class AgentStatusHistory extends OdinRecord<AgentStatusHistoryProperties> {
|
|
179
|
+
entity: 'SupportModule:AgentStatusHistory';
|
|
180
|
+
type: AgentStatusHistoryEntityTypes;
|
|
181
|
+
schemaId: 'bab18158-d61c-42bf-b05d-22f606c951a2';
|
|
182
|
+
properties: AgentStatusHistoryProperties;
|
|
183
|
+
/** Linked User records (AgentStatusHistory__User) */
|
|
184
|
+
User: OdinLink<LinkedOdinRecord<UserProperties>>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* RabbitMQ routing keys for AgentStatusHistory events
|
|
188
|
+
*/
|
|
189
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_CREATED = "SupportModule.AgentStatusHistory.SubDbRecordCreated";
|
|
190
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_UPDATED = "SupportModule.AgentStatusHistory.SubDbRecordUpdated";
|
|
191
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_DELETED = "SupportModule.AgentStatusHistory.SubDbRecordDeleted";
|
|
192
|
+
/**
|
|
193
|
+
* Type-specific routing keys for AgentStatusHistory events
|
|
194
|
+
* Subscribe to these for events on specific entity types only
|
|
195
|
+
*/
|
|
196
|
+
/** This is the default record type created */
|
|
197
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_DEFAULT_CREATED = "SupportModule.AgentStatusHistory.DEFAULT.SubDbRecordCreated";
|
|
198
|
+
/** This is the default record type updated */
|
|
199
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_DEFAULT_UPDATED = "SupportModule.AgentStatusHistory.DEFAULT.SubDbRecordUpdated";
|
|
200
|
+
/** This is the default record type deleted */
|
|
201
|
+
export declare const ROUTING_KEY_AGENT_STATUS_HISTORY_DEFAULT_DELETED = "SupportModule.AgentStatusHistory.DEFAULT.SubDbRecordDeleted";
|
|
202
|
+
/** Event: AgentStatusHistory__User link created */
|
|
203
|
+
export declare const ROUTING_KEY_LINK_AGENT_STATUS_HISTORY_USER_CREATED = "SupportModule.AgentStatusHistory.User.SubDbRecordAssociationCreated";
|
|
204
|
+
/** Event: AgentStatusHistory__User link deleted */
|
|
205
|
+
export declare const ROUTING_KEY_LINK_AGENT_STATUS_HISTORY_USER_DELETED = "SupportModule.AgentStatusHistory.User.SubDbRecordAssociationDeleted";
|