@skippr/live-agent-sdk 0.38.0 → 0.39.0
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/dist/esm/lib-exports.js
CHANGED
|
@@ -542,14 +542,31 @@ var DOM_EVENTS_TOPIC = "skippr.dom-events";
|
|
|
542
542
|
var HIGHLIGHT_TOPIC = "skippr.highlight";
|
|
543
543
|
var NAME_MAX_CHARS = 80;
|
|
544
544
|
|
|
545
|
+
// src/lib/agentMode.ts
|
|
546
|
+
var AGENT_MODE = {
|
|
547
|
+
Standard: "standard",
|
|
548
|
+
AlwaysOn: "always_on"
|
|
549
|
+
};
|
|
550
|
+
var AGENT_MODES = Object.values(AGENT_MODE);
|
|
551
|
+
|
|
552
|
+
// src/lib/sessionStatus.ts
|
|
553
|
+
var SESSION_STATUS = {
|
|
554
|
+
pending: "pending",
|
|
555
|
+
active: "active",
|
|
556
|
+
paused: "paused",
|
|
557
|
+
completed: "completed",
|
|
558
|
+
expired: "expired"
|
|
559
|
+
};
|
|
560
|
+
var SESSION_STATUSES = Object.values(SESSION_STATUS);
|
|
561
|
+
|
|
545
562
|
// src/lib/session.ts
|
|
546
563
|
function getResumableSessionId(currentSession, mode) {
|
|
547
564
|
if (!currentSession)
|
|
548
565
|
return;
|
|
549
566
|
const { id, status } = currentSession;
|
|
550
|
-
if (status ===
|
|
567
|
+
if (status === SESSION_STATUS.paused || status === SESSION_STATUS.active)
|
|
551
568
|
return id;
|
|
552
|
-
if (mode ===
|
|
569
|
+
if (mode === AGENT_MODE.AlwaysOn && (status === SESSION_STATUS.expired || status === SESSION_STATUS.completed))
|
|
553
570
|
return id;
|
|
554
571
|
return;
|
|
555
572
|
}
|
|
@@ -567,11 +584,11 @@ function getModuleSessionState(currentSession, mode) {
|
|
|
567
584
|
return null;
|
|
568
585
|
if (canResumeSession(currentSession, mode))
|
|
569
586
|
return "resume";
|
|
570
|
-
if (mode ===
|
|
587
|
+
if (mode === AGENT_MODE.Standard) {
|
|
571
588
|
const { status } = currentSession;
|
|
572
|
-
if (status ===
|
|
589
|
+
if (status === SESSION_STATUS.completed)
|
|
573
590
|
return "completed";
|
|
574
|
-
if (status ===
|
|
591
|
+
if (status === SESSION_STATUS.expired)
|
|
575
592
|
return "expired";
|
|
576
593
|
}
|
|
577
594
|
return null;
|
|
@@ -3681,7 +3698,7 @@ function Sidebar({
|
|
|
3681
3698
|
const internalCtx = useContextValue(LiveAgentContext);
|
|
3682
3699
|
const usesHostAuth = internalCtx?.usesHostAuth ?? false;
|
|
3683
3700
|
const authFailed = internalCtx?.authFailed ?? false;
|
|
3684
|
-
const showAgenda = agentMode !==
|
|
3701
|
+
const showAgenda = agentMode !== AGENT_MODE.AlwaysOn;
|
|
3685
3702
|
const isFloating = variant === "floating";
|
|
3686
3703
|
const isSidebar = variant === "sidebar";
|
|
3687
3704
|
useEffect16(() => {
|
|
@@ -4241,6 +4258,10 @@ export {
|
|
|
4241
4258
|
useAgentVoiceState,
|
|
4242
4259
|
parseNumber,
|
|
4243
4260
|
formatTime,
|
|
4261
|
+
SESSION_STATUSES,
|
|
4262
|
+
SESSION_STATUS,
|
|
4244
4263
|
SCREEN_SHARE_OPTIONS,
|
|
4245
|
-
LiveAgent
|
|
4264
|
+
LiveAgent,
|
|
4265
|
+
AGENT_MODES,
|
|
4266
|
+
AGENT_MODE
|
|
4246
4267
|
};
|